diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3341773 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,354 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) +INCLUDE(CMakeDependentOption) + +#qiu +PROJECT(SalomeMCCAD C CXX) #qiu + +SET(CMAKE_BUILD_TYPE Release) +# Ensure a proper linker behavior: +CMAKE_POLICY(SET CMP0003 NEW) + +# Versioning +# =========== +# Project name, upper case +STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) + +SET(${PROJECT_NAME_UC}_MAJOR_VERSION 0)#qiu +SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)#qiu +SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) +SET(${PROJECT_NAME_UC}_VERSION + ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) +SET(${PROJECT_NAME_UC}_VERSION_DEV 0) + +# Find KERNEL +# =========== +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") +IF(EXISTS ${KERNEL_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") + INCLUDE(SalomeMacros) + FIND_PACKAGE(SalomeKERNEL REQUIRED) + KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA + ADD_DEFINITIONS(${KERNEL_DEFINITIONS}) + INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS}) +ELSE(EXISTS ${KERNEL_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR") +ENDIF(EXISTS ${KERNEL_ROOT_DIR}) + +# Platform setup +# ============== +INCLUDE(SalomeSetupPlatform) # From KERNEL +# Always build libraries as shared objects: +SET(BUILD_SHARED_LIBS TRUE) +# Local macros: +LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") + +# User options +# ============ +#OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) + + +# Prerequisites +# ============= +# Find "big" prerequisites first - they reference themselves many others +# -> this can help finding the smaller prerequisites and detect conficts. +# In our case KERNEL has already loaded many prereq: + +## +## From KERNEL: +## + +# Various +FIND_PACKAGE(SalomePython REQUIRED) +FIND_PACKAGE(SalomePThread REQUIRED) +FIND_PACKAGE(SalomeSWIG REQUIRED) +FIND_PACKAGE(SalomeBoost REQUIRED) +FIND_PACKAGE(SalomeOmniORB REQUIRED) +FIND_PACKAGE(SalomeOmniORBPy REQUIRED) +FIND_PACKAGE(SalomeLibXml2 REQUIRED) +FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C) + + +# Find GUI (optional) +#qiu IF(SALOME_BUILD_GUI) + SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI") + IF(EXISTS ${GUI_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(SalomeGUI) + FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA + ADD_DEFINITIONS(${GUI_DEFINITIONS}) + INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS}) + ELSE(EXISTS ${GUI_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR") + ENDIF(EXISTS ${GUI_ROOT_DIR}) + SALOME_LOG_OPTIONAL_PACKAGE(SalomeGUI SALOME_BUILD_GUI) +#qiu ENDIF(SALOME_BUILD_GUI) + +## +## Prerequisites From GUI: +## + +#qiu IF(SALOME_BUILD_GUI) + + # Qt4 + FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml) + INCLUDE(${QT_USE_FILE}) + + MESSAGE ("QTLibsFind: ${QT_LIBRARIES}") + + # Optional prerequisites for GUI + IF(SALOME_USE_GLVIEWER) + FIND_PACKAGE(SalomeOpenGL) + SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER) + ENDIF() +#qiu ENDIF(SALOME_BUILD_GUI) + +## +## MCCAD specifics +## + +FIND_PACKAGE(SalomeCAS REQUIRED) +FIND_PACKAGE(SalomeVTK REQUIRED)#qiu +INCLUDE(${VTK_USE_FILE}) + +# Find MED +# =========== +SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "Path to the Salome MED") +IF(EXISTS ${MED_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(SalomeMED REQUIRED) + FIND_PACKAGE(SalomeMEDFile REQUIRED) + ADD_DEFINITIONS(${MED_DEFINITIONS}) + INCLUDE_DIRECTORIES(${MED_INCLUDE_DIRS}) +ELSE(EXISTS ${MED_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome MED, please define MED_ROOT_DIR") +ENDIF(EXISTS ${MED_ROOT_DIR}) +# Find GEOM +# =========== +SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the Salome GEOM") +IF(EXISTS ${GEOM_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${GEOM_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(SalomeGEOM REQUIRED) + ADD_DEFINITIONS(${GEOM_DEFINITIONS}) + INCLUDE_DIRECTORIES(${GEOM_INCLUDE_DIRS}) +ELSE(EXISTS ${GEOM_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome GEOM, please define GEOM_ROOT_DIR") +ENDIF(EXISTS ${GEOM_ROOT_DIR}) +# Find SMESH +# =========== +SET(SMESH_ROOT_DIR $ENV{SMESH_ROOT_DIR} CACHE PATH "Path to the Salome SMESH") +IF(EXISTS ${SMESH_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${SMESH_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(SalomeSMESH REQUIRED) + ADD_DEFINITIONS(${SMESH_DEFINITIONS}) + INCLUDE_DIRECTORIES(${SMESH_INCLUDE_DIRS}) +ELSE(EXISTS ${SMESH_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome SMESH, please define SMESH_ROOT_DIR") +ENDIF(EXISTS ${SMESH_ROOT_DIR}) + +## Find TETGEN +## =========== +#SET(TETGEN_ROOT_DIR $ENV{TETGEN_ROOT_DIR} CACHE PATH "Path to the Salome TETGEN") +#IF(EXISTS ${TETGEN_ROOT_DIR}) +# LIST(APPEND CMAKE_MODULE_PATH "${TETGEN_ROOT_DIR}/adm_local/cmake_files") +# FIND_PACKAGE(TETGEN REQUIRED) +# ADD_DEFINITIONS(${TETGEN_DEFINITIONS}) +# INCLUDE_DIRECTORIES(${TETGEN_INCLUDE_DIRS}) +#ELSE(EXISTS ${TETGEN_ROOT_DIR}) +# MESSAGE(WARNING "We absolutely need a TETGEN, please define TETGEN_ROOT_DIR") +#ENDIF(EXISTS ${TETGEN_ROOT_DIR}) + + +# Find NETGEN +# =========== +SET(NETGEN_ROOT_DIR $ENV{NETGEN_ROOT_DIR} CACHE PATH "Path to the Salome NETGEN") +IF(EXISTS ${NETGEN_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${NETGEN_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(Netgen REQUIRED) + ADD_DEFINITIONS(${NETGEN_DEFINITIONS}) + INCLUDE_DIRECTORIES(${NETGEN_INCLUDE_DIRS}) +ELSE(EXISTS ${NETGEN_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a NETGEN, please define NETGEN_ROOT_DIR") +ENDIF(EXISTS ${NETGEN_ROOT_DIR}) + +#qiu FIND_PACKAGE(McCad REQUIRED) + + + +# Detection summary: +SALOME_PACKAGE_REPORT_AND_CHECK() + +# Directories +# (default values taken from KERNEL) +# =========== +SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries") +SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs") +SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files") +SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers") +SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH + "Install path: SALOME scripts") +SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH + "Install path: SALOME script data") +SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH + "Install path: SALOME Python scripts") +SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff") +SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH + "Install path: SALOME Python shared modules") +SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: SALOME CMake files") +SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH + "Install path: local SALOME CMake files") +SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH + "Install path: local SALOME config files (obsolete, to be removed)") + +SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources") +SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation") + + + +SET(SALOME_MCCAD_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/mccad" CACHE PATH + "Install path: SALOME MCCAD specific data") +SET(SALOME_MCCAD_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/mccad" CACHE PATH + "Install path: SALOME MCCAD scripts") + + +MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS) +MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON) +MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES) +MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) +#qiu MARK_AS_ADVANCED(SALOME_GEOM_INSTALL_RES_DATA SALOME_GEOM_INSTALL_RES_SCRIPTS SALOME_GEOM_INSTALL_PLUGINS) +MARK_AS_ADVANCED(SALOME_MCCAD_INSTALL_RES_DATA SALOME_MCCAD_INSTALL_RES_SCRIPTS) +MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC) + +# Accumulate environment variables for MCCAD module +SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}) +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) + +# Sources +# ======== +ADD_SUBDIRECTORY(idl) + +ADD_SUBDIRECTORY(adm_local) +ADD_SUBDIRECTORY(resources) +ADD_SUBDIRECTORY(bin) +ADD_SUBDIRECTORY(src) + + +# Header configuration +# ==================== +SALOME_XVERSION(${PROJECT_NAME}) +SALOME_CONFIGURE_FILE(MCCAD_version.h.in MCCAD_version.h INSTALL ${SALOME_INSTALL_HEADERS}) + +# Configuration export +# (here only the level 1 prerequisites are exposed) +# ==================== +INCLUDE(CMakePackageConfigHelpers) + +# List of targets in this project we want to make visible to the rest of the world. +# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" + +SET(_${PROJECT_NAME}_exposed_targets + MCCADEngine + SalomeIDLMCCAD + MCCAD +#qiu compile as one library to avoid million of linking issue. + TKMcCad + Tetgen +# TKMcCadAEV +# TKMcCadBoolExp +# TKMcCadCom +# TKMcCadConvertTools +# TKMcCadCSG +# TKMcCadCSGBuild +# TKMcCadCSGGeom +# TKMcCadCSGUtil +# TKMcCadDiscDs +# TKMcCadDiscretization +# TKMcCadEXPlug +# TKMcCadGTOOL +# TKMcCadGUI +# TKMcCadIOHelper +# TKMcCadIOTools +# TKMcCadMcRead +# TKMcCadMcVoid +# TKMcCadMcWrite +# TKMcCadMDReader +# TKMcCadMessenger +# TKMcCadTDS +##qiu move this library to McCadCom +# TKMcCadTool +# TKMcCadXCAF +##qiu comment-out this library because McCad GUI is not used anymore +## TKMcCadViewTool +# TKQMcCadMessenger +##qiu comment-out this library because McCad GUI is not used anymore +## TKQMcCadTools +# TKMcCadExBRep +# TKMcCadExIges +# TKMcCadExStep +# TKMcCadExMcnp +# TKMcCadExTripoli + ) + + + +# Add all targets to the build-tree export set +EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} + FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake) + +# Create the configuration files: +# - in the build tree: + +# Ensure the variables are always defined for the configure: +SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}") +SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}") +SET(CAS_ROOT_DIR "${CAS_ROOT_DIR}") +SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}") + +SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") + +# Build variables that will be expanded when configuring SalomeConfig.cmake: +SALOME_CONFIGURE_PREPARE(CAS VTK) + + +CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in + ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" + PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX + KERNEL_ROOT_DIR GUI_ROOT_DIR CAS_ROOT_DIR VTK_ROOT_DIR )#qiu OPENCV_ROOT_DIR + +# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): +# Get the relative path of the include directory so +# we can register it in the generated configuration files: +# +WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + VERSION ${${PROJECT_NAME_UC}_VERSION} + COMPATIBILITY AnyNewerVersion) + +# Install the CMake configuration files: +INSTALL(FILES + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}") + +# Install the export set for use with the install-tree +INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" + FILE ${PROJECT_NAME}Targets.cmake) diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/LICENCE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/MCCAD_version.h b/MCCAD_version.h new file mode 100644 index 0000000..6ecb359 --- /dev/null +++ b/MCCAD_version.h @@ -0,0 +1,32 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org + +#if !defined(__MCCAD_VERSION_H__) +#define __MCCAD_VERSION_H__ + +/* + MCCAD_VERSION is (major << 16) + (minor << 8) + patch. +*/ + +#define MCCAD_VERSION_STR "0.5.0" +#define MCCAD_VERSION 0x000300 + +#endif // __MCCAD_VERSION_H__ diff --git a/MCCAD_version.h.in b/MCCAD_version.h.in new file mode 100644 index 0000000..334bbfb --- /dev/null +++ b/MCCAD_version.h.in @@ -0,0 +1,32 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org + +#if !defined(__MCCAD_VERSION_H__) +#define __MCCAD_VERSION_H__ + +/* + MCCAD_VERSION is (major << 16) + (minor << 8) + patch. +*/ + +#define MCCAD_VERSION_STR "@VERSION@" +#define MCCAD_VERSION @XVERSION@ + +#endif // __MCCAD_VERSION_H__ diff --git a/README.md b/README.md new file mode 100644 index 0000000..66fe9dc --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +************************************************************************************** +McCad-Salome: MC geometry conversion tool McCad under Salome platform + +McCad is a geometry conversion tool developed at KIT to enable the automatic conversions of CAD models into the Monte Carlo (MC) geometries. This version of McCad is integrated into the open-source Salome platform. + +For any questions related to the use of this software/library you may contact Ulrich Fischer(ulrich.fischer@kit.edu) or, for technical assistance, contact Lei Lu (lei.lu@kit.edu) and Yuefeng Qiu (yuefeng.qiu@kit.edu). +************************************************************************************** + + +It is not necessary to compile McCad in order to use it, because we provided also precompiled McCad binaries. You can find them in repository "McCad-Salome-Binaries". Compile it only if you cannot find precompiled McCad binaries, or you are going to change the source code. + +This release is tested under Salome_7.4.0. Using other Salome version is not guarantee to work, and might cause error during this process. + +************************************************************************************** +********Compilation and installation on Linux system******** + + +***Installing Salome platform*** +-> Download Salome_7.4.0 platform from http://www.salome-platform.org/downloads/previous-versions/salome-v7.4.0 . + +-----> Under the list "Binaries for officially supported Linux platforms", Choose the version which is closest to your OS. + +----->You need to register for downloading Salome. + +-> Extract the zip file into a folder, then go into this folder and run the script "runInstall". A install wizard window will come out. + +-> Click always "Next", and keep the default value if you don't care. + +-----> If you like, you can change the installation folder; + +-----> If you want to save disk space, choose only these module : KERNEL, GUI, MED, GEOM, SMESH, PARAVIS. + +-----> There might be warnings on "cppunit" libraries and so on, it won't affect the use of Salome. + +-> We abbreviate the Salome install folder as $SALOME + + +***Compiling McCad *** + +-> Download this package, unzip and rename it as "MCCAD_SRC_0.5.0", place it under $SALOME. + +-> We need to add MCCAD package into the Salome environment for compiling it. In the following changes, back-up those file before changing them. + + -> Open $SALOME/build.sh (or $SALOME/build.sh), find line 32, and add "MCCAD" into the list. At the end it looks like: def_modules="${def_modules} RANDOMIZER SIERPINSKY ATOMIC ATOMGEN ATOMSOLV DOCUMENTATION MCCAD" + -> Add the following environment variables to the end of $SALOME/env_build.sh (if you are using csh, then $SALOME/env_build.csh) + +#------ MCCAD ------ +export MCCAD_ROOT_DIR=${INST_ROOT}/MCCAD_0.5.0 +if [ -n "${ENV_FOR_LAUNCH}" ] ; then + if [ "${ENV_FOR_LAUNCH}" = "1" ] ; then + exportp PATH ${MCCAD_ROOT_DIR}/bin/salome + exportp LD_LIBRARY_PATH ${MCCAD_ROOT_DIR}/lib/salome + exportp PYTHONPATH ${MCCAD_ROOT_DIR}/bin/salome:${MCCAD_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome + fi +fi +## +#------ MCCAD_src ------ +export MCCAD_SRC_DIR=${INST_ROOT}/MCCAD_SRC_0.5.0 + +-> Go to $SALOME, run the following command to compile McCad: + ./build.sh MCCAD + +-> After the compilation, You can find the binaries in $SALOME/INSTALL/MCCAD_0.5.0. Copy this folder "MCCAD_0.5.0" to $SALOME folder. + + +***Installing and running McCad *** + +-> Be sure that your $SALOME/MCCAD_0.5.0 folder have following folders: + -> bin + -> lib + -> share + -> adm_local + -> idl + -> include + +-> Open $SALOME/KERNEL_7.4.0/salome.sh, add the following environment variables into this file. + +#------ MCCAD ------ +export MCCAD_ROOT_DIR=${INST_ROOT}/MCCAD_0.5.0 +if [ -n "${ENV_FOR_LAUNCH}" ] ; then + if [ "${ENV_FOR_LAUNCH}" = "1" ] ; then + exportp PATH ${MCCAD_ROOT_DIR}/bin/salome + exportp LD_LIBRARY_PATH ${MCCAD_ROOT_DIR}/lib/salome + exportp PYTHONPATH ${MCCAD_ROOT_DIR}/bin/salome:${MCCAD_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome + fi +fi +## +#------ MCCAD_src ------ +export MCCAD_SRC_DIR=${INST_ROOT}/MCCAD_SRC_0.5.0 + +-> In your desktop, create a new file "runSalome.sh" and put following text into this file(replacing $SALOME with actual path!!): + +#!/bin/bash +source $SALOME/KERNEL_7.4.0/salome.sh +$SALOME/salome_appli_7.4.0/salome --module=GEOM,SMESH,PARAVIS,MCCAD + +-> Under Desktop, make this file as executable script using this command: + chmod +x ./runSalome.sh + +->You can run McCad-Salome with running this script now. + +************************************************************************************** +********Compilation and installation on Windows system******** + +ATTENTION: In this following step you need to have Visual Studio 2010. Without it or with other version of Visual Studio will failed in following steps. + +***Installing Salome platform*** + +-> Download Salome_7.4.0 platform from http://www.salome-platform.org/downloads/previous-versions/salome-v7.4.0 . + ->The version you need is "SALOME SDK self-extracting archive for 64bits Windows". + ->You need to register for downloading Salome. + +-> Extract the Package into a folder, here brief as $SALOME (be sure to replace it with actual path during installation). + +-> Open cmd.exe from Windows Start menu, change folder to $SALOME\WORK, and execute "compile.bat". Please take a coffee, because it takes hours. When the compilation finished, Salome platform will be ready. + +***Compiling McCad*** + +-> Download the McCad-Salome package, unzip it. + +-> In $SALOME\MODULES, Create a folder "MCCAD", put the source code inside, and rename the source code folder as "MCCAD_SRC" + + +-> We need to add McCad into the Salome environment. First make a backup of file $SALOME\WORK\set_env.bat + +----->in line 55, add "MCCAD" into the "list" (add it anywhere inside the parenthesis, separate with at least one whitespace) + +----->in line 81, add "GUI GEOM MED SMESH PARAVIS MCCAD" into "env_m_list"(add them inside the parenthesis, separate with at least one whitespace). + +-> In file $SALOME\WORK\compile.py, add the following line to line 35 + + all_modules.append('MCCAD') + +-> Open cmd.exe from Windows Start menu, change folder to $SALOME\WORK, and execute command: + + compile.bat MCCAD + +-> The compilation will finished in a few minutes. + +***Installing and using McCad*** + +-> To run McCad, start cmd.exe in the Windows Start menu, and run the following command: + +----->$SALOME\WORK\run_salome.bat --module=MCCAD + +----->If you want to start also geometry, meshing and visualization module, using command: $SALOME\WORK\run_salome.bat --module=GEOM,SMESH,PARAVIS,MCCAD + +-> One more easy way to run the program is: + +----->right-click $SALOME\WORK\run_salome.bat and "Send to -> Desktop (short-cut)"; + +----->right-click the short-cut link in the Desktop, choose "properties"; + +----->Behind the value of "Target", add " --module=MCCAD" or " + --module=GEOM,SMESH,PARAVIS,MCCAD"(with a whitespace in the front). Click "OK". Next time you can start McCad with this short-cut link. + + + +************************************************************************************** +For more information, you can find in our publications. + +->Yuefeng Qiu, Lei Lu, Ulrich Fischer, Integrated approach for fusion multi-physics coupled analyses based on hybrid CAD and mesh geometries, Fusion Engineering and Design, Available online 4 July 2015, ISSN 0920-3796, http://dx.doi.org/10.1016/j.fusengdes.2015.06.118. + +->L. Lu, U. Fischer, P. Pereslavtsev, Improved algorithms and advanced features of the CAD to MC conversion tool McCad, Fusion Engineering and Design, Volume 89, Issues 9–10, October 2014, Pages 1885-1888, ISSN 0920-3796, http://dx.doi.org/10.1016/j.fusengdes.2014.05.015. + + +Have fun! + + + + + + + diff --git a/SalomeMCCADConfig.cmake.in b/SalomeMCCADConfig.cmake.in new file mode 100644 index 0000000..5fe96ec --- /dev/null +++ b/SalomeMCCADConfig.cmake.in @@ -0,0 +1,115 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +# - Config file for the @PROJECT_NAME@ package +# It defines the following variables. +# Specific to the pacakge @PROJECT_NAME@ itself: +# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file +# + +### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE: +@PACKAGE_INIT@ + +# Load the dependencies for the libraries of @PROJECT_NAME@ +# (contains definitions for IMPORTED targets). This is only +# imported if we are not built as a subproject (in this case targets are already there) +IF(NOT @PROJECT_NAME@_BINARY_DIR) + INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake") +ENDIF() + +# Package root dir: + +SET_AND_CHECK(MCCAD_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") + +# Include directories + +SET_AND_CHECK(MCCAD_INCLUDE_DIRS "${MCCAD_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") +SET(MCCAD_INCLUDE_DIRS "${MCCAD_INCLUDE_DIRS};@_SalomeMCCAD_EXTRA_HEADERS@") +SET(MCCAD_DEFINITIONS "@KERNEL_DEFINITIONS@") + +# Package specific environment variables +@_SalomeMCCAD_EXTRA_ENV_FULL@ + +#### Now the specificities + + +# Level 1 prerequisites: +SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@") +SET_AND_CHECK(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@") +SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@") + + +SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@") +LIST(APPEND MCCAD_DEFINITIONS "@GUI_DEFINITIONS@") + + +# For all prerequisites, load the corresponding targets if the package was used +# in CONFIG mode. This ensures dependent projects link correctly +# without having to set LD_LIBRARY_PATH: +SET(_PREREQ @_PREREQ_LIST@) +SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@) +SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@") +LIST(LENGTH _PREREQ_CONFIG_DIR _list_len) +IF(NOT _list_len EQUAL 0) + # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... + MATH(EXPR _range "${_list_len}-1") + FOREACH(_p RANGE ${_range}) + LIST(GET _PREREQ ${_p} _pkg ) + LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir) + LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo) + MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...") + IF(NOT _pkg_compo) + FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE + PATHS "${_pkg_dir}" + NO_DEFAULT_PATH) + ELSE() + STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}") + MESSAGE(STATUS "===> (components: ${_pkg_compo})") + FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE + COMPONENTS ${_compo_lst} + PATHS "${_pkg_dir}" + NO_DEFAULT_PATH) + ENDIF() + ENDFOREACH() +ENDIF() + +# Installation directories +SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@") +SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@") +SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@") +SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@") +SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@") +SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@") +SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@") +SET(SALOME_INSTALL_CMAKE "@SALOME_INSTALL_CMAKE@") +SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@") +SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@") +SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@") +SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@") +SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@") +SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@") + +INCLUDE("${GUI_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomeGUITargets.cmake") +INCLUDE("${KERNEL_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeKERNELTargets.cmake") + + +# Exposed MCCAD targets: +SET(MCCAD_MCCADEngine MCCADEngine) +SET(MCCAD_MCCAD MCCAD) +SET(MCCAD_SalomeIDLMCCAD SalomeIDLMCCAD) diff --git a/adm_local/CMakeLists.txt b/adm_local/CMakeLists.txt new file mode 100644 index 0000000..30304c3 --- /dev/null +++ b/adm_local/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +ADD_SUBDIRECTORY(unix) +ADD_SUBDIRECTORY(cmake_files) diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt new file mode 100644 index 0000000..d150051 --- /dev/null +++ b/adm_local/cmake_files/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +# =============================================================== +# Files to be installed +# =============================================================== + +# These files are data, module or lib files +SET(_adm_data +FindMCCAD.cmake#qiu +FindSalomeMCCAD.cmake#qiu +# FindMcCad.cmake #qiu +FindNetgen.cmake +#FindTETGEN.cmake +) +INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL}) diff --git a/adm_local/cmake_files/FindMCCAD.cmake b/adm_local/cmake_files/FindMCCAD.cmake new file mode 100644 index 0000000..8ea00ac --- /dev/null +++ b/adm_local/cmake_files/FindMCCAD.cmake @@ -0,0 +1,28 @@ +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + + +SET(MCCAD_CXXFLAGS -I${MCCAD_ROOT_DIR}/include/salome) # to be removed +SET(MCCAD_INCLUDE_DIRS ${MCCAD_ROOT_DIR}/include/salome) + +FIND_LIBRARY(MCCAD_MCCADEngine MCCADEngine ${MCCAD_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MCCAD_MCCAD MCCAD ${MCCAD_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MCCAD_SalomeIDLMCCAD SalomeIDLMCCAD ${MCCAD_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MCCAD_TKMcCad TKMcCad ${MCCAD_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MCCAD_Tetgen Tetgen ${MCCAD_ROOT_DIR}/lib/salome) diff --git a/adm_local/cmake_files/FindNetgen.cmake b/adm_local/cmake_files/FindNetgen.cmake new file mode 100644 index 0000000..e2efb71 --- /dev/null +++ b/adm_local/cmake_files/FindNetgen.cmake @@ -0,0 +1,93 @@ +# - Find NETGEN +# Sets the following variables: +# NETGEN_INCLUDE_DIRS - path to the NETGEN include directories +# NETGEN_LIBRARIES - path to the NETGEN libraries to be linked against +# + +######################################################################### +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +# ------ + +IF(NOT Netgen_FIND_QUIETLY) + MESSAGE(STATUS "Check for Netgen ...") +ENDIF() + +# ------ + +SET(NETGEN_ROOT_DIR $ENV{NETGEN_ROOT_DIR}) + +IF(NETGEN_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${NETGEN_ROOT_DIR}") +ENDIF(NETGEN_ROOT_DIR) + +FIND_PATH(_netgen_base_inc_dir nglib.h) +SET(NETGEN_INCLUDE_DIRS ${_netgen_base_inc_dir}) +FIND_PATH(_netgen_add_inc_dir occgeom.hpp HINTS ${_netgen_base_inc_dir} PATH_SUFFIXES share/netgen/include) +LIST(APPEND NETGEN_INCLUDE_DIRS ${_netgen_add_inc_dir}) +LIST(REMOVE_DUPLICATES NETGEN_INCLUDE_DIRS) + +FIND_LIBRARY(NETGEN_nglib NAMES nglib) +IF(WIN32) + FIND_LIBRARY(NETGEN_csg NAMES csg) + FIND_LIBRARY(NETGEN_gen NAMES gen) + FIND_LIBRARY(NETGEN_geom2d NAMES geom2d) + FIND_LIBRARY(NETGEN_gprim NAMES gprim) + FIND_LIBRARY(NETGEN_interface NAMES interface) + FIND_LIBRARY(NETGEN_la NAMES la) + FIND_LIBRARY(NETGEN_mesh NAMES mesh) + FIND_LIBRARY(NETGEN_occ NAMES occ) + FIND_LIBRARY(NETGEN_stl NAMES stl) +ENDIF(WIN32) + +SET(NETGEN_LIBRARIES ${NETGEN_nglib}) + +IF(WIN32) + SET(NETGEN_LIBRARIES ${NETGEN_LIBRARIES} + ${NETGEN_csg} + ${NETGEN_gen} + ${NETGEN_geom2d} + ${NETGEN_gprim} + ${NETGEN_interface} + ${NETGEN_la} + ${NETGEN_mesh} + ${NETGEN_occ} + ${NETGEN_stl} + ) +ENDIF(WIN32) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETGEN REQUIRED_VARS NETGEN_INCLUDE_DIRS NETGEN_LIBRARIES) + +IF(NETGEN_FOUND) + IF(NOT Netgen_FIND_QUIETLY) + MESSAGE(STATUS "Netgen library: ${NETGEN_LIBRARIES}") + ENDIF() + SET(NETGEN_DEFINITIONS "-DOCCGEOMETRY") + + #RNV: currently on windows use netgen without thread support. + #TODO: check support of the multithreading on windows + IF(WIN32) + SET(NETGEN_DEFINITIONS "${NETGEN_DEFINITIONS} -DNO_PARALLEL_THREADS") + ENDIF(WIN32) +ENDIF() diff --git a/adm_local/cmake_files/FindSalomeMCCAD.cmake b/adm_local/cmake_files/FindSalomeMCCAD.cmake new file mode 100644 index 0000000..8439863 --- /dev/null +++ b/adm_local/cmake_files/FindSalomeMCCAD.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +IF(NOT SalomeMCCAD_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome MCCAD ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${MCCAD_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeMCCAD SalomeMCCAD CONFIG) + +IF(NOT SalomeMCCAD_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome MCCAD: ${MCCAD_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeMCCAD_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeMCCAD_EXTRA_ENV_${_res}}") +ENDFOREACH() diff --git a/adm_local/unix/CMakeLists.txt b/adm_local/unix/CMakeLists.txt new file mode 100644 index 0000000..4f0c452 --- /dev/null +++ b/adm_local/unix/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +ADD_SUBDIRECTORY(config_files) diff --git a/adm_local/unix/config_files/CMakeLists.txt b/adm_local/unix/config_files/CMakeLists.txt new file mode 100644 index 0000000..1478fd8 --- /dev/null +++ b/adm_local/unix/config_files/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +SET(_m4_data +# check_McCad.m4 + check_MCCAD.m4 + check_NETGEN.m4 +# check_TetGen.m4 + ) + +INSTALL(FILES ${_m4_data} DESTINATION ${SALOME_INSTALL_AMCONFIG_LOCAL}/config_files) diff --git a/adm_local/unix/config_files/check_MCCAD.m4 b/adm_local/unix/config_files/check_MCCAD.m4 new file mode 100644 index 0000000..a4aa49a --- /dev/null +++ b/adm_local/unix/config_files/check_MCCAD.m4 @@ -0,0 +1,55 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org + +AC_DEFUN([CHECK_MCCAD],[ + +AC_CHECKING(for MCCAD) + +MCCAD_ok=no + +AC_ARG_WITH(atomic, + [ --with-mccad=DIR root directory path of MCCAD module installation ], + MCCAD_DIR="$withval",MCCAD_DIR="") + +if test "x$MCCAD_DIR" == "x" ; then + # no --with-atomic-dir option used + if test "x$MCCAD_ROOT_DIR" != "x" ; then + # MCCAD_ROOT_DIR environment variable defined + MCCAD_DIR=$MCCAD_ROOT_DIR + fi +fi + +if test -f ${MCCAD_DIR}/lib/salome/libMCCAD.so ; then + MCCAD_ok=yes + AC_MSG_RESULT(Using MCCAD module distribution in ${MCCAD_DIR}) + + if test "x$MCCAD_ROOT_DIR" == "x" ; then + MCCAD_ROOT_DIR=${MCCAD_DIR} + fi + AC_SUBST(MCCAD_ROOT_DIR) +else + AC_MSG_WARN("Cannot find MCCAD module sources") +fi + +AC_MSG_RESULT(for MCCAD: $MCCAD_ok) + +])dnl + diff --git a/adm_local/unix/config_files/check_NETGEN.m4 b/adm_local/unix/config_files/check_NETGEN.m4 new file mode 100644 index 0000000..086e9ea --- /dev/null +++ b/adm_local/unix/config_files/check_NETGEN.m4 @@ -0,0 +1,263 @@ +dnl Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +dnl +dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl + +AC_DEFUN([CHECK_NETGEN],[ + +AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_CXXCPP])dnl +AC_REQUIRE([CHECK_CAS])dnl + +AC_CHECKING([for Netgen]) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_ARG_WITH([netgen], + [AC_HELP_STRING([--with-netgen=DIR], [root directory path to NETGEN library installation])], + [NETGEN_HOME=$withval],[NETGEN_HOME=yes]) + +NETGEN_INCLUDES="" +NETGEN_LIBS="" +NETGEN_V5=no + +AC_SUBST(NETGEN_INCLUDES) +AC_SUBST(NETGEN_LIBS) + +Netgen_ok=no + +if test "x$NETGEN_HOME" = "x" -o "x$NETGEN_HOME" = "xyes" -o "x$NETGEN_HOME" = "xauto" ; then + # auto-detection + +#qiu change to new style in 7.4.0 salome.sh +# if test "x$NETGENHOME" != "x" ; then + if test "x$NETGEN_ROOT_DIR" != "x" ; then +# - by environment variable NETGENHOME + #NETGEN_HOME=$NETGENHOME + NETGEN_HOME=$NETGEN_ROOT_DIR + else + # - by searching NETGEN executables + AC_PATH_PROG([TEMP], [ng_stl]) + if test "x$TEMP" != "x" ; then + NETGEN_BIN_DIR=`dirname $TEMP` + NETGEN_HOME=`dirname $NETGEN_BIN_DIR` + else + NETGEN_HOME="" + fi + fi +fi + +echo NETGEN_HOME=$NETGEN_HOME + +if test "x$NETGEN_HOME" != "x"; then + + echo ---------------------------------------------------------- + echo You are about to choose to use somehow the + echo Netgen Library to generate Tetrahedric mesh. + echo + echo You are strongly advised to consult the file + echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly + echo about assumptions made on the installation of the Netgen + echo application and libraries. + echo ---------------------------------------------------------- + + NETGEN_INCLUDES="-I${NETGEN_HOME}/include -I${NETGEN_HOME}/share/netgen/include" + NETGEN_LIBS_OLD="-L${NETGEN_HOME}/lib -lnglib" + NETGEN_LIBS_NEW="-L${NETGEN_HOME}/lib -lnglib -linterface -lgeom2d -lcsg -lstl -locc -lmesh" + + dnl check Netgen headers availability + + CPPFLAGS_old="$CPPFLAGS" + CXXFLAGS_old="$CXXFLAGS" + CPPFLAGS="$CAS_CPPFLAGS $NETGEN_INCLUDES $CPPFLAGS" + CXXFLAGS="$CAS_CXXFLAGS $NETGEN_INCLUDES $CXXFLAGS" + + AC_MSG_CHECKING([for Netgen header file]) + + AC_CHECK_HEADER([nglib.h], [Netgen_ok=yes], [Netgen_ok=no]) + + dnl check Netgen libraries + + NETGEN_LIBS=${NETGEN_LIBS_NEW} + + LIBS_old="$LIBS" + LIBS="$NETGEN_LIBS $CAS_LDPATH -lTKernel -lTKMath -lTKG3d -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo -lTKGeomBase $LIBS_old" + + if test "x$Netgen_ok" = "xyes"; then + + AC_MSG_NOTICE([checking for Netgen libraries]) + + AC_MSG_CHECKING([libraries ... try new style ]) + + AC_TRY_LINK( + [ + #include + #include + namespace nglib { + #include "nglib.h" + } + ], + [ + nglib::Ng_Init(); + nglib::Ng_Exit(); + ], + [Netgen_ok=yes], + [Netgen_ok=no]) + + if test "x$Netgen_ok" = "xno" ; then + + AC_MSG_RESULT([no]) + + AC_MSG_CHECKING([libraries ... try old style]) + + NETGEN_LIBS=${NETGEN_LIBS_OLD} + LIBS="$NETGEN_LIBS $CAS_LDPATH -lTKernel -lTKMath -lTKG3d -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo -lTKGeomBase $LIBS_old" + + AC_TRY_LINK( + [ + #include + #include + namespace nglib { + #include "nglib.h" + } + ], + [ + nglib::Ng_Init(); + nglib::Ng_Exit(); + ], + [Netgen_ok=yes], + [Netgen_ok=no]) + + fi + + fi + + dnl check if Netgen of v5 or v4 + + if test "$Netgen_ok" = "yes" ; then + + AC_MSG_RESULT([yes]) + + AC_MSG_CHECKING([Netgen version]) + + AC_TRY_LINK( + [ + #include + #include + #define OCCGEOMETRY + namespace nglib { + #include "nglib.h" + } + #include + ], + [ + nglib::Ng_Init(); + netgen::Mesh* ngMesh; + ngMesh->CalcLocalH(1.0); + nglib::Ng_Exit(); + ], + [NETGEN_V5=yes], + [NETGEN_V5=no]) + + fi + + dnl check OCCT support in Netgen + + if test "$Netgen_ok" = "yes" ; then + + AC_MSG_RESULT([yes]) + + AC_MSG_CHECKING([for OCCT support in Netgen library]) + + AC_TRY_LINK( + [ + #include + #include + #define OCCGEOMETRY + namespace nglib { + #include "nglib.h" + } + ], + [ + nglib::Ng_Init(); + nglib::Ng_OCC_Geometry* ng_occ_geom = nglib::Ng_OCC_NewGeometry(); + nglib::Ng_Exit(); + ], + [Netgen_ok=yes], + [Netgen_ok=no]) + + fi + + dnl check SALOME patch in Netgen + + if test "$Netgen_ok" = "yes" ; then + + AC_MSG_RESULT([yes]) + + AC_MSG_CHECKING([for SALOME patch in Netgen library]) + + AC_TRY_LINK( + [ + #include + #include + #define OCCGEOMETRY + namespace nglib { + #include "nglib.h" + } + #include + ], + [ + nglib::Ng_Init(); + netgen::OCCGeometry occgeo; + nglib::Ng_Exit(); + ], + [Netgen_ok=yes], + [Netgen_ok=no]) + + fi + + LIBS="$LIBS_old" + CPPFLAGS="$CPPFLAGS_old" + CXXFLAGS="$CXXFLAGS_old" + +fi + +if test "x$Netgen_ok" = xyes ; then + + AC_MSG_RESULT([yes]) + + if test "x$NETGEN_V5" = "xyes" ; then + AC_MSG_RESULT([Netgen is of version 5.0 or newer]) + NETGEN_INCLUDES="$NETGEN_INCLUDES -DNETGEN_V5" + else + AC_MSG_RESULT([Netgen is of version 4.9.13 or older]) + fi + +else + + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Netgen is not properly installed. Read NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers for more details.]) + +fi + +AC_LANG_RESTORE + +])dnl diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt new file mode 100644 index 0000000..ed559a4 --- /dev/null +++ b/bin/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS}) + +# =============================================================== +# Files to be installed +# =============================================================== + +SET(_bin_scripts + myrunSalome.py +) +SALOME_INSTALL_SCRIPTS("${_bin_scripts}" ${SALOME_INSTALL_SCRIPT_SCRIPTS}) diff --git a/bin/VERSION b/bin/VERSION new file mode 100644 index 0000000..5029e3c --- /dev/null +++ b/bin/VERSION @@ -0,0 +1 @@ +THIS IS SAMPLE CORBA-ENGINE MODULE : MCCAD : VERSION: 0.3.0 diff --git a/bin/VERSION.in b/bin/VERSION.in new file mode 100644 index 0000000..4a6d528 --- /dev/null +++ b/bin/VERSION.in @@ -0,0 +1 @@ +THIS IS SAMPLE CORBA-ENGINE MODULE : MCCAD : VERSION: @VERSION@ diff --git a/bin/myrunSalome.py b/bin/myrunSalome.py new file mode 100644 index 0000000..f94c310 --- /dev/null +++ b/bin/myrunSalome.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org + +def test(clt): + """ + Test function that creates an instance of MCCAD component + usage : MCCAD=test(clt) + """ + # create an LifeCycleCORBA instance + import LifeCycleCORBA + lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb) + import MCCAD_ORB + MCCAD = lcc.FindOrLoadComponent("FactoryServer", "MCCAD") + return MCCAD + +# + +if __name__ == "__main__": + import user + from runSalome import * + clt,args = main() + + # + # Impression arborescence Naming Service + # + + if clt != None: + print + print " --- registered objects tree in Naming Service ---" + clt.showNS() + session=clt.waitNS("/Kernel/Session") + catalog=clt.waitNS("/Kernel/ModulCatalog") + import socket + container = clt.waitNS("/Containers/" + socket.gethostname().split('.')[0] + "/FactoryServer") diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt new file mode 100644 index 0000000..68cddec --- /dev/null +++ b/idl/CMakeLists.txt @@ -0,0 +1,49 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +INCLUDE(UseOmniORB) + +INCLUDE_DIRECTORIES( + ${KERNEL_INCLUDE_DIRS} + ${OMNIORB_INCLUDE_DIR} + ${MED_INCLUDE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) + +IF(WIN32) + ADD_DEFINITIONS(-DNOGDI) +ENDIF(WIN32) + + + + SET(SalomeIDLMCCAD_IDLSOURCES + MCCAD.idl ) + +SET(IDL_INCLUDE_DIRS + ${KERNEL_ROOT_DIR}/idl/salome + ${CMAKE_CURRENT_SOURCE_DIR} + ${MED_ROOT_DIR}/idl/salome +) +SET(IDL_LINK_FLAGS + ${KERNEL_SalomeIDLKernel} + ${MED_SalomeIDLMED} +) + +OMNIORB_ADD_MODULE(SalomeIDLMCCAD "${SalomeIDLMCCAD_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}") +INSTALL(TARGETS SalomeIDLMCCAD EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/idl/MCCAD.idl b/idl/MCCAD.idl new file mode 100644 index 0000000..78473ce --- /dev/null +++ b/idl/MCCAD.idl @@ -0,0 +1,248 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#ifndef __MCCAD_GEN__ +#define __MCCAD_GEN__ + +#include "SALOME_Component.idl" +#include "SALOME_Exception.idl" +#include "SALOMEDS.idl" +#include "MEDCouplingCorbaServant.idl" + + + +module MCCAD_ORB +{ + +//a part contains one or more solid, and has only one material +typedef double MColor[3]; +typedef double FixArray[3]; + + interface BaseObj + { + string getName(); + void setName(in string Name); + long getID(); + string getRemark(); + void setRemark(in string Name); + SALOMEDS::TMPFile getShapeStream(); + //get shape for used in the same host only + long long getShapePointer(); + void getColor(out MColor aColor); + void setColor(in MColor aColor); + }; + + typedef sequence BaseObjList; + + interface Part : BaseObj + { +// string getName(); +// void setName(in string Name); +// long getID(); +// string getDescription(); +// void setDescription(in string Name); + void setShapeStream(in SALOMEDS::TMPFile aShapeStream ); +// SALOMEDS::TMPFile getShapeStream(); + //get shape for used in the same host only +// long long getShapePointer(); + + void recoverShape (); + void setIsDecomposed(in boolean isDecompsed ); + boolean getIsDecomposed(); + + void setMesh(in SALOME_MED::MEDCouplingUMeshCorbaInterface aMesh); + SALOME_MED::MEDCouplingUMeshCorbaInterface getMesh(); + void clearMesh(); + void setImportance(in FixArray aIMP); + FixArray getImportance(); + string getAdditive(); + void setAdditive(in string aAdditive); + + double getVolume(); + double getMeshVolume(); + + boolean hasBackupShape(); + boolean hasMesh(); + boolean isExplodible(); + + }; + +//material for parts + + + interface Material + { + string getName(); + void setName(in string Name); + long getID(); + void setID(in long id); + double getDensity(); + void setDensity(in double aDensity); + string getMatCard(); + void setMatCard(in string MatCard); + void getColor(out MColor aColor); + void setColor(in MColor aColor); + + + }; + + + typedef sequence PartList; + +//Material group, grouping the parts with the same material in a component + interface Group : BaseObj + { +// string getName(); +// void setName(in string Name); +// long getID(); + PartList getPartList(); + boolean setPartList(in PartList aPartList); + Material getMaterial(); + long getMaterialID(); + void setMaterial(in Material aMaterial); + Part getPart(in long PartID) ; + boolean appendPart(in Part aPart); + boolean deletePart(in long PartID); + boolean insertPart(in Part aPart, in long PartID); + boolean clearParts(); + //append parts in the index group to this + void appendPartInGroup (in Group aGroup); + //get all the shape in this group, return as a COMPOUND +// SALOMEDS::TMPFile getShapeStream(); + //get shape for used in the same host only +// long long getShapePointer(); + + boolean hasMaterial(); + long getNumParts(); + + }; + + + typedef sequence GroupList; + +//Geometry Components grouping the material groups to become a component +//Naming to Component because Component clashes with CORBA Key word:Component + interface Component : BaseObj + { +// string getName(); +// void setName(in string Name); +// long getID(); + GroupList getGroupList(); + boolean setGroupList(in GroupList aGroupList); +// Group generateGroup(in string Name); + Group getGroup(in long GroupID) ; + boolean appendGroup(in Group aGroup); + boolean deleteGroup(in long GroupID); + boolean insertGroup(in Group aGroup, in long GroupID); + boolean clearGroups(); + //append group in the index component to this + void appendGroupInComponent (in Component aComponent); + //get all the shape in this component, return as a COMPOUND +// SALOMEDS::TMPFile getShapeStream(); + //get shape for used in the same host only +// long long getShapePointer(); + void setEnvelopStream(in SALOMEDS::TMPFile aShapeStream); + SALOMEDS::TMPFile getEnvelopStream(); + long long getEnvelopPointer(); + boolean hasEnvelop(); + void clearEnvelop(); + long getNumParts(); + long getNumGroups(); + + + }; + + + typedef sequence ComponentList; + typedef sequence MaterialList; + + interface MCCAD_Gen : Engines::EngineComponent + { + + //set a Component list data in into the study + boolean setData ( in long studyID, in ComponentList theData); + ComponentList getData ( in long studyID) ; + MaterialList getMaterialList(in long studyID) ; + + //generate an empty Component + Component generateComponent(in string Name) raises (SALOME::SALOME_Exception); + //generate an empty Material Group + Group generateGroup(in string Name) raises (SALOME::SALOME_Exception); + //generate a Part + Part generatePart(in string Name) raises (SALOME::SALOME_Exception); + //generate a material + Material generateMaterial(in string Name, in long MaterialID, in long studyID ) raises (SALOME::SALOME_Exception); + //get Component according to the id; + Component getComponent(in long studyID, in long ComponentID); + //get an Material Group + Group getGroup(in long studyID, in long GroupID) raises (SALOME::SALOME_Exception); + //get a Part according to the Component ID, Group ID and Part ID + Part getPart(in long studyID, in long PartID); + //get a material + Material getMaterial ( in long studyID, in long MaterialID); + //deep copy of a Part + Part deepCopyPart(in Part aPart) raises (SALOME::SALOME_Exception); + Group deepCopyGroup(in Group aGroup) raises (SALOME::SALOME_Exception); + //append a Component to the end of the Component list in this Stduy + boolean appendComponent(in long studyID, in Component aComponent);// raises (SALOME::SALOME_Exception); + //insert a Part before Part with ID = ComponentID; + boolean insertComponent (in long studyID, in Component aComponent, in long ComponentID);//raises (SALOME::SALOME_Exception); + //delete the Part according to the id + boolean deleteComponent (in long studyID, in long ComponentID);// raises (SALOME::SALOME_Exception); + //clear all Component + boolean clearComponent(in long studyID); + //append a Material to the end of the Material list in this Stduy + boolean appendMaterial(in long studyID, in Material aMaterial);// raises (SALOME::SALOME_Exception); + //delete the material according to the id + boolean deleteMaterial (in long studyID, in long MaterialID);// raises (SALOME::SALOME_Exception); + + //get all the shape in this study, return as a COMPOUND + SALOMEDS::TMPFile getShapeStream(in long studyID); + //get shape for used in the same host only + long long getShapePointer(in long studyID); + //import OCC Geometry files, include brep, step, iges format, ifExplode is true end explode compound +// PartList ImportGeom(in string FileName, in boolean ifExplode) raises (SALOME::SALOME_Exception); + PartList ImportGeom(in string FileName) raises (SALOME::SALOME_Exception); + PartList explodePart(in Part aPart) raises (SALOME::SALOME_Exception); + Part fuseParts(in PartList aPartList, in string aName) raises (SALOME::SALOME_Exception); + boolean decomposePart(in Part aPart); + boolean decomposeEnvelop(in Component aComponent); + //import MED file + SALOME_MED::MEDCouplingUMeshCorbaInterface importMED(in string MEDFileName) raises (SALOME::SALOME_Exception); + void export2MED(in SALOME_MED::MEDCouplingUMeshCorbaInterface aMesh, in string FileName) raises (SALOME::SALOME_Exception); + //export all mesh assigned to the part to a abaqus file + void exportAllMesh2Abaqus (in long studyID, in string FileName) raises (SALOME::SALOME_Exception); +// void unittest(); + + //generate tetrahedral mesh using Tetgen + boolean generateTetgenMesh(in Part aPart, in double aDeflection, in double aCoefficient, in double aMeshQuality) raises (SALOME::SALOME_Exception); + boolean generateNetgenMesh(in Part aPart, in double aDeflection, in double aCoefficient) raises (SALOME::SALOME_Exception); + + //export geometry to brep/step/iges file + void exportGeom(in BaseObjList aBaseObjList, in string FileName); + + + + + + }; + +}; + +#endif diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt new file mode 100644 index 0000000..752850d --- /dev/null +++ b/resources/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +# =============================================================== +# Files to be installed +# =============================================================== + +# These files are data, module or lib files +SET( _res_files + Component.png + Group.png + MCCAD.png + Part.png + ) +INSTALL(FILES ${_res_files} DESTINATION ${SALOME_MCCAD_INSTALL_RES_DATA}) + +SALOME_CONFIGURE_FILE(MCCADCatalog.xml.in MCCADCatalog.xml INSTALL ${SALOME_MCCAD_INSTALL_RES_DATA}) +SALOME_CONFIGURE_FILE(SalomeApp.xml.in SalomeApp.xml INSTALL ${SALOME_MCCAD_INSTALL_RES_DATA}) + + + + diff --git a/resources/Component.png b/resources/Component.png new file mode 100644 index 0000000..b57e56a Binary files /dev/null and b/resources/Component.png differ diff --git a/resources/Group.png b/resources/Group.png new file mode 100644 index 0000000..235d9e4 Binary files /dev/null and b/resources/Group.png differ diff --git a/resources/MCCAD.png b/resources/MCCAD.png new file mode 100644 index 0000000..869f613 Binary files /dev/null and b/resources/MCCAD.png differ diff --git a/resources/MCCADCatalog.xml.in b/resources/MCCADCatalog.xml.in new file mode 100644 index 0000000..36f6e5e --- /dev/null +++ b/resources/MCCADCatalog.xml.in @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + MCCAD + MCCAD GUI + Data + KIT-INR + 0.5.0 + KIT + 1 + MCCAD.png + 'linux' ~ OS + + + + diff --git a/resources/Part.png b/resources/Part.png new file mode 100644 index 0000000..e34cb88 Binary files /dev/null and b/resources/Part.png differ diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml new file mode 100644 index 0000000..0e9c320 --- /dev/null +++ b/resources/SalomeApp.xml @@ -0,0 +1,85 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in new file mode 100644 index 0000000..2bb3465 --- /dev/null +++ b/resources/SalomeApp.xml.in @@ -0,0 +1,85 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..113f1b3 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + + +SET(SUBDIRS + TETGEN MCCAD MCCADGEN MCCADGUI + ) + +FOREACH(dir ${SUBDIRS}) + ADD_SUBDIRECTORY(${dir}) +ENDFOREACH(dir ${SUBDIRS}) diff --git a/src/MCCAD/CMakeLists.txt b/src/MCCAD/CMakeLists.txt new file mode 100644 index 0000000..1ed222d --- /dev/null +++ b/src/MCCAD/CMakeLists.txt @@ -0,0 +1,632 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +##################################################################### +# # +# Build McCad libraries # +# # +##################################################################### + +############################################################################ + +# +# build McCad shared libraries +#--------------------------------------------------------------------------- + + + +#qiu make the debug version +#SET(CMAKE_BUILD_TYPE debug) + +# additional include directories +INCLUDE_DIRECTORIES( + McCadHeaders + ${CAS_INCLUDE_DIRS} + ${QT_INCLUDES} + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( ${CAS_DEFINITIONS} ${QT_DEFINITIONS} ) + +IF(NOT DEFINED WIN32) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -funsigned-char -Wall -fmessage-length=0 -DNO_CXX_EXCEPTION -MD -DHAVE_LIMITS_H -DHAVE_IOSTREAM -DHAVE_CONFIG_H -fpermissive -pthread -fopenmp " ) +ENDIF(NOT DEFINED WIN32) + +MESSAGE ("CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}") +MESSAGE ("CAS_DEFINITIONS: ${CAS_DEFINITIONS}") +SET(McSrc .)#qiu +SET(McInc ./McCadHeaders)#qiu + +#qiu +QT4_WRAP_CPP(MOCS # ${McInc}/QMcCad_Application.h +# ${McInc}/QMcCad_Editor.h +# ${McInc}/QMcCad_ActionFactory.h +# ${McInc}/QMcCad_ActionMaster.h +# ${McInc}/QMcCad_View.h +# ${McInc}/QMcCad_LogWindow.h + ${McInc}/QMcCad_VGParamDialog.h +# ${McInc}/QMcCadGeomeTree_TreeWidget.hxx +# ${McInc}/QMcCadGeomeTree_AddToMGDialog.h +# ${McInc}/McCadDesign_MakeBox.hxx +# ${McInc}/McCadDesign_MakeCylinder.hxx +# ${McInc}/McCadDesign_MakeCone.hxx +# ${McInc}/McCadDesign_MakeSphere.hxx +# ${McInc}/McCadDesign_CopyTo.hxx +# ${McInc}/McCadDesign_Rotate.hxx +# ${McInc}/McCadDesign_MoveTo.hxx +# ${McInc}/McCadDesign_Scale.hxx +# ${McSrc}/McCadDesign/McCadMatManageDlg.hxx +# ${McInc}/QMcCad_TransparencyDialog.h +# ${McInc}/QMcCad_ClippingPlaneDialog.h +# ${McInc}/QMcCad_ReadListDialog.hxx +) + + +ADD_LIBRARY (TKMcCad +#qiu ADD_LIBRARY (TKMcCadGUI + ${McSrc}/McCadGUI/McCadGUI_GuiFactory.cxx + ${McSrc}/McCadGUI/McCadGUI_BaseDialog.cxx + ${McSrc}/McCadGUI/McCadGUI_ColorDialog.cxx + ${McSrc}/McCadGUI/McCadGUI_FileDialog.cxx + ${McSrc}/McCadGUI/McCadGUI_InputDialog.cxx + ${McSrc}/McCadGUI/McCadGUI_ProgressDialog.cxx #) + + +#ADD_LIBRARY (TKMcCadDiscDs + ${McSrc}/McCadDiscDs/McCadDiscDs_SequenceOfDiscFace_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_HSequenceOfDiscFace_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_ListOfDiscFace_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_SequenceOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_HSequenceOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_ListOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscFace_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscFace_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_DiscFace.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_SequenceOfSeqOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_HSequenceOfHSeqOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_0.cxx + ${McSrc}/McCadDiscDs/McCadDiscDs_DiscSolid.cxx #) + + +#ADD_LIBRARY (TKMcCadTDS + ${McSrc}/McCadTDS/McCadTDS_ExtFace.cxx + ${McSrc}/McCadTDS/McCadTDS_ExtSolid.cxx + ${McSrc}/McCadTDS/McCadTDS_SequenceOfExtFace_0.cxx + ${McSrc}/McCadTDS/McCadTDS_HSequenceOfExtFace_0.cxx + ${McSrc}/McCadTDS/McCadTDS_SequenceOfExtSolid_0.cxx + ${McSrc}/McCadTDS/McCadTDS_HSequenceOfExtSolid_0.cxx + ${McSrc}/McCadTDS/McCadTDS_DataMapOfIntegerExtFace_0.cxx + ${McSrc}/McCadTDS/McCadTDS_DataMapOfIntegerSolid_0.cxx + ${McSrc}/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtFace_0.cxx + ${McSrc}/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtSolid_0.cxx + ${McSrc}/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_0.cxx + ${McSrc}/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_0.cxx + ${McSrc}/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_0.cxx + ${McSrc}/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_0.cxx #) + +#ADD_LIBRARY (TKMcCadGTOOL + ${McSrc}/McCadGTOOL/McCadGTOOL.cxx #) + +#ADD_LIBRARY (TKMcCadBoolExp + ${McSrc}/McCadBoolExp/McCadBoolExp_PostFixer.cxx + ${McSrc}/McCadBoolExp/McCadBoolExp_ExprParser.cxx #) + +#ADD_LIBRARY (TKMcCadEXPlug + ${McSrc}/McCadEXPlug/McCadEXPlug_ExchangePlugin.cxx + ${McSrc}/McCadEXPlug/McCadEXPlug_PluginManager.cxx + ${McSrc}/McCadEXPlug/McCadEXPlug.cxx + ${McSrc}/McCadEXPlug/McCadEXPlug_MCBase.cxx + ${McSrc}/McCadEXPlug/McCadEXPlug_SequenceOfSharedLibrary_0.cxx + ${McSrc}/McCadEXPlug/McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_0.cxx #) + +#ADD_LIBRARY (TKMcCadExStep + ${McSrc}/McCadExDllStep/McCadExDllStep_Step.cxx #) + +#ADD_LIBRARY (TKMcCadExIges + ${McSrc}/McCadExDllIges/McCadExDllIges_Iges.cxx #) + +#ADD_LIBRARY (TKMcCadExBRep + ${McSrc}/McCadExDllBrep/McCadExDllBrep_Brep.cxx #) + +#ADD_LIBRARY (TKMcCadCSGGeom + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SequenceOfSurface_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SequenceOfCell_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerSurface_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerCell_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SequenceOfTransformation_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerTransformation_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfSurface_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfCell_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_HSequenceOfSurface_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_HSequenceOfCell_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_HSequenceOfTransformation_0.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_GQ.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Sphere.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Plane.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Cylinder.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Torus.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Cell.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Cone.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Transformation.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_SurfaceOfRevolution.cxx + ${McSrc}/McCadCSGGeom/McCadCSGGeom_Surface.cxx #) + +#ADD_LIBRARY (TKMcCadCSGBuild + ${McSrc}/McCadCSGBuild/McCadCSGBuild_SolidFromCSG.cxx #) + +#ADD_LIBRARY (TKMcCadMcWrite + ${McSrc}/McCadMcWrite/McCadMcWrite_McInputGenerator.cxx + ${McSrc}/McCadMcWrite/McCadMcWrite_McnpInputGenerator.cxx + ${McSrc}/McCadMcWrite/McCadMcWrite_TripoliInputGenerator.cxx #) + +#ADD_LIBRARY (TKMcCadMcRead + ${McSrc}/McCadMcRead/McCadMcRead_SequenceOfFill_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_HSequenceOfFill_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_DataMapOfIntegerFill_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfFill_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_SequenceOfCell_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_HSequenceOfCell_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_DataMapOfIntegerCell_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCell_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead.cxx + ${McSrc}/McCadMcRead/McCadMcRead_SequenceOfCellPtr_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_HSequenceOfCellPtr_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCellPtr_0.cxx + ${McSrc}/McCadMcRead/McCadMcRead_Cell.cxx + ${McSrc}/McCadMcRead/McCadMcRead_Fill.cxx + ${McSrc}/McCadMcRead/McCadMcRead_FillBuilder.cxx + ${McSrc}/McCadMcRead/McCadMcRead_TrsfBuilder.cxx + ${McSrc}/McCadMcRead/McCadMcRead_CellBuilder.cxx + ${McSrc}/McCadMcRead/McCadMcRead_SurfaceFactory.cxx + ${McSrc}/McCadMcRead/McCadMcRead_Reader.cxx #) + +#ADD_LIBRARY (TKMcCadCSG + ${McSrc}/McCadCSGAdapt/McCadCSGAdapt_ShapeAnalyser.cxx + ${McSrc}/McCadCSGAdapt/McCadCSGAdapt_SolidAnalyser.cxx + ${McSrc}/McCadCSGAdapt/McCadCSGAdapt_ShellAnalyser.cxx + ${McSrc}/McCadCSGAdapt/McCadCSGAdapt_FaceAnalyser.cxx + ${McSrc}/McCadCSGAdapt/McCadCSGAdapt_ShapeGeomAnalyser.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_TrivialCheck.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_Extender.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_FaceFuser.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_CellBuilder.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_Cutter.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_Decomposer.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_SignCheck.cxx + ${McSrc}/McCadCSGTool/McCadCSGTool_SurfaceChecker.cxx#) +#ADD_LIBRARY (TKMcCadCSGUtil + ${McSrc}/McCadCSGUtil/McCadCSGUtil_SolidBuilder.cxx #) + +#ADD_LIBRARY (TKMcCadExMcnp + ${McSrc}/McCadExDllMcnp/McCadExDllMcnp_Mcnp.cxx #) + +#ADD_LIBRARY (TKMcCadExTripoli + ${McSrc}/McCadExDllTripoli/McCadExDllTripoli_Tripoli.cxx#) + +#ADD_LIBRARY (TKMcCadDiscretization + ${McSrc}/McCadDiscretization/McCadDiscretization_Face.cxx + ${McSrc}/McCadDiscretization/McCadDiscretization_Solid.cxx #) + +#ADD_LIBRARY (TKMcCadCom + ${McSrc}/McCadCom/McCadCom_Document.cxx + ${McSrc}/McCadCom/McCadCom_View.cxx + ${McSrc}/McCadCom/McCadCom_CasDocument.cxx + ${McSrc}/McCadCom/McCadCom_CasView.cxx + ${McSrc}/McCadCom/McCadCom_SequenceOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_ListOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_MapOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapofIntegerListOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_SequenceOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_ListOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_MapOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapofIntegerListOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_SequenceNodeOfSequenceOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_ListNodeOfListOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_ListIteratorOfListOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_StdMapNodeOfMapOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_MapIteratorOfMapOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_0.cxx + ${McSrc}/McCadCom/McCadCom_SequenceNodeOfSequenceOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_ListNodeOfListOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_ListIteratorOfListOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_StdMapNodeOfMapOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_MapIteratorOfMapOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_0.cxx + ${McSrc}/McCadCom/McCadCom_SequenceOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_ListOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_MapOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapofIntegerListOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_SequenceNodeOfSequenceOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_ListNodeOfListOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_ListIteratorOfListOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_StdMapNodeOfMapOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_MapIteratorOfMapOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_0.cxx + ${McSrc}/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_0.cxx + #) + +#ADD_LIBRARY (TKMcCadAEV + ${McSrc}/McCadAEV/McCadAEV_Application.cxx + ${McSrc}/McCadAEV/McCadAEV_Editor.cxx + ${McSrc}/McCadAEV/McCadAEV_Viewer.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceOfViewer_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListOfViewer_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceOfEditor_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListOfEditor_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewer_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListNodeOfListOfViewer_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListIteratorOfListOfViewer_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditor_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListNodeOfListOfEditor_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListIteratorOfListOfEditor_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceOfEditorPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListOfEditorPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceOfViewerPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListOfViewerPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditorPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListNodeOfListOfEditorPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListIteratorOfListOfEditorPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewerPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListNodeOfListOfViewerPtr_0.cxx + ${McSrc}/McCadAEV/McCadAEV_ListIteratorOfListOfViewerPtr_0.cxx #) + +#ADD_LIBRARY (TKMcCadMcVoid + ${McSrc}/McCadMcVoid/McCadMcVoid_Generator.cxx + ${McSrc}/McCadMcVoid/McCadMcVoid.cxx + ${McSrc}/McCadMcVoid/McCadMcVoid_ForwardCollision.cxx + ${McSrc}/McCadMcVoid/McCadConvexSolid.cxx + ${McSrc}/McCadMcVoid/McCadGeomData.cxx + ${McSrc}/McCadMcVoid/McCadVoidCell.cxx + ${McSrc}/McCadMcVoid/McCadVoidCellManager.cxx + ${McSrc}/McCadMcVoid/McCadExtFace.cxx + ${McSrc}/McCadMcVoid/McCadExtAuxFace.cxx + ${McSrc}/McCadMcVoid/McCadExtBndFace.cxx + ${McSrc}/McCadMcVoid/IGeomFace.cxx + ${McSrc}/McCadMcVoid/McCadGeomPlane.cxx + ${McSrc}/McCadMcVoid/McCadGeomCylinder.cxx + ${McSrc}/McCadMcVoid/McCadGeomCone.cxx + ${McSrc}/McCadMcVoid/McCadGeomSphere.cxx + ${McSrc}/McCadMcVoid/McCadGeomTorus.cxx + ${McSrc}/McCadMcVoid/McCadGeomRevolution.cxx + ${McSrc}/McCadMcVoid/McCadTransfCard.cxx + ${McSrc}/McCadMcVoid/McCadSolid.cxx + ${McSrc}/McCadMcVoid/McCadTripoliCell.cxx + ${McSrc}/McCadMcVoid/IMcCadWriter.cxx + ${McSrc}/McCadMcVoid/McCadMcnpWriter.cxx + ${McSrc}/McCadMcVoid/McCadGDMLWriter.cxx + ${McSrc}/McCadMcVoid/McCadTripoliWriter.cxx + ${McSrc}/McCadMcVoid/McCadVoidGenerator.cxx + #qiu move source from McCadTool to here + ${McSrc}/McCadTool/MaterialManager.cxx + ${McSrc}/McCadTool/Material.cxx + ${McSrc}/McCadTool/MaterialGroup.cxx + ${McSrc}/McCadTool/McCadGeomTool.cxx + ${McSrc}/McCadTool/McCadMathTool.cxx + ${McSrc}/McCadTool/McCadGeneTool.cxx + ${McSrc}/McCadTool/McCadConvertConfig.cxx + ${McSrc}/McCadTool/McCadFuseSurface.cxx #) +#ADD_LIBRARY (TKMcCadTool + ${McSrc}/McCadTool/McCadTool_Task.cxx + ${McSrc}/McCadTool/McCadTool_TaskMaster.cxx + ${McSrc}/McCadTool/McCadTool_TaskHistory.cxx + ${McSrc}/McCadTool/McCadTool_ListOfTask_0.cxx + ${McSrc}/McCadTool/McCadTool_ListNodeOfListOfTask_0.cxx + ${McSrc}/McCadTool/McCadTool_ListIteratorOfListOfTask_0.cxx + ${McSrc}/McCadTool/MaterialManager.cxx + ${McSrc}/McCadTool/Material.cxx + ${McSrc}/McCadTool/MaterialGroup.cxx + ${McSrc}/McCadTool/McCadGeomTool.cxx + ${McSrc}/McCadTool/McCadMathTool.cxx + ${McSrc}/McCadTool/McCadGeneTool.cxx + ${McSrc}/McCadTool/McCadConvertConfig.cxx + ${McSrc}/McCadTool/McCadFuseSurface.cxx #) + +#qiu comment-out this library because McCad GUI is not used anymore +#ADD_LIBRARY (TKMcCadViewTool ${McSrc}/McCadViewTool/McCadViewTool_FitAll.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Axis.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Axo.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_BackProject.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_FrontProject.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_TopProject.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_BottomProject.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_LeftProject.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_RightProject.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Pan.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Rotate.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Reset.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Zoom.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_SetBackgroundColor.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_SetHiddenLine.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_SetAntialiasing.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Transparency.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Dump.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Redraw.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_ZoomOut.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_ZoomIn.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_SetShadingMode.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_WireFrame.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_Delete.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_SetShapeColor.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_ShowAll.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_HideSelected.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_RedisplaySelected.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_DisplaySelectedOnly.cxx +# ${McSrc}/McCadViewTool/McCadViewTool_ReadValueList.cxx ) + +#ADD_LIBRARY (TKMcCadConvertTools + ${McSrc}/McCadConvertTools/McCadConvertTools_Convertor.cxx + ${McSrc}/McCadConvertTools/McCadConvertTools_VoidGenerator.cxx #) + +#ADD_LIBRARY (TKMcCadIOHelper + ${McSrc}/McCadIOHelper/McCadIOHelper_InputFileParser.cxx + ${McSrc}/McCadIOHelper/McCadIOHelper_Expander.cxx + ${McSrc}/McCadIOHelper/McCadIOHelper_Merger.cxx#) + +#ADD_LIBRARY (TKMcCadMDReader + ${McSrc}/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_0.cxx + ${McSrc}/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_0.cxx + ${McSrc}/McCadMDReader/McCadMDReader_DataMapOfAsciiStringReal_0.cxx + ${McSrc}/McCadMDReader/McCadMDReader_MapAsciiStringHasher_0.cxx + ${McSrc}/McCadMDReader/McCadMDReader_Reader.cxx #) + +#ADD_LIBRARY (TKMcCadXCAF + ${McSrc}/McCadXCAF/McCadXCAF_Application.cxx + ${McSrc}/McCadXCAF/McCadXCAF_TDocShapeLabelIterator.cxx #) + +#qiu comment-out this library because McCad GUI is not used anymore +#ADD_LIBRARY (TKQMcCadTools ${McSrc}/McCadDesign/McCadDesign_Tool.cxx +# ${McSrc}/McCadDesign/McCadDesign_MakeBox.cxx +# ${McSrc}/McCadDesign/McCadDesign_MakeCylinder.cxx +# ${McSrc}/McCadDesign/McCadDesign_MakeCone.cxx +# ${McSrc}/McCadDesign/McCadDesign_MakeSphere.cxx +# ${McSrc}/McCadDesign/McCadDesign_CopyTo.cxx +# ${McSrc}/McCadDesign/McCadDesign_Rotate.cxx +# ${McSrc}/McCadDesign/McCadDesign_MoveTo.cxx +# ${McSrc}/McCadDesign/McCadDesign_Scale.cxx +# ${McSrc}/McCadDesign/McCadMatManageDlg.cxx ) + +#ADD_LIBRARY (TKMcCadMessenger + ${McSrc}/McCadMessenger/McCadMessenger_Singleton.cxx + ${McSrc}/McCadMessenger/McCadMessenger_StdOut.cxx +#) + +#ADD_LIBRARY (TKQMcCadMessenger + ${McSrc}/QMcCadMessenger/QMcCadMessenger_MainWindowMessage.cxx +#) + +#add_library (TKMcCadIOTools + ${McSrc}/McCadIOTools/McCadIOTools_ExportBrep.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ExportMcnp.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ExportIges.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ExportStep.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ExportTripoli.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ImportBrep.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ImportIges.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ImportMcnp.cxx + ${McSrc}/McCadIOTools/McCadIOTools_ImportStep.cxx + ${McSrc}/McCadIOTools/McCadIOTools_MCExportBase.cxx + ${McSrc}/McCadIOTools/McCadIOTools.cxx + ${McSrc}/McCadIOTools/McCadInputModelData.cxx + + ${McSrc}/QMcCad/QMcCad_VGParamDialog.cpp #qiu this file is used in + ${MOCS} + ) + + +# +# Link libraries with each other +#------------------------------------------------------- + + + +##################################################################### +# # +# Build McCad executable # +# # +##################################################################### +#qiu +#SET ( QMCCAD ${McSrc}/QMcCad ) + +#SET (QSRCS ${QMCCAD}/main.cpp +# ${QMCCAD}/QMcCad_Application.cpp +# ${QMCCAD}/QMcCad_Editor.cpp +# ${QMCCAD}/QMcCad_ActionFactory.cpp +# ${QMCCAD}/QMcCad_ActionMaster.cpp +# ${QMCCAD}/QMcCad_Viewer.cpp +# ${QMCCAD}/QMcCad_View.cpp +# ${QMCCAD}/QMcCad_LogWindow.cpp +# ${QMCCAD}/QMcCad_VGParamDialog.cpp +# ${McSrc}/QMcCadGeomeTree/QMcCadGeomeTree_TreeWidget.cxx +# ${McSrc}/QMcCadGeomeTree/QMcCadGeomeTree_AddToMGDialog.cxx +# ${QMCCAD}/QMcCad_TransparencyDialog.cpp +# ${QMCCAD}/QMcCad_ClippingPlaneDialog.cpp +# ${QMCCAD}/QMcCad_ReadListDialog.cxx) + +SET (OCC_LIBRARIES ${CAS_TKernel} + ${CAS_TKMath} + ${CAS_TKService} + ${CAS_TKG2d} + ${CAS_TKBRep} + ${CAS_TKG3d} + ${CAS_TKGeomAlgo} + ${CAS_TKV3d} + ${CAS_TKBool} + ${CAS_TKTopAlgo} + ${CAS_TKGeomBase} + ${CAS_TKFillet} +# ${CAS_TKV2d} + ${CAS_TKPrim} + ${CAS_TKHLR} + ${CAS_TKMesh} + ${CAS_TKBO} + ${CAS_TKShHealing} + ${CAS_TKCDF} + ${CAS_TKLCAF} + ${CAS_TKXDESTEP} + ${CAS_TKXDEIGES} + ${CAS_TKXCAF} + ${CAS_TKCAF} + ${CAS_TKMeshVS} + ${CAS_TKXSBase} + ${CAS_TKSTEP} + ${CAS_TKIGES} + ) + +#qiu +#SET (MCCAD_LIBRARIES TKMcCadAEV +# TKMcCadBoolExp +# TKMcCadCom +# TKMcCadConvertTools +# TKMcCadCSG +# TKMcCadCSGBuild +# TKMcCadCSGGeom +# TKMcCadCSGUtil +# TKMcCadDiscDs +# TKMcCadDiscretization +# TKMcCadEXPlug +# TKMcCadGTOOL +# TKMcCadGUI +# TKMcCadIOHelper +# TKMcCadIOTools +# TKMcCadMcRead +# TKMcCadMcVoid +# TKMcCadMcWrite +# TKMcCadMDReader +# TKMcCadMessenger +# TKMcCadTDS +# TKMcCadTool +# TKMcCadXCAF +# TKMcCadViewTool +# TKQMcCadMessenger +# TKQMcCadTools +# ) + + +# +# Executable +#--------------------------------------------------------------------------- + + +#qiu ADD_EXECUTABLE (McCadApp ${QSRCS} +# ${MOCS} +# ${QMCCAD}/qrc_qmccad.cpp ) + +# +# link libraries to the executable +#--------------------------------------------------------------------------- + +#qiu TARGET_LINK_LIBRARIES (McCadApp ${OCC_LIBRARIES} +# ${QT_LIBRARIES} +# ${MCCAD_LIBRARIES} +# pthread ) + +#qiu compile as one library to avoid million of linking issue. +TARGET_LINK_LIBRARIES (TKMcCad ${OCC_LIBRARIES} + ${QT_LIBRARIES} + #${MCCAD_LIBRARIES} + #pthread + ) + +# +# define installation +# +#qiu only install libraries, without McCad executable +install ( TARGETS #qiu McCadApp + #qiu ${MCCAD_LIBRARIES} +# TKMcCadAEV +# TKMcCadBoolExp +# TKMcCadCom +# TKMcCadConvertTools +# TKMcCadCSG +# TKMcCadCSGBuild +# TKMcCadCSGGeom +# TKMcCadCSGUtil +# TKMcCadDiscDs +# TKMcCadDiscretization +# TKMcCadEXPlug +# TKMcCadGTOOL +# TKMcCadGUI +# TKMcCadIOHelper +# TKMcCadIOTools +# TKMcCadMcRead +# TKMcCadMcVoid +# TKMcCadMcWrite +# TKMcCadMDReader +# TKMcCadMessenger +# TKMcCadTDS +# TKMcCadTool +# TKMcCadXCAF +#qiu comment-out this library because McCad GUI is not used anymore +# TKMcCadViewTool +# TKQMcCadMessenger +#qiu comment-out this library because McCad GUI is not used anymore +# TKQMcCadTools +# TKMcCadExBRep +# TKMcCadExIges +# TKMcCadExStep +# TKMcCadExMcnp +# TKMcCadExTripoli + TKMcCad + EXPORT ${PROJECT_NAME}TargetGroup + DESTINATION ${SALOME_INSTALL_LIBS} + ) + +#install( FILES ${PROJECT_SOURCE_DIR}/bin/McCad +# ${PROJECT_SOURCE_DIR}/bin/McCadConvertScript +# DESTINATION ${CMAKE_INSTALL_PREFIX}/bin +# PERMISSIONS OWNER_READ +# OWNER_WRITE +# OWNER_EXECUTE +# GROUP_READ +# GROUP_EXECUTE +# WORLD_READ +# WORLD_EXECUTE ) + +#install( DIRECTORY ${PROJECT_SOURCE_DIR}/doc +# ${PROJECT_SOURCE_DIR}/tutorial +# DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mccad +# FILE_PERMISSIONS OWNER_READ +# OWNER_WRITE +# OWNER_EXECUTE +# GROUP_READ +# GROUP_EXECUTE +# WORLD_READ +# WORLD_EXECUTE +# DIRECTORY_PERMISSIONS OWNER_READ +# OWNER_WRITE +# OWNER_EXECUTE +# GROUP_READ +# GROUP_EXECUTE +# WORLD_READ +# WORLD_EXECUTE ) diff --git a/src/MCCAD/McCad.template b/src/MCCAD/McCad.template new file mode 100644 index 0000000..7d16f2a --- /dev/null +++ b/src/MCCAD/McCad.template @@ -0,0 +1,6 @@ +#!/bin/sh + +export MCCAD_LIBDIR=@CMAKE_INSTALL_PREFIX@/lib +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCCAD_LIBDIR + +McCadApp $1 $2 $3 diff --git a/src/MCCAD/McCadAEV/McCadAEV_Application.cxx b/src/MCCAD/McCadAEV/McCadAEV_Application.cxx new file mode 100644 index 0000000..46cd31b --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_Application.cxx @@ -0,0 +1,96 @@ +#include +#include +#include +#include +#include + + +McCadAEV_Application::McCadAEV_Application() +{ + myPluginManager = McCadEXPlug_PluginManager::Instance(); +} + +void McCadAEV_Application::Destroy() +{ + //delete myPluginManager; +} +OSD_Directory McCadAEV_Application::ResourceDir() const +{ + return myResourceDir; +} + +void McCadAEV_Application::SetResourceDir(const OSD_Directory& theDir) +{ + myResourceDir = theDir; + +} + +void McCadAEV_Application::SetPluginPath(const OSD_Path& thePath) +{ + myPluginPath = thePath; +} + +OSD_Path McCadAEV_Application::GetPluginPath() const +{ + return myPluginPath; +} + +Standard_Boolean McCadAEV_Application::LoadPlugins() +{ + if (myPluginManager == NULL) + myPluginManager = McCadEXPlug_PluginManager::Instance(); + + if (!McCadEXPlug::PathExists(myPluginPath)) + { + cout << "The Plugin Path seems not to exist!! : " << myPluginPath.Name().ToCString() << endl; + return false; + } + if (!McCadEXPlug::PathIsReadable(myPluginPath)) + { + cout << "The Plugin Path seems not Readable!! : " << myPluginPath.Name().ToCString() << endl; + return false; + } + return myPluginManager->LoadSharedLibrary(myPluginPath); +} + +Standard_Boolean McCadAEV_Application::UnLoadPlugins() +{ + if (myPluginManager == NULL) + myPluginManager = McCadEXPlug_PluginManager::Instance(); + myPluginManager->UnLoadSharedLibrary(); + return true; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadAEV_Application::Formats() const +{ + return myPluginManager->GetFormats(); +} + +McCadEXPlug_ExchangePluginPtr McCadAEV_Application::GetPlugin( const TCollection_AsciiString& theExtension) const +{ + return myPluginManager->GetPlugin(theExtension); +} + +Handle(TColStd_HSequenceOfAsciiString) McCadAEV_Application::GetExtensions() const +{ + return myPluginManager->GetExtensions(); + +} + +Standard_Boolean McCadAEV_Application::CheckExtension( const TCollection_AsciiString& theExtension) const +{ + return myPluginManager->CheckExtension(theExtension); +} + +void McCadAEV_Application::CloseEditor(const McCadAEV_EditorPtr& theEdPtr) +{ +} + +void McCadAEV_Application::OpenEditor(const McCadAEV_EditorPtr& theEdPtr) +{ +} + +void McCadAEV_Application::AddEditor(const McCadAEV_EditorPtr& theEdPtr) +{ +} + diff --git a/src/MCCAD/McCadAEV/McCadAEV_Editor.cxx b/src/MCCAD/McCadAEV/McCadAEV_Editor.cxx new file mode 100644 index 0000000..793e56f --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_Editor.cxx @@ -0,0 +1,52 @@ +#include +#include + + +McCadAEV_Editor::McCadAEV_Editor() +{ + +} + +void McCadAEV_Editor::Destroy() +{ + + +} + +void McCadAEV_Editor::Open() +{ +} + +void McCadAEV_Editor::Close() +{ +} + +void McCadAEV_Editor::Update() +{ +} + +void McCadAEV_Editor::SetDocument(const Handle(McCadCom_Document)& theDoc) +{ + +} + +Handle(McCadCom_Document) McCadAEV_Editor::GetDocument() const +{ + return NULL; +} + +McCadAEV_ViewerPtr McCadAEV_Editor::GetViewer() const +{ + return NULL; +} + +void McCadAEV_Editor::SetViewer(const McCadAEV_ViewerPtr& theViewerPtr) +{ + +} + +void McCadAEV_Editor::InitViewer() +{ + +} + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfEditorPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfEditorPtr_0.cxx new file mode 100644 index 0000000..51f37e7 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfEditorPtr_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListOfEditorPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#include +#endif + + +#define Item McCadAEV_EditorPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditorPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditorPtr_Type_() +#define TCollection_List McCadAEV_ListOfEditorPtr +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfEditor_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfEditor_0.cxx new file mode 100644 index 0000000..a23d1ac --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfEditor_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListOfEditor_HeaderFile +#include +#endif +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfEditor_HeaderFile +#include +#endif + + +#define Item McCadAEV_Editor +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditor +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditor_Type_() +#define TCollection_List McCadAEV_ListOfEditor +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfViewerPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfViewerPtr_0.cxx new file mode 100644 index 0000000..cacd4ed --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfViewerPtr_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListOfViewerPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#include +#endif + + +#define Item McCadAEV_ViewerPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewerPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewerPtr_Type_() +#define TCollection_List McCadAEV_ListOfViewerPtr +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfViewer_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfViewer_0.cxx new file mode 100644 index 0000000..f736777 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListIteratorOfListOfViewer_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListOfViewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfViewer_HeaderFile +#include +#endif + + +#define Item McCadAEV_Viewer +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewer +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewer_Type_() +#define TCollection_List McCadAEV_ListOfViewer +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfEditorPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfEditorPtr_0.cxx new file mode 100644 index 0000000..46f8daf --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfEditorPtr_0.cxx @@ -0,0 +1,92 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_ListOfEditorPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfEditorPtr_HeaderFile +#include +#endif +//McCadAEV_ListNodeOfListOfEditorPtr::~McCadAEV_ListNodeOfListOfEditorPtr() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_ListNodeOfListOfEditorPtr_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_ListNodeOfListOfEditorPtr", + sizeof(McCadAEV_ListNodeOfListOfEditorPtr), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_ListNodeOfListOfEditorPtr) Handle(McCadAEV_ListNodeOfListOfEditorPtr)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_ListNodeOfListOfEditorPtr) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditorPtr))) { + _anOtherObject = Handle(McCadAEV_ListNodeOfListOfEditorPtr)((Handle(McCadAEV_ListNodeOfListOfEditorPtr)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_ListNodeOfListOfEditorPtr::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditorPtr) ; +} +//Standard_Boolean McCadAEV_ListNodeOfListOfEditorPtr::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditorPtr) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadAEV_ListNodeOfListOfEditorPtr::~Handle_McCadAEV_ListNodeOfListOfEditorPtr() {} +#define Item McCadAEV_EditorPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditorPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditorPtr_Type_() +#define TCollection_List McCadAEV_ListOfEditorPtr +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfEditor_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfEditor_0.cxx new file mode 100644 index 0000000..45f13f0 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfEditor_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListOfEditor_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfEditor_HeaderFile +#include +#endif +//McCadAEV_ListNodeOfListOfEditor::~McCadAEV_ListNodeOfListOfEditor() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_ListNodeOfListOfEditor_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_ListNodeOfListOfEditor", + sizeof(McCadAEV_ListNodeOfListOfEditor), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_ListNodeOfListOfEditor) Handle(McCadAEV_ListNodeOfListOfEditor)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_ListNodeOfListOfEditor) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditor))) { + _anOtherObject = Handle(McCadAEV_ListNodeOfListOfEditor)((Handle(McCadAEV_ListNodeOfListOfEditor)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_ListNodeOfListOfEditor::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditor) ; +} +//Standard_Boolean McCadAEV_ListNodeOfListOfEditor::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditor) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadAEV_ListNodeOfListOfEditor::~Handle_McCadAEV_ListNodeOfListOfEditor() {} +#define Item McCadAEV_Editor +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditor +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditor_Type_() +#define TCollection_List McCadAEV_ListOfEditor +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfViewerPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfViewerPtr_0.cxx new file mode 100644 index 0000000..46b6817 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfViewerPtr_0.cxx @@ -0,0 +1,92 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_ListOfViewerPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfViewerPtr_HeaderFile +#include +#endif +//McCadAEV_ListNodeOfListOfViewerPtr::~McCadAEV_ListNodeOfListOfViewerPtr() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_ListNodeOfListOfViewerPtr_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_ListNodeOfListOfViewerPtr", + sizeof(McCadAEV_ListNodeOfListOfViewerPtr), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_ListNodeOfListOfViewerPtr) Handle(McCadAEV_ListNodeOfListOfViewerPtr)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_ListNodeOfListOfViewerPtr) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewerPtr))) { + _anOtherObject = Handle(McCadAEV_ListNodeOfListOfViewerPtr)((Handle(McCadAEV_ListNodeOfListOfViewerPtr)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_ListNodeOfListOfViewerPtr::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewerPtr) ; +} +//Standard_Boolean McCadAEV_ListNodeOfListOfViewerPtr::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewerPtr) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadAEV_ListNodeOfListOfViewerPtr::~Handle_McCadAEV_ListNodeOfListOfViewerPtr() {} +#define Item McCadAEV_ViewerPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewerPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewerPtr_Type_() +#define TCollection_List McCadAEV_ListOfViewerPtr +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfViewer_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfViewer_0.cxx new file mode 100644 index 0000000..85fd5e2 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListNodeOfListOfViewer_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListOfViewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfViewer_HeaderFile +#include +#endif +//McCadAEV_ListNodeOfListOfViewer::~McCadAEV_ListNodeOfListOfViewer() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_ListNodeOfListOfViewer_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_ListNodeOfListOfViewer", + sizeof(McCadAEV_ListNodeOfListOfViewer), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_ListNodeOfListOfViewer) Handle(McCadAEV_ListNodeOfListOfViewer)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_ListNodeOfListOfViewer) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewer))) { + _anOtherObject = Handle(McCadAEV_ListNodeOfListOfViewer)((Handle(McCadAEV_ListNodeOfListOfViewer)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_ListNodeOfListOfViewer::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewer) ; +} +//Standard_Boolean McCadAEV_ListNodeOfListOfViewer::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewer) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadAEV_ListNodeOfListOfViewer::~Handle_McCadAEV_ListNodeOfListOfViewer() {} +#define Item McCadAEV_Viewer +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewer +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewer_Type_() +#define TCollection_List McCadAEV_ListOfViewer +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListOfEditorPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListOfEditorPtr_0.cxx new file mode 100644 index 0000000..e71f589 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListOfEditorPtr_0.cxx @@ -0,0 +1,46 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfEditorPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#include +#endif + + +#define Item McCadAEV_EditorPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditorPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditorPtr_Type_() +#define TCollection_List McCadAEV_ListOfEditorPtr +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListOfEditor_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListOfEditor_0.cxx new file mode 100644 index 0000000..3582ca9 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListOfEditor_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfEditor_HeaderFile +#include +#endif +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfEditor_HeaderFile +#include +#endif + + +#define Item McCadAEV_Editor +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditor +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditor_Type_() +#define TCollection_List McCadAEV_ListOfEditor +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListOfViewerPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListOfViewerPtr_0.cxx new file mode 100644 index 0000000..7411f5c --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListOfViewerPtr_0.cxx @@ -0,0 +1,46 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfViewerPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#include +#endif + + +#define Item McCadAEV_ViewerPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewerPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewerPtr_Type_() +#define TCollection_List McCadAEV_ListOfViewerPtr +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_ListOfViewer_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_ListOfViewer_0.cxx new file mode 100644 index 0000000..495b712 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_ListOfViewer_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListIteratorOfListOfViewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_ListNodeOfListOfViewer_HeaderFile +#include +#endif + + +#define Item McCadAEV_Viewer +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewer +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewer_Type_() +#define TCollection_List McCadAEV_ListOfViewer +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditorPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditorPtr_0.cxx new file mode 100644 index 0000000..15d7794 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditorPtr_0.cxx @@ -0,0 +1,87 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_SequenceOfEditorPtr_HeaderFile +#include +#endif +//McCadAEV_SequenceNodeOfSequenceOfEditorPtr::~McCadAEV_SequenceNodeOfSequenceOfEditorPtr() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_SequenceNodeOfSequenceOfEditorPtr_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_SequenceNodeOfSequenceOfEditorPtr", + sizeof(McCadAEV_SequenceNodeOfSequenceOfEditorPtr), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr) Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditorPtr))) { + _anOtherObject = Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)((Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_SequenceNodeOfSequenceOfEditorPtr::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditorPtr) ; +} +//Standard_Boolean McCadAEV_SequenceNodeOfSequenceOfEditorPtr::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditorPtr) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr::~Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr() {} +#define SeqItem McCadAEV_EditorPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditorPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditorPtr +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditor_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditor_0.cxx new file mode 100644 index 0000000..758a734 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfEditor_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _McCadAEV_SequenceOfEditor_HeaderFile +#include +#endif +//McCadAEV_SequenceNodeOfSequenceOfEditor::~McCadAEV_SequenceNodeOfSequenceOfEditor() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_SequenceNodeOfSequenceOfEditor_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_SequenceNodeOfSequenceOfEditor", + sizeof(McCadAEV_SequenceNodeOfSequenceOfEditor), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_SequenceNodeOfSequenceOfEditor) Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_SequenceNodeOfSequenceOfEditor) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditor))) { + _anOtherObject = Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)((Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_SequenceNodeOfSequenceOfEditor::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditor) ; +} +//Standard_Boolean McCadAEV_SequenceNodeOfSequenceOfEditor::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditor) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadAEV_SequenceNodeOfSequenceOfEditor::~Handle_McCadAEV_SequenceNodeOfSequenceOfEditor() {} +#define SeqItem McCadAEV_Editor +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditor_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditor +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewerPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewerPtr_0.cxx new file mode 100644 index 0000000..8f07f43 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewerPtr_0.cxx @@ -0,0 +1,87 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_SequenceOfViewerPtr_HeaderFile +#include +#endif +//McCadAEV_SequenceNodeOfSequenceOfViewerPtr::~McCadAEV_SequenceNodeOfSequenceOfViewerPtr() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_SequenceNodeOfSequenceOfViewerPtr_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_SequenceNodeOfSequenceOfViewerPtr", + sizeof(McCadAEV_SequenceNodeOfSequenceOfViewerPtr), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr) Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewerPtr))) { + _anOtherObject = Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)((Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_SequenceNodeOfSequenceOfViewerPtr::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewerPtr) ; +} +//Standard_Boolean McCadAEV_SequenceNodeOfSequenceOfViewerPtr::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewerPtr) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr::~Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr() {} +#define SeqItem McCadAEV_ViewerPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewerPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewerPtr +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewer_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewer_0.cxx new file mode 100644 index 0000000..91bcce0 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceNodeOfSequenceOfViewer_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_SequenceOfViewer_HeaderFile +#include +#endif +//McCadAEV_SequenceNodeOfSequenceOfViewer::~McCadAEV_SequenceNodeOfSequenceOfViewer() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadAEV_SequenceNodeOfSequenceOfViewer_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadAEV_SequenceNodeOfSequenceOfViewer", + sizeof(McCadAEV_SequenceNodeOfSequenceOfViewer), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadAEV_SequenceNodeOfSequenceOfViewer) Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadAEV_SequenceNodeOfSequenceOfViewer) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewer))) { + _anOtherObject = Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)((Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadAEV_SequenceNodeOfSequenceOfViewer::DynamicType() const +{ + return STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewer) ; +} +//Standard_Boolean McCadAEV_SequenceNodeOfSequenceOfViewer::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewer) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadAEV_SequenceNodeOfSequenceOfViewer::~Handle_McCadAEV_SequenceNodeOfSequenceOfViewer() {} +#define SeqItem McCadAEV_Viewer +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewer_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewer +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceOfEditorPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfEditorPtr_0.cxx new file mode 100644 index 0000000..45d4503 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfEditorPtr_0.cxx @@ -0,0 +1,44 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile +#include +#endif + + +#define SeqItem McCadAEV_EditorPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditorPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditorPtr +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceOfEditor_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfEditor_0.cxx new file mode 100644 index 0000000..37b7746 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfEditor_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile +#include +#endif + + +#define SeqItem McCadAEV_Editor +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditor_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditor +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceOfViewerPtr_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfViewerPtr_0.cxx new file mode 100644 index 0000000..d7cc5d6 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfViewerPtr_0.cxx @@ -0,0 +1,44 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile +#include +#endif + + +#define SeqItem McCadAEV_ViewerPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewerPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewerPtr +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_SequenceOfViewer_0.cxx b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfViewer_0.cxx new file mode 100644 index 0000000..c276521 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_SequenceOfViewer_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile +#include +#endif + + +#define SeqItem McCadAEV_Viewer +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewer_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewer +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadAEV/McCadAEV_Viewer.cxx b/src/MCCAD/McCadAEV/McCadAEV_Viewer.cxx new file mode 100644 index 0000000..f4f9d56 --- /dev/null +++ b/src/MCCAD/McCadAEV/McCadAEV_Viewer.cxx @@ -0,0 +1,76 @@ +#include +//qiu #include +#include +#include + +McCadAEV_Viewer::McCadAEV_Viewer() +{ + myViewer = NULL; + myContext = NULL; + myCollector = NULL; + myName = "McCadViewer"; +} + +void McCadAEV_Viewer::Destroy() +{ + +} + +void McCadAEV_Viewer::Update() +{ +} + +void McCadAEV_Viewer::Reconfigure() +{ + +} + +Handle(AIS_InteractiveContext) McCadAEV_Viewer::GetContext() const +{ + return myContext; +} + +void McCadAEV_Viewer::SetContext(const Handle(AIS_InteractiveContext)& theContext) +{ + myContext = theContext; +} + +Handle(V3d_Viewer) McCadAEV_Viewer::MakeCasViewer(const Standard_CString theDisplay, + const Standard_ExtString theName, const Standard_CString theDomain, + const Standard_Real theViewSize, const V3d_TypeOfOrientation theViewProj, + const Standard_Boolean theCompMode, const Standard_Boolean theDefCompMode) +{ +//qiu static Handle(Graphic3d_GraphicDevice) defaultdevice; +//qiu if(defaultdevice.IsNull()) +//qiu defaultdevice = new Graphic3d_GraphicDevice(theDisplay); + static Handle(Graphic3d_GraphicDriver) defaultdevice; +// if(defaultdevice.IsNull()) +// defaultdevice = new Graphic3d_GraphicDriver(theDisplay); + + Handle(V3d_Viewer) aCascadeViewer = new V3d_Viewer(defaultdevice, theName, theDomain, + theViewSize, theViewProj, Quantity_NOC_GRAY30, + V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT, + theCompMode, theDefCompMode, V3d_TEX_NONE); + return aCascadeViewer; +} + +Handle(V3d_Viewer) McCadAEV_Viewer::GetViewer() const +{ + return myViewer; +} + +void McCadAEV_Viewer::SetViewer(const Handle(V3d_Viewer)& theViewer) +{ + myViewer = theViewer; +} + +TCollection_AsciiString McCadAEV_Viewer::GetName() const +{ + return myName; +} + +void McCadAEV_Viewer::SetName(const TCollection_AsciiString& theName) +{ + myName = theName; +} + diff --git a/src/MCCAD/McCadBoolExp/McCadBoolExp_ExprParser.cxx b/src/MCCAD/McCadBoolExp/McCadBoolExp_ExprParser.cxx new file mode 100644 index 0000000..23a9f4f --- /dev/null +++ b/src/MCCAD/McCadBoolExp/McCadBoolExp_ExprParser.cxx @@ -0,0 +1,134 @@ +#include +#include +#include +#include +#include + +using namespace std; + +static unsigned int ii; +static vector vg; + +McCadBoolExp_ExprParser::McCadBoolExp_ExprParser() +{ + NotDone(); + myInputInFixCSG = new TColStd_HSequenceOfAsciiString; + myInFixCSG = new TColStd_HSequenceOfAsciiString; +} + +McCadBoolExp_ExprParser::McCadBoolExp_ExprParser(const Handle(TColStd_HSequenceOfAsciiString)& inputCSGSeq) +{ + NotDone(); + myInFixCSG = new TColStd_HSequenceOfAsciiString; + Init(inputCSGSeq); +} + +void McCadBoolExp_ExprParser::Init(const Handle(TColStd_HSequenceOfAsciiString)& inputCSGSeq) +{ + ii=0; + vg.clear(); + myInFixCSG->Clear(); + + myInputInFixCSG = inputCSGSeq; + for ( int it = 1; it <= myInputInFixCSG->Length(); it++ ) + { + vg.push_back(myInputInFixCSG->Value(it)); + } + if (vg.size()) + { + Done(); + Expression(); + if (!IsDone()) cout << "Error in the Boolean Expression!! " << endl; + } + else + { + cout << "Empty Boolean Expression!! " << endl; + NotDone(); + } +} + +Standard_Boolean McCadBoolExp_ExprParser::IsDone() const +{ + return myIsDone; +} + +void McCadBoolExp_ExprParser::Done() +{ + myIsDone = Standard_True; +} + +void McCadBoolExp_ExprParser::NotDone() +{ + myIsDone = Standard_False; +} + +void McCadBoolExp_ExprParser::SetInFix(const Handle(TColStd_HSequenceOfAsciiString)& inputCSGSeq) +{ + Init(inputCSGSeq); +} + +Handle(TColStd_HSequenceOfAsciiString) McCadBoolExp_ExprParser::GetInFix() const +{ + return myInFixCSG; +} + +void McCadBoolExp_ExprParser::Expression() +{ + Term(); + if (ii < vg.size() && vg[ii] == ":") + { + //cout << " " << vg[ii] << " "; + myInFixCSG->Append(vg[ii]); + ii++; + Expression(); + } +} + +void McCadBoolExp_ExprParser::Term() +{ + Factor(); + if ((ii < vg.size()) && ((vg[ii] == "(" )|| (vg[ii] != ")" && vg[ii] != ":"))) + { + if (vg[ii-1] !="#") + { + //cout << " | "; + TCollection_AsciiString aTerm("|"); + myInFixCSG->Append(aTerm); + } + Term(); + } +} + +void McCadBoolExp_ExprParser::Factor() +{ + if (vg[ii] == "(") + { + //cout << " " << vg[ii] << " "; + myInFixCSG->Append(vg[ii]); + ii++; + Expression(); + if (ii < vg.size() && vg[ii] == ")") + { + //cout << " " << vg[ii] << " "; + myInFixCSG->Append(vg[ii]); + ii++; + } + else + { + cout<< " " << vg[ii] << " " << ii <<" Error#1: Boolean Expression Mismatch !!" << endl; + NotDone(); + } + } + else if (((vg[ii] != ")" && vg[ii] != ":") || vg[ii] == "#") && ii < vg.size()) + { + //cout << " " << vg[ii]; + myInFixCSG->Append(vg[ii]); + ii++; + } + else + { + cout<< " " << vg[ii] << " " << ii <<" Error#2: Boolean Expression Mismatch !!" << endl; + NotDone(); + } +} + diff --git a/src/MCCAD/McCadBoolExp/McCadBoolExp_PostFixer.cxx b/src/MCCAD/McCadBoolExp/McCadBoolExp_PostFixer.cxx new file mode 100644 index 0000000..c649708 --- /dev/null +++ b/src/MCCAD/McCadBoolExp/McCadBoolExp_PostFixer.cxx @@ -0,0 +1,257 @@ +#include + +#include +#include +#include +#include +#include + +#include + +using namespace std; + +namespace +{ + inline bool isws(char c, char const * const wstr) + { + return (strchr(wstr, c) != NULL); + } +} + +template void stringtok(Container &l, string const &s, char const * const ws = " \t\n") +{ + const string::size_type S = s.size(); + string::size_type i = 0; + + while (i < S) + { + // eat leading whitespace + while ((i < S) && (isws(s[i], ws))) + ++i; + if (i == S) + return; // nothing left but WS + + // find end of word + string::size_type j = i+1; + while ((j < S) && (!isws(s[j], ws))) + ++j; + + // add word + l.push_back(s.substr(i, j-i)); + + // set up for next loop + i = j+1; + } +} + +McCadBoolExp_PostFixer::McCadBoolExp_PostFixer() +{ + myIsDone = Standard_False; + myPostFixCSG = new TColStd_HSequenceOfAsciiString; +} + +McCadBoolExp_PostFixer::McCadBoolExp_PostFixer( const TCollection_AsciiString& theCSG) +{ + myIsDone = Standard_False; + myPostFixCSG = new TColStd_HSequenceOfAsciiString; + Init(theCSG); +} + +void McCadBoolExp_PostFixer::Init(const TCollection_AsciiString& theCSG) +{ + //cout << "POSTFIXER : IN : " << theCSG << endl; + string s = theCSG.ToCString(); + string::iterator ittr; + ittr = s.begin(); + string srp = " "; + + while (ittr != s.end() ) + { + if ((isdigit(*ittr) || *ittr == '-' || *ittr=='.') && ittr != s.end()) + while ((isdigit(*ittr) || *ittr == '-' || *ittr=='.' || *ittr=='E' || *ittr=='e' ) && ittr != s.end()) + srp +=*ittr++;//append all digits (real, and or exp) to srp + else + {//make some space between real values and operator + srp +=" "; + srp +=*ittr++; + srp +=" "; + } + srp +=" "; + } + + list tmpls; + list::iterator illl; + stringtok(tmpls, srp); //break string to tokens and save to tmpls + + if (tmpls.size() == 0) + { + cout << "Error :: empty CSG expression." << endl; + NotDone(); + return; + } + + myInPutCSG = new TColStd_HSequenceOfAsciiString; + myInFixCSG = new TColStd_HSequenceOfAsciiString; + + for (illl = tmpls.begin(); illl != tmpls.end(); ++illl) + { +//qiu char str[(*illl).size()]; +//qiu strcpy(str, (*illl).c_str()); +//qiu TCollection_AsciiString aTerm(str); + TCollection_AsciiString aTerm((*illl).c_str()); + myInPutCSG->Append(aTerm); + } + /*cout << "in McCadBoolExp_PostFixer.cxx\n"; + for(Standard_Integer i=1; i<=myInPutCSG->Length(); i++) + cout << myInPutCSG->Value(i).ToCString() << " "; + cout << endl;*/ + + McCadBoolExp_ExprParser aParser; + aParser.Init(myInPutCSG); + if (!aParser.IsDone()) + { + cout << "Error :: Parsing CSG expression failed." << endl; + NotDone(); + return; + } + Handle(TColStd_HSequenceOfAsciiString) theInFixCSG = aParser.GetInFix(); + myInFixCSG->Clear(); + myInFixCSG->Append(theInFixCSG); + + /*for(Standard_Integer i=1; i<=myInFixCSG->Length(); i++) + cout << myInFixCSG->Value(i).ToCString() << " "; + cout << endl;*/ + + Handle(TColStd_HSequenceOfAsciiString) thePostFixCSG = PostFix(myInFixCSG); + if (thePostFixCSG->Length() == 0) + { + cout << "Error :: Postfixing CSG expression failed." << endl; + NotDone(); + return; + } + + myPostFixCSG->Append(thePostFixCSG); + + /*for(Standard_Integer i=1; i<=myPostFixCSG->Length(); i++) + cout << myPostFixCSG->Value(i).ToCString() << " "; + cout << endl;*/ + + Done(); +} + +Standard_Boolean McCadBoolExp_PostFixer::IsDone() const +{ + return myIsDone; +} + +void McCadBoolExp_PostFixer::Done() +{ + myIsDone = Standard_True; +} + +void McCadBoolExp_PostFixer::NotDone() +{ + myIsDone = Standard_False; +} + +Standard_Integer McCadBoolExp_PostFixer::Priority( + const TCollection_AsciiString& theToken) const +{ + if (theToken == "(") + return 4; + else if (theToken == "#") + return 3; // complement + else if (theToken == "|") + return 2; // intersection + else if (theToken == ":") + return 1; // union + else + return 0; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadBoolExp_PostFixer::PostFix(const Handle(TColStd_HSequenceOfAsciiString)& theInFix) +{ + Handle(TColStd_HSequenceOfAsciiString) thePostFix = new TColStd_HSequenceOfAsciiString; + + stack save; + + for ( int it = 1; it <= theInFix->Length(); it++ ) + { + TCollection_AsciiString aTerm = theInFix->Value(it); + if( (aTerm != ")") && (aTerm != "(") && (aTerm != "#") && (aTerm != "|") && (aTerm != ":")) + { // an operand + thePostFix->Append(aTerm); + } + else if (aTerm == ")") + { + // a nested expression + while (true) + { + TCollection_AsciiString anItem = save.top(); + save.pop(); + if (anItem == "(") + break; + thePostFix->Append(anItem); + } + } + else + { + // an operator + while (!save.empty() && Priority(save.top()) > Priority(aTerm)) + { + if (save.top() == "(" && aTerm != ")") + // Don't pop parenthesis unless current term is parenthesis + break; + thePostFix->Append(save.top()); + save.pop(); + } + save.push(aTerm); + } + } + while (!save.empty()) + { + // flush the stack + thePostFix->Append(save.top()); + save.pop(); + } + return thePostFix; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadBoolExp_PostFixer::GetPostFix() const +{ + if(IsDone()) return myPostFixCSG; + else + { + cout << "Warning:: Null PostFix Epression !!" << endl; + return NULL; + } +} + +Handle(TColStd_HSequenceOfAsciiString) McCadBoolExp_PostFixer::GetInFix() const +{ + return myInFixCSG; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadBoolExp_PostFixer::GetInput() const +{ + return myInPutCSG; +} + +void McCadBoolExp_PostFixer::PrintInFix(Standard_OStream& theStream) +{ + for (int it = 1; it <= myInFixCSG->Length(); it++) + { + theStream << (myInFixCSG->Value(it)).ToCString() << " "; + } + theStream << endl; +} + +void McCadBoolExp_PostFixer::PrintPostFix(Standard_OStream& theStream) +{ + for (int it = 1; it <= myPostFixCSG->Length(); it++) + { + theStream << (myPostFixCSG->Value(it)).ToCString() << " "; + } + theStream << endl; +} + diff --git a/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_FaceAnalyser.cxx b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_FaceAnalyser.cxx new file mode 100644 index 0000000..e343794 --- /dev/null +++ b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_FaceAnalyser.cxx @@ -0,0 +1,146 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +McCadCSGAdapt_FaceAnalyser::McCadCSGAdapt_FaceAnalyser() +{ + +} + +McCadCSGAdapt_FaceAnalyser::McCadCSGAdapt_FaceAnalyser(const TopoDS_Shell& theShell) +{ + Init(theShell); +} + +void McCadCSGAdapt_FaceAnalyser::Init(const TopoDS_Shell& theShell) +{ + myPrecision = 1.e-02; + myShell =theShell; + isFixed = Standard_False; + haveSmallFaces = HaveSmallFaces(); + // haveSmallEdges = HaveSmallEdges(); + haveSmallEdges = Standard_False; + haveIndirect = Standard_True; +} + +void McCadCSGAdapt_FaceAnalyser::SetPrecision(const Standard_Real thePrecision) +{ + myPrecision = thePrecision; +} + +Standard_Real McCadCSGAdapt_FaceAnalyser::GetPrecision() const +{ + return myPrecision; +} + +TopoDS_Shell McCadCSGAdapt_FaceAnalyser::FixedShell() +{ + if(isFixed) + return myShell; + else + { + Fix(); + return FixedShell(); + } +} + +Standard_Boolean McCadCSGAdapt_FaceAnalyser::HaveSmallFaces() const +{ + if(myShell.IsNull()) return Standard_False; + + ShapeAnalysis_CheckSmallFace FaceAnal; + Standard_Integer NbSmallfaces = 0; + for(TopExp_Explorer theExp(myShell,TopAbs_FACE); theExp.More(); theExp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(theExp.Current()); + TopoDS_Edge E1,E2; + if(FaceAnal.CheckSpotFace(theFace,myPrecision) || FaceAnal.CheckStripFace(theFace,E1,E2,myPrecision)) + NbSmallfaces++; + } + + if(NbSmallfaces) + return Standard_True; + else return Standard_False; + +} + +void McCadCSGAdapt_FaceAnalyser::DeleteSmallFaces() +{ + ShapeFix_FixSmallFace FaceFix; + FaceFix.Init(myShell); + TopoDS_Shell theShell = TopoDS::Shell(FaceFix.RemoveSmallFaces()); + myShell = theShell; + haveSmallFaces = Standard_False; + +} + +Standard_Boolean McCadCSGAdapt_FaceAnalyser::HaveSmallEdges() const +{ + Standard_Boolean tmpBoolean=Standard_False; + + if(myShell.IsNull()) return tmpBoolean; + + for(TopExp_Explorer theExp(myShell,TopAbs_FACE); theExp.More(); theExp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(theExp.Current()); + + TopoDS_Wire theWire = TopoDS::Wire(theFace); + + ShapeAnalysis_Wire WireAnal(theWire,theFace,myPrecision); + + tmpBoolean = WireAnal.CheckSmall(myPrecision); + } + + return tmpBoolean; + +} + +void McCadCSGAdapt_FaceAnalyser::DeleteSmallEdges() +{ + Handle(ShapeBuild_ReShape) theContext = new ShapeBuild_ReShape(); + TopoDS_Shell theShell = TopoDS::Shell(ShapeFix::RemoveSmallEdges(myShell,myPrecision,theContext)); + myShell = theShell; + haveSmallEdges = Standard_False; + +} + +Standard_Boolean McCadCSGAdapt_FaceAnalyser::HaveInDirectFaces() const +{ + return haveIndirect; +} + +void McCadCSGAdapt_FaceAnalyser::DoDirectFaces() +{ + TopoDS_Shape theShape = ShapeCustom::DirectFaces(myShell); + myShell = TopoDS::Shell(theShape); + haveIndirect = Standard_False; + +} + +void McCadCSGAdapt_FaceAnalyser::Fix() +{ + isFixed = Standard_True; + + if(haveSmallEdges) + DeleteSmallEdges(); + if(haveSmallFaces) + DeleteSmallFaces(); + if(haveIndirect) + DoDirectFaces(); + +} + diff --git a/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShapeAnalyser.cxx b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShapeAnalyser.cxx new file mode 100644 index 0000000..caf2ae2 --- /dev/null +++ b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShapeAnalyser.cxx @@ -0,0 +1,141 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +//================================================================================== +// Function: McCadCSGAdapt_ShapeAnalyser() +// Description : +// Author : H. Tsige-Tamirat +// Date : Fri Jan 2 19:06:57 CET 2001 +//================================================================================== + +McCadCSGAdapt_ShapeAnalyser::McCadCSGAdapt_ShapeAnalyser() +{ + +} +//================================================================================== +// Function: McCadCSGAdapt_ShapeAnalyser(const TopoDS_Shape& theShape) +// Description : +// Author : H. Tsige-Tamirat +// Date : Fri Jan 2 19:06:57 CET 2001 +//================================================================================== + +McCadCSGAdapt_ShapeAnalyser::McCadCSGAdapt_ShapeAnalyser(const TopoDS_Shape& theShape) +{ + + myShape = theShape; + +} + +void McCadCSGAdapt_ShapeAnalyser::Init(const TopoDS_Shape& theShape) +{ + myShape = theShape; + +} + +void McCadCSGAdapt_ShapeAnalyser::SetTolerance(const Standard_Real theTol) +{ + + if (myShape.IsNull() || theTol <= 0) return; + ShapeFix_ShapeTolerance ShapeTol; + ShapeTol.SetTolerance(myShape,theTol); + +} + +Standard_Real McCadCSGAdapt_ShapeAnalyser::GetTolerance() const +{ + ShapeAnalysis_ShapeTolerance ShapeTolAnalysis; + return ShapeTolAnalysis.Tolerance(myShape,0,TopAbs_SHAPE); + +} + +void McCadCSGAdapt_ShapeAnalyser::PrintContent(Standard_OStream& theStream) const +{ + + Standard_Integer NbSharedSolids,NbSolidsWithVoids, NbSolids; + Standard_Integer NbSharedShells, NbShells, NbFaces, NbWires, NbEdges, NbVertices; + TopExp_Explorer exp; + TopTools_MapOfShape mapsh; + NbSharedSolids= 0; + NbSolidsWithVoids=0; + NbSolids = 0; + for (exp.Init (myShape,TopAbs_SOLID); exp.More(); exp.Next()) { + TopoDS_Solid theSolid = TopoDS::Solid (exp.Current()); + theSolid.Location(TopLoc_Location()); + mapsh.Add(theSolid); + Standard_Integer nbs = 0; + for (TopExp_Explorer shex(theSolid,TopAbs_SHELL); shex.More(); shex.Next()) + nbs ++; + if (nbs > 1) NbSolidsWithVoids++; + NbSolids++; + } + NbSharedSolids = mapsh.Extent(); + + NbShells=0; + NbFaces = 0; + NbWires = 0; + NbEdges = 0; + NbVertices = 0; + + mapsh.Clear(); + + for (exp.Init (myShape,TopAbs_SHELL); exp.More(); exp.Next()) { + NbShells++; + TopoDS_Shell theShell = TopoDS::Shell(exp.Current()); + theShell.Location(TopLoc_Location()); + mapsh.Add(theShell); + for (TopExp_Explorer shel (theShell,TopAbs_FACE); shel.More(); shel.Next()) + TopoDS_Face theFace = TopoDS::Face(shel.Current()); + NbFaces++; + } + NbSharedShells = mapsh.Extent(); + + theStream << "====== Shape Content Analysis =====================" <<'\n'; + theStream << "Shared Solids: " << NbSharedSolids <<'\n'; + theStream << "Solids: " << NbSolids <<'\n'; + theStream << "Solids with voids: " << NbSolidsWithVoids <<'\n'; + theStream << "========================================" <<'\n'; + theStream << "Shared Shells: " << NbSharedShells <<'\n'; + theStream << "Shells: " << NbShells <<'\n'; + theStream << "Total Number of Faces: " << NbFaces <<'\n'; + theStream << "========================================" <<'\n'; +} + +void McCadCSGAdapt_ShapeAnalyser::PrintInfo(Standard_OStream& theStream) const +{ + // print here avrage tolerance for face, edge and vertices. + ShapeAnalysis_ShapeTolerance ShapeTolAnalysis; + Standard_Real AvTol = ShapeTolAnalysis.Tolerance(myShape,0,TopAbs_SHAPE); + Standard_Real MinTol = ShapeTolAnalysis.Tolerance(myShape,-1,TopAbs_SHAPE); + Standard_Real MaxTol = ShapeTolAnalysis.Tolerance(myShape,1,TopAbs_SHAPE); + theStream << "====== Tolerance =====================" <<'\n'; + theStream << "Avrage global Tolerance: " << AvTol <<'\n'; + theStream << "Minimal global Tolerance: " << MinTol <<'\n'; + theStream << "Maximal global Tolerance: " << MaxTol <<'\n'; + theStream << "========================================" <<'\n'; +} +void McCadCSGAdapt_ShapeAnalyser::ScaleShape(const Standard_Real theFactor) +{ + + TopoDS_Shape theScaledShape = ShapeCustom::ScaleShape(myShape, theFactor); + myShape = theScaledShape; + +} + +TopoDS_Shape McCadCSGAdapt_ShapeAnalyser::Shape() const +{ + return myShape; +} diff --git a/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShapeGeomAnalyser.cxx b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShapeGeomAnalyser.cxx new file mode 100644 index 0000000..e4c1b98 --- /dev/null +++ b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShapeGeomAnalyser.cxx @@ -0,0 +1,477 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +McCadCSGAdapt_ShapeGeomAnalyser::McCadCSGAdapt_ShapeGeomAnalyser() +{ + + myConvertibly = false; + myIsDone = false; + + myNbPlane= 0; + myNbCylinder= 0; + myNbCone= 0; + myNbSphere= 0; + myNbTorus= 0; + myNbBezierSurface= 0; + myNbBSplineSurface= 0; + myNbSurfaceOfRevolution= 0; + myNbSurfaceOfExtrusion= 0; + myNbOffsetSurface= 0; + myNbUnspecifiedSurf= 0; + + myNbLine= 0; + myNbCircle= 0; + myNbEllipse= 0; + myNbHyperbola= 0; + myNbParabola= 0; + myNbBezierCurve= 0; + myNbBSplineCurve= 0; + myNbUnspecifiedCurves= 0; +} + +McCadCSGAdapt_ShapeGeomAnalyser::McCadCSGAdapt_ShapeGeomAnalyser( + const TopoDS_Shape& theShape) +{ + myShape = theShape; + myConvertibly = false; + myIsDone = false; + + myNbPlane= 0; + myNbCylinder= 0; + myNbCone= 0; + myNbSphere= 0; + myNbTorus= 0; + myNbBezierSurface= 0; + myNbBSplineSurface= 0; + myNbSurfaceOfRevolution= 0; + myNbSurfaceOfExtrusion= 0; + myNbOffsetSurface= 0; + myNbUnspecifiedSurf= 0; + + myNbLine= 0; + myNbCircle= 0; + myNbEllipse= 0; + myNbHyperbola= 0; + myNbParabola= 0; + myNbBezierCurve= 0; + myNbBSplineCurve= 0; + myNbUnspecifiedCurves= 0; + +} +void McCadCSGAdapt_ShapeGeomAnalyser::SetShape(const TopoDS_Shape& theShape) +{ + myShape = theShape; +} + +TopoDS_Shape McCadCSGAdapt_ShapeGeomAnalyser::GetShape() const +{ + return myShape; +} + +void McCadCSGAdapt_ShapeGeomAnalyser::Init() +{ + + if (myShape.IsNull()) + { + cout << "Set the shape first!" << endl; + myIsDone = false; + return; + } + + Standard_Integer fCount = 0; + Handle_Geom_Surface theSurface; + GeomAbs_SurfaceType theSurfType; + Handle_Geom_Curve theCurve; + GeomAbs_CurveType theCurveType; + Handle_Geom_TrimmedCurve trimCurve; + Handle_Geom_Curve basisCurve; + Handle(Geom_Surface) myNewSurf; + + // ShapeCustom_Surface Convert; + Handle(Geom_BSplineSurface) myBS; + + for (TopExp_Explorer exp(myShape, TopAbs_FACE); exp.More(); exp.Next()) + { + fCount++; + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + theSurface = BRep_Tool::Surface(theFace); + theSurfType = GeomAdaptor_Surface(theSurface).GetType(); + switch (theSurfType) + { + case GeomAbs_Plane: + myNbPlane++; + break; + case GeomAbs_Cylinder: + myNbCylinder++; + break; + case GeomAbs_Cone: + myNbCone++; + break; + case GeomAbs_Sphere: + myNbSphere++; + break; + case GeomAbs_Torus: + myNbTorus++; + break; + case GeomAbs_BezierSurface: + myNbBezierSurface++; + break; + case GeomAbs_BSplineSurface: + myNbBSplineSurface++; + break; + case GeomAbs_SurfaceOfRevolution: + myNbSurfaceOfRevolution++; + break; + case GeomAbs_SurfaceOfExtrusion: + myNbSurfaceOfExtrusion++; + break; + case GeomAbs_OffsetSurface: + myNbOffsetSurface++; + break; + default: + myNbUnspecifiedSurf++; + break; + } + + } + + for (TopExp_Explorer exp(myShape, TopAbs_EDGE); exp.More(); exp.Next()) + { + + Standard_Real first, last; + + theCurve = BRep_Tool::Curve(TopoDS::Edge(exp.Current()), first, last); + + if (!theCurve.IsNull()) + { + if (theCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) + { + cout << " Might be a trimmed curve!!" << endl; + trimCurve = Handle_Geom_TrimmedCurve::DownCast(theCurve); + basisCurve = trimCurve->BasisCurve(); + theCurveType = GeomAdaptor_Curve(basisCurve).GetType(); + } + else + { + theCurveType = GeomAdaptor_Curve(theCurve).GetType(); + + } + + switch (theCurveType) + { + case GeomAbs_Line: + myNbLine++; + break; + case GeomAbs_Circle: + myNbCircle++; + + break; + case GeomAbs_Ellipse: + myNbEllipse++; + + break; + case GeomAbs_Hyperbola: + myNbHyperbola++; + + break; + case GeomAbs_Parabola: + myNbParabola++; + + break; + case GeomAbs_BezierCurve: + myNbBezierCurve++; + + case GeomAbs_BSplineCurve: + myNbBSplineCurve++; + + break; + default: + myNbUnspecifiedCurves++; + + break; + } + } + } + int nonAnalytic = 0; + nonAnalytic = myNbBezierSurface + myNbBSplineSurface + + myNbSurfaceOfRevolution + myNbSurfaceOfExtrusion + + myNbOffsetSurface + myNbUnspecifiedSurf; + if (nonAnalytic == 0) + myConvertibly = true; + else + myConvertibly = false; + myIsDone = true; +} + +void McCadCSGAdapt_ShapeGeomAnalyser::PrintSurfaceInfo( + Standard_OStream& theStream) +{ + int NumberOfAllSurf = myNbPlane + myNbCylinder + myNbCone + myNbSphere + + myNbTorus + myNbBezierSurface + myNbBSplineSurface + + myNbSurfaceOfRevolution + myNbSurfaceOfExtrusion + + myNbOffsetSurface + myNbUnspecifiedSurf; + + int NumberOfAllCurves = myNbLine + myNbCircle + myNbEllipse + myNbHyperbola + + myNbParabola + myNbBezierCurve + myNbBSplineCurve + + myNbUnspecifiedCurves; + + theStream << " Summary of solid geometric content " << endl; + theStream + << "============================================================ " + << endl; + theStream << endl; + theStream << endl; + theStream << " Surface Type " <<"Number of Surfaces" << endl; + theStream << " Plane " << myNbPlane << endl; + theStream << " Cylinder " << myNbCylinder << endl; + theStream << " Cone " << myNbCone << endl; + theStream << " Sphere " << myNbSphere << endl; + theStream << " Torus " << myNbTorus << endl; + theStream << " Bezier " << myNbBezierSurface << endl; + theStream << " BSpline " << myNbBSplineSurface << endl; + theStream << " Revolution " << myNbSurfaceOfRevolution << endl; + theStream << " Extrusion " << myNbSurfaceOfExtrusion << endl; + theStream << " Offset " << myNbOffsetSurface << endl; + theStream << " Unspecified " << myNbUnspecifiedSurf << endl; + theStream << endl; + theStream << " Total Number of Surfaces = " << NumberOfAllSurf << endl; + theStream + << "============================================================ " + << endl; + theStream << endl; + theStream << endl; + theStream << " Curve Type " <<"Number of Curves" << endl; + theStream << " Linear " << myNbLine << endl; + theStream << " Circular " << myNbCircle << endl; + theStream << " Elliptic " << myNbEllipse << endl; + theStream << " Hyperbolic " << myNbHyperbola << endl; + theStream << " Parabolic " << myNbParabola << endl; + theStream << " Bezier " << myNbBezierCurve << endl; + theStream << " BSpline " << myNbBSplineCurve << endl; + theStream << " Unspecified " << myNbUnspecifiedCurves << endl; + + theStream << " Total Number of Curves = " << NumberOfAllCurves << endl; + theStream + << "============================================================ " + << endl; + + theStream << endl; + +} + +void McCadCSGAdapt_ShapeGeomAnalyser::PrintShapeInfo(Standard_OStream& theStream) const +{ + + McCadCSGAdapt_ShapeAnalyser theShapeAnalyser(myShape); + + theShapeAnalyser.PrintContent(theStream); + theShapeAnalyser.PrintInfo(theStream); +} + +Standard_Boolean McCadCSGAdapt_ShapeGeomAnalyser::Convertibly() const +{ + return myConvertibly; +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbPlane() const +{ + return myNbPlane; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbCylinder() const +{ + return myNbCylinder; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbCone() const +{ + return myNbCone; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbSphere() const +{ + + return myNbSphere; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbTorus() const +{ + + return myNbTorus; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbBezierSurface() const +{ + + return myNbBezierSurface; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbBSplineSurface() const +{ + return myNbBSplineSurface; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbSurfaceOfRevolution() const +{ + + return myNbSurfaceOfRevolution; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbSurfaceOfExtrusion() const +{ + + return myNbSurfaceOfExtrusion; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbOffsetSurface() const +{ + return myNbOffsetSurface; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbUnspecifiedSurf() const +{ + return myNbUnspecifiedSurf; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbLine() const +{ + return myNbLine; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbCircle() const +{ + return myNbCircle; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbEllipse() const +{ + return myNbEllipse; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbHyperbola() const +{ + return myNbHyperbola; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbParabola() const +{ + + return myNbParabola; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbBezierCurve() const +{ + return myNbBezierCurve; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbBSplineCurve() const +{ + return myNbBSplineCurve; + +} + +Standard_Integer McCadCSGAdapt_ShapeGeomAnalyser::GetNbUnspecifiedCurves() const +{ + return myNbUnspecifiedCurves; +} + +Standard_Boolean McCadCSGAdapt_ShapeGeomAnalyser::IsDone() const +{ + return myIsDone; +} + diff --git a/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShellAnalyser.cxx b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShellAnalyser.cxx new file mode 100644 index 0000000..ac93960 --- /dev/null +++ b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_ShellAnalyser.cxx @@ -0,0 +1,51 @@ +#include +#include +#include +#include + +McCadCSGAdapt_ShellAnalyser::McCadCSGAdapt_ShellAnalyser() +{ + isFixed = Standard_False; +} + +McCadCSGAdapt_ShellAnalyser::McCadCSGAdapt_ShellAnalyser(const TopoDS_Shell& theShell) +{ + Init(theShell); +} + +void McCadCSGAdapt_ShellAnalyser::Init(const TopoDS_Shell& theShell) +{ + myShell = theShell; + isFixed = Standard_False; +} + +Standard_Boolean McCadCSGAdapt_ShellAnalyser::CheckShell() const +{ + ShapeAnalysis_Shell ShellAnal; + ShellAnal.CheckOrientedShells(myShell,Standard_True); + if(ShellAnal.HasBadEdges() || ShellAnal.HasFreeEdges()) return Standard_False; + else return Standard_True; +} + +TopoDS_Shell McCadCSGAdapt_ShellAnalyser::FixedShell() +{ + if(isFixed) + return myShell; + else + { + Fix(); + return FixedShell(); + } +} + +void McCadCSGAdapt_ShellAnalyser::Fix() +{ + + isFixed = Standard_True; + Handle(ShapeFix_Shell) theShellFix = new ShapeFix_Shell; + theShellFix->Init(myShell); + theShellFix->Perform(); + TopoDS_Shell theShell = theShellFix->Shell(); + myShell = theShell; +} + diff --git a/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_SolidAnalyser.cxx b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_SolidAnalyser.cxx new file mode 100644 index 0000000..f07e442 --- /dev/null +++ b/src/MCCAD/McCadCSGAdapt/McCadCSGAdapt_SolidAnalyser.cxx @@ -0,0 +1,43 @@ +#include +#include +#include +#include + +McCadCSGAdapt_SolidAnalyser::McCadCSGAdapt_SolidAnalyser() +{ + myIsFixed = Standard_False; +} + +McCadCSGAdapt_SolidAnalyser::McCadCSGAdapt_SolidAnalyser(const TopoDS_Solid& theSolid) +{ + Init(theSolid); +} + +void McCadCSGAdapt_SolidAnalyser::Init(const TopoDS_Solid& theSolid) +{ + myFirstSolid = theSolid; + myIsFixed = Standard_False; + myResultSolid = new TopTools_HSequenceOfShape; +} + +TopoDS_Solid McCadCSGAdapt_SolidAnalyser::FixedSolid() +{ + if (!IsFixed()) + Fix(); + return myFirstSolid; +} + +void McCadCSGAdapt_SolidAnalyser::Fix() +{ + Handle(ShapeFix_Solid) genericFix = new ShapeFix_Solid; + genericFix->Init(myFirstSolid); + genericFix->Perform(); + TopoDS_Solid theSolid =TopoDS::Solid(genericFix->Solid()); + myFirstSolid = theSolid; + myIsFixed = Standard_True; +} + + +bool McCadCSGAdapt_SolidAnalyser::IsFixed(){ + return myIsFixed; +} diff --git a/src/MCCAD/McCadCSGBuild/McCadCSGBuild_SolidFromCSG.cxx b/src/MCCAD/McCadCSGBuild/McCadCSGBuild_SolidFromCSG.cxx new file mode 100644 index 0000000..5799339 --- /dev/null +++ b/src/MCCAD/McCadCSGBuild/McCadCSGBuild_SolidFromCSG.cxx @@ -0,0 +1,2056 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//qiu #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +//qiu #include +//qiu #include +//qiu #include +//qiu #include +//qiu #include +//qiu #include + +//qiu #include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + + +#define MAX2(X, Y) ( Abs(X) > Abs(Y) ? Abs(X) : Abs(Y) ) +//qiu +const Standard_Boolean bRunParallel = true; +const Standard_Real aFuzzyValue = 1.0e-5; + + +Standard_Real McCadCSGBuild_SolidFromCSG::VolumeOfShape(const TopoDS_Shape& theShape) +{ + GProp_GProps GP; + BRepGProp::VolumeProperties(theShape, GP); + return GP.Mass(); +} + +/*Handle(TopTools_HSequenceOfShape) LinApprox(Handle(TopTools_HSequenceOfShape) failedHSolSeq, const TopoDS_Solid& theSolid) +{ + //////////////////////////////////////////////////////////////////// + Handle(TopTools_HSequenceOfShape) linHSpaces = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) HFaces = new TopTools_HSequenceOfShape(); + Bnd_Box2d BB2; + Bnd_Box BB3; + Standard_Real UMin,UMax,VMin,VMax; + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + for (TopExp_Explorer ex(theSolid,TopAbs_FACE); ex.More(); ex.Next()) + { + BRepBndLib::AddClose(ex.Current(),BB3); + // BB3.Add(BRep_Tool::Pnt(TopoDS::Vertex(ex.Current()))); + // BB3.SetGap(0.0); + } + BB3.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + TopoDS_Shape locBox = BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin), gp_Pnt(aXmax, aYmax, aZmax)).Shape(); + BB2.Add(gp_Pnt2d(aXmin, aYmin)); + BB2.Add(gp_Pnt2d(aXmin, aZmin)); + BB2.Add(gp_Pnt2d(aYmin, aZmin)); + BB2.Add(gp_Pnt2d(aXmax, aYmax)); + BB2.Add(gp_Pnt2d(aXmax, aZmax)); + BB2.Add(gp_Pnt2d(aYmax, aZmax)); + BB2.SetGap(0.0); + BB2.Get(UMin,VMin,UMax,VMax); + int iz=0; + + Standard_Real tolDegen(1.e-7); + + for (int k =1; k<= failedHSolSeq->Length(); k++) + { + for (TopExp_Explorer ex(failedHSolSeq->Value(k),TopAbs_FACE); ex.More(); ex.Next()) + { + TopLoc_Location L; + const TopoDS_Face& iFace = TopoDS::Face(ex.Current()); + const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*)&iFace.TShape()); + TF->Tolerance(1.e-03); + TopAbs::Print(iFace.Orientation(),cout); cout << endl; + //////////////////////////////////////////////////////////////////////////////////////// +#ifdef OCC650 + TopoDS_Face fF = BRepBuilderAPI_MakeFace(BRep_Tool::Surface(iFace,L),UMin,UMax,VMin,VMax); +#else + TopoDS_Face fF = BRepBuilderAPI_MakeFace(BRep_Tool::Surface(iFace,L),UMin,UMax,VMin,VMax, tolDegen); +#endif + fF.Orientation(iFace.Orientation()); + BRepTools::Update(fF); + BRepTools::UVBounds(fF,UMin,UMax,VMin,VMax); + cout << "Face Bounds for " << ++iz << endl; + cout << UMin << " " << UMax << " " << VMin << " " << VMax << endl; + //////////////////////////////////////////////////////////////////////////////// + BRep_Builder B; + TopoDS_Shell Sh; + B.MakeShell(Sh); + TopoDS_Solid Solid; + B.Add(Sh,fF); + if (!Sh.Free ()) Sh.Free(Standard_True); + B.MakeSolid(Solid); + B.Add(Solid,Sh); + + //////////////////////////// Triangulation ///////////////////////////////////// + for (TopExp_Explorer exF(Solid,TopAbs_FACE); exF.More(); exF.Next()) + { + TopLoc_Location loc; + TopoDS_Face lF = TopoDS::Face(exF.Current()); + BRepTools::Update(lF); + BRepTools::UVBounds(lF,UMin,UMax,VMin,VMax); + cout << "Face Bounds for " << ++iz << endl; + cout << UMin << " " << UMax << " " << VMin << " " << VMax << endl; + + Handle(Geom_Surface) theSurf = BRep_Tool::Surface(lF,loc); + Handle(Poly_Triangulation) mesh; + BRepAdaptor_Surface BS(lF,Standard_True); + gp_Trsf T = BS.Trsf(); + + Standard_Real aDeflection = MAX2( fabs(UMax)-fabs(UMin), fabs(VMax)-fabs(VMin))/4.0; + BRepMesh::Mesh(lF, aDeflection); + mesh = BRep_Tool::Triangulation(lF,loc); + + if (mesh.IsNull()) cout << "Face triangulation failed !!" << endl; + else + { + Standard_Integer nNodes = mesh->NbNodes(); + TColgp_Array1OfPnt meshPnts(1,nNodes); + meshPnts = mesh->Nodes(); + Standard_Integer nbTriangles = mesh->NbTriangles(); + cout << " Number of Nodes = " << nNodes << " Number of Triangles = " << nbTriangles << endl; + Standard_Integer n1, n2, n3; + const Poly_Array1OfTriangle& Triangles = mesh->Triangles(); + BRep_Builder fB; + TopoDS_Shell fSh; + fB.MakeShell(fSh); + TopoDS_Solid fSolid; + int messer; + if (nbTriangles >4) messer = int(nbTriangles/4); + else messer = 1; + cout << messer << endl; + for (int i = 1; i <= nbTriangles; i=i+messer) + { + cout << i << endl; + Triangles(i).Get(n1, n2, n3); + gp_Pnt P1 = (meshPnts(n1)).Transformed(T); + gp_Pnt P2 = (meshPnts(n2)).Transformed(T); + gp_Pnt P3 = (meshPnts(n3)).Transformed(T); + gp_Vec v1(P1, P2), v2(P1, P3); + gp_Vec v3 = v1 ^ v2; + v3.Normalize(); + gp_Dir D1(v3); + gp_Pln Plane1(P1,D1); + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(Plane1); + F1.Orientation(iFace.Orientation()); + fB.Add(fSh,F1); + } + fSh.Orientation(iFace.Orientation()); + if (!fSh.Free ()) fSh.Free(Standard_True); + fB.MakeSolid(fSolid); + fB.Add(fSolid,fSh); + linHSpaces->Append(fSolid); + + } + } + } + } + return linHSpaces; +}*/ + + +TopoDS_Solid RepairOpenShell(TopoDS_Shape& theSolid) +{ + // BRepBuilderAPI_Sewing Sew(1.e-04, Standard_False, Standard_False); + BRepBuilderAPI_Sewing Sew(1.e-04); + TopoDS_Solid sSolid; + + /*Sew.Load(sSolid); + + if (Sew.IsDegenerated(theSolid)) + cout << "The Shape is degenerated !!" << endl;*/ + + for (TopExp_Explorer aExp(theSolid, TopAbs_FACE); aExp.More(); aExp.Next()) + Sew.Add(TopoDS::Face(aExp.Current())); + Sew.Perform(); + // + // Extract free edges. + // + // Sew.Dump(); + + TopoDS_Shape sShape = Sew.SewedShape(); + + //TopAbs::Print(sShape.ShapeType(), cout); + //cout << endl; + + Standard_Integer nbedge = Sew.NbFreeEdges(); + cout << "Number of free edge found = "<< nbedge << endl; + TopTools_ListOfShape freeEdges; + Handle(TopTools_HSequenceOfShape) aFaceSeq = new TopTools_HSequenceOfShape; + TopoDS_Edge anEdge; + // we need the following for orientaion calculation!! + //////////////////////////////////////////////////////////////////////////////// + // TopoDS_Edge aBoundedEdge = TopoDS::Edge(Sew.MultipleEdge(nbMultEdge)); // ContigousEdge(nbContEdge)); + Handle(TColgp_HSequenceOfPnt) aPntSeq = new TColgp_HSequenceOfPnt; + + ////////////////////////////////////////////////////////////////////////////// + + BRepBuilderAPI_MakeWire wireMaker; + + for (Standard_Integer iedge = 1; iedge <= nbedge; iedge++) + { + anEdge = TopoDS::Edge(Sew.FreeEdge(iedge)); + wireMaker.Add(anEdge); + } + + TopoDS_Wire theWire = wireMaker.Wire(); + BRepBuilderAPI_MakeFace faceMaker(theWire); + + if(!faceMaker.IsDone()) + { + cout << "FACE CONSTRUCTION FAILED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + } + + TopoDS_Face theFace = faceMaker.Face(); + + Sew.Add(theFace); + Sew.Perform(); + TopoDS_Shape sewed = Sew.SewedShape(); + + cout << "make shell\n"; + TopoDS_Shell aShell = TopoDS::Shell(sewed); + cout << ".. done\n"; + cout << "make solid\n"; + BRepBuilderAPI_MakeSolid solidMaker(aShell); + TopoDS_Solid finalSolid = solidMaker.Solid(); + cout << "... done\n"; + + return finalSolid; + + /*BRepBuilderAPI_Sewing sewTool; + sewTool.Add(theSolid); + sewTool.Add(theFace); + sewTool.Perform(); + TopoDS_Shape sewed = sewTool.SewedShape();*/ + /*STEPControl_Writer stpWrtr; + stpWrtr.Transfer(sewed,STEPControl_AsIs); + stpWrtr.Write("finalSolid.stp"); + + Handle(ShapeFix_Shape) genericFix = new ShapeFix_Shape; + genericFix->Init(sewed); + genericFix->SetPrecision (1.e-03); + genericFix->SetMaxTolerance(0.0); + genericFix->FixSolidTool()->CreateOpenSolidMode() = Standard_True; + genericFix->Perform(); + sewed = genericFix->Shape();*/ + + + + +/* BRepAlgoAPI_Fuse fuser(theSolid, theFace); + + if(!fuser.IsDone()) + cout << "Solid Maker failed\n\n\n"; + + TopoDS_Shape returnSolid = fuser.Shape();*/ + + + + /*for (Standard_Integer iedge = 1; iedge <= nbedge; iedge++) + { + anEdge = TopoDS::Edge(Sew.FreeEdge(iedge)); + if (!BRep_Tool::Degenerated(anEdge) ) + { + freeEdges.Append(anEdge); + for (TopExp_Explorer aExv(anEdge, TopAbs_VERTEX); aExv.More(); aExv.Next()) + { + gp_Pnt theP = BRep_Tool::Pnt(TopoDS::Vertex(aExv.Current())); + aPntSeq->Append(theP); + } + } + } + + //cout << "Point found!! " << endl; + + Handle(BRepAlgo_EdgeConnector) edgeCon = new BRepAlgo_EdgeConnector; + TopTools_ListOfShape wires; + edgeCon->AddStart(freeEdges); + wires = edgeCon->MakeBlock(); + + TopTools_ListIteratorOfListOfShape it(wires); + if (edgeCon->IsDone()) + { + cout << "CONNECTED EDGES : " << endl; + Standard_Integer p(0); + for (; it.More(); it.Next()) + { + const TopoDS_Shape& aWire = it.Value(); + TopAbs_Orientation orient = aWire.Orientation(); + + + BRepBuilderAPI_FindPlane pFind(aWire, 1.e-02); + Handle(Geom_Plane) thePlane; + + TopoDS_Face aFace; + if (pFind.Found()) + { + thePlane = pFind.Plane(); + gp_Pln aPln = thePlane->Pln(); + + GeomAdaptor_Surface theASurf(thePlane); + //////////////////////////////////////////////////////////////////////// + // calculate the orietation of the face + cout << " Computing orientation ............. " << endl; + for (int j =1; j<=aPntSeq->Length(); j++) + { + Standard_Real aVal = McCadGTOOL::Evaluate(theASurf, + aPntSeq->Value(j)); + if (aVal > 1.e-04 || aVal < -1.e-04) + { + if (aVal > 1.e-04) + orient = TopAbs_REVERSED; + if (aVal < 1.e-04) + orient = TopAbs_FORWARD; + cout << " Computing orientation successful!! " << endl; + break; + } + } + if (orient == TopAbs_FORWARD) + cout << " Computed orientation is TopAbs_FORWARD!! " + << endl; + else if (orient == TopAbs_REVERSED) + cout << "Computed orientation is TopAbs_REVERSED!! " + << endl; + else + cout << " Computed orientation is TopAbs_Unknown!! " + << endl; + + /////////////////////////////////////////////////////////////////////// + aFace = BRepBuilderAPI_MakeFace(aPln, TopoDS::Wire(aWire)); + aFace.Orientation(orient); + aFaceSeq->Append(aFace); + } + else + { + cout << "_#_McCadCSGBuild_SolidFromCSG.cxx :: Can not find a plane for a wire. " << endl; + continue; + } + } + } + else + { + cout << "_#_McCadCSGBuild_SolidFromCSG.cxx :: Can not make wires " << endl; + // return theSolid; + }*/ + + //cout << "Number of new faces = " << aFaceSeq->Length() << endl; + + /* + TopoDS_Face F; + + for(TopExp_Explorer aExp(theSolid,TopAbs_FACE); aExp.More(); aExp.Next()) + { + F = TopoDS::Face(aExp.Current()); + aFaceSeq->Append(F); + } + + BRepBuilderAPI_Sewing Sew1(1.e-04); + TopoDS_Solid S; + Sew1.Load(S); + for(int i=1; i<= aFaceSeq->Length(); i++) Sew1.Add(TopoDS::Face(aFaceSeq->Value(i))); + Sew1.Perform(); + TopoDS_Shape theShape = Sew1.SewedShape(); + if(theShape.IsNull()) + { + cout << "Warning: Repair of solid failed!! " << endl; + return theSolid; + } + + cout << " Repair of open shell successful !! " << endl ; + cout << " Model may be approximated !! " << endl; + + return TopoDS::Solid(theShape); + } + */ + + /*TopoDS_Shell sh; + TopoDS_Face F; + BRep_Builder B; + B.MakeShell(sh); + + for (TopExp_Explorer aExp(sShape, TopAbs_FACE); aExp.More(); aExp.Next()) + { + F = TopoDS::Face(aExp.Current()); + Handle(ShapeFix_Face) faceFix = new ShapeFix_Face; + faceFix->Init(F); + faceFix->SetPrecision(1.e-03); + faceFix->SetMaxTolerance(1.e-03); + faceFix->Perform(); + F = TopoDS::Face(faceFix->Result()); + B.Add(sh, F); + } + if (aFaceSeq->Length() > 0) + { + for (int i=1; i<= aFaceSeq->Length(); i++) + { + TopoDS_Face theFace = TopoDS::Face(aFaceSeq->Value(i)); + const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*)&theFace.TShape()); + TF->Tolerance(1.e-03); + B.Add(sh, theFace); + } + } + if (!sh.Free()) + sh.Free(Standard_True); + TopoDS_Solid solid; + B.MakeSolid(solid); + B.Add(solid, sh); + try + { + BRepClass3d_SolidClassifier bsc3d (solid); + Standard_Real t = Precision::Confusion(); + bsc3d.PerformInfinitePoint(t); + + if (bsc3d.State() == TopAbs_IN) + { + cout << "_#_McCadCSGBuild_SolidFromCSG.cxx :: Inifinity in Solid !! " << endl; + if (!sh.Free ()) sh.Free(Standard_True); + TopoDS_Solid soli2; + B.MakeSolid (soli2); + sh.Reverse(); + B.Add (soli2,sh); + solid = soli2; + } + } + catch(Standard_Failure) + { + cout << "_#_McCadCSGBuild_SolidFromCSG.cxx :: Warning: SolidFromShell: Exception: " << endl; + } + + cout << " Repair of open shell may be successful !! " << endl; + cout << " Model may be approximated !! " << endl; + + return solid;*/ +} + +static gp_Pnt ApproxBaryCenter(const TopoDS_Shape& S) +{ + Standard_Integer i; + TopExp_Explorer ex; + gp_XYZ xyz(0, 0, 0); + for (ex.Init(S, TopAbs_VERTEX), i = 1; ex.More(); ex.Next(), i++) + xyz += BRep_Tool::Pnt(TopoDS::Vertex(ex.Current())).XYZ(); + xyz /= i; + return gp_Pnt(xyz); +} + +TopoDS_Shape Scale(const TopoDS_Shape& S, Standard_Real theFact) +{ + gp_Trsf T; + gp_Pnt thePnt = ApproxBaryCenter(S); + T.SetScale(thePnt, theFact); // we scale up or down relative to barycenter depending on theFact; + Handle(BRepTools_TrsfModification) TrsfMod = new BRepTools_TrsfModification(T); + BRepTools_Modifier Md; + Md.Init(S); + Md.Perform(TrsfMod); + if (Md.IsDone()) + { + return Md.ModifiedShape(S); + } + else + { + cout << "_#_McCadCSGBuild_SolidFromCSG.cxx :: Can not scale/modify shape !! " << endl; + return S; + } +} + +Handle(TopTools_HSequenceOfShape) SortByRadius(Handle(TopTools_HSequenceOfShape) HSolSeq) +{ + Standard_Real currentRad = 0, oldRad = 0; + if (HSolSeq->IsEmpty()) return HSolSeq; + if (HSolSeq->Length() <= 1) return HSolSeq; + + for (int i=1; i<= HSolSeq->Length(); i++) + { + TopExp_Explorer exp(HSolSeq->Value(i),TopAbs_FACE); + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F; + for (; exp.More(); exp.Next()) F = TopoDS::Face(exp.Current()); // we have only one face since this is a halfspace. + TopAbs_Orientation orient = F.Orientation(); + if (orient == TopAbs_FORWARD); + //cout << " TopAbs_FORWARD at Sorting !!!" << endl; + else if (orient == TopAbs_REVERSED); + //cout << " TopAbs_REVERSED at Sorting !!! " << endl; + else + cout << " TopAbs_Unknown at Sorting !!! " << endl; + S = BRep_Tool::Surface(F, l); + GeomAdaptor_Surface AS(S); + switch (AS.GetType()) + { + case GeomAbs_Cylinder: + { + gp_Cylinder C = AS.Cylinder(); + currentRad = C.Radius(); + break; + } + case GeomAbs_Cone: + { + gp_Cone C = AS.Cone(); + currentRad = C.RefRadius() / tan(C.SemiAngle()); // heuristic + break; + } + case GeomAbs_Sphere: + { + gp_Sphere C = AS.Sphere(); + currentRad = C.Radius(); + break; + } + case GeomAbs_Torus: + { + gp_Torus C = AS.Torus(); + // currentRad = C.MajorRadius(); + currentRad = C.MinorRadius(); + break; + } + default: break; + } + if (i==1) + { + oldRad = currentRad; + //cout << "Current Radius = " << currentRad << endl; + continue; + } + else + { + //cout << "Current Radius = " << currentRad << endl; + for (int k = i - 1; k>=1; k--) + { + if(currentRad < oldRad) + { + //cout << "Exchanging ................" << endl; + HSolSeq->Exchange(k,k+1); + } + else + break; + } + } + oldRad = currentRad; + } + + //cout << "Radius based sorting performed !! " << endl; + + return HSolSeq; +} + + +McCadCSGBuild_SolidFromCSG::McCadCSGBuild_SolidFromCSG() +{ +} + +McCadCSGBuild_SolidFromCSG::McCadCSGBuild_SolidFromCSG(const Handle(McCadCSGGeom_Cell)& theCell) +{ + Init(theCell); +} + + +void McCadCSGBuild_SolidFromCSG::Init(const Handle(McCadCSGGeom_Cell)& theCell) +{ + NotDone(); + myCell = theCell; + myType = McCadCSGBuild_Other; + mySolids = new TopTools_HSequenceOfShape(); + MakeSolids(); + Done(); +} + + +Standard_Boolean McCadCSGBuild_SolidFromCSG::IsDone() const +{ + return myIsDone; +} + + +void McCadCSGBuild_SolidFromCSG::Done() +{ + myIsDone = Standard_True; +} + + +void McCadCSGBuild_SolidFromCSG::NotDone() +{ + myIsDone = Standard_False; +} + + +void McCadCSGBuild_SolidFromCSG::MakeSolids() +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + // currently the csg exp is supposed to be in disjunctive normal form. + Handle(TColStd_HSequenceOfAsciiString) csgExp = myCell->GetCSG(); + McCadCSGGeom_DataMapOfIntegerSurface surfMap; + + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface surfIter = myCell->GetSurface(); + + for (; surfIter.More(); surfIter.Next())//for all surface numbers fill surface map + surfMap.Bind(surfIter.Key(), surfIter.Value()); + + if (csgExp->Length() == 0 || surfMap.Extent() == 0) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Empty CSG Expression or number of surfaces is zero !! ", + McCadMessenger_ErrorMsg); + return; + } + + for(Standard_Integer pl=1; pl<=csgExp->Length(); pl++) + cout << csgExp->Value(pl).ToCString() << " "; + cout << endl; + + cout << "Cell processing started "<< endl; + cout << "======================== "<< endl; + + for (int i=1; i<= csgExp->Length(); i++) // For All CSG-Terms build solids + { + Handle(TopTools_HSequenceOfShape) HSolSeq = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) BoxSeq = new TopTools_HSequenceOfShape(); + Handle(TColGeom_HSequenceOfSurface) geomSurfSeq = new TColGeom_HSequenceOfSurface(); + + while (csgExp->Value(i) != TCollection_AsciiString(" ) ")) //half space computation for one solid + { + if ((csgExp->Value(i)).IsIntegerValue()) // if surface number in csg expression + { + //## build TopoDS_Face + Standard_Integer surfNo = (csgExp->Value(i)).IntegerValue(); + Standard_Integer key = abs(surfNo); + Handle(McCadCSGGeom_Surface) aCSGSurf = surfMap(key); + Handle(Geom_Surface) theSurf = aCSGSurf->CasSurf(); + geomSurfSeq->Append(theSurf); + GeomAdaptor_Surface theAdaptSurf(theSurf); +Standard_Real tolDegen(1.e-07); +#ifdef OCC650 + TopoDS_Face theFace = BRepBuilderAPI_MakeFace(theSurf); +#else + TopoDS_Face theFace = BRepBuilderAPI_MakeFace(theSurf, tolDegen); +#endif + //## find point on solid side of the face + gp_Ax3 pos; + + if(! theAdaptSurf.GetType() == GeomAbs_SurfaceOfRevolution && ! theAdaptSurf.GetType()==GeomAbs_BSplineSurface) + { + Handle(Geom_ElementarySurface) ES = Handle(Geom_ElementarySurface)::DownCast(theSurf); + pos = ES->Position(); + } + else + { + pos = aCSGSurf->GetAxis(); + } + +// gp_Ax3 stdAx3(gp::Origin(), gp::DZ()); +// gp_Dir theDirect = pos.Direction(); + gp_Trsf T; + T.SetTransformation(pos); + + // TopAbs_Orientation orient; + Standard_Real U=1.0, V=1.0; + gp_Pnt thePnt = theSurf->Value(U, V); + + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt; + + for (int j=1; j <=3; j++) + { + // perturbation coordinatewise + Standard_Real r = thePnt.Coord(j); + gp_Pnt tmpPnt = thePnt; + tmpPnt.SetCoord(j, r+0.1); + thePntSeq->Append(tmpPnt); + tmpPnt.SetCoord(j, r-0.1); + thePntSeq->Append(tmpPnt); + } + + gp_Pnt samPnt(0,0,0); + Handle(McCadCSGGeom_SurfaceOfRevolution) surfOfRev = NULL; + Handle(TColStd_HSequenceOfReal) surfPar = NULL; + if(theAdaptSurf.GetType()==GeomAbs_SurfaceOfRevolution) // recalculate aVal + { + surfOfRev = Handle(McCadCSGGeom_SurfaceOfRevolution)::DownCast( aCSGSurf ); + surfOfRev->GetParameter(surfPar); + } + + if (surfNo < 0)//Forward oriented surface + { + for (int j=1; j<=thePntSeq->Length(); j++) + { + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptSurf, thePntSeq->Value(j)); + + if(theAdaptSurf.GetType()==GeomAbs_SurfaceOfRevolution) // recalculate aVal + { + gp_Dir theDir = surfOfRev->GetAxis().Direction(); + gp_Dir xDir(1,0,0); + gp_Dir yDir(0,1,0); + gp_Dir zDir(0,0,1); + + Standard_Real Xb(0),Yb(0),Zb(0), Q(0), X(0), Y(0), Z(0), + A(surfPar->Value(4)), + B(surfPar->Value(5)), + C(surfPar->Value(6)); + + if(theDir.IsEqual(xDir, 1e-3)) + { + Xb = surfPar->Value(1); + Yb = surfPar->Value(2); + Zb = surfPar->Value(3); + X = thePntSeq->Value(j).X(); + Y = thePntSeq->Value(j).Y(); + Z = thePntSeq->Value(j).Z(); + } + if(theDir.IsEqual(yDir, 1e-3)) + { + Xb = surfPar->Value(2); + Yb = surfPar->Value(1); + Zb = surfPar->Value(3); + X = thePntSeq->Value(j).Y(); + Y = thePntSeq->Value(j).X(); + Z = thePntSeq->Value(j).Z(); + } + if(theDir.IsEqual(zDir, 1e-3)) + { + Xb = surfPar->Value(3); + Yb = surfPar->Value(2); + Zb = surfPar->Value(1); + X = thePntSeq->Value(j).Z(); + Y = thePntSeq->Value(j).Y(); + Z = thePntSeq->Value(j).X(); + } + + Q = Sqrt((Y-Yb) * (Y-Yb) + (Z-Zb) * (Z-Zb)) - A; + + aVal = (X-Xb) * (X-Xb) / (B * B) + Q * Q / (C * C) - 1; + } + + if (aVal < -1.e-04) + { + samPnt = thePntSeq->Value(j); + break; + } + } + } + else//reverse oriented surface + { + for (int j=1; j<=thePntSeq->Length(); j++) + { + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptSurf, thePntSeq->Value(j)); + + if(theAdaptSurf.GetType()==GeomAbs_SurfaceOfRevolution) // recalculate aVal + { + gp_Dir theDir = surfOfRev->GetAxis().Direction(); + gp_Dir xDir(1,0,0); + gp_Dir yDir(0,1,0); + gp_Dir zDir(0,0,1); + + Standard_Real Xb(0),Yb(0),Zb(0), Q(0), X(0), Y(0), Z(0), + A(surfPar->Value(4)), + B(surfPar->Value(5)), + C(surfPar->Value(6)); + + if(theDir.IsEqual(xDir, 1e-3)) + { + Xb = surfPar->Value(1); + Yb = surfPar->Value(2); + Zb = surfPar->Value(3); + X = thePntSeq->Value(j).X(); + Y = thePntSeq->Value(j).Y(); + Z = thePntSeq->Value(j).Z(); + } + if(theDir.IsEqual(yDir, 1e-3)) + { + Xb = surfPar->Value(2); + Yb = surfPar->Value(1); + Zb = surfPar->Value(3); + X = thePntSeq->Value(j).Y(); + Y = thePntSeq->Value(j).X(); + Z = thePntSeq->Value(j).Z(); + } + if(theDir.IsEqual(zDir, 1e-3)) + { + Xb = surfPar->Value(3); + Yb = surfPar->Value(2); + Zb = surfPar->Value(1); + X = thePntSeq->Value(j).Z(); + Y = thePntSeq->Value(j).Y(); + Z = thePntSeq->Value(j).X(); + } + + Q = Sqrt((Y-Yb) * (Y-Yb) + (Z-Zb) * (Z-Zb)) - A; + + aVal = (X-Xb) * (X-Xb) / (B * B) + Q * Q / (C * C) - 1; + + } + + if (aVal > 1.e-04) + { + samPnt = thePntSeq->Value(j); + break; + } + } + //} + } + + //## build half space + TopoDS_Shape HSol = BRepPrimAPI_MakeHalfSpace(theFace,samPnt).Solid(); + + if (HSol.IsNull()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: A NULL half space: maybe wrong orientation !?!", + McCadMessenger_ErrorMsg); + return; + } + else + { + HSolSeq->Append(HSol); + } + } + i++; + } + + //## sort half spaces by type + if (HSolSeq->Length() == 0) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Halfspace solid computation failed !! ", + McCadMessenger_ErrorMsg); + return; + } + ///////////////////////////////////sort halfspaces//////////////////////////////////////////////// + // TopTools_ListOfShape LPlan,LCyl,LCon,LSphere,LTor; + Handle(TopTools_HSequenceOfShape) LPlan = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LCyl = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LCon = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LSphere = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LTor = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) Other = new TopTools_HSequenceOfShape(); + + for (int j = 1; j<= HSolSeq->Length(); j++) //For all Half Spaces: collect by type + { + TopExp_Explorer exp(HSolSeq->Value(j), TopAbs_FACE); + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F; + for (; exp.More(); exp.Next()) + F = TopoDS::Face(exp.Current()); // we have only one face since this is a halfspace. + + S = BRep_Tool::Surface(F, l); + if (!S.IsNull()) + { + GeomAdaptor_Surface AS(S); + switch (AS.GetType()) + { + case GeomAbs_Plane: + { + //cout << "plane\n"; + LPlan->Append(HSolSeq->Value(j)); + break; + } + case GeomAbs_Cylinder: + { + //cout << "cylinder\n"; + LCyl->Append(HSolSeq->Value(j)); + break; + } + case GeomAbs_Cone: + { + //cout << "cone\n"; + LCon->Append(HSolSeq->Value(j)); + break; + } + case GeomAbs_Sphere: + { + //cout << "sphere\n"; + LSphere->Append(HSolSeq->Value(j)); + break; + } + case GeomAbs_Torus: + { + //cout << "torus\n"; + LTor->Append(HSolSeq->Value(j)); + break; + } + case GeomAbs_SurfaceOfRevolution: + { + //cout << "other\n"; + Other->Append(HSolSeq->Value(j)); + break; + } + default: break; + } + } + else + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Nonanalytic surface !!! ", + McCadMessenger_WarningMsg); + } + } + + LTor = SortByRadius(LTor); + LSphere= SortByRadius(LSphere); + LCon =SortByRadius(LCon); + LCyl = SortByRadius(LCyl); + HSolSeq->Clear(); + + HSolSeq->Append(LTor); + HSolSeq->Append(LSphere); + HSolSeq->Append(LCyl); + HSolSeq->Append(LCon); + HSolSeq->Append(Other); + + Handle(TopTools_HSequenceOfShape) linHSolSeq = new TopTools_HSequenceOfShape(); + linHSolSeq->Append(LPlan); + + LPlan->Clear(); + LTor->Clear(); + LSphere->Clear(); + LCon->Clear(); + LCyl->Clear(); + Other->Clear(); + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//qiu IntTools_Context ctx; + TopoDS_Shape tmpS1, tmpS2; + TopoDS_Solid tmpSol, newSol, oldSol1; + TopoDS_Shape BigShape; + + //## compute box for common operations + BigShape = BRepPrimAPI_MakeBox(gp_Pnt(-1.e5,-1.e5,-1.e5),gp_Pnt(1.e5,1.e5,1.e5)).Shape(); + TopoDS_Solid Big = TopoDS::Solid(BigShape); + //TopoDS_Solid testBIG = Big; + + + TopoDS_Solid polSol1; + /////////////////////////////////////////////////////////////////////////////////////////////////////////// + + Handle(TopTools_HSequenceOfShape) polyHSolids = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) failedHSolSeq = new TopTools_HSequenceOfShape(); + + //## processing linear half-spaces first + if (linHSolSeq->Length() > 0) //only linear half spaces are treated + { + cout << "processing linear halfspaces : " << linHSolSeq->Length() << endl; + for (int k=1; k<=linHSolSeq->Length() ; k++) // make huge finit solids which represent the half spaces + { + Standard_Boolean bOp= Standard_False; + tmpS1 = TopoDS::Solid(linHSolSeq->Value(k)); + + try + { +//qiu BOPTools_DSFiller pDF; +//qiu BOPTools_DSFiller pDF; +//qiu pDF.SetShapes(tmpS1, Big); +//qiu pDF.Perform(); + +//qiu BRepAlgoAPI_Common aCommonOp(tmpS1,Big, pDF); + BRepAlgoAPI_Common aCommonOp(tmpS1,Big); + + if(aCommonOp.IsDone()) + { + bOp= Standard_True; + tmpS2 = aCommonOp.Shape(); + } + else + { + bOp= Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Boolean Operation on a halfspace failed !!! 2", + McCadMessenger_WarningMsg); + } + } + catch(...) + { + bOp= Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Boolean Operation on a halfspace failed !!! 3", + McCadMessenger_WarningMsg); + } + + if (bOp) + { + polyHSolids->Append(tmpS2); + } + else + { + TCollection_AsciiString msg; + msg += k; + msg += "_#_McCadCSGBuild_SolidFromCSG.cxx :: Linear halfspace appended to fail sequence!! "; + msgr->Message(msg.ToCString(), McCadMessenger_WarningMsg); + failedHSolSeq->Append(linHSolSeq->Value(k)); + } + } + + + cout << "Number of linear boxed halfspaces = "<< polyHSolids->Length() << endl; + if (polyHSolids->Length() == 1) + { + for ( TopExp_Explorer Ex(polyHSolids->Value(1), TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + polSol1 = TopoDS::Solid( Ex.Current()); + } + } + else + { + //## perform common operation on generated boxed half spaces (LINEAR) + for ( TopExp_Explorer Ex(polyHSolids->Value(1), TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + polSol1 = TopoDS::Solid( Ex.Current()); + } + + for (int k=2; k<=polyHSolids->Length() ; k++) + { + ///////////////////////////////////////////////////////////////////////////////////// + int itol = 0; + Standard_Boolean bOp= Standard_False; + + //oldSol1 = TopoDS::Solid(polyHSolids->Value(k)); + + for ( TopExp_Explorer Ex(polyHSolids->Value(k), TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + oldSol1 = TopoDS::Solid( Ex.Current()); + } + + Standard_Boolean need2repeat = Standard_True; + while(need2repeat) + { + try + { +//qiu BOPTools_DSFiller pDF; +//qiu pDF.SetShapes(oldSol1, polSol1); +//qiu pDF.Perform(); + + BRepAlgoAPI_Common aCommonOp(oldSol1,polSol1); + + if(aCommonOp.IsDone()) + { + bOp= Standard_True; + tmpS1 = aCommonOp.Shape(); + } + else + { + bOp= Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Boolean Operation on a halfspace failed !!! 4", + McCadMessenger_WarningMsg); + } + + } + catch(...) + { + bOp= Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Boolean Operation on a halfspace failed !!! 5", + McCadMessenger_WarningMsg); + } + + const TopoDS_Shape& aShape = tmpS1; + + //Test if shape is valid + BRepCheck_Analyzer BA(aShape, Standard_False); + + int sCount=0; + for (TopExp_Explorer ex(aShape, TopAbs_SOLID); ex.More(); ex.Next()) + { + sCount++; + const TopoDS_Solid& solid = TopoDS::Solid(ex.Current()); + if (solid.IsNull()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BOP for solid failed: NULL SOLID computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + for (TopExp_Explorer exs(solid, TopAbs_SHELL); exs.More(); exs.Next()) + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + BA.Init(sh, Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + //BRepCheck::Print(iter.Value(), cout); + if (iter.Value() == BRepCheck_UnorientableShape) + { + Handle(ShapeFix_Shell) genericFix = new ShapeFix_Shell(sh); + genericFix->SetPrecision(1.e-03); + genericFix->SetMaxTolerance(0.0); + genericFix->Perform(); + BA.Init(sh, Standard_False); + } + } + + if (!BA.IsValid()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BRepCheck_Analyzer for shell failed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + } + BA.Init(aShape, Standard_False); + if (!BA.IsValid()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BRepCheck_Analyzer for solid failed !! - 0", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + if (sCount==0) + { + bOp = Standard_False; // if check is run on compound containing no solid + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Compound containing no solid computed !", + McCadMessenger_WarningMsg); + } + + if (tmpS1.IsNull()) + { + bOp = Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Null solid computed !!! ", + McCadMessenger_WarningMsg); + } + + //////////////////////////////////////////////// + // try Tolerance correction + itol++; + if (!bOp && itol <= 4) + { +//qiu Standard_Real locTol = 1.e-07*(pow(10, itol)); + Standard_Real locTol = 1.e-07*(pow(10.0, itol)); + TCollection_AsciiString msg(itol); + msg += "_#_McCadCSGBuild_SolidFromCSG.cxx :: . Tolerance correction due to failed BOP!!"; + msgr->Message(msg.ToCString(), McCadMessenger_WarningMsg); + + ///////////////////////////////////////////////////////////////// + ShapeFix_ShapeTolerance setter; + Standard_Boolean sett; + // sett = setter.LimitTolerance(oldSol1,locTol,0.0,TopAbs_SOLID); + sett = setter.LimitTolerance(polSol1, locTol, 0.0, TopAbs_SOLID); + } + else if (!bOp && itol > 4) + { + itol = 0; + TCollection_AsciiString msg( "_#_McCadCSGBuild_SolidFromCSG.cxx :: Tolerance correction failed: nonlinear halfspaces number .... "); + msg += k; + msgr->Message(msg.ToCString(), McCadMessenger_WarningMsg); + + failedHSolSeq->Append(polyHSolids->Value(k)); + //continue; + break; // while loop and continue + } + else + { + // cout << "Processing linear halfspaces number .... " << k << " .... finished. " << endl; + need2repeat = Standard_False; + for ( TopExp_Explorer Ex(aShape, TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + polSol1 = TopoDS::Solid( Ex.Current()); + } + } + } + } + } + } + else + { + polSol1 = Big; + } + ////////////////////////////////////////////////////////////////////// + +// BRepTools::Write(polSol1, "polSol1.rle"); + + BRepCheck_Analyzer BA3(polSol1, Standard_False); + if (BA3.IsValid()) + ; // mySolids->Append(polSol1); + else + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: ***** Invalid linear Solid computed **** ", + McCadMessenger_ErrorMsg); + + //Big = polSol1; + + int itol=0, ideg = 1; + //Standard_Boolean openF = Standard_False; + + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + //## perform boolean common operation for nonlinear half spaces + cout << " Number of nonlinear halfspaces = " << HSolSeq->Length() << endl; + if (HSolSeq->Length() > 0)//for all nonlinear halfspaces + { + for (int k=1; k<=HSolSeq->Length() ; k++) + { + itol = 0; + Standard_Boolean bOp= Standard_False; + + oldSol1 = TopoDS::Solid(HSolSeq->Value(k)); + cout << "Processing nonlinear halfspaces number ......... " << k << endl; + + //perform boolean common until success or till tolerance correction is too high. + Standard_Boolean need2repeat = Standard_True; + while(need2repeat) + { + try + { +//qiu BOPTools_DSFiller pDF; +//qiu pDF.SetShapes(oldSol1, polSol1); +//qiu pDF.Perform(); + +//qiu BRepAlgoAPI_Common aCommonOp(oldSol1,polSol1, pDF); + BRepAlgoAPI_Common aCommonOp(oldSol1,polSol1); + + if(aCommonOp.IsDone()) + { + bOp= Standard_True; + tmpS1 = aCommonOp.Shape(); + } + else + { + bOp= Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Boolean Operation on a halfspace failed !!! 6", + McCadMessenger_WarningMsg); + } + } + catch(...) + { + bOp = Standard_False; + /*STEPControl_Writer flWrt; + flWrt.Transfer(polSol1, STEPControl_AsIs); + flWrt.Write("Failed.stp");*/ + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Boolean Operation on a halfspace failed !!! 7", + McCadMessenger_WarningMsg); + //exit(-1); + break; + } + + const TopoDS_Shape& aShape = tmpS1; + BRepCheck_Analyzer BA(aShape, Standard_False); + int sCount=0; + + for (TopExp_Explorer ex(aShape, TopAbs_SOLID); ex.More(); ex.Next()) //perform shape tests + { + sCount++; + const TopoDS_Solid& solid = TopoDS::Solid(ex.Current()); + if (solid.IsNull()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BOP for solid failed: NULL SOLID computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + for (TopExp_Explorer exs(solid, TopAbs_SHELL); exs.More(); exs.Next()) + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + BA.Init(sh, Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + + if (!BA.IsValid()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BRepCheck_Analyzer for shell failed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + /////////////////////////////////////////////////////////////////////////////////////////// + for (TopExp_Explorer exf(solid, TopAbs_FACE); exf.More(); exf.Next()) + { + const TopoDS_Face& aF = TopoDS::Face(exf.Current()); + BA.Init(aF, Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(aF); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + + if (BA.IsValid()) + ; + else + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BRepCheck_Analyzer for face failed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + /////////////////////////////////////////////////////////////////////////////////////////// + } + + BA.Init(aShape, Standard_False); + + if (!BA.IsValid()) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: BRepCheck_Analyzer for solid failed !! - 1" , + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + + if (sCount==0) + { + bOp = Standard_False; // if check is run on compound containing no solid + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Compound containing no solid computed !!", + McCadMessenger_WarningMsg); + } + + if (tmpS1.IsNull()) + { + bOp = Standard_False; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Null solid computed !!! " , + McCadMessenger_WarningMsg); + } + + //////////////////////////////////////////////// + // try Tolerance correction + itol++; + if (!bOp && itol <= 4) + { +//qiu Standard_Real locTol = 1.e-07*(pow(10, itol)); + Standard_Real locTol = 1.e-07*(pow(10.0, itol)); + cout << itol <<" _ " << ideg<< " Tolerance correction due to failed BOP!!!" << endl; + + ///////////////////////////////////////////////////////////////// + ShapeFix_ShapeTolerance setter; + Standard_Boolean sett; + // sett = setter.LimitTolerance(oldSol1,locTol,0.0,TopAbs_SOLID); + sett = setter.LimitTolerance(polSol1, locTol, 0.0, TopAbs_SOLID); + } + else if (!bOp && itol > 4) + { + itol = 0; + cout<< "Tolerance correction failed: nonlinear halfspaces number .... " << k << endl; + failedHSolSeq->Append(HSolSeq->Value(k)); + break; // ... while loop and continue + } + else + { + need2repeat = Standard_False; + for ( TopExp_Explorer Ex(aShape, TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + polSol1 = TopoDS::Solid( Ex.Current()); + } + } + } + /*STEPControl_Writer aWrtr; + aWrtr.Transfer(polSol1, STEPControl_AsIs); + TCollection_AsciiString newTest("newTest_"); + //newTest += TCollection_AsciiString(itol); + newTest += ".stp"; + aWrtr.Write(newTest.ToCString());*/ + } + } + //cout << "...done\n\n"; + //Big = polSol1; + + itol=0, ideg = 1; + HSolSeq->Clear(); + HSolSeq->Append(failedHSolSeq); + + //##reprocess failed solids + if(HSolSeq->Length() > 0) + { + cout << "\n\nReprocessing failed Half Spaces\n"; + cout << "number of failed HS : " << HSolSeq->Length() << "\n+++++++++++++++++++++++++++++++++++++++++++\n"; + + //## shrink Big to reasonable size + Bnd_Box aidBox; + BRepBndLib::Add(polSol1, aidBox); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + aidBox.SetGap(5); + aidBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + cout << "aidBox : " << aXmin << " " << aYmin << " " << aZmin << " " << aXmax << " " << aYmax << " " << aZmax << endl; + TopoDS_Shape aidShp = BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin), gp_Pnt(aXmax, aYmax, aZmax)).Shape(); + Big = TopoDS::Solid(aidShp); + + //## process all failed solids + for (int k=1; k<=HSolSeq->Length(); k++) + { + ShapeFix_ShapeTolerance setter; + Standard_Real scaleFactor=1.0; + Standard_Boolean bopFailed = Standard_True, sett = Standard_False; + Standard_Real aTol(1.e-5); + + sett = setter.LimitTolerance(Big, aTol, 0.0, TopAbs_SOLID); + + if(!sett) + cout << "McCadCSGBuild_SolidFromCSG :: could not reset tolerance!\n"; + + //## compute boxed half space + while(bopFailed) + { + cout << "scaleFactor : " << scaleFactor << endl; + TopoDS_Shape tmpShp = Scale(Big,scaleFactor); + + try + { +//qiu BOPTools_DSFiller pDF; +//qiu pDF.SetShapes(tmpShp, HSolSeq->Value(k)); +//qiu pDF.Perform(); + +//qiu BRepAlgoAPI_Common outerCommonOp(tmpShp,HSolSeq->Value(k), pDF); + BRepAlgoAPI_Common outerCommonOp(tmpShp,HSolSeq->Value(k)); + + if(outerCommonOp.IsDone()) + { + tmpS2 = outerCommonOp.Shape(); + + /*STEPControl_Writer aWrtr; + aWrtr.Transfer(tmpS2, STEPControl_AsIs); + aWrtr.Write("tmpS2.stp");*/ + + if(tmpS2.IsNull()) + { + cout << "\n## NULL Shape computed\n\n"; + continue; + } + + Standard_Integer shCnt(0); + for ( TopExp_Explorer Ex(tmpS2, TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + tmpS2 = Ex.Current(); + shCnt++; + } + + if(shCnt == 1) + { + if(tmpS2.IsNull()) + cout << "NULL SOLID COMPUTED\n\n"; + else + bopFailed = Standard_False; + } + else if(shCnt > 1) + { + cout << "More than one Solid resulted!!!\n"; + bopFailed = Standard_True; + } + else + { + bopFailed = Standard_True; + } + } + else + { + bopFailed = Standard_True; + } + } + catch(Standard_Failure) + { + bopFailed = Standard_True; + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Catch: Boolean Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + Standard_Failure::Caught()->Print(cout); cout << endl; + } + scaleFactor+=0.1; + } + + + //## compute common of polSol1 and tmpS2 + try + { +//qiu BOPTools_DSFiller pDF; +//qiu pDF.SetShapes(tmpS2, polSol1); +//qiu pDF.Perform(); + +//qiu BRepAlgoAPI_Common theCOp(tmpS2, polSol1, pDF); + BRepAlgoAPI_Common theCOp(tmpS2, polSol1); + + if(theCOp.IsDone()) + { + tmpS1 = theCOp.Shape(); + + if(tmpS1.IsNull()) + { + cout << "\n## NULL Shape computed\n\n"; + continue; + } + + Standard_Integer shCnt(0); + for ( TopExp_Explorer Ex(tmpS1, TopAbs_SOLID); Ex.More(); Ex.Next() ) + { + newSol = TopoDS::Solid(Ex.Current()); + shCnt++; + } + + if(shCnt == 1) + { + if(newSol.IsNull()) + { + cout << "NULL SOLID COMPUTED\n\n"; + break; + } + + Standard_Real oldVol, newVol, tmpVol; +//qiu oldVol = McCadMcVoid::VolumeOfShape(polSol1); +//qiu newVol = McCadMcVoid::VolumeOfShape(newSol); + oldVol = VolumeOfShape(polSol1); + newVol = VolumeOfShape(newSol); + + if(oldVol < newVol) + { + cout << "COMMON HAS BIGGER VOLUME THAN ORIGINAL SOLID!!!\n"; + tmpVol = oldVol; + oldVol = newVol; + newVol = tmpVol; + } + + if(Abs(Abs( oldVol / newVol) -1) < aTol) + { + cout << "Nearly identical VOLUMES !!!\n"; + cout.precision(15); + cout << "Volume 1 : " << oldVol << endl; + cout << "Volume 2 : " << newVol << endl; + cout << "Common operation is considered failed !!!\n"; + + // extract verties from polSol1 and build BoundingBox + + cout << "Trying to double cut!!!\n"; + TopoDS_Shape cShp1 = Big; + BRepAlgoAPI_Cut firstCut(cShp1, tmpS2); + + if(firstCut.IsDone()) + { + TopoDS_Shape tmpShp = firstCut.Shape(); + + ShapeFix_ShapeTolerance setter; + Standard_Boolean sett; + sett = setter.LimitTolerance(polSol1, 1e-3, 0.0, TopAbs_SOLID); + if(!sett) + cout << "McCadCSGBuild_SolidFromCSG :: could not reset tolerance! 0 \n"; + sett = setter.LimitTolerance(tmpShp, 1e-3, 0.0, TopAbs_SOLID); + if(!sett) + cout << "McCadCSGBuild_SolidFromCSG :: could not reset tolerance! 1 \n"; + + BRepAlgoAPI_Cut secondCut(polSol1, tmpShp); + + if(secondCut.IsDone()) + { + tmpShp = secondCut.Shape(); + +//qiu oldVol = McCadMcVoid::VolumeOfShape(polSol1); +//qiu newVol = McCadMcVoid::VolumeOfShape(tmpShp); + oldVol = VolumeOfShape(polSol1); + newVol = VolumeOfShape(tmpShp); + + if(Abs( oldVol / newVol)-1 < aTol) + { + cout << "STILL THE SAME VOLUME !!!\n"; + cout.precision(15); + cout << "Volume 1 : " << oldVol << endl; + cout << "Volume 2 : " << newVol << endl; + cout << Abs(oldVol / newVol)-1 << endl; + } + + BRepCheck_Analyzer BA(tmpShp, Standard_True); + if(!BA.IsValid()) + { + cout << "Second cut failed !!!" << endl; + + ShapeAnalysis_Shell sas; + sas.LoadShells(tmpShp); + sas.CheckOrientedShells(tmpShp, Standard_True); + + if(sas.HasFreeEdges()) + { + cout << "Building missing face!!!\n"; + newSol = RepairOpenShell(tmpShp); + } + } + else + { + cout << "????\n"; + newSol = TopoDS::Solid(tmpShp); + } + + } + else + cout << "SECOND CUT FAILED\n"; + + } + else + cout << "CUTTING FAILED\n"; + } + + polSol1 = newSol; + } + else if(shCnt > 1) + { + cout << "More than one Solid resulted!!!\n"; + } + else + { + cout << "NULL Solid computed\n"; + } + } + else + { + cout << "Common Operation failed!!\n"; + } + } + catch(Standard_Failure) + { + msgr->Message("_#_McCadCSGBuild_SolidFromCSG.cxx :: Catch: Boolean Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + Standard_Failure::Caught()->Print(cout); cout << endl; + } + + } + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (polSol1.IsNull()) + msgr->Message("***** Null solid computed **** ", McCadMessenger_ErrorMsg); + + mySolids->Append(polSol1); + cout << "======================== "<< endl; + cout << "Cell processing ended "<< endl; + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + } +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGBuild_SolidFromCSG::Solids() const +{ + return mySolids; +} + + +TopoDS_Solid McCadCSGBuild_SolidFromCSG::Fused() const +{ + TopoDS_Shape tmpSol, oldSol, newSol; + + if (mySolids->Length() == 1) + return TopoDS::Solid(mySolids->Value(1)); + + else + { + + for (int k=2; k<=mySolids->Length() ; k++) + { + if (k==2) + oldSol = TopoDS::Solid(mySolids->Value(k-1)); + + newSol = TopoDS::Solid(mySolids->Value(k)); + + tmpSol = BRepAlgoAPI_Fuse(oldSol, newSol); + + oldSol = tmpSol; + + } + } + cout << "McCadCSGBuild_SolidFromCSG::Fused() " << endl; + + return TopoDS::Solid(tmpSol); +} + + +Standard_Integer McCadCSGBuild_SolidFromCSG::NbSolids() const +{ + return mySolids->Length(); +} + + +McCadCSGBuild_SolidType McCadCSGBuild_SolidFromCSG::Type() const +{ + + return myType; + +} + +// BOPTools_Tools3D::RemoveSims(tmpS2,ctx); +/* + BRepCheck_Analyzer BA5(tmpS2,Standard_True); + if(BA5.IsValid()) ; + else + { + cout << k << ".1 After BOP: Invalid Solid computed, fix follows. " << endl; + Handle(ShapeFix_Shape) genericFix = new ShapeFix_Shape; + genericFix->Init(tmpS2); + genericFix->SetPrecision (1.e-03); + genericFix->SetMaxTolerance(0.0); + genericFix->Perform(); + tmpS2 =TopoDS::Solid(genericFix->Shape()); + } + BA5.Init(tmpS2); + if(BA5.IsValid()) ; + else + { + cout << k << ".2 After BOP: Invalid Solid computed, fix follows " << endl ; + Handle(ShapeFix_Wireframe) wFix = new ShapeFix_Wireframe(tmpS2); + wFix->SetPrecision(1.e-03); + wFix->SetMaxTolerance(0.0); + wFix->FixSmallEdges(); + wFix->FixWireGaps(); + tmpS2 =TopoDS::Solid(wFix->Shape()); + } + BA5.Init(tmpS2); + if(BA5.IsValid()) ; + else cout << k << ". After BOP: Invalid Solid computed, fix failed " << endl ; + */ +/* + + BRep_Builder BB; Standard_Real locTol = 1.e-03; + for ( TopExp_Explorer ex(tmpS2,TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& iFace = TopoDS::Face(ex.Current()); + const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*)&iFace.TShape()); + TF->Tolerance(locTol); + TopExp_Explorer anExpW (iFace, TopAbs_WIRE); + for (; anExpW.More(); anExpW.Next()) { + const TopoDS_Shape& aW=anExpW.Current(); + TopExp_Explorer anExp(aW, TopAbs_EDGE); + for (; anExp.More(); anExp.Next()) { + const TopoDS_Edge& aE=TopoDS::Edge(anExp.Current()); + const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&aE.TShape()); + TE->Tolerance(locTol); + TopExp_Explorer anExpV(aE, TopAbs_VERTEX); + for (; anExpV.More(); anExpV.Next()) { + const TopoDS_Vertex& aVx=TopoDS::Vertex(anExpV.Current()); + const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*)&aVx.TShape()); + TV->Tolerance(locTol); + } + } + } + } + + + Handle(ShapeFix_FixSmallFace) fixer = new ShapeFix_FixSmallFace; + fixer->Init(oldSol1); + fixer->SetPrecision(1.e-03); + fixer->SetMaxTolerance(1.e-03); + fixer->Perform(); + oldSol1 = TopoDS::Solid(fixer->Shape()); + + + if (!sh.Free ()) {cout << "Free Shell !! " << endl; sh.Free(Standard_True);} + + TopoDS_Solid solid; + BRep_Builder B; + B.MakeSolid(solid); + B.Add(solid,sh); + try { + BRepClass3d_SolidClassifier bsc3d (solid); + Standard_Real t = Precision::Confusion(); + bsc3d.PerformInfinitePoint(t); + + if (bsc3d.State() == TopAbs_IN) { + if (!sh.Free ()) sh.Free(Standard_True); + TopoDS_Solid soli2; + B.MakeSolid (soli2); + sh.Reverse(); + B.Add (soli2,sh); + solid = soli2; + } + + + + Standard_Real UMin=0,UMax=0,VMin=0,VMax=0; + for ( TopExp_Explorer ex(polSol1,TopAbs_FACE); ex.More(); ex.Next()) + { + TopLoc_Location L; + TopoDS_Face F = TopoDS::Face(ex.Current()); + BRepTools::Update(F); + Standard_Real tUMin=0,tUMax=0,tVMin=0,tVMax=0; + BRepTools::UVBounds(F,tUMin,tUMax,tVMin,tVMax); + BRepAdaptor_Surface BS(F,Standard_True); + GeomAdaptor_Surface adSurf= BS.Surface(); + if (adSurf.GetType() == GeomAbs_Plane) + { + cout << tUMin << " " << tUMax << " " << tVMin << " " << tVMax << endl; + // if ((fabs(fabs(tUMax) - fabs(tUMin)) >= fabs(fabs(UMax) - fabs(UMin)))) + // if ((fabs(fabs(tVMax) - fabs(tVMin)) >= fabs(fabs(VMax) - fabs(VMin))) ) + + + if (UMin > tUMin) UMin = tUMin; + if (UMax < tUMax) UMax = tUMax; + if (VMin > tVMin) VMin = tVMin; + if (VMax < tVMax) VMax = tVMax; + + } + } + + + //////////////////////////////////////////////////////////////////// + TopoDS_Face HFace; + for (TopExp_Explorer ex(failedHSolSeq->Value(k),TopAbs_FACE); ex.More(); ex.Next()) + HFace = TopoDS::Face(ex.Current()); + + BRepAlgo_Section Sec(HFace,polSol1,Standard_False); + + + Sec.ComputePCurveOn1(Standard_True); + // Sec.ComputePCurveOn2(Standard_True); + Sec.Approximation(Standard_False); + Sec.Build(); + TopoDS_Shape secShape = Sec.Shape(); // we expect hier a wire + int iz=0; + TopoDS_Wire iWire; + BRep_Builder fB; + fB.MakeWire(iWire); + + Handle(BRepAlgo_EdgeConnector) Con = new BRepAlgo_EdgeConnector; + + for (TopExp_Explorer ex(secShape,TopAbs_EDGE); ex.More(); ex.Next()) + { + TopoDS_Edge anEdge = TopoDS::Edge(ex.Current()); + if (!BRep_Tool::Degenerated(anEdge)) + { + fB.Add(iWire,anEdge); + cout << ++iz << endl; + } + } + iWire = BRepAlgo::ConcatenateWire(iWire, GeomAbs_C1, 1e-03); + if(Con->IsWire(iWire)) cout << " Wire seems to be ok!! " << endl ; + else cout << " Wire seems to be not ok!! " << endl; + + TopAbs::Print(secShape.ShapeType(),cout); cout << endl; + //////////////////////////////////////////////////////////////// + TopoDS_Shell fSh; + fB.MakeShell(fSh); + TopoDS_Solid fSolid; + iz=0; + for (TopExp_Explorer ex(failedHSolSeq->Value(k),TopAbs_FACE); ex.More(); ex.Next()) + { + TopLoc_Location L; + const TopoDS_Face& iFace = TopoDS::Face(ex.Current()); + // + // TopoDS_Face fF = BRepBuilderAPI_MakeFace(BRep_Tool::Surface(iFace,L),iWire); + // TopoDS_Face fF = BRepBuilderAPI_MakeFace(iWire); + TopoDS_Face fF = BRepBuilderAPI_MakeFace(iFace,iWire); + const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*)&fF.TShape()); + TF->Tolerance(1.0); + // fF.Orientation(TopAbs_INTERNAL); + fF.Orientation(iFace.Orientation()); + fB.Add(fSh,fF); + Standard_Real tUMin=0,tUMax=0,tVMin=0,tVMax=0; + BRepTools::Update(fF); + BRepTools::UVBounds(fF,tUMin,tUMax,tVMin,tVMax); + BRepAdaptor_Surface BS(fF,Standard_True); + GeomAdaptor_Surface adSurf= BS.Surface(); + cout << tUMin << " " << tUMax << " " << tVMin << " " << tVMax << endl; + cout << ++iz << endl; + } + + cout << " New halfspace face computed !! " << endl; + + for (TopExp_Explorer ex(Big,TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& iFace = TopoDS::Face(ex.Current()); + fB.Add(fSh,iFace); + cout << ++iz << endl; + } + + if (!fSh.Free ()) fSh.Free(Standard_True); // fSh.Reverse(); + + fSh.Reverse(); + + fSh.Compose(TopAbs_FORWARD); + + if (!fSh.Free ()) fSh.Free(Standard_True); + fB.MakeSolid(fSolid); + fB.Add(fSolid,fSh); + + BRepCheck_Analyzer BAF(fSolid,Standard_True); + if(BAF.IsValid()) + { + cout << " New halfspace solid computed !! " << endl; + } + else + { + cout << " New halfspace solid is invalid !! " << endl; + fSolid = BRepBuilderAPI_MakeSolid(fSh).Solid(); + Handle(BRepCheck_Shell) res = new BRepCheck_Shell(fSh); + BRepCheck::Print(res->Closed(),cout); + BRepCheck::Print(res->Orientation(),cout); + if(res->IsUnorientable()) cout << " Shell Is Unorientable !! " << endl; + cout << " Shell Check finished !! " << endl; + } + + + BRepCheck_Analyzer BA(polSol1,Standard_False); + if(BA.IsValid()) + { + mySolids->Append(polSol1); + cout << "Cell processing ended "<< endl; + cout << "======================== "<< endl; + } + else + { + cout << " Invalid Solid computed: fix follows !! " << endl; + TopoDS_Shell tmpSh; + for ( TopExp_Explorer ex(polSol1,TopAbs_SHELL); ex.More(); ex.Next()) + { + tmpSh = TopoDS::Shell(ex.Current()); + + Handle(ShapeFix_Shell) genericFix = new ShapeFix_Shell; + genericFix->Init(tmpSh); + genericFix->SetPrecision (1.e-03); + genericFix->SetMaxTolerance(1.e-03); + genericFix->Perform(); + tmpSh =TopoDS::Shell(genericFix->Shape()); + + if(BA.IsValid(tmpSh)) + { + cout << " Shell is valid!! " << endl ; + TopoDS_Solid aSolid = BRepBuilderAPI_MakeSolid(tmpSh).Solid(); + mySolids->Append(aSolid); + } + else + { + cout << " Shell is not valid!! " << endl ; + + TopoDS_Solid aSolid = BRepBuilderAPI_MakeSolid(tmpSh).Solid(); + mySolids->Append(aSolid); + Handle(BRepCheck_Shell) res = new BRepCheck_Shell(tmpSh); + BRepCheck::Print(res->Closed(),cout); + BRepCheck::Print(res->Orientation(),cout); + if(res->IsUnorientable()) cout << " Shell Is Unorientable !! " << endl; + } + for ( TopExp_Explorer ex(tmpSh,TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& iFace = TopoDS::Face(ex.Current()); + + if(BA.IsValid(iFace))cout << " Face is valid!! " << endl; + else { + cout << " Face is not valid!! " << endl; + Handle(BRepCheck_Face) res = new BRepCheck_Face(iFace); + res->GeometricControls(Standard_True); + BRepCheck::Print(res->IntersectWires(),cout); + BRepCheck::Print(res->ClassifyWires(),cout); + BRepCheck::Print(res->OrientationOfWires(),cout); + if(res->IsUnorientable()) cout << " Face Is Unorientable !! " << endl; + } + TopExp_Explorer anExpW (iFace, TopAbs_WIRE); + for (; anExpW.More(); anExpW.Next()) { + const TopoDS_Shape& aW=anExpW.Current(); + if(BA.IsValid(aW)) cout << " Wire is valid!! " << endl; + else cout << " Wire is not valid!! " << endl; + TopExp_Explorer anExp(aW, TopAbs_EDGE); + for (; anExp.More(); anExp.Next()) { + const TopoDS_Edge& aE=TopoDS::Edge(anExp.Current()); + if(BA.IsValid(aE)) cout << " Ege is valid!! " << endl; + else cout << " Ege is not valid!! " << endl; + TopExp_Explorer anExpV(aE, TopAbs_VERTEX); + for (; anExpV.More(); anExpV.Next()) { + const TopoDS_Vertex& aVx=TopoDS::Vertex(anExpV.Current()); + if(BA.IsValid(aVx)) cout << " Verice is valid!! " << endl; + else cout << " Verice is not valid!! " << endl; + + } + } + } + } + } + cout << "Cell processing ended "<< endl; + cout << "======================== "<< endl; + } + + + + */ diff --git a/src/MCCAD/McCadCSGBuild/tt.cxx b/src/MCCAD/McCadCSGBuild/tt.cxx new file mode 100644 index 0000000..696f92d --- /dev/null +++ b/src/MCCAD/McCadCSGBuild/tt.cxx @@ -0,0 +1,137 @@ +Handle(TopTools_HSequenceOfShape) LinApprox(Handle(TopTools_HSequenceOfShape) failedHSolSeq, const TopoDS_Solid& theSolid) +{ + + //////////////////////////////////////////////////////////////////// + Handle(TopTools_HSequenceOfShape) linHSpaces = new TopTools_HSequenceOfShape(); + + Bnd_Box2d BB2; + Bnd_Box BB3; + Standard_Real UMin,UMax,VMin,VMax; + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + for (TopExp_Explorer ex(theSolid,TopAbs_VERTEX); ex.More(); ex.Next()) + { + BRepBndLib::AddClose(ex.Current(),BB3); + // BB3.Add(BRep_Tool::Pnt(TopoDS::Vertex(ex.Current()))); + // BB3.SetGap(0.0); + } + BB3.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + TopoDS_Shape locBox = BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin), gp_Pnt(aXmax, aYmax, aZmax)).Shape(); + BB2.Add(gp_Pnt2d(aXmin, aYmin)); + BB2.Add(gp_Pnt2d(aXmin, aZmin)); + BB2.Add(gp_Pnt2d(aYmin, aZmin)); + BB2.Add(gp_Pnt2d(aXmax, aYmax)); + BB2.Add(gp_Pnt2d(aXmax, aZmax)); + BB2.Add(gp_Pnt2d(aYmax, aZmax)); + BB2.SetGap(0.0); + BB2.Get(UMin,VMin,UMax,VMax); + int iz=0; + for (int k =1; k<= failedHSolSeq->Length(); k++) + { + for (TopExp_Explorer ex(failedHSolSeq->Value(k),TopAbs_FACE); ex.More(); ex.Next()) + { + TopLoc_Location L; + const TopoDS_Face& iFace = TopoDS::Face(ex.Current()); + const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*)&iFace.TShape()); + TF->Tolerance(1.e-03); + //////////////////////////////////////////////////////////////////////////////////////// + TopoDS_Face fF = BRepBuilderAPI_MakeFace(BRep_Tool::Surface(iFace,L),UMin,UMax,VMin,VMax); + fF.Orientation(iFace.Orientation()); + BRepTools::Update(fF); + BRepTools::UVBounds(fF,UMin,UMax,VMin,VMax); + cout << "Face Bounds for " << ++iz << endl; + cout << UMin << " " << UMax << " " << VMin << " " << VMax << endl; + //////////////////////////////////////////////////////////////////////////////// + BRep_Builder B; + TopoDS_Shell Sh; + B.MakeShell(Sh); + TopoDS_Solid Solid; + B.Add(Sh,fF); + if (!Sh.Free ()) Sh.Free(Standard_True); + B.MakeSolid(Solid); + B.Add(Solid,Sh); + + + TopoDS_Shape tmpSh; + try + { + + BRepAlgoAPI_Common COp(locBox,Solid); + if(COp.IsDone()) + { + + tmpSh = COp.Shape(); + } + else + { + cout << "LinApprox BOP: Boolean Operation on a halfspace failed !!!" << endl; + continue; + } + + } + catch(Standard_Failure) + { + cout << "LinApprox Catch: Boolean Operation on a halfspace failed !!!" << endl; + Standard_Failure::Caught()->Print(cout); cout << endl; + continue; + } + + + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////// Triangulation ///////////////////////////////////// + for (TopExp_Explorer exF(tmpSh,TopAbs_FACE); exF.More(); exF.Next()) + { + TopLoc_Location loc; + TopoDS_Face lF = TopoDS::Face(exF.Current()); + BRepTools::Update(lF); + BRepTools::UVBounds(lF,UMin,UMax,VMin,VMax); + cout << "Face Bounds for " << ++iz << endl; + cout << UMin << " " << UMax << " " << VMin << " " << VMax << endl; + + Handle(Geom_Surface) theSurf = BRep_Tool::Surface(lF,loc); + Handle(Poly_Triangulation) mesh; + BRepAdaptor_Surface BS(lF,Standard_True); + gp_Trsf T = BS.Trsf(); + + Standard_Real aDeflection = MAX2( fabs(UMax)-fabs(UMin), fabs(VMax)-fabs(VMin))/1.0; + BRepMesh::Mesh(lF, aDeflection); + mesh = BRep_Tool::Triangulation(lF,loc); + + if (mesh.IsNull()) cout << "Face triangulation failed !!" << endl; + else + { + Standard_Integer nNodes = mesh->NbNodes(); + TColgp_Array1OfPnt meshPnts(1,nNodes); + meshPnts = mesh->Nodes(); + Standard_Integer nbTriangles = mesh->NbTriangles(); + cout << " Number of Nodes = " << nNodes << " Number of Triangles = " << nbTriangles << endl; + Standard_Integer n1, n2, n3; + const Poly_Array1OfTriangle& Triangles = mesh->Triangles(); + for (int i = 1; i <= nbTriangles; i++) + { + Triangles(i).Get(n1, n2, n3); + gp_Pnt P1 = (meshPnts(n1)).Transformed(T); + gp_Pnt P2 = (meshPnts(n2)).Transformed(T); + gp_Pnt P3 = (meshPnts(n3)).Transformed(T); + gp_Vec v1(P1, P2), v2(P1, P3); + gp_Vec v3 = v1 ^ v2; + v3.Normalize(); + gp_Dir D1(v3); + gp_Pln Plane1(P1,D1); + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(Plane1); + F1.Orientation(iFace.Orientation()); + BRep_Builder fB; + TopoDS_Shell fSh; + fB.MakeShell(fSh); + TopoDS_Solid fSolid; + fB.Add(fSh,F1); + if (!fSh.Free ()) fSh.Free(Standard_True); + fB.MakeSolid(fSolid); + fB.Add(fSolid,fSh); + linHSpaces->Append(fSolid); + } + } + } + } + } + return linHSpaces; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cell.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cell.cxx new file mode 100644 index 0000000..7bfed23 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cell.cxx @@ -0,0 +1,483 @@ +#include +#include +#include + +McCadCSGGeom_Cell::McCadCSGGeom_Cell() +{ + myCellNumber = 0; + myMaterialNumber = 0; + myDensity = 0.;//arbitrary density + mySurfCounter = 0; + myTrsfCounter = 0; + myCSG = new TColStd_HSequenceOfAsciiString(); + myCSG->Clear(); + mySurfaces.Clear(); + myComment = TCollection_AsciiString("c McCad Generated Cell!"); + myComplementCells = new TColStd_HSequenceOfInteger; + myIsVoid = Standard_False; + myMCType = McCadCSGGeom_MCNP; +} + + +McCadCSGGeom_Cell::McCadCSGGeom_Cell(const Standard_Integer theCNum, const Standard_Integer theMNum, const Standard_Real theDensity) +{ + myCellNumber = theCNum; + myMaterialNumber = theMNum; + myDensity = theDensity; + mySurfCounter = 0; + myTrsfCounter = 0; + myCSG = new TColStd_HSequenceOfAsciiString; + myCSG->Clear(); + mySurfaces.Clear(); + myComment = TCollection_AsciiString("c McCad Generated Cell!"); + myComplementCells = new TColStd_HSequenceOfInteger; + myIsVoid = Standard_False; + myMCType = McCadCSGGeom_MCNP; +} + + +void McCadCSGGeom_Cell::SetCellNumber(const Standard_Integer theCNum) +{ + myCellNumber = theCNum; +} + + +Standard_Integer McCadCSGGeom_Cell::GetCellNumber() const +{ + return myCellNumber; +} + + +void McCadCSGGeom_Cell::SetMaterialNumber(const Standard_Integer theMNum) +{ + myMaterialNumber = theMNum; +} + + +Standard_Integer McCadCSGGeom_Cell::GetMaterialNumber() const +{ + return myMaterialNumber; +} + + +void McCadCSGGeom_Cell::SetDensity(const Standard_Real theDensity) +{ + myDensity = theDensity; +} + + +Standard_Real McCadCSGGeom_Cell::GetDensity() const +{ + return myDensity; +} + + +void McCadCSGGeom_Cell::SetSurface( const McCadCSGGeom_DataMapOfIntegerSurface& theSurfaces) +{ + mySurfaces.Clear(); + mySurfaces.Assign(theSurfaces); +} + + +McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface McCadCSGGeom_Cell::GetSurface() const +{ + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface surfIter(mySurfaces); + return surfIter; +} + + +void McCadCSGGeom_Cell::PrintCell(Standard_OStream& theStream) +{ + // used for absolute counting mySurfCounter && myTrsfCounter + // should be set to zero before starting printing; + + theStream.precision(5); + theStream.width(5); + theStream.fill(' '); + theStream.setf(ios::left); + + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + TColStd_HSequenceOfInteger plusList; // sort list by positive and negative values. >> MINUS >> PLUS and print volumes. + TColStd_HSequenceOfInteger minusList; + TColStd_HSequenceOfInteger vminusList; + Standard_Boolean isFictive (Standard_False); + + for(int i=1; i<=myCSG->Length(); i++) + { + TCollection_AsciiString curVal = myCSG->Value(i); + if(curVal.IsIntegerValue()) + { + Standard_Integer intVal = curVal.IntegerValue(); + if(intVal < 0) + minusList.Append(intVal); + else + plusList.Append(intVal); + } + else if(curVal.Search("#") > 0) //complement + { + while(curVal.Search("#") > 0) + { + curVal.LeftAdjust(); + curVal.Remove(1,curVal.Search("#")); + + TCollection_AsciiString tmpStr = curVal; + + if(tmpStr.Search(" ") > 0) + curVal = tmpStr.Split(curVal.Search(" ")); + else + curVal = ""; + + tmpStr.RightAdjust(); + + if(tmpStr.IsIntegerValue()) + vminusList.Append(tmpStr.IntegerValue()); + else + cout << "###### NOT AN INTEGER VALUE" << endl; + } + } + else if(curVal.Search("FICTIVE") > 0) // make cell Virtual + { + isFictive = Standard_True; + } + } + + //Print Surfaces + if(plusList.Length() > 0) + { + theStream << "\n PLUS " << plusList.Length() << " "; + for(int i=1; i<=plusList.Length(); i++) + theStream << plusList.Value(i) << " "; + } + if(minusList.Length() > 0) + { + theStream << "\n MINUS " << minusList.Length() << " "; + for(int i=1; i<=minusList.Length(); i++) + theStream << Abs(minusList.Value(i)) << " "; + } + if(vminusList.Length()>0) // we have complementary cells + { + theStream << "\n VMINUS " << vminusList.Length() << " "; + for(int i=1; i<=vminusList.Length(); i++) + theStream << Abs(vminusList.Value(i)) << " "; + } + if(isFictive) + theStream << " FICTIVE "; + } + else // Default MCNP + { + theStream.setf(ios::left); + theStream.unsetf(ios::right); + theStream << setw(5) << myCellNumber << " "; // cell number + theStream << setw(3) << myMaterialNumber << " "; + + if( !myIsVoid && myDensity != 0 ) + theStream << setw(8) << myDensity << " "; + theStream << endl; + + theStream.unsetf(ios::left); + theStream.setf(ios::right); + theStream.width(7); + theStream.fill(' '); + theStream << setw(12) << " "; + + int stcount = 12; + + // print importances + if(myIsOuterVoid) + { + myCSG->Append(TCollection_AsciiString(" IMP:N=0")); + myCSG->Append(TCollection_AsciiString(" IMP:P=0")); + } + else + { + myCSG->Append(TCollection_AsciiString(" IMP:N=1")); + myCSG->Append(TCollection_AsciiString(" IMP:P=1")); + } + + // make universe + if(getenv("MCCAD_MAKEUNIVERSE") != NULL) + { + TCollection_AsciiString universe(" U="); + TCollection_AsciiString uNumber(getenv("MCCAD_MAKEUNIVERSE")); + if(uNumber.IsIntegerValue()) + { + universe += uNumber; + myCSG->Append(universe); + } + } + + // cout << "\n" << stcount << endl; + + theStream.setf(ios::right); + + bool notYetInComplementSection(true); + bool notYetImp(true); + + for (int i=1; i<= myCSG->Length(); i++) + { + TCollection_AsciiString curCSG = myCSG->Value(i); + curCSG.RightAdjust(); + + if(curCSG.Search("#") > 0 && notYetInComplementSection) + { + notYetInComplementSection = false; + theStream << endl << setw(12) << " "; + stcount = 12; + } + + if( curCSG.Search("imp") > 0 || curCSG.Search("IMP") > 0 ) + { + if(notYetImp) + { + notYetImp = false; + theStream << endl << setw(12) << " "; + stcount = 12; + } + } + + if( stcount+8 > 78 ) + { + theStream << endl << setw(12) << " "; + stcount = 12; + } + + theStream << setw(8) << curCSG.ToCString(); + stcount += 8; + } + + theStream.unsetf(ios::right); + } + + theStream << endl; +} + + +void McCadCSGGeom_Cell::PrintSurfaces(Standard_OStream& theStream) +{ + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface theIter; + + theStream.precision(5); + theStream.width(5); + theStream.fill(' '); + theStream.setf(ios::left); + + // we set first the trsf numbers correctly + Standard_Integer iCount = GetTrsfCounter(); + for (theIter.Initialize(mySurfaces) ; theIter.More() ; theIter.Next()) + { + Handle(McCadCSGGeom_Surface) tmpSurf = theIter.Value(); + + if (tmpSurf->HaveTransformation()) + { + iCount++; + tmpSurf->SetTrsfNumber(iCount); + } + } + for (theIter.Initialize(mySurfaces) ; theIter.More() ; theIter.Next()) + { + Handle(McCadCSGGeom_Surface) tmpSurf = theIter.Value(); + Standard_Integer surffNb = tmpSurf->GetNumber() + mySurfCounter; + tmpSurf->SetNumber(surffNb); + tmpSurf->SetMCType(myMCType); + tmpSurf->Print(theStream); + } +} + + +void McCadCSGGeom_Cell::PrintSurfaceTrsfMat(Standard_OStream& theStream) +{ + theStream.precision(7); + // theStream.width(5); + theStream.fill(' '); + theStream.setf(ios::left); + + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface theIter; + + for (theIter.Initialize(mySurfaces) ; theIter.More() ; theIter.Next()) + { + Handle(McCadCSGGeom_Surface) tmpSurf = theIter.Value(); + + if (tmpSurf->HaveTransformation()) + { + gp_Trsf theTrsf; + gp_Ax3 theAxis = tmpSurf->GetAxis(); + gp_Ax3 stdAxis; + theTrsf.SetTransformation(theAxis, stdAxis); + + TCollection_AsciiString trStr("tr"); + trStr += tmpSurf->GetTrsfNumber(); + theStream << setw(7) << trStr.ToCString(); + + gp_XYZ Vec = theTrsf.TranslationPart(); + theStream.precision(7); + theStream.width(7); + theStream.fill(' '); + + if(Abs(Vec.X()) < 1.e-7) + Vec.SetX(0.0); + if(Abs(Vec.Y()) < 1.e-7) + Vec.SetY(0.0); + if(Abs(Vec.Z()) < 1.e-7) + Vec.SetZ(0.0); + + theStream.setf(ios::right); + theStream << setw(15) << Vec.X() << " " + << setw(15) << Vec.Y() << " " + << setw(15) << Vec.Z() << endl; + gp_Mat Mat = theTrsf.HVectorialPart(); + + for (int i=1; i<=3; i++) + { + gp_XYZ Vvec = Mat.Column(i); + + if(Abs(Vvec.X()) < 1.e-10) + Vvec.SetX(0.0); + if(Abs(Vvec.Y()) < 1.e-10) + Vvec.SetY(0.0); + if(Abs(Vvec.Z()) < 1.e-10) + Vvec.SetZ(0.0); + + theStream << setw(7)<< " " + << setw(15) << Vvec.X() << " " + << setw(15) << Vvec.Y() << " " + << setw(15) << Vvec.Z() << endl; + } + theStream.unsetf(ios::right); + } + } +} + + +void McCadCSGGeom_Cell::SetCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG) +{ + myCSG = theCSG; +} + + +void McCadCSGGeom_Cell::AppendToCSG(const TCollection_AsciiString& theCSG) +{ + myCSG->Append(theCSG); +} + + +Handle(TColStd_HSequenceOfAsciiString) McCadCSGGeom_Cell::GetCSG() const +{ + return myCSG; +} + + +void McCadCSGGeom_Cell::SetSurfCounter(const Standard_Integer theSCount) +{ + mySurfCounter = theSCount; +} + + +Standard_Integer McCadCSGGeom_Cell::GetSurfCounter() const +{ + return mySurfCounter; +} + + +void McCadCSGGeom_Cell::SetTrsfCounter(const Standard_Integer theTCount) +{ + myTrsfCounter = theTCount; +} + + +Standard_Integer McCadCSGGeom_Cell::GetTrsfCounter() const +{ + return myTrsfCounter; +} + + +Standard_Integer McCadCSGGeom_Cell::GetNbOfSurf() const +{ + return mySurfaces.Extent(); +} + + +Standard_Integer McCadCSGGeom_Cell::GetNbOfSurfTrsf() const +{ + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface theIter; + Standard_Integer iCount=0; + + for (theIter.Initialize(mySurfaces) ; theIter.More() ; theIter.Next()) + { + if ((theIter.Value())->HaveTransformation()) + { + iCount++; + } + } + return iCount; +} + + +void McCadCSGGeom_Cell::SetComment(const TCollection_AsciiString& theComment) +{ + myComment = theComment; +} + + +TCollection_AsciiString McCadCSGGeom_Cell::GetComment() const +{ + return myComment; +} + + +void McCadCSGGeom_Cell::PrintComment(Standard_OStream& theStream) +{ + if(myMCType == McCadCSGGeom_TRIPOLI) + { + theStream << "// " << (myComment).ToCString() << endl; + } + else + theStream << (myComment).ToCString() << " " << endl; +} + + +void McCadCSGGeom_Cell::SetComplementCells(const Handle(TColStd_HSequenceOfInteger)& theIntSeq) +{ + myComplementCells->Clear(); + myComplementCells->Append(theIntSeq); +} + +void McCadCSGGeom_Cell::SetVoid(const Standard_Boolean& isVoid) +{ + myIsVoid = isVoid; +} + +void McCadCSGGeom_Cell::SetOuterVoid(Standard_Boolean isVoid) +{ + myIsOuterVoid = isVoid; +} + +Standard_Boolean McCadCSGGeom_Cell::IsVoid() +{ + return myIsVoid; +} + +Handle(TColStd_HSequenceOfInteger) McCadCSGGeom_Cell::GetComplementCells() const +{ + return myComplementCells; +} + +void McCadCSGGeom_Cell::SetMCType(const McCadCSGGeom_MCType& theMCType) +{ + myMCType = theMCType; +} + +McCadCSGGeom_MCType McCadCSGGeom_Cell::GetMCType() +{ + return myMCType; +} + +void McCadCSGGeom_Cell::SetVolume(const Standard_Real& theVol) +{ + myVolume = theVol; +} + +Standard_Real McCadCSGGeom_Cell::GetVolume() +{ + return myVolume; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cone.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cone.cxx new file mode 100644 index 0000000..15c0087 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cone.cxx @@ -0,0 +1,446 @@ +#include +#include +#include +#include + + +#include +#include + + + +McCadCSGGeom_Cone::McCadCSGGeom_Cone() +{ + gp_Ax3 A3; + SetType(McCadCSGGeom_Conical); + SetAxis(A3); + mySheet = 0; + myApex = gp_Pnt(0,0,0); +} + +McCadCSGGeom_Cone::McCadCSGGeom_Cone(const gp_Ax3& A3,const Standard_Real Ang,const Standard_Real theRadius) +{ + SetType(McCadCSGGeom_Conical); + SetAxis(A3); + mySemiAngle = Ang; + myRadius =theRadius; + mySheet = 0; + myApex = gp_Pnt(0,0,0); +} + +McCadCSGGeom_Cone::McCadCSGGeom_Cone(const gp_Ax3& A3,const Standard_Real Ang,const Standard_Real theRadius, const int sheet) +{ + SetType(McCadCSGGeom_Conical); + SetAxis(A3); + mySemiAngle = Ang; + myRadius =theRadius; + mySheet = sheet; + myApex = gp_Pnt(0,0,0); +} + +int McCadCSGGeom_Cone::Sheet() +{ + if(abs(mySheet) > 1) + mySheet = int (mySheet / abs(mySheet)); + + return mySheet; +} + +void McCadCSGGeom_Cone::SetRadius(const Standard_Real theRadius) +{ + myRadius = theRadius; +} + +void McCadCSGGeom_Cone::SetSemiAngle(const Standard_Real Ang) +{ + mySemiAngle = Ang; +} + +Standard_Real McCadCSGGeom_Cone::GetRadius() const +{ + + return myRadius; + +} + +Standard_Real McCadCSGGeom_Cone::GetSemiAngle() const +{ + + return mySemiAngle ; + +} + +void McCadCSGGeom_Cone::Coefficients(Standard_Real& A1,Standard_Real& A2,Standard_Real& A3,Standard_Real& B1,Standard_Real& B2,Standard_Real& B3,Standard_Real& C1,Standard_Real& C2,Standard_Real& C3,Standard_Real& D) const +{ + + gp_Cone C(myAxis, mySemiAngle,myRadius); + + C.Coefficients( A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + +} + +void McCadCSGGeom_Cone::Print(Standard_OStream& theStream) const +{ + + theStream.setf(ios::scientific); + theStream.precision(myOutputPrecision); + + gp_Pnt theApex; + gp_Dir theDir; + gp_Ax1 coneMainAx; + Standard_Real A1, A2, A3, B1, B2, B3, C1, C2, C3, D; + gp_Cone C; + gp_Trsf tmpTrsf; + gp_XYZ transl; + // if the main axis is rotated the Trsf matrix is printed by client; + // here we only print qaudric in major axis position with its TRcard Number. + // warning it is up to the clien to print the Trsf matrix. + gp_Ax3 theAxis; + + if (haveTrsf) + { +// cout << "HAVE TRANSFORMED CONE AXIS!!!\n\n\n"; +// cout << myAxis.Direction().X() << " " << myAxis.Direction().Z() << " -- " << myTransformedAxis.Direction().X() << " " << myTransformedAxis.Direction().Z() << endl; + //cout << myAxis.Location().X() << " " << myAxis.Location().Z() << " -- " << myTransformedAxis.Location().X() << " " << myTransformedAxis.Location().Z() << endl; + theAxis = myTransformedAxis; + } + else + theAxis = myAxis; + + C.SetPosition(theAxis); + C.SetRadius(myRadius); + C.SetSemiAngle(mySemiAngle); + + C.Scale(gp_Pnt(0,0,0), Scale()); // this is to make mcnp happy with its cms. + + coneMainAx = C.Axis(); + theDir = coneMainAx.Direction(); + + theApex = C.Apex(); + + Standard_Real apexX(theApex.X()), apexY(theApex.Y()), apexZ(theApex.Z()); + if(Abs(apexX) < 1.0e-07) + apexX = 0.0; + if(Abs(apexY) < 1.0e-07) + apexY = 0.0; + if(Abs(apexZ) < 1.0e-07) + apexZ = 0.0; + + gp_Ax3 stdAx3Z(theAxis.Location(),gp::DZ()); + gp_Ax3 stdAx3X(theAxis.Location(),gp::DX()); + gp_Ax3 stdAx3Y(theAxis.Location(),gp::DY()); + + if(GetMCType()==McCadCSGGeom_TRIPOLI) // we don't need transformation cards + { + theStream << setw(8) << " SURF " << setw(5) << myNumber << " "; + gp_Ax3 stdAxis; + theAxis = GetAxis(); + theDir = theAxis.Direction(); + tmpTrsf.SetTransformation(theAxis, stdAxis); + transl = tmpTrsf.TranslationPart(); + cout << "TRANSLATION : " << tmpTrsf.TranslationPart().X() << " " << tmpTrsf.TranslationPart().Y() << " " << tmpTrsf.TranslationPart().Z() << endl; + gp_Pnt xyzPnt(transl); + stdAx3Z.SetLocation(xyzPnt); + stdAx3Y.SetLocation(xyzPnt); + stdAx3X.SetLocation(xyzPnt); + } + + if ( theAxis.IsCoplanar(stdAx3X, 0.001,0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CONEX"; + theStream.setf(ios::right); + theStream << setw(15) << apexX << " " + << setw(15) << apexY << " " + << setw(15) << apexZ << "\n\t\t" + << setw(20) << C.SemiAngle()*(180./M_PI) << endl; + theStream.unsetf(ios::right); + } + else + { + if (fabs(apexX) >= 1.e-07 && fabs(apexY) <= 1.e-07 && fabs(apexZ) <= 1.e-07) + { + theStream << setw(5) << myNumber << " " ; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + + theStream << setw(4) << "KX " + << setw(8+myOutputPrecision) << apexX << " " + << setw(8+myOutputPrecision) << pow(tan(C.SemiAngle()),2) << endl ; + theStream.unsetf(ios::right); + } + else + { + theStream << setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "K/X " + << setw(8+myOutputPrecision) << apexX << " " + << setw(8+myOutputPrecision) << apexY << " " + << setw(8+myOutputPrecision) << apexZ << " " << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << pow(tan(C.SemiAngle()),2) << endl ; + theStream.unsetf(ios::right); + } + } + } + else if ( theAxis.IsCoplanar(stdAx3Y, 0.001,0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CONEY"; + theStream.setf(ios::right); + theStream << setw(15) << apexX << " " + << setw(15) << apexY << " " + << setw(15) << apexZ << "\n\t\t" + << setw(20) << C.SemiAngle()*(180./M_PI) << endl; + theStream.unsetf(ios::right); + } + else + { + if (fabs(apexX) <= 1.e-07 && fabs(apexY) >= 1.e-07 && fabs(apexZ) <= 1.e-07) + { + theStream<< setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " " ; + else + theStream << setw(4) << " "; + + theStream << setw(4) << "KY " + << setw(8+myOutputPrecision) << apexY << " " + << setw(8+myOutputPrecision) << pow(tan(C.SemiAngle()),2) << endl ; + theStream.unsetf(ios::right); + } + else + { + theStream << setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + + theStream << setw(4) << "K/Y " + << setw(8+myOutputPrecision) << apexX << " " + << setw(8+myOutputPrecision) << apexY << " " + << setw(8+myOutputPrecision) << apexZ << " " << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << pow(tan(C.SemiAngle()),2) << endl ; + theStream.unsetf(ios::right); + } + } + } + else if ( theAxis.IsCoplanar(stdAx3Z, 0.001,0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CONEZ"; + theStream.setf(ios::right); + theStream << setw(15) << apexX << " " + << setw(15) << apexY << " " + << setw(15) << apexZ << "\n\t\t" + << setw(20) << C.SemiAngle()*(180./M_PI) << endl; + theStream.unsetf(ios::right); + } + else + { + if (fabs(apexX) <= 1.e-07 && fabs(apexY) <= 1.e-07 && fabs(apexZ) >= 1.e-07) + { + theStream << setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " " ; + else + theStream << setw(4) << " "; + theStream << setw(4) << "KZ " + << setw(8+myOutputPrecision) << apexZ << " " + << setw(8+myOutputPrecision) << pow(tan(C.SemiAngle()),2) << endl ; + theStream.unsetf(ios::right); + } + else + { + theStream << setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " " ; + else + theStream << setw(4) << " "; + + theStream << setw(4) << "K/Z " + << setw(8+myOutputPrecision) << apexX << " " + << setw(8+myOutputPrecision) << apexY << " " + << setw(8+myOutputPrecision) << apexZ << " " << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << pow(tan(C.SemiAngle()),2) << endl; + theStream.unsetf(ios::right); + } + } + } + else + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CONE"; + theStream.setf(ios::right); + theStream << setw(15) << myApex.X() << " " + << setw(15) << myApex.Y() << " " + << setw(15) << myApex.Z() << "\n\t\t" + << setw(20) << C.SemiAngle()*(180./M_PI) << "\n\t\t" + << setw(20) << theDir.X() << " " + << setw(15) << theDir.Y() << " " + << setw(15) << theDir.Z() << endl; + theStream.unsetf(ios::right); + } + else + { + theStream << "c McCad: Warning a conical surface may be written as a generic quadric!!" << endl; + + C.Coefficients (A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + + theStream << setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "GQ " + << setw(8+myOutputPrecision) << A1 << " " + << setw(8+myOutputPrecision) << A2 << " " + << setw(8+myOutputPrecision) << A3 << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << 2*B1 << " " + << setw(8+myOutputPrecision) << 2*B2 << " " + << setw(8+myOutputPrecision) << 2*B3 << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << 2*C1 << " " + << setw(8+myOutputPrecision) << 2*C2 << " " + << setw(8+myOutputPrecision) << 2*C3 << " " << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << D << endl ; + theStream.unsetf(ios::right); + } + } +} + + +Standard_Real McCadCSGGeom_Cone::Evaluate(const gp_Pnt& thePoint) const +{ + gp_Cone C(myAxis,mySemiAngle,myRadius); + return McCadGTOOL::Evaluate(C,thePoint); +} + +gp_Pnt McCadCSGGeom_Cone::Value(const Standard_Real U,const Standard_Real V) const +{ + gp_Cone C(myAxis,mySemiAngle,myRadius); + return ElSLib::Value(U,V,C); +} + + +void McCadCSGGeom_Cone::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + if (theSurf.GetType() != GeomAbs_Cone) {cout << "Surface Type incorrect !!" << endl ; return;} + gp_Cone C = theSurf.Cone(); + myAxis = C.Position(); + + myApex = C.Apex(); + //cout << "SETCASSURFACE:POSITION :: " << myAxis.Location().X() << " < " << myAxis.Location().Z() << endl; + //cout << "THE APEX : " << C.Apex().X() << " " << C.Apex().Y() << " " << C.Apex().Z() << endl; + + mySemiAngle = C.SemiAngle(); + myRadius = C.RefRadius(); + SetAxis(myAxis); +} + +Handle(Geom_Surface) McCadCSGGeom_Cone::CasSurf() const +{ + gp_Cone C(myAxis,mySemiAngle,myRadius); + Handle(Geom_ConicalSurface) Gcone = new Geom_ConicalSurface(C); + return Gcone; +} + +Standard_Boolean McCadCSGGeom_Cone::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + + if(another->GetType() != myType) + return Standard_False; + + Handle(Geom_ConicalSurface) Gcone; + + try + { + Gcone = Handle_Geom_ConicalSurface::DownCast(another->CasSurf()); + } + catch(...) + { + return Standard_False; + } + gp_Cone C = Gcone->Cone(); + + Standard_Real aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD; + Standard_Real bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD; + + Coefficients (aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD); + +// cout << "CONE1 : " << aA1 << " " << aA2 << " " << aA3<< " " << aB1<< " " << aB2<< " " << aB3<< " " << aC1<< " " << aC2<< " " << aC3<< " " << aD << endl; + + C.Coefficients (bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD); + +// cout << "CONE2 : " << bA1<< " " << bA2<< " " << bA3<< " " << bB1<< " " << bB2<< " " << bB3<< " " << bC1<< " " << bC2<< " " << bC3<< " " << bD << endl; + + + if ( fabs(aA1 - bA1 )<= 1.e-04 && + fabs(aA2 - bA2 )<= 1.e-04 && + fabs(aA3 - bA3 )<= 1.e-04 && + fabs(aB1 - bB1 )<= 1.e-04 && + fabs(aB2 - bB2 )<= 1.e-04 && + fabs(aB3 - bB3 )<= 1.e-04 && + fabs(aC1 - bC1 )<= 1.e-04 && + fabs(aC2 - bC2 )<= 1.e-04 && + fabs(aC3 - bC3 )<= 1.e-04 && + fabs(aD - bD )<= 1.e-04 ) + { + return Standard_True; + } + else return Standard_False; +} + +Standard_Boolean McCadCSGGeom_Cone::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + + return IsEqual(another); + + if(another->GetType() != myType) return Standard_False; + + Handle(Geom_ConicalSurface) Gcone = Handle_Geom_ConicalSurface::DownCast(another->CasSurf()); + gp_Cone C = Gcone->Cone(); + + Standard_Real aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD; + Standard_Real bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD; + + Coefficients (aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD); + C.Coefficients (bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD); + + if ( fabs(aA1 - bA1 )<= 1.e-04 && + fabs(aA2 - bA2 )<= 1.e-04 && + fabs(aA3 - bA3 )<= 1.e-04 && + fabs(aB1 - bB1 )<= 1.e-04 && + fabs(aB2 - bB2 )<= 1.e-04 && + fabs(aB3 - bB3 )<= 1.e-04 && + fabs(aC1 - bC1 )<= 1.e-04 && + fabs(aC2 - bC2 )<= 1.e-04 && + fabs(aC3 - bC3 )<= 1.e-04 && + fabs(aD - bD )<= 1.e-04 ) + { + return Standard_True; + } + else return Standard_False; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cylinder.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cylinder.cxx new file mode 100644 index 0000000..c28cdab --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Cylinder.cxx @@ -0,0 +1,392 @@ +#include +#include +#include +#include + +#include +#include + +McCadCSGGeom_Cylinder::McCadCSGGeom_Cylinder() +{ + gp_Ax3 A3; + SetType(McCadCSGGeom_Cylindrical); + SetAxis(A3); + +} + +McCadCSGGeom_Cylinder::McCadCSGGeom_Cylinder(const gp_Ax3& A3, + const Standard_Real theRadius) +{ + SetType(McCadCSGGeom_Cylindrical); + SetAxis(A3); + myRadius =theRadius; + +} + +void McCadCSGGeom_Cylinder::SetRadius(const Standard_Real theRadius) +{ + + myRadius = theRadius; + +} + +Standard_Real McCadCSGGeom_Cylinder::GetRadius() const +{ + + return myRadius; + +} + +void McCadCSGGeom_Cylinder::Coefficients(Standard_Real& A1, Standard_Real& A2, + Standard_Real& A3, Standard_Real& B1, Standard_Real& B2, + Standard_Real& B3, Standard_Real& C1, Standard_Real& C2, + Standard_Real& C3, Standard_Real& D) const +{ + gp_Cylinder C(myAxis, myRadius); + + C.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + +} + +void McCadCSGGeom_Cylinder::Print(Standard_OStream& theStream) const +{ + theStream.setf(ios::scientific); + theStream.precision(myOutputPrecision); + gp_Pnt theLocation; + gp_Dir theDir; + Standard_Real A1, A2, A3, B1, B2, B3, C1, C2, C3, D; + gp_Cylinder aCylinder; + gp_Trsf tmpTrsf; + gp_XYZ transl; + + // if the main axis is rotated the Trsf matrix is printed by client; + // here we only print quadric in major axis position with its TRcard Number. + // warning it is up to the client to print the Trsf matrix. + gp_Ax3 theAxis; + + if (haveTrsf) + theAxis = myTransformedAxis; + else + theAxis = GetAxis();//myAxis; + + aCylinder.SetPosition(theAxis); + aCylinder.SetRadius(myRadius); + theDir = theAxis.Direction(); + theLocation = theAxis.Location(); + + Standard_Real locX(theLocation.X()), locY(theLocation.Y()), locZ(theLocation.Z()); + if( Abs(locX) < 1.0e-07 ) + locX = 0.0; + if( Abs(locY) < 1.0e-07 ) + locY = 0.0; + if( Abs(locZ) < 1.0e-07 ) + locZ = 0.0; + + + aCylinder.Scale(gp_Pnt(0,0,0), Scale()); // this is to make mcnp happy with its cms. + Standard_Real aRadius = aCylinder.Radius(); + if(Abs(aRadius) < 1.0e-07) + aRadius = 0.0; + + gp_Ax3 stdAx3Z(theAxis.Location(), gp::DZ()); + gp_Ax3 stdAx3X(theAxis.Location(), gp::DX()); + gp_Ax3 stdAx3Y(theAxis.Location(), gp::DY()); + + if(GetMCType()==McCadCSGGeom_TRIPOLI) // we don't need transformation cards + { + theStream << setw(8) <<" SURF " << setw(5) << myNumber << " "; + gp_Ax3 stdAxis; + theAxis = GetAxis(); + theDir = theAxis.Direction(); + tmpTrsf.SetTransformation(theAxis, stdAxis); + transl = tmpTrsf.TranslationPart(); + gp_Pnt xyzPnt(transl); + stdAx3Z.SetLocation(xyzPnt); + stdAx3Y.SetLocation(xyzPnt); + stdAx3X.SetLocation(xyzPnt); + } + + if (theAxis.IsCoplanar(stdAx3X, 0.001, 0.001)) + { + if(GetMCType()==McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CYLX"; + theStream.setf(ios::right); + theStream << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << " " + << setw(15) << aRadius << endl; + theStream.unsetf(ios::right); + } + else // DEFAULT: MCNP + { + if (fabs(locY) <= 1.e-07 && fabs(locZ) <= 1.e-07) + { + theStream<< setw(5) << myNumber << " "; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "CX " << setw(8+myOutputPrecision) + << aRadius << endl; + theStream.unsetf(ios::right); + } + else + { + theStream<< setw(5) << myNumber << " "; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "C/X " + << setw(8+myOutputPrecision) << locY << " " + << setw(8+myOutputPrecision) << locZ << " " + << setw(8+myOutputPrecision) << aRadius << endl; + theStream.unsetf(ios::right); + } + } + } + else if (theAxis.IsCoplanar(stdAx3Y, 0.001, 0.001)) + { + if(GetMCType()==McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CYLY"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Z() << " " + << setw(15) << aRadius << endl; + theStream.unsetf(ios::right); + // theStream << setw(10) << "CYLY" << transl.X() << " " << transl.Z() << " " << aCylinder.Radius() << endl; + } + else // DEFAULT: MCNP + { + if (fabs(locX)<= 1.e-07 && fabs(locZ) <= 1.e-07) + { + theStream << setw(5) << myNumber << " "; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "CY " << setw(8+myOutputPrecision) << aRadius << endl; + theStream.unsetf(ios::right); + } + else + { + + theStream<< setw(5) << myNumber << " "; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "C/Y " + << setw(8+myOutputPrecision) << locX << " " + << setw(8+myOutputPrecision) << locZ << " " + << setw(8+myOutputPrecision) << aRadius << endl; + theStream.unsetf(ios::right); + } + } + } + else if (theAxis.IsCoplanar(stdAx3Z, 0.001, 0.001)) + { + + //cout << "_#_McCadCSGGeom_Cylinder:: theAxis = " << theAxis.Location().X() << " " << theAxis.Location().Y() << " " << theAxis.Location().Z() << endl; + + if(GetMCType()==McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CYLZ"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << aRadius << endl; + theStream.unsetf(ios::right); + //theStream << setw(10) << "CYLZ" << transl.X() << " " << transl.Y() << " " << aCylinder.Radius() << endl; + } + else // DEFAULT: MCNP + { + if (fabs(locX) <= 1.e-07 && fabs(locY) <= 1.e-07 ) + { + //cout << "haveTrsf = " << haveTrsf << endl; + theStream<< setw(5) << myNumber << " "; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "CZ " << setw(8+myOutputPrecision) << aRadius << endl; + theStream.unsetf(ios::right); + } + else + { + theStream<< setw(5) << myNumber << " "; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(4) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "C/Z " + << setw(8+myOutputPrecision) << locX << " " + << setw(8+myOutputPrecision) << locY << " " + << setw(8+myOutputPrecision) << aRadius << endl; + theStream.unsetf(ios::right); + } + } + } + else + { + if(GetMCType()==McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "CYL"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << aRadius << "\n\t\t" + << setw(20) << theDir.X() << " " + << setw(15) << theDir.Y() << " " + << setw(15) << theDir.Z() << endl; + theStream.unsetf(ios::right); + //theStream << setw(10) << "CYL" << transl.X() << " " << transl.Y() << " " << transl.Z() << " " << aCylinder.Radius() << "\n\t\t" + // << theDir.X() << " " << theDir.Y() << " " << theDir.Z() << endl; + } + else // DEFAULT: MCNP + { + theStream << "c McCad: cylindrical surface written as quadric!!" << endl; + aCylinder.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + theStream << setw(5)<< myNumber << " "; + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + + theStream << "GQ " + << setw(8+myOutputPrecision) << A1 << " " + << setw(8+myOutputPrecision) << A2 << " " + << setw(8+myOutputPrecision) << A3 << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << 2*B1 << " " + << setw(8+myOutputPrecision) << 2*B3 << " " + << setw(8+myOutputPrecision) << 2*B2 << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << 2*C1 << " " + << setw(8+myOutputPrecision) << 2*C2 << " " + << setw(8+myOutputPrecision) << 2*C3 << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << D << endl; + } + } + +} + +Standard_Real McCadCSGGeom_Cylinder::Evaluate(const gp_Pnt& thePoint) const +{ + + gp_Cylinder C(myAxis, myRadius); + return McCadGTOOL::Evaluate(C, thePoint); + +} + +gp_Pnt McCadCSGGeom_Cylinder::Value(const Standard_Real U, const Standard_Real V) const +{ + gp_Cylinder C(myAxis, myRadius); + return ElSLib::Value(U, V, C); +} + +void McCadCSGGeom_Cylinder::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + if (theSurf.GetType() != GeomAbs_Cylinder) + { + cout << "Surface Type incorrect !!" << endl; + return; + } + gp_Cylinder C = theSurf.Cylinder(); + gp_Ax3 theAxis = C.Position(); + + //cout << "McCadCSGGeom_Cylinder:: theAxis = " << theAxis.Location().X() << " " << theAxis.Location().Y() << " " << theAxis.Location().Z() << endl; + + myRadius = C.Radius(); + SetAxis(theAxis); +} + +Handle(Geom_Surface) McCadCSGGeom_Cylinder::CasSurf() const +{ + gp_Cylinder C(myAxis,myRadius); + Handle(Geom_CylindricalSurface) surf = new Geom_CylindricalSurface(C); + return surf; +} + +Standard_Boolean McCadCSGGeom_Cylinder::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + + if(another->GetType() != myType) + return Standard_False; + + Handle(Geom_CylindricalSurface) Gcyl = Handle_Geom_CylindricalSurface::DownCast(another->CasSurf()); + gp_Cylinder other = Gcyl->Cylinder(); + + Standard_Real aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD; + Standard_Real bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD; + + Coefficients(aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD); + other.Coefficients (bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD); + /*cout << "\n **** " << aA1 << " " << aA2 << " " << aA3 << " " << + aB1 << " " << aB2 << " " << aB3 << " " << + aC1 << " " << aC2 << " " << aC3 << " " << aD << endl; + cout << " **** " << bA1 << " " << bA2 << " " << bA3 << " " << + bB1 << " " << bB2 << " " << bB3 << " " << + bC1 << " " << bC2 << " " << bC3 << " " << bD << endl;*/ + + if ( fabs(aA1 - bA1 )<= 1.e-04 && + fabs(aA2 - bA2 )<= 1.e-04 && + fabs(aA3 - bA3 )<= 1.e-04 && + fabs(aB1 - bB1 )<= 1.e-04 && + fabs(aB2 - bB2 )<= 1.e-04 && + fabs(aB3 - bB3 )<= 1.e-04 && + fabs(aC1 - bC1 )<= 1.e-04 && + fabs(aC2 - bC2 )<= 1.e-04 && + fabs(aC3 - bC3 )<= 1.e-04 && + fabs(aD - bD )<= 1.e-04 ) + { + return Standard_True; + } + return Standard_False; +} + +Standard_Boolean McCadCSGGeom_Cylinder::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + return IsEqual(another); + + if(another->GetType() != myType) return Standard_False; + + Handle(Geom_CylindricalSurface) Gcyl = Handle_Geom_CylindricalSurface::DownCast(another->CasSurf()); + gp_Cylinder other = Gcyl->Cylinder(); + + Standard_Real aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD; + Standard_Real bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD; + + Coefficients(aA1, aA2, aA3, aB1, aB2, aB3, aC1, aC2, aC3, aD); + other.Coefficients(bA1, bA2, bA3, bB1, bB2, bB3, bC1, bC2, bC3, bD); + + if ( fabs(aA1 - bA1 )<= 1.e-04 && + fabs(aA2 - bA2 )<= 1.e-04 && + fabs(aA3 - bA3 )<= 1.e-04 && + fabs(aB1 - bB1 )<= 1.e-04 && + fabs(aB2 - bB2 )<= 1.e-04 && + fabs(aB3 - bB3 )<= 1.e-04 && + fabs(aC1 - bC1 )<= 1.e-04 && + fabs(aC2 - bC2 )<= 1.e-04 && + fabs(aC3 - bC3 )<= 1.e-04 && + fabs(aD - bD )<= 1.e-04 ) + { + return Standard_True; + } + return Standard_False; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_0.cxx new file mode 100644 index 0000000..69ca4e7 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerCell +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_0.cxx new file mode 100644 index 0000000..a4c03ac --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Surface +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerSurface +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_0.cxx new file mode 100644 index 0000000..20effb0 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerTransformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Transformation +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerTransformation +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_0.cxx new file mode 100644 index 0000000..752146b --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile +#include +#endif +//McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell::~McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell", + sizeof(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell) Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell))) { + _anOtherObject = Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)((Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell) ; +} +//Standard_Boolean McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell::~Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerCell +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_0.cxx new file mode 100644 index 0000000..58d39f2 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_HeaderFile +#include +#endif +//McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface::~McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface", + sizeof(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface) Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface))) { + _anOtherObject = Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)((Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface) ; +} +//Standard_Boolean McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface::~Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Surface +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerSurface +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_0.cxx new file mode 100644 index 0000000..4fe8eee --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerTransformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif +//McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation::~McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation", + sizeof(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation) Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation))) { + _anOtherObject = Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)((Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation) ; +} +//Standard_Boolean McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation::~Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Transformation +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerTransformation +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerCell_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerCell_0.cxx new file mode 100644 index 0000000..9ca21fa --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerCell_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerCell +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerSurface_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerSurface_0.cxx new file mode 100644 index 0000000..ddbaa6c --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerSurface_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Surface +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerSurface +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerTransformation_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerTransformation_0.cxx new file mode 100644 index 0000000..749423b --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_DataMapOfIntegerTransformation_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Transformation +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerTransformation +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_GQ.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_GQ.cxx new file mode 100644 index 0000000..6e5d86b --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_GQ.cxx @@ -0,0 +1,341 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadCSGGeom_GQ::McCadCSGGeom_GQ() +{ + //empty ctor + MakeSurface(); // dummy surface + SetType(McCadCSGGeom_Quadric); +} + +McCadCSGGeom_GQ::McCadCSGGeom_GQ(const Standard_Real A,const Standard_Real B,const Standard_Real C,const Standard_Real D,const Standard_Real E,const Standard_Real F,const Standard_Real G,const Standard_Real H,const Standard_Real I,const Standard_Real J) +{ + myA = A; + myB = B; + myC = C; + myD = D; + myE = E; + myF = F; + myG = G; + myH = H; + myI = I; + myJ = J; + SetType(McCadCSGGeom_Quadric); + + MakeSurface(); //dummy surface +} + +void McCadCSGGeom_GQ::Coefficients(Standard_Real& A,Standard_Real& B,Standard_Real& C,Standard_Real& D,Standard_Real& E,Standard_Real& F,Standard_Real& G,Standard_Real& H,Standard_Real& I,Standard_Real& J) const +{ + A = myA; + B = myB; + C = myC; + D = myD; + E = myE; + F = myF; + G = myG; + H = myH; + I = myI; + J = myJ; +} + +void McCadCSGGeom_GQ::Print(Standard_OStream& theStream) const +{ + Standard_Real s=Scale();//0.1; //This is to make mcnp happy with its cm + Standard_Real t=s*s; + + //No transformation cards needed + theStream << setw(5) << myNumber << " "; + theStream << "GQ " << setw(10) << myA/t << " " << myB/t << " " << myC/t << " " << myD/t << " " << myE/t << endl; + theStream << " " << setw(10) << myF/t << " " << myG/s << " " << myH/s << " " << myI/s << " " << myJ << endl; +} + +Standard_Real McCadCSGGeom_GQ::Evaluate(const gp_Pnt& thePoint) const +{ + Standard_Real x = thePoint.X(); + Standard_Real y = thePoint.Y(); + Standard_Real z = thePoint.Z(); + + return (myA*x*x + myB*y*y + myC*z*z + myD*x*y + myE*y*z + myF*z*x + myG*x + myH*y + myI*z + myJ); +} + +gp_Pnt McCadCSGGeom_GQ::Value(const Standard_Real U,const Standard_Real V) const +{ + return mySurface->Value(U, V); +} + +void McCadCSGGeom_GQ::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + mySurface = theSurf.Surface(); +} + +Handle(Geom_Surface) McCadCSGGeom_GQ::CasSurf() const +{ + return mySurface; +} + +Standard_Boolean McCadCSGGeom_GQ::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{//TODO + /* + * This function is not yet implemented. If the same surface occurce multiple times, we will not know!!! But MCNP will + * sort them out so it's not that bad right now! + * */ + + if(another->GetType()!=myType) + return Standard_False; + + return Standard_False; +} + + +Standard_Boolean McCadCSGGeom_GQ::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{//TODO + return IsEqual(another); +} + + +Standard_Integer McCadCSGGeom_GQ::ComputeMatrixRank(gp_Mat m) +{ + Standard_Integer i(1), j(1), s(1), p(0), rank(3); + Standard_Real f(0.0), max(0.0); + Standard_Boolean done(Standard_True); + + + do + { + /*cout << "m[ {" << m(1,1) << ", " << m(1,2) << ", " << m(1,3) << " } \n {" << + m(2,1) << ", " << m(2,2) << ", " << m(2,3) << " } \n {" << + m(3,1) << ", " << m(3,2) << ", " << m(3,3) << " } ]" << endl;*/ + + max = Abs(m(s,s)); + p = s; + + for (i = s+1; i <= 3; i++) + { + if( Abs(m(i,s)) > max) + { + max = Abs(m(i,s)) ; + p = i; + } + } + + if (max < 1e-5) + { + done = Standard_False; + break; + } + + if (p != s) // pivoting + { + Standard_Real h; + for (j = s ; j <= 3; j++) + { + h = m(s,j); + m(s,j) = m(p,j); + m(p,j) = h; + } + } + + // gauss elimination + for (i = s+1; i <= 3; i++ ) + { + f = -(m(i,s)/m(s,s)); + m(i,s) = 0.0; + for (j = s+1; j <= 3 ; j++) + m(i,j) += f*m(s,j); + } + s++; + } while ( s <= 3 ) ; + + if(Abs(m(3,3)) < 1e-5) + rank = 2; + if(Abs(m(2,2)) < 1e-5) + rank = 1; + if(!done) + rank = s-1; + + return rank; +} + + +void McCadCSGGeom_GQ::MakeSurface() +{ // make cassurface in the given boundary + //gather points + + mySurface = NULL; + + /*gp_Mat mat(myA , myD/2., myF/2., + myD/2., myB , myE/2., + myF/2., myE/2., myC ); + + Standard_Integer rank = ComputeMatrixRank(mat); + + if(rank == 0) // plane + { + Standard_Real A(myG),B(myH),C(myI),D(myJ); + + gp_Pln pln(A,B,C,D); + Handle(Geom_Plane) geomPln = new Geom_Plane(pln); + mySurface = geomPln; + } + else if(rank == 1) // paraboloid, plane, + { + + } + else if(rank == 2) + { + + } + else if(rank == 3) + { + + }*/ + +/* Standard_Integer xRng(0), yRng(0); + + xRng = (double(xMax-xMin)/100. <= 0.1) ? 100 : 1000; + yRng = (double(yMax-yMin)/100. <= 0.1) ? 100 : 1000; + + TColgp_Array2OfPnt pnt2Array(1,xRng,1,yRng); + pnt2Array.Init(gp_Pnt(-999999,-999999,-999999)); + + Standard_Real dX = double(xMax-xMin)/double(xRng); + Standard_Real dY = double(yMax-yMin)/double(xRng); + Standard_Real x(xMin-dX),y,z; + Standard_Integer xCnt(0), yCnt(0), xHit(0), yHit(0), pntCnt(0); + gp_Pnt tstPnt; + Standard_Boolean firstHit = Standard_True; + + for(int i=1; i<=xRng; i++) + { + x += dX; + y = yMin-dY; + for(int j=1; j<=yRng; j++) + { + y+=dY; + + Standard_Real Q = 0.5 * (myE*y + myF*x + myI) / myC; + Standard_Real T = (myA*x*x + myB*y*y + myD*x*y + myG*x + myH*y + myJ) / myC; + + if((Q*Q - T) > 0) + { + if(firstHit) + { + xHit = i; + firstHit = Standard_False; + } + xCnt = (i > xCnt) ? i : xCnt; + yCnt = (j > yCnt) ? j : yCnt; + pntCnt++; + + z = -Q + Sqrt(Q*Q - T); + tstPnt = gp_Pnt(x,y,z); + if(Abs(Evaluate(tstPnt))<1e-7) + pnt2Array.SetValue(i,j,tstPnt); + else + { + z = Q - Sqrt(Q*Q - T); + tstPnt.SetZ(z); + if(Abs(Evaluate(tstPnt))<1e-7) + pnt2Array.SetValue(i,j,tstPnt); + else + pntCnt--; + } + pnt2Array.SetValue(i,j,tstPnt); + //cout << "(i , j) = (" << i << " , " << j << ")\t\t(x, y, z) = (" << tstPnt.X() << ", " << tstPnt.Y() << ", " << tstPnt.Z() << ") \n"; + } + } + } + + //cout << "\n\n==========================================================================\n\n"; + + tstPnt = gp_Pnt(-999999,-999999,-999999); + Standard_Integer curY(0), maxY(0), minY(999999), curX(0), minX(0), maxX(0); + + for(int i=xHit; i<=xCnt; i++) + { + curY=0; + firstHit = Standard_True; + for(int j=1; j<= yRng; j++) + { + if(!pnt2Array(i,j).IsEqual(tstPnt,1e-7)) + { + if(firstHit) + { + minY = ( j < minY ) ? j : minY; + firstHit = Standard_False; + } + curY++; + if(j=yRng) + maxY = j; + //cout << "(i,j) = " << i << " " << j << endl; + } + else + { + if(curY>0) + { + maxY = j; + j = yRng; + continue; + } + } + } + //cout << "YVals for x: " << i << "\t\t" << minY << " " << maxY << endl; + } + + //cout << "minY, maxY : " << minY << " , " << maxY << endl; + + firstHit = Standard_True; + + for(int i=xHit; i<=xCnt; i++) + { + if(firstHit) + { + if(!pnt2Array(i,minY).IsEqual(tstPnt,1e-7) && !pnt2Array(i,maxY).IsEqual(tstPnt,1e-7)) + { + firstHit = Standard_False; + minX = (i>minX) ? i : minX; + } + } + else + { + if(pnt2Array(i,minY).IsEqual(tstPnt,1e-7) || pnt2Array(i,maxY).IsEqual(tstPnt,1e-7)) + { + maxX = (i + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceOfCell_HeaderFile +#include +#endif +//McCadCSGGeom_HSequenceOfCell::~McCadCSGGeom_HSequenceOfCell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_HSequenceOfCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_HSequenceOfCell", + sizeof(McCadCSGGeom_HSequenceOfCell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_HSequenceOfCell) Handle(McCadCSGGeom_HSequenceOfCell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_HSequenceOfCell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_HSequenceOfCell))) { + _anOtherObject = Handle(McCadCSGGeom_HSequenceOfCell)((Handle(McCadCSGGeom_HSequenceOfCell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_HSequenceOfCell::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_HSequenceOfCell) ; +} +//Standard_Boolean McCadCSGGeom_HSequenceOfCell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_HSequenceOfCell) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCSGGeom_HSequenceOfCell::~Handle_McCadCSGGeom_HSequenceOfCell() {} +#define Item Handle_McCadCSGGeom_Cell +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfCell_Type_() +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_HSequenceOfSurface_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_HSequenceOfSurface_0.cxx new file mode 100644 index 0000000..c1921e1 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_HSequenceOfSurface_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceOfSurface_HeaderFile +#include +#endif +//McCadCSGGeom_HSequenceOfSurface::~McCadCSGGeom_HSequenceOfSurface() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_HSequenceOfSurface_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_HSequenceOfSurface", + sizeof(McCadCSGGeom_HSequenceOfSurface), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_HSequenceOfSurface) Handle(McCadCSGGeom_HSequenceOfSurface)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_HSequenceOfSurface) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_HSequenceOfSurface))) { + _anOtherObject = Handle(McCadCSGGeom_HSequenceOfSurface)((Handle(McCadCSGGeom_HSequenceOfSurface)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_HSequenceOfSurface::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_HSequenceOfSurface) ; +} +//Standard_Boolean McCadCSGGeom_HSequenceOfSurface::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_HSequenceOfSurface) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCSGGeom_HSequenceOfSurface::~Handle_McCadCSGGeom_HSequenceOfSurface() {} +#define Item Handle_McCadCSGGeom_Surface +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfSurface +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfSurface +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfSurface +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfSurface_Type_() +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_HSequenceOfTransformation_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_HSequenceOfTransformation_0.cxx new file mode 100644 index 0000000..32f7dd2 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_HSequenceOfTransformation_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceOfTransformation_HeaderFile +#include +#endif +//McCadCSGGeom_HSequenceOfTransformation::~McCadCSGGeom_HSequenceOfTransformation() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_HSequenceOfTransformation_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_HSequenceOfTransformation", + sizeof(McCadCSGGeom_HSequenceOfTransformation), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_HSequenceOfTransformation) Handle(McCadCSGGeom_HSequenceOfTransformation)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_HSequenceOfTransformation) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_HSequenceOfTransformation))) { + _anOtherObject = Handle(McCadCSGGeom_HSequenceOfTransformation)((Handle(McCadCSGGeom_HSequenceOfTransformation)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_HSequenceOfTransformation::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_HSequenceOfTransformation) ; +} +//Standard_Boolean McCadCSGGeom_HSequenceOfTransformation::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_HSequenceOfTransformation) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCSGGeom_HSequenceOfTransformation::~Handle_McCadCSGGeom_HSequenceOfTransformation() {} +#define Item Handle_McCadCSGGeom_Transformation +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfTransformation +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfTransformation +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfTransformation +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfTransformation_Type_() +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Plane.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Plane.cxx new file mode 100644 index 0000000..48dc9b3 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Plane.cxx @@ -0,0 +1,353 @@ +#include +#include +#include +#include + +#include +#include +McCadCSGGeom_Plane::McCadCSGGeom_Plane() +{ + gp_Ax3 axis; + SetType(McCadCSGGeom_Planar); + SetAxis(axis); +} + +McCadCSGGeom_Plane::McCadCSGGeom_Plane(const Standard_Real A, + const Standard_Real B, const Standard_Real C, const Standard_Real D) +{ + gp_Pln aPln(A, B, C, D); + SetType(McCadCSGGeom_Planar); + SetAxis(aPln.Position()); +} + +void McCadCSGGeom_Plane::Coefficients(Standard_Real& A, Standard_Real& B, + Standard_Real& C, Standard_Real& D) const +{ + gp_Pln aPln(myAxis); + aPln.Coefficients(A, B, C, D); +} + +void McCadCSGGeom_Plane::Print(Standard_OStream& theStream) const +{ + theStream.setf(ios::scientific); + theStream.precision(myOutputPrecision); + Standard_Real A, B, C, D; + gp_Pln aPln; + // if the main axis is rotated the Trsf matrix is printed by client; + // here we only print qaudric in major axis position with its TRcard Number. + // warning it is up to the clien to print the Trsf matrix. + + if (haveTrsf) + { + aPln.SetPosition(myTransformedAxis); + } + else + { + aPln.SetPosition(GetAxis()); + } + + aPln.Coefficients(A, B, C, D); + if(Abs(A) < 1.0e-07) + A = 0.0; + if(Abs(B) < 1.0e-07) + B = 0.0; + if(Abs(C) < 1.0e-07) + C = 0.0; + if(Abs(D) < 1.0e-07) + D = 0.0; + + //aPln.Scale(gp_Pnt(0,0,0), Scale()); // this is to make mcnp happy with its cms. + + + // note that mcnp uses the plane eq. as follows AX+BY+CZ-D = 0 + // Cascade uses AX+BY+CZ+D. Therefore D must be corrected accordingly. + // only globaly right handed oriented PX, PY and PZ are written; + // others are written as generic P; + + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(8) << " SURF " << setw(5) << myNumber << " "; + + if ( A > 1.e-7 && fabs(B) < 1.e-7 && fabs(C) < 1.e-7 ) + { + theStream << setw(7) << "PLANEX"; + theStream.setf(ios::right); + theStream << setw(15) << -D << endl; + theStream.unsetf(ios::right); + } + else if (B > 1.e-7 && fabs(A) < 1.e-7 && fabs(C) < 1.e-7) + { + theStream << setw(7) << "PLANEY"; + theStream.setf(ios::right); + theStream << setw(15) << -D << endl; + theStream.unsetf(ios::right); + } + else if ( C > 1.e-7 && fabs(A) < 1.e-7 && fabs(B) < 1.e-7) + { + theStream << setw(7) << "PLANEZ"; + theStream.setf(ios::right); + theStream << setw(15) << -D << endl; + theStream.unsetf(ios::right); + } + else + { + if (fabs(A) < 1.e-9) + A = 0.0 ; + if (fabs(B) < 1.e-9) + B = 0.0; + if (fabs(C) < 1.e-9 ) + C = 0.0; + + theStream << setw(7) << "PLANE"; + theStream.setf(ios::right); + theStream << setw(15) << A << " " + << setw(15) << B << " " + << setw(15) << C << "\n\t\t" + << setw(20) << D << endl; + theStream.unsetf(ios::right); + } + } + else // MCNP is default + { + if ( A > 1.e-7 && fabs(B) < 1.e-7 && fabs(C) < 1.e-7 ) + { + theStream << setw(5) << myNumber << " " ; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "PX "<< setw(8+myOutputPrecision) << -D << endl; + theStream.unsetf(ios::right); + } + else if (B > 1.e-7 && fabs(A) < 1.e-7 && fabs(C) < 1.e-7) + { + theStream<< setw(5) << myNumber << " " ; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "PY "<< setw(8+myOutputPrecision) << -D << endl; + theStream.unsetf(ios::right); + } + else if ( C > 1.e-7 && fabs(A) < 1.e-7 && fabs(B) < 1.e-7) + { + theStream << setw(5) << myNumber << " " ; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " " ; + else + theStream << setw(4) << " "; + theStream << setw(4) << "PZ " << setw(8+myOutputPrecision) << -D << endl; + theStream.unsetf(ios::right); + } + else + { + theStream<< setw(5) << myNumber << " " ; + + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "P " + << setw(8+myOutputPrecision) << A << " " + << setw(8+myOutputPrecision) << B << " " + << setw(8+myOutputPrecision) << C << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << -D << endl; + theStream.unsetf(ios::right); + } + } +} + + +Standard_Real McCadCSGGeom_Plane::Evaluate(const gp_Pnt& thePoint) const +{ + gp_Pln aPln(myAxis); + return McCadGTOOL::Evaluate(aPln, thePoint); +} + + +gp_Pnt McCadCSGGeom_Plane::Value(const Standard_Real U, const Standard_Real V) const +{ + gp_Pln aPln(myAxis); + return ElSLib::Value(U, V, aPln); +} + + +void McCadCSGGeom_Plane::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + if (theSurf.GetType() != GeomAbs_Plane) + { + cout << "_#_McCadCSGGeom_Plane.cxx :: Surface Type incorrect !!" << endl; + return; + } + gp_Pln aPln = theSurf.Plane(); + gp_Ax3 ax3 = aPln.Position(); + SetAxis(ax3); +} + + +Handle(Geom_Surface) McCadCSGGeom_Plane::CasSurf() const +{ + gp_Pln aPln(myAxis); + Handle(Geom_Plane) surf = new Geom_Plane(aPln); + return surf; +} + + +Standard_Boolean McCadCSGGeom_Plane::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + if(another->GetType() != myType) + return Standard_False; + + gp_Pln aPln(myAxis); + gp_Ax3 pos = aPln.Position(); +// gp_Dir dir = pos.Direction(); +// gp_Pnt loc = pos.Location (); + + Standard_Real sA,sB,sC,sD, oA, oB, oC, oD; + aPln.Coefficients(sA,sB,sC,sD); +// Standard_Real D1 = dir.X()* loc.X() + dir.Y()* loc.Y() + dir.Z()*loc.Z(); + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(another->CasSurf()); + gp_Pln other = Gpln->Pln(); + other.Coefficients(oA,oB,oC,oD); + + if(Abs(oA)<1e-7) + oA = 0.0; + if(Abs(oB)<1e-7) + oB = 0.0; + if(Abs(oC)<1e-7) + oC = 0.0; + if(Abs(oD)<1e-7) + oD = 0.0; + if(Abs(sA)<1e-7) + sA = 0.0; + if(Abs(sB)<1e-7) + sB = 0.0; + if(Abs(sC)<1e-7) + sC = 0.0; + if(Abs(sD)<1e-7) + sD = 0.0; + + /*cout << "\n" << oA << " " << oB << " " << oC << " " << oD; + cout << "\n" << sA << " " << sB << " " << sC << " " << sD;*/ + + if(Abs(Abs(oA) - Abs(sA)) > 1e-5 || + Abs(Abs(oB) - Abs(sB)) > 1e-5 || + Abs(Abs(oC) - Abs(sC)) > 1e-5 || + Abs(Abs(oD) - Abs(sD)) > 1e-5 ) + return Standard_False; + + /*cout << "\n" << Abs(oA-sA) << " " << Abs(oB-sB) << " " << Abs(oC-sC) << " " << Abs(oD-sD) << endl;*/ + + if( Abs(oA-sA) < 1.e-5 && + Abs(oB-sB) < 1.e-5 && + Abs(oC-sC) < 1.e-5 && + Abs(oD-sD) < 1.e-5 ) + return Standard_True; + + /*cout << "\n" << oA << " " << oB << " " << oC << " " << oD; + cout << "\n" << sA << " " << sB << " " << sC << " " << sD;*/ + + /*gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + gp_Pnt otherLoc = otherPos.Location(); + Standard_Real D2 = otherDir.X()* otherLoc.X() + otherDir.Y()* otherLoc.Y() + otherDir.Z()* otherLoc.Z(); + + if( (dir.IsEqual(otherDir, 1.0e-03) && fabs(D1 - D2) < 1.0e-03) ) + { + return Standard_True; + }*/ + + return Standard_False; +} + + +Standard_Boolean McCadCSGGeom_Plane::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + if(another->GetType() != myType) + return Standard_False; + + gp_Pln aPln(myAxis); + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + gp_Pnt loc = pos.Location (); + + Standard_Real sA,sB,sC,sD, oA, oB, oC, oD; + aPln.Coefficients(sA,sB,sC,sD); + Standard_Real D1 = dir.X()* loc.X() + dir.Y()* loc.Y() + dir.Z()*loc.Z(); + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(another->CasSurf()); + gp_Pln other = Gpln->Pln(); + other.Coefficients(oA,oB,oC,oD); + + if(Abs(oA)<1e-7) + oA = 0.0; + if(Abs(oB)<1e-7) + oB = 0.0; + if(Abs(oC)<1e-7) + oC = 0.0; + if(Abs(oD)<1e-7) + oD = 0.0; + if(Abs(sA)<1e-7) + sA = 0.0; + if(Abs(sB)<1e-7) + sB = 0.0; + if(Abs(sC)<1e-7) + sC = 0.0; + if(Abs(sD)<1e-7) + sD = 0.0; + + if(Abs(Abs(oA) - Abs(sA)) > 1e-5 || + Abs(Abs(oB) - Abs(sB)) > 1e-5 || + Abs(Abs(oC) - Abs(sC)) > 1e-5 || + Abs(Abs(oD) - Abs(sD)) > 1e-5 ) + return Standard_False; + + if( ( Abs(oA-sA) < 1.e-5 && Abs(oB-sB) < 1.e-5 && Abs(oC-sC) < 1.e-5 && Abs(oD-sD) < 1.e-5 ) || + ( Abs(oA+sA) < 1.e-5 && Abs(oB+sB) < 1.e-5 && Abs(oC+sC) < 1.e-5 && Abs(oD+sD) < 1.e-5 ) ) + { + return Standard_True; + } + + + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + gp_Pnt otherLoc = otherPos.Location(); + Standard_Real D2 = otherDir.X()* otherLoc.X() + otherDir.Y()* otherLoc.Y() + otherDir.Z()* otherLoc.Z(); + + if( (dir.IsEqual(otherDir, 1.0e-03) && fabs(D1 - D2) < 1.0e-03) ) + return Standard_True; + + + return Standard_False; + + /*if(another->GetType() != myType) + return Standard_False; + + gp_Pln aPln(myAxis); + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + gp_Pnt loc = pos.Location (); + Standard_Real D1 = dir.X()* loc.X() + dir.Y()* loc.Y() + dir.Z()*loc.Z(); + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(another->CasSurf()); + gp_Pln other = Gpln->Pln(); + + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + gp_Pnt otherLoc = otherPos.Location(); + Standard_Real D2 = otherDir.X()* otherLoc.X() + otherDir.Y()* otherLoc.Y() + otherDir.Z()* otherLoc.Z(); + + if (dir.IsParallel(otherDir, 1.0e-03) && fabs(D1 - D2) < 1.0e-03) + { + return Standard_True; + } + return Standard_False;*/ +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfCell_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfCell_0.cxx new file mode 100644 index 0000000..c0c4c34 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfCell_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceOfCell_HeaderFile +#include +#endif +//McCadCSGGeom_SequenceNodeOfSequenceOfCell::~McCadCSGGeom_SequenceNodeOfSequenceOfCell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_SequenceNodeOfSequenceOfCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_SequenceNodeOfSequenceOfCell", + sizeof(McCadCSGGeom_SequenceNodeOfSequenceOfCell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell) Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfCell))) { + _anOtherObject = Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)((Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_SequenceNodeOfSequenceOfCell::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfCell) ; +} +//Standard_Boolean McCadCSGGeom_SequenceNodeOfSequenceOfCell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfCell) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell::~Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell() {} +#define SeqItem Handle_McCadCSGGeom_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfCell +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfSurface_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfSurface_0.cxx new file mode 100644 index 0000000..422cdde --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfSurface_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceOfSurface_HeaderFile +#include +#endif +//McCadCSGGeom_SequenceNodeOfSequenceOfSurface::~McCadCSGGeom_SequenceNodeOfSequenceOfSurface() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_SequenceNodeOfSequenceOfSurface_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_SequenceNodeOfSequenceOfSurface", + sizeof(McCadCSGGeom_SequenceNodeOfSequenceOfSurface), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface) Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfSurface))) { + _anOtherObject = Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)((Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_SequenceNodeOfSequenceOfSurface::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfSurface) ; +} +//Standard_Boolean McCadCSGGeom_SequenceNodeOfSequenceOfSurface::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfSurface) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface::~Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface() {} +#define SeqItem Handle_McCadCSGGeom_Surface +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfSurface_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfSurface +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_0.cxx new file mode 100644 index 0000000..f5d8226 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceOfTransformation_HeaderFile +#include +#endif +//McCadCSGGeom_SequenceNodeOfSequenceOfTransformation::~McCadCSGGeom_SequenceNodeOfSequenceOfTransformation() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_SequenceNodeOfSequenceOfTransformation", + sizeof(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation) Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation))) { + _anOtherObject = Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)((Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_SequenceNodeOfSequenceOfTransformation::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation) ; +} +//Standard_Boolean McCadCSGGeom_SequenceNodeOfSequenceOfTransformation::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation::~Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation() {} +#define SeqItem Handle_McCadCSGGeom_Transformation +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfTransformation +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfCell_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfCell_0.cxx new file mode 100644 index 0000000..a671d67 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfCell_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadCSGGeom_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfCell +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfSurface_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfSurface_0.cxx new file mode 100644 index 0000000..fc134b7 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfSurface_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadCSGGeom_Surface +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfSurface_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfSurface +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfTransformation_0.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfTransformation_0.cxx new file mode 100644 index 0000000..d41264c --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SequenceOfTransformation_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadCSGGeom_Transformation +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfTransformation +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Sphere.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Sphere.cxx new file mode 100644 index 0000000..7fe17ca --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Sphere.cxx @@ -0,0 +1,241 @@ +#include +#include +#include +#include + +#include +#include + +McCadCSGGeom_Sphere::McCadCSGGeom_Sphere() +{ + gp_Ax3 A3; + SetType(McCadCSGGeom_Spherical); + SetAxis(A3); + +} + +McCadCSGGeom_Sphere::McCadCSGGeom_Sphere(const Standard_Real theRadius) +{ + gp_Ax3 A3; + SetType(McCadCSGGeom_Spherical); + SetAxis(A3); + myRadius = theRadius; +} + +McCadCSGGeom_Sphere::McCadCSGGeom_Sphere(const gp_Ax3& A3, const Standard_Real theRadius) +{ + SetType(McCadCSGGeom_Spherical); + SetAxis(A3); + myRadius =theRadius; +} + +void McCadCSGGeom_Sphere::SetRadius(const Standard_Real theRadius) +{ + myRadius = theRadius; +} + +Standard_Real McCadCSGGeom_Sphere::GetRadius() const +{ + return myRadius; +} + +void McCadCSGGeom_Sphere::Coefficients(Standard_Real& A1, Standard_Real& A2, + Standard_Real& A3, Standard_Real& B1, Standard_Real& B2, + Standard_Real& B3, Standard_Real& C1, Standard_Real& C2, + Standard_Real& C3, Standard_Real& D) const +{ + gp_Sphere S(myAxis, myRadius); + + S.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); +} + +void McCadCSGGeom_Sphere::Print(Standard_OStream& theStream) const +{ + theStream.setf(ios::scientific); + theStream.precision(myOutputPrecision); + gp_Pnt theLocation; + // gp_Dir theDirect; + // gp_Ax1 MainAx; + // Standard_Real A1, A2, A3, B1, B2, B3, C1, C2, C3, D; + gp_Sphere aSphere; + + // if the main axis is rotated the Trsf matrix is printed by client; + // here we only print qaudric in major axis position with its TRcard Number. + // warning it is up to the clien to print the Trsf matrix. + + if (haveTrsf) + { + aSphere.SetPosition(myTransformedAxis); + aSphere.SetRadius(myRadius); + } + else + { + aSphere.SetPosition(myAxis); + aSphere.SetRadius(myRadius); + } + + aSphere.Scale(gp_Pnt(0,0,0), Scale()); // this is to make mcnp happy with its cms. + + theLocation = aSphere.Location(); + + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(8) << " SURF " << setw(5) << myNumber << " "; + theStream << setw(7) << "SPHERE"; + theStream.setf(ios::right); + theStream << setw(15) << theLocation.X() << " " + << setw(15) << theLocation.Y() << " " + << setw(15) << theLocation.Z() << "\n\t\t" + << setw(20) << aSphere.Radius() << endl; + theStream.unsetf(ios::right); + } + else + { + if (theLocation.X() == 0 && theLocation.Y() == 0 && theLocation.Z() == 0) + { + theStream<< setw(5) << myNumber << " "; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "SO " << setw(8+myOutputPrecision) << aSphere.Radius() << endl; + theStream.unsetf(ios::right); + } + else if (theLocation.X() != 0 && theLocation.Y() == 0 && theLocation.Z() + == 0) + { + theStream<< setw(5) << myNumber << " "; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "SX " + << setw(8+myOutputPrecision) << theLocation.X() << " " + << setw(8+myOutputPrecision) << aSphere.Radius() << endl; + theStream.unsetf(ios::right); + } + else if (theLocation.X() == 0 && theLocation.Y() != 0 && theLocation.Z() + == 0) + { + theStream<< setw(5) << myNumber << " "; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "SY " + << setw(8+myOutputPrecision) << theLocation.Y() << " " + << setw(8+myOutputPrecision) << aSphere.Radius() << endl; + theStream.unsetf(ios::right); + } + else if (theLocation.X() == 0 && theLocation.Y() == 0 && theLocation.Z() + != 0) + { + theStream<< setw(5) << myNumber << " "; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "SZ " + << setw(8+myOutputPrecision) << theLocation.Z() << " " + << setw(8+myOutputPrecision) << aSphere.Radius() << endl; + theStream.unsetf(ios::right); + } + else + { + theStream << setw(5) << myNumber << " "; + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "S " + << setw(8+myOutputPrecision) << theLocation.X() << " " + << setw(8+myOutputPrecision) << theLocation.Y() << " " + << setw(8+myOutputPrecision) << theLocation.Z() << " " << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << aSphere.Radius() << endl; + theStream.unsetf(ios::right); + } + } +} + +Standard_Real McCadCSGGeom_Sphere::Evaluate(const gp_Pnt& thePoint) const +{ + gp_Sphere S(myAxis, myRadius); + return McCadGTOOL::Evaluate(S, thePoint); +} + +gp_Pnt McCadCSGGeom_Sphere::Value(const Standard_Real U, const Standard_Real V) const +{ + gp_Sphere S(myAxis, myRadius); + return ElSLib::Value(U, V, S); +} + +void McCadCSGGeom_Sphere::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + if (theSurf.GetType() != GeomAbs_Sphere) + { + cout << "Surface Type incorrect !!" << endl; + return; + } + gp_Sphere S = theSurf.Sphere(); + myAxis = S.Position(); + myRadius = S.Radius(); + SetAxis(myAxis); +} + +Handle(Geom_Surface) McCadCSGGeom_Sphere::CasSurf() const +{ + gp_Sphere S(myAxis,myRadius); + Handle(Geom_SphericalSurface) surf = new Geom_SphericalSurface(S); + return surf; +} + +Standard_Boolean McCadCSGGeom_Sphere::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + + if(another->GetType() != myType) return Standard_False; + + Handle(Geom_SphericalSurface) Gsph = Handle_Geom_SphericalSurface::DownCast(another->CasSurf()); + gp_Sphere C = Gsph->Sphere(); + gp_Ax3 ax2 = C.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real rad2 = C.Radius(); + Standard_Real Precision = 1.e-05; + + gp_Dir dir1 = myAxis.Direction(); + gp_XYZ loc1 = (myAxis.Location()).XYZ(); + + if((dir1.IsEqual(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) + && (fabs(myRadius -rad2 )<= Precision)) + return Standard_True; + else return Standard_False; +} + +Standard_Boolean McCadCSGGeom_Sphere::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + return IsEqual(another); + + if(another->GetType() != myType) return Standard_False; + + Handle(Geom_SphericalSurface) Gsph = Handle_Geom_SphericalSurface::DownCast(another->CasSurf()); + gp_Sphere C = Gsph->Sphere(); + gp_Ax3 ax2 = C.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real rad2 = C.Radius(); + Standard_Real Precision = 1.e-04; + + gp_Dir dir1 = myAxis.Direction(); + gp_XYZ loc1 = (myAxis.Location()).XYZ(); + + if((dir1.IsParallel(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) + && (fabs(myRadius -rad2 )<= Precision)) + return Standard_True; + else return Standard_False; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Surface.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Surface.cxx new file mode 100644 index 0000000..a52765d --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Surface.cxx @@ -0,0 +1,218 @@ +#include +#include +#include +#include + +McCadCSGGeom_Surface::McCadCSGGeom_Surface() +{ + myNumber =-1; + myType = McCadCSGGeom_OtherSurface; + myMCType = McCadCSGGeom_MCNP; + myTransformedAxis= myAxis; + myTNumber = 0; + haveTrsf = Standard_False; + myUnit = McCadCSGGeom_CM; + myIsMacroBody = Standard_False; + myMacroBodySurfaceHSequence = NULL; +} + +Standard_Boolean McCadCSGGeom_Surface::HaveTransformation() const +{ + return haveTrsf; + +} + +void McCadCSGGeom_Surface::SetTrsfNumber(const Standard_Integer theTNumber) +{ + myTNumber = theTNumber; +} + +Standard_Integer McCadCSGGeom_Surface::GetTrsfNumber() const +{ + + return myTNumber; +} + +void McCadCSGGeom_Surface::SetTrsf(const gp_Trsf& theTrsf) +{ + myTrsf = theTrsf; +} + +gp_Trsf McCadCSGGeom_Surface::GetTrsf() const +{ + + return myTrsf; + +} + +void McCadCSGGeom_Surface::SetLocation(const gp_Pnt& Loc) +{ + + myAxis.SetLocation(Loc); + +} + +gp_Pnt McCadCSGGeom_Surface::GetLocation() const +{ + return myAxis.Location(); +} + +gp_Ax3 McCadCSGGeom_Surface::GetAxis() const +{ + gp_Ax3 scaledAxis = myAxis; + scaledAxis.Scale(gp_Pnt(0,0,0), Scale()); + return scaledAxis; +} + +void McCadCSGGeom_Surface::SetAxis(const gp_Ax3& theAx) +{ + myAxis = theAx; + + ///////////////////////////////////////////////////////////////////////////////////////// + if (!myAxis.Direct()) + { + cout << " IndirectSurface found !!!" << endl; + } + ///////////////////////////////////////////////////////////////////////////////////////// + + if(myType == McCadCSGGeom_Planar || + myType == McCadCSGGeom_Spherical || + myType == McCadCSGGeom_Quadric || + myType == McCadCSGGeom_OtherSurface) + { + haveTrsf = Standard_False; + return ; + } + + // cout << "McCadCSGGeom_Surface :: " << myAxis.Location().X() << " " << myAxis.Location().Y() << " " << myAxis.Location().Z() << endl; + + gp_Ax3 stdAx(gp::Origin(),gp::DZ()); + + gp_Ax3 stdAx3Z(myAxis.Location(),gp::DZ()); + gp_Ax3 stdAx3X(myAxis.Location(),gp::DX()); + gp_Ax3 stdAx3Y(myAxis.Location(),gp::DY()); + + /*cout << "stdAx: " << stdAx.Location().X() << " " << stdAx.Location().Y() << " " << stdAx.Location().Z() << endl; + cout << "stdAx3X: " << stdAx3X.Location().X() << " " << stdAx3X.Location().Y() << " " << stdAx3X.Location().Z() << endl; + cout << "stdAx3Y: " << stdAx3Y.Location().X() << " " << stdAx3Y.Location().Y() << " " << stdAx3Y.Location().Z() << endl; + cout << "stdAx3Z: " << stdAx3Z.Location().X() << " " << stdAx3Z.Location().Y() << " " << stdAx3Z.Location().Z() << endl;*/ + + // Standard_Boolean isCentered = Standard_False; + + /*if( stdAx.Location().X() == myAxis.Location().X() && //because the IsCoplanar function does not test if the Locations match (although + stdAx.Location().Y() == myAxis.Location().Y() && //it is supposed to do so) + stdAx.Location().Z() == myAxis.Location().Z() ) + isCentered = Standard_True;*/ + +/* if(myType == McCadCSGGeom_Toroidal) // prevent a skewed transformation if parallel to z-Axis.. + { + gp_Dir torDir = myAxis.Direction(); + gp_Dir stdDir = stdAx.Direction(); + + if(torDir.IsParallel(stdDir, 1e-5)) + { + gp_Ax3 newAx(myAxis.Location(), gp::DZ()); + myAxis = newAx; + } + }*/ + + /*if (isCentered && (stdAx.IsCoplanar(stdAx3Z, 0.001,0.001) || stdAx.IsCoplanar(stdAx3X, 0.001,0.001) + || stdAx.IsCoplanar(stdAx3Y, 0.001,0.001)))*/ + // if(isCentered && stdAx.IsCoplanar(myAxis, 0.001, 0.001)) + if (myAxis.IsCoplanar(stdAx3Z, 0.001,0.001) || myAxis.IsCoplanar(stdAx3X, 0.001,0.001) || myAxis.IsCoplanar(stdAx3Y, 0.001,0.001)) + { + haveTrsf = Standard_False; + return ; + } + else + { + // we draw on the translated Z-Axis + myTransformedAxis.SetAxis(stdAx.Axis()); + haveTrsf = Standard_True; + return; + } +} + +McCadCSGGeom_SurfaceType McCadCSGGeom_Surface::GetType() const +{ + return myType; +} + +void McCadCSGGeom_Surface::SetType(const McCadCSGGeom_SurfaceType theType) +{ + myType = theType; +} + +Standard_Integer McCadCSGGeom_Surface::GetNumber() const +{ + return myNumber; +} + +void McCadCSGGeom_Surface::SetNumber(const Standard_Integer theNumber) +{ + myNumber = theNumber; +} + +void McCadCSGGeom_Surface::SetUnits(McCadCSGGeom_Unit theUnit) +{ + myUnit = theUnit; +} + +McCadCSGGeom_Unit McCadCSGGeom_Surface::GetUnits() const +{ + return myUnit; +} + +Standard_Real McCadCSGGeom_Surface::Scale() const +{ + Standard_Real scaleFactor(1.0); + switch(myUnit) + { + case McCadCSGGeom_CM: scaleFactor = 1.0; break; + case McCadCSGGeom_MM: scaleFactor = 0.1; break; + case McCadCSGGeom_Inch: scaleFactor = 2.54; break; + default : scaleFactor = 1.0; break; + } + return scaleFactor; +} + +void McCadCSGGeom_Surface::SetMCType(const McCadCSGGeom_MCType& theMCType) +{ + myMCType = theMCType; +} + + +McCadCSGGeom_MCType McCadCSGGeom_Surface::GetMCType() const +{ + return myMCType; +} + +///////// MACROBODY RELATED STUFF + +void McCadCSGGeom_Surface::SetIsMacroBody() +{ + myIsMacroBody = Standard_True; +} + +Standard_Boolean McCadCSGGeom_Surface::IsMacroBody() +{ + return myIsMacroBody; +} + +void McCadCSGGeom_Surface::AddMacroBodySurface(const Standard_Integer& surfNum) +{ + if(myMacroBodySurfaceHSequence == NULL) + myMacroBodySurfaceHSequence = new TColStd_HSequenceOfInteger(); + myMacroBodySurfaceHSequence->Append(surfNum); +} + +Handle(TColStd_HSequenceOfInteger) McCadCSGGeom_Surface::GetMacroBodySurfaces() +{ + return myMacroBodySurfaceHSequence; +} + + +void McCadCSGGeom_Surface::SetMacroBodySurfaceNumbers(const Handle(TColStd_HSequenceOfInteger)& mbsn) +{ + myMacroBodySurfaceHSequence = mbsn; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SurfaceOfRevolution.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SurfaceOfRevolution.cxx new file mode 100644 index 0000000..3740e31 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_SurfaceOfRevolution.cxx @@ -0,0 +1,287 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadCSGGeom_SurfaceOfRevolution::McCadCSGGeom_SurfaceOfRevolution() +{ + SetType(McCadCSGGeom_SurfOfRev); +} + +McCadCSGGeom_SurfaceOfRevolution::McCadCSGGeom_SurfaceOfRevolution(gp_Ax1& revAxis, Handle(Geom_Curve)& basisCurve) +{ + SetType(McCadCSGGeom_SurfOfRev); + myBasisCurve = basisCurve; + myRevAxis = revAxis; + gp_Ax2 the2Axis(revAxis.Location(), revAxis.Direction()); + //the2Axis.SetAxis(revAxis); + gp_Ax3 the3Axis(the2Axis); + SetAxis(the3Axis); + myRealSeq = new TColStd_HSequenceOfReal(); +} + +McCadCSGGeom_SurfaceOfRevolution::McCadCSGGeom_SurfaceOfRevolution(gp_Ax1& revAxis, Handle(Geom_Curve)& basisCurve, Handle(TColStd_HSequenceOfReal)& realSeq) +{ + SetType(McCadCSGGeom_SurfOfRev); + myBasisCurve = basisCurve; + myRevAxis = revAxis; + gp_Ax2 the2Axis(revAxis.Location(), revAxis.Direction()); + //the2Axis.SetAxis(revAxis); + gp_Ax3 the3Axis(the2Axis); + SetAxis(the3Axis); + myRealSeq = realSeq; +} + +/*void McCadCSGGeom_SurfaceOfRevolution::Coefficients(Standard_Real& A, Standard_Real& B, + Standard_Real& C, Standard_Real& D) const +{ + gp_Pln aPln(myAxis); + aPln.Coefficients(A, B, C, D); +}*/ + +void McCadCSGGeom_SurfaceOfRevolution::Print(Standard_OStream& theStream) const +{ + theStream.setf(ios::scientific); + + // Calculate Parameters R, A, B + Standard_Real R, A, B; + + gp_Pnt p1 = myRevAxis.Location(); + Handle(Geom_Ellipse) e = Handle(Geom_Ellipse)::DownCast(myBasisCurve); + gp_Pnt p2 = e->Location(); + R = p1.Distance(p2); + A = e->MajorRadius(); + B = e->MinorRadius(); + + gp_Ax3 theAxis; + + if (haveTrsf) + theAxis = myTransformedAxis; + else + theAxis = myAxis; + + gp_Pnt theTorusLocation = theAxis.Location(); + + gp_Ax3 stdAx3Z(theAxis.Location(), gp::DZ()); + gp_Ax3 stdAx3X(theAxis.Location(), gp::DX()); + gp_Ax3 stdAx3Y(theAxis.Location(), gp::DY()); + gp_XYZ transl; + + // prepare for tripoli + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(8) << " SURF " << setw(5) << myNumber << " "; + gp_Ax3 stdAxis; + theAxis = GetAxis(); + //gp_Dir theDir = theAxis.Direction(); + gp_Trsf tmpTrsf; + tmpTrsf.SetTransformation(theAxis, stdAxis); + transl = tmpTrsf.TranslationPart(); + gp_Pnt xyzPnt(transl); + stdAx3Z.SetLocation(xyzPnt); + stdAx3Y.SetLocation(xyzPnt); + stdAx3X.SetLocation(xyzPnt); + } + else if(GetMCType() == McCadCSGGeom_MCNP) + theStream << setw(5) << myNumber << " "; + + if (theAxis.IsCoplanar(stdAx3X, 0.001, 0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "TORUSX"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << R << " " + << setw(15) << A << " " + << setw(15) << B << endl; + theStream.unsetf(ios::right); + } + else // MCNP + { + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "TX " + << setw(8+myOutputPrecision) << theTorusLocation.X() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Y() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Z() << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << R << " " + << setw(8+myOutputPrecision) << A << " " + << setw(8+myOutputPrecision) << B << endl; + theStream.unsetf(ios::right); + } + } + else if (theAxis.IsCoplanar(stdAx3Y, 0.001, 0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "TORUSY"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << R << " " + << setw(15) << A << " " + << setw(15) << B << endl; + theStream.unsetf(ios::right); + //theStream << setw(10) << "TORUSY" << transl.X() << " " << transl.Y() << " " << transl.Z() << " " + // << myMajorRadius << " " << myMinorRadius << " " << myMinorRadius << endl; + } + else //MCNP + { + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + + theStream << setw(4) << "TY " + << setw(8+myOutputPrecision) << theTorusLocation.X() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Y() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Z() << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << R << " " + << setw(8+myOutputPrecision) << A << " " + << setw(8+myOutputPrecision) << B << endl; + theStream.unsetf(ios::right); + } + } + else if (theAxis.IsCoplanar(stdAx3Z, 0.001, 0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "TORUSZ"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << R << " " + << setw(15) << A << " " + << setw(15) << B << endl; + theStream.unsetf(ios::right); + //theStream << setw(10) << "TORUSZ" << transl.X() << " " << transl.Y() << " " << transl.Z() << " " + // << myMajorRadius << " " << myMinorRadius << " " << myMinorRadius << endl; + } + else // MCNP + { + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "TZ " + << setw(8+myOutputPrecision) << theTorusLocation.X() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Y() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Z() << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << R << " " + << setw(8+myOutputPrecision) << A << " " + << setw(8+myOutputPrecision) << B << endl; + theStream.unsetf(ios::right); + } + } + else + { + if(haveTrsf) + theStream << myTNumber << " -- " << endl; + else + theStream << "NO TRSFNBR" << endl; + } +} + + +Standard_Real McCadCSGGeom_SurfaceOfRevolution::Evaluate(const gp_Pnt& thePoint) const +{ + GeomAPI_ProjectPointOnSurf projector(thePoint, mySurf); + gp_Pnt nearestPnt = projector.NearestPoint(); + + Standard_Real dist = nearestPnt.Distance(thePoint); + if(dist < 1e-5) + return 0.0; + + // Make solid and check if thePoint lies on the inside or the outside + BRepBuilderAPI_MakeShell shellMaker(mySurf, Standard_False); + TopoDS_Shell theShell = shellMaker.Shell(); + BRepBuilderAPI_MakeSolid solidMaker(theShell); + TopoDS_Shape theSolid = solidMaker.Shape(); + Standard_Integer sgn(1); + + BRepClass3d_SolidClassifier clssfr(theSolid, thePoint, 1e-7); + + if(clssfr.State() == TopAbs_IN) + sgn = -1; + else if(clssfr.State() == TopAbs_ON) + dist = 0.0; + + return dist*sgn; +} + + +gp_Pnt McCadCSGGeom_SurfaceOfRevolution::Value(const Standard_Real U, const Standard_Real V) const +{ + return gp_Pnt(0,0,0); +} + + +void McCadCSGGeom_SurfaceOfRevolution::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + if (theSurf.GetType() != GeomAbs_SurfaceOfRevolution) + { + cout << "Surface Type incorrect !!" << endl; + return; + } + + mySurf = theSurf.Surface(); +} + + +Handle(Geom_Surface) McCadCSGGeom_SurfaceOfRevolution::CasSurf() const +{ + Handle(Geom_SurfaceOfRevolution) retSurf = new Geom_SurfaceOfRevolution(myBasisCurve, myRevAxis); + return retSurf; +} + + +Standard_Boolean McCadCSGGeom_SurfaceOfRevolution::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + return Standard_False; +} + + +Standard_Boolean McCadCSGGeom_SurfaceOfRevolution::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + return Standard_False; +} + +Handle(Geom_SurfaceOfRevolution) McCadCSGGeom_SurfaceOfRevolution::SurfaceOfRevolution() const +{ + Handle(Geom_SurfaceOfRevolution) retSurf = new Geom_SurfaceOfRevolution(myBasisCurve, myRevAxis); + return retSurf; +} + +void McCadCSGGeom_SurfaceOfRevolution::SetParameter(Handle(TColStd_HSequenceOfReal)& realSeq) +{ + myRealSeq = realSeq; +} + +void McCadCSGGeom_SurfaceOfRevolution::GetParameter(Handle(TColStd_HSequenceOfReal)& realSeq) const +{ + realSeq = myRealSeq; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Torus.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Torus.cxx new file mode 100644 index 0000000..80aa09e --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Torus.cxx @@ -0,0 +1,358 @@ +#include +#include +#include +#include + +#include +#include +#include + +McCadCSGGeom_Torus::McCadCSGGeom_Torus() +{ + gp_Ax3 A3; + SetType(McCadCSGGeom_Toroidal); + myIsElliptical = Standard_False; + SetAxis(A3); + +} + +McCadCSGGeom_Torus::McCadCSGGeom_Torus(const gp_Ax3& A3, const Standard_Real theMajorRadius, const Standard_Real theMinorRadius) +{ + SetType(McCadCSGGeom_Toroidal); + SetAxis(A3); + myMajorRadius = theMajorRadius; + myMinorRadius = theMinorRadius; + myMinorEllipsRadius = theMinorRadius; +} + +void McCadCSGGeom_Torus::SetMajorRadius(const Standard_Real theMajorRadius) +{ + myMajorRadius = theMajorRadius; +} + +void McCadCSGGeom_Torus::SetMinorRadius(const Standard_Real theMinorRadius) +{ + myMinorRadius = theMinorRadius; +} + +void McCadCSGGeom_Torus::SetMinorEllipticalRadius(const Standard_Real theMinorEllipsRadius) +{ + myMinorEllipsRadius = theMinorEllipsRadius; +} + +Standard_Real McCadCSGGeom_Torus::GetMajorRadius() const +{ + return myMajorRadius; +} + +Standard_Real McCadCSGGeom_Torus::GetMinorRadius() const +{ + return myMinorRadius; +} + +Standard_Real McCadCSGGeom_Torus::GetMinorEllipticalRadius() const +{ + return myMinorEllipsRadius; +} + +Standard_Boolean McCadCSGGeom_Torus::IsElliptical() const +{ + return myIsElliptical; +} + +void McCadCSGGeom_Torus::SetElliptical(const Standard_Boolean theState) +{ + myIsElliptical = theState; +} + +void McCadCSGGeom_Torus::Coefficients(TColStd_Array1OfReal& Coef) const +{ + gp_Torus T(myAxis, myMajorRadius, myMinorRadius); + + T.Coefficients(Coef); + +} + +void McCadCSGGeom_Torus::Print(Standard_OStream& theStream) const +{ + theStream.setf(ios::scientific); + theStream.precision(myOutputPrecision); + gp_Torus T; + // if the main axis is rotated the Trsf matrix is printed by client; + // here we only print qaudric in major axis position with its TRcard Number. + // warning it is upto the client to print the Trsf matrix. + gp_Ax3 theAxis; + + gp_Pnt theTorusLocation; + gp_Dir theTorusDirect; + gp_Ax1 torusMainAx; + + if (haveTrsf) + theAxis = myTransformedAxis; + else + theAxis = myAxis; + + //cout << "Torus major radius : " << myMajorRadius << " , minor radius : " << myMinorRadius << endl; + + Standard_Real scaledMinorRadius(0.0), scaledMajorRadius(0.0); + + if(myMajorRadius < myMinorRadius) // OCC doesn't seem to like this case !!! + { + // make fake torus for main axis and scaling!!! + gp_Torus dummyTorus; + dummyTorus.SetPosition(theAxis); + dummyTorus.SetMajorRadius(10.0); + dummyTorus.SetMinorRadius(2.0); + + dummyTorus.Scale(gp_Pnt(0,0,0), Scale()); + scaledMinorRadius = myMinorRadius * Scale(); + scaledMajorRadius = myMajorRadius * Scale(); + + theTorusLocation = dummyTorus.Location(); + torusMainAx = dummyTorus.Axis(); + theTorusDirect = torusMainAx.Direction(); + } + else + { + T.SetPosition(theAxis); + T.SetMajorRadius(myMajorRadius); + T.SetMinorRadius(myMinorRadius); + + T.Scale(gp_Pnt(0,0,0), Scale()); // this is to make mcnp happy with its cms. + + // after Scaling reset radii + scaledMajorRadius = T.MajorRadius(); + scaledMinorRadius = T.MinorRadius(); + + theTorusLocation = T.Location(); + torusMainAx = T.Axis(); + theTorusDirect = torusMainAx.Direction(); + } + + gp_Ax3 stdAx3Z(theAxis.Location(), gp::DZ()); + gp_Ax3 stdAx3X(theAxis.Location(), gp::DX()); + gp_Ax3 stdAx3Y(theAxis.Location(), gp::DY()); + gp_XYZ transl; + + // prepare for tripoli + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(8) << " SURF " << setw(5) << myNumber << " "; + gp_Ax3 stdAxis; + theAxis = GetAxis(); + //gp_Dir theDir = theAxis.Direction(); + gp_Trsf tmpTrsf; + tmpTrsf.SetTransformation(theAxis, stdAxis); + transl = tmpTrsf.TranslationPart(); + gp_Pnt xyzPnt(transl); + stdAx3Z.SetLocation(xyzPnt); + stdAx3Y.SetLocation(xyzPnt); + stdAx3X.SetLocation(xyzPnt); + } + else if(GetMCType() == McCadCSGGeom_MCNP) + theStream << setw(5) << myNumber << " "; + + if (theAxis.IsCoplanar(stdAx3X, 0.001, 0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "TORUSX"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << scaledMajorRadius << " " + << setw(15) << scaledMinorRadius << " " + << setw(15) << scaledMinorRadius << endl; + theStream.unsetf(ios::right); + } + else // MCNP + { + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "TX " + << setw(8+myOutputPrecision) << theTorusLocation.X() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Y() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Z() << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << scaledMajorRadius << " " + << setw(8+myOutputPrecision) << scaledMinorRadius << " " + << setw(8+myOutputPrecision) << scaledMinorRadius << endl; + theStream.unsetf(ios::right); + } + } + else if (theAxis.IsCoplanar(stdAx3Y, 0.001, 0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "TORUSY"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << scaledMajorRadius << " " + << setw(15) << scaledMinorRadius << " " + << setw(15) << scaledMinorRadius << endl; + theStream.unsetf(ios::right); + //theStream << setw(10) << "TORUSY" << transl.X() << " " << transl.Y() << " " << transl.Z() << " " + // << myMajorRadius << " " << myMinorRadius << " " << myMinorRadius << endl; + } + else //MCNP + { + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + + theStream << setw(4) << "TY " + << setw(8+myOutputPrecision) << theTorusLocation.X() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Y() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Z() << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << scaledMajorRadius << " " + << setw(8+myOutputPrecision) << scaledMinorRadius << " " + << setw(8+myOutputPrecision) << scaledMinorRadius << endl; + theStream.unsetf(ios::right); + } + } + else if (theAxis.IsCoplanar(stdAx3Z, 0.001, 0.001)) + { + if(GetMCType() == McCadCSGGeom_TRIPOLI) + { + theStream << setw(7) << "TORUSZ"; + theStream.setf(ios::right); + theStream << setw(15) << transl.X() << " " + << setw(15) << transl.Y() << " " + << setw(15) << transl.Z() << "\n\t\t" + << setw(20) << scaledMajorRadius << " " + << setw(15) << scaledMinorRadius << " " + << setw(15) << scaledMinorRadius << endl; + theStream.unsetf(ios::right); + //theStream << setw(10) << "TORUSZ" << transl.X() << " " << transl.Y() << " " << transl.Z() << " " + // << myMajorRadius << " " << myMinorRadius << " " << myMinorRadius << endl; + } + else // MCNP + { + theStream.setf(ios::right); + if (haveTrsf) + theStream << setw(3) << myTNumber << " "; + else + theStream << setw(4) << " "; + theStream << setw(4) << "TZ " + << setw(8+myOutputPrecision) << theTorusLocation.X() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Y() << " " + << setw(8+myOutputPrecision) << theTorusLocation.Z() << endl + << setw(14) << " " + << setw(8+myOutputPrecision) << scaledMajorRadius << " " + << setw(8+myOutputPrecision) << scaledMinorRadius << " " + << setw(8+myOutputPrecision) << scaledMinorRadius << endl; + theStream.unsetf(ios::right); + } + } + else // MCNP + { + theStream << "c McCad Error: A generic Torus transformation." + << endl; + theStream + << "c McCad: The following are the coefficients of the torus:" + << endl; + + // The size of the array is upper - lower + 1. + + TColStd_Array1OfReal Coef(1, 31); + T.Coefficients(Coef); + if (haveTrsf) + theStream << myTNumber << " "; + theStream << " " << "GT " << setw(10); + for (int it=1; it <= 31; it++) + { + theStream << setw(10) << Coef(it) << " "; + } + theStream << endl; + } +} + +Standard_Real McCadCSGGeom_Torus::Evaluate(const gp_Pnt& thePoint) const +{ + gp_Torus T(myAxis, myMajorRadius, myMinorRadius); + return McCadGTOOL::Evaluate(T, thePoint); +} + +gp_Pnt McCadCSGGeom_Torus::Value(const Standard_Real U, const Standard_Real V) const +{ + gp_Torus T(myAxis, myMajorRadius, myMinorRadius); + return ElSLib::Value(U, V, T); +} + +void McCadCSGGeom_Torus::SetCasSurf(const GeomAdaptor_Surface& theSurf) +{ + if (theSurf.GetType() != GeomAbs_Torus) + { + cout << "Surface Type incorrect !!" << endl; + return; + } + gp_Torus T = theSurf.Torus(); + gp_Ax3 theAxis = T.Position(); +// cout << "McCadCSGGeom_Torus :: theAxis = " << theAxis.Location().X() << " " << theAxis.Location().Y() << " " << theAxis.Location().Z() << endl; + myMajorRadius = T.MajorRadius(); + myMinorRadius = T.MinorRadius(); + SetAxis(theAxis); +} + +Handle(Geom_Surface) McCadCSGGeom_Torus::CasSurf() const +{ + gp_Torus T(myAxis,myMajorRadius,myMinorRadius); + Handle(Geom_ToroidalSurface) surf = new Geom_ToroidalSurface(T); + return surf; +} + +Standard_Boolean McCadCSGGeom_Torus::IsEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + + if(another->GetType() != myType) return Standard_False; + + Handle(Geom_ToroidalSurface) Gtor = Handle_Geom_ToroidalSurface::DownCast(another->CasSurf()); + gp_Torus C = Gtor->Torus(); + gp_Ax3 ax2 = C.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real arad2 = C.MajorRadius(); + Standard_Real irad2 = C.MinorRadius(); + Standard_Real Precision = 1.e-05; + + gp_Dir dir1 = myAxis.Direction(); + gp_XYZ loc1 = (myAxis.Location()).XYZ(); + + if((dir1.IsEqual(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) && + (fabs(myMajorRadius - arad2 )<= Precision) && (fabs(myMinorRadius -irad2 )<= Precision) ) + return Standard_True; + else return Standard_False; +} + +Standard_Boolean McCadCSGGeom_Torus::IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const +{ + return IsEqual(another); + + if(another->GetType() != myType) return Standard_False; + + Handle(Geom_ToroidalSurface) Gtor = Handle_Geom_ToroidalSurface::DownCast(another->CasSurf()); + gp_Torus C = Gtor->Torus(); + gp_Ax3 ax2 = C.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real arad2 = C.MajorRadius(); + Standard_Real irad2 = C.MinorRadius(); + Standard_Real Precision = 1.e-04; + + gp_Dir dir1 = myAxis.Direction(); + gp_XYZ loc1 = (myAxis.Location()).XYZ(); + + if((dir1.IsParallel(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) && + (fabs(myMajorRadius - arad2 )<= Precision) && (fabs(myMinorRadius -irad2 )<= Precision) ) + return Standard_True; + else return Standard_False; +} diff --git a/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Transformation.cxx b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Transformation.cxx new file mode 100644 index 0000000..5578cc3 --- /dev/null +++ b/src/MCCAD/McCadCSGGeom/McCadCSGGeom_Transformation.cxx @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +McCadCSGGeom_Transformation::McCadCSGGeom_Transformation() +{ + myID = 0; + myTrsf.SetValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0); +} + +McCadCSGGeom_Transformation::McCadCSGGeom_Transformation(const Standard_Real a14,const Standard_Real a24,const Standard_Real a34, + const Standard_Real a11,const Standard_Real a12,const Standard_Real a13, + const Standard_Real a21,const Standard_Real a22,const Standard_Real a23, + const Standard_Real a31,const Standard_Real a32,const Standard_Real a33) +{ + + // myTrsf.SetValues(1,0,0,0,0,1,0,0,0,0,1,0,1e-5,1e-5); + + // myTrsf.SetValues(a11,a12,a13,a14,a21,a22,a23,a24, a31,a32,a33,a34,1e-5,1e-5); + myTrsf.SetValues(a11,a21,a31,a14,a12,a22,a32,a24,a13,a23,a33,a34,1e-5,1e-5); + + // gp_Ax3 stdAxis; + // gp_Ax3 theAxis = stdAxis.Transformed(myTrsf); + //gp_Trsf theTrsf; + //theTrsf.SetTransformation(theAxis,stdAxis); + //myTrsf = theTrsf; +} +void McCadCSGGeom_Transformation::SetValues(const Standard_Real a14,const Standard_Real a24,const Standard_Real a34, + const Standard_Real a11,const Standard_Real a12,const Standard_Real a13, + const Standard_Real a21,const Standard_Real a22,const Standard_Real a23, + const Standard_Real a31,const Standard_Real a32,const Standard_Real a33) +{ + + myTrsf.SetValues(a11,a21,a31,a14,a12,a22,a32,a24,a13,a23,a33,a34,1e-5,1e-5); +} + +void McCadCSGGeom_Transformation::SetVValues(const Standard_Real a14,const Standard_Real a24,const Standard_Real a34) +{ + gp_Vec V(a14,a24,a34); + myTrsf.SetTranslation(V); + +} + +void McCadCSGGeom_Transformation::SetIdNum(const Standard_Integer theId) +{ + myID = theId; +} + +Standard_Integer McCadCSGGeom_Transformation::GetIdNum() const +{ + return myID; +} + +void McCadCSGGeom_Transformation::SetTrsf(const gp_Trsf& theTrsf) +{ + myTrsf = theTrsf; +} + +gp_Trsf McCadCSGGeom_Transformation::GetTrsf() const +{ + return myTrsf; +} + diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool.cxx new file mode 100644 index 0000000..7f41ef8 --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool.cxx @@ -0,0 +1,2755 @@ +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +#include + +#include + + +//MYTEST +/*#include +#include + +#include +#include + +#include +#include */ +//#include +//MYTEST + + +#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) ) +#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) ) + +#define MIN2(X, Y) ( Abs(X) < Abs(Y)? Abs(X) : Abs(Y) ) +#define MIN3(X, Y, Z) ( MIN2 ( MIN2(X,Y) , Z) ) + +gp_Dir Normal(const TopoDS_Face& F, const gp_Pnt& P) { + Standard_Real U, V; + gp_Pnt pt; + BRepAdaptor_Surface AS(F, Standard_True); + + switch (AS.GetType()) + { + case GeomAbs_Plane: + ElSLib::Parameters(AS.Plane(), P, U, V); + break; + + case GeomAbs_Cylinder: + ElSLib::Parameters(AS.Cylinder(), P, U, V); + break; + + case GeomAbs_Cone: + ElSLib::Parameters(AS.Cone(), P, U, V); + break; + + case GeomAbs_Torus: + ElSLib::Parameters(AS.Torus(), P, U, V); + break; + + default: + { + return gp_Dir(1., 0., 0.); + } + } + + gp_Vec D1U, D1V; + AS.D1(U, V, pt, D1U, D1V); + gp_Dir N; + CSLib_DerivativeStatus St; + CSLib::Normal(D1U, D1V, Precision::Confusion(), St, N); + if (F.Orientation() == TopAbs_FORWARD) + N.Reverse(); + return N; +} + +Standard_Real AreaOfShape(const TopoDS_Shape& aShape) { + GProp_GProps GP; + BRepGProp::SurfaceProperties(aShape, GP); + return GP.Mass(); + +} + +Standard_Boolean IsTriangleValid(const gp_Pnt& P1, const gp_Pnt& P2, + const gp_Pnt& P3) { + gp_Vec V1(P1, P2); + gp_Vec V2(P2, P3); + gp_Vec V3(P3, P1); + + if ((V1.SquareMagnitude() > 1.e-10) && (V2.SquareMagnitude() > 1.e-10) + && (V3.SquareMagnitude() > 1.e-10)) { + V1.Cross(V2); // V1 = Normal + if (V1.SquareMagnitude() > 1.e-10) + return Standard_True; + else + return Standard_False; + } else + return Standard_False; +} + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::Resultants(const TopoDS_Face& theFace) +{ + TopLoc_Location loc; + TopAbs_Orientation orient = theFace.Orientation(); + + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + + GeomAdaptor_Surface adaptedFaceSurface(theFaceSurface); + + Handle(TopTools_HSequenceOfShape) seqResultant = new TopTools_HSequenceOfShape(); + + ////////////////////////////////////////////////////////////////////////////////////////////// + // new adapted resultant computation: in local coordinates. + //- Note that in the case of the cone, resultants alone are not separating. we have to + // include also partial drivatives. + ////////////////////////////////////////////////////////////////////////////////////////////// + + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(theFace,UMin,UMax, VMin, VMax); + + // reject closed surfaces + if( (adaptedFaceSurface.GetType() == GeomAbs_Cylinder || adaptedFaceSurface.GetType() == GeomAbs_Cone) && + Abs(Abs(UMax-UMin)-2.*M_PI) < 1e-7 ) + return seqResultant; + if( adaptedFaceSurface.GetType() == GeomAbs_Sphere && + ( Abs(Abs(UMax-UMin)-2.*M_PI) < 1.e-7 || + Abs(Abs(VMax-VMin)-M_PI) < 1.e-7 ) ) + return seqResultant; + if( adaptedFaceSurface.GetType() == GeomAbs_Torus && + ( Abs(Abs(UMax-UMin)-2.*M_PI) < 1.e-7 || + Abs(Abs(VMax-VMin)-2.*M_PI) < 1.e-7 ) ) + return seqResultant; + + BRepAdaptor_Surface BSF(theFace,Standard_True); + gp_Trsf T = BSF.Trsf(); + + if ( fabs(UMax - UMin)<= gp::Resolution() || fabs(VMax - VMin)<= gp::Resolution() ) + return seqResultant; + + // get extremal points + gp_Pnt P1 = (theFaceSurface->Value(UMin,VMin)).Transformed(T); + gp_Pnt P2 = (theFaceSurface->Value(UMin,VMax)).Transformed(T); + gp_Pnt P3 = (theFaceSurface->Value(UMax,VMin)).Transformed(T); + gp_Pnt P4 = (theFaceSurface->Value(UMax,VMax)).Transformed(T); + + // we compute an orientation point which lies on the right side of the face using bbox. + Bnd_Box theBB; + BRepBndLib::Add(theFace,theBB); + theBB.SetGap(5.0); + Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + theBB.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////// + + // Plane1 = ( P1, P2, p3 ), + // v1 = p1 - p2, v2 = p1 - p4 v3 = v1 ^ v2 + gp_Vec v1(P1, P2), v2(P1, P3); + gp_Vec v3 = v1 ^ v2; + v3.Normalize(); + gp_Dir D1(v3); + Handle(Geom_Plane) Pl1 = new Geom_Plane(P1,D1); + + gp_Vec v4(P3, P1), v5(P3, P4); + gp_Vec v6 = v4 ^ v5; + v6.Normalize(); + gp_Dir D2(v6); + Handle(Geom_Plane) Pl2 = new Geom_Plane(P3,D2); + + ElSLib::Parameters(Pl1->Pln(),P1,UMin,VMin); + ElSLib::Parameters(Pl2->Pln(),P4,UMax,VMax); + + if (v3.IsParallel(v6,1.0e-4)) + { +#ifdef OCC650 + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(Pl1, UMin,UMax, VMin, VMax); +#else + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(Pl1, UMin,UMax, VMin, VMax, 1.e-7); +#endif + F1.Orientation(orient); // this orieantation will not be used !!! + seqResultant->Append(F1); + } + else + { +#ifdef OCC650 + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(Pl1, UMin,UMax, VMin, VMax); +#else + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(Pl1, UMin,UMax, VMin, VMax, 1.e-7); +#endif + F1.Orientation(orient); // this orieantation will not be used !!! + seqResultant->Append(F1); + +#ifdef OCC650 + F1 = BRepBuilderAPI_MakeFace(Pl2, UMin,UMax, VMin, VMax); +#else + F1 = BRepBuilderAPI_MakeFace(Pl2, UMin,UMax, VMin, VMax, 1.e-7); +#endif + F1.Orientation(orient); // this orieantation will not be used !!! + seqResultant->Append(F1); + } +// cout << "=================================================== " << endl; +// cout << " Number of Resultants computed = " << seqResultant->Length() << "\n" << endl; + + return seqResultant; +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::BoxResultants(const TopoDS_Face& theFace) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TopLoc_Location loc; + Handle_Geom_Surface theSurface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface adaptedFaceSurface(theSurface); + Handle_TopTools_HSequenceOfShape resultantSeq = new TopTools_HSequenceOfShape(); + Standard_Real uMin,uMax, vMin, vMax; + BRepTools::UVBounds(theFace,uMin,uMax, vMin, vMax); + BRepAdaptor_Surface brepSurface(theFace,Standard_True); + gp_Trsf surfaceTransformation = brepSurface.Trsf(); + + // return planes for closed curved faces + if((adaptedFaceSurface.GetType() == GeomAbs_Cylinder && Abs(Abs(uMax-uMin)-2*M_PI) < 1e-7 ) || + (adaptedFaceSurface.GetType() == GeomAbs_Torus && ( Abs(Abs(vMax-vMin)-2*M_PI) < 1e-7 || + Abs(Abs(uMax-uMin)-2*M_PI) < 1e-7) ) || + (adaptedFaceSurface.GetType() == GeomAbs_Sphere && ( Abs(Abs(vMax-vMin)-2*M_PI) < 1e-7 || + Abs(Abs(uMax-uMin)-2*M_PI) < 1e-7) ) || + (adaptedFaceSurface.GetType() == GeomAbs_Cone && Abs(Abs(uMax-uMin)-2*M_PI) < 1e-7)) + { + TopExp_Explorer edgeIterator(theFace, TopAbs_EDGE); + for(; edgeIterator.More(); edgeIterator.Next()) { + TopoDS_Edge curEdge = TopoDS::Edge(edgeIterator.Current()); + + Bnd_Box tstBox; + BRepBndLib::Add(curEdge, tstBox); + + if(tstBox.IsThin(1e-7)) + continue; + + Standard_Real curveFirst, curveLast; + const Handle_Geom_Curve& curve = BRep_Tool::Curve(curEdge,loc, curveFirst, curveLast); + + BRepAdaptor_Curve baCurve; + baCurve.Initialize(curEdge); + + if(curve->IsClosed()) { + TopoDS_Wire wire = BRepBuilderAPI_MakeWire(curEdge); + TopoDS_Face planarFace = BRepBuilderAPI_MakeFace(wire ,Standard_True); + resultantSeq->Append(planarFace); + } + } + return resultantSeq; + } + + // Calculate resultants from corner vertices of face + ////////////////////////////////////////////////////// + + // not closed but U and V parameters differ too little + if ( fabs(uMax - uMin) <= gp::Resolution() || fabs(vMax - vMin) <= gp::Resolution() ) + return resultantSeq; + + // define corner points of face + gp_Pnt p1 = (theSurface->Value(uMin,vMin)).Transformed(surfaceTransformation); + gp_Pnt p2 = (theSurface->Value(uMin,vMax)).Transformed(surfaceTransformation); + gp_Pnt p3 = (theSurface->Value(uMax,vMin)).Transformed(surfaceTransformation); + gp_Pnt p4 = (theSurface->Value(uMax,vMax)).Transformed(surfaceTransformation); + + // calculate vertices for planes + gp_Vec vec1(p1, p2), vec2(p1, p3); + gp_Vec vec3 = vec1 ^ vec2; + vec3.Normalize(); + gp_Vec vec4(p3, p1), vec5(p3, p4); + gp_Vec vec6 = vec4 ^ vec5; + vec6.Normalize(); + TopoDS_Vertex vert1 = BRepBuilderAPI_MakeVertex(p1); + TopoDS_Vertex vert2 = BRepBuilderAPI_MakeVertex(p2); + TopoDS_Vertex vert3 = BRepBuilderAPI_MakeVertex(p3); + TopoDS_Vertex vert4 = BRepBuilderAPI_MakeVertex(p4); + + //in der Ebene + if (vec3.IsParallel(vec6,1.0e-4)) { + TopoDS_Wire wire1 = BRepBuilderAPI_MakePolygon(vert1,vert3,vert4,vert2,Standard_True); // ordered traversal important.. + TopoDS_Face planarFace1 = BRepBuilderAPI_MakeFace(wire1,Standard_True); + if(planarFace1.IsNull()) + msgr->Message("_#_McCadCSGTool::BoxResultants : Null face computed - 0\n", McCadMessenger_WarningMsg); + else + resultantSeq->Append(planarFace1); + } + else { + TopoDS_Wire wire1 = BRepBuilderAPI_MakePolygon(vert1,vert3,vert4,Standard_True); + TopoDS_Face planarFace1 = BRepBuilderAPI_MakeFace(wire1,Standard_True); + if(planarFace1.IsNull()) + msgr->Message("_#_McCadCSGTool::BoxResultants : Null face computed - 1\n", McCadMessenger_WarningMsg); + else + resultantSeq->Append(planarFace1); + TopoDS_Wire wire2 = BRepBuilderAPI_MakePolygon(vert1,vert4,vert2,Standard_True); + TopoDS_Face planarFace2 = BRepBuilderAPI_MakeFace(wire2,Standard_True); + if(planarFace2.IsNull()) + msgr->Message("_#_McCadCSGTool::BoxResultants : Null face computed - 1\n", McCadMessenger_WarningMsg); + else + resultantSeq->Append(planarFace2); + } + + //calculate planes for all non-degenerated, non-linear edges + ///////////////////////////////////////////////////////////// + BRepAdaptor_Curve adaptorCurve; + for (TopExp_Explorer exd(theFace,TopAbs_EDGE); exd.More(); exd.Next()) { + TopoDS_Edge edge = TopoDS::Edge(exd.Current()); + + // skip degenerated edges + if(BRep_Tool::Degenerated (edge)) + continue; + + // skip linear lines + adaptorCurve.Initialize(edge); + if (adaptorCurve.GetType() == GeomAbs_Line) + continue; + + // determine first and last parameter for curve + Standard_Real firstParameter = (!(Precision::IsNegativeInfinite(adaptorCurve.FirstParameter()))) ? adaptorCurve.FirstParameter() : -1.0; + Standard_Real lastParameter = (!(Precision::IsPositiveInfinite(adaptorCurve.LastParameter()))) ? adaptorCurve.LastParameter() : 1.0; + if(adaptorCurve.IsClosed()) + firstParameter = MAX2(lastParameter,firstParameter)/2; + if (lastParameter-firstParameter < .5 ) // why? + continue; + + // set correct orientation + Standard_Real oFirst, oLast; + if (edge.Orientation() == TopAbs_REVERSED) { + oFirst = lastParameter; + oLast = firstParameter; + } + else { + oFirst = firstParameter; + oLast = lastParameter; + } + + gp_Pnt pf = adaptorCurve.Value(oFirst); + gp_Pnt pl = adaptorCurve.Value(oLast); + gp_Pnt pm = adaptorCurve.Value(oFirst + (oLast-oFirst)/2); + + gp_Vec ccv1(pf, pl); + gp_Lin lin(pf,gp_Dir(ccv1)); + Standard_Real dismPnt = lin.Distance(pm); + + // shift middle vertex if it has small distance to the connecting line between first and last point + if (dismPnt < 1.e-5 ) { + gp_Dir normalOfFace = Normal(theFace,pf); + gp_Vec normalVec(normalOfFace); + /** Using vTan is the worst thing you can do + gp_Vec vTan = ccv1 ^ vN; + vTan.Normalize(); + vTan *= 100.; + we have along linear edges also associated linear faces therefore we make this face big + to use the non linear cut faces first....*/ + normalVec.Normalize(); + normalVec *= 100000.; + pm.Translate(normalVec); + vert1 = BRepBuilderAPI_MakeVertex(pf); + vert2 = BRepBuilderAPI_MakeVertex(pm); + vert3 = BRepBuilderAPI_MakeVertex(pl); + } + else { + vert1 = BRepBuilderAPI_MakeVertex(pf); + vert2 = BRepBuilderAPI_MakeVertex(pm); + vert3 = BRepBuilderAPI_MakeVertex(pl); + } + TopoDS_Wire w1 = BRepBuilderAPI_MakePolygon(vert1,vert2,vert3,Standard_True); + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(w1,Standard_True); + if(F1.IsNull()) + msgr->Message("_#_McCadCSGTool::BoxResultants : Null face computed - 2\n", McCadMessenger_WarningMsg); + else + resultantSeq->Append(F1); + } + + return resultantSeq; +} + + + +/*Handle(TopTools_HSequenceOfShape) McCadCSGTool::AppBoxResultants(const TopoDS_Face& theFace) +{ + TopLoc_Location loc; + Bnd_Box theBB; + TopoDS_Shape supBox; + TopExp_Explorer ex; + + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + Handle(TopTools_HSequenceOfShape) seqResultant = new TopTools_HSequenceOfShape(); + + // BRepAdaptor_Surface surface with bounds + cout << "Starting Bounding Box computation !!!!" << endl; + + BRepAdaptor_Surface BS(theFace,Standard_True); + // Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface theAFaceSurface = BS.Surface(); + if (theAFaceSurface.GetType() == GeomAbs_Plane) + { + //cout << "A plane Face " << endl; + return seqResultant; + } + // BndLib_AddSurface::Add(theAFaceSurface,Precision::Confusion(),theBB); + BRepBndLib::Add(theFace,theBB); + theBB.SetGap(0.0); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + theBB.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + // what should be done in this cases is not yet clear!!! + // enlarge Box added on Thu Sep 29 14:42:03 CES 2005 + if(theBB.IsVoid()) + { + cout << "Void Box computed!! " << endl; + return seqResultant; + } + if(theBB.IsWhole()) + { + cout << "Whole Box computed!! " << endl; + return seqResultant; + } + if(theBB.IsThin(BRep_Tool::Tolerance(theFace))) + { + cout << "Thin Box computed!! " << endl; + return seqResultant; + } + if(theBB.IsXThin(BRep_Tool::Tolerance(theFace))) + { + cout << "X Thin Box computed!! " << endl; + aXmin = aXmin - 0.5; + aXmax = aXmax + 0.5; + // return seqResultant; + } + if(theBB.IsYThin(BRep_Tool::Tolerance(theFace))) + { + cout << "Y Thin Box computed!! " << endl; + aYmin = aYmin - 0.5; + aYmax = aYmax + 0.5; + // return seqResultant; + } + if(theBB.IsZThin(BRep_Tool::Tolerance(theFace))) + { + cout << "Z Thin Box computed!! " << endl; + cout << "Will increase box size!!" << endl; + aZmin = aZmin - 0.5; + aZmax = aZmax + 0.5; + // + //return seqResultant; + } + + supBox = BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin), gp_Pnt(aXmax, aYmax, aZmax)).Shape(); + + TopoDS_Solid solBox = TopoDS::Solid(supBox); + +// cout << "Bounding Box computation successful !!!!" << endl; + + for (ex.Init(solBox,TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aBFace = TopoDS::Face(ex.Current()); + Handle(Geom_Surface) aBSurface = BRep_Tool::Surface(aBFace,loc); + // if (aBSurface.GetType() == GeomAbs_Plane) return seqResultant; + Standard_Real A=0, B=0, C=0, D=0; + gp_Pln aPlane = GeomAdaptor_Surface(aBSurface).Plane(); + + aPlane.Coefficients(A, B, C, D); + + Standard_Real epsi; + epsi =.001*D; + if (fabs(A) > 1e-5) + epsi = fabs(aXmax - aXmin)/1000.; + if (fabs(B) > 1e-5) + epsi = fabs(aYmax - aYmin)/1000.; + if (fabs(C) > 1e-5) + epsi = fabs(aZmax - aZmin)/1000.; + // epsi is set 1/5 of the box size. + // peturbation: since the intersection of the undelying surfaces is + // transversal, the resultants are peturbation invariant. + + Handle(Geom_Plane) aPosPetSurface = new Geom_Plane( A, B, C, D+epsi); + Handle(Geom_Plane) aNegPetSurface = new Geom_Plane( A, B, C, D-epsi); + + GeomInt_IntSS theIntPos(aPosPetSurface,theFaceSurface,Precision::Confusion(), Standard_True, Standard_False,Standard_False); + + if(!theIntPos.IsDone()) + { + cout << "_#_McCadCSGTool.cxx :: Positive Int failed! " << endl; + return seqResultant; + } + + GeomInt_IntSS theIntNeg(aNegPetSurface,theFaceSurface,Precision::Confusion(),Standard_True, Standard_False,Standard_False); + + if(!theIntNeg.IsDone()) + { + cout << "_#_McCadCSGTool.cxx :: Negative Int failed! " << endl; + return seqResultant; + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////// + cout << "Number of Lines: " <Append(F1); + + return seqResultant; + }*/ + + if(adaptedFaceSurface.GetType() == GeomAbs_Sphere) // u-closed && v-closed sphere + { + if(Abs(Abs(UMax - UMin)-2*M_PI) < 1.e-5 /*&& Abs(Abs(VMax - VMin)-PI) < 1.0e-5*/) + { + return seqResultant; + } + } + //MYTEST Torus special : Tue Jan 19 13:57:40 CET 2010 +/* if(adaptedFaceSurface.GetType() == GeomAbs_Torus) + { + if(orient == TopAbs_REVERSED) // reversed torus + { + // check if u-closed + if(Abs(Abs(UMax - UMin) - 2*PI) > 1.e-3) + {// not u-closed -> need for splitting plane + cout << "NOT U-CLOSED\n"; + if(Abs(Abs(UMax-UMin)) - PI > 1e-3) + cout << "CCCCCCCCCCCCCCCCC cut neccessary for torus CCCCCCCCCCCCCCCCCCCCCCc\n"; + // create face + // not important right now !!! + //TODO : implement missing planar faces + } + + + // check if v-closed + if(Abs(Abs(VMax - VMin) - 2*PI) > 1.e-3) + {// not v-closed -> need for splitting plane + // cout << "NOT V-CLOSED\n"; + TCollection_AsciiString sDesc("0 Z "); + Standard_Real radius = sqrt(P1.X()*P1.X() + P1.Y()*P1.Y()); + sDesc += P1.Z(); + sDesc += TCollection_AsciiString(" "); + sDesc += radius; + sDesc += TCollection_AsciiString(" "); + radius = sqrt(P4.X()*P4.X() + P4.Y()*P4.Y()); + sDesc += P4.Z(); + sDesc += TCollection_AsciiString(" "); + sDesc += radius; + + cout << sDesc.ToCString() << endl; + + McCadMcRead_SurfaceFactory sfFact; + sfFact.MakeSurface(sDesc); + + if(!sfFact.IsDone()) + { + cout << "_#_McCadCSGTool.cxx :: Failed to make Axissymmetric Surface By Points!\n"; + return seqResultant; + } + + TopoDS_Face aFace; + + Handle(McCadCSGGeom_Surface) theSurf = sfFact.GetSurface(); + if(theSurf->GetType() == McCadCSGGeom_Conical) + { + Handle(McCadCSGGeom_Cone) mcCone = Handle(McCadCSGGeom_Cone)::DownCast(theSurf); + Handle(Geom_ConicalSurface) coneSurf = Handle(Geom_ConicalSurface)::DownCast(mcCone->CasSurf()); + gp_Cone aCone = coneSurf->Cone(); + aFace = BRepBuilderAPI_MakeFace(aCone).Face(); + + aFace.Orientation(TopAbs_REVERSED); + seqResultant->Append(aFace); + + } + else if(theSurf->GetType() == McCadCSGGeom_Cylindrical) + { + //TODO implement cylindrical + } + else + { + cout << "_#_McCadCSGTool.cxx :: Partial has uncommon surface type!!!\n"; + } + + } + } + }*/ + //#MYTEST Torus special + + + + if(adaptedFaceSurface.GetType() == GeomAbs_Torus || adaptedFaceSurface.GetType() == GeomAbs_SurfaceOfRevolution) + { + + /*if(Abs(UMin) < 1e-7) + VMin = 0;*/ + + if(Abs(Abs(VMax - VMin)-2.*M_PI) < 1e-5) // v-closed torus doesn't need resultants + return seqResultant; + else if(Abs(Abs(UMax - UMin)-2*M_PI) < 0.001 || Abs(Abs(UMax - UMin)-M_PI) < 0.001) // reset Pnt3 & Pnt4 + { + P3 = (theFaceSurface->Value(UMax/3.0, VMin)).Transformed(T); + P4 = (theFaceSurface->Value(UMax/3.0, VMax)).Transformed(T); + } + + // else construct special rescue point for toroidal surfaces + Standard_Real uDiffHalf = (UMax-UMin)/2.0; + + gp_Pnt pnt1 = (theFaceSurface->Value(uDiffHalf, VMin)); + gp_Pnt pnt2 = (theFaceSurface->Value(uDiffHalf, (VMax-VMin)/2.0)); + + if(orient == TopAbs_FORWARD) + rescuePnt = gp_Pnt((pnt1.X()+pnt2.X())/2.0, (pnt1.Y()+pnt2.Y())/2.0, (pnt1.Z()+pnt2.Z())/2.0); + else + rescuePnt = gp_Pnt(1e9, 1e9, 1e9); + } + + Handle(TColgp_HSequenceOfPnt) oPntSeq = new TColgp_HSequenceOfPnt(); //SamplePoints created by triangulation + TopoDS_Shape supBox = BRepPrimAPI_MakeBox(gp_Pnt(Xmin, Ymin, Zmin), gp_Pnt(Xmax, Ymax, Zmax)).Shape(); + + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + //computing sample point on the faces of the bounding box + for (TopExp_Explorer exF(supBox,TopAbs_FACE); exF.More(); exF.Next()) + { + TopoDS_Face aFace = TopoDS::Face(exF.Current()); + Handle(Poly_Triangulation) mesh; + mesh = BRep_Tool::Triangulation(aFace, loc); + if (mesh.IsNull()) + { + Standard_Real aDeflection = MAX3( Xmax-Xmin , Ymax-Ymin , Zmax-Zmin)/4.0; + BRepMesh::Mesh(aFace, aDeflection); + mesh = BRep_Tool::Triangulation(aFace, loc); + } + + if (mesh.IsNull()) + { + cout << "_#_McCadCSGTool.cxx :: Face triangulation failed !!" << endl; + cout << " Use now incremental method !!" << endl; + Standard_Real dx = fabs(Xmax - Xmin)/2.; + Standard_Real dy = fabs(Ymax - Ymin)/2.; + Standard_Real dz = fabs(Zmax - Zmin)/2.; + oPntSeq->Append(gp_Pnt(Xmin, Ymin, Zmin)); + oPntSeq->Append(gp_Pnt(Xmin, Ymin+dy, Zmin+dz)); + oPntSeq->Append(gp_Pnt(Xmax, Ymin+dy, Zmin+dz)); + oPntSeq->Append(gp_Pnt(Xmin+dx, Ymin, Zmin+dz)); + oPntSeq->Append(gp_Pnt(Xmin+dx, Ymax, Zmin+dz)); + oPntSeq->Append(gp_Pnt(Xmin+dx, Ymin+dy, Zmin)); + oPntSeq->Append(gp_Pnt(Xmin+dx, Ymin+dy, Zmax)); + oPntSeq->Append(gp_Pnt(Xmax, Ymax, Zmax)); + } + else + { + Standard_Integer nNodes = mesh->NbNodes(); + TColgp_Array1OfPnt meshPnts(1,nNodes); + meshPnts = mesh->Nodes(); + for(Standard_Integer i=meshPnts.Lower(); i<=meshPnts.Upper(); i++) + { + gp_Pnt aPnt = (meshPnts(i)).Transformed(T); + oPntSeq->Append(aPnt); + } + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////// + + Standard_Integer inIndex(0); + Standard_Real inVal(0.0); + + if(orient == TopAbs_FORWARD) + {//For all potential Sample Points find the point with the biggest value OUT of the Surface + for (Standard_Integer il=1; il<= oPntSeq->Length(); il++) + { + Standard_Real orientVal = McCadGTOOL::Evaluate(adaptedFaceSurface,oPntSeq->Value(il)); + + if(orientVal < -.1 ) + { + if (Abs(orientVal) > inVal) // we maximize + { + inIndex = il; + inVal = Abs(orientVal); + } + } + } + } + else if(orient == TopAbs_REVERSED) + { + for (Standard_Integer il=1; il<= oPntSeq->Length(); il++) //For all potential Sample Points find the point with the biggest value OUT of the Surface + { + Standard_Real orientVal = McCadGTOOL::Evaluate(adaptedFaceSurface,oPntSeq->Value(il)); + + if(orientVal > 0.1 ) + { + if (Abs(orientVal) > inVal) // we maximize + { + inIndex = il; + inVal = Abs(orientVal); + //cout << orientVal << endl; + } + } + } + } + + + gp_Pnt InOrientPnt;//, OutOrientPnt; + if(inIndex == 0) + { + cout << "Important Warning: Inward/Outward orientation point assumed ( " << rescuePnt.X() << " , " << rescuePnt.Y() << " , " << rescuePnt.Z() << " ) "<< endl; //(0,0,0) !!" << endl; + InOrientPnt = rescuePnt; + } + else + { + InOrientPnt = oPntSeq->Value(inIndex); + } +//cout<< "3\n"; + + //////////////////////////////////////////////////////////////////////////////////////////////////////////// + // compute new partials + gp_Vec v1(P1, P2), v2(P1, P3); + gp_Vec v3 = v1 ^ v2; + v3.Normalize(); + gp_Dir D1(v3); + Handle(Geom_Plane) Pl1 = new Geom_Plane(P1,D1); + + gp_Vec v4(P3, P1), v5(P3, P4); + gp_Vec v6 = v4 ^ v5; + v6.Normalize(); + gp_Dir D2(v6); + Handle(Geom_Plane) Pl2 = new Geom_Plane(P3,D2); +//cout << "4\n"; + //////////////////////////////////////////////////// + Handle(Geom_HSequenceOfSurface) surfSeq = new Geom_HSequenceOfSurface; + + if (v3.IsParallel(v6,1.0e-4)) // trac#23 always parallel the way the extremal points are defined + { + surfSeq->Append(Pl1); + } + else + { + surfSeq->Append(Pl1); + surfSeq->Append(Pl2); + std::cout << "not parallel\n"; + } + + ///////////////////////////////////////////////////////////////////////////////////////////// + for (Standard_Integer si = 1; si <= surfSeq->Length(); si++) + { + GeomAdaptor_Surface parSurface(surfSeq->Value(si)); + ///////////////////////////////////////////////////////////////////// + // we compute here the orientation of the parSurface relative to orientPnt + // which certainly lies on the Face. + TopAbs_Orientation InOrient; + + Standard_Real orientVal = McCadGTOOL::Evaluate(parSurface,InOrientPnt); + + if(orientVal < 0.0 ) + { + InOrient = TopAbs_FORWARD; + } + else if (orientVal > 0.0 ) + { + InOrient = TopAbs_REVERSED; + } + else + { + cout << "Important Warning: FORWARD orientation assumed for Partial!!" << endl; + InOrient = TopAbs_FORWARD; + } + + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + + //only in this case we need additional points. In the other cases the partials are always supported. + if (adaptedFaceSurface.GetType() == GeomAbs_Torus || adaptedFaceSurface.GetType() == GeomAbs_Cone ) + { + Handle(Poly_Triangulation) mesh; + mesh = BRep_Tool::Triangulation(theFace, loc); + BRepAdaptor_Surface BS(theFace,Standard_True); + gp_Trsf T = BS.Trsf(); + Standard_Real aDeflection=0.0; + if (mesh.IsNull()) + { + //cout << "_#_McCadCSGTool.cxx :: A Face has no triangulation !!" << endl; + Bnd_Box B; + BRepBndLib::AddClose(theFace, B); + B.SetGap(0.0); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + //cout << aXmin << " " << aYmin << " " << aZmin <<" " << aXmax<< " " << aYmax<< " " << aZmax << endl; + //cout << "Box computed !!" << endl; + + aDeflection = MAX3(aXmax-aXmin , aYmax-aYmin , aZmax-aZmin)/1.0; + + BRepMesh::Mesh(theFace, aDeflection); + } + + mesh = BRep_Tool::Triangulation(theFace, loc); + + if (mesh.IsNull()) + cout << "_#_McCadCSGTool.cxx :: Face triangulation failed !!" << endl; + else + { + Standard_Integer nNodes = mesh->NbNodes(); + + Poly_Connect conn(mesh); + TColgp_Array1OfPnt meshPnts(1,nNodes); + meshPnts = mesh->Nodes(); + + // cout << " Number of total node Points = " << nNodes <Append(aPnt); + } + else + { + if(aVal > 0.0 ); // point is supported + else thePntSeq->Append(aPnt); + } + } + } + } + ///////////////////////////////////////////////////////////////////////////////////////////// + // the thePntSeq contains the unsupported points + // we extremize and compute the max distance and move the partial by this distance away from the surface! + gp_Pln parPlane = parSurface.Plane(); + gp_Ax3 axis = parPlane.Position(); + + Standard_Boolean shouldPush = Standard_False; + Standard_Real dist = 0 , maxDist = 0; + + if ( thePntSeq->Length() > 0 ) // otherwise all points are supported, we are done here; + { + shouldPush = Standard_True; + gp_Pln aPln = parSurface.Plane(); + + Standard_Integer index=0; + for (int i=1; i<= thePntSeq->Length(); i++) + { + dist = aPln.Distance(thePntSeq->Value(i)); + //cout << dist << " "; + if ( dist >= maxDist) + { + maxDist = dist; + index = i; + } + } + + //cout << maxDist << " " << endl; + axis.SetLocation(thePntSeq->Value(index)); + } + gp_Pln aPlane(axis); + + if(shouldPush) // we have to correct by push away from node; + { + cout << "\nPUSHING!!!\n" ; + Standard_Real A,B,C,D; + aPlane.Coefficients(A,B,C,D); + + if (InOrient == TopAbs_FORWARD) + { + // cout << "The orientation of the partial is forward." << endl; + gp_Pln tmpPln(A,B,C,D - maxDist); + aPlane = tmpPln; + } + else + { + // cout << "The orientation of the partial is reversed." << endl; + gp_Pln tmpPln(A,B,C,D + maxDist); + aPlane = tmpPln; + } + } + /* + else // push partial away from the boundary by standard purturbation of 1.0; + { + Standard_Real A,B,C,D; + aPlane.Coefficients(A,B,C,D); + if (parOrient == TopAbs_FORWARD) + { + cout << "The orientation of the partial is forward." << endl; + gp_Pln tmpPln(A,B,C,D - 10.0); + aPlane = tmpPln; + } + else + { + cout << "The orientation of the partial is reversed." << endl; + gp_Pln tmpPln(A,B,C,D + 10.0); + aPlane = tmpPln; + } + } + */ + + Standard_Real A,B,C,D; + aPlane.Coefficients(A,B,C,D); + // cout << "ADDING PLANE :: " << A << " " << B << " " << C << " " << D << endl; + + ////////////////// + // this is new addition to have bounded partials + if(si==1) + { + ElSLib::Parameters(Pl1->Pln(), P1, UMin,VMin); // !!!! HERE + ElSLib::Parameters(Pl1->Pln(), P4, UMax,VMax); + } + else + { + ElSLib::Parameters(Pl2->Pln(), P1, UMin,VMin); // !!!! HERE + ElSLib::Parameters(Pl2->Pln(), P4, UMax,VMax); + } + + ///////////////////////////////////////////////////////////////////////////////////////////// + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(aPlane, UMin,UMax, VMin, VMax).Face(); + // cout << "U/V-Min/-Max: " << UMin << " " << UMax << " " << VMin << " " << VMax << endl; + + F1.Orientation(InOrient); // this orientation will be used !!! + seqResultant->Append(F1); + } + //cout << " Number of Partials computed = " << seqResultant->Length() << endl ; + // cout << "=================================================== " << endl; + return seqResultant; +} + + +Standard_Boolean McCadCSGTool::AddAuxSurf(const TopoDS_Face& aFace, + Handle(TopTools_HSequenceOfShape) & seqResultant) +{ + TopLoc_Location loc; + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(aFace,loc); + GeomAdaptor_Surface adaptedFaceSurface(theFaceSurface); + + if( adaptedFaceSurface.GetType() == GeomAbs_Cylinder + || adaptedFaceSurface.GetType() == GeomAbs_Cone + || adaptedFaceSurface.GetType() == GeomAbs_Sphere) + { + return GenAuxFaceOfCylinder(seqResultant,aFace); + } + + else if( adaptedFaceSurface.GetType() == GeomAbs_Torus + /*|| adaptedFaceSurface.GetType() == GeomAbs_SurfaceOfRevolution*/) + { + return GenAuxFaceOfTorus(seqResultant,aFace); + } + else + { + return Standard_False; + } +} + + +Standard_Boolean McCadCSGTool::GenAuxFaceOfCylinder( Handle(TopTools_HSequenceOfShape) & seqResultant, + const TopoDS_Face& theFace) +{ + TopAbs_Orientation orient = theFace.Orientation(); + if (orient == TopAbs_FORWARD) + { + return Standard_False; + } + + TopLoc_Location loc; + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface adaptedFaceSurface(theFaceSurface); + + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(theFace,UMin,UMax, VMin, VMax); + BRepAdaptor_Surface BSF(theFace,Standard_True); + gp_Trsf T = BSF.Trsf(); //the surfaces coordinate system + + if ( fabs(UMax - UMin)<= gp::Resolution() || fabs(VMax - VMin)<= gp::Resolution()) + { +//qiu return seqResultant; + return seqResultant==NULL? Standard_False: Standard_True; + } + + // trac#23 + gp_Pnt P1 = (theFaceSurface->Value(UMin,VMin)).Transformed(T); //get extremal points in the surfaces coord sys. + gp_Pnt P2 = (theFaceSurface->Value(UMin,VMax)).Transformed(T); + gp_Pnt P3 = (theFaceSurface->Value(UMax,VMin)).Transformed(T); + gp_Pnt P4 = (theFaceSurface->Value(UMax,VMax)).Transformed(T); + + gp_Pnt pnt_mid = (theFaceSurface->Value(UMin+(UMax-UMin)/2.0,VMin+(VMax-VMin)/2.0)).Transformed(T); + + gp_Vec v1, v2, v3; + + // handle closed faces + if( adaptedFaceSurface.GetType() == GeomAbs_Cylinder + || adaptedFaceSurface.GetType() == GeomAbs_Cone ) // closed cylinder doesn't need resultant + { + if (Abs((UMax-UMin)-2*M_PI) < 1e-7) + { +//qiu return seqResultant; + return seqResultant==NULL? Standard_False: Standard_True; + } + + v1 = gp_Vec::gp_Vec(P2,P1); + v2 = gp_Vec::gp_Vec(P3,P1); + v3 = v2 ^ v1; + } + else if(adaptedFaceSurface.GetType() == GeomAbs_Sphere) // u-closed && v-closed sphere + { + if(Abs(Abs(UMax - UMin)-2*M_PI) < 1.e-5) + { +//qiu return seqResultant; + return seqResultant==NULL? Standard_False: Standard_True; + } + + P3 = (theFaceSurface->Value(UMin,VMin+((VMax - VMin)/2.0)) ).Transformed(T); + P4 = (theFaceSurface->Value(UMax,VMin+((VMax - VMin)/2.0)) ).Transformed(T); + + v1 = gp_Vec::gp_Vec(P2,P1); + v2 = gp_Vec::gp_Vec(P3,P4); + v3 = v2 ^ v1; + } + + // gp_Vec v1(P1, P2), v2(P1, P3); + // gp_Vec v3 = v2 ^ v1; + + v3.Normalize(); + gp_Dir plane_dir(v3); + + //gp_Pnt pnt(P1.X()+v3.X()*0.0001,P1.Y()+v3.Y()*0.0001,P1.Z()+v3.Z()*0.0001); + Handle(Geom_Plane) plane = new Geom_Plane(P1,plane_dir); + TopoDS_Face face = BRepBuilderAPI_MakeFace(plane->Pln()); + + Standard_Real orientVal = McCadGTOOL::Evaluate(plane->Pln(),pnt_mid); + TopAbs_Orientation ori_plane; + + if(orientVal < 0.0 ) + { + ori_plane = TopAbs_FORWARD; + } + else if (orientVal > 0.0 ) + { + ori_plane = TopAbs_REVERSED; + } + + face.Orientation(ori_plane); // this orientation will be used !!! + seqResultant->Append(face); +} + + + +Standard_Boolean McCadCSGTool::GenAuxFaceOfTorus(Handle(TopTools_HSequenceOfShape) & seqResultant, + const TopoDS_Face& theFace) +{ + TopLoc_Location loc; + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface adaptedFaceSurface(theFaceSurface); + + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(theFace,UMin,UMax, VMin, VMax); + BRepAdaptor_Surface BSF(theFace,Standard_True); + gp_Trsf T = BSF.Trsf(); //the surfaces coordinate system + + Standard_Real orientVal; + TopoDS_Face face; + + McCadMathTool::ZeroValue(UMin,1.e-10); + McCadMathTool::ZeroValue(UMax,1.e-10); + McCadMathTool::ZeroValue(VMin,1.e-10); + McCadMathTool::ZeroValue(VMin,1.e-10); + + TopAbs_Orientation orient = theFace.Orientation(); + if (orient == TopAbs_FORWARD) + { + if ( fabs(UMax - UMin)<= gp::Resolution())// || fabs(VMax - VMin)<= gp::Resolution() ) + return Standard_False; + + gp_Pnt P1 = (theFaceSurface->Value(UMin,VMin)).Transformed(T); //get extremal points in the surfaces coord sys. + gp_Pnt P2 = (theFaceSurface->Value(UMin,VMax)).Transformed(T); + gp_Pnt P3 = (theFaceSurface->Value(UMax,VMin)).Transformed(T); + gp_Pnt P4 = (theFaceSurface->Value(UMax,VMax)).Transformed(T); + + // handle closed faces + if(Abs((UMax-UMin)-2*M_PI) < 1e-7 ) // closed cylinder doesn't need resultant + { + return Standard_False; + } + + gp_Pnt PA = (theFaceSurface->Value(UMin, M_PI)).Transformed(T); + gp_Pnt PB = (theFaceSurface->Value(UMax, M_PI)).Transformed(T); + + gp_Torus torus = adaptedFaceSurface.Torus(); // Get the geometry of torus + gp_Ax3 Axis = torus.Position(); // The coordinator of torus + gp_Dir Dir = Axis.Direction(); // The direction of torus axis + + gp_Vec vecA(Dir); + gp_Vec vecB(PA, PB); + + gp_Vec vecPln = vecA ^ vecB; + vecPln.Normalize(); + gp_Dir dirPln(vecPln); + + //gp_Pnt PC(PA.X()+vecPln.X()*0.0001,PA.Y()+vecPln.Y()*0.0001,PA.Z()+vecPln.Z()*0.0001); + Handle(Geom_Plane) plane = new Geom_Plane(PA,dirPln); + + face = BRepBuilderAPI_MakeFace(plane->Pln()); + + gp_Pnt pnt_mid = (theFaceSurface->Value(UMin+(UMax-UMin)/2.0,VMin+(VMax-VMin)/2.0)).Transformed(T); + orientVal = McCadGTOOL::Evaluate(plane->Pln(),pnt_mid); + } + else + { + gp_Pnt PA = (theFaceSurface->Value(0, VMin)).Transformed(T); + gp_Pnt PB = (theFaceSurface->Value(0, VMax)).Transformed(T); + + gp_Vec vecA(PA,PB); + + gp_Torus torus = adaptedFaceSurface.Torus(); // Get the geometry of torus + gp_Ax3 axis = torus.Position(); // The coordinator of torus + gp_Pnt center = axis.Location(); // The center of torus + + gp_Dir dir = axis.Direction(); // The direction of torus axis + gp_Vec vecB(dir); + + Standard_Real radius = torus.MajorRadius(); + + Standard_Real semiAngle = vecA.Angle(vecB); + gp_Pnt pnt_mid = (theFaceSurface->Value(UMin+(UMax-UMin)/2.0,VMin+(VMax-VMin)/2.0)).Transformed(T); + + if (Abs(semiAngle - M_PI/2.0) M_PI/2.0) + { + semiAngle = M_PI - semiAngle; + + vecA.SetX(-1.0*vecA.X()); + vecA.SetY(-1.0*vecA.Y()); + vecA.SetZ(-1.0*vecA.Z()); + } + + gp_Pnt pnt_cnt = (theFaceSurface->Value(0.0,0.0)).Transformed(T); + gp_Vec vecC(center,pnt_cnt); + + Standard_Real angle = vecA.Angle(vecC); + + if(angle > M_PI/2.0) + { + gp_Dir new_dir(-1.0*dir.X(), -1.0*dir.Y(), -1.0*dir.Z()); + axis.SetDirection(new_dir); + } + + gp_Cone cone; + + cone.SetSemiAngle(semiAngle); + cone.SetLocation(center); + cone.SetPosition(axis); + cone.SetRadius(radius); + + face = BRepBuilderAPI_MakeFace(cone); + orientVal = McCadGTOOL::Evaluate(cone,pnt_mid); + } + } + + TopAbs_Orientation ori,ori_new; + ori = face.Orientation(); + + if(orientVal < 0.0 ) + { + ori_new = TopAbs_FORWARD; + } + else if (orientVal > 0.0 ) + { + ori_new = TopAbs_REVERSED; + } + + face.Orientation(ori_new); // this orientation will be used !!! + seqResultant->Append(face); + + return Standard_True; + +} + +// gp_Pnt P5; +// gp_Pnt P6; + +// //if(Abs(Abs(UMax - UMin)-2*M_PI) < 0.001 || Abs(Abs(UMax - UMin)-M_PI) < 0.001) // reset Pnt3 & Pnt4 +// { +// P5 = (theFaceSurface->Value(UMin, VMin+(VMax-VMin)/2.0)).Transformed(T); +// P6 = (theFaceSurface->Value(UMax, VMin+(VMax-VMin)/2.0)).Transformed(T); +// } + +// //////////////////////////////////////////////////////////////////////////////////////////////////////////// +// // compute new partials +// gp_Vec v1(P1, P2), v2(P1, P5); +// gp_Vec v3 = v2 ^ v1 ; +// v3.Normalize(); +// gp_Dir D1(v3); +// Handle(Geom_Plane) Pl1 = new Geom_Plane(P1,D1); + +// gp_Vec v4(P3, P4), v5(P3, P6); +// gp_Vec v6 = v4 ^ v5; +// v6.Normalize(); +// gp_Dir D2(v6); +// Handle(Geom_Plane) Pl2 = new Geom_Plane(P3,D2); + +// TopoDS_Face glF1 = BRepBuilderAPI_MakeFace(Pl1->Pln()); +// TopoDS_Face glF2 = BRepBuilderAPI_MakeFace(Pl2->Pln()); + + //seqResultant->Append(glF1); + //seqResultant->Append(glF2); + + + + + + + + +/*** COMPUTE SAMPLE POINTS ***/ + +Handle(TColgp_HSequenceOfPnt) McCadCSGTool::SamplePoints(const TopoDS_Shape& theShape) { + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + Standard_Real MaxTol = 1.e-7; + TopoDS_Solid tmpSol; + + try{ // return if no solid + tmpSol = TopoDS::Solid(theShape); + } + catch(...){ + msgr->Message("McCadCSGTool::SamplePoints :: Error : input shape is not a solid\n", McCadMessenger_DefaultMsg); + return thePntSeq; + } + + BRepClass3d_SolidClassifier bsc3d (tmpSol); //Provides an algorithm to classify a point in a solid (IN/OUT/ON) + /////////////////////////////////////////////////////////////////////////////////////////// + Standard_Integer NbV; + TopTools_IndexedDataMapOfShapeListOfShape aMVE; + TopExp::MapShapesAndAncestors(tmpSol, TopAbs_VERTEX, TopAbs_EDGE, aMVE);//aMVE containes a map of all Vertices of tmpSol and appended + NbV = aMVE.Extent();//number of Vertices //to each a list of all edges that consist them + TopTools_ListOfShape aLEdge; + TopTools_MapOfShape aMEdge; + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = new TColgp_HSequenceOfPnt(); + + for (int k=1; k<=NbV; k++) // For all Vertices calculate sample points (1/10th along an edge) + { + const TopoDS_Vertex& aV = TopoDS::Vertex(aMVE.FindKey(k)); //current vertex: aV + gp_Pnt pv = BRep_Tool::Pnt(aV);//point coordinates of current vertex + + Standard_Real Tol = BRep_Tool::Tolerance(aV); + aLEdge = aMVE.FindFromKey(aV); + TopTools_ListIteratorOfListOfShape anIt(aLEdge); + + //For all edges that contain current vertex append non-degenerated edges to aMEdge + for(; anIt.More(); anIt.Next()) { + TopoDS_Shape aS = anIt.Value(); + aS.Orientation(TopAbs_FORWARD); + if(!BRep_Tool::Degenerated (TopoDS::Edge(aS))) //check if current edge is degenerated + aMEdge.Add(aS); //list of non-degenerated edges + } + + //For all non-degenerated edges calculate potential sample points + TopTools_MapIteratorOfMapOfShape it(aMEdge); + BRepAdaptor_Curve c; + for (; it.More(); it.Next()) { + const TopoDS_Edge& E = TopoDS::Edge(it.Key()); + c.Initialize(E); // create path along the current edge + Standard_Real f = (!(Precision::IsNegativeInfinite(c.FirstParameter()))) ? c.FirstParameter() : -1.0; + Standard_Real l = (!(Precision::IsPositiveInfinite(c.LastParameter()))) ? c.LastParameter() : 1.0; + gp_Pnt pf = c.Value(f);//starting point of edge + Standard_Real D = (l - f)/10; + if(D < MaxTol) + D = MaxTol*10; //MaxTol=1e-7, i.e. D > 1e-7 + + gp_Pnt pp; + if (fabs(pf.Distance(pv)) <= Tol ) + pp = c.Value(f+D); + else //should never occure since the position of the vertex and the paths starting point should be the same within the tolerance + pp = c.Value(l-D); + tmpPntSeq->Append(pp); + } + + // calulate barycenter + gp_XYZ xyz(0,0,0); + for (int j=1; j<=tmpPntSeq->Length(); j++) + xyz += (tmpPntSeq->Value(j)).XYZ(); + xyz /= tmpPntSeq->Length(); + gp_Pnt bary(xyz); + + // prepend the vertex + tmpPntSeq->Prepend(pv); + + //test if Bary is inside the Solid else perturb + bsc3d.Perform(bary,MaxTol); + if (bsc3d.State() == TopAbs_IN) { + tmpPntSeq->Append(bary); + } + else { + // perturbation coordinatewise + Handle(TColgp_HSequenceOfPnt) aPntSeq = new TColgp_HSequenceOfPnt; + for (int j=1; j<= tmpPntSeq->Length(); j++) { + gp_Pnt aPnt = tmpPntSeq->Value(j); + gp_Pnt aPref; + + if(j == 1) + aPref = bary; // we perturb the vertex relative to the bary center + else + aPref = pv; // the other coord. are perturbed relative to the vertex. + + //X-pertubation + Standard_Boolean done = Standard_False; + for ( int kx=-1; kx <=1; kx++) { + if(done) + break; + + gp_Pnt aPntx = aPnt; + Standard_Real dx = fabs(aPref.X() - aPntx.X())/2; + + if (dx <= MaxTol*1000) + dx= MaxTol*1000; + + Standard_Real rx = aPntx.Coord(1); + aPntx.SetCoord(1,rx+dx*kx); + bsc3d.Perform(aPntx,MaxTol*100); + + if (bsc3d.State() == TopAbs_IN) { + aPntSeq->Append(aPntx); + done = Standard_True; + break; + } + + //Y-pertubation + for ( int ky=-1; ky <=1; ky++) { + if(done) + break; + + gp_Pnt aPnty = aPntx; + Standard_Real dy = fabs(aPref.Y() - aPnty.Y())/2; + + if (dy <= MaxTol*1000) + dy= MaxTol*1000; + + Standard_Real ry = aPnty.Coord(2); + aPnty.SetCoord(2,ry+dy*ky); + bsc3d.Perform(aPnty,MaxTol*100); + if (bsc3d.State() == TopAbs_IN) { + aPntSeq->Append(aPnty); + done = Standard_True; + break; + } + + //Z-pertubation + for ( int kz=-1; kz <=1; kz++) { + gp_Pnt aPntz = aPnty; + Standard_Real dz = fabs(aPref.Z() - aPntz.Z())/2; + + if (dz <= MaxTol*1000) + dz= MaxTol*1000; + + Standard_Real rz = aPntz.Coord(3); + aPntz.SetCoord(3,rz+dz*kz); + bsc3d.Perform(aPntz,MaxTol*100); + + if (bsc3d.State() == TopAbs_IN) { + aPntSeq->Append(aPntz); + done = Standard_True; + break; + } + } + } + } + } + tmpPntSeq->Append(aPntSeq); + } + ////////////////////////////////////////////////////////////////////////////////////////////////////// + aMEdge.Clear(); + thePntSeq->Append(tmpPntSeq); + tmpPntSeq->Clear(); + } + /* TCollection_AsciiString message("number of sample points computed : "); + message += thePntSeq->Length(); + msgr->Message(message.ToCString()); */ + return thePntSeq; +} + + +Handle(TColgp_HSequenceOfPnt) McCadCSGTool::AllSamplePoints(const TopoDS_Shape& theShape) +{ + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + + thePntSeq->Append(SamplePoints(theShape)); + Standard_Integer MAXNUMPNT=5, MINNUMPNT=3; + + + for (TopExp_Explorer ex(theShape,TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aF = TopoDS::Face(ex.Current()); + thePntSeq->Append(FaceSamplePoints(aF,MAXNUMPNT, MINNUMPNT)); + + } + // filter redundant poits + for (int j=2; j<= thePntSeq->Length(); j++) + { + gp_XYZ p1 = (thePntSeq->Value(j)).XYZ(); + for (int jk=j-1; jk >= 1; jk--) + { + gp_XYZ p2 = (thePntSeq->Value(jk)).XYZ(); + if(p1.IsEqual(p2,1.e-03)) {thePntSeq->Remove(jk); j=jk;} + } + } + ////////////////////////////////////////////////////////////////////// + cout << "Number of All Sample Points:---------------------------------------------- " << thePntSeq->Length() << endl; + return thePntSeq; +} + + +Handle(TColgp_HSequenceOfPnt) McCadCSGTool::FaceSamplePoints(const TopoDS_Face& theFace,const Standard_Integer MAXNUMPNT,const Standard_Integer MINNUMPNT) +{ + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + + TopExp_Explorer ex; + BRepClass_FaceClassifier bsc3d; + BRepAdaptor_Curve2d c; + int vCount=0; + if (MAXNUMPNT <= 0 || MINNUMPNT <= 0 ) + { + cout << "Error Negative Number of Sample Points asked for: " << thePntSeq->Length() << endl; + return thePntSeq; + } + Standard_Real xmLen = 50, ymLen = 50; // this is the resolution 5 cm; + Standard_Real amLen = 3.14/(2*MAXNUMPNT); + BRepAdaptor_Surface BS(theFace,Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + for (TopExp_Explorer exV(theFace,TopAbs_VERTEX); exV.More(); exV.Next()) //count vertices + vCount++; + + + for (TopExp_Explorer ex(theFace,TopAbs_EDGE); ex.More(); ex.Next()) // For all edges, spread sample points along edges + { + c.Initialize(TopoDS::Edge(ex.Current()),theFace); + Standard_Real f = (!(Precision::IsNegativeInfinite(c.FirstParameter()))) ? c.FirstParameter() : -1.0; + Standard_Real l = (!(Precision::IsPositiveInfinite(c.LastParameter()))) ? c.LastParameter() : 1.0; + gp_Pnt2d pf = c.Value(f); + gp_Pnt2d pl = c.Value(l); + gp_Pnt p3f; + theASurface.D0(pf.X(),pf.Y(),p3f); + gp_Pnt p3l; + theASurface.D0(pl.X(),pl.Y(),p3l); + Standard_Real Len = p3f.Distance(p3l); + + // cout << "Len = " << Len << endl; + Standard_Integer NUMPNT; + + if(int(Len/xmLen) < MINNUMPNT) + NUMPNT = MINNUMPNT; + else if(int(Len/xmLen) > MAXNUMPNT) + NUMPNT = MAXNUMPNT; + else + NUMPNT = int(Len/xmLen); + + for(int t=0; t<=NUMPNT;t++) + { + Standard_Real a = Standard_Real(t)/Standard_Real(NUMPNT); + Standard_Real par = (1-a)*f + a*l; + gp_Pnt2d p2 = c.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + gp_Pnt p1; + theASurface.D0(U,V,p1); + bsc3d.Perform(theFace,p2,1.0e-07); + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON ) + { + thePntSeq->Append(p1); + } + + } + } + + ////////////////////////////////////////////////////////// + Standard_Real U1, U2, V1, V2; + BRepTools::UVBounds(theFace, U1, U2, V1, V2); + + if (theASurface.GetType() == GeomAbs_Cone ||theASurface.GetType() == GeomAbs_Cylinder) + { + xmLen = amLen; + } + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + xmLen = amLen; + ymLen = amLen; + } + + Standard_Real du=1, dv=1; + + Standard_Real XLen=U2-U1; + + Standard_Real YLen=V2-V1; + + Standard_Integer XNUMPNT; + if(int(XLen/xmLen) < MINNUMPNT) + XNUMPNT = MINNUMPNT; + else if(int(XLen/xmLen) > MAXNUMPNT) + XNUMPNT = MAXNUMPNT; + else + XNUMPNT = int(XLen/xmLen); + + Standard_Integer YNUMPNT; + + if(int(YLen/ymLen) < MINNUMPNT) + YNUMPNT = MINNUMPNT; + else if(int(YLen/ymLen) > MAXNUMPNT) + YNUMPNT = MAXNUMPNT; + else + YNUMPNT = int(YLen/ymLen); + + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = new TColgp_HSequenceOfPnt(); + Standard_Integer repeat = 0; + + do{ //spread Sample Points all over the Face + /*if(repeat > 0 && repeat <= 3) + cout << "*** Face Sample loop repeated ** " << endl;*/ + if (repeat > 3 ) + { + cout << "The model could be under-sampled !!! " << endl; + cout << "Number of sample points is : " << tmpPntSeq->Length() << endl; + break; + } + du = XLen/Standard_Real(XNUMPNT); + dv = YLen/Standard_Real(YNUMPNT); + // cout << "The deltas are : " << du << " " << dv << endl; + // cout << "The No of deltas are : " << XNUMPNT << " " << YNUMPNT << endl; + tmpPntSeq->Clear(); + + for (int j=0; j<=YNUMPNT; j++) + { + Standard_Real V = V1+dv*j; + + for (int i=0; i<=XNUMPNT; i++) + { + // cout << " J = " << j << " I = " << i << endl; + gp_Pnt p1; + Standard_Real U = U1+du*i; + theASurface.D0(U,V,p1); + gp_Pnt2d p2(U,V); + bsc3d.Perform(theFace,p2,1.0e-07); + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON ) + { + tmpPntSeq->Append(p1); + } + } + } + + XNUMPNT=XNUMPNT*2; + YNUMPNT=YNUMPNT*2; + repeat++; + }while(tmpPntSeq->Length() < MINNUMPNT*MINNUMPNT); + + thePntSeq->Append(tmpPntSeq); + ///////////////////////////////////////////////////////////////////////// + // filter redundant points + for (int j=2; j<= thePntSeq->Length(); j++) + { + gp_XYZ p1 = (thePntSeq->Value(j)).XYZ(); + for (int jk=j-1; jk >= 1; jk--) + { + gp_XYZ p2 = (thePntSeq->Value(jk)).XYZ(); + if(p1.IsEqual(p2,1.e-03)) + { + thePntSeq->Remove(jk); + j=jk; + } + } + } + ////////////////////////////////////////////////////////// +// cout << "Number of Face Sample Points: " << thePntSeq->Length() << endl; + return thePntSeq; + +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::DeleteRedLinFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) +{ + if (aFaceSeq->Length() > 1 ) + { + for(int i=2; i<= aFaceSeq->Length(); i++) + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(i)); + S = BRep_Tool::Surface(F,l); + GeomAdaptor_Surface AS(S); + + if(AS.GetType() != GeomAbs_Plane) + { + aFaceSeq->Remove(i); + i--; + continue; + } + + gp_Pln aPln = AS.Plane(); + + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + gp_Pnt loc = pos.Location (); + Standard_Real sA,sB,sC,sD; + aPln.Coefficients(sA,sB,sC,sD); + Standard_Real D1 = dir.X()* loc.X() + dir.Y()* loc.Y() + dir.Z()*loc.Z(); + + + for (int j=i-1; j >= 1; j--) + { + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(j)); + S = BRep_Tool::Surface(F,l); + GeomAdaptor_Surface AS2(S); + + if(AS2.GetType() != GeomAbs_Plane) + { + aFaceSeq->Remove(j); + continue; + } + + gp_Pln other = AS2.Plane(); + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + gp_Pnt otherLoc = otherPos.Location(); + + Standard_Real D2 = otherDir.X()* otherLoc.X() + otherDir.Y()* otherLoc.Y() + otherDir.Z()* otherLoc.Z(); + + if (dir.IsEqual(otherDir, 1.0e-03) && fabs(D1 - D2) < 1.0e-03) + { + aFaceSeq->Remove(j); + i=j; + } + } + } + return aFaceSeq; + } + else + return aFaceSeq; +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::DeleteRedCylFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) +{ + if (aFaceSeq->Length() > 1 ) + { + for(int i=2; i<= aFaceSeq->Length(); i++) + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(i)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS(S); + if(AS.GetType() != GeomAbs_Cylinder) + { + aFaceSeq->Remove(i); + i--; + continue; + } + gp_Cylinder C1 = AS.Cylinder(); + gp_Ax3 ax1 = C1.Position(); + gp_Dir dir1 = ax1.Direction(); + gp_Pnt loc1 = ax1.Location(); + Standard_Real rad1 = C1.Radius(); + + for (int j=i-1; j >= 1; j--) + { + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(j)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS2(S); + if(AS2.GetType() != GeomAbs_Cylinder) + { + aFaceSeq->Remove(j); + continue; + } + gp_Cylinder C2 = AS2.Cylinder(); + gp_Ax3 ax2 = C2.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_Pnt loc2 = (ax2.Location()).XYZ(); + Standard_Real rad2 = C2.Radius(); + // Standard_Real Precision = 1.e-05; + + if (dir1.IsEqual(dir2, 1.e-03) && + loc1.IsEqual(loc2,1.e-03) && + (fabs(rad1 - rad2 )<= 1.e-03) ) + { + aFaceSeq->Remove(j); + i=j; + } + } + } + return aFaceSeq; + } + else return aFaceSeq; + +} + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::DeleteRedConFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) +{ + if (aFaceSeq->Length() > 1 ) + { + for(int i=2; i<= aFaceSeq->Length(); i++) + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(i)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS(S); + if(AS.GetType() != GeomAbs_Cone) + { + aFaceSeq->Remove(i); + i--; + continue; + } + gp_Cone C1 = AS.Cone(); + gp_Ax3 ax1 = C1.Position(); + gp_Dir dir1 = ax1.Direction(); + gp_XYZ loc1 = (ax1.Location()).XYZ(); + Standard_Real rad1 = C1.RefRadius(); + Standard_Real ang1 = C1.SemiAngle(); + for (int j=i-1; j >= 1; j--) + { + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(j)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS2(S); + if(AS2.GetType() != GeomAbs_Cone) + { + aFaceSeq->Remove(j); + continue; + } + gp_Cone C2 = AS2.Cone(); + gp_Ax3 ax2 = C2.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real rad2 = C2.RefRadius(); + Standard_Real ang2 = C2.SemiAngle(); + Standard_Real Precision = 1.e-05; + + if((dir1.IsEqual(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) + && (fabs(rad1 -rad2 )<= Precision) && (fabs(ang1 - ang2)<= Precision)) + { + aFaceSeq->Remove(j); + i=j; + } + } + } + return aFaceSeq; + } + else return aFaceSeq; +} + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::DeleteRedSphFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) +{ + if (aFaceSeq->Length() > 1 ) + { + for(int i=2; i<= aFaceSeq->Length(); i++) + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(i)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS(S); + if(AS.GetType() != GeomAbs_Sphere) + { + aFaceSeq->Remove(i); + i--; + continue; + } + gp_Sphere C1 = AS.Sphere(); + gp_Ax3 ax1 = C1.Position(); + gp_Dir dir1 = ax1.Direction(); + gp_XYZ loc1 = (ax1.Location()).XYZ(); + Standard_Real rad1 = C1.Radius(); + + for (int j=i-1; j >= 1; j--) + { + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(j)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS2(S); + if(AS2.GetType() != GeomAbs_Sphere) + { + aFaceSeq->Remove(j); + continue; + } + gp_Sphere C2 = AS2.Sphere(); + gp_Ax3 ax2 = C2.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real rad2 = C2.Radius(); + Standard_Real Precision = 1.e-05; + + if((dir1.IsEqual(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) && (fabs(rad1 -rad2 )<= Precision) ) + { + aFaceSeq->Remove(j); + i=j; + } + } + } + return aFaceSeq; + } + else return aFaceSeq; + +} + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::DeleteRedTorFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) +{ + if (aFaceSeq->Length() > 1 ) + { + for(int i=2; i<= aFaceSeq->Length(); i++) + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(i)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS(S); + if(AS.GetType() != GeomAbs_Torus) + { + aFaceSeq->Remove(i); + i--; + continue; + } + gp_Torus C1 = AS.Torus(); + gp_Ax3 ax1 = C1.Position(); + gp_Dir dir1 = ax1.Direction(); + gp_XYZ loc1 = (ax1.Location()).XYZ(); + Standard_Real arad1 = C1.MajorRadius(); + Standard_Real irad1 = C1.MinorRadius(); + + for (int j=i-1; j >= 1; j--) + { + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(j)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS2(S); + if(AS2.GetType() != GeomAbs_Torus) + { + aFaceSeq->Remove(j); + continue; + } + gp_Torus C2 = AS2.Torus(); + gp_Ax3 ax2 = C2.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real arad2 = C2.MajorRadius(); + Standard_Real irad2 = C2.MinorRadius(); + Standard_Real Precision = 1.e-05; + + if((dir1.IsEqual(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) && + (fabs(arad1 -arad2 )<= Precision) && (fabs(irad1 -irad2 )<= Precision) ) + { + aFaceSeq->Remove(j); + i=j; + } + } + } + return aFaceSeq; + } + else return aFaceSeq; + +} + +Handle(TopTools_HSequenceOfShape) McCadCSGTool::DeleteRedSORFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) +{ + if (aFaceSeq->Length() > 1 ) + { + for(int i=2; i<= aFaceSeq->Length(); i++) + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(i)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS(S); + gp_Torus C1 = AS.Torus(); + gp_Ax3 ax1 = C1.Position(); + gp_Dir dir1 = ax1.Direction(); + gp_XYZ loc1 = (ax1.Location()).XYZ(); + Standard_Real arad1 = C1.MajorRadius(); + Standard_Real irad1 = C1.MinorRadius(); + + for (int j=i-1; j >= 1; j--) + { + TopoDS_Face F = TopoDS::Face(aFaceSeq->Value(j)); + S = BRep_Tool::Surface(F); + GeomAdaptor_Surface AS2(S); + gp_Torus C2 = AS2.Torus(); + gp_Ax3 ax2 = C2.Position(); + gp_Dir dir2 = ax2.Direction(); + gp_XYZ loc2 = (ax2.Location()).XYZ(); + Standard_Real arad2 = C2.MajorRadius(); + Standard_Real irad2 = C2.MinorRadius(); + Standard_Real Precision = 1.e-05; + + if((dir1.IsEqual(dir2,1.e-03)) && (loc1.IsEqual(loc2,1.e-03)) && + (fabs(arad1 -arad2 )<= Precision) && (fabs(irad1 -irad2 )<= Precision) ) + { + aFaceSeq->Remove(j); + i=j; + } + } + } + return aFaceSeq; + } + else + return aFaceSeq; + +} + +/* +TopoDS_Solid McCadCSGTool::LinSolid(const TopoDS_Solid& aSolid) +{ + // this code has a major problem not specificaly known. + // classfication of infinity fails, resulting solid not always valid!!! + // don't use it at the moment. + TopoDS_Solid theSolid = aSolid; + cout << " Linearizing small faces of the solid! "<< endl; + cout << " ===================================== "<< endl; + int icorr=0; + int fc = 0; + for (TopExp_Explorer ex(theSolid, TopAbs_FACE); ex.More(); ex.Next()) { + fc++; + } + cout << " Total number of Face = "<< fc << endl; + fc=0; + for (TopExp_Explorer ex(theSolid, TopAbs_FACE); ex.More(); ex.Next()) + { + fc++; + cout << " Processing FaceBox number : "<< fc << endl; + TopoDS_Face theFace = TopoDS::Face(ex.Current()); + + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + if (theASurface.GetType() == GeomAbs_Plane) + continue; + if (theASurface.GetType() != GeomAbs_Cone && theASurface.GetType() + != GeomAbs_Cylinder &&theASurface.GetType() != GeomAbs_Sphere + && theASurface.GetType() != GeomAbs_Torus) { + cout << "Can not treat non analytic surface "<< endl; + return theSolid; + } + Standard_Real area = AreaOfShape(theFace); + cout << "area fo face = "<< area << endl; + if (area >= 50000) + continue; + cout << " .......... Processing FaceBox number : "<< fc << endl; + + //////////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////// + TopTools_IndexedDataMapOfShapeListOfShape allMEF; + TopExp::MapShapesAndAncestors(theSolid, TopAbs_EDGE, TopAbs_FACE, + allMEF); + TopTools_ListOfShape allLFace; + //Standard_Boolean onlyLin=Standard_True; + //////////////////////////////////////////////////////////////////////////////////// + TopLoc_Location loc; + Handle(Geom_Surface) aS = BRep_Tool::Surface(theFace,loc); + // Handle(Geom_ElementarySurface) aEs = Handle_Geom_ElementarySurface::DownCast(aS); + + //int ivc = 0; + + gp_Vec Nvec(0,0,0), Lvec(0,0,0); + Standard_Real U1, U2, V1, V2; + //Standard_Real Prec = gp::Resolution(); + BRepTools::UVBounds(theFace, U1, U2, V1, V2); + if( U2 - U1 > .25*PI ) continue; // here we have a surface > 1/4 perimeter, we let it live. + // cout << "U1 = " << U1 << " U2 = " << U2 << " V1 = " << V1 << " V2 = " << V2 << endl; + gp_Pnt p1,p2,p3,p4; + theASurface.D0(U1,V1,p1); + theASurface.D0(U1,V2,p2); + theASurface.D0(U2,V1,p3); + theASurface.D0(U2,V2,p4); + /////////////////////////////////////////////////////// + gp_Pnt pu,po; + theASurface.D0((U1+U2)/2,V1,pu); + theASurface.D0((U1+U2)/2,V2,po); + /////////////////////////////////////////////////////// + // compute extremal to derermine the shift. + gp_Pnt pex; + + theASurface.D0((U1+U2)/2,(V1+V2)/2,pex); + gp_Vec v1(p1, p2), v2(p1, p3),v4(p1, p4); + gp_Vec v3 = v1 ^ v2; + gp_Vec v5 = v1 ^ v4; + v3.Normalize();v5.Normalize(); + gp_Dir D1(v3); + gp_Dir D2(v5); + gp_Pln aPln1(p1,D1),aPln2(p1,D2); + + Standard_Real exD1 = aPln1.Distance(pex); + Standard_Real exD2 = aPln2.Distance(pex); + Standard_Real exD; + if (exD1 > exD2) exD = 2*exD1; + else exD = 2*exD2; + cout << "Extrem Distance = " << exD << endl; + if (exD < 1.) exD = 1.0; + ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////// + Standard_Integer NbV; + TopTools_IndexedDataMapOfShapeListOfShape aMVE; + TopExp::MapShapesAndAncestors(theFace, TopAbs_VERTEX, TopAbs_EDGE, aMVE); + NbV = aMVE.Extent(); + TopTools_ListOfShape aLEdge; + TopTools_MapOfShape aMEdge; + /////////////////////////////////////////////////////////////////////////////////// + Handle(TopTools_HSequenceOfShape) aVSeq = new TopTools_HSequenceOfShape; + cout << " Nb of V = " << NbV << endl; + for (int k=1; k<=NbV; k++) + { + TopoDS_Vertex aV=TopoDS::Vertex(aMVE.FindKey(k)); + if (aMEdge.Add(aV)) + { + aVSeq->Append(aV); + aLEdge = aMVE.FindFromKey(aV); + TopTools_ListIteratorOfListOfShape anIt(aLEdge); + // Standard_Boolean reject = Standard_False; + int itt=0; + for(; anIt.More(); anIt.Next()) + { + itt++; + TopoDS_Shape aS=anIt.Value(); + aS.Orientation(TopAbs_FORWARD); + for (TopExp_Explorer exd(aS,TopAbs_VERTEX); exd.More(); exd.Next()) + { + if (!aMEdge.Add(exd.Current())); + else + { + aVSeq->Append(exd.Current()); + } + } + } + } + } + + cout << "Number of a Vertex is : " << aVSeq->Length() << endl; + /////////////////////////////////////////////////////////////////////////////////// + // for (Standard_Integer ji=1; ji<= aVSeq->Length(); ji++) + // { + // PrintPnt(BRep_Tool::Pnt(TopoDS::Vertex(aVSeq->Value(ji)))); + // } + /////////////////////////////////////////////////////////////////////////////////// + + Handle(TopTools_HSequenceOfShape) aWSeq = new TopTools_HSequenceOfShape; + Handle(TopTools_HSequenceOfShape) aESeq = new TopTools_HSequenceOfShape; + + if(aVSeq->Length() < 3 || aVSeq->Length() > 4 ) continue; + if(aVSeq->Length() == 3 || aVSeq->Length() == 4 ) + { + TopoDS_Wire w1 = BRepBuilderAPI_MakePolygon(TopoDS::Vertex(aVSeq->Value(1)), + TopoDS::Vertex(aVSeq->Value(2)), + TopoDS::Vertex(aVSeq->Value(3)),Standard_True).Wire(); + if(w1.Checked()) cout << "w1 Checked ................." << endl; + if(w1.Closed())cout << "w1 Closed ................." << endl; + if(w1.Orientable()) cout << "w1 Orientable ................." << endl; + w1.Orientation(TopAbs_FORWARD); + aWSeq->Append(w1); + } + if( aVSeq->Length() == 4 ) + { + TopoDS_Wire w2 = BRepBuilderAPI_MakePolygon(TopoDS::Vertex(aVSeq->Value(2)), + TopoDS::Vertex(aVSeq->Value(3)), + TopoDS::Vertex(aVSeq->Value(4)),Standard_True).Wire(); + if(w2.Checked()) cout << "w2 Checked ................." << endl; + if(w2.Closed())cout << "w2 Closed ................." << endl; + if(w2.Orientable()) cout << "w2 Orientable ................." << endl; + w2.Orientation(TopAbs_FORWARD); + aWSeq->Append(w2); + } + + aVSeq->Clear(); + /////////////////////////////////////////////////////////////////////////////////// + BRepAdaptor_Curve c; + Handle(TopTools_HSequenceOfShape) aFaceSeq = new TopTools_HSequenceOfShape; + + TopTools_MapOfShape aMapFace; + TopTools_MapOfShape exMapFace; + /////////////////////////////////////////////////////////////////////////////// + for (TopExp_Explorer exw(theSolid,TopAbs_FACE); exw.More(); exw.Next()) + aMapFace.Add(TopoDS::Face(exw.Current())); + cout << "beging Number of Faces in the map : " << aMapFace.Extent() << endl; + //////////////////////////////////////////////////////////////////////////////// + int ied = 0; + Standard_Boolean replaceFailed = Standard_False; + for (TopExp_Explorer exd(theFace,TopAbs_EDGE); exd.More(); exd.Next()) + { + + replaceFailed = Standard_False; + aVSeq->Clear(); + TopoDS_Edge E = TopoDS::Edge(exd.Current()); + for (TopExp_Explorer exv(E,TopAbs_VERTEX); exv.More(); exv.Next()) aVSeq->Append(exv.Current()); + c.Initialize(E); + if (c.GetType() == GeomAbs_Line) {cout << "GeomAbs_Line" << endl; continue;} + if (c.GetType() == GeomAbs_Circle) cout << "GeomAbs_Circle" << endl; + if (c.GetType() == GeomAbs_Ellipse) cout << "GeomAbs_Ellipse" << endl; + if (c.GetType() == GeomAbs_Hyperbola) cout << "GeomAbs_Hyperbola" << endl; + if (c.GetType() == GeomAbs_Parabola) cout << "GeomAbs_Parabola" << endl; + if (c.GetType() == GeomAbs_BezierCurve) cout << "GeomAbs_Bezier" << endl; + if (c.GetType() == GeomAbs_BSplineCurve) cout << "GeomAbs_BSpline" << endl; + if (c.GetType() == GeomAbs_OtherCurve) cout << "GeomAbs_Other" << endl; + + Standard_Real f = (!(Precision::IsNegativeInfinite(c.FirstParameter()))) ? c.FirstParameter() : -1.0; + Standard_Real l = (!(Precision::IsPositiveInfinite(c.LastParameter()))) ? c.LastParameter() : 1.0; + + gp_Pnt pf = c.Value(f); + gp_Pnt pl = c.Value(l); + gp_Pnt pm = c.Value((l-f)/2); + gp_Vec ccv1(pf, pl), ccv2(pm, pl); + if (ccv1.IsParallel(ccv2,1.e-5)) + { + continue; + } + ied++; + cout << ied << " start ================================================================= " << ied << endl; + // TopoDS_Edge lE = BRepBuilderAPI_MakeEdge(pf,pl).Edge(); + /////////////////////////////////////////////////////// + Standard_Integer NbeE; + TopTools_IndexedDataMapOfShapeListOfShape aMEF; + TopExp::MapShapesAndAncestors(theSolid,TopAbs_EDGE,TopAbs_FACE, aMEF); + NbeE = aMEF.Extent(); + TopTools_ListOfShape aLFace; + + TopTools_MapOfShape exMapEdge; + /////////////////////////////////////////////////////////////////////////////////// + // cout << " Nb of F = " << NbeE << endl; + for (int k=1; k<=NbeE; k++) + { + TopoDS_Edge aFE =TopoDS::Edge(aMEF.FindKey(k)); + TopoDS_Edge tmpE = aFE; + tmpE.Orientation(E.Orientation()); + if(!exMapEdge.Add(aFE)) {continue;} + + // if(aFE.Orientation() != E.Orientation() && E == tmpE) + if(E == tmpE) + { + + cout << ied << " Edge is Found!!!! " << endl; + aLFace = aMEF.FindFromKey(aMEF.FindKey(k)); + TopTools_ListIteratorOfListOfShape anIt(aLFace); + for(; anIt.More(); anIt.Next()) + { + TopoDS_Face hF= TopoDS::Face(anIt.Value()); + if(hF!=theFace) + { + BRepAdaptor_Surface BAS(hF,Standard_True); + GeomAdaptor_Surface aaS = BAS.Surface(); + if (aaS.GetType() == GeomAbs_Plane) + { + exMapFace.Add(hF); + cout << "Linear Face is Found!!!! " << endl; + TopLoc_Location lo; + Handle (Geom_Surface) aSur = BRep_Tool::Surface(hF,lo); + TopoDS_Wire wo; + + int iwc = 0; + for (TopExp_Explorer exw(hF,TopAbs_WIRE); exw.More(); exw.Next()) + { + iwc++; + wo = TopoDS::Wire(exw.Current()); + } + if(iwc > 1) + { + replaceFailed = Standard_True; + cout << " >>>>>>>> ReplaceFailed Number of wires is : " << iwc << endl; + break; + } + TopoDS_Wire wh; + // wh = TopoDS::Wire(wo.EmptyCopied()); + + BRepBuilderAPI_MakeWire BWh(wh); + + ///////////////////////////////////////////////////////// + for (TopExp_Explorer exh(hF,TopAbs_EDGE); exh.More(); exh.Next()) + { + TopoDS_Edge hE = TopoDS::Edge(exh.Current()); + hE.Orientation(E.Orientation()); + TopoDS_Vertex VF,VL; + for (TopExp_Explorer exv(TopoDS::Edge(exh.Current()),TopAbs_VERTEX); + exv.More(); exv.Next()) + { + + TopAbs_Orientation vto = exv.Current().Orientation(); + if (vto == TopAbs_FORWARD) { + VF = TopoDS::Vertex(exv.Current()); + } + else if (vto == TopAbs_REVERSED) { + VL = TopoDS::Vertex(exv.Current()); + } + else cout << " Unknown Vertex Orientation !! " << endl; + } + if (hE == E) + { + cout << "Local Edge is Found!!!! " << endl; + cout << " Making New Edge ............................ " << endl; + gp_Pnt P1 = BRep_Tool::Pnt(VF); + gp_Pnt P2 = BRep_Tool::Pnt(VL); + Standard_Real l = P1.Distance(P2); + if (l <= gp::Resolution()) + { + replaceFailed = Standard_True; + cout << " Making New Edge Failed: Same Points ..... " << endl; + break; + } + else + { + TopoDS_Edge tE= BRepBuilderAPI_MakeEdge(VF,VL).Edge(); + BWh.Add(tE); + } + cout << " New Edge Added " << endl; + } + else + { + TopoDS_Edge ahE = TopoDS::Edge(exh.Current()); + BWh.Add(ahE); + } + } + + wh = BWh.Wire(); + wh.Orientation(wo.Orientation()); + ////////////////////////////////////////////////////////////////////////////////// + cout << "============ face begin ===========" << endl; + // TopoDS_Shape S = hF.EmptyCopied(); + // S.Orientation (TopAbs_FORWARD ); + BRep_Builder BF; + // BF.Add(S,wh); + TopoDS_Face anF = BRepBuilderAPI_MakeFace(aSur,wh).Face(); + // TopoDS_Face anF = TopoDS::Face(S); + anF.Orientation(hF.Orientation()); + BF.UpdateFace(anF,BRep_Tool::Tolerance(hF)); + cout << "============ face end ===========" << endl; + ////////////////////////////////////////////////////////////////////////////// + BRepCheck_Analyzer BA(wh,Standard_True); + BA.Init(wh,Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(wh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + cout << "============ Wire ===========" << endl; + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + BRepCheck::Print(iter.Value(),cout); + } + cout << "===================================" << endl; + if(BA.IsValid()) + { + cout << "Wire BRepCheck_Analyzer done !!" << endl; + } + else + { + replaceFailed = Standard_True; + cout << "Wire BRepCheck_Analyzer failed !!" << endl; + break; + } + ////////////////////////////////////////////////////////////////////////////////// + BA.Init(anF,Standard_False); + RES = BA.Result(anF); + StatusList = RES->Status(); + cout << "============ Face ===========" << endl; + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + BRepCheck::Print(iter.Value(),cout); + // if(iter.Value() !=BRepCheck_NoError) + // theShapeSequence->Append(wo); + } + cout << "===================================" << endl; + if(BA.IsValid()) + { + + cout << "FACE BRepCheck_Analyzer done !!" << endl; + } + else + { + replaceFailed = Standard_True; + cout << "FACE BRepCheck_Analyzer failed !!" << endl; + break; + } + //////////////////////////////////////////////////////////////////////////////////// + aMapFace.Add(anF); + // theShapeSequence->Append(wh); + // if(ied==1 ) + // theShapeSequence->Append(anF); + /////////////////////////////////////////////////////////////////// + } + else + { + /// non planar case + cout << "Non Linear Face is Found!!!! " << endl; + ///////////////////////////////////////////////////////////////////// + TopoDS_Wire wo; + int iwc = 0; + for (TopExp_Explorer exw(theFace,TopAbs_WIRE); exw.More(); exw.Next()) + { + iwc++; + wo = TopoDS::Wire(exw.Current()); + } + if(iwc > 1) + { + replaceFailed = Standard_True; + cout << " >>>>>>>> ReplaceFailed Number of wires is : " << iwc << endl; + break; + } + ///////////////////////////////////////////////////////////////////// + TopoDS_Wire wh; + BRepBuilderAPI_MakeWire BWh(wh); + + ///////////////////////////////////////////////////////// + + TopoDS_Vertex VF,VL; + for (TopExp_Explorer exv(E,TopAbs_VERTEX); + exv.More(); exv.Next()) + { + + TopAbs_Orientation vto = exv.Current().Orientation(); + if (vto == TopAbs_FORWARD) { + VF = TopoDS::Vertex(exv.Current()); + } + else if (vto == TopAbs_REVERSED) { + VL = TopoDS::Vertex(exv.Current()); + } + else cout << " Unknown Vertex Orientation !! " << endl; + } + cout << "Local Edge is Found!!!! " << endl; + cout << " Making New Edge ............................ " << endl; + gp_Pnt P1 = BRep_Tool::Pnt(VF); + gp_Pnt P2 = BRep_Tool::Pnt(VL); + Standard_Real l = P1.Distance(P2); + if (l <= gp::Resolution()) + { + replaceFailed = Standard_True; + cout << " Making New Edge Failed: Same Points ..... " << endl; + break; + } + else + { + TopoDS_Edge tE= BRepBuilderAPI_MakeEdge(VL,VF).Edge(); + tE.Orientation(E.Orientation()); + BWh.Add(tE); + } + cout << " New Edge Added " << endl; + BWh.Add(E); + wh = BWh.Wire(); + // wh.Orientation(wo.Orientation()); + if (wh.Orientation() == TopAbs_FORWARD) { + cout << " TopAbs_FORWARD Wire Orientation !! " << endl; + } + else if (wh.Orientation() == TopAbs_REVERSED) { + cout << " TopAbs_REVERSED Wire Orientation !! " << endl; + } + else cout << " Unknown Wire Orientation !! " << endl; + ////////////////////////////////////////////////////////////////////////////////// + cout << "============ face begin ===========" << endl; + BRep_Builder BF; + TopoDS_Face anF = BRepBuilderAPI_MakeFace(wh).Face(); + if(anF.IsNull()) + { + replaceFailed = Standard_True; + cout << " Making New Edge Failed: Space Curve ..... " << endl; + break; + } + + // anF.Orientation(wo.Orientation()); + //////////////////////////////////////////////////////////////// + BRepAdaptor_Surface lBAS(anF,Standard_True); + gp_Pln aPln = lBAS.Plane(); + gp_Ax3 pos = aPln.Position(); + const gp_Pnt& loc = pos.Location (); + const gp_Dir& dir = pos.Direction(); + Standard_Real D = (dir.X() * (pex.X() - loc.X()) + + dir.Y() * (pex.Y() - loc.Y()) + + dir.Z() * (pex.Z() - loc.Z())); + if (D < 0) + anF.Orientation(TopAbs_FORWARD); + else if (D>0) + anF.Orientation(TopAbs_REVERSED); + else + { + replaceFailed = Standard_True; + cout << " Orientation Value : " << D << endl; + cout << " Unknown Orientation !!" << endl; + break; + + } + ///////////////////////////////////////////////////////////////// + BF.UpdateFace(anF,BRep_Tool::Tolerance(hF)); + cout << "============ face end ===========" << endl; + ////////////////////////////////////////////////////////////////////////////// + BRepCheck_Analyzer BA(wh,Standard_True); + BA.Init(wh,Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(wh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + cout << "============ Wire ===========" << endl; + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + BRepCheck::Print(iter.Value(),cout); + } + cout << "===================================" << endl; + if(BA.IsValid()) + { + cout << "Wire BRepCheck_Analyzer done !!" << endl; + } + else + { + replaceFailed = Standard_True; + cout << "Wire BRepCheck_Analyzer failed !!" << endl; + break; + } + ////////////////////////////////////////////////////////////////////////////////// + BA.Init(anF,Standard_False); + RES = BA.Result(anF); + StatusList = RES->Status(); + cout << "============ Face ===========" << endl; + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + BRepCheck::Print(iter.Value(),cout); + } + cout << "===================================" << endl; + if(BA.IsValid()) + { + + cout << "FACE BRepCheck_Analyzer done !!" << endl; + } + else + { + replaceFailed = Standard_True; + cout << "FACE BRepCheck_Analyzer failed !!" << endl; + break; + } + //////////////////////////////////////////////////////////////////////////////////// + aMapFace.Add(anF); + aMapFace.Add(hF); + // theShapeSequence->Append(anF); + // theShapeSequence->Append(hF); + /////////////////////////////////////////////////////////////////// + } + } + + if(replaceFailed) break; + } + } + if(replaceFailed) break; + } + cout << ied << " end ================================================================= " << ied << endl; + if(replaceFailed) break; + } + if(replaceFailed) + { + cout << "Replacement of Faces : " << --fc << " failed!!" << endl; + continue; + } + + cout << "before removing Number of Faces : " << aMapFace.Extent() << endl; + aMapFace.Remove(theFace); + ////////////////////////////////////////////////////////////////////// + TopTools_MapIteratorOfMapOfShape anItw(exMapFace); + for(; anItw.More(); anItw.Next()) + { + if(aMapFace.Remove(anItw.Key())) + cout << "Removing a faces........ " << endl; + } + ////////////////////////////////////////////////////////////////////// + + cout << "after removing Number of Faces : " << aMapFace.Extent() << endl; + // theShapeSequence->Append( theFace); + /////////////////////////////////////////////////////////////////////////////////// + cout << "Number of wires is : " << aWSeq->Length() << endl; + //////////////////////////////////////////////////////////////////////////////////// + TopAbs_Orientation orientOftheFace = TopAbs_FORWARD; + for (TopExp_Explorer exw(theFace,TopAbs_WIRE); exw.More(); exw.Next()) + orientOftheFace = exw.Current().Orientation(); + + for(int j=1; j<= aWSeq->Length(); j++) + { + TopoDS_Wire aW = TopoDS::Wire(aWSeq->Value(j)); + TopoDS_Face aF = BRepBuilderAPI_MakeFace(aW,Standard_False).Face(); + if(aF.IsNull()) cout << "Null Face " << endl; + BRep_Builder BF; + BF.UpdateFace(aF, BRep_Tool::Tolerance(theFace)); + aF.Orientation(orientOftheFace); + aMapFace.Add(aF); + } + ///////////////////////////////////////////////////////////////// + cout << " Total number of Face = " << aMapFace.Extent() << endl; + ////////////////////////////////////////////////////////////////// + Standard_Real stol = 1.e-6; + Redo: + BRepBuilderAPI_Sewing Sew(stol); + Sew.SetMinTolerance(1.e-3); + Sew.SetLocalTolerancesMode(Standard_True); + TopoDS_Shell shell; + Sew.Load(shell); + TopoDS_Solid solid; + + if (aMapFace.Extent() > 0 ) + { + TopTools_MapIteratorOfMapOfShape anIt(aMapFace); + for(; anIt.More(); anIt.Next()) + { + TopoDS_Face tmpFace = TopoDS::Face(anIt.Key()); + Sew.Add(tmpFace); + // cout << "Sew faces........ " << endl; + } + } + else {cout << "Warning: No faces available!!! " << endl; continue;} + Sew.Perform(); + if (Sew.NbFreeEdges() > 0 ) + { + if (stol < 1e-3) + { + stol = stol*10; + cout << "Sewing tolerance corrrection : " << stol << endl; + goto Redo; + } + else + { + cout << "Face replace failed due to Sew error!!" << endl; + continue; + } + } + Sew.Dump(); + BRep_Builder B; + B.MakeSolid(solid); + Standard_Boolean failedShell = Standard_False; + TopoDS_Shape sShape = Sew.SewedShape(); + // cout << "............ " ; + // TopAbs::Print(sShape.ShapeType(),cout);cout << " ................." << endl; + for(TopExp_Explorer exw(sShape,TopAbs_SHELL); exw.More(); exw.Next()) + { + TopoDS_Shell sh = TopoDS::Shell(exw.Current()); + cout << "................... Add Shell ........ " << endl; + BRepCheck_Analyzer BA(sh,Standard_True); + BA.Init(sh,Standard_True); + Handle(BRepCheck_Result) RES = BA.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + BRepCheck::Print(iter.Value(),cout); + + } + if(BA.IsValid()) + { + cout << "Shell BRepCheck_Analyzer done !!" << endl; + B.Add(solid,sh); + } + else + { + cout << "Shell BRepCheck_Analyzer failed !!" << endl; + failedShell = Standard_True; + } + + } + if(failedShell) + { + cout << "Shell building failed no repair is performed ............ "; + continue; + } + if(solid.IsNull()) cout << " Null Solid failed ............ "; + else cout << " Non Null Solid ............ "; + cout << "............ "; + TopAbs::Print(solid.ShapeType(),cout);cout << " ................." << endl; + /////////////////////////////////////////////////////////////////////////// + try + { + BRepClass3d_SolidClassifier bsc3d(solid); + // Standard_Real t = Precision::Confusion(); + bsc3d.PerformInfinitePoint(stol); + if (bsc3d.State() == TopAbs_IN) + { + cout << ">>>>>>>>>>>>>>>>>>>>>>> Infinity in Solid !! <<<<<<<<<<<<<<<<<<<<<< " << endl; + } + else + { + icorr++; + theSolid = solid; + cout << "Solid build up finished! " << endl; + + } + } + + catch(Standard_Failure) { + cout << "Warning: SolidFromShell: Exception: " << endl; + } + } + cout << " Total number of corrected faces is : "<< icorr << endl; + cout << "Lin ends here ++++++++++++++++++++++++++++++++++++++++++++++++++" + << endl; + cout << endl; + return theSolid; +} +*/ diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_CellBuilder.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_CellBuilder.cxx new file mode 100644 index 0000000..fa11f7d --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_CellBuilder.cxx @@ -0,0 +1,923 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +#include +#include +// #include + +McCadCSGTool_CellBuilder::McCadCSGTool_CellBuilder() +{ + Init(); +} + + +McCadCSGTool_CellBuilder::McCadCSGTool_CellBuilder(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq) +{ + Init(); + Init(theExtSolidSeq); +} + + +McCadCSGTool_CellBuilder::McCadCSGTool_CellBuilder(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq, const Standard_Integer theMatNumber) +{ + Init(); + myMatNumber = theMatNumber; + myIsVoid = Standard_False; + Init(theExtSolidSeq); +} + +McCadCSGTool_CellBuilder::McCadCSGTool_CellBuilder(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq, const Standard_Integer theMatNumber, const Standard_Real theDensity) +{ + Init(); + myMatNumber = theMatNumber; + myDensity = theDensity; + myIsVoid = Standard_False; + myMakeOuterVoid = Standard_False; + + Init(theExtSolidSeq); +} + + +void McCadCSGTool_CellBuilder::SetMatNumber(const Standard_Integer theMatNumber) +{ + myMatNumber = theMatNumber; + myIsVoid = Standard_False; +} + + +void McCadCSGTool_CellBuilder::MakeOuterVoid(Standard_Boolean state) +{ + myMakeOuterVoid = state; +} + + +void McCadCSGTool_CellBuilder::SetDensity(const Standard_Real theDensity) +{ + myDensity = theDensity; + myIsVoid = Standard_False; +} + +void McCadCSGTool_CellBuilder::Init() +{ + myUnits = McCadCSGGeom_CM; + myMatNumber = 0; + myDensity = 0.0; + myIsVoid = Standard_True; +} + +void McCadCSGTool_CellBuilder::Init(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq) +{ + NotDone(); + myExtSolidSeq = theExtSolidSeq; + + myCell = new McCadCSGGeom_Cell(0, myMatNumber, myDensity); + + if(myIsVoid) + myCell->SetVoid(Standard_True); + if(myMakeOuterVoid) + myCell->SetOuterVoid(Standard_True); + else + myCell->SetOuterVoid(Standard_False); + + myCell->SetTrsfCounter(0); + myCell->SetSurfCounter(0); + + McCadCSGGeom_DataMapOfIntegerSurface surfMap; + TCollection_AsciiString theComment; + Handle(TColStd_HSequenceOfAsciiString) aCSG = new TColStd_HSequenceOfAsciiString(); //aCSG, describes geometry of one cell + + if(myExtSolidSeq->Length() == 0) + { + Done(); + return; + } + + Standard_Real cellVolume(0.0); + + if(myExtSolidSeq->Length() > 1) // for outer void + aCSG->Append(" ("); + + for (Standard_Integer i=1; i<= myExtSolidSeq->Length(); i++)//For all extended solids ... + { + if(myExtSolidSeq->Length() > 1 || myMakeOuterVoid) + aCSG->Append("("); + Handle(McCadTDS_ExtSolid) anExtSol = myExtSolidSeq->Value(i); + + + theComment = anExtSol->GetComment(); + TopoDS_Solid aSol = anExtSol->GetSolid(); + + // calculate volume and add to cellVolume + GProp_GProps GP; + BRepGProp::VolumeProperties(aSol, GP); + cellVolume += GP.Mass(); + + Handle(TopTools_HSequenceOfShape) theFaceSeq = new TopTools_HSequenceOfShape; + + for (TopExp_Explorer ex(aSol,TopAbs_FACE); ex.More(); ex.Next()) //append all faces of current solid to theFaceSeq + theFaceSeq->Append(ex.Current()); + + if(anExtSol->HaveExt()) + { + theFaceSeq->Append(anExtSol->GetFaces()); + } + //cout << "Number of faces including extensions = " << theFaceSeq->Length() << endl; + ///////////////////////////////////////////////////////////////////////////// + // + for (int j = 1; j<= theFaceSeq->Length(); j++)//For all faces of current solid put planes in right orientation + { + TopLoc_Location l; + TopoDS_Face F = TopoDS::Face(theFaceSeq->Value(j)); + TopAbs_Orientation orient = F.Orientation(); + Handle(Geom_Surface) S = BRep_Tool::Surface(F, l); + + GeomAdaptor_Surface AS(S); + if (AS.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = AS.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction(); + + /////////////////////////////// //////////////////////// + Standard_Real A(0.0),B(0.0),C(0.0),D(0.0); + if (locAxis.Direct()) // right handed coordinate system + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else // left handed coordinate system - correction neccessary + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + // using 10^-7 instead of 0, because a value like -10^-18 wich is effectivly 0 + // would be interpreted as a negative non-zero value + const double negZero(-1.e-7); + if ( (D > 0 && (locDir.X() < negZero || locDir.Y() < negZero || locDir.Z() < negZero )) || + (locDir.X() <= 0. && locDir.Y() <= 0. && locDir.Z() <= 0. ) ) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + gp_Pln glPl(glAxis); + TopoDS_Face glF = BRepBuilderAPI_MakeFace(glPl); + + if(orient == TopAbs_FORWARD) + glF.Orientation(TopAbs_REVERSED); + if(orient == TopAbs_REVERSED) + glF.Orientation(TopAbs_FORWARD); + + theFaceSeq->SetValue(j,glF); + } + } + } + + //////////////////////////////////////////////////////////////////////////// + // here we delete redundant faces first + Handle(TopTools_HSequenceOfShape) LPlan = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LCyl = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LCon = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LSphere = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LTor = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LGQ = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) LSOR = new TopTools_HSequenceOfShape(); + + //gp_Pnt backupPnt1, backupPnt2; + + for (int j = 1; j<= theFaceSeq->Length(); j++) //Delete redundant faces + { + TopLoc_Location l; + Handle(Geom_Surface) S; + TopoDS_Face F = TopoDS::Face(theFaceSeq->Value(j)); + S = BRep_Tool::Surface(F, l); + if (!S.IsNull()) + { + GeomAdaptor_Surface AS(S); + switch (AS.GetType()) + { + case GeomAbs_Plane: + { + LPlan->Append(theFaceSeq->Value(j)); + break; + } + case GeomAbs_Cylinder: + { + LCyl->Append(theFaceSeq->Value(j)); + break; + } + case GeomAbs_Cone: + { + LCon->Append(theFaceSeq->Value(j)); + break; + } + case GeomAbs_Sphere: + { + LSphere->Append(theFaceSeq->Value(j)); + break; + } + case GeomAbs_Torus: + { + LTor->Append(theFaceSeq->Value(j)); + break; + } + case GeomAbs_BezierSurface: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: BezierSurface can not be handled!" << endl; + break; + } + case GeomAbs_BSplineSurface: + { + + cout << "!!! BSpline Surface will be treated as General Quadric !!!\n"; + + LGQ->Append(theFaceSeq->Value(j)); + break; + } + case GeomAbs_SurfaceOfRevolution: + { + //cout << "_#_McCadCSGTool_CellBuilder.cxx :: SurfaceOfRevolution can not be handled!" << endl; + Handle(Geom_SurfaceOfRevolution) rev = Handle(Geom_SurfaceOfRevolution)::DownCast(S); + Handle(Geom_Curve) basisCurve = rev->BasisCurve(); + GeomAdaptor_Curve gaCurve(basisCurve); + + //might be an elliptical torus + if(gaCurve.GetType() == GeomAbs_Ellipse || gaCurve.GetType() == GeomAbs_Circle ) + { + gp_Ax1 revAx = rev->Axis(); + gp_Dir revDir = revAx.Direction(); + gp_Vec revVec(revDir.X(), revDir.Y(), revDir.Z()); + + // test if axis of revolution is perpendicular to two of the axis of the ellipse/circle + if(gaCurve.GetType() == GeomAbs_Ellipse) + { + Handle(Geom_Ellipse) e = Handle(Geom_Ellipse)::DownCast(basisCurve); + gp_Ax1 normAx = e->Axis(); + gp_Dir normDir = normAx.Direction(); + gp_Vec normVec(normDir.X(), normDir.Y(), normDir.Z()); + + if(Abs(revVec*normVec) > 1.0e-7) + { + cout << "_#_McCadCSGGeom_CellBuilder.cxx :: Ellipse not perpendicular to rotation Axis !!!\n" << endl; + break; + } + + LSOR->Append(theFaceSeq->Value(j)); + + } + else + { + Handle(Geom_Circle) c = Handle(Geom_Circle)::DownCast(basisCurve); + gp_Ax1 normAx = c->Axis(); + gp_Dir normDir = normAx.Direction(); + gp_Vec normVec(normDir.X(), normDir.Y(), normDir.Z()); + + if(Abs(revVec*normVec) > 1.0e-7) + { + cout << "_#_McCadCSGGeom_CellBuilder.cxx :: Ellipse not perpendicular to rotation Axis !!!\n" << endl; + break; + } + + LSOR->Append(theFaceSeq->Value(j)); + } + } + else + cout << "_#_McCadCSGGeom_CellBuilder.cxx :: Not supported kind of SurfaceOfRevolution !!!\n" << endl; + + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: SurfaceOfExtrusion can not be handled!" << endl; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: OffsetSurface can not be handled!" << endl; + break; + } + case GeomAbs_OtherSurface: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Unknown type of surface!" << endl; + break; + } + } + + } + else + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Nonanalytic surface " << endl; + } + } + + + //cout << "\nnumber of Planes : " << LPlan->Length() << endl; + //cout << "number of cylinders: " << LCyl->Length() << endl; + + //test if two faces are the same and delete redundant + LTor = McCadCSGTool::DeleteRedTorFace(LTor); + LSphere= McCadCSGTool::DeleteRedSphFace(LSphere); + LCon = McCadCSGTool::DeleteRedConFace(LCon); + LCyl = McCadCSGTool::DeleteRedCylFace(LCyl); + LPlan = McCadCSGTool::DeleteRedLinFace(LPlan); + LSOR = McCadCSGTool::DeleteRedSORFace(LSOR); + //TODO: LGQ = McCadCSGTool::DeleteRedGQ(LGQ); + + theFaceSeq->Clear(); + theFaceSeq->Append(LPlan); + theFaceSeq->Append(LTor); + theFaceSeq->Append(LSphere); + theFaceSeq->Append(LCon); + theFaceSeq->Append(LCyl); + theFaceSeq->Append(LGQ); + theFaceSeq->Append(LSOR); + LTor->Clear(); + LSphere->Clear(); + LCon->Clear(); + LCyl->Clear(); + LPlan->Clear(); + LGQ->Clear(); + //cout << "Number of irredundant faces = " << theFaceSeq->Length() << endl; + //Standard_Integer myCnt(0); + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + for (Standard_Integer j=1; j<= theFaceSeq->Length(); j++)//Now construct geometry + { + TopLoc_Location L; + TopoDS_Face theFace = TopoDS::Face(theFaceSeq->Value(j)); + TopAbs_Orientation orient = theFace.Orientation(); + + BRepAdaptor_Surface BS(theFace,Standard_True); + Handle(Geom_Surface) theSurface = BRep_Tool::Surface(theFace,L); + // GeomAdaptor_Surface theAdapSurface = BS.Surface(); + GeomAdaptor_Surface theAdapSurface(theSurface); + // Handle(Geom_Surface) theSurface = theAdapSurface.Surface(); + + Handle(Geom_ElementarySurface) ES = Handle(Geom_ElementarySurface)::DownCast(theSurface); + //////////////////////////////////////////////////////////////////////////////////////////////// + gp_Trsf T; + if(theAdapSurface.GetType()!=GeomAbs_BSplineSurface && theAdapSurface.GetType()!=GeomAbs_SurfaceOfRevolution) + { + gp_Ax3 stdAx3(gp::Origin(),gp::DZ()); + gp_Ax3 pos = ES->Position(); + T.SetTransformation(stdAx3,pos); + //gp_Dir theDirect = pos.Direction(); + //gp_Dir XDirect = pos.XDirection(); + //gp_Dir YDirect = pos.YDirection(); + //gp_Pnt theLoc = pos.Location(); + } + // cout << "The Position : " << theLoc.X() << " " << theLoc.Y() << " " << theLoc.Z() << "\n\n"; + Standard_Boolean negAxis = Standard_False; + //if (theDirect.X() < 0 || theDirect.Y() < 0 || theDirect.Z() < 0) + //cout << "McCadCSGTool_CellBuilder.cxx :: HAVE NEGAXIS\n\n\n";//negAxis = Standard_True; + // if(T.IsNegative()) negAxis = Standard_True; + // if(T.VectorialPart().Determinant() < 0.0) negAxis = Standard_True; + // if (XDirect.Crossed(YDirect).Dot(pos.Direction()) < 0 ) negAxis = Standard_True; + // if(negAxis) cout <<"_#_McCadCSGTool_CellBuilder.cxx :: %%%%%%%%% Negative transformation %%%%%%%% " << endl; + ////////////////////////////////////////////////////////////////////////////////////////// + // cout <<" XDir: X = " << XDirect.X() << " Y = " << XDirect.Y() << " Z = " << XDirect.Z() <D0(0,0, pnt1); + theSurf->D0(0,PI, pnt2); + + gp_Pnt midPnt((pnt2.X()+pnt1.X())/2.0, (pnt2.Y()+pnt1.Y())/2.0, (pnt2.Z()+pnt1.Z())/2.0); + + BRepBuilderAPI_MakeShell shellMaker(theSurf, Standard_False); + TopoDS_Shell theShell = shellMaker.Shell(); + BRepBuilderAPI_MakeSolid solidMaker(theShell); + TopoDS_Shape theSolid = solidMaker.Shape(); + + BRepClass3d_SolidClassifier clssfr(theSolid); + cout << "1\n"; + clssfr.Perform(midPnt, 1.0e-3); // !!! CRASHES !!! ??? ??? ??? + cout << "2\n"; + + if(clssfr.State() == TopAbs_IN) + negAxis = Standard_True; + }*/ + if(orient == TopAbs_REVERSED) + negAxis = Standard_True; + + Handle(Geom_SurfaceOfRevolution) rev = Handle(Geom_SurfaceOfRevolution)::DownCast(theSurface); + Handle(Geom_Curve) basisCurve = rev->BasisCurve(); + gp_Ax1 revAx = rev->Axis(); + + aCSGSurf = new McCadCSGGeom_SurfaceOfRevolution(revAx, basisCurve); + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Extrusion is not supported" << endl; + return; + } + case GeomAbs_OffsetSurface: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Surface is not analytic " << endl; + return; + } + case GeomAbs_OtherSurface: + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Surface is not analytic " << endl; + return; + } + } + + + if(aCSGSurf == 0) + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Problem with CSG surface creation." << endl; + return; + } + else + { + aCSGSurf->SetCasSurf(theAdapSurface); + //myUnits=McCadCSGGeom_MM; + aCSGSurf->SetUnits(myUnits); + } + + + /////////////////////////////////////////////////////////////////////////////////////////////// + // we check first if the surface is already in the map!! + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface theIter; + Standard_Boolean isFound = Standard_False; + Standard_Integer foundSurfNumb = 0; + for ( theIter.Initialize(surfMap); theIter.More(); theIter.Next()) + { + Handle(McCadCSGGeom_Surface) tmpSurf = theIter.Value(); + if (aCSGSurf->IsEqual(tmpSurf)) + { + isFound = Standard_True; + foundSurfNumb = theIter.Key(); + break; + } + else + isFound = Standard_False; + } + /////////////////////////////////////////////////////////////////////////////////////////////// + if (isFound) + { + //cout << "_#_McCadCSGTool_CellBuilder.cxx :: A redundant surface has been discarded." << endl; + if(orient == TopAbs_FORWARD) + { + if(negAxis) + aCSG->Append(TCollection_AsciiString(foundSurfNumb)); + else + aCSG->Append(TCollection_AsciiString(-foundSurfNumb)); + } + else if (orient == TopAbs_REVERSED) + { + if(negAxis) + aCSG->Append(TCollection_AsciiString(-foundSurfNumb)); + else + aCSG->Append(TCollection_AsciiString(foundSurfNumb)); + } + else + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Incorrect surface orientation " << endl; + return; + } + } + else + { + if(orient == TopAbs_FORWARD) + { + Standard_Integer surfNumb = myCell->GetSurfCounter(); + surfNumb++; + myCell->SetSurfCounter(surfNumb); + aCSGSurf->SetNumber(surfNumb); + + /*if(theAdapSurface.GetType() == GeomAbs_Plane) + { + cout << " --- >Forward Plane : " << surfNumb << endl; + + if(negAxis) + cout << "NEG"; + else + cout << "POS"; + cout << endl; + }*/ + + if (aCSGSurf->HaveTransformation()) + { + Standard_Integer trNumb = myCell->GetTrsfCounter(); + trNumb++; + aCSGSurf->SetTrsfNumber(trNumb); + myCell->SetTrsfCounter(trNumb); + } + if(negAxis) + aCSG->Append(TCollection_AsciiString(surfNumb)); + else + aCSG->Append(TCollection_AsciiString(-surfNumb)); + surfMap.Bind(surfNumb,aCSGSurf); + } + else if (orient == TopAbs_REVERSED) + { + Standard_Integer surfNumb = myCell->GetSurfCounter(); + surfNumb++; + myCell->SetSurfCounter(surfNumb); + + aCSGSurf->SetNumber(surfNumb); + + + /*if(theAdapSurface.GetType() == GeomAbs_Plane) + { + cout << " --- >Reversed Plane : " << surfNumb << endl; + + if(negAxis) + cout << "NEG"; + else + cout << "POS"; + cout << endl; + }*/ + + if (aCSGSurf->HaveTransformation()) + { + Standard_Integer trNumb = myCell->GetTrsfCounter(); + trNumb++; + aCSGSurf->SetTrsfNumber(trNumb); + myCell->SetTrsfCounter(trNumb); + } + + if(negAxis) + aCSG->Append(TCollection_AsciiString(-surfNumb)); + else + aCSG->Append(TCollection_AsciiString(surfNumb)); + + surfMap.Bind(surfNumb,aCSGSurf); + } + else + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Incorrect surface orientation " << endl; + return; + } + } + } + + if(myExtSolidSeq->Length() > 1 || myMakeOuterVoid) + aCSG->Append(")"); + // each time you have a solid behind you add a union sign but not to the last. + // This is the semi-algebraic decomposition S = union*(i...n intersec s_i) + if(i < myExtSolidSeq->Length()) + aCSG->Append(TCollection_AsciiString(" : ")); + } + + if(myExtSolidSeq->Length() > 1) + aCSG->Append(") "); + //test + /*for(int i=1; i<= aCSG->Length();i++) + { + cout << (aCSG->Value(i)).ToCString() << " "; + } + cout << endl;*/ + //test end + myCell->SetCSG(aCSG); + myCell->SetSurface(surfMap); + myCell->SetComment(theComment); + if(!myCell->IsVoid()) + myCell->SetVolume(cellVolume); + + //cout << "Number of surfaces used for cell = " << surfMap.Extent() << endl; + //cout << "End cell building " << endl; + //cout << "======================================= " << endl; + Done(); +} + + +Standard_Boolean McCadCSGTool_CellBuilder::IsDone() const +{ + return myIsDone; +} + + +void McCadCSGTool_CellBuilder::Done() +{ + myIsDone = Standard_True; +} + + +void McCadCSGTool_CellBuilder::NotDone() +{ + myIsDone = Standard_False; +} + + +Handle(McCadCSGGeom_Cell) McCadCSGTool_CellBuilder::GetCell() const +{ + return myCell; +} + + +Standard_Integer McCadCSGTool_CellBuilder::NbExtSolids() const +{ + return myExtSolidSeq->Length(); +} + + +Standard_Integer McCadCSGTool_CellBuilder::NbFaces() const +{ + return myCell->GetSurfCounter(); +} + + +Standard_Boolean McCadCSGTool_CellBuilder::IsSimpleSolid() const +{ + if (myExtSolidSeq->Length() ==1 && (myExtSolidSeq->Value(1))->HaveExt() == Standard_False) + return Standard_True; + else + return Standard_False; +} + + +void McCadCSGTool_CellBuilder::SetUnits(McCadCSGGeom_Unit theUnit) +{ + myUnits = theUnit; +} + +McCadCSGGeom_Unit McCadCSGTool_CellBuilder::GetUnits() const +{ + return myUnits; +} + + +/*---------------------------------- +// PRIVATE FUNCTIONS +------------------------------------*/ + +Standard_Boolean McCadCSGTool_CellBuilder::ComputeGQ(const TopoDS_Face& theFace, math_Vector& pVec) +{ + /* + * Compute General Quadric (GQ) for given Face + * + * GQ is defined by: A x**2 + B y**2 + C z**2 + D xy + E yz + F zx + G x + H y + I z = -1 + * + * Best fitting parameter vector (A,B,C,D,E,F,G,H,I) is found by solving the set of linear equations + * A x = b for x by using a singular value decomposition algorithm, implemented by OCC + * A herewith is the design matrix given by A_ij = X_j(x_i), with X_j \in {x**2, y**2, ... , y, z} + * b_j = -1 for all j=1..N, N=Number of Sample points. So A is a NxM matrix (N sample points, M parameters). + * Solving the above equation for x leads to the best fitting parameter vector in the xhisquare sense. + */ + + //Get Sample Points on surface + Standard_Integer sp=2, N=0; + Handle(TColgp_HSequenceOfPnt) theSamplePoints; + + while(true)//collect sample points + { + theSamplePoints = McCadCSGTool::FaceSamplePoints(theFace,sp+1,sp); + N = theSamplePoints->Length(); + + /*for(int i=1; iValue(i); + + for(int j=i+1; j<=N; j++) + { + gp_Pnt pntB = theSamplePoints->Value(j); + if(pntA.X()==pntB.X()) sim++; + if(pntA.Y()==pntB.Y()) sim++; + if(pntA.Z()==pntB.Z()) sim++; + } + + if(sim<2) + { + cout << pntA.X() << " " << pntA.Y() << " " << pntA.Z() << endl; + filteredPoints->Append(pntA); + } + }*/ + + if(N >= 18) + break; + + theSamplePoints->Clear(); + + if(sp>4) + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Can't create sufficient sample points for fit!!!" << endl; + return Standard_False; + } + sp++; + } + +//Fill design matrix A + Standard_Integer i,j; + + math_Vector b(1,N); // =-1 + math_Matrix A(1,N,1,9); //design matrix + b.Init(-1); // A.a=b, where a='parameter vector', b='residual vector' + + for(i=1; i<=N; i++) + { + gp_Pnt pnt = theSamplePoints->Value(i); + + for(j=1;j<=9;j++) + { + Standard_Real eval = DjFunc(pnt,j); + if(Abs(eval)<1.0e-9) + eval = 0.0; + + A(i,j) = eval; + } + } + + math_SVD singVD(A); // perform singular value decomposition and solve herewith the least square problem + singVD.Solve(b, pVec, 1e-7); + + //set small values to cero + for(j=1; j<=9; j++) + if(Abs(pVec(j))<1e-7) + pVec(j)=0.0; + + //Test if sum of squared errors is smaller threshold (0.01) + Standard_Real chiSqu(0.0); + for(i=1;i<=N;i++) + { + Standard_Real val(0.0); + for(j=1;j<=9;j++) + { + val += (A(i,j)*pVec(j)); + } + val+=1; + + //cout << "val : " << val << endl; + chiSqu += val*val; + } + + cout << "\n\n\nCHISQU = " << chiSqu << "\n\n\n"; + + if(chiSqu > 0.01) + { + cout << "_#_McCadCSGTool_CellBuilder.cxx :: Construction of General Quadric failed due to bad ChiSquare!!!\n"; + cout << " ChiSquare = " << chiSqu << endl; + cout << "-------------------------------------------------------------------------------------------------\n\n"; + return Standard_False; + } + + + return Standard_True; +} + + +Standard_Real McCadCSGTool_CellBuilder::DjFunc(const gp_Pnt& pnt, const Standard_Integer& indx) +{ + switch(indx) + { + case 1: return (pnt.X() * pnt.X()); // x**2 + case 2: return (pnt.Y() * pnt.Y()); // y**2 + case 3: return (pnt.Z() * pnt.Z()); // z**2 + case 4: return (pnt.X() * pnt.Y()); // xy + case 5: return (pnt.Y() * pnt.Z()); // yz + case 6: return (pnt.Z() * pnt.X()); // zx + case 7: return (pnt.X()); // x + case 8: return (pnt.Y()); // y + case 9: return (pnt.Z()); // z + case 10:return (1); // 1 + default: return 0; + } + return 0; +} + diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_Cutter.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_Cutter.cxx new file mode 100644 index 0000000..edd0053 --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_Cutter.cxx @@ -0,0 +1,615 @@ +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include + + +McCadCSGTool_Cutter::McCadCSGTool_Cutter() +{ + myIsDone = false; + myLastCut = Standard_False; +} + + +McCadCSGTool_Cutter::McCadCSGTool_Cutter(const TopoDS_Shape& theSolid,const Handle(McCadTDS_ExtFace)& theExtFace) +{ + Init(theSolid,theExtFace); +} + + +void McCadCSGTool_Cutter::Init(const TopoDS_Shape& theSolid,const Handle(McCadTDS_ExtFace)& theExtFace) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + NotDone(); + mySolid = theSolid; + myExtFace = theExtFace; + myResultSolids = new TopTools_HSequenceOfShape(); + if ( (myExtFace->NbPosPnt() == 0) || (myExtFace->NbNegPnt() == 0) ) + { + NotDone(); + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Extended face without sample points", McCadMessenger_ErrorMsg); + return; + } + gp_Pnt posPnt(0,0,0); + posPnt = myExtFace->GetPosPnt(); + gp_Pnt negPnt(0,0,0); + negPnt = myExtFace->GetNegPnt(); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // this is a test for extents and evaluation + TopoDS_Face aFace = myExtFace->GetFace(); + BRepAdaptor_Surface BS(aFace,Standard_True); + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + + //////////////////////////////////////////////////////////////// + // construct cutting half spaces + TopoDS_Shape PosHSol = BRepPrimAPI_MakeHalfSpace(aFace,posPnt).Solid(); //positive cutting half space SOLID + if(PosHSol.IsNull()) + msgr->Message("\n_#_McCadCSGTool_Cutter.cxx :: Solid of positive cutting half space is empty!!!", + McCadMessenger_WarningMsg); + TopoDS_Shape NegHSol = BRepPrimAPI_MakeHalfSpace(aFace,negPnt).Solid(); //negative cutting half space SOLID + if(NegHSol.IsNull()) + msgr->Message("\n_#_McCadCSGTool_Cutter.cxx :: Solid of negative cutting half space is empty!!!", + McCadMessenger_WarningMsg); + + Standard_Boolean pHalfCut = Standard_False; + Standard_Boolean nHalfCut = Standard_False; + + //////////////////////////////////////////////////////////////////////////// + // + Bnd_Box B; + BRepBndLib::Add(mySolid, B); + B.SetGap(1000.0); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + TopoDS_Shape aBox = BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin), gp_Pnt(aXmax, aYmax, aZmax)).Shape(); + + ////////////////////////////////////////////////////////////////////////// + // create pseudo half spaces (shrink to suitable size) + TopoDS_Shape PosBox, NegBox; + try + { + BRepAlgoAPI_Common posHCommon(PosHSol,aBox); + if(posHCommon.IsDone()) + { + PosBox = posHCommon.Shape(); + PosHSol = PosBox; + } + posHCommon.Destroy(); + } + catch(Standard_DomainError) + { + Standard_Failure::Caught()->Print(cout); cout << endl; + } + try + { + BRepAlgoAPI_Common negHCommon(NegHSol,aBox); + if(negHCommon.IsDone()) + { + NegBox = negHCommon.Shape(); + NegHSol = NegBox; + } + negHCommon.Destroy(); + } + catch(Standard_DomainError) + { + Standard_Failure::Caught()->Print(cout); cout << endl; + } + + + int itol=0, highTolCount=0; + + ////////////////////////////////////////////////////////////// + // JUMP-MASTER + MASTER: //goto label; if cutting fails: try again using a higher tolerance + + //////////////////////////////////////////////////////////////////////// + // cutting with negative half space + if (NegHSol.IsNull()) + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: A negative Null Cut appears!!", + McCadMessenger_ErrorMsg); + else + { + try + { + BRepAlgoAPI_Cut posCut(mySolid,NegHSol); + + if(posCut.IsDone()) + { + pHalfCut = Standard_True; + myPosPartSol = posCut.Shape(); + } + else + { + pHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Positive side solid Cutting failed !!", + McCadMessenger_WarningMsg); + } + posCut.Destroy(); + } + catch(Standard_DomainError) + { + pHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Boolean Operation on a halfspace has failed !!!", + McCadMessenger_WarningMsg); + cout << "OCC error message: "; + Standard_Failure::Caught()->Print(cout); cout << endl; + } + } + + ////////////////////////////////////////////////////////////////////////////// + // cutting with positive half space + if (PosHSol.IsNull()) + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: A positive Null Cut appears!!", + McCadMessenger_WarningMsg); + else + { + try + { + BRepAlgoAPI_Cut negCut(mySolid,PosHSol); + + if(negCut.IsDone()) + { + nHalfCut = Standard_True; + myNegPartSol = negCut.Shape(); + } + else + { + nHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Negative side solid cutting failed !!", + McCadMessenger_WarningMsg); + } + negCut.Destroy(); + } + catch(Standard_DomainError) + { + nHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Boolean Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + cout << "OCC error : "; + Standard_Failure::Caught()->Print(cout); cout << endl; + } + } + + + int sCount=0; + + //////////////////////////////////////////////////////////////// + // check if positive part is valid + Standard_Boolean posPartNotValid(Standard_False); + + for (TopExp_Explorer ex(myPosPartSol,TopAbs_SOLID);ex.More();ex.Next()) + { + sCount++; + TopoDS_Solid solid = TopoDS::Solid(ex.Current()); + + if(solid.IsNull()) + { + TCollection_AsciiString warningMessage("_#_McCadCSGTool_Cutter.cxx :: NULL Cut: P Cutting solid failed !!\n Trying to use Boolean Common operation..."); + msgr->Message(warningMessage.ToCString(), McCadMessenger_WarningMsg); + posPartNotValid = Standard_True; + break; + } + + BRepCheck_Analyzer BA(solid,Standard_True); + + if(!BA.IsValid()) + { + posPartNotValid = Standard_True; + break; + } + } + + /////////////////////////////////////////////////////////// + // if cutting failed, try common operation + if(posPartNotValid) + { + sCount = 0; + + try + { + BRepAlgoAPI_Common negCommon(mySolid, NegHSol); + + if(negCommon.IsDone()) + { + pHalfCut = Standard_True; + myPosPartSol = negCommon.Shape(); + } + else + { + pHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Positive side solid Common Operation failed !!", + McCadMessenger_WarningMsg); + } + negCommon.Destroy(); + } + catch(Standard_DomainError) + { + pHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Boolean Operation on a halfspace has failed !!!", + McCadMessenger_WarningMsg); + cout << "OCC error message: "; + Standard_Failure::Caught()->Print(cout); cout << endl; + } + + for (TopExp_Explorer ex(myPosPartSol,TopAbs_SOLID);ex.More();ex.Next()) + { + sCount++; + TopoDS_Solid solid = TopoDS::Solid(ex.Current()); + + if(solid.IsNull()) + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: NULL Common: P Common solid failed !!", + McCadMessenger_WarningMsg); + + pHalfCut = Standard_False; + break; + } + + BRepCheck_Analyzer BA(solid, Standard_True); + + if(!BA.IsValid()) + { + pHalfCut = Standard_False; + break; + } + } + } + + if(sCount==0) + pHalfCut = Standard_False; + + sCount=0; + + ////////////////////////////////////////////////////////// + // check if negative part is valid + Standard_Boolean negPartNotValid(Standard_False); + + for (TopExp_Explorer ex(myNegPartSol,TopAbs_SOLID);ex.More();ex.Next()) + { + sCount++; + TopoDS_Solid solid = TopoDS::Solid(ex.Current()); + + if(solid.IsNull()) + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: NULL Cut: N Cutting solid failed !!", + McCadMessenger_WarningMsg); + negPartNotValid = Standard_True; + break; + } + + BRepCheck_Analyzer BA(solid,Standard_True); + + + if(!BA.IsValid()) + { + negPartNotValid = Standard_True; + + break; + } + } + //////////////////////////////////////////////////////// + // if cutting failed, try common operation + if(negPartNotValid) + { + sCount = 0; + + try + { + BRepAlgoAPI_Common negCommon(mySolid, NegHSol); + + if(negCommon.IsDone()) + { + nHalfCut = Standard_True; + myNegPartSol = negCommon.Shape(); + } + else + { + nHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Negative side solid Common Operation failed !!", + McCadMessenger_DefaultMsg); + } + negCommon.Destroy(); + } + catch(Standard_DomainError) + { + nHalfCut = Standard_False; + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Boolean Operation on a halfspace has failed !!!", + McCadMessenger_WarningMsg); + cout << "OCC error message: "; + Standard_Failure::Caught()->Print(cout); cout << endl; + } + + for (TopExp_Explorer ex(myNegPartSol,TopAbs_SOLID);ex.More();ex.Next()) + { + sCount++; + TopoDS_Solid solid = TopoDS::Solid(ex.Current()); + + if(solid.IsNull()) + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: NULL Common: N Common solid failed !!", + McCadMessenger_WarningMsg); + nHalfCut = Standard_False; + break; + } + + BRepCheck_Analyzer BA(solid,Standard_True); + + if(!BA.IsValid()) + { + nHalfCut = Standard_False; + break; + } + } + } + + if(sCount==0) + nHalfCut = Standard_False; // if check is run on compound containing no solid + + /////////////////////////////////////////////////////////////////// + // Test if a boolean operation failed + sCount=0; + itol++; + Standard_Real highTol(1.e-3); + + if ((!nHalfCut || !pHalfCut) && itol <=3) + { +//qiu Standard_Real locTol = 1.e-07*(pow(10,itol)); + Standard_Real locTol = 1.e-07*(pow(10.0,itol)); + highTol = locTol; + cout << "_#_McCadCSGTool_Cutter.cxx :: Tolerance correction due to failed boolean operation. --- " << itol << endl; + cout << " Tolerance is : " << locTol <Message("_#_McCadCSGTool_Cutter.cxx :: Warning: Cutting failed may try again !!", + McCadMessenger_WarningMsg); + NotDone(); + return; + } + //////////////////////////////////////////////////////////////// + // if cutting certainly fails we try common; + // hihg tolerance BOP + if ((!pHalfCut || !nHalfCut) && IsLastCut() && highTolCount < 1 ) + { + highTolCount++; + Standard_Real locTol = highTol; +//qiu highTol = locTol*(pow(10,highTolCount)); + highTol = locTol*(pow(10.0,highTolCount)); + + cout << "******************************************************************************" << endl; + cout << highTolCount << ". High Tolerance correction due to failed boolean operation. " << endl; + cout << "Warning: Tolerance is high may introduce error : " << highTol <Message("_#_McCadCSGTool_Cutter.cxx :: Warning: Null solid in Positive part!!", + McCadMessenger_WarningMsg); + BRepClass3d_SolidClassifier bsc3d (aSolid); + Standard_Real t = Precision::Confusion(); + bsc3d.PerformInfinitePoint(t); + + if (bsc3d.State() == TopAbs_IN) + cout << "Infinity in Solid, therefore discaded !! " << endl; + else + myResultSolids->Append(aSolid); + } + else + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Model may be invalid: Solid computation from shell failed!! ", + McCadMessenger_WarningMsg); + } + } + else + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Model may be invalid - open shell", + McCadMessenger_WarningMsg); + } + + // cout << " Total number of shells after cutting " << endl; + + for (TopExp_Explorer ex(myNegPartSol,TopAbs_SHELL);ex.More();ex.Next()) + { + + TopoDS_Shell tmpShell = TopoDS::Shell(ex.Current()); + BRepCheck_Shell shellCheck(tmpShell); + // BRepCheck::Print(shellCheck.Orientation(),cout); cout << endl; + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) + { + BRepBuilderAPI_MakeSolid Bu(tmpShell); + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + if(aSolid.IsNull()) + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Warning: Null solid in Positive part!!", + McCadMessenger_WarningMsg); + + BRepClass3d_SolidClassifier bsc3d (aSolid); + Standard_Real t = Precision::Confusion(); + bsc3d.PerformInfinitePoint(t); + + if (bsc3d.State() == TopAbs_IN) + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Infinity in Solid, therefore discarded !! ", + McCadMessenger_WarningMsg); + else + myResultSolids->Append(aSolid); + } + else + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Model may be invalid: Solid computation from shell failed!! ", + McCadMessenger_WarningMsg); + } + } + else + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Model may be invalid - open shell!!", + McCadMessenger_WarningMsg); + } + ///////////////////////////////////////////////////////////////////////// + } + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // content analysis of result solids + //cout << "////////////////////////////////////////////////////////////////////////////////// " << endl; + //cout << " Cut Result = " << myResultSolids->Length() << endl; + if (!IsLastCut() && myResultSolids->Length() <= 1) + { + msgr->Message("_#_McCadCSGTool_Cutter.cxx :: Warning: Cut result may be degenerate !!", + McCadMessenger_WarningMsg); + NotDone(); + return; + } + TopExp_Explorer ex; + int iv; + for ( int i=1; i<=myResultSolids->Length(); i++) + { + for (ex.Init(myResultSolids->Value(i),TopAbs_FACE), iv=1;ex.More();ex.Next(), iv++) + { + TopoDS_Face theFace = TopoDS::Face(ex.Current()); + BRepAdaptor_Surface BS(theFace,Standard_True); + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + if(theAdaptFaceSurface.GetType() != GeomAbs_Plane) + { + // cout << "Solid: "<< i << " Face = " << iv << " non-planar face .....................!!"<< endl; + } + else + { + gp_Pln aPln = theAdaptFaceSurface.Plane(); + Standard_Real A,B,C,D; + aPln. Coefficients(A,B,C,D); + // cout << "Solid: "<< i << " Face = " << iv << " A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl; + } + } + } + //cout << "////////////////////////////////////////////////////////////////////////////////// " << endl; + ///////////////////////////////////////////////////////////////////////////////////////////////////// + Done(); +} + + +Standard_Boolean McCadCSGTool_Cutter::IsDone() const +{ + return myIsDone; +} + + +void McCadCSGTool_Cutter::Done() +{ + myIsDone = Standard_True; +} + + +void McCadCSGTool_Cutter::NotDone() +{ + myIsDone = Standard_False; +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGTool_Cutter::Solids() const +{ + return myResultSolids; +} + + +void McCadCSGTool_Cutter::SetLastCut(const Standard_Boolean isLast) +{ + myLastCut = isLast; +} + + +Standard_Boolean McCadCSGTool_Cutter::IsLastCut() const +{ + return myLastCut; +} diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_Decomposer.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_Decomposer.cxx new file mode 100644 index 0000000..14efcca --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_Decomposer.cxx @@ -0,0 +1,144 @@ +#include +#include +#include +#include +#include + +#include + +#include +#include + +//qiu #include + +#include +#include +#include +#include + +#include +#include + +#include + +McCadCSGTool_Decomposer::McCadCSGTool_Decomposer() +{ + myIsDone = false; +} + +McCadCSGTool_Decomposer::McCadCSGTool_Decomposer(const TopoDS_Solid& theSolid) +{ + myIsDone = false; + Init(theSolid); +} + +void McCadCSGTool_Decomposer::Init(const TopoDS_Solid& theSolid) { + //local init + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + NotDone(); + TopoDS_Solid aSolid = theSolid; + myProcessedSolids = new TopTools_HSequenceOfShape(); + myUnProcessedSolids = new TopTools_HSequenceOfShape(); + myUnProcessedSolids->Append(aSolid);//Append unprocessed Solid to Sequence of unprocessed Solids + + //perform cut for all unprocessed solids + for (Standard_Integer i = 1; i <= myUnProcessedSolids->Length(); i++) { + TopoDS_Solid tmpSol = TopoDS::Solid(myUnProcessedSolids->Value(i)); + + // test for topological correctness + BRepCheck_Analyzer BA5(tmpSol, Standard_True); + if(!BA5.IsValid()) { + McCadCSGAdapt_SolidAnalyser solAna(tmpSol); + tmpSol = solAna.FixedSolid(); + } + + //check if solid is trivial (box, sphere,...) + McCadCSGTool_TrivialCheck trivial(tmpSol); + if (trivial.IsDone() && trivial.Elementary()) { + myProcessedSolids->Append(tmpSol); + } + else { + // test solid's surfaces for sign-constancy and cut if sign-changing surface is found + McCadCSGTool_SignCheck check(tmpSol); + if (check.IsDone()) { + if (check.SignStateChanges()) { + // if cutting fails due to cas BOP we try with the next extFace! + Handle(McCadTDS_ExtFace) tmpExtFace; + while (check.NbExtFace() > 0) { + cout << "." << flush; + tmpExtFace = check.GetExtFace(); + + // perform cut + McCadCSGTool_Cutter cut; + if (check.NbExtFace() < 1) + cut.SetLastCut(Standard_True); + cut.Init(tmpSol, tmpExtFace); + + if (cut.IsDone()) { + Handle(TopTools_HSequenceOfShape) tmpSolSeq = cut.Solids(); + if (tmpSolSeq->Length() >=2) { + myUnProcessedSolids->Append(tmpSolSeq); + break; + } + else if (cut.IsLastCut() && tmpSolSeq->Length() <= 1) { + // at the last cut we accept also 1 solid with warning. + msgr->Message("_#_McCadCSGTool_Decomposer.cxx :: Warning: Cutted solid may have degenerated result!!", + McCadMessenger_WarningMsg); + myUnProcessedSolids->Append(tmpSolSeq); + break; + } + } + else if (check.NbExtFace() == 0) { + msgr->Message("_#_McCadCSGTool_Decomposer.cxx :: Cutting solid failed certainly !!\n", + McCadMessenger_ErrorMsg); + break; + } + else { + msgr->Message("_#_McCadCSGTool_Decomposer.cxx :: Cutting solid failed !!", + McCadMessenger_ErrorMsg); + msgr->Message(" Trying to cut with next face ...... ", + McCadMessenger_ErrorMsg); + } + } + } + else + myProcessedSolids->Append(tmpSol); + } + else + msgr->Message("_#_McCadCSGTool_Decomposer.cxx :: Sign check failed ", + McCadMessenger_ErrorMsg); + } + } + Done(); +} + + +Standard_Boolean McCadCSGTool_Decomposer::IsDone() const +{ + return myIsDone; +} + + +void McCadCSGTool_Decomposer::Done() +{ + myIsDone = Standard_True; +} + + +void McCadCSGTool_Decomposer::NotDone() +{ + myIsDone = Standard_False; +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGTool_Decomposer::GetProcessedSolids() const +{ + return myProcessedSolids; +} + + +Standard_Integer McCadCSGTool_Decomposer::NbProcessedSolids() const +{ + return myProcessedSolids->Length(); +} + diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_Extender.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_Extender.cxx new file mode 100644 index 0000000..a27345e --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_Extender.cxx @@ -0,0 +1,1025 @@ +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +// #include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* + * Purpose: + * + * Extend the boundary support set in order to establish definability. That is, adding resultants + * and partial derivatives to the already existing support set. + * + */ + + +Handle(McCadCSGGeom_Surface) MakeMcCadSurf(const GeomAdaptor_Surface& theAdapSurface) +{ + Handle(McCadCSGGeom_Surface) aCSGSurf; + + switch (theAdapSurface.GetType()) + { + case GeomAbs_Plane: + aCSGSurf = new McCadCSGGeom_Plane; + break; + case GeomAbs_Cylinder: + aCSGSurf = new McCadCSGGeom_Cylinder; + break; + case GeomAbs_Cone: + aCSGSurf = new McCadCSGGeom_Cone; + break; + case GeomAbs_Sphere: + aCSGSurf = new McCadCSGGeom_Sphere; + break; + case GeomAbs_Torus: + aCSGSurf = new McCadCSGGeom_Torus; + break; + case GeomAbs_BezierSurface: + { + cout << "_#_McCadCSGTool_Extender.cxx :: Surface is not analytic " << endl; + break; + } + case GeomAbs_BSplineSurface: + { + cout << "_#_McCadCSGTool_Extender.cxx :: Surface is not analytic " << endl; + break; + } + case GeomAbs_SurfaceOfRevolution: + { + //cout << "_#_McCadCSGTool_Extender.cxx :: Surface is not analytic " << endl; + aCSGSurf = new McCadCSGGeom_SurfaceOfRevolution; + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "_#_McCadCSGTool_Extender.cxx :: Surface is not analytic " << endl; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "_#_McCadCSGTool_Extender.cxx :: Surface is not analytic " << endl; + break; + } + case GeomAbs_OtherSurface: + { + cout << "_#_McCadCSGTool_Extender.cxx :: Surface is not analytic " << endl; + break; + } + } + + aCSGSurf->SetCasSurf(theAdapSurface); + + return aCSGSurf; + +} + +McCadCSGTool_Extender::McCadCSGTool_Extender() +{ + +} + +McCadCSGTool_Extender::McCadCSGTool_Extender(const TopoDS_Solid& theSolid) +{ + Init(theSolid); +} + +void McCadCSGTool_Extender::Init(const TopoDS_Solid& theSolid) +{ + NotDone(); + + mySolid = theSolid; + myExtSolid = new McCadTDS_ExtSolid(mySolid); + myExtSolid->SetHaveExt(Standard_False); + + Handle(TopTools_HSequenceOfShape) theResultantSeq = new TopTools_HSequenceOfShape(); + + /////////////////////////////////////////////////////////////////////////////////////////// + /*TopTools_IndexedDataMapOfShapeListOfShape aMEF; + TopExp::MapShapesAndAncestors(mySolid, TopAbs_EDGE, TopAbs_FACE, aMEF);*/ + + //TopTools_MapOfShape theFinalFaceMap; + //TopTools_MapOfShape theRemoveFaceMap; +// Standard_Boolean isFused = Standard_False; + + // a map is too rigid. if there are more than two faces on one surface it produces to many fused faces + // especially for toroidal surfaces this is bad and leads to meaningless partials, which might + // destroy the final shape of the solid + Handle(TopTools_HSequenceOfShape) fcSeq = new TopTools_HSequenceOfShape; + + for(TopExp_Explorer ex(theSolid, TopAbs_FACE); ex.More(); ex.Next()) + fcSeq->Append(ex.Current()); + + //TopLoc_Location loc; + + //cout << "Number of faces in solid : " << fcSeq->Length() << endl; + + // fuse faces on the same surface that share an identical edge (different orientation) + //////////////////////////////////////////////////////////////////////////////////////// + + FuseFaces(fcSeq); + + if(fcSeq->Length() < 1) + { + Done(); + return; + } + + //cout << "Number Of Faces after fusing : " << fcSeq->Length() << endl; + + /////////////////////////////////////////////////////////////////////////////////////////////// + // Compute Partials + + for(int i=1; i<=fcSeq->Length(); i++) + { + TopoDS_Face aFace = TopoDS::Face(fcSeq->Value(i)); + + if(aFace.Orientation() != TopAbs_REVERSED) + continue; + + theResultantSeq->Append(McCadCSGTool::Partials(aFace)); + } + + if (theResultantSeq->Length() == 0) + { + Done(); + return; + } + myExtSolid->SetHaveExt(Standard_True); + + ////////////////////////////////////////////////////////////////////////////// + // Generate sample points + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt; + thePntSeq->Append(McCadCSGTool::SamplePoints(myExtSolid->GetSolid())); + + /////////////////////////////////////////////// + // Remove sign-changing resultants + //STEPControl_Writer wrt; + for (Standard_Integer i = 1; i <= theResultantSeq->Length(); i++) + { + TopoDS_Face theFace = TopoDS::Face(theResultantSeq->Value(i)); + Handle(McCadTDS_ExtFace) extFace = new McCadTDS_ExtFace(theFace); + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + + for (Standard_Integer i=1; i <= thePntSeq->Length(); i++) + { + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptFaceSurface, thePntSeq->Value(i)); + + if (aVal > 5.) + extFace->AppendPosPnt(thePntSeq->Value(i)); + if (aVal < -5.) + extFace->AppendNegPnt(thePntSeq->Value(i)); + } + + Standard_Integer NbPosPnt = extFace->NbPosPnt(); + Standard_Integer NbNegPnt = extFace->NbNegPnt(); + + if (NbNegPnt > 0 && NbPosPnt > 0) // i.e sign changing + { + /*wrt.Transfer(theFace, STEPControl_AsIs); + cout << "SIGN CHANGING RESULTANT!!!\n";*/ + continue; + } + + myExtSolid->AppendFace(theFace); + } + + //wrt.Write("signChangingResultant.stp"); + + Done(); +} + + +Standard_Boolean McCadCSGTool_Extender::IsDone() const +{ + return myIsDone; +} + +void McCadCSGTool_Extender::Done() +{ + myIsDone = Standard_True; +} + +void McCadCSGTool_Extender::NotDone() +{ + myIsDone = Standard_False; +} + +Handle(McCadTDS_ExtSolid) McCadCSGTool_Extender::ExtSolid() const +{ + return myExtSolid; +} + + +void McCadCSGTool_Extender::FuseFaces(Handle(TopTools_HSequenceOfShape)& fcSeq, Standard_Boolean reversedOnly) +{ + TopLoc_Location loc; + Standard_Boolean isFused = Standard_False; + // fuse faces on the same surface that share an identical edge (different orientation) + //////////////////////////////////////////////////////////////////////////////////////// + + // face 1 + for(int i=1; i<=fcSeq->Length(); i++) + { + isFused = Standard_False; + TopoDS_Face f1 = TopoDS::Face(fcSeq->Value(i)); + const Handle(Geom_Surface)& aS1 = BRep_Tool::Surface(f1,loc); + GeomAdaptor_Surface aAs1(aS1); + Handle(McCadCSGGeom_Surface) mS1 = MakeMcCadSurf(aAs1); + + TopAbs_Orientation orient1 = f1.Orientation(); + + // remove planes and surfaces with forward orientation + //////////////////////////////////////////////////////// + if(aAs1.GetType() == GeomAbs_Plane || (orient1 != TopAbs_REVERSED && reversedOnly)) + { + if(reversedOnly) + { + fcSeq->Remove(i); + i--; + } + continue; + } + + // face 2 + for(int j=fcSeq->Length(); j>i ; j--) + { + TopoDS_Face f2 = TopoDS::Face(fcSeq->Value(j)); + const Handle(Geom_Surface)& aS2 = BRep_Tool::Surface(f2,loc); + GeomAdaptor_Surface aAs2(aS2); + TopAbs_Orientation orient2 = f2.Orientation(); + + if(aAs2.GetType() == GeomAbs_Plane || (orient2 != TopAbs_REVERSED && reversedOnly)) + { + if(reversedOnly) + { + fcSeq->Remove(j); + } + continue; + } + + if((aAs1.GetType() != aAs2.GetType()) || (orient1 != orient2)) + continue; + + Handle(McCadCSGGeom_Surface) mS2 = MakeMcCadSurf(aAs2); + + // check if faces lie on same surface + ////////////////////////////////////////////// + if (!mS1->IsEqual(mS2)) + { + //cout << "NOT EQUAL!!!\n\n\n"; + continue; + } + + /*// edges of face 1 + for(TopExp_Explorer ex1(f1, TopAbs_EDGE); ex1.More(); ex1.Next()) + { + TopoDS_Edge e1 = TopoDS::Edge(ex1.Current()); + + // edges of face 2 + for(TopExp_Explorer ex2(f2, TopAbs_EDGE); ex2.More(); ex2.Next()) + { + TopoDS_Edge e2 = TopoDS::Edge(ex2.Current()); + + // faces share same edge (regardless of the orientation) + if(e1.IsSame(e2)) + {*/ + + // !!! Edge comparison doesn't work well + // new method tests if the faces share the same surface + // and if the UV-Bounds overlap or touch each other + // GOOD LUCK !!! + + if ( (orient1 == TopAbs_REVERSED && reversedOnly) || ( !reversedOnly && ( + aAs1.GetType() == GeomAbs_Cylinder || aAs1.GetType() == GeomAbs_Sphere || + aAs1.GetType() == GeomAbs_Cone || aAs1.GetType() == GeomAbs_Torus ) ) ) + { + try + { + // check surface area + ///////////////////////////////// + GProp_GProps GP1; + BRepGProp::SurfaceProperties(f1, GP1); + if(GP1.Mass() < 0.1) + continue; + // check surface area + ///////////////////////////////// + GProp_GProps GP2; + BRepGProp::SurfaceProperties(f2, GP2); + if(GP2.Mass() < 0.1) + continue; + + // NON-Boolean Fusion + ////////////////////////////////// + /* + * Boolean operations in OCC tend to freeze the program or + * crash it, from time to time. Therefore for simple shapes + * (i.e. cutted along iso(UV)lines) we don't use boolean ops. + */ + + // check if bounds coincide + Standard_Real UMin1,UMax1, VMin1, VMax1; + BRepTools::UVBounds(f1,UMin1,UMax1, VMin1, VMax1); + Standard_Real UMin2,UMax2, VMin2, VMax2; + BRepTools::UVBounds(f2,UMin2,UMax2, VMin2, VMax2); + Standard_Real UMin(0.0),UMax(0.0), VMin(0.0), VMax(0.0); + + // Nullify small dimensions + if(Abs(UMin1) < 1.e-10) + UMin1 = 0.0; + if(Abs(UMin2) < 1.e-10) + UMin2 = 0.0; + if(Abs(UMax1) < 1.e-10) + UMax1 = 0.0; + if(Abs(UMax2) < 1.e-10) + UMax2 = 0.0; + if(Abs(VMin1) < 1.e-10) + VMin1 = 0.0; + if(Abs(VMin2) < 1.e-10) + VMin2 = 0.0; + if(Abs(VMax1) < 1.e-10) + VMax1 = 0.0; + if(Abs(VMax2) < 1.e-10) + VMax2 = 0.0; + + + // Perform UV test + { + // if U-Values do not collide in any direction continue + if( ( ((UMin1 < UMin2) && (UMin1 < UMax2)) && + ((UMax1 < UMin2) && (UMax1 < UMax2)) && + (UMin1 != 0) ) || + ( ((UMin1 > UMin2) && (UMin1 > UMax2)) && + ((UMax1 > UMin2) && (UMax1 > UMax2)) && + (UMin2 != 0)) ) + { + continue; + } + + + if(aAs1.GetType() == GeomAbs_Torus) + { + if( ( ((VMin1 < VMin2) && (VMin1 < VMax2)) && + ((VMax1 < VMin2) && (VMax1 < VMax2)) ) || + ( ((VMin1 > VMin2) && (VMin1 > VMax2)) && + ((VMax1 > VMin2) && (VMax1 > VMax2)) ) + ) + continue; + } + } + + // make sure uv bounds lie on iso-lines + Standard_Boolean boundsOnISO(Standard_True); + + // get main axis + gp_Ax1 mainAx; + + if(aAs1.GetType() == GeomAbs_Cylinder) + mainAx = aAs1.Cylinder().Axis(); + else if(aAs1.GetType() == GeomAbs_Cone) + mainAx = aAs1.Cone().Axis(); + else if(aAs1.GetType() == GeomAbs_Sphere) + ; + else if(aAs1.GetType() == GeomAbs_Torus) + ; + else + continue; + + if(aAs1.GetType() == GeomAbs_Cylinder || aAs1.GetType() == GeomAbs_Cone) + { + for(TopExp_Explorer ex1(f1, TopAbs_EDGE); ex1.More(); ex1.Next()) + { + Standard_Real first, mid, last; + TopoDS_Edge e1 = TopoDS::Edge(ex1.Current()); + + Handle(Geom_Curve) theCurve = BRep_Tool::Curve(e1, first, last); + + if(GeomAdaptor_Curve(theCurve).GetType() == GeomAbs_Line) + continue; + + mid = (first+last)/2.0; + + gp_Pnt p1, p2, p3; + theCurve->D0(first, p1); + theCurve->D0(mid, p2); + theCurve->D0(last, p3); + + gp_Vec v1(p2,p1), v2(p2,p3), v1xv2; + v1xv2 = v1.Crossed(v2); + + gp_Dir dir(v1xv2); + gp_Ax1 ax(p2, dir); + + /*cout << "mainAxis : " << mainAx.Direction().X() << " , " << mainAx.Direction().Y() << " , " << mainAx.Direction().Z() << endl; + cout << "ax : " << ax.Direction().X() << " , " << ax.Direction().Y() << " , " << ax.Direction().Z() << endl;*/ + + if(!ax.IsParallel(mainAx, 0.01)) + { + boundsOnISO = Standard_False; + break; + } + } + } + else + boundsOnISO = Standard_True; + + + if(boundsOnISO) + { //ISO LINES + + // test if cylinders and cones can be fused without boolean fusion + if(aAs1.GetType() == GeomAbs_Cylinder || aAs1.GetType() == GeomAbs_Cone || aAs1.GetType() == GeomAbs_Sphere) + { + + /*if(aAs1.GetType() == GeomAbs_Cylinder) + { + gp_Cylinder theCylinder = aAs1.Cylinder(); + + cout << "Cylinder : " << theCylinder.Radius() << endl; + cout << "U1 : " << UMin1 << " , " << UMax1 << " U2 : " << UMin2 << " , " << UMax2 << endl; + cout << "V1 : " << VMin1 << " , " << VMax1 << " V2 : " << VMin2 << " , " << VMax2 << endl; + }*/ + { + if(Abs(UMax1-UMin1+UMax2-UMin2 - 2*M_PI) < 1e-5) + { + UMin = 0; + UMax = 2*M_PI; + } + else + { + if( Abs(UMin1-UMax2) < 1.0e-5 || ( UMin1 == 0 && Abs(UMax2-2*M_PI) < 1e-7 )) + { + UMin = UMin2; + UMax = UMax1; + } + else if( Abs(UMin2-UMax1) < 1.0e-5 || ( UMin2 == 0 && Abs(UMax1-2*M_PI) < 1e-7 ) ) + { + UMin = UMin1; + UMax = UMax2; + } + + if(UMax < UMin) + UMax += 2*M_PI; + } + + if (VMin1 <= VMin2) + VMin = VMin1; + else + VMin = VMin2; + + if (VMax1 >= VMax2) + VMax = VMax1; + else + VMax = VMax2; + } + /*if(aAs1.GetType() == GeomAbs_Cylinder) + cout << "U : " << UMin << " , " << UMax << " V :" << VMin << " , " << VMax << endl;*/ + } + else if(aAs1.GetType() == GeomAbs_Torus) + { + // Maximize + ///////////////////////// + if (UMin1 <= UMin2) + UMin = UMin1; + else + UMin = UMin2; + + if (VMin1 <= VMin2) + VMin = VMin1; + else + VMin = VMin2; + + if (UMax1 >= UMax2) + UMax = UMax1; + else + UMax = UMax2; + + if (VMax1 >= VMax2) + VMax = VMax1; + else + VMax = VMax2; + + if((Abs(VMax-VMin) - 2*M_PI) < 1e-5) + { + VMin = 0; + VMax = 2*M_PI; + } + } + else + continue; + + // make new face + ///////////////////////// +#ifdef OCC650 + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(aS1, UMin,UMax, VMin, VMax).Face(); +#else + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(aS1, UMin,UMax, VMin, VMax, 1.e-7).Face(); +#endif + + theNewFace.Orientation(f1.Orientation()); + + if(!theNewFace.IsNull()) + { + fcSeq->Remove(j); + fcSeq->Remove(i); + fcSeq->Append(theNewFace); + + isFused = Standard_True; + i--; + break; + } + else + cout << "theNewFace is NULL!!!\n"; + + } //# ISO lines + + ////////////////////////////////////////// + // TRY Boolean Fusion + ////////////////////////////////////////// + + // perform boolean operation + cout << "fusing ... \n"; + TopoDS_Face theNewFace; + + /*STEPControl_Writer wrt; + wrt.Transfer(f1, STEPControl_AsIs); + wrt.Transfer(f2, STEPControl_AsIs); + wrt.Write("beforecrash.stp");*/ + + TopoDS_Shape fsdShp; + + try + { + BRepAlgoAPI_Fuse fuser(f1, f2); + + if(!fuser.IsDone()) + cout << "### not fused!!!\n"; + + fsdShp = fuser.Shape(); + } + catch(...) + { + // cout << "Hello, I'm your fuser. I refuse to fuse. Sincerely, BRepAlgo_Fuse\n"; + } + + Handle(TopTools_HSequenceOfShape) fuseResults = new TopTools_HSequenceOfShape; + + Standard_Integer fcCnt(0); + for(TopExp_Explorer ex(fsdShp, TopAbs_FACE); ex.More(); ex.Next()) + { + fcCnt++; + theNewFace = TopoDS::Face(ex.Current()); + fuseResults->Append(theNewFace); + } + + + if(fcCnt != 1) // fusion failed # try diffrent fuse tool + { + cout << "1st fusing attempt failed\n"; + if(aAs1.GetType() == GeomAbs_Cylinder) + { + //cout << "# CYLINDER\n"; + // build Bounding Box + //////////////////////////// + Bnd_Box aBB; + BRepBndLib::Add(f1, aBB); + BRepBndLib::Add(f2, aBB); + aBB.SetGap(1); + + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + aBB.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + TopoDS_Shape aBox = BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin),gp_Pnt(aXmax, aYmax, aZmax)).Shape(); + gp_Pnt x(aXmin, aYmin, aZmin); + gp_Pnt y(aXmax, aYmax, aZmax); + + gp_Pnt centralPnt((y.X()+x.X())/2.0, (y.Y()+x.Y())/2.0, (y.Z()+x.Z())/2.0); + + gp_Cylinder aCyl = aAs1.Cylinder(); + TopoDS_Face cylFc = BRepBuilderAPI_MakeFace(aCyl).Face(); + + // Find Common from Bounding Box and the cylindrical Surface + ///////////////////////////////////////////////////////////// + BRepAlgoAPI_Common cmn1( cylFc, aBox); + TopoDS_Shape cmnShp1; + if(cmn1.IsDone()) + cmnShp1 = cmn1.Shape(); + + if(cmnShp1.IsNull()) + { + cout << "Null Shape computed!!\n"; + continue; + } + + // find curved edges + ///////////////////////////////////// + Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape; + for(TopExp_Explorer ex(f1, TopAbs_EDGE); ex.More(); ex.Next()) + edges->Append(ex.Current()); + for(TopExp_Explorer ex(f2, TopAbs_EDGE); ex.More(); ex.Next()) + edges->Append(ex.Current()); + + Handle(TopTools_HSequenceOfShape) curvedEdges = new TopTools_HSequenceOfShape; + + for(Standard_Integer i=1; i<=edges->Length(); i++) + { + TopoDS_Edge e = TopoDS::Edge(edges->Value(i)); + BRepAdaptor_Curve baCrv; + baCrv.Initialize(e); + + if(baCrv.GetType() == GeomAbs_Line) + continue; + else + curvedEdges->Append(e); + + // BRepTools::Dump(e, cout); + + } + edges->Clear(); + + + // split into edges for two faces + ////////////////////////////////// + Handle(TopTools_HSequenceOfShape) frstSeq = new TopTools_HSequenceOfShape; + + Standard_Integer rejCnt(0); + Standard_Integer maxRej(curvedEdges->Length()-3); + + //fill first + /////////////////// + for(Standard_Integer i=1; i<=curvedEdges->Length(); i++) + { + TopoDS_Edge curE = TopoDS::Edge(curvedEdges->Value(i)); + + if(frstSeq->Length() < 1) + { + frstSeq->Append(curE); + curvedEdges->Remove(1); + i--; + continue; + } + + TopExp_Explorer ex(curE, TopAbs_VERTEX); + TopoDS_Vertex v1 = TopoDS::Vertex(ex.Current()); + ex.Next(); + TopoDS_Vertex v2 = TopoDS::Vertex(ex.Current()); + + Standard_Boolean isAppended(Standard_False); + + for(Standard_Integer j=1; j<=frstSeq->Length(); j++) + { + TopoDS_Edge e_j = TopoDS::Edge(frstSeq->Value(j)); + for(TopExp_Explorer vEx(e_j, TopAbs_VERTEX); vEx.More(); vEx.Next()) + { + TopoDS_Vertex v_j = TopoDS::Vertex(vEx.Current()); + + if(v_j.IsSame(v1) || v_j.IsSame(v2)) + { + frstSeq->Append(curE); + curvedEdges->Remove(i); + maxRej = curvedEdges->Length() - 3; + rejCnt=0; + i--; + isAppended = Standard_True; + break; + } + } + if(isAppended) + break; + } + + if(!isAppended) + { + if(rejCnt == maxRej) // we're done here + break; + rejCnt++; + } + } + + // Build cut faces + ///////////////////////// + TopoDS_Face cF1, cF2; + + if(frstSeq->Length() < 2 || curvedEdges->Length() < 2) + continue; + + if(frstSeq->Length() == 2) + { + TopoDS_Edge ed = TopoDS::Edge(frstSeq->Value(1)); + gp_Pnt p1, p2, p3; + BRepAdaptor_Curve baC(ed); + baC.D0(baC.FirstParameter(), p1); + baC.D0((baC.FirstParameter()+baC.LastParameter())/2.0, p2); + baC.D0(baC.LastParameter(), p3); + + gp_Vec v1(p1, p2), v2(p1, p3), v3; + v3 = v1.Crossed(v2); + gp_Dir dir(v3); + gp_Pln pln1(p1, dir); + + cF1 = BRepBuilderAPI_MakeFace(pln1).Face(); + } + else + { + TopoDS_Edge ed1 = TopoDS::Edge(frstSeq->Value(1)); + TopoDS_Edge ed2 = TopoDS::Edge(frstSeq->Value(2)); + gp_Pnt p1, p2, p3, p4; + BRepAdaptor_Curve baC1(ed1); + BRepAdaptor_Curve baC2(ed2); + + baC1.D0(baC1.FirstParameter(), p1); + baC1.D0(baC1.LastParameter(), p2); + baC2.D0(baC2.FirstParameter(), p3); + baC2.D0(baC2.LastParameter(), p4); + + if(p3.IsEqual(p1, 1.e-3) || p3.IsEqual(p2, 1.e-3)) + p3 = p4; + + gp_Vec v1(p1, p2), v2(p1, p3), v3; + v3 = v1.Crossed(v2); + gp_Dir dir(v3); + gp_Pln pln1(p1, dir); + + cF1 = BRepBuilderAPI_MakeFace(pln1).Face(); + } + + if(curvedEdges->Length() == 2) + { + TopoDS_Edge ed = TopoDS::Edge(curvedEdges->Value(1)); + gp_Pnt p1, p2, p3; + BRepAdaptor_Curve baC(ed); + baC.D0(baC.FirstParameter(), p1); + baC.D0((baC.FirstParameter()+baC.LastParameter())/2.0, p2); + baC.D0(baC.LastParameter(), p3); + + gp_Vec v1(p1, p2), v2(p1, p3), v3; + v3 = v1.Crossed(v2); + gp_Dir dir(v3); + gp_Pln pln1(p1, dir); + + cF2 = BRepBuilderAPI_MakeFace(pln1).Face(); + } + else + { + TopoDS_Edge ed1 = TopoDS::Edge(curvedEdges->Value(1)); + TopoDS_Edge ed2 = TopoDS::Edge(curvedEdges->Value(2)); + gp_Pnt p1, p2, p3, p4; + BRepAdaptor_Curve baC1(ed1); + BRepAdaptor_Curve baC2(ed2); + + baC1.D0(baC1.FirstParameter(), p1); + baC1.D0(baC1.LastParameter(), p2); + baC2.D0(baC2.FirstParameter(), p3); + baC2.D0(baC2.LastParameter(), p4); + + if(p3.IsEqual(p1, 1.e-3) || p3.IsEqual(p2, 1.e-3)) + p3 = p4; + + gp_Vec v1(p1, p2), v2(p1, p3), v3; + v3 = v1.Crossed(v2); + gp_Dir dir(v3); + gp_Pln pln1(p1, dir); + + cF2 = BRepBuilderAPI_MakeFace(pln1).Face(); + } + + // cut result face on its ends + ///////////////////////////////// + TopoDS_Shape hSol1 = BRepPrimAPI_MakeHalfSpace(cF1,centralPnt).Solid(); + TopoDS_Shape hSol2 = BRepPrimAPI_MakeHalfSpace(cF2,centralPnt).Solid(); + + //resize half spaces + BRepAlgoAPI_Common resizer1(hSol1, aBox); + hSol1 = resizer1.Shape(); + BRepAlgoAPI_Common resizer2(hSol2, aBox); + hSol2 = resizer2.Shape(); + + BRepAlgoAPI_Common cmn3( cmnShp1, hSol1); + TopoDS_Shape cmnShp2 = cmn3.Shape(); + BRepAlgoAPI_Common cmn4( cmnShp2, hSol2); + TopoDS_Shape finalFace = cmn4.Shape(); + Standard_Integer cnt(0); + + for(TopExp_Explorer ex(finalFace, TopAbs_FACE); ex.More(); ex.Next()) + { + theNewFace = TopoDS::Face(ex.Current()); + cnt++; + } + + if(cnt != 1) + continue; + } + else + { + // cout << "OTHER\n"; + //BRepTools::Dump(f1, cout); + } + } + + // shape Heal + Handle(ShapeFix_Shape) shpFixer = new ShapeFix_Shape(theNewFace); + shpFixer->SetPrecision(1e-7); + shpFixer->SetMaxTolerance(1e-3); + shpFixer->FixWireTool()->FixRemovePCurveMode() = 1; + shpFixer->Perform(); + + fcCnt = 0; + if(shpFixer->Status(ShapeExtend_DONE) ) + { + TopoDS_Shape resFace = shpFixer->Shape(); + + for(TopExp_Explorer ex1(resFace, TopAbs_FACE); ex1.More(); ex1.Next()) + { + theNewFace = TopoDS::Face(ex1.Current()); + fcCnt++; + } + } + else + cout << "_#_McCadCSGTool_Extender.cxx :: Shape Heal failed!\n"; + + if(fcCnt > 1) + continue; + + // proceed + if(!theNewFace.IsNull()) + { + fcSeq->Remove(j); + fcSeq->Remove(i); + fcSeq->Append(theNewFace); + isFused = Standard_True; + + i--; + break; + } + } + catch(...) + { + cout << "_#_McCadCSGTool_Extender.cxx :: Face Fuse failed !!!" << endl; + } + } + else + { + cout << reversedOnly << endl; + exit(-1); + } + /*} + else + { + cout << "Not the same edge\n"; + if(aAs1.GetType() != GeomAbs_Torus) + { + STEPControl_Writer wrt; + wrt.Transfer(f1, STEPControl_AsIs); + wrt.Transfer(f2, STEPControl_AsIs); + wrt.Write("edges.stp"); + exit(-1); + } + } + } + if(isFused) + break; + }*/ + + if(isFused) + break; + } + } +// cout << "# Number of faces after fusing : " << fcSeq->Length() << endl; +// cout << "##################### LEAVING FUSE #########################\n\n"; + /*STEPControl_Writer wrt; + for(Standard_Integer i=1; i<=fcSeq->Length(); i++) + wrt.Transfer(fcSeq->Value(i), STEPControl_AsIs); + wrt.Write("fused.stp"); + exit(-1);*/ +} + + + +// we delete redundant resultant surfaces. Note that they are linear. + +////////////////////////////////////////////////////////////////////// +/* + for (Standard_Integer i = 1 ; i <= theResultantSeq->Length(); i++) + { + + TopoDS_Face theFace = TopoDS::Face(theResultantSeq->Value(i)); + + BRepAdaptor_Surface BS(theFace,Standard_True); + + GeomAdaptor_Surface theAdaptSurface = BS.Surface(); + + if (theAdaptSurface.GetType() != GeomAbs_Plane) { cout << "Non planar resultant " << endl; return;} + + gp_Pln rPln = theAdaptSurface.Plane(); + Standard_Real rA,rB,rC,rD; + rPln.Coefficients(rA,rB,rC,rD); + + // cout << " rDir X = " << rA << " Y = " << rB << " Z = " << rC << " " << rD << endl; + + for (ex.Init(mySolid,TopAbs_FACE); ex.More(); ex.Next()) + { + + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + + BRepAdaptor_Surface BS(aFace,Standard_True); + + GeomAdaptor_Surface adSurface = BS.Surface(); + + if (adSurface.GetType() == GeomAbs_Plane) + { + gp_Pln sPln = adSurface.Plane(); + + Standard_Real sA,sB,sC,sD; + + sPln.Coefficients(sA,sB,sC,sD); + // cout << " sDir X = " << sA << " Y = " << sB << " Z = " << sC << " " << sD << endl; + // this is a tmp solution: the tolerances should be corrected later. + if( (fabs(rA - sA) < 1e-3) && + (fabs(rB - sB) < 1e-3) && + (fabs(rC - sC) < 1e-3) && + (fabs(rD - sD) < 1e-3) ) + { + theResultantSeq->Remove(i); + cout << "... .. .. Deleting redundant resultants !!! " << endl; + } + } + } + } + */ +///////////////////////////////////////////////////////////////// + +/// we keep only sign constant resultants; reason see theoretical part +// if(theResultantSeq->Length() == 0){ +// Done(); +// cout << "All resultants seem to be redundant!!! " << endl; +// return; +// } + diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_FaceFuser.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_FaceFuser.cxx new file mode 100644 index 0000000..be22882 --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_FaceFuser.cxx @@ -0,0 +1,665 @@ +/* + * McCadCSGTool_FaceFuser.cxx + * + * Created on: Dec 15, 2010 + * Author: grosse + */ + +//#include + +#include +#include +#include +#include + + +McCadCSGTool_FaceFuser::McCadCSGTool_FaceFuser() +{ + Init(); +} + + +McCadCSGTool_FaceFuser::McCadCSGTool_FaceFuser(Handle_TopTools_HSequenceOfShape& faceSeq, + Standard_Boolean skipForwardOriented ) +{ + Init(); + myUseReverseOrientedOnly = skipForwardOriented; + AddShapes(faceSeq); + Fuse(); +} + + +McCadCSGTool_FaceFuser::McCadCSGTool_FaceFuser(TopoDS_Face& f1, TopoDS_Face& f2) +{ + Init(); + myOriginalFaces->Append(f1); + myOriginalFaces->Append(f2); + Fuse(); +} + + +void McCadCSGTool_FaceFuser::Init() +{ + myCurrentSurfaceType = GeomAbs_OtherSurface; + myIsDone = Standard_False; + myFusionFailed = Standard_False; + myUseReverseOrientedOnly = Standard_False; + + myFusedFaces = new TopTools_HSequenceOfShape; + myOriginalFaces = new TopTools_HSequenceOfShape; + +} + + +Standard_Boolean McCadCSGTool_FaceFuser::IsDone() +{ + return myIsDone; +} + + +Standard_Boolean McCadCSGTool_FaceFuser::FusionFailed() +{ + return myFusionFailed; +} + + +Handle_TopTools_HSequenceOfShape McCadCSGTool_FaceFuser::GetFused() +{ + if(!IsDone()) + Fuse(); + if(FusionFailed()) + { + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + msgr->Message("_#_McCadCSGTool_FaceFuser :: Lateral fusing of faces has failed!!!\n", + McCadMessenger_WarningMsg); + } + + return myFusedFaces; +} + +Handle_TopTools_HSequenceOfShape McCadCSGTool_FaceFuser::GetOriginal() +{ + return myOriginalFaces; +} + + +void McCadCSGTool_FaceFuser::AddShapes(Handle_TopTools_HSequenceOfShape& theShapes) +{ + for(Standard_Integer i=1; i<=theShapes->Length(); i++) + { + TopoDS_Shape curShape = theShapes->Value(i); + for(TopExp_Explorer ex(curShape, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face curFace = TopoDS::Face(ex.Current()); + myOriginalFaces->Append(curFace); + } + } +} + +void McCadCSGTool_FaceFuser::SkipForwardOriented(Standard_Boolean& state) +{ + myUseReverseOrientedOnly = state; +} + + + +Standard_Boolean McCadCSGTool_FaceFuser::IsLateral(const TopoDS_Face& f1, const TopoDS_Face& f2) +{ + TopLoc_Location loc; + const Handle(Geom_Surface)& surface1 = BRep_Tool::Surface(f1,loc); + GeomAdaptor_Surface adaptedSurface1(surface1); + const Handle(Geom_Surface)& surface2 = BRep_Tool::Surface(f2,loc); + GeomAdaptor_Surface adaptedSurface2(surface2); + + // surfaces not the same surface type? skip + if(adaptedSurface1.GetType() != adaptedSurface2.GetType()) + return Standard_False; + + TopAbs_Orientation orient1 = f1.Orientation(); + TopAbs_Orientation orient2 = f2.Orientation(); + + // surfaces not the same orientation? skip + if(orient1 != orient2) + return Standard_False; + + Handle(McCadCSGGeom_Surface) mccadSurface1; + Handle(McCadCSGGeom_Surface) mccadSurface2; + + // check which kind of surface type we have + if(adaptedSurface1.GetType() == GeomAbs_Plane) + { + myCurrentSurfaceType = GeomAbs_Plane; + mccadSurface1 = new McCadCSGGeom_Plane; + mccadSurface2 = new McCadCSGGeom_Plane; + } + else if(adaptedSurface1.GetType() == GeomAbs_Cylinder) + { + myCurrentSurfaceType = GeomAbs_Cylinder; + mccadSurface1 = new McCadCSGGeom_Cylinder; + mccadSurface2 = new McCadCSGGeom_Cylinder; + } + else if(adaptedSurface1.GetType() == GeomAbs_Cone) + { + myCurrentSurfaceType = GeomAbs_Cone; + mccadSurface1 = new McCadCSGGeom_Cone; + mccadSurface2 = new McCadCSGGeom_Cone; + } + else if(adaptedSurface1.GetType() == GeomAbs_Sphere) + { + myCurrentSurfaceType = GeomAbs_Sphere; + mccadSurface1 = new McCadCSGGeom_Sphere; + mccadSurface2 = new McCadCSGGeom_Sphere; + } + else if(adaptedSurface1.GetType() == GeomAbs_Torus) + { + myCurrentSurfaceType = GeomAbs_Torus; + mccadSurface1 = new McCadCSGGeom_Torus; + mccadSurface2 = new McCadCSGGeom_Torus; + } + else + myCurrentSurfaceType = GeomAbs_OtherSurface; + + + if(myCurrentSurfaceType == GeomAbs_OtherSurface) + return Standard_False; + + mccadSurface1->SetCasSurf(adaptedSurface1); + mccadSurface2->SetCasSurf(adaptedSurface2); + + if(!mccadSurface1->IsEqual(mccadSurface2)) + return Standard_False; + + + // check if the faces have a shared edge + for(TopExp_Explorer ex1(f1,TopAbs_EDGE); ex1.More(); ex1.Next()) + { + TopoDS_Edge e1 = TopoDS::Edge(ex1.Current()); + for(TopExp_Explorer ex2(f2,TopAbs_EDGE); ex2.More(); ex2.Next()) + { + TopoDS_Edge e2 = TopoDS::Edge(ex2.Current()); + if(e1.IsSame(e2)) // fails see trac#21 + return Standard_True; + } + } + + return Standard_False; + +} + +Standard_Boolean McCadCSGTool_FaceFuser::FaceBoundaryOnUVIsoLines(const TopoDS_Face& theFace) +{ + // this does only make sense for cones and cylinders!! + TopLoc_Location loc; + const Handle(Geom_Surface)& surface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface adaptedSurface(surface); + + Standard_Boolean onBounds(Standard_False); + Standard_Boolean firstSwitch(Standard_True); + + gp_Ax1 mainAx; + if(adaptedSurface.GetType() == GeomAbs_Cylinder) + mainAx = adaptedSurface.Cylinder().Axis(); + else if(adaptedSurface.GetType() == GeomAbs_Cone) + mainAx = adaptedSurface.Cone().Axis(); + else if(adaptedSurface.GetType() == GeomAbs_Sphere) + ; + else if(adaptedSurface.GetType() == GeomAbs_Torus) + mainAx = adaptedSurface.Torus().Axis(); + + for(TopExp_Explorer ex1(theFace, TopAbs_EDGE); ex1.More(); ex1.Next()) + { + Standard_Real first, mid, last; + TopoDS_Edge e1 = TopoDS::Edge(ex1.Current()); + + Handle(Geom_Curve) theCurve = BRep_Tool::Curve(e1, first, last); + + GeomAbs_CurveType crvType = GeomAdaptor_Curve(theCurve).GetType(); + + // check if curve lies on a plane ;; + if( crvType == GeomAbs_Line ) + continue; + if( crvType != GeomAbs_Circle ) + { + return Standard_False; + } + + + if(firstSwitch) + { + firstSwitch = Standard_False; + onBounds = Standard_True; + } + + mid = (first+last)/2.0; + + gp_Pnt p1, p2, p3; + theCurve->D0(first, p1); + theCurve->D0(mid, p2); + theCurve->D0(last, p3); + + gp_Vec v1(p2,p1), v2(p2,p3), v1xv2; + v1xv2 = v1.Crossed(v2); + + gp_Dir dir(v1xv2); + gp_Ax1 ax(p2, dir); + + if(!ax.IsParallel(mainAx, 0.01)) + onBounds = Standard_False; + } + + return onBounds; +} + + +// Perform fusion operations +///////////////////////////// +void McCadCSGTool_FaceFuser::Fuse() +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + Standard_Boolean unsupportedSurfaceType(Standard_False); + myFusionFailed = false; + + myFusedFaces->Clear(); + myFusedFaces->Append(myOriginalFaces); + + for(Standard_Integer i=1; i<=myFusedFaces->Length(); i++) + { + TopoDS_Face f1 = TopoDS::Face(myFusedFaces->Value(i)); + + // Check surface area + GProp_GProps GP1; + BRepGProp::SurfaceProperties(f1, GP1); + if(GP1.Mass() < 0.1) + continue; + + if(myUseReverseOrientedOnly == Standard_True && f1.Orientation() != TopAbs_REVERSED) + { + myFusedFaces->Remove(i); + i--; + continue; + } + + for(Standard_Integer j=myFusedFaces->Length(); j>i; j--) + { + TopoDS_Face f2 = TopoDS::Face(myFusedFaces->Value(j)); + + // Check surface area + GProp_GProps GP2; + BRepGProp::SurfaceProperties(f2, GP2); + if(GP2.Mass() < 0.1) + continue; + + if(myUseReverseOrientedOnly == Standard_True && f2.Orientation() != TopAbs_REVERSED) + { + myFusedFaces->Remove(j); + continue; + } + + if(IsLateral(f1, f2)) + { + Handle_TopTools_HSequenceOfShape curFaces = new TopTools_HSequenceOfShape; + curFaces->Append(f1); + curFaces->Append(f2); + + // Try to use the OpenCascade Boolean Operation Fuse Method + if(!OCCFuse(curFaces)) + { + switch(myCurrentSurfaceType) + { + case GeomAbs_Plane: + PlaneFuse(curFaces); + break; + case GeomAbs_Cylinder: + CylinderFuse(curFaces); + break; + case GeomAbs_Cone: + CylinderFuse(curFaces); + break; + case GeomAbs_Sphere: + SphereFuse(curFaces); + break; + case GeomAbs_Torus: + SphereFuse(curFaces); + break; + default: + msgr->Message("_#_McCadCSGTool_FaceFuser :: Trying to fuse faces of unsupported surface type!", + McCadMessenger_WarningMsg); + myFusedFaces->Remove(j); + myFusedFaces->Remove(i); + i--; + unsupportedSurfaceType = Standard_True; + break; + } + + // break j-loop + if(unsupportedSurfaceType) + { + unsupportedSurfaceType = Standard_False; + break; + } + + if(curFaces->Length() > 1) + myFusionFailed = Standard_True; + else + { + myFusedFaces->Remove(j); + myFusedFaces->Remove(i); + myFusedFaces->Append(curFaces); + i--; + break; // j-loop + } + } + else // OCC fuse operation was successful + { + myFusedFaces->Remove(j); + myFusedFaces->Remove(i); + myFusedFaces->Append(curFaces); + i--; + break; // j-loop + } + } + } + } + myIsDone = true; +} + +// Try OCC fuse operation +////////////// +Standard_Boolean McCadCSGTool_FaceFuser::OCCFuse(Handle_TopTools_HSequenceOfShape& faces) +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + + if(faces->Length() != 2) + return Standard_False; + + TopoDS_Face f1 = TopoDS::Face(faces->Value(1)); + TopoDS_Face f2 = TopoDS::Face(faces->Value(2)); + + TopoDS_Shape fusedShape; + + try + { + // use older BRepAlgo_Fuse instead of BRepAlgoAPI_Fuse; it delivers better results... + BRepAlgo_Fuse occFuser(f1, f2); + + if(!occFuser.IsDone()) + { + msgr->Message("_#_McCadCSGTool_FaceFuser :: Boolean Fuse Operation failed for two faces!", + McCadMessenger_WarningMsg); + return Standard_False; + } + + fusedShape = occFuser.Shape(); + } + catch(...) + { + msgr->Message("_#_McCadCSGTool_FaceFuser :: Boolean Fuse Operation crashed!!!\n", + McCadMessenger_WarningMsg); + return Standard_False; + } + + Handle_TopTools_HSequenceOfShape fuseResults = new TopTools_HSequenceOfShape; + + for(TopExp_Explorer ex(fusedShape, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face theNewFace = TopoDS::Face(ex.Current()); + fuseResults->Append(theNewFace); + } + + if(fuseResults->Length() != 1) + return Standard_False; + + TopoDS_Face newFace = TopoDS::Face(fuseResults->Value(1)); + + // check validity of Result + ////////////////////////////////////// + BRepCheck_Analyzer faceAnalyzer(newFace, Standard_True); + if(!faceAnalyzer.IsValid()) + return Standard_False; + + // adjust orientation if neccessary -- in some cases this is needed (even for fusion of planar faces)!!! + faces->Clear(); + if(newFace.Orientation() != f1.Orientation()) + newFace.Orientation(f1.Orientation()); + faces->Append(newFace); + + return Standard_True; +} + + +// surface specific fuse + +void McCadCSGTool_FaceFuser::CylinderFuse(Handle_TopTools_HSequenceOfShape& faces) +{ + TopoDS_Face f1 = TopoDS::Face(faces->Value(1)); + TopoDS_Face f2 = TopoDS::Face(faces->Value(2)); + + if(FaceBoundaryOnUVIsoLines(f1) && FaceBoundaryOnUVIsoLines(f2)) + { + Standard_Real UMin1(0.0), UMin2(0.0), UMin(0.0), UMax1(0.0), UMax2(0.0), UMax(0.0), + VMin1(0.0), VMin2(0.0), VMin(0.0), VMax1(0.0), VMax2(0.0), VMax(0.0); + BRepTools::UVBounds(f1,UMin1,UMax1, VMin1, VMax1); + BRepTools::UVBounds(f2,UMin2,UMax2, VMin2, VMax2); + + // Nullify small dimensions + if(Abs(UMin1) < 1.e-10) + UMin1 = 0.0; + if(Abs(UMin2) < 1.e-10) + UMin2 = 0.0; + if(Abs(UMax1) < 1.e-10) + UMax1 = 0.0; + if(Abs(UMax2) < 1.e-10) + UMax2 = 0.0; + if(Abs(VMin1) < 1.e-10) + VMin1 = 0.0; + if(Abs(VMin2) < 1.e-10) + VMin2 = 0.0; + if(Abs(VMax1) < 1.e-10) + VMax1 = 0.0; + if(Abs(VMax2) < 1.e-10) + VMax2 = 0.0; + + // figure out the boundary + if(Abs(UMax1-UMin1+UMax2-UMin2 - 2*M_PI) < 1e-5) + { + UMin = 0; + UMax = 2*M_PI; + } + else + { + if( Abs(UMin1-UMax2) < 1.0e-5 || ( UMin1 == 0 && Abs(UMax2-2*M_PI) < 1e-7 ) ) + { + UMin = UMin2; + UMax = UMax1; + } + else if( Abs(UMin2-UMax1) < 1.0e-5 || ( UMin2 == 0 && Abs(UMax1-2*M_PI) < 1e-7 ) ) + { + UMin = UMin1; + UMax = UMax2; + } + + if(UMax < UMin) + UMax += 2*M_PI; + } + + if (VMin1 <= VMin2) + VMin = VMin1; + else + VMin = VMin2; + + if (VMax1 >= VMax2) + VMax = VMax1; + else + VMax = VMax2; + + // make new face + TopLoc_Location loc; + Handle(Geom_Surface) surface = BRep_Tool::Surface(f1,loc); +#ifdef OCC650 + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(surface, UMin,UMax, VMin, VMax).Face(); +#else + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(surface, UMin,UMax, VMin, VMax, 1.e-7).Face(); +#endif + theNewFace.Orientation(f1.Orientation()); + + faces->Clear(); + faces->Append(theNewFace); + } + else // Todo : how to fuse to lateral cylindrical faces, that have skewed ends? + { + + } +} + +void McCadCSGTool_FaceFuser::ConeFuse(Handle_TopTools_HSequenceOfShape& faces) +{ + cout << "Cone Fuse -- NOT IMPLEMENTED!!!!!!!!!!!\n"; +} + +void McCadCSGTool_FaceFuser::SphereFuse(Handle_TopTools_HSequenceOfShape& faces) +{ + if(faces->Length() != 2) + return; + + TopoDS_Face f1 = TopoDS::Face(faces->Value(1)); + TopoDS_Face f2 = TopoDS::Face(faces->Value(2)); + + Standard_Real UMin1(0.0), UMin2(0.0), UMin(0.0), UMax1(0.0), UMax2(0.0), UMax(0.0), + VMin1(0.0), VMin2(0.0), VMin(0.0), VMax1(0.0), VMax2(0.0), VMax(0.0); + BRepTools::UVBounds(f1,UMin1,UMax1, VMin1, VMax1); + BRepTools::UVBounds(f2,UMin2,UMax2, VMin2, VMax2); + + // Nullify small dimensions + if(Abs(UMin1) < 1.e-10) + UMin1 = 0.0; + if(Abs(UMin2) < 1.e-10) + UMin2 = 0.0; + if(Abs(UMax1) < 1.e-10) + UMax1 = 0.0; + if(Abs(UMax2) < 1.e-10) + UMax2 = 0.0; + if(Abs(VMin1) < 1.e-10) + VMin1 = 0.0; + if(Abs(VMin2) < 1.e-10) + VMin2 = 0.0; + if(Abs(VMax1) < 1.e-10) + VMax1 = 0.0; + if(Abs(VMax2) < 1.e-10) + VMax2 = 0.0; + + if(Abs(UMin1 - UMin2) < 1e-7 && Abs(UMax1-UMax2) < 1e-7 ) + { + if(Abs((VMax2-VMin1)-2*M_PI)<1e-7 || Abs((VMax1-VMin2)-2*M_PI)<1e-7) + { + VMin = 0; + VMax = 2*M_PI; + } + UMin = UMin1; + UMax = UMax1; + } + if(Abs(VMin1 - VMin2) < 1e-7 && Abs(VMax1 - VMax2) < 1e-7) + { + if(Abs((UMax2-UMin1)-2*M_PI)<1e-7 || Abs((UMax1-UMin2)-2*M_PI)<1e-7) + { + UMin = 0; + UMax = 2*M_PI; + } + VMin=VMin1; + VMax=VMax1; + } + + TopLoc_Location loc; + Handle(Geom_Surface) surface = BRep_Tool::Surface(f1,loc); +#ifdef OCC650 + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(surface, UMin,UMax, VMin, VMax).Face(); +#else + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(surface, UMin,UMax, VMin, VMax, 1.e-7).Face(); +#endif + theNewFace.Orientation(f1.Orientation()); + + faces->Clear(); + faces->Append(theNewFace); +} + +void McCadCSGTool_FaceFuser::TorusFuse(Handle_TopTools_HSequenceOfShape& faces) +{ + cout << "Torus Fuse\n "; + + if(faces->Length() != 2) + return; + + TopoDS_Face f1 = TopoDS::Face(faces->Value(1)); + TopoDS_Face f2 = TopoDS::Face(faces->Value(2)); + + Standard_Real UMin1(0.0), UMin2(0.0), UMin(0.0), UMax1(0.0), UMax2(0.0), UMax(0.0), + VMin1(0.0), VMin2(0.0), VMin(0.0), VMax1(0.0), VMax2(0.0), VMax(0.0); + BRepTools::UVBounds(f1,UMin1,UMax1, VMin1, VMax1); + BRepTools::UVBounds(f2,UMin2,UMax2, VMin2, VMax2); + + // Nullify small dimensions + if(Abs(UMin1) < 1.e-10) + UMin1 = 0.0; + if(Abs(UMin2) < 1.e-10) + UMin2 = 0.0; + if(Abs(UMax1) < 1.e-10) + UMax1 = 0.0; + if(Abs(UMax2) < 1.e-10) + UMax2 = 0.0; + if(Abs(VMin1) < 1.e-10) + VMin1 = 0.0; + if(Abs(VMin2) < 1.e-10) + VMin2 = 0.0; + if(Abs(VMax1) < 1.e-10) + VMax1 = 0.0; + if(Abs(VMax2) < 1.e-10) + VMax2 = 0.0; + + //cout << UMin1 << " " << UMax1 << " - " << VMin1 << " " << VMax1 << endl; + //cout << UMin2 << " " << UMax2 << " - " << VMin2 << " " << VMax2 << endl; + + if(Abs(UMin1 - UMin2) < 1e-7 && Abs(UMax1-UMax2) < 1e-7 ) + { + if(Abs((VMax2-VMin1)-2*M_PI)<1e-7 || Abs((VMax1-VMin2)-2*M_PI)<1e-7) + { + VMin = 0; + VMax = 2*M_PI; + } + UMin = UMin1; + UMax = UMax1; + } + if(Abs(VMin1 - VMin2) < 1e-7 && Abs(VMax1 - VMax2) < 1e-7) + { + if(Abs((UMax2-UMin1)-2*M_PI)<1e-7 || Abs((UMax1-UMin2)-2*M_PI)<1e-7) + { + UMin = 0; + UMax = 2*M_PI; + } + VMin=VMin1; + VMax=VMax1; + } + + TopLoc_Location loc; + Handle(Geom_Surface) surface = BRep_Tool::Surface(f1,loc); +#ifdef OCC650 + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(surface, UMin,UMax, VMin, VMax).Face(); +#else + TopoDS_Face theNewFace = BRepBuilderAPI_MakeFace(surface, UMin,UMax, VMin, VMax, 1.e-7).Face(); +#endif + theNewFace.Orientation(f1.Orientation()); + +/* STEPControl_Writer wrt; + wrt.Transfer(f1, STEPControl_AsIs); + wrt.Transfer(f2, STEPControl_AsIs); + wrt.Transfer(theNewFace, STEPControl_AsIs); + wrt.Write("torus.stp");*/ + + faces->Clear(); + faces->Append(theNewFace); +} + +void McCadCSGTool_FaceFuser::PlaneFuse(Handle_TopTools_HSequenceOfShape& faces) +{ +// fusing of planes is not necessary for the algorithm +// the fusing is ment for higher order surfaces +} + diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_SignCheck.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_SignCheck.cxx new file mode 100644 index 0000000..98d09d0 --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_SignCheck.cxx @@ -0,0 +1,601 @@ +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadCSGTool_SignCheck::McCadCSGTool_SignCheck() +{ + mySignIsConstant = Standard_False; + myIsDone = Standard_False; +} + + +McCadCSGTool_SignCheck::McCadCSGTool_SignCheck(const TopoDS_Shape& theSolid) +{ + mySignIsConstant = Standard_False; + myIsDone = Standard_False; + Init(theSolid); +} + + +void McCadCSGTool_SignCheck::Init(const TopoDS_Shape& theSolid) +{ + NotDone(); + + mySolid = theSolid; + myExtFaceIndex = 0; + myAllExtFace = new McCadTDS_HSequenceOfExtFace(); + + //append sample points of the solid + mySamplePnt = new TColgp_HSequenceOfPnt; + mySamplePnt->Append(McCadCSGTool::SamplePoints(mySolid)); + + Classify(); + Done(); +} + + +Standard_Boolean McCadCSGTool_SignCheck::IsDone() const +{ + return myIsDone; +} + + +void McCadCSGTool_SignCheck::Done() +{ + myIsDone = Standard_True; +} + + +void McCadCSGTool_SignCheck::NotDone() +{ + myIsDone = Standard_False; +} + + +Handle(McCadTDS_ExtFace) McCadCSGTool_SignCheck::GetExtFace() +{ + if(myAllExtFace->Length()== 0 ) + return 0; + + myExtFaceIndex++; + //myExtFace = Rank(myAllExtFace); + myExtFace = myAllExtFace->Value(myExtFaceIndex); + + AdjustFaceUV(); + + return myExtFace; +} + + +Standard_Integer McCadCSGTool_SignCheck::NbExtFace() const +{ + return myAllExtFace->Length() - myExtFaceIndex; +} + + +void McCadCSGTool_SignCheck::Classify() { + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt; + thePntSeq->Append(mySamplePnt); //All Sample Points of current Solid + + if (!thePntSeq->Length()) { + msgr->Message("_#_McCadCSGTool_SignCheck.cxx :: No sample points available", + McCadMessenger_ErrorMsg); + NotDone(); + return; + } + Handle(McCadTDS_HSequenceOfExtFace) aResultantSeq = new McCadTDS_HSequenceOfExtFace; + Handle(McCadTDS_HSequenceOfExtFace) aSignFaceSeq = new McCadTDS_HSequenceOfExtFace; + + // fuse nonlinear FACES BEFORE GENERATING RESULTANTS + Handle(TopTools_HSequenceOfShape) faceSeq = new TopTools_HSequenceOfShape; + Handle(TopTools_HSequenceOfShape) planeSeq = new TopTools_HSequenceOfShape; + + // sort out planar faces, delete redundant planes + TopLoc_Location loc; + //For all Faces of current solid + for (TopExp_Explorer ex(mySolid, TopAbs_FACE); ex.More(); ex.Next()) { + TopoDS_Face exFace = TopoDS::Face(ex.Current()); + + const Handle(Geom_Surface)& exFaceSurface = BRep_Tool::Surface(exFace,loc); + GeomAdaptor_Surface adaptorSurface(exFaceSurface); + + // remove planar faces that ly on the same surface;; only the surface is important for sign constancy + // no need for fusing for planar faces!!! + ////////////////////////////// + if(adaptorSurface.GetType() == GeomAbs_Plane) + { + Standard_Boolean sameSurfaceFound(Standard_False); + + gp_Pln thePln = adaptorSurface.Plane(); + Standard_Real sA, sB, sC, sD; + thePln.Coefficients(sA, sB, sC, sD); + + for(Standard_Integer i=1; i<= planeSeq->Length(); i++) { + TopoDS_Face otherFace = TopoDS::Face(planeSeq->Value(i)); + const Handle(Geom_Surface)& otherSurface = BRep_Tool::Surface(otherFace,loc); + GeomAdaptor_Surface otherAdaptorSurface(otherSurface); + + gp_Pln otherPln = otherAdaptorSurface.Plane(); + Standard_Real oA, oB, oC, oD; + otherPln.Coefficients(oA, oB, oC, oD); + + Standard_Real localTolerance = 1.e-5; + if( ( Abs( oA - sA ) < localTolerance && + Abs( oB - sB ) < localTolerance && + Abs( oC - sC ) < localTolerance && + Abs( oD - sD ) < localTolerance ) || + ( Abs( oA + sA ) < localTolerance && + Abs( oB + sB ) < localTolerance && + Abs( oC + sC ) < localTolerance && + Abs( oD + sD ) < localTolerance ) ) + { + sameSurfaceFound = Standard_True; + break; + } + } + if(!sameSurfaceFound) + planeSeq->Append(exFace); + } + else + faceSeq->Append(exFace); + } + + // fuse non planar faces + McCadCSGTool_FaceFuser faceFuser(faceSeq); + faceSeq->Clear(); + faceSeq->Append(faceFuser.GetFused()); + faceSeq->Append(planeSeq); + + // test for all faces if extension of boundary support set is neccessary + for(int i=1; i<=faceSeq->Length(); i++) { + TopoDS_Face theFace = TopoDS::Face(faceSeq->Value(i)); + Handle(McCadTDS_ExtFace) extFace = new McCadTDS_ExtFace(theFace); + TopLoc_Location L; + BRepAdaptor_Surface BS(theFace, Standard_True); + TopAbs_Orientation orient = theFace.Orientation(); + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,L); + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + + // Evaluate Sample Points for current face + for (Standard_Integer i = 1; i <= thePntSeq->Length(); i++) { + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptFaceSurface, thePntSeq->Value(i)); // get result of Face Equation for current Sample Point + + if (aVal > 1.e-6) + extFace->AppendPosPnt(thePntSeq->Value(i)); + if (aVal < -1.e-6) + extFace->AppendNegPnt(thePntSeq->Value(i)); + } + + if( extFace->GetNegPoints()->Length() < 1 && + extFace->GetPosPoints()->Length() < 1 ) + msgr->Message("_#_McCadCSGTool_SignCheck :: no positive and no negative points found\n"); + + // define orientation of cut face + Standard_Integer NbPosPnt = extFace->NbPosPnt(); + Standard_Integer NbNegPnt = extFace->NbNegPnt(); + if ((orient != TopAbs_FORWARD) && (orient != TopAbs_REVERSED)) { + msgr->Message("_#_McCadCSGTool_SignCheck.cxx :: Warning: Face orientation heuristically.", + McCadMessenger_WarningMsg); + if (NbPosPnt > NbNegPnt) { + theFace.Orientation(TopAbs_REVERSED); + extFace->SetFace(theFace); + } + else if (NbPosPnt < NbNegPnt) { + theFace.Orientation(TopAbs_FORWARD); + extFace->SetFace(theFace); + } + else { + theFace.Orientation(TopAbs_FORWARD); + extFace->SetFace(theFace); + msgr->Message("_#_McCadCSGTool_SignCheck : Face orientation heuristically.", McCadMessenger_WarningMsg); + } + } + + // determine if cut face is extending the boundary support set + if (orient == TopAbs_FORWARD && NbPosPnt > 0) + extFace->SetHaveExt(Standard_True); + else if (orient == TopAbs_REVERSED && NbNegPnt > 0) + extFace->SetHaveExt(Standard_True); + else { + extFace->SetHaveExt(Standard_False); + } + + if (extFace->HaveExt()) + aSignFaceSeq->Append(extFace); + } + + // compute resultants for non-linear cut faces + for(int i=1; i<=aSignFaceSeq->Length(); i++) { + TopoDS_Face aF = (aSignFaceSeq->Value(i))->GetFace(); + BRepAdaptor_Surface aBS(aF, Standard_True); + GeomAdaptor_Surface aAS = aBS.Surface(); + + if (aAS.GetType() == GeomAbs_Plane) // append only planar faces to myAllExtFace + myAllExtFace->Append(aSignFaceSeq->Value(i)); + else // compute resultants for non linear faces + myAllExtFace->Append(SingChangingResultants(aSignFaceSeq->Value(i))); + } + + // sort cut faces by area content + myExtFace = Rank(myAllExtFace); + + if (myAllExtFace->Length() > 0) { + mySignIsConstant = Standard_True; + return; + } + else { + mySignIsConstant = Standard_False; + return; + } +} + + +Handle(McCadTDS_HSequenceOfExtFace) McCadCSGTool_SignCheck::SingChangingResultants(const Handle(McCadTDS_ExtFace)& theExtFace) const +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + Handle(McCadTDS_ExtFace) extFace = theExtFace; + Handle(McCadTDS_HSequenceOfExtFace) extResFaceSeq = new McCadTDS_HSequenceOfExtFace(); + ///////////////////////////////////////////////////////////////////////////////////////////////// + // It is preferable to use adapted pseudo resultants called by McCadCSGTool::Resultants(extFace->GetFace()). + // But they work if their support is on outer side. If the support starts in the inner side and end + // with a contact with the outer side they fail to be sign changing..... + // Therefore we try first if we can get valid adapted pseudo resultants if this fails we compute + // the Boxed resultants. + /////////////////////////////////////////////////////////////////////////////////////////////// + + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt; + thePntSeq->Append(mySamplePnt); + Standard_Boolean successful = Standard_False; + Standard_Boolean isTorus = Standard_False; + Handle(TopTools_HSequenceOfShape) theResultants = new TopTools_HSequenceOfShape; + + // trigger for torus to Boxed computation: for the torus boxed resultatns are used always. + TopoDS_Face aF = extFace->GetFace(); + BRepAdaptor_Surface aBS(aF,Standard_True); + GeomAdaptor_Surface aAS = aBS.Surface(); + if (aAS.GetType() == GeomAbs_Torus) + isTorus = Standard_True; + + // add face sample points to make life easy + theResultants = McCadCSGTool::BoxResultants(aF); + for(TopExp_Explorer ex(mySolid,TopAbs_VERTEX); ex.More(); ex.Next()) + thePntSeq->Append(BRep_Tool::Pnt(TopoDS::Vertex(ex.Current()))); + + for (Standard_Integer j=1; j <=theResultants->Length(); j++) { + if(theResultants->Value(j).IsNull()) { + msgr->Message("_#_McCadCSGTool_SignCheck.cxx :: NULL Resultant skipped!!!\n", + McCadMessenger_WarningMsg); + continue; + } + + TopoDS_Face theFace = TopoDS::Face(theResultants->Value(j)); + + Handle(McCadTDS_ExtFace) extFace = new McCadTDS_ExtFace(theFace); + BRepAdaptor_Surface BS(theFace,Standard_True); + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + + for (Standard_Integer i=1; i <= thePntSeq->Length(); i++) { + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptFaceSurface, thePntSeq->Value(i)); + + if(aVal >= 0.1 ) + extFace->AppendPosPnt(thePntSeq->Value(i)); + else if (aVal < -0.1 ) + extFace->AppendNegPnt(thePntSeq->Value(i)); + } + + Standard_Integer NbPosPnt = extFace->NbPosPnt(); + Standard_Integer NbNegPnt = extFace->NbNegPnt(); + + if (NbPosPnt > 0 && NbNegPnt > 0 ) { + extFace->SetHaveExt(Standard_True); + extResFaceSeq->Append(extFace); + successful = Standard_True; + } + else { + extFace->SetHaveExt(Standard_False); + } + } + if (successful) + return extResFaceSeq; + else // not sign changing ... + extResFaceSeq->Clear(); + + // non-toroidal surfaces + if (!isTorus) { + theResultants = McCadCSGTool::Resultants(extFace->GetFace()); + for (Standard_Integer j=1; j <=theResultants->Length(); j++) { + TopoDS_Face theFace = TopoDS::Face(theResultants->Value(j)); + Handle(McCadTDS_ExtFace) extFace = new McCadTDS_ExtFace(theFace); + BRepAdaptor_Surface BS(theFace,Standard_True); + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + + for (Standard_Integer i=1; i <= thePntSeq->Length(); i++) { + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptFaceSurface, thePntSeq->Value(i)); + + if(aVal > 0.1 ) + extFace->AppendPosPnt(thePntSeq->Value(i)); + else if (aVal < -0.1 ) + extFace->AppendNegPnt(thePntSeq->Value(i)); + } + + Standard_Integer NbPosPnt = extFace->NbPosPnt(); + Standard_Integer NbNegPnt = extFace->NbNegPnt(); + + if (NbPosPnt > 0 && NbNegPnt > 0 ) { + extFace->SetHaveExt(Standard_True); + extResFaceSeq->Append(extFace); + successful = Standard_True; + } + else + extFace->SetHaveExt(Standard_False); + } + } + + if (successful) { + cout << " Pseudo Resultants used. Number of resultants = "<< extResFaceSeq->Length() << endl; + return extResFaceSeq; + } + + return extResFaceSeq; +} + + //////////////////////////////////////////////////////////////////// + // if the abouve fail we use more sample points. +/* thePntSeq->Clear(); + thePntSeq->Append(McCadCSGTool::AllSamplePoints(mySolid)); + for(TopExp_Explorer ex(mySolid,TopAbs_VERTEX); ex.More(); ex.Next()) + { + thePntSeq->Append(BRep_Tool::Pnt(TopoDS::Vertex(ex.Current()))); + } + //////////////////////////////////////////////////////////////////// + theResultants = McCadCSGTool::AppBoxResultants(extFace->GetFace()); + cout << "Extended Box Resultants ............... being calculated ..." << endl; + successful = Standard_False; + + for (Standard_Integer j=1; j <=theResultants->Length(); j++) + { + TopoDS_Face theFace = TopoDS::Face(theResultants->Value(j)); + + Handle(McCadTDS_ExtFace) extFace = new McCadTDS_ExtFace(theFace); + + BRepAdaptor_Surface BS(theFace,Standard_True); + + GeomAdaptor_Surface theAdaptFaceSurface = BS.Surface(); + + //TopAbs_Orientation orient = theFace.Orientation(); + + // GeomAbs_SurfaceType surfType = theAdaptFaceSurface.GetType(); + + cout << "............................................................" << endl; + + for (Standard_Integer i=1; i <= thePntSeq->Length(); i++) + { + + Standard_Real aVal = McCadGTOOL::Evaluate(theAdaptFaceSurface, thePntSeq->Value(i)); + + // cout << "Resultant: aVal = " << aVal << endl; + + if(aVal > 1.5 ) + extFace->AppendPosPnt(thePntSeq->Value(i)); + else if (aVal < -1.5 ) + extFace->AppendNegPnt(thePntSeq->Value(i)); + } + + Standard_Integer NbPosPnt = extFace->NbPosPnt(); + Standard_Integer NbNegPnt = extFace->NbNegPnt(); + + if (NbPosPnt > 0 && NbNegPnt > 0 ) + extFace->SetHaveExt(Standard_True); + else + extFace->SetHaveExt(Standard_False); + + if(extFace->HaveExt()) + { + + if (NbPosPnt == 0) + { + cout << "Warning:: Can not compute Sample points around face !! " << endl; + + } + else if (NbNegPnt == 0) + { + cout << "Warning:: Can not compute Sample points around face !! " << endl; + } + successful = Standard_True; + extResFaceSeq->Append(extFace); + } + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (successful) + { + cout << " Boxed Resultants with samples used. Number of resultants = "<< extResFaceSeq->Length() << endl; + return extResFaceSeq; + } + else + { + cout << "Warning:: Boxed Resultants with samples can not be computed!!! "<< extResFaceSeq->Length() << endl; + cout << "Warning:: Resultant computation failed due to failing sample points !!! " << endl; + extResFaceSeq->Clear(); + return extResFaceSeq; + }*/ + + +Handle(McCadTDS_ExtFace) McCadCSGTool_SignCheck::Rank(Handle(McCadTDS_HSequenceOfExtFace)& aExtFaceSeq) +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + Handle(McCadTDS_HSequenceOfExtFace) theExtFaceSeq = aExtFaceSeq; + //1. the ranking is performed through the number of faces supported. + ///////////////////////////////////////////////////////////////////////////////////////////////// + // face area based ranking base on feature assumption. + // big faces determine the feature of the shape + Handle(TColStd_HSequenceOfReal) areaSeq = new TColStd_HSequenceOfReal(); + Standard_Real area; + + for (Standard_Integer i=1; i <= theExtFaceSeq->Length(); i++) + { + TopoDS_Face exFace = (theExtFaceSeq->Value(i))->GetFace(); + GProp_GProps GP; + BRepGProp::SurfaceProperties(exFace,GP); + area= GP.Mass(); + if(area <= 1.0e-7) + { + // small face heuristics in the hope that they do not affect the computation!! + theExtFaceSeq->Remove(i); + TCollection_AsciiString msg("_#_McCadCSGTool_SignCheck.cxx :: Small area face removed; Area : "); + + msg += area; + msgr->Message(msg.ToCString()); + } + else + areaSeq->Append(area); +// cout << i << ". Area of Face = " << area <Length() >1) + { + for (Standard_Integer j = 2; j<= areaSeq->Length(); j++) + { + Standard_Integer k; + Standard_Real tmpArea = areaSeq->Value(j); + for (k = j-1; k>=1; k--) + { + if (tmpArea > areaSeq->Value(k)) + { + areaSeq->SetValue(k+1,areaSeq->Value(k)); + theExtFaceSeq->Exchange(k+1,k); + } + else + break; + } + areaSeq->SetValue(k+1,tmpArea); + } + } + + if (theExtFaceSeq->Length() > 0) + return theExtFaceSeq->Value(1); + else + return 0; +} + + +void McCadCSGTool_SignCheck::AdjustFaceUV() +{ + //The underlying surface of an extFace is here always planar. + //The extended Face will be used for linear halfspace construction. Therefore umin,umax,vmin, and vmax should be + // adjusted. we set this values to 1e7, i.e., 100 meters. + + TopoDS_Face theFace = myExtFace->GetFace(); + Standard_Real prec = BRep_Tool::Tolerance(theFace); + //cout << "Old Tolerance of Face = " << prec < + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace std; + +McCadCSGTool_SurfaceChecker::McCadCSGTool_SurfaceChecker() {} + +McCadCSGTool_SurfaceChecker::~McCadCSGTool_SurfaceChecker() {} + +bool McCadCSGTool_SurfaceChecker::printSurfaceInfo(Handle_TopTools_HSequenceOfShape & shapes, + TCollection_AsciiString inName, + TCollection_AsciiString logFileName) +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + bool freeFromInvalidSurfaces(true); + ofstream output; + + if(logFileName.IsEmpty()) + { + cout << "\n\n\n**************************************************\n\nFILE: " << inName.ToCString() << "\n" << endl; + cout << "number of solids : " << shapes->Length() << endl; + } + else + { + output.open(logFileName.ToCString(), ios_base::app); + output << "\n\n\n**************************************************\n\nFILE: " << inName.ToCString() << "\n" << endl; + output << "number of solids : " << shapes->Length() << endl; + } + + + Handle_TopTools_HSequenceOfShape invalidSurfaceSeq = new TopTools_HSequenceOfShape; + + // check surface types!!! + for(int i=1; i<=shapes->Length(); i++) + { + TopoDS_Shape tmpShp = shapes->Value(i); + TopExp_Explorer ex(tmpShp, TopAbs_FACE); + + Standard_Integer plnCnt(0), cylCnt(0), conCnt(0), sphCnt(0), torCnt(0), bzrCnt(0), splnCnt(0), extrCnt(0), revCnt(0), offsetCnt(0), otherCnt(0); + Standard_Integer allCnt(0); + + for(; ex.More(); ex.Next()) + { + allCnt++; + TopoDS_Face curF = TopoDS::Face(ex.Current()); + TopLoc_Location aLoc; + Handle(Geom_Surface) aSurf = BRep_Tool::Surface(curF, aLoc); + GeomAdaptor_Surface adSurf(aSurf); + switch(adSurf.GetType()) + { + case GeomAbs_Plane: + plnCnt++; + break; + case GeomAbs_Cylinder: + cylCnt++; + break; + case GeomAbs_Cone: + conCnt++; + break; + case GeomAbs_Sphere: + sphCnt++; + break; + case GeomAbs_Torus: + { // TODO : check for right orientation || Tori must be axis parallel + torCnt++; + break; + } + case GeomAbs_BezierSurface: + invalidSurfaceSeq->Append(curF); + bzrCnt++; + break; + case GeomAbs_BSplineSurface: + invalidSurfaceSeq->Append(curF); + splnCnt++; + break; + case GeomAbs_SurfaceOfRevolution: + invalidSurfaceSeq->Append(curF); + revCnt++; + break; + case GeomAbs_SurfaceOfExtrusion: + invalidSurfaceSeq->Append(curF); + extrCnt++; + break; + case GeomAbs_OffsetSurface: + invalidSurfaceSeq->Append(curF); + offsetCnt++; + break; + default: + invalidSurfaceSeq->Append(curF); + otherCnt++; + break; + } + } + + TCollection_AsciiString message("\nSurface Information for Solid : "); + message.AssignCat(i); + message.AssignCat("\n========================================\n"); + message.AssignCat("Number Of Surfaces In Model : "); + message.AssignCat(allCnt); + message.AssignCat("\n----------------------------------------"); + message.AssignCat("\nPlanes : "); + message.AssignCat(plnCnt); + message.AssignCat("\nCylinder : "); + message.AssignCat(cylCnt); + message.AssignCat("\nCones : "); + message.AssignCat(conCnt); + message.AssignCat("\nSpheres : "); + message.AssignCat(sphCnt); + message.AssignCat("\nToroidal Surfaces : "); + message.AssignCat(torCnt); + + if(bzrCnt > 0 || splnCnt > 0 || revCnt > 0 || extrCnt > 0 || offsetCnt > 0 || otherCnt > 0) + { + message.AssignCat("\n\n--- invalid surface types ---"); + message.AssignCat("\nBezier Surfaces : "); + message.AssignCat(bzrCnt); + message.AssignCat("\nBSpline Surfaces : "); + message.AssignCat(splnCnt); + message.AssignCat("\nSurfaces Of Revolution : "); + message.AssignCat(revCnt); + message.AssignCat("\nSurfaces Of Extrusion : "); + message.AssignCat(extrCnt); + message.AssignCat("\nOffset Surfaces : "); + message.AssignCat(offsetCnt); + message.AssignCat("\nUnknown Type Of Surface : "); + message.AssignCat(otherCnt); + freeFromInvalidSurfaces = false; + } + message.AssignCat("\n========================================\n\n"); + msgr->Message( message.ToCString() ); + + if(!logFileName.IsEmpty()) + { + output << "\nSurface Information for Solid " << i << endl; + output << "========================================\n"; + output << "Number Of Surfaces In Model : " << allCnt << endl; + output << "----------------------------------------"<< endl; + output << "Planes : " << plnCnt << endl; + output << "Cylinder : " << cylCnt << endl; + output << "Cones : " << conCnt << endl; + output << "Spheres : " << sphCnt << endl; + output << "Toroidal Surfaces : " << torCnt << endl; + if(bzrCnt > 0 || splnCnt > 0 || revCnt > 0 || extrCnt > 0 || offsetCnt > 0 || otherCnt > 0) + { + output << "\n--- invalid surface types ---" << endl; + output << "Bezier Surfaces : " << bzrCnt << endl; + output << "BSpline Surfaces : " << splnCnt << endl; + output << "Surfaces Of Revolution : " << revCnt << endl; + output << "Surfaces Of Extrusion : " << extrCnt << endl; + output << "Offset Surfaces : " << offsetCnt << endl; + output << "Unknown Type Of Surface : " << otherCnt << endl; + } + output << "========================================\n\n"; + } + } + + if(invalidSurfaceSeq->Length() > 0){ + STEPControl_Writer wrt; + for(int i=1; i<=invalidSurfaceSeq->Length(); i++) + wrt.Transfer(invalidSurfaceSeq->Value(i), STEPControl_AsIs); + wrt.Write("invalidSurfaces.stp"); + } + + output.close(); + + return freeFromInvalidSurfaces; +} + + +bool McCadCSGTool_SurfaceChecker::readFile(TCollection_AsciiString inName, TCollection_AsciiString logFileName) +{ + STEPControl_Reader stpRdr; + stpRdr.ReadFile(inName.ToCString()); + stpRdr.TransferRoots(); + Handle(TopTools_HSequenceOfShape) shpSeq = new TopTools_HSequenceOfShape; + + for(int i=1; i<=stpRdr.NbShapes(); i++) // transfer shapes + shpSeq->Append(stpRdr.Shape(i)); + + if(logFileName.IsEmpty()) + logFileName = "surfaceCheck.log"; + + return printSurfaceInfo( shpSeq, inName, logFileName ); +} + + +void McCadCSGTool_SurfaceChecker::readDirectory(TCollection_AsciiString inp, TCollection_AsciiString logFileName) { + + if(!logFileName.IsEmpty()) + { + ofstream output; + output.open(logFileName.ToCString(), ios_base::out); + output.close(); // clear output-file + } + + cout << inp.ToCString() << " ------------------- \n\n"; + + if(inp.IsEqual(".")) + inp = "./"; + + if(inp.SearchFromEnd("/") == inp.Length()) + { + TCollection_AsciiString command; + command = TCollection_AsciiString("ls -1 ") + inp + TCollection_AsciiString("*.stp"); + char command_string[77]; + //static unsigned int size = 1024; + strcpy(command_string, string(command.ToCString()).c_str()); + FILE *dl; + int BUF_SIZE = 1024; +//qiu char in_buf[BUF_SIZE]; + char in_buf[1024]; +//qiu +#ifdef WIN32 + dl = _popen(command_string, "r"); +#else + dl = popen(command_string, "r"); +#endif + int control = 0; + + while (fgets(in_buf, BUF_SIZE, dl)) { + TCollection_AsciiString tmp(in_buf); + + TCollection_AsciiString NAME; + char* env = getenv("PWD"); + TCollection_AsciiString ENV(env); + + NAME = ENV + TCollection_AsciiString("/") + tmp; + + NAME = NAME.Token("\n", 1); // remove "newline" before aString + + readFile(NAME, logFileName); + + control++; + } + + if (control == 0) { + remove(logFileName.ToCString()); + cout << "The respective directory is empty!" << endl; + } + } + else if(inp.Length()-inp.SearchFromEnd(".stp") == 3) + readFile(inp, logFileName); + else + cout << "Invalid input. Input must either be a '.stp' - file or a '*/' - directory!" << endl; +} + + + diff --git a/src/MCCAD/McCadCSGTool/McCadCSGTool_TrivialCheck.cxx b/src/MCCAD/McCadCSGTool/McCadCSGTool_TrivialCheck.cxx new file mode 100644 index 0000000..0522dd2 --- /dev/null +++ b/src/MCCAD/McCadCSGTool/McCadCSGTool_TrivialCheck.cxx @@ -0,0 +1,120 @@ +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +McCadCSGTool_TrivialCheck::McCadCSGTool_TrivialCheck() : + myElementary(Standard_False) +{ + myIsDone = false; +} + +McCadCSGTool_TrivialCheck::McCadCSGTool_TrivialCheck(const TopoDS_Shape& theSolid) : myElementary(Standard_False) +{ + myIsDone = false; + Init(theSolid); +} + +void McCadCSGTool_TrivialCheck::Init(const TopoDS_Shape& theSolid) +{ + NotDone(); + mySolid = theSolid; + if (LinearConvex()) + myElementary = Standard_True; + else if (SingleSphere()) + myElementary = Standard_True; + else if (SingleTorus()) + myElementary = Standard_True; + else + myElementary = Standard_False; + Done(); +} + +Standard_Boolean McCadCSGTool_TrivialCheck::IsDone() const +{ + return myIsDone; +} + +void McCadCSGTool_TrivialCheck::Done() +{ + myIsDone = Standard_True; +} + +void McCadCSGTool_TrivialCheck::NotDone() +{ + myIsDone = Standard_False; +} + +Standard_Boolean McCadCSGTool_TrivialCheck::LinearConvex() const +{ + Standard_Integer linType=1; + TopExp_Explorer ex; + + for (ex.Init(mySolid, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + BRepAdaptor_Surface BS(aFace, Standard_True); + GeomAdaptor_Surface aSurface = BS.Surface(); + linType = linType * (Standard_Integer(aSurface.GetType() == GeomAbs_Plane)); + } + + if (linType && mySolid.Convex()) + return Standard_True; + else + return Standard_False; +} + +Standard_Boolean McCadCSGTool_TrivialCheck::SingleSphere() const +{ + Standard_Integer i; + TopExp_Explorer ex; + GeomAdaptor_Surface aSurface; + + //TODO:: counting the amount of used faces is not sufficient + // use U-V-range test instead + // trac #9 + + for (ex.Init(mySolid, TopAbs_FACE), i=1; ex.More(); ex.Next(), i++) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + BRepAdaptor_Surface BS(aFace, Standard_True); + aSurface = BS.Surface(); + } + if ((i==1) && aSurface.GetType() == GeomAbs_Sphere) + return Standard_True; + else + return Standard_False; + +} + +Standard_Boolean McCadCSGTool_TrivialCheck::SingleTorus() const +{ + // TODO: trac #9, see SingleSphere above + Standard_Integer i; + TopExp_Explorer ex; + GeomAdaptor_Surface aSurface; + for (ex.Init(mySolid, TopAbs_FACE), i=1; ex.More(); ex.Next(), i++) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + BRepAdaptor_Surface BS(aFace, Standard_True); + aSurface = BS.Surface(); + } + if ((i==1) && aSurface.GetType() == GeomAbs_Torus) + return Standard_True; + else + return Standard_False; + +} + +Standard_Boolean McCadCSGTool_TrivialCheck::Elementary() const +{ + return myElementary; +} + diff --git a/src/MCCAD/McCadCSGUtil/McCadCSGUtil_SolidBuilder.cxx b/src/MCCAD/McCadCSGUtil/McCadCSGUtil_SolidBuilder.cxx new file mode 100644 index 0000000..54fe33f --- /dev/null +++ b/src/MCCAD/McCadCSGUtil/McCadCSGUtil_SolidBuilder.cxx @@ -0,0 +1,850 @@ +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +//qiu +#include + +using namespace std; + + +TopoDS_Shape BigShape = BRepPrimAPI_MakeBox(gp_Pnt(-1.e5,-1.e5,-1.e5),gp_Pnt(1.e5,1.e5,1.e5)).Shape(); +//TopoDS_Shape BigShape = BRepPrimAPI_MakeBox(gp_Pnt(-1000,-1000,-1000),gp_Pnt(1000,1000,1000)).Shape(); + +void Prepare() +{ + /////////////////////////////////////////////////////////////////////////////////////////////// + //cout << "Boolean operation support for started!"<< endl; +} + +McCadCSGUtil_SolidBuilder::McCadCSGUtil_SolidBuilder() +{ + +} + +McCadCSGUtil_SolidBuilder::McCadCSGUtil_SolidBuilder(const Handle(McCadMcRead_Cell)& theCell) +{ + Init(theCell); +} + +void McCadCSGUtil_SolidBuilder::Init(const Handle(McCadMcRead_Cell)& theCell) +{ + NotDone(); + myCell = theCell; + myType = McCadCSGBuild_Other; + MakeSolid(); +} + +Standard_Boolean McCadCSGUtil_SolidBuilder::IsDone() const +{ + return myIsDone; +} + +void McCadCSGUtil_SolidBuilder::Done() +{ + myIsDone = Standard_True; +} + +void McCadCSGUtil_SolidBuilder::NotDone() +{ + myIsDone = Standard_False; +} + +void McCadCSGUtil_SolidBuilder::MakeSolid() +{ + cout << "Making a solid\n"; + ///////////////////////////////////////////////////////////////////////////////// + // For a single product term we use the old evaluator: + // Handle(TColStd_HSequenceOfAsciiString) theInFixCSG = myCell->GetInFixCSG(); + // cout << endl; + // cout << myCell->GetCellNumber() << ". theInFix: "; + // for(int i=1; i<= theInFixCSG->Length();i++) + // { + // + // cout << (theInFixCSG->Value(i)).ToCString(); + // } + // cout << endl; + ///////////////////////////////////////////////////////////////////////////////// + Handle(TColStd_HSequenceOfAsciiString) thePostFixCSG = myCell->GetPostFixCSG(); + //Handle(TColStd_HSequenceOfAsciiString) the1CSG = myCell->GetCSG(); + McCadCSGGeom_DataMapOfIntegerSurface surfMap; + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface surfIter = myCell->GetSurface(); + + for (; surfIter.More(); surfIter.Next()) + surfMap.Bind(surfIter.Key(), surfIter.Value()); + /////////////////////////////////////////////////////////////////////////////////////////////// +/* if (surfMap.Extent() > 1) //prepare + { + surfIter.Initialize(surfMap); + int iQCount = 0; + for (; surfIter.More(); surfIter.Next()) + { + Handle(McCadCSGGeom_Surface) theCSGSurf = surfIter.Value(); + Handle(Geom_Surface) theSurf = theCSGSurf->CasSurf(); + GeomAdaptor_Surface theAdaptSurf(theSurf); + if (theAdaptSurf.GetType() != GeomAbs_Plane) + iQCount++; + } + if (iQCount > 0) + { + //cout << "Total number of quadric surface in the Cell = " << iQCount << endl; + //cout << "Boolean operation support in preparation .... " << endl; + Prepare(); + } + } + else + cout << "### No content in Surf map\n";*/ + /////////////////////////////////////////////////////////////////////////////////////////////// + if (thePostFixCSG->Length() == 0 || surfMap.Extent() == 0) + { + cout << "Empty CSG Expression or number of surfaces is zero !! "<< endl; + + NotDone(); + return; + } + cout << "Processing cell number: " << myCell->GetCellNumber() << " started!"<< endl; + cout << "======================== "<< endl; + //////////////////////////////////////////////////////////////////////////////////////////////////// + TCollection_AsciiString tmpStr; + for (int i=1; i<= thePostFixCSG->Length(); i++) + { + tmpStr.InsertAfter(tmpStr.Length(), thePostFixCSG->Value(i)); + tmpStr.InsertAfter(tmpStr.Length(), " "); + } + /* + * if simple geometry, i.e. no ':' or '#', run McCadCSGBuild_SolidFromCSG and return; else proceed here + */ + + if (tmpStr.Search(":") < 0 && tmpStr.Search("#") < 0) + { + Handle(TColStd_HSequenceOfAsciiString) theCSG = new TColStd_HSequenceOfAsciiString; + theCSG->Append(" ( "); + for (int i=1; i<= thePostFixCSG->Length(); i++) + { + if ((thePostFixCSG->Value(i)).IsIntegerValue()) + theCSG->Append((thePostFixCSG->Value(i)).IntegerValue()); + } + theCSG->Append(" ) "); + myCell->SetCSG(theCSG); + + McCadCSGBuild_SolidFromCSG theBuilder(myCell); + + if(theBuilder.IsDone()) + { + myShape = theBuilder.Fused(); + + if(myCell->IsTRCL()) // set transformation to current object + { + cout << myCell->GetTRCLNumber() << " HAS TRAFO : " << myCell->GetTRCLNumber() << endl; + gp_Trsf theTrsf = myCell->GetTrsf()->GetTrsf(); + + /*for(int i=1; i<=3; i++) + { + for(int j=1; j<=4; j++) + cout << theTrsf.Value(i,j) << " "; + cout << endl; + }*/ + + TopLoc_Location newLoc(theTrsf); + myShape.Location(newLoc); + } + + cout << "#Boolean evaluation completed for cell number: " << myCell->GetCellNumber() << endl; + Done(); + cout << "==================================================== \n"<< endl; + return; + } + } + //cout << "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}\n"; + + + cout << "postFixCSG : "; + for(Standard_Integer k=1; k<=thePostFixCSG->Length(); k++) + cout << (thePostFixCSG->Value(k)).ToCString() << " "; + cout << endl; + + //////////////////////////////////////////////////////////////////////////////////////////////////// + //cout << "ThePostFix befor halfspace construction : " << thePostFixCSG->Length() << endl; + for(int i=1; i<= thePostFixCSG->Length(); i++) + { + if((thePostFixCSG->Value(i)).IsIntegerValue()) //for all integer values, build half spaces and bind them to myHSolidMap + { + Standard_Integer surfNo = (thePostFixCSG->Value(i)).IntegerValue(); + + if(myHSolidMap.IsBound(surfNo))//half space allready been constructed + continue; + + Standard_Integer key = abs(surfNo); + + if(!surfMap.IsBound(key)) + { + NotDone(); + return; + } + + Handle(McCadCSGGeom_Surface) aCSGSurf = surfMap(key); + + Handle(Geom_Surface) theSurf = aCSGSurf->CasSurf(); + GeomAdaptor_Surface theAdaptSurf(theSurf); + gp_Cone theCone; + /* switch(theAdaptSurf.GetType()) + { + case GeomAbs_Plane: + cout << "Plane\n"; + break; + case GeomAbs_Cylinder: + cout << "Cylinder\n"; + break; + case GeomAbs_Torus: + cout << "Torus\n"; + break; + case GeomAbs_Cone: + cout << "Cone\n"; + Standard_Real A1, A2, A3, B1, B2, B3, C1, C2, C3, D; + theCone = theAdaptSurf.Cone(); + theCone.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + cout << "Coefficients : " << A1 << " " << A2 << " " << A3 << " " << B1 << " " << B2 << " " << B3 << " " << C1 << " " << C2 << " " << C3 << " " << D << endl; + break; + case GeomAbs_Sphere: + cout << "Sphere\n"; + break; + default: + cout << "DEFAULT\n"; + }*/ + TopoDS_Shape HSol = MakeHalfSpace(aCSGSurf,surfNo); + + if (HSol.IsNull()) + { + cout << "A null half space computed!!" << endl; + return; + } + else + myHSolidMap.Bind(surfNo,HSol); + //MYMOD myHSolidMap.Bind(key,HSol);//!!!!!!!!!!! NOT KEY; BUT SURFNO !!!!!!!!!!!!!!!!!! + } + } + //////////////////////////////////////////////////////////////////////////////////// + //we evaluate the postfix csg now!! + TopTools_DataMapOfIntegerShape aResultMap; + stack theResult; + int aNewKey = 1000000; + //cout << "McCadCSGUtil_SolidBuilder.cxx :: " << thePostFixCSG->Length() << " map size: " << myHSolidMap.Extent() << endl; + + for ( int it = 1; it <= thePostFixCSG->Length(); it++ ) + { + TCollection_AsciiString aTerm = thePostFixCSG->Value(it); + if(aTerm.IsIntegerValue()) + { // an operand + Standard_Integer aNum = aTerm.IntegerValue(); + Standard_Integer aKey = abs(aNum); + + theResult.push(aNum); + if(!aResultMap.IsBound(aNum)) + { + aResultMap.Bind(aNum,myHSolidMap(aNum)); + } + + if(thePostFixCSG->Length()==1) + aNewKey = aKey; //in case of a single closed surface such as sphere + } + else if(aTerm == "#") + { + // note that this is an unary operator + TCollection_AsciiString anItem = theResult.top(); + Standard_Integer aNum = anItem.IntegerValue(); + TopoDS_Shape tmpShape1 = aResultMap(aNum); + + if (tmpShape1.IsNull()) + cout << " Null solid computed !!! " << endl; + + theResult.pop(); + + TopoDS_Shape resultShape = Reverse(tmpShape1); + if(CheckShape(resultShape)) + { + aNewKey++; + aResultMap.Bind(aNewKey,resultShape); + TCollection_AsciiString aToken(aNewKey); + theResult.push(aToken); + } + else + { + aNewKey = -1; + cout << "Boolean evaluation failed for this cell!" << endl; + break; + } + } + else if(aTerm == "|") + { + // cout << "|\n"; + TCollection_AsciiString anItem = theResult.top(); + Standard_Integer aNum = anItem.IntegerValue(); + Standard_Integer aKey = abs(aNum); + TopoDS_Shape tmpShape1 = aResultMap(aNum); + + if (tmpShape1.IsNull()) + cout << " Null solid computed !!! " << endl; + + theResult.pop(); + if(theResult.size()==0) + continue; + + anItem = theResult.top(); + aNum = anItem.IntegerValue(); + aKey = abs(aNum); + TopoDS_Shape tmpShape2 = aResultMap(aNum); + if (tmpShape2.IsNull()) + cout << " Null solid computed !!! " << endl; + + theResult.pop(); + + TopoDS_Shape resultShape = Common(tmpShape1, tmpShape2); + if (resultShape.IsNull()) + cout << " resultShape:: Null solid computed !!! " << endl; + + + if(CheckShape(resultShape)) + { + aNewKey++; + aResultMap.Bind(aNewKey,resultShape); + TCollection_AsciiString aToken(aNewKey); + theResult.push(aToken); + } + else + { + aNewKey = -1; + cout << "Boolean evaluation failed for this cell!!" << endl; + break; + } + } + else if(aTerm == ":") + { + // cout << ":\n"; + TCollection_AsciiString anItem = theResult.top(); + Standard_Integer aNum = anItem.IntegerValue(); + Standard_Integer aKey = abs(aNum); + TopoDS_Shape tmpShape1 = aResultMap(aNum); + + theResult.pop(); + + anItem = theResult.top(); + aNum = anItem.IntegerValue(); + aKey = abs(aNum); + TopoDS_Shape tmpShape2 = aResultMap(aNum); + + theResult.pop(); + + TopoDS_Shape resultShape = Fuse(tmpShape1, tmpShape2); + + if(CheckShape(resultShape)) + { + aNewKey++; + aResultMap.Bind(aNewKey,resultShape); + TCollection_AsciiString aToken(aNewKey); + theResult.push(aToken); + } + else + { + aNewKey = -1; + cout << "Boolean evaluation failed for this cell!!!" << endl; + break; + } + } + else + { + cout << "Unkown term type in the Boolean expression for this cell!" << endl; + } + } + + /////////////////////////////////////////////////////////////////////////////////// + // here we are with the result + if(aNewKey == -1) // MYTEST + { + cout << "Boolean evaluation failed for cell number: " << myCell->GetCellNumber() << endl; + NotDone(); + } + else + { + cout << "Boolean evaluation completed for cell number: " << myCell->GetCellNumber() << endl; + + myShape = aResultMap(aNewKey); + + if(myCell->IsTRCL()) // set transformation to current object + { + //cout << "HAS TRAFO 1\n"; + //cout << "myCell Trafo Nr " << myCell->GetTRCLNumber() << endl; + if(!myCell->GetTRCLNumber()==0) + { + gp_Trsf theTrsf = myCell->GetTrsf()->GetTrsf(); + TopLoc_Location newLoc(theTrsf); + myShape.Move(newLoc); + } + } + //else + //cout << "NO TRafo for cell no: "<GetCellNumber() << endl; + + Done(); + } + cout << "___ DONE\n"; + cout << "==================================================== "<< endl; +} + + +TopoDS_Shape McCadCSGUtil_SolidBuilder::MakeHalfSpace(const Handle(McCadCSGGeom_Surface)& theCSGSurf, const Standard_Integer sNum) +{ + Standard_Integer surfNo = sNum; + + Handle(Geom_Surface) theSurf = theCSGSurf->CasSurf(); + GeomAdaptor_Surface theAdaptSurf(theSurf); +#ifdef OCC650 + TopoDS_Face theFace = BRepBuilderAPI_MakeFace(theSurf); +#else + TopoDS_Face theFace = BRepBuilderAPI_MakeFace(theSurf, 1.0e-7); +#endif + //Standard_Boolean negAxis = Standard_False; + Handle(Geom_ElementarySurface) ES = Handle(Geom_ElementarySurface)::DownCast(theSurf); + + gp_Ax3 pos = ES->Position(); + gp_Trsf T; + + if(!pos.Direct()) + cout << "_#_McCadCSGUtil_SolidBuilder.cxx :: LHS\n\n\n"; + + //test for negative axis: +//MYMOD 300508 + /*gp_Dir theDirect = pos.Direction(); + gp_Dir XDirect = pos.XDirection(); + gp_Dir YDirect = pos.YDirection(); + gp_Pnt theLoc = pos.Location(); + + if (theDirect.X() < 0 || theDirect.Y() < 0 || theDirect.Z() <= 0) + { + negAxis = Standard_True; + cout << "NEGATIV AXIS\n"; + }*/ +//MYMOD # + + T.SetTransformation(pos); +/* + if (negAxis) + cout << " negative axis " << endl;*/ + + Standard_Real U=1, V=1; + gp_Pnt thePnt(0,0,0); + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + thePnt = theSurf->Value(U,V); + +//qiu +#ifdef WIN32 + if(_isnan(thePnt.X()) || _isnan(thePnt.Y()) || _isnan(thePnt.Z())) +#else + if(isnan(thePnt.X()) || isnan(thePnt.Y()) || isnan(thePnt.Z())) +#endif + + { + cout << "Sample point by projection ..."; + gp_Pnt aPnt(1,1,1); + GeomAPI_ProjectPointOnSurf thePntPro(aPnt,theSurf); + if(thePntPro.IsDone() && thePntPro.NbPoints() > 0) + { + thePnt = thePntPro.NearestPoint(); + cout << " ... finished" << endl; + } + else + { + cout << " ... failed" << endl; + } + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////// + + /*cout <<" XDir: X = " << XDirect.X() << " Y = " << XDirect.Y() << " Z = " << XDirect.Z() <Status(); + BRepCheck_ListIteratorOfListOfStatus iter;*/ + //cout << endl; + /*for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + BRepCheck::Print(iter.Value(), cout); + }*/ + //cout << endl; + if(!BA.IsValid()) + { + cout << "_#_McCadCSGUtil_SolidBuilder.cxx :: BRepCheck_Analyzer for shell failed !" << endl; + bOp = Standard_False; + break; + } + } + } + BA.Init(aShape, Standard_False); + if (!BA.IsValid()) + { + cout << "_#_McCadCSGUtil_SolidBuilder.cxx :: BRepCheck_Analyzer for solid failed !!!" << endl; + bOp = Standard_False; + } + if (sCount==0) + { + bOp = Standard_False; // if check is run on compound containing no solid + cout << "_#_McCadCSGUtil_SolidBuilder.cxx :: Compound containing no solid computed !!" << endl; + } + + return bOp; +} + + +Handle(TopTools_HSequenceOfShape) McCadCSGUtil_SolidBuilder::HalfSpaces() const +{ + TopTools_DataMapIteratorOfDataMapOfIntegerShape Iter(myHSolidMap); + Handle(TopTools_HSequenceOfShape) aShapeSeq = new TopTools_HSequenceOfShape; + for (;Iter.More(); Iter.Next()) aShapeSeq->Append(Iter.Value()); + return aShapeSeq; +} + + +TopoDS_Shape McCadCSGUtil_SolidBuilder::Result() const +{ + return myShape; +} + + +Standard_Integer McCadCSGUtil_SolidBuilder::NbHSolids() const +{ + return myHSolidMap.Extent(); +} + + +McCadCSGBuild_SolidType McCadCSGUtil_SolidBuilder::ResultType() const +{ + return McCadCSGBuild_Other; +} + diff --git a/src/MCCAD/McCadCom/McCadCom_CasDocument.cxx b/src/MCCAD/McCadCom/McCadCom_CasDocument.cxx new file mode 100644 index 0000000..a0382ae --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_CasDocument.cxx @@ -0,0 +1,111 @@ +#include + +#include +#include +#include + +McCadCom_CasDocument::McCadCom_CasDocument() +{ + myContext = NULL; +} + +McCadCom_CasDocument::McCadCom_CasDocument(const Handle(AIS_InteractiveContext)& theContext) +{ + myContext = theContext; +} + + +McCadCom_CasDocument::McCadCom_CasDocument(const Standard_Integer& theID) +{ + myContext = NULL; + NewDocument(theID); +} + +void McCadCom_CasDocument::SetTDoc(const Handle(TDocStd_Document)& theTDoc) +{ + myTDoc = theTDoc; +} + +Handle(TDocStd_Document) McCadCom_CasDocument::GetTDoc() +{ + return myTDoc; +} + + +void McCadCom_CasDocument::SetBgColor(const Quantity_Color& theCol) +{ + myBgCol = theCol; +} + +Quantity_Color McCadCom_CasDocument::GetBgColor() const +{ + return myBgCol; +} + +void McCadCom_CasDocument::Notify() const +{ + // view update + Handle_McCadCom_CasView theView; + McCadCom_ListIteratorOfListOfCasView iter; + for (iter.Initialize(myViews); iter.More(); iter.Next()) + { + theView = iter.Value(); + theView->Update(); + } +} + +void McCadCom_CasDocument::Attach(const Handle(McCadCom_CasView)& theView) +{ + myViews.Prepend(theView); +} + +void McCadCom_CasDocument::AddShape(const Handle(AIS_Shape)& theAISShape) +{ + if(myContext != NULL) + { + myContext->Display(theAISShape); + } + else + { + cout << "The Document does not have a Viewer Context!! " << endl; + } +} + +void McCadCom_CasDocument::RemoveShape(const Handle(AIS_Shape)& theAISShape) +{ + if(myContext != NULL) + { + myContext->Erase(theAISShape); + } + else + { + cout << "The Document does not have a Viewer Context!! " << endl; + } +} + +void McCadCom_CasDocument::SetContext(const Handle(AIS_InteractiveContext)& theContext) +{ + myContext = theContext; +} + +Handle(AIS_InteractiveContext) McCadCom_CasDocument::GetContext() const +{ + return myContext; +} + +Handle(McCadCom_CasView) McCadCom_CasDocument::NewView() +{ + Handle(McCadCom_CasView) aView = new McCadCom_CasView(this); + + return aView; +} + +void McCadCom_CasDocument::Views(McCadCom_ListOfCasView& theViewList) +{ + McCadCom_ListIteratorOfListOfCasView iter; + for (iter.Initialize(myViews); iter.More(); iter.Next()) + { + theViewList.Append(iter.Value()); + } +} + diff --git a/src/MCCAD/McCadCom/McCadCom_CasView.cxx b/src/MCCAD/McCadCom/McCadCom_CasView.cxx new file mode 100644 index 0000000..f527a83 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_CasView.cxx @@ -0,0 +1,402 @@ +//qiu change the order of the inlude files +#include +#include +#include + +McCadCom_CasView::McCadCom_CasView() +{ + + myXmin = 0; + myYmin = 0; + myXmax = 0; + myYmax = 0; + myTaskMaster = new McCadTool_TaskMaster(this); + myIsInitialized = Standard_False; +} + + +McCadCom_CasView::McCadCom_CasView(const Handle(McCadCom_CasDocument)& theDocument) +{ + SetDocument(theDocument); + myXmin = 0; + myYmin = 0; + myXmax = 0; + myYmax = 0; + myTaskMaster = new McCadTool_TaskMaster(this); + myIsInitialized = Standard_False; +} + +//qiu comment out because the Window in old McCad is not used any more +/*qiu +void McCadCom_CasView::Init(const Handle(Xw_Window)& theWin) +{ + Handle(McCadCom_CasDocument) aDocument = Handle_McCadCom_CasDocument::DownCast(myDocument); + Handle(AIS_InteractiveContext) aContext = aDocument->GetContext(); + myView = aContext->CurrentViewer()->CreateView(); + if ( !myView.IsNull() ) + { + myIsInitialized = Standard_True; + myView->SetWindow(theWin); + if ( !theWin->IsMapped() ) + theWin->Map(); + + myView->SetBackgroundColor(aDocument->GetBgColor()); + myView->MustBeResized(); + myView->SetTransparency(1); + //myView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_GOLD, 0.1, V3d_WIREFRAME ); + } + else + cout << "Warning:: Can not create CAS view !!!" << endl; +} +*/ + + +Standard_Boolean McCadCom_CasView::IsInit() const +{ + return myIsInitialized; +} + + +void McCadCom_CasView::SetTaskMaster(const Handle(McCadTool_TaskMaster)& theTaskMaster) +{ + myTaskMaster = theTaskMaster; +} + + +Handle(McCadTool_TaskMaster) McCadCom_CasView::GetTaskMaster() const +{ + return myTaskMaster; +} + + +void McCadCom_CasView::SetDefaultTask(const Handle(McCadTool_Task)& theTask) +{ + myTaskMaster->SetDefaultTask(theTask); +} + + +Handle(McCadTool_Task) McCadCom_CasView::GetDefaultTask() const +{ + return myTaskMaster->GetDefaultTask(); +} + + +void McCadCom_CasView::SetCurrentTask(const Handle(McCadTool_Task)& theTask) +{ + myTaskMaster->SetCurrentTask(theTask); +} + + +Handle(McCadTool_Task) McCadCom_CasView::GetCurrentTask() const +{ + return myTaskMaster->GetCurrentTask(); +} + + +void McCadCom_CasView::Execute() +{ + myTaskMaster->Execute(); +} + + +void McCadCom_CasView::UnExecute() +{ + myTaskMaster->UnExecute(); +} + + +void McCadCom_CasView::Suspend() +{ + myTaskMaster->Suspend(); +} + +void McCadCom_CasView::Resume() +{ + myTaskMaster->Resume(); +} + + +void McCadCom_CasView::SetState(const McCadTool_State theState) +{ + myTaskMaster->SetState(theState); +} + + +McCadTool_State McCadCom_CasView::State() const +{ + return myTaskMaster->State(); +} + + +void McCadCom_CasView::MousePressEvent(const QMouseEvent& e) +{ + myTaskMaster->MousePressEvent(e); +} + + +void McCadCom_CasView::MouseReleaseEvent(const QMouseEvent& e) +{ + myTaskMaster->MouseReleaseEvent(e); +} + + +void McCadCom_CasView::MouseMoveEvent(const QMouseEvent& e) +{ + myTaskMaster->MouseMoveEvent(e); +} + + +void McCadCom_CasView::MouseLeaveEvent() +{ + myTaskMaster->MouseLeaveEvent(); +} + + +void McCadCom_CasView::MouseEnterEvent() +{ + myTaskMaster->MouseEnterEvent(); +} + + +Handle(V3d_View) McCadCom_CasView::View() const +{ + return myView; +} + + +void McCadCom_CasView::Redraw() const +{ + myView->Redraw(); +} + + +void McCadCom_CasView::Reset() const +{ + myView->Reset(); +} + + +void McCadCom_CasView::FitAll() const +{ + myView->FitAll(); + myView->ZFitAll(); + myView->Redraw(); +} + + +void McCadCom_CasView::FitAll(const Standard_Integer Xmin, + const Standard_Integer Ymin, const Standard_Integer Xmax, + const Standard_Integer Ymax) +{ + myXmin = Xmin; + myYmin = Ymin; + myXmax = Xmax; + myYmax = Ymax; + myView->WindowFitAll(myXmin, myYmin, myXmax, myYmax); +} + + +void McCadCom_CasView::Back() const +{ + myView->SetProj(V3d_Xneg); +} + + +void McCadCom_CasView::Front() const +{ + myView->SetProj(V3d_Xpos); +} + + +void McCadCom_CasView::Top() const +{ + myView->SetProj(V3d_Zpos); +} + + +void McCadCom_CasView::Bottom() const +{ + myView->SetProj(V3d_Zneg); +} + + +void McCadCom_CasView::Left() const +{ + myView->SetProj(V3d_Ypos); +} + + +void McCadCom_CasView::Right() const +{ + myView->SetProj(V3d_Yneg); +} + + +void McCadCom_CasView::Iso() const +{ + myView->SetProj(V3d_XposYnegZpos); +} + + +void McCadCom_CasView::Pan(const Standard_Integer Dx, const Standard_Integer Dy) +{ + myView->Pan(Dx, Dy); +} + + +void McCadCom_CasView::Rotate(const Standard_Real Ax, const Standard_Real Ay, + const Standard_Real Az) +{ + myView->StartRotation(Ax, Ay); +} + + +void McCadCom_CasView::Rotate(const Standard_Real Ax, const Standard_Real Ay, + const Standard_Real Az, const Standard_Integer X, + const Standard_Integer Y, const Standard_Integer Z) +{ +} + + +void McCadCom_CasView::WindowFitAll(const Standard_Integer Xmin, + const Standard_Integer Ymin, const Standard_Integer Xmax, + const Standard_Integer Ymax) +{ + myXmin = Xmin; + myYmin = Ymin; + myXmax = Xmax; + myYmax = Ymax; + myView->WindowFitAll(myXmin, myYmin, myXmax, myYmax); +} + + +void McCadCom_CasView::Resize() +{ + myView->MustBeResized(); +} + + +void McCadCom_CasView::Size(Standard_Integer& theWidth, + Standard_Integer& theHeight) +{ +} + + +void McCadCom_CasView::Zoom() +{ + myView->Zoom(myXmin, myYmin, myXmax, myYmax); +} + + +void McCadCom_CasView::SetBackgroundColor(const Quantity_Color& theColor) +{ + myView->SetBackgroundColor(theColor); +} + + +void McCadCom_CasView::SetBackgroundColor(const Standard_Real R, + const Standard_Real G, const Standard_Real B) +{ +} + + +Quantity_Color McCadCom_CasView::BackgroundColor() const +{ + Quantity_Color aColor(Quantity_NOC_WHITE); + return aColor; +} + + +void McCadCom_CasView::SetShadingModel(const V3d_TypeOfShadingModel Model) +{ +} + + +void McCadCom_CasView::SetVisualization(const V3d_TypeOfVisualization Mode) +{ +} + + +void McCadCom_CasView::SetHiddenLineOn() +{ +} + + +void McCadCom_CasView::SetHiddenLineOff() +{ +} + +void McCadCom_CasView::SetAntialiasingOn() +{ +} + + +void McCadCom_CasView::SetAntialiasingOff() +{ +} + + +void McCadCom_CasView::Dump(const Standard_CString aFile, + const Aspect_FormatOfSheetPaper aFormat) +{ + myView->Redraw(); + Standard_Boolean dumped = myView->Dump(aFile); + if (dumped) + cout << "Window content has been printed to the File: " << aFile + << endl; + else + cout << "Printing failed !!" << endl; +} + + +void McCadCom_CasView::SetMinMaxPoints(const Standard_Integer Xmin, + const Standard_Integer Ymin, const Standard_Integer Xmax, + const Standard_Integer Ymax) +{ + myXmin = Xmin; + myYmin = Ymin; + myXmax = Xmax; + myYmax = Ymax; +} + + +void McCadCom_CasView::SetMinPoints(const Standard_Integer Xmin, + const Standard_Integer Ymin) +{ + myXmin = Xmin; + myYmin = Ymin; +} + + +void McCadCom_CasView::SetMaxPoints(const Standard_Integer Xmax, + const Standard_Integer Ymax) +{ + myXmax = Xmax; + myYmax = Ymax; +} + + +void McCadCom_CasView::GetMinMaxPoints(Standard_Integer& Xmin, + Standard_Integer& Ymin, Standard_Integer& Xmax, Standard_Integer& Ymax) +{ + Xmin = myXmin; + Ymin = myYmin; + Xmax = myXmax; + Ymax = myYmax; +} + + +void McCadCom_CasView::GetMinPoints(Standard_Integer& Xmin, + Standard_Integer& Ymin) +{ + Xmin = myXmin; + Ymin = myYmin; +} + + +void McCadCom_CasView::GetMaxPoints(Standard_Integer& Xmax, + Standard_Integer& Ymax) +{ + Xmax = myXmax; + Ymax = myYmax; +} diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_0.cxx new file mode 100644 index 0000000..e2ea56f --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapofIntegerListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfCasView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfCasView +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_0.cxx new file mode 100644 index 0000000..b37f758 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfDocument_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapofIntegerListOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfDocument +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfDocument +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_0.cxx new file mode 100644 index 0000000..638126d --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfView_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapofIntegerListOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfView +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_0.cxx new file mode 100644 index 0000000..3637da5 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapofIntegerListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif +//McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView::~McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView", + sizeof(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView) Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView))) { + _anOtherObject = Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)((Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView) ; +} +//Standard_Boolean McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView::~Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfCasView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfCasView +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_0.cxx new file mode 100644 index 0000000..07bd1af --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_ListOfDocument_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapofIntegerListOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif +//McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument::~McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument", + sizeof(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument) Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument))) { + _anOtherObject = Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)((Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument) ; +} +//Standard_Boolean McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument::~Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfDocument +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfDocument +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfView_0.cxx new file mode 100644 index 0000000..56ec10f --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapNodeOfDataMapofIntegerListOfView_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_ListOfView_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapofIntegerListOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_HeaderFile +#include +#endif +//McCadCom_DataMapNodeOfDataMapofIntegerListOfView::~McCadCom_DataMapNodeOfDataMapofIntegerListOfView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_DataMapNodeOfDataMapofIntegerListOfView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_DataMapNodeOfDataMapofIntegerListOfView", + sizeof(McCadCom_DataMapNodeOfDataMapofIntegerListOfView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView) Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfView))) { + _anOtherObject = Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)((Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_DataMapNodeOfDataMapofIntegerListOfView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfView) ; +} +//Standard_Boolean McCadCom_DataMapNodeOfDataMapofIntegerListOfView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfView) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView::~Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfView +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfCasView_0.cxx new file mode 100644 index 0000000..7acc6f1 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfCasView_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfCasView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfCasView +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfDocument_0.cxx new file mode 100644 index 0000000..3fcfd1f --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfDocument_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfDocument_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfDocument +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfDocument +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfView_0.cxx new file mode 100644 index 0000000..f7d6906 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_DataMapofIntegerListOfView_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfView_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfView +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_Document.cxx b/src/MCCAD/McCadCom/McCadCom_Document.cxx new file mode 100644 index 0000000..227a3e3 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_Document.cxx @@ -0,0 +1,93 @@ +#include +#include + +McCadCom_Document::McCadCom_Document() +{ + // myViews; + myName = "McCadDocument"; + myIsModified = Standard_False; + myIsInitialized = Standard_False; + myIsNew = Standard_True; + +} + +Standard_Boolean McCadCom_Document::NewDocument(const Standard_Integer& theID) +{ + TCollection_ExtendedString Name; + + if(theID < 0) + Name = "Unnamed Document"; + else + Name = TCollection_ExtendedString("Unnamed Document ") + TCollection_ExtendedString(theID); + + + SetDocName(Name); + //SetModified(Standard_True); + myIsInitialized = Standard_True; + myIsNew = Standard_True; + + return Standard_True; +} + + +Standard_Boolean McCadCom_Document::IsNew() +{ + return myIsNew; +} + + +Standard_Boolean McCadCom_Document::IsInitialized() const +{ + return myIsInitialized; +} + +Standard_Boolean McCadCom_Document::OpenFile(const TCollection_ExtendedString& aFileName) +{ + return Standard_False; +} + +Standard_Boolean McCadCom_Document::SaveFile() +{ + return Standard_False; +} + +Standard_Boolean McCadCom_Document::SaveAsFile(const TCollection_ExtendedString& aFileName) +{ + return Standard_False; +} + +void McCadCom_Document::Update() const +{ +} + +void McCadCom_Document::Notify() const +{ + +} + +void McCadCom_Document::Detach(const Handle(McCadCom_View)& theView) +{ + +} + +void McCadCom_Document::SetDocName(const TCollection_ExtendedString& theName) +{ + myIsNew = Standard_False; + myName = theName; +} + +TCollection_ExtendedString McCadCom_Document::GetDocName() const +{ + return myName; +} + +void McCadCom_Document::SetIsModified(const Standard_Boolean theMod) +{ + myIsModified = theMod; +} + +Standard_Boolean McCadCom_Document::IsSetModified() const +{ + return myIsModified; +} + diff --git a/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfCasView_0.cxx new file mode 100644 index 0000000..8c045ea --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfCasView_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadCom_ListNodeOfListOfCasView_HeaderFile +#include +#endif + + +#define Item Handle_McCadCom_CasView +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfCasView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfCasView_Type_() +#define TCollection_List McCadCom_ListOfCasView +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfDocument_0.cxx new file mode 100644 index 0000000..5802167 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfDocument_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadCom_ListNodeOfListOfDocument_HeaderFile +#include +#endif + + +#define Item Handle_McCadCom_Document +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfDocument +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfDocument_Type_() +#define TCollection_List McCadCom_ListOfDocument +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfView_0.cxx new file mode 100644 index 0000000..6c8d1ea --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListIteratorOfListOfView_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _McCadCom_ListNodeOfListOfView_HeaderFile +#include +#endif + + +#define Item Handle_McCadCom_View +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfView_Type_() +#define TCollection_List McCadCom_ListOfView +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfCasView_0.cxx new file mode 100644 index 0000000..4925466 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfCasView_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_ListIteratorOfListOfCasView_HeaderFile +#include +#endif +//McCadCom_ListNodeOfListOfCasView::~McCadCom_ListNodeOfListOfCasView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_ListNodeOfListOfCasView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_ListNodeOfListOfCasView", + sizeof(McCadCom_ListNodeOfListOfCasView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_ListNodeOfListOfCasView) Handle(McCadCom_ListNodeOfListOfCasView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_ListNodeOfListOfCasView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_ListNodeOfListOfCasView))) { + _anOtherObject = Handle(McCadCom_ListNodeOfListOfCasView)((Handle(McCadCom_ListNodeOfListOfCasView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_ListNodeOfListOfCasView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_ListNodeOfListOfCasView) ; +} +//Standard_Boolean McCadCom_ListNodeOfListOfCasView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_ListNodeOfListOfCasView) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_ListNodeOfListOfCasView::~Handle_McCadCom_ListNodeOfListOfCasView() {} +#define Item Handle_McCadCom_CasView +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfCasView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfCasView_Type_() +#define TCollection_List McCadCom_ListOfCasView +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfDocument_0.cxx new file mode 100644 index 0000000..edb10ac --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfDocument_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_ListIteratorOfListOfDocument_HeaderFile +#include +#endif +//McCadCom_ListNodeOfListOfDocument::~McCadCom_ListNodeOfListOfDocument() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_ListNodeOfListOfDocument_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_ListNodeOfListOfDocument", + sizeof(McCadCom_ListNodeOfListOfDocument), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_ListNodeOfListOfDocument) Handle(McCadCom_ListNodeOfListOfDocument)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_ListNodeOfListOfDocument) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_ListNodeOfListOfDocument))) { + _anOtherObject = Handle(McCadCom_ListNodeOfListOfDocument)((Handle(McCadCom_ListNodeOfListOfDocument)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_ListNodeOfListOfDocument::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_ListNodeOfListOfDocument) ; +} +//Standard_Boolean McCadCom_ListNodeOfListOfDocument::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_ListNodeOfListOfDocument) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_ListNodeOfListOfDocument::~Handle_McCadCom_ListNodeOfListOfDocument() {} +#define Item Handle_McCadCom_Document +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfDocument +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfDocument_Type_() +#define TCollection_List McCadCom_ListOfDocument +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfView_0.cxx new file mode 100644 index 0000000..ea93dd2 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListNodeOfListOfView_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_ListIteratorOfListOfView_HeaderFile +#include +#endif +//McCadCom_ListNodeOfListOfView::~McCadCom_ListNodeOfListOfView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_ListNodeOfListOfView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_ListNodeOfListOfView", + sizeof(McCadCom_ListNodeOfListOfView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_ListNodeOfListOfView) Handle(McCadCom_ListNodeOfListOfView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_ListNodeOfListOfView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_ListNodeOfListOfView))) { + _anOtherObject = Handle(McCadCom_ListNodeOfListOfView)((Handle(McCadCom_ListNodeOfListOfView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_ListNodeOfListOfView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_ListNodeOfListOfView) ; +} +//Standard_Boolean McCadCom_ListNodeOfListOfView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_ListNodeOfListOfView) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_ListNodeOfListOfView::~Handle_McCadCom_ListNodeOfListOfView() {} +#define Item Handle_McCadCom_View +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfView_Type_() +#define TCollection_List McCadCom_ListOfView +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListOfCasView_0.cxx new file mode 100644 index 0000000..db1bfad --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListOfCasView_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListIteratorOfListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadCom_ListNodeOfListOfCasView_HeaderFile +#include +#endif + + +#define Item Handle_McCadCom_CasView +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfCasView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfCasView_Type_() +#define TCollection_List McCadCom_ListOfCasView +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListOfDocument_0.cxx new file mode 100644 index 0000000..15e2173 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListOfDocument_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListIteratorOfListOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadCom_ListNodeOfListOfDocument_HeaderFile +#include +#endif + + +#define Item Handle_McCadCom_Document +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfDocument +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfDocument_Type_() +#define TCollection_List McCadCom_ListOfDocument +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_ListOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_ListOfView_0.cxx new file mode 100644 index 0000000..9606d56 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_ListOfView_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_ListIteratorOfListOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _McCadCom_ListNodeOfListOfView_HeaderFile +#include +#endif + + +#define Item Handle_McCadCom_View +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfView_Type_() +#define TCollection_List McCadCom_ListOfView +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfCasView_0.cxx new file mode 100644 index 0000000..b332df4 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfCasView_0.cxx @@ -0,0 +1,54 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_MapOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#include +#endif + + +#define TheKey Handle_McCadCom_CasView +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfCasView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfCasView_Type_() +#define TCollection_Map McCadCom_MapOfCasView +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfDocument_0.cxx new file mode 100644 index 0000000..8ac7aa4 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfDocument_0.cxx @@ -0,0 +1,54 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_MapOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#include +#endif + + +#define TheKey Handle_McCadCom_Document +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfDocument +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfDocument_Type_() +#define TCollection_Map McCadCom_MapOfDocument +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfView_0.cxx new file mode 100644 index 0000000..f0d53c3 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_MapIteratorOfMapOfView_0.cxx @@ -0,0 +1,54 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_MapOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_StdMapNodeOfMapOfView_HeaderFile +#include +#endif + + +#define TheKey Handle_McCadCom_View +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfView_Type_() +#define TCollection_Map McCadCom_MapOfView +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_MapOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_MapOfCasView_0.cxx new file mode 100644 index 0000000..9733d96 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_MapOfCasView_0.cxx @@ -0,0 +1,54 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_MapIteratorOfMapOfCasView_HeaderFile +#include +#endif + + +#define TheKey Handle_McCadCom_CasView +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfCasView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfCasView_Type_() +#define TCollection_Map McCadCom_MapOfCasView +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_MapOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_MapOfDocument_0.cxx new file mode 100644 index 0000000..2385ef8 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_MapOfDocument_0.cxx @@ -0,0 +1,54 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_MapIteratorOfMapOfDocument_HeaderFile +#include +#endif + + +#define TheKey Handle_McCadCom_Document +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfDocument +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfDocument_Type_() +#define TCollection_Map McCadCom_MapOfDocument +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_MapOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_MapOfView_0.cxx new file mode 100644 index 0000000..b50d2fb --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_MapOfView_0.cxx @@ -0,0 +1,54 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_StdMapNodeOfMapOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_MapIteratorOfMapOfView_HeaderFile +#include +#endif + + +#define TheKey Handle_McCadCom_View +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfView_Type_() +#define TCollection_Map McCadCom_MapOfView +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfCasView_0.cxx new file mode 100644 index 0000000..126af09 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfCasView_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadCom_SequenceOfCasView_HeaderFile +#include +#endif +//McCadCom_SequenceNodeOfSequenceOfCasView::~McCadCom_SequenceNodeOfSequenceOfCasView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_SequenceNodeOfSequenceOfCasView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_SequenceNodeOfSequenceOfCasView", + sizeof(McCadCom_SequenceNodeOfSequenceOfCasView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_SequenceNodeOfSequenceOfCasView) Handle(McCadCom_SequenceNodeOfSequenceOfCasView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_SequenceNodeOfSequenceOfCasView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfCasView))) { + _anOtherObject = Handle(McCadCom_SequenceNodeOfSequenceOfCasView)((Handle(McCadCom_SequenceNodeOfSequenceOfCasView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_SequenceNodeOfSequenceOfCasView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfCasView) ; +} +//Standard_Boolean McCadCom_SequenceNodeOfSequenceOfCasView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfCasView) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadCom_SequenceNodeOfSequenceOfCasView::~Handle_McCadCom_SequenceNodeOfSequenceOfCasView() {} +#define SeqItem Handle_McCadCom_CasView +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfCasView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfCasView +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfDocument_0.cxx new file mode 100644 index 0000000..31de044 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfDocument_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadCom_SequenceOfDocument_HeaderFile +#include +#endif +//McCadCom_SequenceNodeOfSequenceOfDocument::~McCadCom_SequenceNodeOfSequenceOfDocument() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_SequenceNodeOfSequenceOfDocument_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_SequenceNodeOfSequenceOfDocument", + sizeof(McCadCom_SequenceNodeOfSequenceOfDocument), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_SequenceNodeOfSequenceOfDocument) Handle(McCadCom_SequenceNodeOfSequenceOfDocument)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_SequenceNodeOfSequenceOfDocument) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfDocument))) { + _anOtherObject = Handle(McCadCom_SequenceNodeOfSequenceOfDocument)((Handle(McCadCom_SequenceNodeOfSequenceOfDocument)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_SequenceNodeOfSequenceOfDocument::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfDocument) ; +} +//Standard_Boolean McCadCom_SequenceNodeOfSequenceOfDocument::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfDocument) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadCom_SequenceNodeOfSequenceOfDocument::~Handle_McCadCom_SequenceNodeOfSequenceOfDocument() {} +#define SeqItem Handle_McCadCom_Document +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfDocument_Type_() +#define TCollection_Sequence McCadCom_SequenceOfDocument +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfView_0.cxx new file mode 100644 index 0000000..1051d5f --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_SequenceNodeOfSequenceOfView_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _McCadCom_SequenceOfView_HeaderFile +#include +#endif +//McCadCom_SequenceNodeOfSequenceOfView::~McCadCom_SequenceNodeOfSequenceOfView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_SequenceNodeOfSequenceOfView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_SequenceNodeOfSequenceOfView", + sizeof(McCadCom_SequenceNodeOfSequenceOfView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_SequenceNodeOfSequenceOfView) Handle(McCadCom_SequenceNodeOfSequenceOfView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_SequenceNodeOfSequenceOfView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfView))) { + _anOtherObject = Handle(McCadCom_SequenceNodeOfSequenceOfView)((Handle(McCadCom_SequenceNodeOfSequenceOfView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_SequenceNodeOfSequenceOfView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfView) ; +} +//Standard_Boolean McCadCom_SequenceNodeOfSequenceOfView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfView) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadCom_SequenceNodeOfSequenceOfView::~Handle_McCadCom_SequenceNodeOfSequenceOfView() {} +#define SeqItem Handle_McCadCom_View +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfView +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_SequenceOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_SequenceOfCasView_0.cxx new file mode 100644 index 0000000..0c6e8fc --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_SequenceOfCasView_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadCom_CasView +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfCasView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfCasView +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_SequenceOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_SequenceOfDocument_0.cxx new file mode 100644 index 0000000..42aa436 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_SequenceOfDocument_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadCom_Document +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfDocument_Type_() +#define TCollection_Sequence McCadCom_SequenceOfDocument +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_SequenceOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_SequenceOfView_0.cxx new file mode 100644 index 0000000..f20b038 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_SequenceOfView_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _McCadCom_SequenceNodeOfSequenceOfView_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadCom_View +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfView +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfCasView_0.cxx b/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfCasView_0.cxx new file mode 100644 index 0000000..dd500ac --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfCasView_0.cxx @@ -0,0 +1,100 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_MapOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_MapIteratorOfMapOfCasView_HeaderFile +#include +#endif +//McCadCom_StdMapNodeOfMapOfCasView::~McCadCom_StdMapNodeOfMapOfCasView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_StdMapNodeOfMapOfCasView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_StdMapNodeOfMapOfCasView", + sizeof(McCadCom_StdMapNodeOfMapOfCasView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_StdMapNodeOfMapOfCasView) Handle(McCadCom_StdMapNodeOfMapOfCasView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_StdMapNodeOfMapOfCasView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfCasView))) { + _anOtherObject = Handle(McCadCom_StdMapNodeOfMapOfCasView)((Handle(McCadCom_StdMapNodeOfMapOfCasView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_StdMapNodeOfMapOfCasView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfCasView) ; +} +//Standard_Boolean McCadCom_StdMapNodeOfMapOfCasView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfCasView) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_StdMapNodeOfMapOfCasView::~Handle_McCadCom_StdMapNodeOfMapOfCasView() {} +#define TheKey Handle_McCadCom_CasView +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfCasView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfCasView_Type_() +#define TCollection_Map McCadCom_MapOfCasView +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfDocument_0.cxx b/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfDocument_0.cxx new file mode 100644 index 0000000..0753021 --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfDocument_0.cxx @@ -0,0 +1,100 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_MapOfDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_MapIteratorOfMapOfDocument_HeaderFile +#include +#endif +//McCadCom_StdMapNodeOfMapOfDocument::~McCadCom_StdMapNodeOfMapOfDocument() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_StdMapNodeOfMapOfDocument_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_StdMapNodeOfMapOfDocument", + sizeof(McCadCom_StdMapNodeOfMapOfDocument), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_StdMapNodeOfMapOfDocument) Handle(McCadCom_StdMapNodeOfMapOfDocument)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_StdMapNodeOfMapOfDocument) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfDocument))) { + _anOtherObject = Handle(McCadCom_StdMapNodeOfMapOfDocument)((Handle(McCadCom_StdMapNodeOfMapOfDocument)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_StdMapNodeOfMapOfDocument::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfDocument) ; +} +//Standard_Boolean McCadCom_StdMapNodeOfMapOfDocument::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfDocument) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_StdMapNodeOfMapOfDocument::~Handle_McCadCom_StdMapNodeOfMapOfDocument() {} +#define TheKey Handle_McCadCom_Document +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfDocument +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfDocument_Type_() +#define TCollection_Map McCadCom_MapOfDocument +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfView_0.cxx b/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfView_0.cxx new file mode 100644 index 0000000..a58179a --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_StdMapNodeOfMapOfView_0.cxx @@ -0,0 +1,100 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _TColStd_MapTransientHasher_HeaderFile +#include +#endif +#ifndef _McCadCom_MapOfView_HeaderFile +#include +#endif +#ifndef _McCadCom_MapIteratorOfMapOfView_HeaderFile +#include +#endif +//McCadCom_StdMapNodeOfMapOfView::~McCadCom_StdMapNodeOfMapOfView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_StdMapNodeOfMapOfView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_StdMapNodeOfMapOfView", + sizeof(McCadCom_StdMapNodeOfMapOfView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_StdMapNodeOfMapOfView) Handle(McCadCom_StdMapNodeOfMapOfView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_StdMapNodeOfMapOfView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfView))) { + _anOtherObject = Handle(McCadCom_StdMapNodeOfMapOfView)((Handle(McCadCom_StdMapNodeOfMapOfView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_StdMapNodeOfMapOfView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfView) ; +} +//Standard_Boolean McCadCom_StdMapNodeOfMapOfView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfView) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadCom_StdMapNodeOfMapOfView::~Handle_McCadCom_StdMapNodeOfMapOfView() {} +#define TheKey Handle_McCadCom_View +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfView_Type_() +#define TCollection_Map McCadCom_MapOfView +#define TCollection_Map_hxx +#include + diff --git a/src/MCCAD/McCadCom/McCadCom_View.cxx b/src/MCCAD/McCadCom/McCadCom_View.cxx new file mode 100644 index 0000000..f4f998c --- /dev/null +++ b/src/MCCAD/McCadCom/McCadCom_View.cxx @@ -0,0 +1,21 @@ +#include + +McCadCom_View::McCadCom_View() +{ + myDocument = NULL; +} + +void McCadCom_View::Update() const +{ +} + +Handle(McCadCom_Document) McCadCom_View::GetDocument() const +{ + return myDocument; +} + +void McCadCom_View::SetDocument(const Handle(McCadCom_Document)& theDoc) +{ + myDocument = theDoc; +} + diff --git a/src/MCCAD/McCadConvertTools/McCadConvertTools_Convertor.cxx b/src/MCCAD/McCadConvertTools/McCadConvertTools_Convertor.cxx new file mode 100644 index 0000000..c542068 --- /dev/null +++ b/src/MCCAD/McCadConvertTools/McCadConvertTools_Convertor.cxx @@ -0,0 +1,242 @@ +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +McCadConvertTools_Convertor::McCadConvertTools_Convertor()//std ctor +{ + Init(); +} + + +McCadConvertTools_Convertor::McCadConvertTools_Convertor(const Handle(TopTools_HSequenceOfShape)& theHSeqOfShp) +{ + Init(); + myInputSolids = theHSeqOfShp; +} + + +void McCadConvertTools_Convertor::Init() +{ + myFileName = "noname"; + myIsConverted = Standard_False; + + myInputSolids = new TopTools_HSequenceOfShape; + myConvertedSolids = new TopTools_HSequenceOfShape; + + myProgress = new McCadGUI_ProgressDialog; +} + + +McCadGUI_ProgressDialogPtr McCadConvertTools_Convertor::GetProgressDialog() +{ + return myProgress; +} + + +Standard_Boolean McCadConvertTools_Convertor::Convert() +{ + Handle(TopTools_HSequenceOfShape) origSolids = new TopTools_HSequenceOfShape; + Handle(McCadCSGGeom_HSequenceOfCell) cellSeq = new McCadCSGGeom_HSequenceOfCell; + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + + Standard_Integer totalProgressSteps = 0; + + // Print Surface information + /////////////////////////////// + McCadCSGTool_SurfaceChecker surfaceChecker; + surfaceChecker.printSurfaceInfo(myInputSolids); + + // Append all original solids to origSolids + ////////////////////////////////////////////////// + for (Standard_Integer i=1; i<= myInputSolids->Length(); i++) + { + if ((myInputSolids->Value(i)).ShapeType() == TopAbs_COMPSOLID || (myInputSolids->Value(i)).ShapeType() == TopAbs_COMPOUND) + { + TopExp_Explorer ex; + for (ex.Init(myInputSolids->Value(i), TopAbs_SOLID); ex.More(); ex.Next()) + { + TopoDS_Solid tmpSol = TopoDS::Solid(ex.Current()); + origSolids->Append(tmpSol); + } + } + else if ((myInputSolids->Value(i)).ShapeType() == TopAbs_SOLID) + { + origSolids->Append(myInputSolids->Value(i)); + } + } + + //check if model is empty + ///////////////////////////////// + if (origSolids->Length() == 0) + { + msgr->Message("_#_Convertor.cxx :: The model contains no solids!!\n", + McCadMessenger_ErrorMsg); + return Standard_False; + } + else + { + TCollection_AsciiString message("Number of original solids: "); + message += origSolids->Length(); + msgr->Message(message.ToCString()); + } + + totalProgressSteps = origSolids->Length(); + myProgress->SetTotalSteps(totalProgressSteps); + + + // perform sign constant decomposition if neccessary + ////////////////////////////////////////////////////////////////////////////////////// + for (Standard_Integer i=1; i<= origSolids->Length(); i++)//Process all Solids + { + myProgress->SetProgress(int(double(i-1)*100./double(totalProgressSteps))); + cout << "|" << flush; + // cout << "\nStart processing solid number: " << i << endl; + // cout << "====================================================" << endl; + TopoDS_Solid tmpSol0 = TopoDS::Solid(origSolids->Value(i));//current solid + + //check if solid is valid; try to fix if not + /////////////////////////////////////////////// + McCadCSGAdapt_SolidAnalyser solAna(tmpSol0); + TopoDS_Solid tmpSol = solAna.FixedSolid(); + + // Count Faces of current Solid after generic fix + //////////////////////////////////////////////////////////////////////// + int fcount = 0; + for (TopExp_Explorer ex(tmpSol, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face iFace = TopoDS::Face(ex.Current()); + TopAbs_Orientation orient = iFace.Orientation(); + if ((orient != TopAbs_FORWARD) && (orient != TopAbs_REVERSED )) + msgr->Message("_#_Convertor.cxx :: Face with unknown Orientation!!", + McCadMessenger_WarningMsg); + //cout << "_#_Convertor.cxx :: Face with unknown Orientation!!" << endl; + fcount++; + } + // cout << " Number of faces after generic fix : " << fcount << "\n" << endl; + + GProp_GProps GP; + BRepGProp::VolumeProperties(tmpSol, GP); + Standard_Real origVol = GP.Mass(); + + ////////////////////////////////////////////////////////////////////////// + // Perform solid decomposition // + ////////////////////////////////////////////////////////////////////////// + + McCadCSGTool_Decomposer Mdec(tmpSol); + Handle(TopTools_HSequenceOfShape) solSeq; + + if (Mdec.IsDone()) + { + solSeq = Mdec.GetProcessedSolids(); + //cout << i << " Nb of Processed Solids: " << solSeq->Length() << endl; + } + else + { + msgr->Message("_#_Convertor.cxx :: Decomposing solid failed!!\n", + McCadMessenger_ErrorMsg); + break; + } + + // Perform volume comparison between original solid and decomposed solids + ///////////////////////////////////////////////////////////////////////// + Standard_Real decVol(0.0); + for(Standard_Integer i=1; i<=solSeq->Length(); i++) + { + TopoDS_Shape tmpShp = solSeq->Value(i); + BRepGProp::VolumeProperties(tmpShp, GP); + decVol += GP.Mass(); + } + + if( Abs(1 - Abs(decVol/origVol)) > 1.0e-5) // Decomposition not correct + { + TCollection_AsciiString errorMessage; + errorMessage += "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + errorMessage += "! Decomposed solid failed volume test: "; + errorMessage += decVol; + errorMessage += " / "; + errorMessage += origVol; + + if(!myFileName.IsEqual("noname.stp")) + { + errorMessage += "\n! for file : "; + errorMessage += myFileName; + ofstream volOut; + volOut.open("failedVolumeControl.log", ios_base::app); + volOut << myFileName.ToCString() << " -- original Volume : " << origVol << " -- volume after decomposition : " << decVol << endl; + volOut.close(); + } + + errorMessage += "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + msgr->Message(errorMessage.ToCString()); + //return Standard_False; + } + + myConvertedSolids->Append(solSeq); + } + + myIsConverted = Standard_True; + + myProgress->SetProgress(100); + + return Standard_True; +} + + +Handle(TopTools_HSequenceOfShape) McCadConvertTools_Convertor::Convert(const Handle(TopTools_HSequenceOfShape)& theHSeqOfShp) +{ + myConvertedSolids->Clear(); + myInputSolids = theHSeqOfShp; + + if(!Convert()) //Convert myHSeqOfShp + cout << "_#_McCadConvertTools_Convertor.cxx :: Conversion failed!!!\n\n"; + + return myConvertedSolids; +} + + +Handle(TopTools_HSequenceOfShape) McCadConvertTools_Convertor::GetConvertedModel() +{ + if(!myIsConverted) + { + cout << "Model has not yet been converted! Starting conversion now ...\n"; + if(!myConvertedSolids->IsEmpty()) + Convert(); + else + cout << "No model set. Nothing to convert...\n"; + } + return myConvertedSolids; +} + + +Standard_Boolean McCadConvertTools_Convertor::IsConverted() const +{ + return myIsConverted; +} + diff --git a/src/MCCAD/McCadConvertTools/McCadConvertTools_VoidGenerator.cxx b/src/MCCAD/McCadConvertTools/McCadConvertTools_VoidGenerator.cxx new file mode 100644 index 0000000..14a0721 --- /dev/null +++ b/src/MCCAD/McCadConvertTools/McCadConvertTools_VoidGenerator.cxx @@ -0,0 +1,653 @@ +//qiu #include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +//qiu add conditional include for mkdir() +#if defined WIN32 +# include +#else //linux +# include +# include +#endif +//qiu using this function to replace mkdir +void Mkdir(std::string dir) { +#if defined WIN32 + _mkdir(dir.data()); +#else //linux + mkdir(dir.data(), 0777); +#endif +} + +using namespace std; + +McCadConvertTools_VoidGenerator::McCadConvertTools_VoidGenerator() { + Init(); +} + + +McCadConvertTools_VoidGenerator::McCadConvertTools_VoidGenerator( McCadIOHelper_VGParameters& parameters){ + Init(); + SetParameters(parameters); +} + + +void McCadConvertTools_VoidGenerator::Init() { + myVVoids = new McCadDiscDs_HSequenceOfDiscSolid; + myVSolids = new McCadDiscDs_HSequenceOfDiscSolid; + myVOuterVoids = new McCadDiscDs_HSequenceOfDiscSolid; + + myFirstFile = true; + + myProgress = new McCadGUI_ProgressDialog; + myProgress->SetTotalSteps(100); + + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(); + m_progressIndicator = Handle(Message_ProgressIndicator)::DownCast(theProgress); + m_parameters.inputSolids = new McCadDiscDs_HSequenceOfDiscSolid; + m_parameters.boundingBox = new TopTools_HSequenceOfShape; +} + + +Standard_Boolean McCadConvertTools_VoidGenerator::Init( McCadIOHelper_VGParameters& parameters) { + SetParameters(parameters); + + return Perform(); +} + + +void McCadConvertTools_VoidGenerator::SetProgressIndicator(Handle_Message_ProgressIndicator& thePI){ + m_progressIndicator = thePI; +} + + +void McCadConvertTools_VoidGenerator::AddDiscSolids(Handle_McCadDiscDs_HSequenceOfDiscSolid& theNamedSolids) { + m_parameters.inputSolids->Append(theNamedSolids); +} + + +McCadCSGGeom_Unit McCadConvertTools_VoidGenerator::GetUnits(){ + return m_parameters.units; +} + +Standard_Integer McCadConvertTools_VoidGenerator::GetInitSurfNb(){ + return m_parameters.initSurfaceNumber; +} + +Standard_Integer McCadConvertTools_VoidGenerator::GetInitCellNb(){ + return m_parameters.initCellNumber; +} + +// ------------------------------------------------------ +// Create a bounding box for the input model +// ------------------------------------------------------ +Standard_Boolean McCadConvertTools_VoidGenerator::MakeBoundingBox() { + Bnd_Box boundingBox; + BRepBndLib boxExpander; + TopLoc_Location loc; + TopExp_Explorer shpEx; + + /* we create a bounding box. Caution, when non-linear faces occur it might + there are often tolerance mismatches on the border. to avoid the resulting + overlaps we introduce a gap in the bounding box. unfortunately the gap + is deleted by OCC code, when we create a bounding box for a face and add + this bounding box to the overall BB. therefor we compute the extremal points + of the face-bounding-box and add these. + */ + + for (int i=1 ; i <= myVSolids->Length(); i++) { + TopoDS_Shape tmpShp = myVSolids->Value(i).GetSolid(); + //boxExpander.Add(tmpShp, aGlBox); + + for(shpEx.Init(tmpShp, TopAbs_FACE); shpEx.More(); shpEx.Next()) { + TopoDS_Face curFace = TopoDS::Face(shpEx.Current()); + Bnd_Box tmpBox; + boxExpander.Add(curFace, tmpBox); + + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(curFace,loc); + GeomAdaptor_Surface adaptedFaceSurface(theFaceSurface); + + if(adaptedFaceSurface.GetType() != GeomAbs_Plane) { + tmpBox.SetGap(0.1); + Standard_Real xMin, yMin, zMin, xMax, yMax, zMax; + tmpBox.Get(xMin, yMin, zMin, xMax, yMax, zMax); + gp_Pnt lower(xMin, yMin, zMin), upper(xMax, yMax, zMax); + boundingBox.Add(lower); + boundingBox.Add(upper); + } + else + boundingBox.Add(tmpBox); + } + } + + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + boundingBox.SetGap(0.0); + boundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + m_parameters.boundingBox->Append(BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape()); + + return Standard_True; +} + + +// ---------------------------------------------- +// Voxelize input solids +// ---------------------------------------------- +void McCadConvertTools_VoidGenerator::Voxelize() { + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + bool first=true; + ofstream tmpOut; + + Standard_Integer numSolids = m_parameters.inputSolids->Length(); + Standard_Real step(20.5/numSolids); + m_progressIndicator->SetStep(step); + + // write voxel files + if(m_parameters.writeVoxelFile) { + msgr->Message("Voxelization started..."); + msgr->Message("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + + TCollection_AsciiString prevName("none"); + + for(Standard_Integer i=1; i<= numSolids; i++) { + McCadDiscDs_DiscSolid aDiscSolid = m_parameters.inputSolids->Value(i); + if( aDiscSolid.GetFileName() != prevName) { + if(first) { + cout << "Processing file: " << aDiscSolid.GetFileName().ToCString() << endl; + first = false; + } + else + cout << "\nProcessing file: " << aDiscSolid.GetFileName().ToCString() << endl; + prevName = aDiscSolid.GetFileName(); + } + cout << "." << flush; + + McCadDiscretization_Solid theDiscer(aDiscSolid); + theDiscer.SetMinNbPnt(m_parameters.minSamplePoints); + theDiscer.SetMaxNbPnt(m_parameters.maxSamplePoints); + theDiscer.SetXresolution(m_parameters.xResolution); + theDiscer.SetYresolution(m_parameters.yResolution); + theDiscer.SetTolerance(m_parameters.tolerance); + theDiscer.Init(); + + // write voxel files + if(theDiscer.IsDone()) { + + // make voxel directory +//qiu mkdir("voxels", 0755); + Mkdir ("voxels"); + + // get voxel file name + TCollection_AsciiString voxelFileName("voxels/"); + + // strip of path from STEP file name + TCollection_AsciiString stepFileName = aDiscSolid.GetFileName(); + if(stepFileName.Search("/") > 0) + voxelFileName += stepFileName.Split(stepFileName.SearchFromEnd("/")); + else + voxelFileName += stepFileName; + voxelFileName += TCollection_AsciiString("_") + i + ".voxel"; + + // open voxel file + tmpOut.open(voxelFileName.ToCString(),ios::out); + if(!tmpOut) { + cout << "_#_McCadConvertTools_VoidGenerator.cxx :: Cannot open file for voxel output: " << voxelFileName << endl; + continue; + } + tmpOut << aDiscSolid.GetName().ToCString() << endl; + + + Handle(McCadDiscDs_HSequenceOfDiscFace) ownVFaces = theDiscer.GetSolid().GetOwnVFaces(); + int NbOfFaces = ownVFaces->Length(); + + //write voxels for all faces of input solid + tmpOut << NbOfFaces << endl; + for (Standard_Integer i=1; i <= ownVFaces->Length();i++){ + Handle(TColgp_HSequenceOfPnt) aPntSeq = ownVFaces->Value(i).GetPoints(); + tmpOut << aPntSeq->Length() << endl; + tmpOut.precision(12); + for (Standard_Integer j = 1; j<= aPntSeq->Length(); j++){ + gp_Pnt aP = aPntSeq->Value(j); + tmpOut << aP.X() << " " << aP.Y() << " " << aP.Z() << endl; + } + } + tmpOut.close(); + + // append voxelized solid to sequence of voxelized solids + McCadDiscDs_DiscSolid tmpVSolid = theDiscer.GetSolid(); + tmpVSolid.SetIsVoid(Standard_False); // unset void flag : this cell is material + myVSolids->Append(tmpVSolid); + } + else { + TCollection_AsciiString fldmsg("_#_McCadConvertTools_VoidGenerator.cxx :: Discretization failed for solid file: "); + fldmsg += aDiscSolid.GetFileName().ToCString(); + msgr->Message(fldmsg.ToCString(), McCadMessenger_ErrorMsg); + } + + m_progressIndicator->Increment(); + } + + msgr->Message("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + msgr->Message("...Voxelization done.\n"); + } + else // read voxel files + { + msgr->Message("Reading voxel files..."); + msgr->Message("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + + Bnd_Box solBB; + + for(Standard_Integer i=1; i<= numSolids; i++){ + McCadDiscDs_DiscSolid aDiscSolid = m_parameters.inputSolids->Value(i); + + // get voxel file name + TCollection_AsciiString voxelFileName("voxels/"); + // strip of path from STEP file name + TCollection_AsciiString stepFileName = aDiscSolid.GetFileName(); + voxelFileName += stepFileName.Split(stepFileName.SearchFromEnd("/")); + voxelFileName += TCollection_AsciiString("_") + i + ".voxel"; + + ifstream tmpIn; + tmpIn.open(voxelFileName.ToCString(),ios::in); + + if(!tmpIn){ + cout << "Couldn't open file: " << voxelFileName.ToCString() << " for reading." << endl; + McCadDiscretization_Solid theDiscer(aDiscSolid); + theDiscer.SetMinNbPnt(m_parameters.minSamplePoints); + theDiscer.SetMaxNbPnt(m_parameters.maxSamplePoints); + theDiscer.SetXresolution(m_parameters.xResolution); + theDiscer.SetYresolution(m_parameters.yResolution); + theDiscer.SetTolerance(m_parameters.tolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()){ + myVSolids->Append(theDiscer.GetSolid()); + } + else{ + TCollection_AsciiString fldmsg("_#_McCadConvertTools_VoidGenerator.cxx :: Discretization failed for solid file: "); + fldmsg += aDiscSolid.GetFileName().ToCString(); + msgr->Message(fldmsg.ToCString(), McCadMessenger_ErrorMsg); + } + } + else { + cout << "Reading voxel data from file: " << voxelFileName.ToCString() << endl; + + char inName[256]; + int NbOfFaces=0; + tmpIn >> inName; + tmpIn >> NbOfFaces; + + Handle(McCadDiscDs_HSequenceOfDiscFace) ownVFaces = aDiscSolid.GetOwnVFaces(); + Handle(McCadDiscDs_HSequenceOfDiscFace) newOwnVFaces = new McCadDiscDs_HSequenceOfDiscFace; + + if(ownVFaces->Length() != NbOfFaces) { + cout << "_#_McCadConvertTools_VoidGenerator.cxx :: Number of faces does not match!!!\n"; + cout << " In : " << NbOfFaces << " -- Solid : " << ownVFaces->Length() << endl; + } + + + for (Standard_Integer k=1; k <= ownVFaces->Length(); k++){ + McCadDiscDs_DiscFace theDFace = ownVFaces->Value(k); + Handle(TColgp_HSequenceOfPnt) aPntSeq = new TColgp_HSequenceOfPnt();; + int NbOfPoints = 0; + + tmpIn >> NbOfPoints; + + if(NbOfPoints > 0 ){ + for (Standard_Integer j = 1; j<= NbOfPoints; j++){ + Standard_Real x,y,z; + tmpIn >> x >> y >> z; + gp_Pnt aP(x,y,z); + aPntSeq->Append(aP); + } + } + + Bnd_Box aBB; + TopoDS_Face aF = TopoDS::Face(theDFace.GetFace()); + + if(aF.IsNull()) + cout << "_#_McCadConvertTools_VoidGenerator.cxx :: Null face found. " << endl; + + for (TopExp_Explorer exv(aF,TopAbs_VERTEX); exv.More(); exv.Next()){ + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + aPntSeq->Prepend(aPnt); + } + + for (Standard_Integer j = 1; j<= aPntSeq->Length(); j++) + aBB.Add(aPntSeq->Value(j)); + + aBB.SetGap(0.0); + theDFace.SetPoints(aPntSeq); + theDFace.SetBBox(aBB); + newOwnVFaces->Append(theDFace); + solBB.Add(aBB); + } + + aDiscSolid.SetOwnVFaces(newOwnVFaces); + solBB.SetGap(0.0); + aDiscSolid.SetBBox(solBB); + aDiscSolid.SetIsVoid(Standard_False); + + myVSolids->Append(aDiscSolid); + } + tmpIn.close(); + + if(m_progressIndicator->UserBreak()) + return; + + m_progressIndicator->Increment(); + } + + msgr->Message("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + msgr->Message("...Reading done.\n"); + } +} + + +void McCadConvertTools_VoidGenerator::DeleteSmallVolumes() { + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance() ; + cout << "\nLooking for small volumes to discard.\n"; + TopExp_Explorer ex; + Standard_Integer idiscard(0); + Standard_Real totVolDiscarded(0.0); + Standard_Real overallVolume(0.0); + double smallestVolumeFound(1.0e100); + + //find smallest volume of input solids - calculate overall volume of input model + for(Standard_Integer i = 1; i <= m_parameters.inputSolids->Length(); i++) { + Handle_TopTools_HSequenceOfShape validInputSolids = new TopTools_HSequenceOfShape; + TopoDS_Shape curShp = m_parameters.inputSolids->Value(i).GetSolid(); + + // explode Compound shapes into solids + if( curShp.ShapeType() == TopAbs_COMPSOLID || curShp.ShapeType() == TopAbs_COMPOUND ) { + for(ex.Init(curShp,TopAbs_SOLID); ex.More(); ex.Next() ) { + TopoDS_Solid tmpSol = TopoDS::Solid(ex.Current()); + Standard_Real curVol = McCadMcVoid::VolumeOfShape(tmpSol); + overallVolume += curVol; + + // add big enough input shapes + if(curVol > m_parameters.minInputSolidVolume ) { + validInputSolids->Append(tmpSol); + if(curVol < smallestVolumeFound) + smallestVolumeFound = curVol; + } + else { + // negative volumes + if(curVol < 0) { + TCollection_AsciiString message("_#_McCadConvertTools_VoidGenerator :: negative input volume found in file : "); + message.AssignCat( m_parameters.inputSolids->Value(i).GetName()); + msgr->Message(message.ToCString(), McCadMessenger_ErrorMsg); + } + idiscard++; + totVolDiscarded += curVol; + } + } + + // remove input solids with small volume from input shapes + if(validInputSolids->Length() < 1) { + m_parameters.inputSolids->Remove(i); + continue; + } + + // rebuild compound of big enough solids + if(validInputSolids->Length() > 1) { + TopoDS_Compound newComp; + BRep_Builder aBuilder; + + for(Standard_Integer j=1; j < validInputSolids->Length(); j++) + aBuilder.Add(newComp, validInputSolids->Value(j)); + + aBuilder.MakeCompound(newComp); + + McCadDiscDs_DiscSolid aDiscSolid = m_parameters.inputSolids->Value(i); + aDiscSolid.SetSolid(newComp); + m_parameters.inputSolids->SetValue(i,aDiscSolid); + } + // exactly one solid + else { + McCadDiscDs_DiscSolid aDiscSolid = m_parameters.inputSolids->Value(i); + aDiscSolid.SetSolid(validInputSolids->Value(1)); + m_parameters.inputSolids->SetValue(i, aDiscSolid); + } + } + // add single solid if big enough + else if (curShp.ShapeType() == TopAbs_SOLID) { + TopoDS_Solid tmpSol = TopoDS::Solid(curShp); + Standard_Real curVol = McCadMcVoid::VolumeOfShape(tmpSol); + overallVolume += curVol; + + if(curVol < smallestVolumeFound) + smallestVolumeFound = curVol; + + // discard small volumes + if(curVol < m_parameters.minInputSolidVolume) { + if(curVol < 0) { + TCollection_AsciiString message("_#_McCadConvertTools_VoidGenerator :: negative input volume found in file : "); + message.AssignCat( m_parameters.inputSolids->Value(i).GetName()); + msgr->Message(message.ToCString(), McCadMessenger_ErrorMsg); + } + + idiscard++; + totVolDiscarded += curVol; + m_parameters.inputSolids->Remove(i); + } + } + } + + // define minimum void volume to 1/5th from smallest input volume if not specified by user + if(m_parameters.minVoidVolume == 0.0) { + smallestVolumeFound/=5.; + if(m_parameters.minVoidVolume < smallestVolumeFound) { + m_parameters.minVoidVolume = smallestVolumeFound; + TCollection_AsciiString message(" # Setting MinimumVoidVolume to : "); + message.AssignCat(m_parameters.minVoidVolume); + msgr->Message(message.ToCString()); + } + } + + TCollection_AsciiString msg("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); + msg += TCollection_AsciiString(idiscard); + msg += " solids have been discarded due to small volume.\nTotal volume of discarded solids: "; + msg += TCollection_AsciiString(totVolDiscarded); + msg += "\nTotal volume of input model : "; + msg += TCollection_AsciiString(overallVolume); + msg += "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"; + msgr->Message(msg.ToCString()); +} + + +void McCadConvertTools_VoidGenerator::CheckInputCollision() { + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + if( !m_parameters.writeCollisionFile ) { + ifstream collIn("CollisionFile"); + + cout << "\n\nReading CollisionFile...\n"; + + if(!collIn) { + msgr->Message("Couldn't read the 'CollisionFile'.\n", + McCadMessenger_WarningMsg); + m_parameters.writeCollisionFile = true; + CheckInputCollision(); + return; + } + + int sct, nbCol; + + for(Standard_Integer i=1; i <= myVSolids->Length(); i++) + { + collIn >> sct >> nbCol; + if (nbCol > 0 ) { + McCadDiscDs_DiscSolid aDiscSolid = myVSolids->Value(i); + Handle(TColStd_HSequenceOfInteger) intSeq = new TColStd_HSequenceOfInteger; + int tmpInt; + for(int j=1; j <=nbCol; j++) { + collIn >> tmpInt; + intSeq->Append(tmpInt); + } + aDiscSolid.SetOtherVSolids(intSeq); + } + } + cout << "...done\n"; + } + else + { + ofstream collOut("CollisionFile"); + if(!collOut) + cout << "Cannot open file for collision output !!!!" << endl; + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpSeq = new McCadDiscDs_HSequenceOfDiscSolid; + tmpSeq->Clear(); + + for(Standard_Integer tr=1; tr<=myVSolids->Length(); tr++) + tmpSeq->Append(myVSolids->Value(tr)); + + McCadMcVoid_ForwardCollision theForwardChecker(tmpSeq); + theForwardChecker.Init(); + if(theForwardChecker.IsDone()) { + msgr->Message("Writing collision output to file: CollisionFile"); + // For all VSolids write collision data in file CollisionFile + for(int i=1; i <= myVSolids->Length(); i++) { + Handle(TColStd_HSequenceOfInteger) intSeq = myVSolids->Value(i).GetOtherVSolids(); + collOut << i << " " << intSeq->Length() << " " ; + + if (intSeq->Length() > 0 ) + for(int j=1; j <= intSeq->Length(); j++) + collOut << intSeq->Value(j) << " "; + collOut << endl; + } + } + else + { + msgr->Message("_#_VoidGenerator.cxx :: Collision check among input solids failed !!", + McCadMessenger_ErrorMsg); + } + collOut.close(); + } +} + + +Standard_Boolean McCadConvertTools_VoidGenerator::GenerateVoids() { + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + if (m_parameters.inputSolids->IsEmpty()) { + msgr->Message("_#_McCadConvertTools_VoidGenerator.cxx :: No input solids found!!!! \n", + McCadMessenger_WarningMsg); + return false; + } + + // Discretize Model, delete solids due to small volume, handle collision in input file + Voxelize(); + CheckInputCollision(); + + // Make bounding box, if not defined + if( m_parameters.boundingBox->Length() < 1 ) { + if( !MakeBoundingBox()) { + msgr->Message("_#_McCadConvertTools_VoidGenerator.cxx :: Could not create Bounding Box!!!\n", + McCadMessenger_ErrorMsg); + return false; + } + } + + // Generate Voids + cout << "\n Starting void generation " << endl; + cout << "===========================" << endl; + McCadMcVoid_Generator theVGen(myVSolids); + theVGen.SetBSolid(m_parameters.boundingBox); + theVGen.SetMinVolume(m_parameters.minVoidVolume); + theVGen.SetMaxComplementedShapes(m_parameters.maxNumberOfComplementCells); + theVGen.SetMaxNbOfPreDecomposition(m_parameters.maxNumberOfPreDecompositionCells); + theVGen.SetMinDecompositionFaceArea(m_parameters.minSizeOfDecompositionFace); + theVGen.SetMinRedecompositionFaceArea(m_parameters.minSizeOfRedecompositionFace); + theVGen.SetDiscParameter( m_parameters.maxSamplePoints, m_parameters.minSamplePoints, + m_parameters.xResolution, m_parameters.yResolution, m_parameters.tolerance ); + theVGen.SetProgressIndicator(m_progressIndicator); + + theVGen.Init(); //running Decomposition of Bounding Box + + if( theVGen.IsDone()) { + cout << "===========================" << endl; + cout << " End of void generation\n" << endl; + } + else { + msgr->Message("_#_VoidGenerator.cxx :: Generation of void failed check output file for informations!!", + McCadMessenger_ErrorMsg); + return false; + } + Handle(McCadDiscDs_HSequenceOfDiscSolid) theVVoid = theVGen.GetDiscVoids(); //Voxelized Voids + myVVoids->Clear(); + myVVoids->Append(theVVoid); + + //make outer space + myOuterSpace = theVGen.MkOuterSpace(); + + //prepare outer space + McCadDiscDs_DiscSolid tmpSol; + + //fuse boxes to a single BB if input Bounding Box is predecomposed by user + for(Standard_Integer j=1; j<=m_parameters.boundingBox->Length(); j++) { + tmpSol.SetSolid(m_parameters.boundingBox->Value(j)); + tmpSol.SetIsOuterVoid(Standard_True); + myVOuterVoids->Append(tmpSol); + } + tmpSol.SetSolid(myOuterSpace); + myVOuterVoids->Append(tmpSol); + + return Standard_True; +} + + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadConvertTools_VoidGenerator::GetVVoids() { + return myVVoids; +} + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadConvertTools_VoidGenerator::GetVSolids() { + return myVSolids; +} + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadConvertTools_VoidGenerator::GetVOuterVoids() { + return myVOuterVoids; +} + + +Standard_Boolean McCadConvertTools_VoidGenerator::Perform() { + DeleteSmallVolumes(); + Standard_Boolean success = GenerateVoids(); + return success; +} + +void McCadConvertTools_VoidGenerator::SetMDReader(McCadMDReader_Reader& theMDReader) { + myMDReader = theMDReader; +} + +McCadMDReader_Reader& McCadConvertTools_VoidGenerator::GetMDReader() { + return myMDReader; +} + +void McCadConvertTools_VoidGenerator::AddBoundingBox(Handle_TopTools_HSequenceOfShape& addBB) { + m_parameters.boundingBox->Append(addBB); +} + +void McCadConvertTools_VoidGenerator::SetParameters(McCadIOHelper_VGParameters ¶meters){ + m_parameters = parameters; + if( !parameters.materialDensityFileName.IsEmpty() ) + myMDReader.ReadFile(parameters.materialDensityFileName); +} diff --git a/src/MCCAD/McCadDesign/McCadDesign_CopyTo.cxx b/src/MCCAD/McCadDesign/McCadDesign_CopyTo.cxx new file mode 100644 index 0000000..0ab0a09 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_CopyTo.cxx @@ -0,0 +1,89 @@ +/* + * McCadDesign_MakeCone.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +McCadDesign_CopyTo::McCadDesign_CopyTo(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theCopyToDialog.setupUi(this); + + connect(theCopyToDialog.okButton, SIGNAL(clicked()), this, SLOT(CreateCopy())); +} + + +void McCadDesign_CopyTo::CreateCopy() +{ + myOriX = GetRealValue(theCopyToDialog.coX->text()); + myOriY = GetRealValue(theCopyToDialog.coY->text()); + myOriZ = GetRealValue(theCopyToDialog.coZ->text()); + + TCollection_AsciiString namePrefix("Copy of "); + + AIS_ListOfInteractive listOfSelected; + Handle(AIS_InteractiveContext) ic = Editor()->GetDocument()->GetContext(); + for(ic->InitCurrent();ic->MoreCurrent(); ic->NextCurrent()) + listOfSelected.Append(ic->Current()); + + //QMcCad_Application::GetAppMainWin()->GetTreeWidget()->GetSelected(listOfSelected); + AIS_ListIteratorOfListOfInteractive it(listOfSelected); + + for(; it.More(); it.Next()) + { + Handle(AIS_InteractiveObject) curIO = it.Value(); + Handle(TPrsStd_AISPresentation) curPres = Handle(TPrsStd_AISPresentation::DownCast(curIO->GetOwner())); + + TDF_Label theLab = curPres->Label(); + Handle(TNaming_NamedShape) nmdShp; + if(!theLab.FindAttribute(TNaming_NamedShape::GetID(), nmdShp)) + continue; + + Handle(TDataStd_Name) theName; + theLab.FindAttribute(TDataStd_Name::GetID(),theName); + TCollection_AsciiString asciiName(namePrefix); + asciiName+=TCollection_AsciiString(theName->Get()); + + TopoDS_Shape theShape = nmdShp->Get();//BRepBuilderAPI_Copy(nmdShp->Get()).Shape(); + TopoDS_Shape newShape; + TColStd_IndexedDataMapOfTransientTransient aMap; + TNaming_CopyShape::CopyTool(theShape, aMap, newShape); + /*TopLoc_Location newLoc = newShape.Location(); + gp_Trsf theTrsf = newLoc.Transformation(); + + theTrsf.SetValues(theTrsf.Value(1,1), theTrsf.Value(1,2), theTrsf.Value(1,3), myOriX, + theTrsf.Value(2,1), theTrsf.Value(2,2), theTrsf.Value(2,3), myOriY, + theTrsf.Value(3,1), theTrsf.Value(3,2), theTrsf.Value(3,3), myOriZ, + 1e-7, 1e-7); + + newLoc = TopLoc_Location(theTrsf); + newShape.Location(newLoc);*/ + + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + TDF_Label newLab = sTool->AddShape(newShape, 0,0); + TDataStd_Name::Set(newLab, asciiName); + + McCadDesign_MoveTo mover(NULL); + mover.PerformMove(newShape, gp_Pnt(myOriX, myOriY, myOriZ)); + sTool->SetShape(newLab, newShape); + + } + + Editor()->UpdateView(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->LoadDocument(Editor()->ID()); + +} diff --git a/src/MCCAD/McCadDesign/McCadDesign_MakeBox.cxx b/src/MCCAD/McCadDesign/McCadDesign_MakeBox.cxx new file mode 100644 index 0000000..6b8a3d6 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_MakeBox.cxx @@ -0,0 +1,67 @@ +/* + * McCadDesign_MakeBox.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ +#include +#include +#include +#include +#include +#include + +McCadDesign_MakeBox::McCadDesign_MakeBox(QWidget* theParent) : QDialog(theParent) +{ + theBoxDialog.setupUi(this); + + connect(theBoxDialog.okButton, SIGNAL(clicked()), this, SLOT(CreateBox())); +} + + +/** + * + * SLOTS + */ + +void McCadDesign_MakeBox::CreateBox() +{ + myOriX = GetRealValue(theBoxDialog.Ori_X->text()); + myOriY = GetRealValue(theBoxDialog.Ori_Y->text()); + myOriZ = GetRealValue(theBoxDialog.Ori_Z->text()); + myDimX = GetRealValue(theBoxDialog.Dim_X->text()); + myDimY = GetRealValue(theBoxDialog.Dim_Y->text()); + myDimZ = GetRealValue(theBoxDialog.Dim_Z->text()); + + if(myDimX == 0.0 ) + { + myEditor->Mcout("Creation of box with NULL dimension not possible!!!"); + return; + } + if(myDimY == 0.0) + myDimY = myDimX; + if(myDimZ == 0.0) + myDimZ = myDimX; + + gp_Pnt ori(0, 0, 0); + TopoDS_Shape newBox = BRepPrimAPI_MakeBox(ori, myDimX, myDimY, myDimZ).Solid(); + + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + TDF_Label newLab = sTool->AddShape(newBox, 0,0); + + TCollection_AsciiString theName("new Box"); + TDataStd_Name::Set(newLab, theName); + + if(myOriX != 0 || myOriY != 0 || myOriZ != 0) + { + McCadDesign_MoveTo mover(NULL); + mover.PerformMove(newBox, gp_Pnt(myOriX, myOriY, myOriZ)); + sTool->SetShape(newLab, newBox); + } + + Editor()->UpdateView(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->LoadDocument(Editor()->ID()); +} + + diff --git a/src/MCCAD/McCadDesign/McCadDesign_MakeCone.cxx b/src/MCCAD/McCadDesign/McCadDesign_MakeCone.cxx new file mode 100644 index 0000000..92843a6 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_MakeCone.cxx @@ -0,0 +1,80 @@ +/* + * McCadDesign_MakeCone.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include +#include + + +McCadDesign_MakeCone::McCadDesign_MakeCone(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theConeDialog.setupUi(this); + + connect(theConeDialog.okButton, SIGNAL(clicked()), this, SLOT(CreateCone())); +} + +void McCadDesign_MakeCone::CreateCone() +{ + myOriX = GetRealValue(theConeDialog.oriX->text()); + myOriY = GetRealValue(theConeDialog.oriY->text()); + myOriZ = GetRealValue(theConeDialog.oriZ->text()); + + myDirX = GetRealValue(theConeDialog.dirX->text()); + myDirY = GetRealValue(theConeDialog.dirY->text()); + myDirZ = GetRealValue(theConeDialog.dirZ->text()); + + myRmin = GetRealValue(theConeDialog.radius->text()); + myRmaj = GetRealValue(theConeDialog.radius_2->text()); + myHeight = GetRealValue(theConeDialog.height->text()); + + if(myRmaj <= 0 || myHeight == 0) + { + Editor()->Mcout("NULL dimension in Cone build!!!"); + return; + } + if(myRmaj == myRmin) + { + Editor()->Mcout("Major radius and minor radius are identical!!!"); + return; + } + + gp_Pnt ori(0, 0, 0); + gp_Dir dir(myDirX, myDirY, myDirZ); + gp_Ax2 theAx(ori, dir); + + TopoDS_Shape newCone = BRepPrimAPI_MakeCone(theAx,myRmaj, myRmin, myHeight).Solid(); + + if(myRmin < 1e-5) // fix shape + { + Handle(ShapeFix_Shape) fixer = new ShapeFix_Shape(newCone); + fixer->Perform(); + if(fixer->Status(ShapeExtend_DONE)) + newCone = fixer->Shape(); + } + + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + TDF_Label newLab = sTool->AddShape(newCone, 0,0); + TCollection_AsciiString theName("new Cone"); + TDataStd_Name::Set(newLab, theName); + + if(myOriX != 0 || myOriY != 0 || myOriZ != 0) + { + McCadDesign_MoveTo mover(NULL); + mover.PerformMove(newCone, gp_Pnt(myOriX, myOriY, myOriZ)); + sTool->SetShape(newLab, newCone); + } + + + Editor()->UpdateView(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->LoadDocument(Editor()->ID()); + +} diff --git a/src/MCCAD/McCadDesign/McCadDesign_MakeCylinder.cxx b/src/MCCAD/McCadDesign/McCadDesign_MakeCylinder.cxx new file mode 100644 index 0000000..067592f --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_MakeCylinder.cxx @@ -0,0 +1,66 @@ +/* + * McCadDesign_MakeCylinder.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include + + +McCadDesign_MakeCylinder::McCadDesign_MakeCylinder(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theCylinderDialog.setupUi(this); + + connect(theCylinderDialog.okButton, SIGNAL(clicked()), this, SLOT(CreateCylinder())); +} + + +void McCadDesign_MakeCylinder::CreateCylinder() +{ + myOriX = GetRealValue(theCylinderDialog.oriX->text()); + myOriY = GetRealValue(theCylinderDialog.oriY->text()); + myOriZ = GetRealValue(theCylinderDialog.oriZ->text()); + + myDirX = GetRealValue(theCylinderDialog.dirX->text()); + myDirY = GetRealValue(theCylinderDialog.dirY->text()); + myDirZ = GetRealValue(theCylinderDialog.dirZ->text()); + + myRadius = GetRealValue(theCylinderDialog.radius->text()); + myHeight = GetRealValue(theCylinderDialog.height->text()); + + if(myRadius <= 0 || myHeight == 0) + { + Editor()->Mcout("NULL dimension in cylinder build!!!"); + return; + } + + gp_Pnt ori(0, 0, 0); + gp_Dir dir(myDirX, myDirY, myDirZ); + gp_Ax2 theAx(ori, dir); + + TopoDS_Shape newCylinder = BRepPrimAPI_MakeCylinder(theAx, myRadius, myHeight).Solid(); + + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + TDF_Label newLab = sTool->AddShape(newCylinder, 0,0); + TCollection_AsciiString theName("new Cylinder"); + TDataStd_Name::Set(newLab, theName); + + if(myOriX != 0 || myOriY != 0 || myOriZ != 0) + { + McCadDesign_MoveTo mover(NULL); + mover.PerformMove(newCylinder, gp_Pnt(myOriX, myOriY, myOriZ)); + sTool->SetShape(newLab, newCylinder); + } + + Editor()->UpdateView(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->LoadDocument(Editor()->ID()); + +} + diff --git a/src/MCCAD/McCadDesign/McCadDesign_MakeSphere.cxx b/src/MCCAD/McCadDesign/McCadDesign_MakeSphere.cxx new file mode 100644 index 0000000..756da3e --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_MakeSphere.cxx @@ -0,0 +1,52 @@ +/* + * McCadDesign_MakeCone.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include + + +McCadDesign_MakeSphere::McCadDesign_MakeSphere(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theSphereDialog.setupUi(this); + + connect(theSphereDialog.okButton, SIGNAL(clicked()), this, SLOT(CreateSphere())); +} + + +void McCadDesign_MakeSphere::CreateSphere() +{ + myOriX = GetRealValue(theSphereDialog.oriX->text()); + myOriY = GetRealValue(theSphereDialog.oriY->text()); + myOriZ = GetRealValue(theSphereDialog.oriZ->text()); + + myRadius = GetRealValue(theSphereDialog.radius->text()); + + if(myRadius <= 0) + { + Editor()->Mcout("NULL dimension in Sphere build!!!"); + return; + } + + gp_Pnt ori(myOriX, myOriY, myOriZ); + + TopoDS_Shape newSphere = BRepPrimAPI_MakeSphere(ori, myRadius).Solid(); + + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + TDF_Label newLab = sTool->AddShape(newSphere, 0,0); + TCollection_AsciiString theName("new Sphere"); + TDataStd_Name::Set(newLab, theName); + + Editor()->UpdateView(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->LoadDocument(Editor()->ID()); + +} + diff --git a/src/MCCAD/McCadDesign/McCadDesign_MoveTo.cxx b/src/MCCAD/McCadDesign/McCadDesign_MoveTo.cxx new file mode 100644 index 0000000..bc1f9c7 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_MoveTo.cxx @@ -0,0 +1,123 @@ +/* + * McCadDesign_MakeCone.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadDesign_MoveTo::McCadDesign_MoveTo(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theMoveToDialog.setupUi(this); + + connect(theMoveToDialog.okButton, SIGNAL(clicked()), this, SLOT(CreateMove())); + connect(theMoveToDialog.coX, SIGNAL(textEdited(QString)), this, SLOT(ConfirmMoveToPnt(QString))); + connect(theMoveToDialog.coY, SIGNAL(textEdited(QString)), this, SLOT(ConfirmMoveToPnt(QString))); + connect(theMoveToDialog.coZ, SIGNAL(textEdited(QString)), this, SLOT(ConfirmMoveToPnt(QString))); + myOriX = 0; + myOriY = 0; + myOriZ = 0; + myDistX = 0; + myDistY = 0; + myDistZ = 0; + myMoveToPnt = Standard_False; + myExternCall = Standard_True; +} + + +void McCadDesign_MoveTo::CreateMove() +{ + myExternCall = Standard_False; + myOriX = GetRealValue(theMoveToDialog.coX->text()); + myOriY = GetRealValue(theMoveToDialog.coY->text()); + myOriZ = GetRealValue(theMoveToDialog.coZ->text()); + myDistX = GetRealValue(theMoveToDialog.disX->text()); + myDistY = GetRealValue(theMoveToDialog.disY->text()); + myDistZ = GetRealValue(theMoveToDialog.disZ->text()); + + AIS_ListOfInteractive listOfSelected; + Handle(AIS_InteractiveContext) ic = Editor()->GetDocument()->GetContext(); + for(ic->InitCurrent();ic->MoreCurrent(); ic->NextCurrent()) + listOfSelected.Append(ic->Current()); + + AIS_ListIteratorOfListOfInteractive it(listOfSelected); + + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + for(; it.More(); it.Next()) + { + Handle(AIS_InteractiveObject) curIO = it.Value(); + /*Handle(TPrsStd_AISPresentation) curPres = Handle(TPrsStd_AISPresentation::DownCast(curIO->GetOwner())); + + TDF_Label theLab = curPres->Label(); + Handle(TNaming_NamedShape) nmdShp; + if(!theLab.FindAttribute(TNaming_NamedShape::GetID(), nmdShp)) + continue; + + TopoDS_Shape movedShape = nmdShp->Get(); + + ic->Clear(curPres->GetAIS(), 0);*/ + + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(curIO); + TopoDS_Shape theShp = aisShp->Shape(); + TDF_Label theLab = sTool->FindShape(theShp, 1); + + PerformMove(theShp, gp_Pnt(myOriX, myOriY, myOriZ)); + + sTool->SetShape(theLab, theShp); + //remove registered flag in order 2 update view + theLab.ForgetAttribute(TDataStd_BooleanList::GetID()); + ic->Remove(curIO, 0); + + //theLab.ForgetAttribute(TPrsStd_AISPresentation::GetID()); + } + + Editor()->UpdateView(); +} + +void McCadDesign_MoveTo::ConfirmMoveToPnt(const QString& dummyStr ) +{ + myMoveToPnt = Standard_True; +} + +void McCadDesign_MoveTo::PerformMove(TopoDS_Shape& theShp, gp_Pnt locPnt) +{ + TopLoc_Location oldLoc = theShp.Location(); + gp_Trsf oldTrsf = oldLoc.Transformation(); + gp_XYZ transl = oldTrsf.TranslationPart(); + + if(!myMoveToPnt && !myExternCall) + { + locPnt.SetX(transl.X() + myDistX); + locPnt.SetY(transl.Y() + myDistY); + locPnt.SetZ(transl.Z() + myDistZ); + } + + // handle rotation of shape + gp_Vec translation(locPnt.X(), locPnt.Y(), locPnt.Z()); + gp_XYZ rotAxis; + Standard_Real rotAngle; + oldTrsf.GetRotation(rotAxis, rotAngle); + gp_Dir tmpDir(rotAxis); + gp_Ax1 tmpAxis(locPnt, tmpDir); + gp_Trsf newTrsf; + + if(Abs(rotAxis.X()) > 1e-7 || Abs(rotAxis.Y()) > 1e-7 || Abs(rotAxis.Z()) > 1e-7) + newTrsf.SetRotation(tmpAxis, rotAngle); + + newTrsf.SetTranslationPart(translation); + //theTrsf.SetTranslationPart(translation); + TopLoc_Location newLoc(newTrsf); + theShp.Location(newLoc); +} + diff --git a/src/MCCAD/McCadDesign/McCadDesign_Rotate.cxx b/src/MCCAD/McCadDesign/McCadDesign_Rotate.cxx new file mode 100644 index 0000000..f265432 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_Rotate.cxx @@ -0,0 +1,113 @@ +/* + * McCadDesign_MakeCone.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +McCadDesign_Rotate::McCadDesign_Rotate(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theRotateDialog.setupUi(this); + + connect(theRotateDialog.okButton, SIGNAL(clicked()), this, SLOT(Rotate())); + connect(theRotateDialog.radButton, SIGNAL(toggled(bool)), this, SLOT(SwitchRadDeg(bool))); + connect(theRotateDialog.angle, SIGNAL(editingFinished()), this, SLOT(UpdateAngle())); + myAngle = 0.; + myIsRad = false; +} + + +void McCadDesign_Rotate::Rotate() +{ + myOriX = GetRealValue(theRotateDialog.axX->text()); + myOriY = GetRealValue(theRotateDialog.axY->text()); + myOriZ = GetRealValue(theRotateDialog.axZ->text()); + + AIS_ListOfInteractive listOfSelected; + Handle(AIS_InteractiveContext) ic = Editor()->GetDocument()->GetContext(); + for(ic->InitCurrent();ic->MoreCurrent(); ic->NextCurrent()) + listOfSelected.Append(ic->Current()); + + AIS_ListIteratorOfListOfInteractive it(listOfSelected); + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + for(; it.More(); it.Next()) + { + Handle(AIS_InteractiveObject) curIO = it.Value(); + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(curIO); + TopoDS_Shape theShape = aisShp->Shape(); + TDF_Label theLab = sTool->FindShape(theShape,1); + theLab.ForgetAttribute(TDataStd_BooleanList::GetID()); + ic->Remove(curIO, 0); + + TopLoc_Location newLoc = theShape.Location(); + gp_Trsf theTrsf = newLoc.Transformation(); + + //extract rotation + gp_XYZ rotAxis; + Standard_Real rotAngle; + theTrsf.GetRotation(rotAxis, rotAngle); + + //rotate + gp_Mat oldRot; + oldRot.SetRotation(rotAxis, rotAngle); + gp_Mat addRot; + gp_XYZ addRotAxis(myOriX, myOriY, myOriZ); + addRot.SetRotation(addRotAxis, myAngle); + addRot *= oldRot; + + theTrsf.SetValues(addRot.Value(1,1), addRot.Value(1,2), addRot.Value(1,3), theTrsf.Value(1,4), + addRot.Value(2,1), addRot.Value(2,2), addRot.Value(2,3), theTrsf.Value(2,4), + addRot.Value(3,1), addRot.Value(3,2), addRot.Value(3,3), theTrsf.Value(3,4), + 1e-7, 1e-7); + + newLoc = TopLoc_Location(theTrsf); + theShape.Location(newLoc); + + sTool->SetShape(theLab,theShape); + } + Editor()->UpdateView(); +} + +void McCadDesign_Rotate::SwitchRadDeg(bool theRadState) +{ + if(theRadState) + { + theRotateDialog.degButton->setChecked(false); + myIsRad = true; + } + else + { + theRotateDialog.radButton->setChecked(false); + myIsRad = false; + } + + TCollection_AsciiString angleName(myAngle); + + if(!theRadState) + angleName = TCollection_AsciiString(180. * myAngle/M_PI); + + theRotateDialog.angle->setText(angleName.ToCString()); +} + +void McCadDesign_Rotate::UpdateAngle() +{ + Standard_Real val = GetRealValue(theRotateDialog.angle->text()); + + if(!myIsRad) + val = M_PI * val/180.; + + myAngle = val; +} + + diff --git a/src/MCCAD/McCadDesign/McCadDesign_Scale.cxx b/src/MCCAD/McCadDesign/McCadDesign_Scale.cxx new file mode 100644 index 0000000..f4fcf11 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_Scale.cxx @@ -0,0 +1,105 @@ +/* + * McCadDesign_MakeCone.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadDesign_Scale::McCadDesign_Scale(QWidget* theParent) : QDialog(theParent), McCadDesign_Tool() +{ + theScaleDialog.setupUi(this); + + connect(theScaleDialog.okButton, SIGNAL(clicked()), this, SLOT(PerformScale())); + connect(theScaleDialog.sf_X, SIGNAL(textEdited(QString)), this, SLOT(SetAxisDependent(QString))); + connect(theScaleDialog.sf_Y, SIGNAL(textEdited(QString)), this, SLOT(SetAxisDependent(QString))); + connect(theScaleDialog.sf_Z, SIGNAL(textEdited(QString)), this, SLOT(SetAxisDependent(QString))); + mySf_X=1; + mySf_Y=1; + mySf_Z=1; + mySf_All=1; + myIsAll=Standard_True; +} + + +void McCadDesign_Scale::PerformScale() +{ + AIS_ListOfInteractive listOfSelected; + Handle(AIS_InteractiveContext) ic = Editor()->GetDocument()->GetContext(); + for(ic->InitCurrent();ic->MoreCurrent(); ic->NextCurrent()) + listOfSelected.Append(ic->Current()); + + //QMcCad_Application::GetAppMainWin()->GetTreeWidget()->GetSelected(listOfSelected); + AIS_ListIteratorOfListOfInteractive it(listOfSelected); + Handle(TDocStd_Document) theTDoc = Editor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + for(; it.More(); it.Next()) + { + Handle(AIS_InteractiveObject) curIO = it.Value(); + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(curIO); + TopoDS_Shape theShp = aisShp->Shape(); + TDF_Label theLab = sTool->FindShape(theShp, 1); + + if(myIsAll) { + mySf_All = GetRealValue(theScaleDialog.sf_All->text()); + + if(mySf_All <= 0.0) { + Editor()->Mcout("Invalid scaling factor! -- Factor <= 0"); + return; + } + mySf_X = mySf_All; + mySf_Y = mySf_All; + mySf_Z = mySf_All; + } + else { + mySf_X = GetRealValue(theScaleDialog.sf_X->text()); + mySf_Y = GetRealValue(theScaleDialog.sf_Y->text()); + mySf_Z = GetRealValue(theScaleDialog.sf_Z->text()); + + if(mySf_X <= 0 || mySf_Y <= 0 || mySf_Z <= 0.0) { + Editor()->Mcout("Invalid scaling factor! -- Factor <= 0"); + return; + } + } + +// cout << mySf_X << " , " << mySf_Y << " , " << mySf_Z << endl; + + gp_Mat sclMat(mySf_X, 0, 0, + 0, mySf_Y, 0, + 0, 0, mySf_Z ); + + gp_GTrsf theGTrsf; + theGTrsf.SetVectorialPart(sclMat); + + BRepBuilderAPI_GTransform theScaler(theGTrsf); + theScaler.Perform(theShp); + theShp = theScaler.Shape(); + + ic->Clear(curIO, 0); + + sTool->SetShape(theLab, theShp); + theLab.ForgetAttribute(TDataStd_BooleanList::GetID()); + } + + Editor()->UpdateView(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->LoadDocument(Editor()->ID()); + +} + +void McCadDesign_Scale::SetAxisDependent(const QString& aString) +{ + myIsAll = Standard_False; +} diff --git a/src/MCCAD/McCadDesign/McCadDesign_Tool.cxx b/src/MCCAD/McCadDesign/McCadDesign_Tool.cxx new file mode 100644 index 0000000..ffe3437 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadDesign_Tool.cxx @@ -0,0 +1,44 @@ +/* + * McCadDesign_MakeBox.cxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#include + +McCadDesign_Tool::McCadDesign_Tool() +{ +} + +void McCadDesign_Tool::SetCurrentEditor(QMcCad_Editor* theEditor) +{ + myEditor = theEditor; +} + + +QMcCad_Editor* McCadDesign_Tool::Editor() +{ + return myEditor; +} + +/** + * + * private functions + */ +Standard_Real McCadDesign_Tool::GetRealValue(const QString& theVal) +{ + if(theVal.length() == 0) + return 0.0; + + char aStr[theVal.length()]; + QByteArray ba = theVal.toAscii(); + strcpy(aStr, ba.data()); + TCollection_AsciiString anAsciiStr(aStr); + if(!anAsciiStr.IsRealValue()) + return 0.0; + + return anAsciiStr.RealValue(); + //return anAsciiStr; +} + diff --git a/src/MCCAD/McCadDesign/McCadMatManageDlg.cxx b/src/MCCAD/McCadDesign/McCadMatManageDlg.cxx new file mode 100644 index 0000000..d1f3896 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadMatManageDlg.cxx @@ -0,0 +1,450 @@ +#include "McCadMatManageDlg.hxx" +#include + +McCadMatManageDlg::McCadMatManageDlg(QWidget* theParent) : QDialog(theParent) +{ + m_MatDialog.setupUi(this); + connect(m_MatDialog.btnAddMat, SIGNAL(clicked()), this, SLOT(AddMaterial())); + connect(m_MatDialog.btnDelMat, SIGNAL(clicked()), this, SLOT(DelMaterial())); + //connect(m_MatDialog.btnMdfMat, SIGNAL(clicked()), this, SLOT(ModifyMaterial())); + connect(m_MatDialog.okButton, SIGNAL(clicked()), this, SLOT(SaveMaterial())); + //connect(m_MatDialog.saveXMLButton, SIGNAL(clicked()), this, SLOT(SaveXMLFile())); + //connect(m_MatDialog.loadXMLButton, SIGNAL(clicked()), this, SLOT(LoadXMLFile())); + connect(m_MatDialog.mMatTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(ShowSelectedMaterial(QTreeWidgetItem*,int))); +} + + +/** ******************************************************************** +* @brief Load Materials and display them +* +* @param +* @return void +* +* @date 28/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::LoadMaterials(QString strSelectedGrp) +{ + m_MatDialog.mMatTree->clear(); + + QString strInfo = QString("Material Group \"%1\" is being edited").arg(m_EditGroupName); + m_MatDialog.label_1->setText(strInfo); + + int iMatNum = m_Editor->GetMatManager()->GetMatNum(strSelectedGrp); // The material number of selected group + + vector MatIDList = m_Editor->GetMatManager()->GetMatIDList(); + for(int i = 0; i< MatIDList.size(); i++) + { + QTreeWidgetItem* itemAdd = new QTreeWidgetItem(); + QString itemText = "M " + QString::number(MatIDList.at(i)); + itemAdd->setText(0,itemText); + itemAdd->setText(1,QString::number(MatIDList.at(i))); + m_MatDialog.mMatTree->addTopLevelItem(itemAdd); + + if (iMatNum!=0 && iMatNum == MatIDList.at(i)) + { + m_MatDialog.mMatTree->setItemSelected(itemAdd,true); // Select the material number of being edited group + DisplayMaterial(iMatNum); + } + } +} + + + +/** ******************************************************************** +* @brief Update and refresh the displayed material information +* +* @param +* @return void +* +* @date 14/11/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::Refresh() +{ + vector MatIDList = m_Editor->GetMatManager()->GetMatIDList(); + for(int i = 0; i< MatIDList.size(); i++) + { + QTreeWidgetItem* itemAdd = new QTreeWidgetItem(); + QString itemText = "M " + QString::number(MatIDList.at(i)); + itemAdd->setText(0,itemText); + itemAdd->setText(1,QString::number(MatIDList.at(i))); + m_MatDialog.mMatTree->addTopLevelItem(itemAdd); + } + + if (MatIDList.size() != 0 ) + { + DisplayMaterial(MatIDList.at(0)); // Load the detail information of the first material + } +} + + + +/** ******************************************************************** +* @brief Add material in the map and a item on the tree +* +* @param +* @return void +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::AddMaterial() +{ + QString strMessage; + if(!CheckInput(strMessage)) // Check the input data and their formats + { + QMessageBox msg; + msg.setText(strMessage); + msg.exec(); + return; + } + + int iOrgID; // Record the selected material id and compared with the new one + QTreeWidgetItem* itemCur = m_MatDialog.mMatTree->currentItem(); + if (NULL != itemCur) + { + iOrgID = itemCur->text(1).toInt(); // Get the material ID + } + else + { + iOrgID = 0; + } + + if(m_ID == iOrgID) // if the new material id is same as selected material, then modify it. + { + ModifyMaterial(); + } // else add a new material + else if(m_Editor->GetMatManager()->InsertNewMaterial(m_ID,m_Density,m_Name,m_Card)) + { + QTreeWidgetItem* itemAdd = new QTreeWidgetItem(); + QString itemText = "M " + m_MatDialog.IDEdit->text(); + itemAdd->setText(0,itemText); + itemAdd->setText(1,m_MatDialog.IDEdit->text()); + m_MatDialog.mMatTree->addTopLevelItem(itemAdd); + ClearData(); + } + else // if the material has already existed, popup the massage box. + { + QMessageBox msg; + + QString strMsg = QString("Material %1 has been already existed").arg(m_ID); + msg.setText(strMsg); + msg.exec(); + } +} + + +/** ******************************************************************** +* @brief Check the input data, make sure they are not empty +* +* @param strErrorMsg +* @return bool, strErrorMsg +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +bool McCadMatManageDlg::CheckInput(QString &strErrorMsg) +{ + if ( m_MatDialog.IDEdit->text().isEmpty() ) + { + strErrorMsg = "Material ID is missing"; + return false; + } + + if ( m_MatDialog.densityEdit->text().isEmpty() ) + { + strErrorMsg = "Density is missing"; + return false; + } + + if ( m_MatDialog.nameEdit->text().isEmpty() ) + { + strErrorMsg = "Material name is missing"; + return false; + } + + if ( m_MatDialog.nameEdit->text().length() > 50 ) + { + strErrorMsg = "Material name is too long"; + return false; + } + + m_Name = m_MatDialog.nameEdit->text(); + m_ID = m_MatDialog.IDEdit->text().toInt(); + m_Density = m_MatDialog.densityEdit->text().toDouble(); + m_Card = m_MatDialog.mCardText->toPlainText(); + + if( m_ID == 0 ) + { + strErrorMsg = "Material ID should be between 1 and 1000"; + return false; + } + + if( m_Density == 0 ) + { + strErrorMsg = "Value of density is wrong"; + return false; + } + + return true; +} + + +/** ******************************************************************** +* @brief Delete the selected item and the related material in map +* +* @param +* @return void +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::DelMaterial() +{ + QTreeWidgetItem* itemCur = m_MatDialog.mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + int index = m_MatDialog.mMatTree->indexOfTopLevelItem(itemCur); + int iDelItem = itemCur->text(1).toInt(); // Get the material ID + + if(m_Editor->GetMatManager()->DeleteMaterial(iDelItem)) + { + m_MatDialog.mMatTree->takeTopLevelItem(index); // Delete the item on the tree + + delete itemCur; // Delete the iterCur pointer + itemCur = NULL; + + ClearData(); // Clear the edit box + } + + return; +} + + + +/** ******************************************************************** +* @brief Modify the selected item and the related material in map +* +* @param +* @return void +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::ModifyMaterial() +{ + QTreeWidgetItem* itemCur = m_MatDialog.mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + m_Card = m_MatDialog.mCardText->toPlainText(); + m_Name = m_MatDialog.nameEdit->text(); + m_ID = m_MatDialog.IDEdit->text().toInt(); + m_Density = m_MatDialog.densityEdit->text().toDouble(); + + int index = itemCur->text(1).toInt(); // Get the material ID + if (m_Editor->GetMatManager()->UpdateMaterial(index,m_ID,m_Density,m_Name,m_Card)) + { + QString itemText = "M " + m_MatDialog.IDEdit->text(); + itemCur->setText(0,itemText); + itemCur->setText(1,m_MatDialog.IDEdit->text()); + } + else + { + return; + } +} + + +/** ******************************************************************** +* @brief Reponse to the item click, update the edit box +* with the selected material. +* +* @param +* @return void +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::ShowSelectedMaterial(QTreeWidgetItem* item,int colume) +{ + QTreeWidgetItem* itemCur = m_MatDialog.mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + int iItem = item->text(1).toInt(); // Get the material ID + DisplayMaterial(iItem); // Display the material whose ID is iItem + + return; +} + + +/** ******************************************************************** +* @brief Display the deteil selected material. +* +* @param +* @return void +* +* @date 13/11/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::DisplayMaterial(int &iItem) +{ + Material *pMaterial = NULL; + pMaterial = m_Editor->GetMatManager()->GetMaterial(iItem); + + if (NULL != pMaterial) + { + QString strID = QString::number(pMaterial->GetMatID()); + QString strDensity = QString::number(pMaterial->GetMatDensity()); + QString strName = pMaterial->GetMatName(); + QString strMatCard = pMaterial->GetMatCard(); + + m_MatDialog.IDEdit->setText(strID); + m_MatDialog.densityEdit->setText(strDensity); + m_MatDialog.nameEdit->setText(strName); + m_MatDialog.mCardText->setText(strMatCard); + } + return; +} + + + +/** ******************************************************************** +* @brief Add material in the map and a item on the tree +* +* @param +* @return void +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::SaveMaterial() +{ + QTreeWidgetItem* itemCur = m_MatDialog.mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + int iItem = itemCur->text(1).toInt(); // Get the material ID + m_Editor->GetMatManager()->InsertMatGroup(m_EditGroupName,iItem); + //m_Editor->GetMatManager()->SaveXMLfile(); +} + + + +/** ******************************************************************** +* @brief Clear the edit box +* +* @param +* @return void +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::ClearData() +{ + m_MatDialog.mCardText->clear(); + m_MatDialog.nameEdit->clear(); + m_MatDialog.IDEdit->clear(); + m_MatDialog.densityEdit->clear(); +} + + +/** ******************************************************************** +* @brief Set the material group now being edited +* +* @param +* @return void +* +* @date 28/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::SetEditGroup(QString theGroupName) +{ + m_EditGroupName = theGroupName; +} + + +/** ******************************************************************** +* @brief Set the editor, connect the editor with material manager +* +* @param +* @return void +* +* @date 28/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::SetCurrentEditor(QMcCad_Editor* theEditor) +{ + m_Editor = theEditor; +} + + +/** ******************************************************************** +* @brief Save the material information as a xml file +* +* @param +* @return void +* +* @date 28/10/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::SaveXMLFile(QString &strFileName) +{ + QString fileFilters("*.xml"); + QString theFileName = QFileDialog::getSaveFileName(this, tr("Save As"), ".", fileFilters ); + + if (!theFileName.isEmpty()) + { + if(!theFileName.endsWith(".xml")) + { + theFileName.append(".xml"); + } + assert(m_Editor); + m_Editor->GetMatManager()->SaveXMLfile(theFileName); + strFileName = theFileName; + //QString strInfo = QString("Material xml file \"%1\"has been saved").arg(theFileName); + } +} + + + +/** ******************************************************************** +* @brief Load the material information as a xml file +* +* @param +* @return void +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void McCadMatManageDlg::LoadXMLFile(QString &strFileName) +{ + QString fileFilters("*.xml"); + QString theFileName = QFileDialog::getOpenFileName(this, tr("Load"), ".", fileFilters ); + + if (!theFileName.isEmpty()) + { + if(!theFileName.endsWith(".xml")) + { + theFileName.append(".xml"); + } + assert(m_Editor); + m_Editor->GetMatManager()->LoadXMLfile(theFileName,false); + Refresh(); // Display the loaded materials + strFileName = theFileName; + } +} + + + diff --git a/src/MCCAD/McCadDesign/McCadMatManageDlg.hxx b/src/MCCAD/McCadDesign/McCadMatManageDlg.hxx new file mode 100644 index 0000000..bdc8e10 --- /dev/null +++ b/src/MCCAD/McCadDesign/McCadMatManageDlg.hxx @@ -0,0 +1,57 @@ +/* + * McCadMatManageDlg.hxx + * + * Created on: Oct 22, 2013 + * Author: Lei + */ + +#ifndef MCCADMATMANAGEDLG_HXX +#define MCCADMATMANAGEDLG_HXX + +#include +#include + +using namespace std; + +class McCadMatManageDlg : public QDialog +{ + Q_OBJECT + +public: + McCadMatManageDlg(QWidget* theParent = NULL); + void LoadMatData(); + void SetCurrentEditor(QMcCad_Editor* theEditor); + bool CheckInput(QString &strErrorMsg); + void ClearData(); + void SetEditGroup(QString theGroupName); + void LoadMaterials(QString strSelectedGrp); + void DisplayMaterial(int &iItem); + void Refresh(); + + void SaveXMLFile(QString &strFileName); + void LoadXMLFile(QString &strFileName); + +public slots: + void AddMaterial(); + void DelMaterial(); + void ModifyMaterial(); + void SaveMaterial(); + void ShowSelectedMaterial(QTreeWidgetItem*item, int colume); + +private: + + Ui::MCardDialog m_MatDialog; + QMcCad_Editor* m_Editor; + + unsigned int m_ID; + double m_Density; + QString m_Name; + QString m_Card; + + QString m_EditGroupName; // The group name of being edited group + + Standard_Integer m_NumOfMat; // Number of Materials + vector m_MatIDList; // The list stores the ID of materials. +}; + +#endif // MCCADMATMANAGEDLG_HXX diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_DiscFace.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_DiscFace.cxx new file mode 100644 index 0000000..b8db263 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_DiscFace.cxx @@ -0,0 +1,85 @@ +#include + +#include +#include + +#include +#include +#include + +McCadDiscDs_DiscFace::McCadDiscDs_DiscFace() +{ + + myVoxelSeq = new TColgp_HSequenceOfPnt(); + + + +} + +McCadDiscDs_DiscFace::McCadDiscDs_DiscFace(const TopoDS_Face& theFace) +{ + + myVoxelSeq = new TColgp_HSequenceOfPnt(); + myFace = theFace; + +} + +void McCadDiscDs_DiscFace::SetFace(const TopoDS_Face& theFace) +{ + + myFace = theFace; + +} + +TopoDS_Face McCadDiscDs_DiscFace::GetFace() const +{ + return myFace; +} + +Standard_Boolean McCadDiscDs_DiscFace::IsDiscret() const +{ + if (myVoxelSeq->Length() > 0 ) return true; + else return false; +} + +void McCadDiscDs_DiscFace::SetPoints(const Handle(TColgp_HSequenceOfPnt)& thePntSeq) +{ + myVoxelSeq = thePntSeq; +} + +Handle(TColgp_HSequenceOfPnt) McCadDiscDs_DiscFace::GetPoints() const +{ + return myVoxelSeq; +} + +void McCadDiscDs_DiscFace::SetBBox(const Bnd_Box& theBBox) +{ + + myBBox = theBBox; + +} + +Bnd_Box McCadDiscDs_DiscFace::GetBBox() const +{ + return myBBox; +} + +Standard_Integer McCadDiscDs_DiscFace::NbOfPoints() const +{ + return myVoxelSeq->Length(); +} + +Standard_Real McCadDiscDs_DiscFace::FaceArea() const +{ + GProp_GProps GP; + BRepGProp::SurfaceProperties(myFace,GP); + return GP.Mass(); +} + +GeomAbs_SurfaceType McCadDiscDs_DiscFace::FaceSurfaceType() const +{ + Handle(Geom_Surface) aSurface = BRep_Tool::Surface(myFace); + GeomAdaptor_Surface theAdapter(aSurface); + return theAdapter.GetType(); +} + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_DiscSolid.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_DiscSolid.cxx new file mode 100644 index 0000000..a9e95f5 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_DiscSolid.cxx @@ -0,0 +1,350 @@ +#include + +#include +#include +#include + +#include +#include +#include + +//#include + +McCadDiscDs_DiscSolid::McCadDiscDs_DiscSolid() +{ + Init(); +} + +McCadDiscDs_DiscSolid::McCadDiscDs_DiscSolid(const TopoDS_Shape& theSolid) +{ + Init(); + SetSolid(theSolid); +} + + +void McCadDiscDs_DiscSolid::Init() +{ + myComment="c McCad: "; + myName="Nobody"; + myVoxelSeq = new TColgp_HSequenceOfPnt(); + myOwnVFaces = new McCadDiscDs_HSequenceOfDiscFace(); + myOtherVSolidsIndexList = new TColStd_HSequenceOfInteger(); + myIndex = 0; + myIsDiscret = false; + myIsVoid = Standard_True; + myIsOuterVoid = Standard_False; + myHaveMaterial = Standard_False; + myHaveDensity = Standard_False; + myMaterialNumber = 0; + myDensity = 0; +} + + +Standard_Boolean McCadDiscDs_DiscSolid::HasDensity() const +{ + return myHaveDensity; +} + + +Standard_Boolean McCadDiscDs_DiscSolid::HasMaterial() const +{ + return myHaveMaterial; +} + + +void McCadDiscDs_DiscSolid::UnsetMaterial() +{ + myMaterialNumber = 0; + myHaveMaterial = Standard_False; +} + + +void McCadDiscDs_DiscSolid::UnsetDensity() +{ + myDensity = 0; + myHaveDensity = Standard_False; +} + + +Standard_Real McCadDiscDs_DiscSolid::GetDensity() const +{ + return myDensity; +} + +Standard_Integer McCadDiscDs_DiscSolid::GetMaterialNumber() const +{ + return myMaterialNumber; +} + + +void McCadDiscDs_DiscSolid::SetMaterialNumber(const Standard_Integer theMaterialNumber) +{ + myMaterialNumber = theMaterialNumber; +} + +void McCadDiscDs_DiscSolid::SetDensity(const Standard_Real theDensity) +{ + myDensity = theDensity; +} + + +void McCadDiscDs_DiscSolid::SetIsDiscret(const Standard_Boolean theState) +{ + myIsDiscret = theState; +} + +Standard_Boolean McCadDiscDs_DiscSolid::IsDiscret() const +{ + return myIsDiscret; +} + +Standard_Boolean McCadDiscDs_DiscSolid::IsVoid() const +{ + return myIsVoid; +} + +void McCadDiscDs_DiscSolid::SetIsVoid(const Standard_Boolean theVoidStatus) +{ + myIsVoid = theVoidStatus; +} + +Standard_Boolean McCadDiscDs_DiscSolid::IsOuterVoid() const +{ + return myIsOuterVoid; +} + +void McCadDiscDs_DiscSolid::SetIsOuterVoid(const Standard_Boolean theStatus) +{ + myIsOuterVoid = theStatus; +} + + +void McCadDiscDs_DiscSolid::MakeOwnVFaces() +{ +// Handle(PColStd_HSequenceOfReal) areaSeq = new PColStd_HSequenceOfReal; +// Handle(McCadDiscDs_HSequenceOfDiscFace) sortedDiscFaces = new McCadDiscDs_HSequenceOfDiscFace; + + for (TopExp_Explorer exF(myShape, TopAbs_FACE); exF.More(); exF.Next()) // sort descending by surface area + { + TopoDS_Face aFace = TopoDS::Face(exF.Current()); + /*GProp_GProps GP1; + BRepGProp::SurfaceProperties(aFace,GP1); + Standard_Real area = GP1.Mass();*/ + McCadDiscDs_DiscFace theDFace(aFace); + AppendOwnVFace(theDFace); + + /*if(areaSeq->Length() < 1) // first element + { + areaSeq->Append(area); + sortedDiscFaces->Append(theDFace); + } + else + { + Standard_Boolean appended(Standard_False); + for(Standard_Integer j=1; j <= areaSeq->Length(); j++) + { + if(area > areaSeq->Value(j)) + { + areaSeq->InsertBefore(j, area); + sortedDiscFaces->InsertBefore(j, theDFace); + appended = Standard_True; + break; + } + } + }*/ + } + + /*for(Standard_Integer i=1; i<=sortedDiscFaces->Length(); i++) + AppendOwnVFace(sortedDiscFaces->Value(i));*/ +} + + +void McCadDiscDs_DiscSolid::SetIndex(const Standard_Integer theIndex) +{ + myIndex = theIndex; +} + + +Standard_Integer McCadDiscDs_DiscSolid::GetIndex() const +{ + return myIndex; +} + + +void McCadDiscDs_DiscSolid::SetSolid(const TopoDS_Shape& theShape) +{ + myShape = theShape; + myOwnVFaces->Clear(); + MakeOwnVFaces(); +} + + +TopoDS_Shape McCadDiscDs_DiscSolid::GetSolid() const +{ + return myShape; +} + + +void McCadDiscDs_DiscSolid::SetVoxel(const Handle(TColgp_HSequenceOfPnt)& theVoxelSeq) +{ + myVoxelSeq->Append(theVoxelSeq); +} + + +Handle(TColgp_HSequenceOfPnt) McCadDiscDs_DiscSolid::GetVoxel() const +{ + if(myVoxelSeq->Length() > 0) + return myVoxelSeq; // is full + + for (Standard_Integer i=1; i <= myOwnVFaces->Length();i++) + myVoxelSeq->Append((myOwnVFaces->Value(i)).GetPoints()); + + return myVoxelSeq; +} + + +void McCadDiscDs_DiscSolid::SetName(const TCollection_AsciiString& aName) +{ + myName = aName; + myComment = myComment + aName; +} + + +void McCadDiscDs_DiscSolid::SetName(const TCollection_AsciiString& aName, const Standard_Integer i) +{ + TCollection_AsciiString thePath = aName; + myFileName = aName; + + TCollection_AsciiString tmpName; + if(thePath.SearchFromEnd("/")>0) + tmpName = thePath.Split(thePath.SearchFromEnd("/")); + + tmpName.Remove(tmpName.SearchFromEnd("."), tmpName.Length() - tmpName.SearchFromEnd(".")+1); //cut extension + + if(tmpName.Search("ExOut") > 0) + { + TCollection_AsciiString theName = tmpName; + theName.Remove(1, tmpName.Search("ExOut") + 4); + tmpName = theName; + } + if(tmpName.Search("converted") > 0) + { + TCollection_AsciiString theName = tmpName; + theName.Remove(1,tmpName.Search("converted") + 8); + tmpName = theName; + } + myName = tmpName; + + myComment += thePath + TCollection_AsciiString(" : ") + myName; +} + + +TCollection_AsciiString McCadDiscDs_DiscSolid::GetComment() const +{ + return myComment; +} + + +TCollection_AsciiString McCadDiscDs_DiscSolid::GetFileName() const +{ + if( myFileName.IsEmpty() ) { + if( myName.IsEmpty() ) + return "unnamed"; + else + return myName; + } + + return myFileName; +} + + +TCollection_AsciiString McCadDiscDs_DiscSolid::GetName() const +{ + return myName; +} + + +void McCadDiscDs_DiscSolid::SetBBox(const Bnd_Box& theBBox) +{ + myBBox = theBBox; +} + +Bnd_Box McCadDiscDs_DiscSolid::GetBBox() +{ + if(myBBox.IsVoid()) + { + // calculate Bounding Box + Bnd_Box aBB; + BRepBndLib::Add(myShape, aBB); + aBB.SetGap(0); + + myBBox.Add(aBB); + } + + return myBBox; +} + + +void McCadDiscDs_DiscSolid::SetOwnVFaces(const Handle(McCadDiscDs_HSequenceOfDiscFace)& vFaces) +{ + myOwnVFaces->Clear(); + myOwnVFaces->Append(vFaces); +} + + +void McCadDiscDs_DiscSolid::AppendOwnVFace(const McCadDiscDs_DiscFace& vFace) +{ + myOwnVFaces->Append(vFace); +} + + +Handle(McCadDiscDs_HSequenceOfDiscFace) McCadDiscDs_DiscSolid::GetOwnVFaces() const +{ + return myOwnVFaces; +} + + +Standard_Integer McCadDiscDs_DiscSolid::NbOfOwnVFace() const +{ + return myOwnVFaces->Length(); +} + + +void McCadDiscDs_DiscSolid::SetOtherVSolids(const Handle(TColStd_HSequenceOfInteger)& vSolidsIndexList) +{ + myOtherVSolidsIndexList->Clear(); + myOtherVSolidsIndexList->Append(vSolidsIndexList); +} + + +void McCadDiscDs_DiscSolid::AppendOtherVSolid(Standard_Integer& theIndex) +{ + myOtherVSolidsIndexList->Append(theIndex); +} + + +Handle(TColStd_HSequenceOfInteger) McCadDiscDs_DiscSolid::GetOtherVSolids() const +{ + return myOtherVSolidsIndexList; +} + + +Standard_Integer McCadDiscDs_DiscSolid::NbOfOtherVSolids() const +{ + return myOtherVSolidsIndexList->Length(); +} + + +Standard_Integer McCadDiscDs_DiscSolid::NbOfPoints() const +{ + return myVoxelSeq->Length(); +} + + +Standard_Real McCadDiscDs_DiscSolid::Volume() const +{ + GProp_GProps GP; + BRepGProp::VolumeProperties(myShape, GP); + return GP.Mass(); +} + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfDiscFace_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfDiscFace_0.cxx new file mode 100644 index 0000000..66976ff --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfDiscFace_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfDiscFace_HeaderFile +#include +#endif +//McCadDiscDs_HSequenceOfDiscFace::~McCadDiscDs_HSequenceOfDiscFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_HSequenceOfDiscFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_HSequenceOfDiscFace", + sizeof(McCadDiscDs_HSequenceOfDiscFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_HSequenceOfDiscFace) Handle(McCadDiscDs_HSequenceOfDiscFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_HSequenceOfDiscFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscFace))) { + _anOtherObject = Handle(McCadDiscDs_HSequenceOfDiscFace)((Handle(McCadDiscDs_HSequenceOfDiscFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_HSequenceOfDiscFace::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscFace) ; +} +//Standard_Boolean McCadDiscDs_HSequenceOfDiscFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscFace) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadDiscDs_HSequenceOfDiscFace::~Handle_McCadDiscDs_HSequenceOfDiscFace() {} +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TheSequence McCadDiscDs_SequenceOfDiscFace +#define TheSequence_hxx +#define TCollection_HSequence McCadDiscDs_HSequenceOfDiscFace +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadDiscDs_HSequenceOfDiscFace +#define TCollection_HSequence_Type_() McCadDiscDs_HSequenceOfDiscFace_Type_() +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfDiscSolid_0.cxx new file mode 100644 index 0000000..2ca1f41 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfDiscSolid_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +//McCadDiscDs_HSequenceOfDiscSolid::~McCadDiscDs_HSequenceOfDiscSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_HSequenceOfDiscSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_HSequenceOfDiscSolid", + sizeof(McCadDiscDs_HSequenceOfDiscSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_HSequenceOfDiscSolid) Handle(McCadDiscDs_HSequenceOfDiscSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_HSequenceOfDiscSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscSolid))) { + _anOtherObject = Handle(McCadDiscDs_HSequenceOfDiscSolid)((Handle(McCadDiscDs_HSequenceOfDiscSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_HSequenceOfDiscSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscSolid) ; +} +//Standard_Boolean McCadDiscDs_HSequenceOfDiscSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscSolid) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadDiscDs_HSequenceOfDiscSolid::~Handle_McCadDiscDs_HSequenceOfDiscSolid() {} +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TheSequence McCadDiscDs_SequenceOfDiscSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadDiscDs_HSequenceOfDiscSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadDiscDs_HSequenceOfDiscSolid +#define TCollection_HSequence_Type_() McCadDiscDs_HSequenceOfDiscSolid_Type_() +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfHSeqOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfHSeqOfDiscSolid_0.cxx new file mode 100644 index 0000000..6e82142 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_HSequenceOfHSeqOfDiscSolid_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfSeqOfDiscSolid_HeaderFile +#include +#endif +//McCadDiscDs_HSequenceOfHSeqOfDiscSolid::~McCadDiscDs_HSequenceOfHSeqOfDiscSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_HSequenceOfHSeqOfDiscSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_HSequenceOfHSeqOfDiscSolid", + sizeof(McCadDiscDs_HSequenceOfHSeqOfDiscSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid) Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_HSequenceOfHSeqOfDiscSolid))) { + _anOtherObject = Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)((Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_HSequenceOfHSeqOfDiscSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_HSequenceOfHSeqOfDiscSolid) ; +} +//Standard_Boolean McCadDiscDs_HSequenceOfHSeqOfDiscSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_HSequenceOfHSeqOfDiscSolid) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid::~Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid() {} +#define Item McCadDiscDs_SequenceOfDiscSolid +#define Item_hxx +#define TheSequence McCadDiscDs_SequenceOfSeqOfDiscSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadDiscDs_HSequenceOfHSeqOfDiscSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid +#define TCollection_HSequence_Type_() McCadDiscDs_HSequenceOfHSeqOfDiscSolid_Type_() +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscFace_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscFace_0.cxx new file mode 100644 index 0000000..b49aae3 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscFace_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListOfDiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#include +#endif + + +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscFace +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscFace +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscSolid_0.cxx new file mode 100644 index 0000000..6ce2eaf --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListIteratorOfListOfDiscSolid_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#include +#endif + + +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscSolid +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscSolid +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscFace_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscFace_0.cxx new file mode 100644 index 0000000..f1394b8 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscFace_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListOfDiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListIteratorOfListOfDiscFace_HeaderFile +#include +#endif +//McCadDiscDs_ListNodeOfListOfDiscFace::~McCadDiscDs_ListNodeOfListOfDiscFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_ListNodeOfListOfDiscFace", + sizeof(McCadDiscDs_ListNodeOfListOfDiscFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_ListNodeOfListOfDiscFace) Handle(McCadDiscDs_ListNodeOfListOfDiscFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_ListNodeOfListOfDiscFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscFace))) { + _anOtherObject = Handle(McCadDiscDs_ListNodeOfListOfDiscFace)((Handle(McCadDiscDs_ListNodeOfListOfDiscFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_ListNodeOfListOfDiscFace::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscFace) ; +} +//Standard_Boolean McCadDiscDs_ListNodeOfListOfDiscFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscFace) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadDiscDs_ListNodeOfListOfDiscFace::~Handle_McCadDiscDs_ListNodeOfListOfDiscFace() {} +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscFace +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscFace +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscSolid_0.cxx new file mode 100644 index 0000000..31174e9 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListNodeOfListOfDiscSolid_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListIteratorOfListOfDiscSolid_HeaderFile +#include +#endif +//McCadDiscDs_ListNodeOfListOfDiscSolid::~McCadDiscDs_ListNodeOfListOfDiscSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_ListNodeOfListOfDiscSolid", + sizeof(McCadDiscDs_ListNodeOfListOfDiscSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_ListNodeOfListOfDiscSolid) Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_ListNodeOfListOfDiscSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscSolid))) { + _anOtherObject = Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)((Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_ListNodeOfListOfDiscSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscSolid) ; +} +//Standard_Boolean McCadDiscDs_ListNodeOfListOfDiscSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscSolid) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadDiscDs_ListNodeOfListOfDiscSolid::~Handle_McCadDiscDs_ListNodeOfListOfDiscSolid() {} +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscSolid +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscSolid +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_ListOfDiscFace_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListOfDiscFace_0.cxx new file mode 100644 index 0000000..f835c3b --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListOfDiscFace_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListIteratorOfListOfDiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#include +#endif + + +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscFace +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscFace +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_ListOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListOfDiscSolid_0.cxx new file mode 100644 index 0000000..a382575 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_ListOfDiscSolid_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListIteratorOfListOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#include +#endif + + +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscSolid +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscSolid +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_0.cxx new file mode 100644 index 0000000..af1ab74 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfDiscFace_HeaderFile +#include +#endif +//McCadDiscDs_SequenceNodeOfSequenceOfDiscFace::~McCadDiscDs_SequenceNodeOfSequenceOfDiscFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_SequenceNodeOfSequenceOfDiscFace", + sizeof(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace) Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace))) { + _anOtherObject = Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)((Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_SequenceNodeOfSequenceOfDiscFace::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace) ; +} +//Standard_Boolean McCadDiscDs_SequenceNodeOfSequenceOfDiscFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace::~Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace() {} +#define SeqItem McCadDiscDs_DiscFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscFace +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_0.cxx new file mode 100644 index 0000000..0615de2 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +//McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid::~McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid", + sizeof(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid) Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid))) { + _anOtherObject = Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)((Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid) ; +} +//Standard_Boolean McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid::~Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid() {} +#define SeqItem McCadDiscDs_DiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscSolid +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_0.cxx new file mode 100644 index 0000000..2a9f170 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfSeqOfDiscSolid_HeaderFile +#include +#endif +//McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid::~McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid", + sizeof(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid) Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid))) { + _anOtherObject = Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)((Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid) ; +} +//Standard_Boolean McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid::~Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid() {} +#define SeqItem McCadDiscDs_SequenceOfDiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfSeqOfDiscSolid +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfDiscFace_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfDiscFace_0.cxx new file mode 100644 index 0000000..779e7b4 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfDiscFace_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile +#include +#endif + + +#define SeqItem McCadDiscDs_DiscFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscFace +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfDiscSolid_0.cxx new file mode 100644 index 0000000..a1fc359 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfDiscSolid_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile +#include +#endif + + +#define SeqItem McCadDiscDs_DiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscSolid +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfSeqOfDiscSolid_0.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfSeqOfDiscSolid_0.cxx new file mode 100644 index 0000000..18d023c --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_SequenceOfSeqOfDiscSolid_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile +#include +#endif + + +#define SeqItem McCadDiscDs_SequenceOfDiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfSeqOfDiscSolid +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadDiscDs/McCadDiscDs_TDiscSolid.cxx b/src/MCCAD/McCadDiscDs/McCadDiscDs_TDiscSolid.cxx new file mode 100644 index 0000000..ee91d93 --- /dev/null +++ b/src/MCCAD/McCadDiscDs/McCadDiscDs_TDiscSolid.cxx @@ -0,0 +1,44 @@ +/* + * McCadDiscDs_TDiscSolid.cxx + * + * This is a persistence class for McCadDiscDs_DiscSolid, to allow to save it in an xml file + * after the conversion, before the file is exported to MCNP or Tripoli syntax, this is the raw + * file format. From this raw file format it nearly costs no time to switch from Tripoli to MCNP + * and vice versa. + */ + +#include + + +const Standard_GUID& McCadDiscDs_TDiscSolid::GetID () +{ + static Standard_GUID TDataStd_GeometryID ("17a7c949-e0fb-49e3-98eb-6b5346ff2784"); + return TDataStd_GeometryID; +} + +const Standard_GUID& McCadDiscDs_TDiscSolid::ID() const +{ + return GetID(); +} + + +void McCadDiscDs_TDiscSolid::Paste (const Handle(TDF_Attribute)& theInto, + const Handle(TDF_RelocationTable)& RT ) const +{ + Handle(McCadDiscDs_TDiscSolid) tDS = Handle(McCadDiscDs_TDiscSolid)::DownCast(theInto); + tDS->Set(myDiscSolid); +} + + +Handle(TDF_Attribute) McCadDiscDs_TDiscSolid::NewEmpty () const +{ + return new McCadDiscDs_TDiscSolid(); +} + + +Standard_OStream& McCadDiscDs_TDiscSolid::Dump(Standard_OStream& theOS) const +{ + Standard_OStream& anOS = TDF_Attribute::Dump( theOS ); + anOS << myString; + return anOS; +} diff --git a/src/MCCAD/McCadDiscretization/McCadDiscretization_Face.cxx b/src/MCCAD/McCadDiscretization/McCadDiscretization_Face.cxx new file mode 100644 index 0000000..a510aa7 --- /dev/null +++ b/src/MCCAD/McCadDiscretization/McCadDiscretization_Face.cxx @@ -0,0 +1,331 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +McCadDiscretization_Face::McCadDiscretization_Face() +{ + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myRlen = 3.14/(2*myMaxNbPnt); + myTolerance = 1.0e-07; + myIsDone = false; +} + + +McCadDiscretization_Face::McCadDiscretization_Face( McCadDiscDs_DiscFace& theDsFace) +{ + myDiscFace = theDsFace; + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myRlen = 3.14/(2*myMaxNbPnt); + myTolerance = 1.0e-07; + myIsDone = false; +} + + +void McCadDiscretization_Face::Init() +{ + BRepClass_FaceClassifier bsc3d; + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + ////////////////////////////////////////////////////////////////////////////////////// + //!!!!!!! Note this is for test purpose!!!!! + // for (TopExp_Explorer ex(aFace,TopAbs_VERTEX); ex.More(); ex.Next()) + // thePntSeq->Append(BRep_Tool::Pnt(TopoDS::Vertex(ex.Current()))); + // cout << "Total Number of sample points computed = " << thePntSeq->Length() << endl; + // return thePntSeq; + ////////////////////////////////////////////////////////////////////////////////////// + BRepAdaptor_Curve2d c; + + TopoDS_Face theFace = TopoDS::Face(myDiscFace.GetFace()); + + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + /*Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; +*/ + +// Standard_Integer nbBrimPoints(0); + + for (TopExp_Explorer ex(theFace, TopAbs_EDGE); ex.More(); ex.Next()) + { + c.Initialize(TopoDS::Edge(ex.Current()), theFace); + Standard_Real f = (!(Precision::IsNegativeInfinite(c.FirstParameter()))) ? c.FirstParameter() : -1.0; + Standard_Real l = (!(Precision::IsPositiveInfinite(c.LastParameter()))) ? c.LastParameter() : 1.0; + + gp_Pnt2d pf = c.Value(f); + gp_Pnt2d pl = c.Value(l); + gp_Pnt p3f; + theASurface.D0(pf.X(), pf.Y(), p3f); + gp_Pnt p3l; + theASurface.D0(pl.X(), pl.Y(), p3l); + Standard_Real Len = p3f.Distance(p3l); + Standard_Integer NUMPNT; + if (int(Len/myXlen) < myMinNbPnt) + NUMPNT = myMinNbPnt; + else if (int(Len/myXlen) > myMaxNbPnt) + NUMPNT = myMaxNbPnt; + else + NUMPNT = int(Len/myXlen); + + for (int t=0; t<=NUMPNT; t++) + { + Standard_Real a = Standard_Real(t)/Standard_Real(NUMPNT); + Standard_Real par = (1-a)*f + a*l; + gp_Pnt2d p2 = c.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bsc3d.Perform(theFace, p2, myTolerance); + + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON) + thePntSeq->Append(p1); + } + + } + +// nbBrimPoints = thePntSeq->Length(); + + //////////////////////////////////////////////////////////////////////////////////////////////////// + Standard_Real U1, U2, V1, V2; + BRepTools::UVBounds(theFace, U1, U2, V1, V2); + + if (theASurface.GetType() == GeomAbs_Cone ||theASurface.GetType() == GeomAbs_Cylinder) + { + myXlen = myRlen; + } + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + myXlen = myRlen; + myYlen = myRlen; + } + + // cout << "U1 = " << U1 << " U2 = " << U2 << " V1 = " << V1 << " V2 = " << V2 << endl; + Standard_Real du=1, dv=1; + + Standard_Real XLen=U2-U1; + Standard_Real YLen=V2-V1; + Standard_Integer XNUMPNT; + if (int(XLen/myXlen) < myMinNbPnt) + XNUMPNT = myMinNbPnt; + else if (int(XLen/myXlen) > myMaxNbPnt) + XNUMPNT = myMaxNbPnt; + else + XNUMPNT = int(XLen/myXlen); + // cout << "XNUMPNT = " << XNUMPNT << endl; + Standard_Integer YNUMPNT; + if (int(YLen/myYlen) < myMinNbPnt) + YNUMPNT = myMinNbPnt; + else if (int(YLen/myYlen) > myMaxNbPnt) + YNUMPNT = myMaxNbPnt; + else + YNUMPNT = int(YLen/myYlen); + // cout << "YNUMPNT = " << YNUMPNT << endl; + + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = new TColgp_HSequenceOfPnt(); + Standard_Integer repeat = 0; + do + { + if (repeat > 3) + break; + + du = XLen/Standard_Real(XNUMPNT); + dv = YLen/Standard_Real(YNUMPNT); + + tmpPntSeq->Clear(); + + for (int j=0; j<=YNUMPNT; j++) + { + Standard_Real V = V1+dv*j; + + for (int i=0; i<=XNUMPNT; i++) + { + gp_Pnt p1; + Standard_Real U = U1+du*i; + theASurface.D0(U, V, p1); + gp_Pnt2d p2(U, V); + + bsc3d.Perform(theFace, p2, myTolerance); + if (bsc3d.State() == TopAbs_IN /*|| bsc3d.State() == TopAbs_ON*/) //MYTEST comment + tmpPntSeq->Append(p1); + } + } + + XNUMPNT=XNUMPNT*2; + YNUMPNT=YNUMPNT*2; + repeat++; + } while (tmpPntSeq->Length() < myMinNbPnt*myMinNbPnt); + + thePntSeq->Append(tmpPntSeq); + + // we add vetices here + for (TopExp_Explorer exv(theFace, TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + thePntSeq->Prepend(aPnt); + } + + /////////////////////////////////////////////////////////////////////////////////////////////// + // remove sample points which have been added multiple times + for (int j=2; j<= thePntSeq->Length(); j++) + { + gp_XYZ p1 = (thePntSeq->Value(j)).XYZ(); + for (int jk=j-1; jk >= 1; jk--) + { + gp_XYZ p2 = (thePntSeq->Value(jk)).XYZ(); + + //cout << p1.X()*p1.X() + p1.Y()*p1.Y() + p1.Z()*p1.Z() + p2.X()*p2.X() + p2.Y()*p2.Y() + p2.Z()*p2.Z() << endl; + + if (p1.IsEqual(p2, 1.e-05)) + { + thePntSeq->Remove(jk); + j=jk; + } + } + } + + + // cout << "Total Number of face sample points computed = " << thePntSeq->Length() << endl; + Bnd_Box aBB; // make a tight box!!!! + + + BRepBndLib::Add(theFace, aBB); + aBB.SetGap(0); + + + if (aBB.IsWhole() || aBB.IsVoid() || aBB.IsThin(1e-7)) + cout << "_#_McCadDiscretization_Face.cxx :: Face Bounding box computation failed !!" << endl; + + //myDiscFace.SetBrimPointIndex(nbBrimPoints); + + myDiscFace.SetPoints(thePntSeq); + myDiscFace.SetBBox(aBB); + + myIsDone = true; +} + + +void McCadDiscretization_Face::SetFace(McCadDiscDs_DiscFace& theDsFace) +{ + myDiscFace = theDsFace; +} + + +McCadDiscDs_DiscFace McCadDiscretization_Face::GetFace() const +{ + return myDiscFace; +} + + +Standard_Boolean McCadDiscretization_Face::IsDone() const +{ + return myIsDone; +} + + +void McCadDiscretization_Face::SetMinNbPnt(const Standard_Integer theNumb) +{ + myMinNbPnt = theNumb; +} + + +Standard_Integer McCadDiscretization_Face::GetMinNbPnt() const +{ + return myMinNbPnt; +} + + +void McCadDiscretization_Face::SetMaxNbPnt(const Standard_Integer theNumb) +{ + myMaxNbPnt = theNumb; +} + + +Standard_Integer McCadDiscretization_Face::GetMaxNbPnt() const +{ + return myMaxNbPnt; +} + +void McCadDiscretization_Face::SetXresolution(const Standard_Real theXlen) +{ + myXlen = theXlen; +} + + +Standard_Real McCadDiscretization_Face::GetXresolution() const +{ + return myXlen; +} + + +void McCadDiscretization_Face::SetYresolution(const Standard_Real theYlen) +{ + myYlen = theYlen; +} + + +Standard_Real McCadDiscretization_Face::GetYresolution() const +{ + return myYlen; +} + + +void McCadDiscretization_Face::SetTolerance(const Standard_Real theTol) +{ + myTolerance = theTol; +} + + +Standard_Real McCadDiscretization_Face::GetTolerance() const +{ + return myTolerance; +} + diff --git a/src/MCCAD/McCadDiscretization/McCadDiscretization_Solid.cxx b/src/MCCAD/McCadDiscretization/McCadDiscretization_Solid.cxx new file mode 100644 index 0000000..842b350 --- /dev/null +++ b/src/MCCAD/McCadDiscretization/McCadDiscretization_Solid.cxx @@ -0,0 +1,178 @@ +#include + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +McCadDiscretization_Solid::McCadDiscretization_Solid() +{ + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myRlen = 3.14/(2*myMaxNbPnt); //angular resolution + myTolrenace = 1.0e-07; + myIsDone = false; +} + +McCadDiscretization_Solid::McCadDiscretization_Solid( McCadDiscDs_DiscSolid& theDsSolid) +{ + + myDiscSolid = theDsSolid; + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myRlen = 3.14/(2*myMaxNbPnt); + myTolrenace = 1.0e-07; + myIsDone = false; + +} + +void McCadDiscretization_Solid::Init() +{ + Handle(McCadDiscDs_HSequenceOfDiscFace) theDFaces = myDiscSolid.GetOwnVFaces(); + Handle(McCadDiscDs_HSequenceOfDiscFace) tmpDFaces = new McCadDiscDs_HSequenceOfDiscFace; + + Bnd_Box solBB; + + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + + for (Standard_Integer i=1; i <= theDFaces->Length(); i++) + { + McCadDiscDs_DiscFace theVFace = theDFaces->Value(i); + McCadDiscretization_Face myDisc(theVFace); + + myDisc.SetMinNbPnt(myMinNbPnt); + myDisc.SetMaxNbPnt(myMaxNbPnt); + myDisc.SetXresolution(myXlen); + myDisc.SetYresolution(myYlen); + myDisc.SetTolerance(myTolrenace); + + myDisc.Init(); + + if(myDisc.IsDone()) + { + tmpDFaces->Append(myDisc.GetFace()); + Bnd_Box aBB = myDisc.GetFace().GetBBox(); + aBB.SetGap(0.0); + if(aBB.IsWhole() || aBB.IsVoid() || aBB.IsThin(1e-7)) + cout << "_#_McCadDiscretization_Solid.cxx :: Face Bounding box computation failed !!" << endl; + solBB.Add(aBB); + + thePntSeq->Append(myDisc.GetFace().GetPoints()); + + } + else + cout << "Face discretization failed!!" << endl; + } + + ////////////////////////////////////////////////////////////////////////////// + solBB.SetGap(0.0); + + if(solBB.IsWhole() || solBB.IsVoid() || solBB.IsThin(1e-7)) + { + cout << "_#_McCadDiscretization_Solid.cxx :: Bounding box computation failed; new computation follows!!" << endl; + TopoDS_Shape aSol = myDiscSolid.GetSolid(); + Bnd_Box aBBox; + for (TopExp_Explorer exV(aSol,TopAbs_VERTEX); exV.More(); exV.Next()) + { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(exV.Current())); + aBBox.Add(aP); + } + solBB = aBBox; + if(solBB.IsWhole() || solBB.IsVoid() || solBB.IsThin(1e-7)) + cout << "_#_McCadDiscretization_Solid.cxx :: Bounding box computation definitely failed !!" << endl; + } + + myDiscSolid.SetOwnVFaces(tmpDFaces); + myDiscSolid.SetBBox(solBB); + myDiscSolid.SetIsDiscret(true); + myIsDone = true; +} + +void McCadDiscretization_Solid::SetSolid(McCadDiscDs_DiscSolid& theDsSolid) +{ + myDiscSolid = theDsSolid; +} + +McCadDiscDs_DiscSolid McCadDiscretization_Solid::GetSolid() const +{ + return myDiscSolid; +} + +Standard_Boolean McCadDiscretization_Solid::IsDone() const +{ + return myIsDone; +} + +void McCadDiscretization_Solid::SetMinNbPnt(const Standard_Integer theNumb) +{ + myMinNbPnt = theNumb; +} + +Standard_Integer McCadDiscretization_Solid::GetMinNbPnt() const +{ + return myMinNbPnt; +} + +void McCadDiscretization_Solid::SetMaxNbPnt(const Standard_Integer theNumb) +{ + myMaxNbPnt = theNumb; +} + +Standard_Integer McCadDiscretization_Solid::GetMaxNbPnt() const +{ + return myMaxNbPnt; +} + +void McCadDiscretization_Solid::SetXresolution(const Standard_Real theXlen) +{ + myXlen = theXlen; +} + +Standard_Real McCadDiscretization_Solid::GetXresolution() const +{ + return myXlen; +} + +void McCadDiscretization_Solid::SetYresolution(const Standard_Real theYlen) +{ + myYlen = theYlen; +} + +Standard_Real McCadDiscretization_Solid::GetYresolution() const +{ + return myYlen; +} + +void McCadDiscretization_Solid::SetTolerance(const Standard_Real theTol) +{ + myTolrenace = theTol; +} + +Standard_Real McCadDiscretization_Solid::GetTolerance() const +{ + return myTolrenace; +} + diff --git a/src/MCCAD/McCadEXPlug/McCadEXPlug.cxx b/src/MCCAD/McCadEXPlug/McCadEXPlug.cxx new file mode 100644 index 0000000..ee807e0 --- /dev/null +++ b/src/MCCAD/McCadEXPlug/McCadEXPlug.cxx @@ -0,0 +1,19 @@ +#include +#include + +Standard_Boolean McCadEXPlug::PathExists(const OSD_Path& thePath) +{ + OSD_Path tmpPath = thePath; + OSD_File theFile; + theFile.SetPath(tmpPath); + return theFile.Exists(); +} + +Standard_Boolean McCadEXPlug::PathIsReadable(const OSD_Path& thePath) +{ + OSD_Path tmpPath = thePath; + OSD_File theFile; + theFile.SetPath(tmpPath); + return theFile.IsReadable(); +} + diff --git a/src/MCCAD/McCadEXPlug/McCadEXPlug_ExchangePlugin.cxx b/src/MCCAD/McCadEXPlug/McCadEXPlug_ExchangePlugin.cxx new file mode 100644 index 0000000..01b801e --- /dev/null +++ b/src/MCCAD/McCadEXPlug/McCadEXPlug_ExchangePlugin.cxx @@ -0,0 +1,97 @@ +#include +#include + +McCadEXPlug_ExchangePlugin::McCadEXPlug_ExchangePlugin() +{ +} + +Standard_Boolean McCadEXPlug_ExchangePlugin::Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) +{ + return Standard_True; +} + +Standard_Boolean McCadEXPlug_ExchangePlugin::Export(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theVEntitySequence) +{ + return Standard_True; +} + +Handle(TopTools_HSequenceOfShape) McCadEXPlug_ExchangePlugin::Import() +{ + Handle(TopTools_HSequenceOfShape) newHSeq = new TopTools_HSequenceOfShape; + return newHSeq; +} + + +// Import/Export to/from TDocStd_Document +Standard_Boolean McCadEXPlug_ExchangePlugin::ImportToDocument(Handle(TDocStd_Document)& theTDoc) +{ + return Standard_True; +} + +Standard_Boolean McCadEXPlug_ExchangePlugin::ExportFromDocument(const Handle(TDocStd_Document)& theTDoc) +{ + return Standard_True; +} + +//________________ + + + +Standard_Integer McCadEXPlug_ExchangePlugin::GetModelType() const +{ + return 0; +} + +void McCadEXPlug_ExchangePlugin::SetModelType(const Standard_Integer theType) +{ +} + +TCollection_AsciiString McCadEXPlug_ExchangePlugin::GetFilename() +{ + TCollection_AsciiString a(" "); + return a; +} + +void McCadEXPlug_ExchangePlugin::SetFilename( + const TCollection_AsciiString& theFileName) +{ +} + +Standard_Integer McCadEXPlug_ExchangePlugin::GetSize() const +{ + return 0; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadEXPlug_ExchangePlugin::GetExtensions() const +{ + return NULL; +} + +TCollection_AsciiString McCadEXPlug_ExchangePlugin::GetExtension() const +{ + TCollection_AsciiString anExtension(".none"); + return anExtension; +} + +TCollection_AsciiString McCadEXPlug_ExchangePlugin::GetFormat() const +{ + TCollection_AsciiString aFormat("none"); + return aFormat; +} + +Standard_Boolean McCadEXPlug_ExchangePlugin::ExportEnabled() const +{ + return Standard_False; +} + +Standard_Boolean McCadEXPlug_ExchangePlugin::ImportEnabled() const +{ + return Standard_False; +} + + +McCadGUI_ProgressDialogPtr McCadEXPlug_ExchangePlugin::GetProgressDialog() +{ + return myProgress; +} + diff --git a/src/MCCAD/McCadEXPlug/McCadEXPlug_MCBase.cxx b/src/MCCAD/McCadEXPlug/McCadEXPlug_MCBase.cxx new file mode 100644 index 0000000..16281b1 --- /dev/null +++ b/src/MCCAD/McCadEXPlug/McCadEXPlug_MCBase.cxx @@ -0,0 +1,251 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include //qiu + +McCadEXPlug_MCBase::McCadEXPlug_MCBase() { + myRecoverVoids = Standard_False; +} + +Handle_McCadDiscDs_HSequenceOfDiscSolid McCadEXPlug_MCBase::PrepareExport(const Handle_TDocStd_Document& theTDoc) { + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + + // count number of solids and determine face areas + McCadXCAF_TDocShapeLabelIterator shapeIterator(theTDoc); + Standard_Real smallestFaceArea(1.0e+99), biggestFaceArea(0.0); + Standard_Integer solidCnt(0); + Handle_XCAFDoc_ShapeTool shapeTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle_McCadDiscDs_HSequenceOfDiscSolid originalSolids = new McCadDiscDs_HSequenceOfDiscSolid; + for(; shapeIterator.More(); shapeIterator.Next()) { + TopoDS_Shape curSolid = shapeTool->GetShape(shapeIterator.Current()); + // find smallest and biggest face + for(TopExp_Explorer faceExp(curSolid, TopAbs_FACE); faceExp.More(); faceExp.Next()) { + TopoDS_Face f1 = TopoDS::Face(faceExp.Current()); + GProp_GProps GP1; + BRepGProp::SurfaceProperties(f1, GP1); + if(GP1.Mass() > biggestFaceArea) + biggestFaceArea = GP1.Mass(); + else if(GP1.Mass() < smallestFaceArea) + smallestFaceArea = GP1.Mass(); + } + solidCnt++; + } + + // no solids found + if(solidCnt == 0) { + msgr->Message("_#_McCadEXPlug_MCBase :: No solids found!!!\n", + McCadMessenger_ErrorMsg); + return originalSolids; + } + + // print message about faces + TCollection_AsciiString faceMessage("\n Face Info\n=========\nsmallest face area : "); + faceMessage += smallestFaceArea; + faceMessage += " -- biggest face area : "; + faceMessage += biggestFaceArea; + faceMessage += "\n"; + msgr->Message(faceMessage.ToCString()); + + // start parameter dialog + QApplication::restoreOverrideCursor(); + QMcCad_VGParamDialog* theVGParamDialog = new QMcCad_VGParamDialog(); + theVGParamDialog->exec(); + if(!theVGParamDialog->Accepted()) + return originalSolids; + + // init progress indicator +//qiu remove gui, might be dangerous! McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(/*qiu*/); + myPI = Handle_Message_ProgressIndicator::DownCast(theProgress); + theProgress->SetLabelText("Decomposing Geometry"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + myUnits = theVGParamDialog->GetUnits(); + myInitCellNb = theVGParamDialog->GetInitialCellNumber() -1 ; + myInitSurfNb = theVGParamDialog->GetInitialSurfaceNumber() -1 ; + + Standard_Real localWorkLoad = 20; + myPI->SetRange(0,100); + myPI->SetStep(localWorkLoad/(solidCnt+1)); + myPI->Increment(); + shapeIterator.Initialize(theTDoc); + + //decompose all shapes + /////////////////////////////// + McCadConvertTools_Convertor convertor; + Handle_TopTools_HSequenceOfShape bbShapes = new TopTools_HSequenceOfShape; + msgr->Message("\nPerforming sign constant decomposition...", + McCadMessenger_HeadingMsg); + + for(; shapeIterator.More(); shapeIterator.Next(), myPI->Increment()) { + TDF_Label curL = shapeIterator.Current(); + TopoDS_Shape curS; + + //myPI->Increment(); + if(myPI->UserBreak()) { + myPI->SetValue(100); + return originalSolids; + } + + if(!shapeTool->IsAssembly(curL)) + curS = shapeTool->GetShape(curL); + else + continue; + + Handle_TDataStd_Name tShpName; + TCollection_AsciiString shpName; + + if(!curL.FindAttribute(TDataStd_Name::GetID(),tShpName)) + shpName = "unnamed"; + else + shpName = TCollection_AsciiString(tShpName->Get()); + + Handle_TopTools_HSequenceOfShape shpSeq = new TopTools_HSequenceOfShape; + shpSeq->Append(curS); + + + + TCollection_AsciiString decMsg("\n+++++++++++++++++++++++++++++++++++++++++++++\n"); + decMsg += shpName; + decMsg += "\n+++++++++++++++++++++++++++++++++++++++++++++"; + msgr->Message(decMsg.ToCString()); + + // decompose solid + Handle_TopTools_HSequenceOfShape decSolid = new TopTools_HSequenceOfShape; + decSolid = convertor.Convert(shpSeq); + + // look for bounding box + TCollection_AsciiString tmpNm(shpName); + tmpNm.UpperCase(); + tmpNm.LeftAdjust(); + tmpNm.RightAdjust(); + tmpNm.RemoveAll(' '); + tmpNm.RemoveAll('_'); + tmpNm.RemoveAll('-'); + + if(tmpNm.Search("BOUNDINGBOX") > 0) { + bbShapes->Append(decSolid); + solidCnt--; + myPI->SetStep(localWorkLoad/(solidCnt)); + continue; + } + + // process decomposed shapes + for(Standard_Integer i=1; i<=decSolid->Length(); i++) { + TCollection_AsciiString appendix(i); + appendix.Prepend("_"); + McCadDiscDs_DiscSolid tmpSolid; + tmpSolid.SetSolid(decSolid->Value(i)); + tmpSolid.SetName(shpName+appendix); + + originalSolids->Append(tmpSolid); + } + } + myPI->SetValue(20.); + + // decomposition failed + if(originalSolids->Length() < 1) { + myPI->SetValue(100); + return originalSolids; + } + + + //Load material and density information + /////////////////////////////////////////// + McCadMDReader_Reader newMDReader(theTDoc); + myMDReader = newMDReader; + + // export decomposed model to step file + /////////////////////////////////////// +//qiu remove gui, might be dangerous! Handle_TDocStd_Application theXCAFApp = QMcCad_Application::GetAppMainWin()->GetXCAFApp(); + Handle_TDocStd_Application theXCAFApp = McCadXCAF_Application::GetApplication(); //qiu find from QMcCad_Application + Handle_TDocStd_Document decTDoc; + theXCAFApp->NewDocument("XmlXCAF", decTDoc); //initialize Document + Handle_XCAFDoc_ShapeTool sTool = XCAFDoc_DocumentTool::ShapeTool(decTDoc->Main()); + + TCollection_AsciiString saveName("mc_Material_Cells.stp"); + + for(Standard_Integer i=1; i<=originalSolids->Length(); i++) { + //append solids, names, material information to the document of decomposed solids + TDataStd_Name curName; + + TCollection_ExtendedString shpName(originalSolids->Value(i).GetName()); + TDF_Label curLab = sTool->AddShape(originalSolids->Value(i).GetSolid()); + + curName.Set(curLab, shpName); + } + + // write decomposed geometry into CAD file + STEPCAFControl_Writer theWriter; + theWriter.SetNameMode(true); + theWriter.SetColorMode(true); + theWriter.SetMaterialMode(true); + theWriter.Transfer(decTDoc); + theWriter.Write(saveName.ToCString()); + theXCAFApp->Close(decTDoc); + + msgr->Message("\nDecomposed Model has been exported...\n"); + msgr->Message("Starting Void Completion...", + McCadMessenger_HeadingMsg); + + // set parameters for VG + McCadIOHelper_VGParameters parameters; + parameters.inputSolids = new McCadDiscDs_HSequenceOfDiscSolid; + parameters.boundingBox = new TopTools_HSequenceOfShape; + if(bbShapes->Length()>0) { + parameters.boundingBox->Append(bbShapes); + } + parameters.writeCollisionFile = theVGParamDialog->GetWriteCollision(); + parameters.writeVoxelFile = theVGParamDialog->GetWriteDiscretModel(); + parameters.minInputSolidVolume = theVGParamDialog->GetMinInputVolume(); + parameters.minVoidVolume = theVGParamDialog->GetMinVoidVolume(); + parameters.minSamplePoints = theVGParamDialog->GetMinSamplePnts(); + parameters.maxSamplePoints = theVGParamDialog->GetMaxSamplePnts(); + parameters.xResolution = theVGParamDialog->GetXRes(); + parameters.yResolution = theVGParamDialog->GetYRes(); + parameters.tolerance = theVGParamDialog->GetTolerance(); + parameters.initCellNumber = myInitCellNb; + parameters.initSurfaceNumber = myInitSurfNb; + parameters.units = myUnits; + parameters.minSizeOfDecompositionFace = theVGParamDialog->GetMinDecFace(); + parameters.minSizeOfRedecompositionFace = theVGParamDialog->GetMinReDecFace(); + parameters.maxNumberOfPreDecompositionCells = theVGParamDialog->GetMaxPreDec(); + parameters.maxNumberOfComplementCells = theVGParamDialog->GetMaxComplemented(); + + //run void completion algorithm + theProgress->SetLabelText("Generating Voids"); + McCadConvertTools_VoidGenerator voidGenerator; + voidGenerator.SetParameters(parameters); + voidGenerator.AddDiscSolids(originalSolids); + voidGenerator.SetProgressIndicator(myPI); + if(!voidGenerator.Perform()) { + msgr->Message("Void Completion Failed, or progress has been aborted.\n", + McCadMessenger_ErrorMsg); + myPI->SetValue(100); + return new McCadDiscDs_HSequenceOfDiscSolid; + } + + theProgress->SetLabelText("Building Cells"); + Handle_McCadDiscDs_HSequenceOfDiscSolid theVEntitySequence = new McCadDiscDs_HSequenceOfDiscSolid; + + theVEntitySequence->Append(voidGenerator.GetVSolids()); + theVEntitySequence->Append(voidGenerator.GetVVoids()); + theVEntitySequence->Append(voidGenerator.GetVOuterVoids()); + + return theVEntitySequence; +} + + +void McCadEXPlug_MCBase::RecoverVoids(const Standard_Boolean& state) { + myRecoverVoids = state; +} diff --git a/src/MCCAD/McCadEXPlug/McCadEXPlug_MapStringHasher.cxx b/src/MCCAD/McCadEXPlug/McCadEXPlug_MapStringHasher.cxx new file mode 100644 index 0000000..425b0e9 --- /dev/null +++ b/src/MCCAD/McCadEXPlug/McCadEXPlug_MapStringHasher.cxx @@ -0,0 +1,30 @@ +#include + +Standard_Integer McCadEXPlug_MapStringHasher::HashCode(const Standard_CString Key,const Standard_Integer Upper) +{ + if(Key == NULL) return 0; + + Standard_CString charPtr = Key; + Standard_Integer aHashCode = 0, alen, i = 0, pos = 0, count, *tmphash; + Standard_Character tabchar[20]; + + alen = strlen(Key); + + while(i < alen) { + for (count = 0,pos = i;count < (Standard_Integer)sizeof(int); count++) { + if (pos + count >= alen) tabchar[count] = '\0'; + else tabchar[count] = charPtr[pos + count]; + i++; + } + tmphash = (int *)tabchar; + aHashCode = aHashCode ^ *tmphash; + } + return aHashCode; +} + +Standard_Boolean McCadEXPlug_MapStringHasher::IsEqual(const Standard_CString K1,const Standard_CString K2) +{ + if (strcmp(K1, K2) == 0) return(Standard_True); + else return(Standard_False); +} + diff --git a/src/MCCAD/McCadEXPlug/McCadEXPlug_PluginManager.cxx b/src/MCCAD/McCadEXPlug/McCadEXPlug_PluginManager.cxx new file mode 100644 index 0000000..bcb70c1 --- /dev/null +++ b/src/MCCAD/McCadEXPlug/McCadEXPlug_PluginManager.cxx @@ -0,0 +1,158 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; + +//qiu remove plugin, might be dangerous! +/*qiu extern*/ map > PluginMakerMap; + +McCadEXPlug_PluginManagerPtr McCadEXPlug_PluginManager::myInstance = 0; + + +McCadEXPlug_PluginManager::McCadEXPlug_PluginManager(){ + myExtensions = new TColStd_HSequenceOfAsciiString; + myFormats = new TColStd_HSequenceOfAsciiString; + myPluginCount=0; + myPathName=""; + mySharedLibIsOpen= Standard_False; +} + + +McCadEXPlug_PluginManagerPtr McCadEXPlug_PluginManager::Instance(){ + if (myInstance == 0) + myInstance = new McCadEXPlug_PluginManager; + return myInstance; +} + + +void McCadEXPlug_PluginManager::Initialize() { + map >::iterator thePluginMakerIter; + for (thePluginMakerIter=PluginMakerMap.begin(); thePluginMakerIter!=PluginMakerMap.end(); thePluginMakerIter++) { + string astr = thePluginMakerIter->first; +//qiu char acstr[astr.size()]; +//qiu strcpy(acstr, astr.c_str()); +//qiu TCollection_AsciiString atcstr= acstr; + TCollection_AsciiString atcstr= astr.c_str(); + myExtensions->Append(atcstr); + myFormats->Append(atcstr); + myPluginCount++; + } +} + + +McCadEXPlug_ExchangePluginPtr McCadEXPlug_PluginManager::GetPlugin( const TCollection_AsciiString& theExtension) const { + if (CheckExtension(theExtension)) { + string theExStr = theExtension.ToCString(); + McCadEXPlug_PluginMaker theMaker = PluginMakerMap[theExStr]; + McCadEXPlug_ExchangePlugin* thePlugIn = theMaker; + + return thePlugIn; + } + else { + cout << "No plugin found for this extension!!" << endl; + return NULL; + } +} + + +Handle(TColStd_HSequenceOfAsciiString) McCadEXPlug_PluginManager::GetExtensions() const{ + return myExtensions; +} + + +Handle(TColStd_HSequenceOfAsciiString) McCadEXPlug_PluginManager::GetFormats() const{ + return myFormats; +} + + +Standard_Boolean McCadEXPlug_PluginManager::CheckExtension( const TCollection_AsciiString& theExtension) const{ + if ( !theExtension.IsEmpty()) { + if ( !myExtensions.IsNull() && !myExtensions->IsEmpty()) { + for (int it = 1; it <= myExtensions->Length(); it++) { + if (myExtensions->Value(it)== theExtension) { + return Standard_True; + } + } + } + } + return Standard_False; +} + + +Standard_Boolean McCadEXPlug_PluginManager::CheckFormat(const TCollection_AsciiString& theFormat) const { + if ( !theFormat.IsEmpty()) { + if ( !myFormats.IsNull() && !myFormats->IsEmpty()) { + for (int it = 1; it <= myFormats->Length(); it++) { + if (myFormats->Value(it) == theFormat) { + return Standard_True; + } + } + } + } + return Standard_False; +} + + +Standard_Boolean McCadEXPlug_PluginManager::LoadSharedLibrary(const OSD_Path& thePath) { + TCollection_AsciiString aName; + thePath.SystemName(aName); + myPathName = aName; + + //cout<<"find the path"<< myPathName < + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _OSD_SharedLibrary_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_SequenceOfSharedLibrary_HeaderFile +#include +#endif +//McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary::~McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary", + sizeof(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary) Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary))) { + _anOtherObject = Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)((Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary::DynamicType() const +{ + return STANDARD_TYPE(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary) ; +} +//Standard_Boolean McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary::~Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary() {} +#define SeqItem OSD_SharedLibrary +#define SeqItem_hxx +#define TCollection_SequenceNode McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_Type_() McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_Type_() +#define TCollection_Sequence McCadEXPlug_SequenceOfSharedLibrary +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadEXPlug/McCadEXPlug_SequenceOfSharedLibrary_0.cxx b/src/MCCAD/McCadEXPlug/McCadEXPlug_SequenceOfSharedLibrary_0.cxx new file mode 100644 index 0000000..592ae73 --- /dev/null +++ b/src/MCCAD/McCadEXPlug/McCadEXPlug_SequenceOfSharedLibrary_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _OSD_SharedLibrary_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile +#include +#endif + + +#define SeqItem OSD_SharedLibrary +#define SeqItem_hxx +#define TCollection_SequenceNode McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_Type_() McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_Type_() +#define TCollection_Sequence McCadEXPlug_SequenceOfSharedLibrary +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadExDllBrep/McCadExDllBrep_Brep.cxx b/src/MCCAD/McCadExDllBrep/McCadExDllBrep_Brep.cxx new file mode 100644 index 0000000..bc57657 --- /dev/null +++ b/src/MCCAD/McCadExDllBrep/McCadExDllBrep_Brep.cxx @@ -0,0 +1,282 @@ +#ifndef _OSD_File_HeaderFile +#include +#endif +#ifndef _BRep_Builder_HeaderFile +#include +#endif +#include +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#include + +using namespace std; + +//qiu we don't need "extern" +///*qiu extern */map > PluginMakerMap; + +McCadExDllBrep_Brep::McCadExDllBrep_Brep() +{ + myExtensions = new TColStd_HSequenceOfAsciiString; + myExtensions->Append(TCollection_AsciiString(".brep")); + myExtensions->Append(TCollection_AsciiString(".Brep")); + myExtensions->Append(TCollection_AsciiString(".rle")); + myFormat = "brep"; + myExportEnabled = Standard_True; + myImportEnabled = Standard_True; + myFileName = " "; + mySize = 0; +} + +Standard_Boolean McCadExDllBrep_Brep::Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) +{ + + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + theGuiFactory->SetType(McCadGUI_Base); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + theGuiFactory->SetType(McCadGUI_Progress); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog(); + + if (theEntitySequence->Length() == 0) + { + theError->Print(TCollection_AsciiString("The model is empty, can not be exported.")); + theError->Print(TCollection_AsciiString("Error: exporting empty model.")); + delete theError; + delete theMessage; + return Standard_False; + } + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + if (theFile.Exists()) + { + theProgress->SetLabelText("Exporting Brep File."); + theProgress->SetCancelButtonText("Cancel Export!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + TopoDS_Shape theShape = theEntitySequence->Value(1); + + Standard_Boolean isValid = BRepTools::Write(theShape,myFileName.ToCString()); + + theProgress->SetProgress(100); + + if(isValid) + { + theMessage->Print(myFileName + TCollection_AsciiString(" has been Exported.")); + delete theMessage; + delete theError; + delete theProgress; + return isValid; + } + else + { + theError->Print(TCollection_AsciiString("Can not Export to the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Brep Writer.")); + delete theError; + delete theMessage; + delete theProgress; + return Standard_False; + } + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + } + else + { + theError->Print(TCollection_AsciiString("Select file first.")); + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + + +} + +Handle(TopTools_HSequenceOfShape) McCadExDllBrep_Brep::Import() +{ + /*McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + theGuiFactory->SetType(McCadGUI_Base); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + theGuiFactory->SetType(McCadGUI_Progress); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog();*/ + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + if (theFile.Exists()) + { + /*theProgress->SetLabelText("Importing Brep File."); + theProgress->SetCancelButtonText("Cancel Import!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0);*/ + + TopoDS_Shape theShape; + BRep_Builder theBuilder; + Standard_Boolean isValid = BRepTools::Read(theShape,myFileName.ToCString(),theBuilder); + +// theProgress->SetProgress(100); + + if(isValid) + { + Handle(TopTools_HSequenceOfShape) theShapeSequence = new TopTools_HSequenceOfShape(); + theShapeSequence->Append(theShape); + /*theMessage->Print(myFileName + TCollection_AsciiString(" has been Imported.")); + delete theMessage; + delete theError; + delete theProgress;*/ + return theShapeSequence; + } + else + { + /*theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Brep Reader")); + delete theError; + delete theMessage; + delete theProgress;*/ + return NULL; + } + } + else + { + /*theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress;*/ + return NULL; + } + } + else + { + /*theError->Print(TCollection_AsciiString("Select file first.")); + delete theMessage; + delete theError; + delete theProgress;*/ + return NULL; + } + +} + +TCollection_AsciiString McCadExDllBrep_Brep::GetFilename() const +{ + return myFileName; +} + +void McCadExDllBrep_Brep::SetFilename(const TCollection_AsciiString& theFileName) +{ + myFileName = theFileName; +} + +Standard_Integer McCadExDllBrep_Brep::GetSize() const +{ + return mySize; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadExDllBrep_Brep::GetExtensions() const +{ + return myExtensions; +} + +TCollection_AsciiString McCadExDllBrep_Brep::GetExtension() const +{ + return myExtensions->Value(1); +} + +TCollection_AsciiString McCadExDllBrep_Brep::GetFormat() const +{ + return myFormat; +} + +Standard_Boolean McCadExDllBrep_Brep::ExportEnabled() const +{ + return myExportEnabled; +} + +Standard_Boolean McCadExDllBrep_Brep::ImportEnabled() const +{ + return myImportEnabled; +} + + +Standard_Boolean McCadExDllBrep_Brep::ImportToDocument(Handle(TDocStd_Document)& theTDoc) +{ + Handle(TopTools_HSequenceOfShape) inShps = Import(); + + Handle(XCAFDoc_ShapeTool) _sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + for(Standard_Integer i=1; i<=1/*inShps->Length()*/; i++) + { + TDF_Label newLab = _sTool->AddShape(inShps->Value(i), 0, 0); + TCollection_AsciiString labelName; + TDF_Tool::Entry(newLab, labelName); + TCollection_AsciiString newName = labelName.Split(labelName.SearchFromEnd(":")); + newName.Prepend("Solid "); + TDataStd_Name::Set(newLab, newName); + } + + return Standard_True; +} + +Standard_Boolean McCadExDllBrep_Brep::ExportFromDocument(const Handle(TDocStd_Document)& theTDoc) +{ + Handle(XCAFDoc_ShapeTool) _sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + TDF_LabelSequence freeShp; + _sTool->GetFreeShapes(freeShp); + TopoDS_Shape theShape; + _sTool->GetShape(freeShp.First(), theShape); + + Handle(TopTools_HSequenceOfShape) exportShape = new TopTools_HSequenceOfShape; + exportShape->Append(theShape); + + return Export(exportShape); +} + +////qiu we don't need "extern" +////qiu extern "C" { +// McCadEXPlug_ExchangePlugin* _McCadEXPlug_PluginMaker() +// { +// return new McCadExDllBrep_Brep; +// } +// +//class PluginProxy { +//public: +// PluginProxy(){ +// // register the maker into the MakerMap +// McCadEXPlug_ExchangePlugin* brepPlugin = _McCadEXPlug_PluginMaker(); +// PluginMakerMap[".BRep"] = brepPlugin; +// PluginMakerMap[".brep"] = brepPlugin; +// PluginMakerMap[".rle"] = brepPlugin; +// } +//}; +//// our one instance of the proxy +//PluginProxy BrepPlug; +////qiu } diff --git a/src/MCCAD/McCadExDllIges/McCadExDllIges_Iges.cxx b/src/MCCAD/McCadExDllIges/McCadExDllIges_Iges.cxx new file mode 100644 index 0000000..d8c202f --- /dev/null +++ b/src/MCCAD/McCadExDllIges/McCadExDllIges_Iges.cxx @@ -0,0 +1,419 @@ +#ifndef _OSD_File_HeaderFile +#include +#endif +#ifndef _IGESControl_Reader_HeaderFile +#include +#endif +#ifndef _IGESControl_Controller_HeaderFile +#include +#endif +#ifndef _IGESControl_Writer_HeaderFile +#include +#endif +#ifndef _Interface_Static_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//qiu remove gui, might be dangerous! #include +#include //qiu +#include + +#include + +using namespace std; + +//qiu we don't need "extern" +///*qiu extern */map > PluginMakerMap; + +McCadExDllIges_Iges::McCadExDllIges_Iges() +{ + myExtensions = new TColStd_HSequenceOfAsciiString; + myExtensions->Append(TCollection_AsciiString(".iges")); + myExtensions->Append(TCollection_AsciiString(".igs")); + myFormat = "iges"; + myExportEnabled = Standard_True; + myImportEnabled = Standard_True; + myFileName = " "; + mySize = 0; +} + +Standard_Boolean McCadExDllIges_Iges::Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) +{ + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + theGuiFactory->SetType(McCadGUI_Base); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + theGuiFactory->SetType(McCadGUI_Progress); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog(); + + if (theEntitySequence->Length() == 0) + { + theError->Print(TCollection_AsciiString("The model is empty, can not be exported.")); + theError->Print(TCollection_AsciiString("Error: exporting empty model.")); + delete theError; + delete theMessage; + return Standard_False; + } + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + if (theFile.Exists()) + { + Standard_Integer theSequenceLength = theEntitySequence->Length(); + theProgress->SetLabelText("Preparing Iges File."); + theProgress->SetCancelButtonText("Cancel Export!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + IGESControl_Controller::Init(); + IGESControl_Writer myWriter (Interface_Static::CVal("XSTEP.iges.unit"),Interface_Static::IVal("XSTEP.iges.writebrep.mode")); + + for (Standard_Integer i=1;i<=theSequenceLength;i++){ + theProgress->SetProgress(i*100/theSequenceLength); + TopoDS_Shape myShape = theEntitySequence->Value(i); + if ( !myShape.IsNull() ) + { + myWriter.AddShape(myShape); + } + } + + // the compute dialog. + theProgress->SetLabelText("Computing Iges Model."); + theProgress->SetCancelButtonText("Cancel Export!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + myWriter.ComputeModel(); + theProgress->SetProgress(100); + + theProgress->SetLabelText("Exporting Iges File."); + theProgress->SetCancelButtonText("Cancel Export!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + Standard_Boolean isValid = myWriter.Write(myFileName.ToCString()); + theProgress->SetProgress(100); + + if(isValid) + { + theMessage->Print(myFileName + TCollection_AsciiString(" has been Exported.")); + delete theMessage; + delete theError; + delete theProgress; + return isValid; + } + else + { + theError->Print(TCollection_AsciiString("Can not Export to the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Iges Writer.")); + delete theError; + delete theMessage; + delete theProgress; + return Standard_False; + } + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + } + else + { + theError->Print(TCollection_AsciiString("Select file first.")); + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + + +} + +Handle(TopTools_HSequenceOfShape) McCadExDllIges_Iges::Import() +{ + Handle(TopTools_HSequenceOfShape) theEnititySequence; + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + theGuiFactory->SetType(McCadGUI_Base); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + theGuiFactory->SetType(McCadGUI_Progress); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog(); + +if (!myFileName.IsEmpty()) + { + + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + + if (theFile.Exists()) + { + + theProgress->SetLabelText("Reading Iges file."); + theProgress->SetCancelButtonText("Cancel Reading!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + IGESControl_Reader myReader; + IFSelect_ReturnStatus myReturnStatus = myReader.ReadFile(myFileName.ToCString()); + + theProgress->SetProgress(100); + + if ( myReturnStatus == IFSelect_RetDone) + { + theProgress->SetProgress(0); + theProgress->SetLabelText("Translating Iges file."); + theProgress->SetCancelButtonText("Cancel Translation!"); + theProgress->SetTotalSteps(100); + + myReader.TransferRoots(); + + theProgress->SetProgress(100); + + Standard_Integer theNumberOfEnteties = myReader.NbShapes(); + + theProgress->SetProgress(0); + theProgress->SetLabelText("Inserting Shapes."); + theProgress->SetCancelButtonText("Cancel Insertion!"); + theProgress->SetTotalSteps(theNumberOfEnteties); + + if (theNumberOfEnteties != 0) + { + TopoDS_Shape theShape; + theEnititySequence = new TopTools_HSequenceOfShape(); + for (Standard_Integer i = 1; i <= theNumberOfEnteties ; i++) + { + theProgress->SetProgress(i*100/theNumberOfEnteties); + theShape = myReader.Shape(i); + theEnititySequence->Append(theShape); + } + } + theMessage->Print(myFileName + TCollection_AsciiString(" has been Imported.")); + delete theMessage; + delete theError; + delete theProgress; + return theEnititySequence; + } + else + { + theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Iges Reader")); + delete theError; + delete theMessage; + return NULL; + } + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + return NULL; + } + } + else + { + theError->Print(TCollection_AsciiString("Select file first.")); + delete theMessage; + delete theError; + return NULL; + } +} + + +TCollection_AsciiString McCadExDllIges_Iges::GetFilename() const +{ + return myFileName; +} + +void McCadExDllIges_Iges::SetFilename(const TCollection_AsciiString& theFileName) +{ + myFileName = theFileName; +} + +Standard_Integer McCadExDllIges_Iges::GetSize() const +{ + return mySize; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadExDllIges_Iges::GetExtensions() const +{ + return myExtensions; +} + +TCollection_AsciiString McCadExDllIges_Iges::GetExtension() const +{ + return myExtensions->Value(1); +} + +TCollection_AsciiString McCadExDllIges_Iges::GetFormat() const +{ + return myFormat; +} + +Standard_Boolean McCadExDllIges_Iges::ExportEnabled() const +{ + return myExportEnabled; +} + +Standard_Boolean McCadExDllIges_Iges::ImportEnabled() const +{ + return myImportEnabled; +} + +Standard_Boolean McCadExDllIges_Iges::ImportToDocument(Handle(TDocStd_Document)& theTDoc) +{ + IGESCAFControl_Reader theReader; + //Handle(Message_ProgressIndicator) theProgress = theReader.Reader().WS()->MapReader()->GetProgress(); + theReader.SetNameMode(Standard_True); + theReader.SetColorMode(Standard_True); + //theReader.SetMatMode(Standard_True); + //theReader.Reader().ClearShapes(); + theReader.ReadFile(myFileName.ToCString()); + + Handle(TDocStd_Document) tstDoc; +//qiu remove gui, might be dangerous! QMcCad_Application::GetAppMainWin()->GetXCAFApp()->NewDocument("XmlXCAF", tstDoc); + McCadXCAF_Application::GetApplication()->NewDocument("XmlXCAF", tstDoc); //qiu from QMcCad_Application + + if(!theReader.Transfer(tstDoc)) + return Standard_False; + + Handle(XCAFDoc_ShapeTool) _sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle(XCAFDoc_ColorTool) _cTool = XCAFDoc_DocumentTool::ColorTool(theTDoc->Main()); + Handle(XCAFDoc_ColorTool) cTool = XCAFDoc_DocumentTool::ColorTool(tstDoc->Main()); + + TDF_LabelSequence Labels; + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(tstDoc->Main()); + sTool->GetShapes(Labels); + + McCadXCAF_TDocShapeLabelIterator it(tstDoc); + + for(; it.More(); it.Next()) + { + TDF_Label curLab = it.Current(); + Handle(TNaming_NamedShape) nmdShp; + + if(!curLab.FindAttribute(TNaming_NamedShape::GetID(), nmdShp)) + continue; + + TopoDS_Shape curShp = nmdShp->Get(); + + TDF_Label newLab = _sTool->AddShape(curShp, Standard_False, Standard_False); + Handle(TDataStd_Name) theName; + TCollection_AsciiString newName; + if(!curLab.FindAttribute(TDataStd_Name::GetID(),theName)) + { + TCollection_AsciiString labelName; + TDF_Tool::Entry(curLab, labelName); + newName = labelName.Split(labelName.SearchFromEnd(":")); + newName.Prepend("Solid "); + } + else + { + newName = TCollection_AsciiString(theName->Get()); + if(newName.Length() == 0) + { + TCollection_AsciiString labelName; + TDF_Tool::Entry(curLab, labelName); + newName = labelName.Split(labelName.SearchFromEnd(":")); + newName.Prepend("Solid "); + } + } + + TDataStd_Name::Set(newLab, newName); + + // for some reasons we couldn't find colorgen... we can use colors from surfaces though... + Quantity_Color newCol; + TDF_Label cLab; + if(cTool->GetColor(curShp, XCAFDoc_ColorGen ,newCol)) + { + TDF_Label _cLab = _cTool->AddColor(newCol); + _cTool->SetColor(curShp, _cLab, XCAFDoc_ColorGen); + } + else if(cTool->GetColor(curShp, XCAFDoc_ColorSurf ,newCol)) + { + TDF_Label _cLab = _cTool->AddColor(newCol); + _cTool->SetColor(curShp, _cLab, XCAFDoc_ColorGen); + } + else if(cTool->GetColor(curShp, XCAFDoc_ColorCurv ,newCol)) + { + TDF_Label _cLab = _cTool->AddColor(newCol); + _cTool->SetColor(curShp, _cLab, XCAFDoc_ColorGen); + } + } + + return Standard_True; +} + +Standard_Boolean McCadExDllIges_Iges::ExportFromDocument(const Handle(TDocStd_Document)& theTDoc) +{ + cout << "???\n"; + IGESCAFControl_Writer theWriter; + + cout << "Export\n"; + + if(!theWriter.Transfer(theTDoc)) + { + cout << "_#_ McCadExDllStep_Step.cxx :: Error: data not transferred!!!\n"; + return Standard_False; + } + cout << "MODEL TRANSFERED\n"; + + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + Standard_Boolean theReturnStatus = theWriter.Write(myFileName.ToCString()); + if (!theReturnStatus) + { + cout << "_::_ McCadExDllStep_Step.cxx :: Export Failed\n"; + return Standard_False; + } + + return Standard_True; +} + + +////qiu we don't need "extern" +////qiu extern "C" { +// McCadEXPlug_ExchangePlugin* _McCadEXPlug_PluginMaker() +// { +// return new McCadExDllIges_Iges; +// } +// +// class PluginProxy { +// public: +// PluginProxy(){ +// // register the maker into the MakerMap +// McCadEXPlug_ExchangePlugin* igesPlugin = _McCadEXPlug_PluginMaker(); +// PluginMakerMap[".iges"] = igesPlugin; +// PluginMakerMap[".igs"] = igesPlugin; +// } +// }; +// // our one instance of the proxy +// PluginProxy IgesPlug; +////qiu } diff --git a/src/MCCAD/McCadExDllMcnp/McCadExDllMcnp_Mcnp.cxx b/src/MCCAD/McCadExDllMcnp/McCadExDllMcnp_Mcnp.cxx new file mode 100644 index 0000000..1fe5730 --- /dev/null +++ b/src/MCCAD/McCadExDllMcnp/McCadExDllMcnp_Mcnp.cxx @@ -0,0 +1,665 @@ +#include +#include +#ifndef _OSD_File_HeaderFile +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +//qiu remove gui, might be dangerous! #include +#include + +using namespace std; + +//qiu we don't need "extern" +///*qiu extern */map > PluginMakerMap; + +McCadExDllMcnp_Mcnp::McCadExDllMcnp_Mcnp() { + myExtensions = new TColStd_HSequenceOfAsciiString; + myExtensions->Append(TCollection_AsciiString(".mcnp")); + myExtensions->Append(TCollection_AsciiString(".mcn")); + myFormat = "mcnp"; + myExportEnabled = Standard_True; + myImportEnabled = Standard_True; + myFileName = " "; + mySize = 0; + myUnits = McCadCSGGeom_CM; + + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(); + myPI = Handle(Message_ProgressIndicator)::DownCast(theProgress); // DUMMY +} + +Standard_Boolean McCadExDllMcnp_Mcnp::Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) { + cout << "_#_McCadExDllMcnp_Mcnp :: Use Export(...) with McCadDiscDs...DiscSolids!" << endl; + return Standard_False; +} + + +Standard_Boolean McCadExDllMcnp_Mcnp::Export(const Handle_McCadDiscDs_HSequenceOfDiscSolid& theVEntitySequence) { + if(theVEntitySequence->IsEmpty()){ + return Standard_False; + } + + if (!myFileName.IsEmpty()) { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + if (theFile.Exists()) { + cout << " Start Cell Building " << endl; + cout << " Total Number of cells = " << theVEntitySequence->Length() << endl; + cout << "================================================================= " << endl; + + Standard_Integer NbMat(0); + Standard_Integer NbVoid(0); + Standard_Integer NbOuterVoids(0); + + Handle(McCadCSGGeom_HSequenceOfCell) cellSeq = new McCadCSGGeom_HSequenceOfCell; + + myPI->SetStep(5/theVEntitySequence->Length()); + + // extract outer voids + Handle(McCadDiscDs_HSequenceOfDiscSolid) outerVoids = new McCadDiscDs_HSequenceOfDiscSolid; + for(Standard_Integer b=theVEntitySequence->Length(); b>=1; b--) { + if(!theVEntitySequence->Value(b).IsOuterVoid()) + break; + outerVoids->Append(theVEntitySequence->Value(b)); + theVEntitySequence->Remove(b); + } + + // build cells + for (int its = 1; its <= theVEntitySequence->Length(); its++) { + McCadDiscDs_DiscSolid currentEntity = theVEntitySequence->Value(its); + TCollection_AsciiString currentName = currentEntity.GetName(); + + if(!currentEntity.IsVoid()) { + NbMat++; +// cout << "**************************************\n"; +// cout << " Building Material Cell .......... " << its << endl; + + Handle(McCadTDS_HSequenceOfExtSolid) extSolSeq = new McCadTDS_HSequenceOfExtSolid; + + TopoDS_Solid sol2ext = TopoDS::Solid(currentEntity.GetSolid()); + + McCadCSGTool_Extender Mext(sol2ext); + + if(Mext.IsDone()){ + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + mcSol->SetComment(currentEntity.GetComment()); + extSolSeq->Append(mcSol); + } + else { + cout << "_#_McCadExDllMcnp_Mcnp :: Extending solid failed!!" << endl; + continue; + } + + // cell building + //////////////////////////////////////////////////////////////////////////// + Standard_Real theDensity = myMDReader.GetDensity(currentName); + Standard_Integer theMatNb = myMDReader.GetMaterial(currentName); + + McCadCSGTool_CellBuilder Mcel; + Mcel.SetDensity(theDensity); + Mcel.SetMatNumber(theMatNb); + Mcel.SetUnits(myUnits); + Mcel.MakeOuterVoid(Standard_False); + Mcel.Init(extSolSeq); + + if(Mcel.IsDone()) { + Handle(McCadCSGGeom_Cell) aCell = Mcel.GetCell(); + //we add here the complements + Handle(TColStd_HSequenceOfInteger) compSeq = currentEntity.GetOtherVSolids(); + aCell->SetComplementCells(compSeq); + cellSeq->Append(aCell); + } + else { + cout << "_#_McCadExDllMcnp_Mcnp :: Cell building failed on Material Cell!!" << endl; + continue; + } +// cout << "************************************** Done cell: " << its << endl; + } + else // Void Cells + { + Handle(McCadTDS_HSequenceOfExtSolid) extSolSeq = new McCadTDS_HSequenceOfExtSolid; + + TopoDS_Solid sol2ext; + try { + sol2ext = TopoDS::Solid(currentEntity.GetSolid()); + } + catch(...) { + cout << "_#_McCadExDllMcnp_Mcnp.cxx :: FAILED\n"; + } + + NbVoid++; +// cout << "**************************************\n"; +// cout << " Building Void Cell .......... " << its << endl; + + McCadCSGTool_Extender Mext(sol2ext); + if(Mext.IsDone()){ + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + mcSol->SetComment(TCollection_AsciiString("c\nc McCad: ===== Void Cells =====\nc")); + extSolSeq->Append(mcSol); + } + else{ + cout << "_#_McCadExDllMcnp_Mcnp :: Extending solid failed!!!" << endl; + continue; + } + + //////////////////////////////////////////////////////////////////////////// + McCadCSGTool_CellBuilder Mcel; + Mcel.SetUnits(myUnits); + Mcel.Init(extSolSeq); + + if(Mcel.IsDone()){ + Handle(McCadCSGGeom_Cell) aCell = Mcel.GetCell(); + + Handle(TColStd_HSequenceOfInteger) compSeq = currentEntity.GetOtherVSolids(); + aCell->SetComplementCells(compSeq); + aCell->SetVoid(Standard_True); + cellSeq->Append(aCell); + } + else{ + cout << "_#_McCadExDllMcnp_Mcnp :: Cell building failed for Void Cell!!" << endl; + continue; + } +// cout << "************************************** Done cell: " << its << endl; + } + myPI->Increment(); + } + + // build outer voids + Handle(McCadTDS_HSequenceOfExtSolid) extSolSeq = new McCadTDS_HSequenceOfExtSolid; + for(Standard_Integer b=2; b<=outerVoids->Length(); b++){ + TopoDS_Solid sol2ext = TopoDS::Solid((outerVoids->Value(b)).GetSolid()); + McCadCSGTool_Extender Mext(sol2ext); + if(Mext.IsDone()) { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + extSolSeq->Append(mcSol); + } + else{ + cout << "_#_McCadExDllMcnp_Mcnp.cxx :: Cell Building failed for outer Voids!!\n"; + continue; + } + } + McCadCSGTool_CellBuilder Mcel; + Mcel.MakeOuterVoid(Standard_True); + Mcel.SetUnits(myUnits); + Mcel.Init(extSolSeq); + + if(Mcel.IsDone()) { + Handle(McCadCSGGeom_Cell) aCell = Mcel.GetCell(); + + aCell->SetVoid(Standard_True); + cellSeq->Append(aCell); + } + else + cout << "_#_VoidGenerator.cxx :: Cell building failed!!" << endl; + + NbOuterVoids++; + + // make outer space + //////////////////// + extSolSeq->Clear(); + TopoDS_Solid sol2ext = TopoDS::Solid((outerVoids->Value(1)).GetSolid()); + McCadCSGTool_Extender Mext(sol2ext); + if(Mext.IsDone()){ + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + extSolSeq->Append(mcSol); + } + else + cout << "_#_McCadExDllMcnp_Mcnp.cxx :: Cell Building failed for outer Voids!!\n"; + + Mcel.Init(extSolSeq); + + if(Mcel.IsDone()){ + Handle(McCadCSGGeom_Cell) aCell = Mcel.GetCell(); + aCell->SetVoid(Standard_True); + cellSeq->Append(aCell); + } + else + cout << "_#_VoidGenerator.cxx :: Cell building failed!!" << endl; + + NbOuterVoids++; + + if(myPI->UserBreak()) + return Standard_False; + + myPI->SetValue(100); + + //adapt outer space + // outer Box and Sphere print after modification + Standard_Integer i = cellSeq->Length(); + +// cout << "GENERATE MCNP SYNTAX \n..............................\n"; + McCadMcWrite_McnpInputGenerator theMcnpWriter(cellSeq); + + theMcnpWriter.SetInitialSurfaceNumber(myInitSurfNb); + theMcnpWriter.SetInitialCellNumber(myInitCellNb); + theMcnpWriter.SurfNumbering(); + + Handle(TColStd_HSequenceOfAsciiString) boxCSG =(cellSeq->Value(i-1))->GetCSG(); + Handle(TColStd_HSequenceOfAsciiString) spCSG =(cellSeq->Value(i))->GetCSG(); + + boxCSG->Prepend(TCollection_AsciiString(" #")); + boxCSG->Prepend(spCSG); + (cellSeq->Value(i))->SetCSG(boxCSG); + int isphere; + for (int it = 1; it <= spCSG->Length(); it++){ + if(spCSG->Value(it).IsIntegerValue()){ + isphere = abs(spCSG->Value(it).IntegerValue()); + //cout << "isphere = " << isphere << endl; + spCSG->Clear(); + spCSG->Append(TCollection_AsciiString(isphere)); + (cellSeq->Value(i))->SetCSG(spCSG); + } + } + + theMcnpWriter.SetNbOfMatCells(NbMat); + theMcnpWriter.SetNbOfVoidCells(NbVoid); + theMcnpWriter.SetNbOfOuterCells(NbOuterVoids); + theMcnpWriter.SetMDReader(myMDReader); + theMcnpWriter.PrintAll(theFile); + theFile.Close(); + + cout << "FILE EXPORTED\n"; + } + else{ + cout << myFileName.ToCString() << " does not exist." << endl; + theFile.Close(); + return Standard_False; + } + } + else{ + cout << " Select file first." << endl; + return Standard_False; + } + return Standard_True; +} + +Handle(TopTools_HSequenceOfShape) McCadExDllMcnp_Mcnp::Import() +{ + Handle(TopTools_HSequenceOfShape) theEnititySequence; + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog(); + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + if (theFile.Exists()) + { + OSD_Protection aProtection; + theFile.Open(OSD_ReadOnly, aProtection); + + theProgress->SetLabelText("Reading MCNP file."); + theProgress->SetCancelButtonText("Cancel Reading!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + theEnititySequence = new TopTools_HSequenceOfShape(); + + McCadMcRead_Reader theReader; + theReader.Parse(theFile); + McCadMcRead_DataMapOfIntegerCell theCellMap; + + theReader.GetCells(theCellMap); + //cout << "Map Extent = " << theCellMap.Extent() << endl; + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter; + cIter.Initialize(theCellMap); + + cout << "\n ### Void cells will not be build ###\n\n"; + + for (; cIter.More();cIter.Next())//For all Cells construct Geometry... + { + Handle(McCadMcRead_Cell) aCell = cIter.Value(); + + if(aCell->GetMaterialNumber() == 0) + { + continue; + } + + McCadCSGUtil_SolidBuilder aB; + aB.Init(aCell); + + if(aB.IsDone()) + { + TopoDS_Shape aShape = aB.Result(); + theEnititySequence->Append(aShape); + } + else + { + cout << "ERROR CELL COULD NOT BE BUILD\n\n"; + } + } + + return theEnititySequence; + } + else + { + theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Reader")); + delete theError; + delete theMessage; + return NULL; + } + theFile.Close(); + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress; + return NULL; + } +} + +TCollection_AsciiString McCadExDllMcnp_Mcnp::GetFilename() const +{ + return myFileName; +} + +void McCadExDllMcnp_Mcnp::SetFilename(const TCollection_AsciiString& theFileName) +{ + myFileName = theFileName; +} + +Standard_Integer McCadExDllMcnp_Mcnp::GetSize() const +{ + return mySize; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadExDllMcnp_Mcnp::GetExtensions() const +{ + return myExtensions; +} + +TCollection_AsciiString McCadExDllMcnp_Mcnp::GetExtension() const +{ + return myExtensions->Value(1); +} + +TCollection_AsciiString McCadExDllMcnp_Mcnp::GetFormat() const +{ + return myFormat; +} + +Standard_Boolean McCadExDllMcnp_Mcnp::ExportEnabled() const +{ + return myExportEnabled; +} + +Standard_Boolean McCadExDllMcnp_Mcnp::ImportEnabled() const +{ + return myImportEnabled; +} + +Standard_Boolean McCadExDllMcnp_Mcnp::ImportToDocument(Handle(TDocStd_Document)& theTDoc) +{ + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + //qiu remove gui, might be dangerous! McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(/*qiu*/); + //Handle(Message_ProgressIndicator) + myPI = Handle(Message_ProgressIndicator)::DownCast(theProgress); + + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle(TDF_Data) theData = theTDoc->GetData(); + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + if (theFile.Exists()) + { + //open file + OSD_Protection aProtection; + theFile.Open(OSD_ReadOnly, aProtection); + + theProgress->SetLabelText("Reading MCNP file."); + theProgress->SetCancelButtonText("Cancel Reading!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + McCadMcRead_Reader theReader; + theReader.Parse(theFile); + + McCadMcRead_DataMapOfIntegerCell theCellMap; + + theReader.GetCells(theCellMap); + theReader.GetMDReader(myMDReader); + + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter; + Standard_Integer numShp = theCellMap.Extent(); + + Standard_Real delta = 100.5/numShp; + myPI->SetStep(delta); + + cIter.Initialize(theCellMap); + + QApplication::restoreOverrideCursor(); + TCollection_AsciiString labEntry("0:1:1:1:6"); + TDF_Label mRootLab; + TDF_Tool::Label(theData, labEntry, mRootLab, Standard_True); + + Standard_Boolean isNewName(Standard_True); + for (; cIter.More();cIter.Next())//For all Cells construct Geometry... + { + Handle(McCadMcRead_Cell) aCell = cIter.Value(); + Standard_Integer aMatNum(1); + + myPI->Increment(); + if(myPI->UserBreak()) + return Standard_False; + + if(aCell->GetMaterialNumber() == 0) + { + continue; + } + if(aCell->IsPseudo()) // TODO: if a cell is pseudo it means, it is filled with a universe. + continue; // build an assembly: fillNumber--+universeCell1--+UniverseCell2,... + + McCadCSGUtil_SolidBuilder aB; + + cout << "Constructing Solid for Cell Number : " << aCell->GetCellNumber() << " / " << theCellMap.Extent() << endl; + aB.Init(aCell); + + if(aB.IsDone()) // add shape and cell number as its name to the document + { + TDF_Label newLab; + TopoDS_Shape aShape = aB.Result(); + newLab = sTool->AddShape(aShape,0,0); + TCollection_ExtendedString theName; + if(aCell->GetPseudoNum()!=0) + { + theName = TCollection_AsciiString(aCell->GetPseudoNum()); + } + else + theName = TCollection_AsciiString(aCell->GetCellNumber()); + + TDataStd_Name::Set(newLab, theName); + + //Test if material group already exists + TDF_ChildIterator matGrpLabs(mRootLab); + TDF_Label newChild; + Standard_Boolean found(Standard_False); + Handle_TDataStd_Name tstName; + TCollection_AsciiString aName = TCollection_AsciiString("material ") + TCollection_AsciiString(aCell->GetMaterialNumber()); + TCollection_AsciiString oName = aName; + TCollection_ExtendedString mName(aName); + + while(true) + { + for(;matGrpLabs.More(); matGrpLabs.Next()) + { + isNewName = Standard_True; + if(matGrpLabs.Value().FindAttribute(TDataStd_Name::GetID(), tstName)) + { + if(tstName->Get().IsEqual(aName)) + { + isNewName = Standard_False; + Handle_TDataStd_Real tstDens; + if(matGrpLabs.Value().FindAttribute(TDataStd_Real::GetID(),tstDens)) + { + mName = TCollection_ExtendedString(aName); + + if(tstDens->Get()==aCell->GetDensity()) + { + newChild = matGrpLabs.Value(); + found = Standard_True; + break; + } + else + { + isNewName = Standard_False; + found = Standard_False; + break; + } + } + } + else + { + mName = TCollection_ExtendedString(aName); + found = Standard_False; + } + } + } + + if(found || isNewName) + break; + + aName = oName + "." + TCollection_AsciiString(aMatNum++); + } + + if(!found) + { + newChild = mRootLab.NewChild(); + + TDataStd_Name::Set(newChild, mName); + TDataStd_Real::Set(newChild, aCell->GetDensity()); + TCollection_AsciiString mCard; + myMDReader.GetMCard(aCell->GetMaterialNumber(), mCard); + TDataStd_AsciiString::Set(newChild,mCard); + } + + Handle(TDataStd_TreeNode) refNode, mainNode; + mainNode = TDataStd_TreeNode::Set ( newChild, TDataStd_TreeNode::GetDefaultTreeID()); + refNode = TDataStd_TreeNode::Set ( newLab, TDataStd_TreeNode::GetDefaultTreeID()); + refNode->Remove(); // abv: fix against bug in TreeNode::Append() + mainNode->Prepend(refNode); + } + else + { + cout << "\n\n_#_McCadExDllMcnp_Mcnp.cxx :: Error : BUILDING OF SOLID FAILED!!!!!!!\n\n"; + ofstream failStrm(".failedSolids"); + failStrm << aCell->GetCellNumber() << endl; + } + } + } + else + { + theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Reader")); + delete theError; + delete theMessage; + return Standard_False; + } + } + else { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + + return Standard_True; +} + +Standard_Boolean McCadExDllMcnp_Mcnp::ExportFromDocument(const Handle(TDocStd_Document)& theTDoc) { + Handle(McCadDiscDs_HSequenceOfDiscSolid) theVEntitySequence = new McCadDiscDs_HSequenceOfDiscSolid; + theVEntitySequence->Append(PrepareExport(theTDoc)); + + if(theVEntitySequence->Length() < 1) + return Standard_False; + else + return Export(theVEntitySequence); +} + +////qiu we don't need "extern" +////qiu extern "C"{ +// McCadEXPlug_ExchangePlugin* _McCadEXPlug_PluginMaker() { +// return new McCadExDllMcnp_Mcnp; +// } +// +// class PluginProxy +// { +// public: +// PluginProxy() +// { +// // register the maker into the MakerMap +// McCadEXPlug_ExchangePlugin* mcnpPlugin = _McCadEXPlug_PluginMaker(); +// PluginMakerMap[".mcnp"] = mcnpPlugin; +// PluginMakerMap[".mcn"] = mcnpPlugin; +// } +// }; +// // our one instance of the proxy +// PluginProxy McnpPlug; +////qiu } diff --git a/src/MCCAD/McCadExDllStep/McCadExDllStep_Step.cxx b/src/MCCAD/McCadExDllStep/McCadExDllStep_Step.cxx new file mode 100644 index 0000000..367de74 --- /dev/null +++ b/src/MCCAD/McCadExDllStep/McCadExDllStep_Step.cxx @@ -0,0 +1,592 @@ +#ifndef _OSD_File_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _STEPControl_Reader_HeaderFile +#include +#endif +#ifndef _STEPControl_Writer_HeaderFile +#include +#endif +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#include +//qiu remove gui, might be dangerous! #include +#include //qiu +#include //qiu +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +using namespace std; + +//qiu we don't need "extern" +///*qiu extern */map > PluginMakerMap; + +McCadExDllStep_Step::McCadExDllStep_Step() +{ + myExtensions = new TColStd_HSequenceOfAsciiString; + myExtensions->Append(TCollection_AsciiString(".step")); + myExtensions->Append(TCollection_AsciiString(".stp")); + myFormat = "step"; + myExportEnabled = Standard_True; + myImportEnabled = Standard_True; + myFileName = " "; + mySize = 0; + myType = 0; +/* cout << "========================"<< endl; + cout << "McCadExDllStep_Step()"<< endl; + cout << "========================"<< endl;*/ + +} +//Standard_Integer McCadExDllStep_Step::GetModelType() const +//{ +// return myType; +// } + +// void McCadExDllStep_Step::SetModelType(const Standard_Integer theType) +// { +// myType = theType; +// } + +Standard_Boolean McCadExDllStep_Step::Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) +{ + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + theGuiFactory->SetType(McCadGUI_Base); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + //theGuiFactory->SetType(McCadGUI_Progress); + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog; + + myProgress = theProgress; + + if (theEntitySequence->Length() == 0) + { + theError->Print(TCollection_AsciiString("The model is empty, can not be exported.")); + theError->Print(TCollection_AsciiString("Error: exporting empty model.")); + cout << "The model is empty, can not be exported." << endl;; + cout << "Error: exporting empty model." << endl; + delete theError; + delete theMessage; + return Standard_False; + } + STEPControl_StepModelType myModelType = STEPControl_AsIs; + + switch(myType) + { + case 0: + myModelType = STEPControl_AsIs; + break; + case 1: + myModelType = STEPControl_ManifoldSolidBrep; + break; + case 2: + myModelType =STEPControl_BrepWithVoids; + break; + case 3: + myModelType =STEPControl_FacetedBrep; + break; + case 4: + myModelType = STEPControl_FacetedBrepAndBrepWithVoids; + break; + case 5: + myModelType = STEPControl_ShellBasedSurfaceModel; + break; + case 6: + myModelType = STEPControl_GeometricCurveSet; + break; + case 7: + myModelType = STEPControl_Hybrid; + break; + default: + myModelType = STEPControl_AsIs; + break; + } + + if(myModelType == STEPControl_FacetedBrep) + if (!IsFacetedBrep(theEntitySequence)) + { + theError->Print(TCollection_AsciiString("The Model is not a faceted Brep.")); + cout << "The Model is not a faceted Brep." << endl; + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + if (theFile.Exists()) + { + Standard_Integer theSequenceLength = theEntitySequence->Length(); + myProgress->SetLabelText("Preparing Step File."); + myProgress->SetCancelButtonText("Cancel Export!"); + myProgress->SetTotalSteps(100); + myProgress->SetProgress(0); + + STEPControl_Writer aWriter; + IFSelect_ReturnStatus aReturnStatus = IFSelect_RetVoid; + + for (Standard_Integer i=1; i<=theSequenceLength; i++) + { + myProgress->SetProgress(i*100/theSequenceLength); + TopoDS_Shape myShape = theEntitySequence->Value(i); + if ( !myShape.IsNull() ) + { + aReturnStatus = aWriter.Transfer(myShape, myModelType); + } + } + if(aReturnStatus == IFSelect_RetDone ) + { + myProgress->SetLabelText("Exporting Step File."); + myProgress->SetCancelButtonText("Cancel Export!"); + myProgress->SetTotalSteps(100); + myProgress->SetProgress(0); + + aReturnStatus = aWriter.Write(myFileName.ToCString()); + if (aReturnStatus == IFSelect_RetDone) + { + myProgress->SetProgress(100); + theMessage->Print(myFileName + TCollection_AsciiString(" has been Exported.")); + cout << myFileName.ToCString() << " has been Exported." << endl; + delete theMessage; + delete theError; + delete theProgress; + return Standard_True; + } + else { + theError->Print(TCollection_AsciiString("Can not Export to the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Writer.")); + cout << "Can not Export to the file:" << myFileName.ToCString() << endl; + cout <<"Error from the Step Writer." << endl; + delete theMessage; + delete theError; + delete theProgress; + return Standard_True; + } + } + else + { + theError->Print(TCollection_AsciiString("Can not Export to the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Translator.")); + cout << "Can not Export to the file:" << myFileName.ToCString() << endl; + cout <<"Error from the Step Writer." << endl; + delete theError; + delete theMessage; + delete theProgress; + return Standard_False; + } + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + cout << myFileName.ToCString() << " does not exist." << endl; + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } + theFile.Close(); + } + else + { + theError->Print(TCollection_AsciiString("Select file first.")); + cout << " Select file first." << endl; + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } +} + + +Handle(TopTools_HSequenceOfShape) McCadExDllStep_Step::Import() +{ + Handle(TopTools_HSequenceOfShape) theEntitySequence = new TopTools_HSequenceOfShape; +/* McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog(); + myProgress = theProgress;*/ + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + if (theFile.Exists()) + { + /*myProgress->SetLabelText("Reading Step file."); + myProgress->SetCancelButtonText("Cancel Reading!"); + myProgress->SetTotalSteps(100); + myProgress->SetProgress(0);*/ + + STEPControl_Reader myReader; + IFSelect_ReturnStatus myReturnStatus = myReader.ReadFile(myFileName.ToCString()); + + //myProgress->SetProgress(100); + + if ( myReturnStatus == IFSelect_RetDone) + { + /*Standard_CString StepLogFile = "_Step.log"; + Standard_Boolean doAppend = Standard_True; + Message_PrinterOStream transferMessages(StepLogFile, doAppend);*/ + //Obsolete in OCC63 : Interface_TraceFile::SetDefault(2,StepLogFile,Standard_True); + + Standard_Boolean failsonly = Standard_False; + myReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity); + // Root transfers + /*myProgress->SetProgress(0); + myProgress->SetLabelText("Translating Step file."); + myProgress->SetCancelButtonText("Cancel Translation!"); + myProgress->SetTotalSteps(100);*/ + + Standard_Integer theNumberOfRoots = myReader.NbRootsForTransfer(); + + myReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity); + + if (theNumberOfRoots != 0) + { + TopoDS_Shape theShape; +//MYMOD 050208 + for ( Standard_Integer i = 1; i <= theNumberOfRoots; i++ ) + { + //myProgress->SetProgress(i*100/theNumberOfRoots); + Standard_Boolean ok = myReader.TransferRoot(i); + + if(ok) + { + theShape = myReader.Shape(i); + theEntitySequence->Append(theShape); + } + else + cout << "_#_McCadExDllStep_Step.cxx :: a shape could not be read!" << endl; + } +//MYMOD # + + /*theMessage->Print(myFileName + TCollection_AsciiString(" has been Imported.")); + delete theMessage; + delete theError; + delete theProgress;*/ + return theEntitySequence; + } + } + else + { + /*theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Reader")); + delete theError; + delete theMessage;*/ + return theEntitySequence; + } + theFile.Close(); + } + else + { + /*theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress;*/ + return theEntitySequence; + } + } + else + { + /*theError->Print(TCollection_AsciiString("Select file first.")); + delete theMessage; + delete theError; + delete theProgress;*/ + return theEntitySequence; + } + + return theEntitySequence; +} + + +TCollection_AsciiString McCadExDllStep_Step::GetFilename() const +{ + return myFileName; +} + + +void McCadExDllStep_Step::SetFilename(const TCollection_AsciiString& theFileName) +{ + myFileName = theFileName; +} + + +Standard_Integer McCadExDllStep_Step::GetSize() const +{ + return mySize; +} + + +Handle(TColStd_HSequenceOfAsciiString) McCadExDllStep_Step::GetExtensions() const +{ + return myExtensions; +} + + +TCollection_AsciiString McCadExDllStep_Step::GetExtension() const +{ + return myExtensions->Value(1); +} + + +TCollection_AsciiString McCadExDllStep_Step::GetFormat() const +{ + return myFormat; +} + + +Standard_Boolean McCadExDllStep_Step::ExportEnabled() const +{ + return myExportEnabled; +} + + +Standard_Boolean McCadExDllStep_Step::ImportEnabled() const +{ + return myImportEnabled; +} + + +Standard_Boolean McCadExDllStep_Step::IsFacetedBrep(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) +{ + Standard_Boolean OneErrorFound = Standard_False; + for (Standard_Integer i=1;i<=aHSequenceOfShape->Length();i++) + { + TopoDS_Shape aShape= aHSequenceOfShape->Value(i); + + TopExp_Explorer Ex(aShape,TopAbs_FACE); + while (Ex.More() && !OneErrorFound) + { + // Get the Geom_Surface outside the TopoDS_Face + Handle(Geom_Surface) aSurface = BRep_Tool::Surface(TopoDS::Face(Ex.Current())); + // check if it is a plane. + if (!aSurface->IsKind(STANDARD_TYPE(Geom_Plane))) + OneErrorFound=Standard_True; + Ex.Next(); + } + TopExp_Explorer Ex2(aShape,TopAbs_EDGE); + while (Ex2.More() && !OneErrorFound) + { + // Get the Geom_Curve outside the TopoDS_Face + Standard_Real FirstDummy,LastDummy; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(Ex2.Current()),FirstDummy,LastDummy); + // check if it is a line. + if (!aCurve->IsKind(STANDARD_TYPE(Geom_Line))) + OneErrorFound=Standard_True; + Ex2.Next(); + } + } + return !OneErrorFound; +} + + +Standard_Boolean McCadExDllStep_Step::ImportToDocument(Handle(TDocStd_Document)& theTDoc) +{ + STEPCAFControl_Reader theReader; + +//qiu remove gui, might be dangerous! McCadGUI_ProgressDialogPtr testD = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + McCadGUI_ProgressDialogPtr testD = new McCadGUI_ProgressDialog();//qiu + TCollection_AsciiString theFile = myFileName; + if(theFile.Search("/")>0) + theFile.Remove(1,theFile.SearchFromEnd("/")); + TCollection_AsciiString labelText = TCollection_AsciiString("Importing file \"") + theFile +TCollection_AsciiString("\""); + testD->SetLabelText(labelText); + Handle(Message_ProgressIndicator) theProgress = Handle(Message_ProgressIndicator)::DownCast(testD); + + theReader.SetNameMode(Standard_True); + theReader.SetColorMode(Standard_True); + //theReader.SetMatMode(Standard_True); + + theReader.Reader().WS()->MapReader()->SetProgress(theProgress); + theProgress->NewScope(10,"Load File"); + theReader.ReadFile(myFileName.ToCString()); + theProgress->EndScope(); + + Standard_Boolean aStatus=Standard_False; + + theReader.Reader().WS()->MapReader()->SetProgress(theProgress); + theProgress->NewScope(90,"Transfer Data"); + + + Handle(TDocStd_Document) tstDoc; + +//qiu remove gui, might be dangerous! QMcCad_Application::GetAppMainWin()->GetXCAFApp()->NewDocument("XmlXCAF", tstDoc); + McCadXCAF_Application::GetApplication()->NewDocument("XmlXCAF", tstDoc);//qiu find from QMcCad_Application + aStatus = theReader.Transfer(tstDoc); + + Handle(XCAFDoc_ShapeTool) _sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle(XCAFDoc_ColorTool) _cTool = XCAFDoc_DocumentTool::ColorTool(theTDoc->Main()); + Handle(XCAFDoc_ColorTool) cTool = XCAFDoc_DocumentTool::ColorTool(tstDoc->Main()); + + McCadXCAF_TDocShapeLabelIterator it(tstDoc); + + for(; it.More(); it.Next()) + { + TDF_Label curLab = it.Current(); + Handle(TNaming_NamedShape) nmdShp; + + if(!curLab.FindAttribute(TNaming_NamedShape::GetID(), nmdShp)) + continue; + + TopoDS_Shape curShp = nmdShp->Get(); + TDF_Label newLab = _sTool->AddShape(curShp, Standard_False, Standard_False); + Handle(TDataStd_Name) theName; + TCollection_AsciiString newName; + if(!curLab.FindAttribute(TDataStd_Name::GetID(),theName)) + { + TCollection_AsciiString labelName; + TDF_Tool::Entry(curLab, labelName); + newName = labelName.Split(labelName.SearchFromEnd(":")); + newName.Prepend("Solid "); + } + else + { + newName = TCollection_AsciiString(theName->Get()); + + if(newName.Length() == 0) + { + TCollection_AsciiString labelName; + TDF_Tool::Entry(curLab, labelName); + newName = labelName.Split(labelName.SearchFromEnd(":")); + newName.Prepend("Solid "); + } + } + + TDataStd_Name::Set(newLab, newName); + + // for some reasons we couldn't find colorgen... we can use colors from surfaces though... + // Quantity_Color newCol; + Quantity_Color newCol (0, 0, 0, Quantity_TOC_RGB); + TDF_Label cLab; + if(cTool->GetColor(curShp, XCAFDoc_ColorGen ,newCol)) + { + TDF_Label _cLab = _cTool->AddColor(newCol); + _cTool->SetColor(curShp, _cLab, XCAFDoc_ColorGen); + } + else if(cTool->GetColor(curShp, XCAFDoc_ColorSurf ,newCol)) + { + TDF_Label _cLab = _cTool->AddColor(newCol); + _cTool->SetColor(curShp, _cLab, XCAFDoc_ColorGen); + } + else if(cTool->GetColor(curShp, XCAFDoc_ColorCurv ,newCol)) + { + TDF_Label _cLab = _cTool->AddColor(newCol); + _cTool->SetColor(curShp, _cLab, XCAFDoc_ColorGen); + } + //newLab.AddAttribute(theName); + } + //aStatus = theReader.Transfer(theTDoc); + theProgress->EndScope(); + + return aStatus; +} + +Standard_Boolean McCadExDllStep_Step::ExportFromDocument(const Handle(TDocStd_Document)& theTDoc) +{ + STEPCAFControl_Writer theWriter; + Standard_Boolean T = Standard_True; + theWriter.SetNameMode(T); + theWriter.SetColorMode(T); + theWriter.SetMaterialMode(T); + +//qiu remove gui, might be dangerous! McCadGUI_ProgressDialogPtr testD = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + McCadGUI_ProgressDialogPtr testD = new McCadGUI_ProgressDialog(/*qiu*/); + TCollection_AsciiString theFileN = myFileName; + if(theFileN.Search("/")>0) + theFileN.Remove(1,theFileN.SearchFromEnd("/")); + TCollection_AsciiString labelText = TCollection_AsciiString("Exporting geometry to \"") + theFileN +TCollection_AsciiString("\""); + testD->SetLabelText(labelText); + Handle(Message_ProgressIndicator) theProgress = Handle(Message_ProgressIndicator)::DownCast(testD); + + theWriter.Writer().WS()->MapReader()->SetProgress(theProgress); + theProgress->NewScope(70,"Transfering Data"); + if(!theWriter.Transfer(theTDoc)) + { + cout << "_#_ McCadExDllStep_Step.cxx :: Error: data not transferred!!!\n"; + return Standard_False; + } + theProgress->EndScope(); + + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + theWriter.Writer().WS()->MapReader()->SetProgress(theProgress); + theProgress->NewScope(30,"Writing File"); + IFSelect_ReturnStatus theReturnStatus = theWriter.Write(myFileName.ToCString()); + theProgress->EndScope(); + + if (theReturnStatus != IFSelect_RetDone) + { + cout << "_::_ McCadExDllStep_Step.cxx :: Export Failed\n"; + return Standard_False; + } + + return Standard_True; +} + +// +//extern "C" { +// +// McCadEXPlug_ExchangePlugin *_McCadEXPlug_PluginMaker() +// { +// return new McCadExDllStep_Step; +// } +// +// class PluginProxy +// { +// public: +// PluginProxy() +// { +// // register the maker into the MakerMap +// PluginMakerMap[".step"] = _McCadEXPlug_PluginMaker(); +// PluginMakerMap[".stp"] = _McCadEXPlug_PluginMaker(); +// } +// }; +// // our one instance of the proxy +// PluginProxy StepPlug; +//} diff --git a/src/MCCAD/McCadExDllTripoli/McCadExDllTripoli_Tripoli.cxx b/src/MCCAD/McCadExDllTripoli/McCadExDllTripoli_Tripoli.cxx new file mode 100644 index 0000000..4a9cfb7 --- /dev/null +++ b/src/MCCAD/McCadExDllTripoli/McCadExDllTripoli_Tripoli.cxx @@ -0,0 +1,606 @@ +#include +#include +#ifndef _OSD_File_HeaderFile +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +//qiu remove gui, might be dangerous! #include +#include //qiu +#include +#include + + +using namespace std; + +//qiu we don't need "extern" +///*qiu extern */map > PluginMakerMap; + +McCadExDllTripoli_Tripoli::McCadExDllTripoli_Tripoli() +{ + myExtensions = new TColStd_HSequenceOfAsciiString; + myExtensions->Append(TCollection_AsciiString(".d")); + myExtensions->Append(TCollection_AsciiString(".tri")); + myFormat = "tripoli"; + myExportEnabled = Standard_True; + myImportEnabled = Standard_True; + myFileName = " "; + mySize = 0; + myUnits = McCadCSGGeom_CM; + + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(); + myPI = Handle(Message_ProgressIndicator)::DownCast(theProgress); // DUMMY + +// cout << "~~~~~~~~~~~~~~~~~~~~~\nTRIPOLI-WRITER\n~~~~~~~~~~~~~~~~~~~~~\n"; + +} + +/*Standard_Boolean McCadExDllTripoli_Tripoli::Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) +{ + cout << " Use with converted discrete model. " << endl; +}*/ + + +Standard_Boolean McCadExDllTripoli_Tripoli::Export(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theVEntitySequence) +{ + /* + * Build Cell Structure and Export Cells to File + */ + + //delete outer voids ||>>|| THEY'RE NOT NEEDED IN TRIPILI + theVEntitySequence->Remove(theVEntitySequence->Length()); + theVEntitySequence->Remove(theVEntitySequence->Length()); + + if (!myFileName.IsEmpty())//FILE NAME GIVEN + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + if (theFile.Exists())//FILE EXISTS + { + + cout << " Start Cell Building " << endl; + cout << " Total Number of cells = " << theVEntitySequence->Length() << endl; + cout << "================================================================= " << endl; + + Standard_Integer NbMat(0); + Standard_Integer NbVoid(0); + Standard_Integer NbOuterVoids(0); + + Handle(McCadCSGGeom_HSequenceOfCell) cellSeq = new McCadCSGGeom_HSequenceOfCell; + + myPI->SetStep(10/theVEntitySequence->Length()); + + for (int its = 1; its <= theVEntitySequence->Length(); its++) + { + McCadDiscDs_DiscSolid currentEntity = theVEntitySequence->Value(its); + TCollection_AsciiString currentName = currentEntity.GetName(); + + if(!currentEntity.IsVoid()) // Material Cells + { + NbMat++; + cout << "**************************************\n"; + cout << " Building Material Cell .......... " << its << endl; + + Handle(McCadTDS_HSequenceOfExtSolid) extSolSeq = new McCadTDS_HSequenceOfExtSolid; + + TopoDS_Solid sol2ext = TopoDS::Solid(currentEntity.GetSolid()); + + McCadCSGTool_Extender Mext(sol2ext); + + if(Mext.IsDone()) + { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + mcSol->SetComment(currentEntity.GetComment()); + extSolSeq->Append(mcSol); + } + else + { + cout << "_#_McCadExDllTripoli_Tripoli :: Extending solid failed!!" << endl; + continue; + } + + // cell building + //////////////////////////////////////////////////////////////////////////// + Standard_Real theDensity = myMDReader.GetDensity(currentName); + Standard_Integer theMatNb = myMDReader.GetMaterial(currentName); + + McCadCSGTool_CellBuilder Mcel; + + Mcel.SetDensity(theDensity); + Mcel.SetMatNumber(theMatNb); + Mcel.SetUnits(myUnits); + Mcel.Init(extSolSeq); + + //McCadCSGTool_CellBuilder Mcel(extSolSeq, theMatNb, theDensity); + + if(Mcel.IsDone()) + { + Handle(McCadCSGGeom_Cell) aCell = Mcel.GetCell(); + + //we add here the complements + Handle(TColStd_HSequenceOfInteger) compSeq = currentEntity.GetOtherVSolids(); + aCell->SetComplementCells(compSeq); + cellSeq->Append(aCell); + } + else + { + cout << "_#_McCadExDllTripoli_Tripoli :: Cell building failed on Material Cell!!" << endl; + continue; + } + cout << "************************************** Done cell: " << its << endl; + } + else // Void Cells + { + Handle(McCadTDS_HSequenceOfExtSolid) extSolSeq = new McCadTDS_HSequenceOfExtSolid; + + TopoDS_Solid sol2ext; + try + { + sol2ext = TopoDS::Solid(currentEntity.GetSolid()); + } + catch(...) + { + cout << "_#_McCadExDllTripoli_Tripoli.cxx :: FAILED\n"; + } + + //in TRIPOLI we don't need to define the outer space + + NbVoid++; + cout << "**************************************\n"; + cout << " Building Void Cell .......... " << its << endl; + + McCadCSGTool_Extender Mext(sol2ext); + if(Mext.IsDone()) + { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + mcSol->SetComment(TCollection_AsciiString(" McCad: ===== Void Cells =====")); + extSolSeq->Append(mcSol); + } + else + { + cout << "_#_McCadExDllTripoli_Tripoli :: Extending solid failed!!!" << endl; + continue; + } + + //////////////////////////////////////////////////////////////////////////// + McCadCSGTool_CellBuilder Mcel; + Mcel.SetUnits(myUnits); + Mcel.Init(extSolSeq); + + if(Mcel.IsDone()) + { + Handle(McCadCSGGeom_Cell) aCell = Mcel.GetCell(); + + //******************************************************************** + + Handle(TColStd_HSequenceOfInteger) compSeq = currentEntity.GetOtherVSolids(); + aCell->SetComplementCells(compSeq); + aCell->SetVoid(Standard_True); + cellSeq->Append(aCell); + } + else + { + cout << "_#_McCadExDllTripoli_Tripoli :: Cell building failed for Void Cell!!" << endl; + continue; + } + cout << "************************************** Done cell: " << its << endl; + } + myPI->Increment(); + } + + if(myPI->UserBreak()) + return Standard_False; + + myPI->SetValue(100); + /////////////////////////////////////////////////////////////////////////////////////////////// + //adapt outer space + // outer Box and Sphere print after modification + + cout << "GENERATE TRIPOLI SYNTAX \n..............................\n"; + McCadMcWrite_TripoliInputGenerator theTripoliWriter(cellSeq); + theTripoliWriter.SetInitialSurfaceNumber(myInitSurfNb); + theTripoliWriter.SetInitialCellNumber(myInitCellNb); + theTripoliWriter.SurfNumbering(); + + /* + * In tripoli the overall shape has to be convex. This requirement is already fulfilled by the + * bounding box. There is no need to define all space. Hence, the last two cell definitions which + * are necessary for MCNP are redundant and can be deleted. + */ + + /////////////////////////////////////////////////////////////////////////////////////////////// + + theTripoliWriter.SetNbOfMatCells(NbMat); + theTripoliWriter.SetNbOfVoidCells(NbVoid); + theTripoliWriter.SetNbOfOuterCells(NbOuterVoids); + theTripoliWriter.SetMDReader(myMDReader); + theTripoliWriter.PrintAll(theFile); + theFile.Close(); + + cout << myFileName.ToCString() << " has been EXPORTED\n"; + } + else + { + cout << myFileName.ToCString() << " does not exist." << endl; + theFile.Close(); + return Standard_False; + } + } + else + { + cout << " Select file first." << endl; + return Standard_False; + } + return Standard_True; +} + +Handle(TopTools_HSequenceOfShape) McCadExDllTripoli_Tripoli::Import() +{ +/* Handle(TopTools_HSequenceOfShape) theEnititySequence; + McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theProgress = theGuiFactory->MakeDialog(); + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + if (theFile.Exists()) + { + + //open file + OSD_Protection aProtection; + theFile.Open(OSD_ReadOnly, aProtection); + + theProgress->SetLabelText("Reading Tripoli file."); + theProgress->SetCancelButtonText("Cancel Reading!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + theEnititySequence = new TopTools_HSequenceOfShape(); + + McCadMcRead_Reader theReader; + theReader.Parse(theFile); + McCadMcRead_DataMapOfIntegerCell theCellMap; + + theReader.GetCells(theCellMap); + //cout << "Map Extent = " << theCellMap.Extent() << endl; + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter; + cIter.Initialize(theCellMap); + + for (; cIter.More();cIter.Next())//For all Cells construct Geometry... + { + Handle(McCadMcRead_Cell) aCell = cIter.Value(); + + if(aCell->GetMaterialNumber() == 0) + { + cout << "Not reconstructed void cell number: " << aCell->GetCellNumber() << endl; + continue; + } + McCadCSGUtil_SolidBuilder aB; + aB.Init(aCell); + + if(aB.IsDone()) + { + TopoDS_Shape aShape = aB.Result(); + theEnititySequence->Append(aShape); + } + } + return theEnititySequence; + } + else + { + theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Reader")); + delete theError; + delete theMessage; + return NULL; + } + theFile.Close(); + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress; + return NULL; + }*/ + return NULL; +} + +TCollection_AsciiString McCadExDllTripoli_Tripoli::GetFilename() const +{ + return myFileName; +} + +void McCadExDllTripoli_Tripoli::SetFilename(const TCollection_AsciiString& theFileName) +{ + myFileName = theFileName; +} + +Standard_Integer McCadExDllTripoli_Tripoli::GetSize() const +{ + return mySize; +} + +Handle(TColStd_HSequenceOfAsciiString) McCadExDllTripoli_Tripoli::GetExtensions() const +{ + return myExtensions; +} + +TCollection_AsciiString McCadExDllTripoli_Tripoli::GetExtension() const +{ + return myExtensions->Value(1); +} + +TCollection_AsciiString McCadExDllTripoli_Tripoli::GetFormat() const +{ + return myFormat; +} + +Standard_Boolean McCadExDllTripoli_Tripoli::ExportEnabled() const +{ + return myExportEnabled; +} + +Standard_Boolean McCadExDllTripoli_Tripoli::ImportEnabled() const +{ + return myImportEnabled; +} + +Standard_Boolean McCadExDllTripoli_Tripoli::ImportToDocument(Handle(TDocStd_Document)& theTDoc) +{ +/* McCadGUI_GuiFactoryPtr theGuiFactory = theGuiFactory->Instance(); + McCadGUI_BaseDialogPtr theMessage = theGuiFactory->MakeDialog(); + McCadGUI_BaseDialogPtr theError = theGuiFactory->MakeDialog(); + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + //Handle(Message_ProgressIndicator) + myPI = Handle(Message_ProgressIndicator)::DownCast(theProgress); + + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle(TDF_Data) theData = theTDoc->GetData(); + + if (!myFileName.IsEmpty()) + { + OSD_Path thePath(myFileName); + OSD_File theFile(thePath); + if (theFile.Exists()) + { + //open file + OSD_Protection aProtection; + theFile.Open(OSD_ReadOnly, aProtection); + + theProgress->SetLabelText("Reading Tripoli file."); + theProgress->SetCancelButtonText("Cancel Reading!"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + McCadMcRead_Reader theReader; + theReader.Parse(theFile); + + McCadMcRead_DataMapOfIntegerCell theCellMap; + + theReader.GetCells(theCellMap); + theReader.GetMDReader(myMDReader); + + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter; + Standard_Integer numShp = theCellMap.Extent(); + Standard_Integer pCnt(0); + Standard_Real delta = 100.5/numShp; + myPI->SetStep(delta); + + cIter.Initialize(theCellMap); + + QApplication::restoreOverrideCursor(); + TCollection_AsciiString labEntry("0:1:1:1:6"); + TDF_Label mRootLab; + TDF_Tool::Label(theData, labEntry, mRootLab, Standard_True); + + Standard_Integer aMatNum(1); + + for (; cIter.More();cIter.Next())//For all Cells construct Geometry... + { + Handle(McCadMcRead_Cell) aCell = cIter.Value(); + + myPI->Increment(); + if(myPI->UserBreak()) + return Standard_False; + + if(aCell->GetMaterialNumber() == 0) + { + cout << "Not reconstructed void cell number: " << aCell->GetCellNumber() << endl; + continue; + } + if(aCell->IsPseudo()) // TODO: if a cell is pseudo it means, it is filled with a universe. + continue; // build an assembly: fillNumber--+universeCell1--+UniverseCell2,... + + McCadCSGUtil_SolidBuilder aB; + aB.Init(aCell); + + if(aB.IsDone()) // add shape and cell number as its name to the document + { + TDF_Label newLab; + TopoDS_Shape aShape = aB.Result(); + newLab = sTool->AddShape(aShape,0,0); + TCollection_ExtendedString theName; + if(aCell->GetPseudoNum()!=0) + { + theName = TCollection_AsciiString(aCell->GetPseudoNum()); + //cout << "set pseudo number " << aCell->GetPseudoNum() << " for Cell " << aCell->GetCellNumber() << endl; + } + else + theName = TCollection_AsciiString(aCell->GetCellNumber()); + + TDataStd_Name::Set(newLab, theName); + + //Test if material group already exists + TDF_ChildIterator matGrpLabs(mRootLab); + TDF_Label newChild; + Standard_Boolean found(Standard_False); + Handle_TDataStd_Name tstName; + TCollection_AsciiString aName = TCollection_AsciiString("material ") + TCollection_AsciiString(aCell->GetMaterialNumber()); + TCollection_ExtendedString mName(aName); + + for(;matGrpLabs.More(); matGrpLabs.Next()) + { + if(matGrpLabs.Value().FindAttribute(TDataStd_Name::GetID(), tstName)) + { + if(tstName->Get().IsEqual(mName)) + { + Handle_TDataStd_Real tstDens; + if(matGrpLabs.Value().FindAttribute(TDataStd_Real::GetID(),tstDens)) + { + if(tstDens->Get()==aCell->GetDensity()) + { + newChild = matGrpLabs.Value(); + found = Standard_True; + break; + } + else // same name but different density --> new Material Group + aName += TCollection_AsciiString("_") + TCollection_AsciiString(aMatNum++); + } + if(found) + break; + } + if(found) + break; + } + if(found) + break; + } + + + if(!found) + { + newChild = mRootLab.NewChild(); + + TDataStd_Name::Set(newChild, mName); + TDataStd_Real::Set(newChild, aCell->GetDensity()); + TCollection_AsciiString mCard; + myMDReader.GetMCard(aCell->GetMaterialNumber(), mCard); + TDataStd_AsciiString::Set(newChild,mCard); + } + + Handle(TDataStd_TreeNode) refNode, mainNode; + mainNode = TDataStd_TreeNode::Set ( newChild, TDataStd_TreeNode::GetDefaultTreeID()); + refNode = TDataStd_TreeNode::Set ( newLab, TDataStd_TreeNode::GetDefaultTreeID()); + refNode->Remove(); // abv: fix against bug in TreeNode::Append() + mainNode->Prepend(refNode); + } + else + cout << "BUILDING OF SOLID FAILED!!!!!!!\n\n"; + } + } + else + { + theError->Print(TCollection_AsciiString("Can not Import the file:") + myFileName ); + theError->Print(TCollection_AsciiString("Error from the Step Reader")); + delete theError; + delete theMessage; + return Standard_False; + } + + } + else + { + theError->Print(myFileName + TCollection_AsciiString(" does not exist.")); + delete theMessage; + delete theError; + delete theProgress; + return Standard_False; + } +*/ + return Standard_False; +} + + +Standard_Boolean McCadExDllTripoli_Tripoli::ExportFromDocument(const Handle(TDocStd_Document)& theTDoc) +{ + Handle(McCadDiscDs_HSequenceOfDiscSolid) theVEntitySequence = new McCadDiscDs_HSequenceOfDiscSolid; + theVEntitySequence->Append(PrepareExport(theTDoc)); + + return Export(theVEntitySequence); +} + + + +////qiu we don't need "extern" +////qiu extern "C" { +//McCadEXPlug_ExchangePlugin* _McCadEXPlug_PluginMaker() +//{ +// return new McCadExDllTripoli_Tripoli; +//} +// +//class PluginProxy +//{ +//public: +// PluginProxy() +// { +// // register the maker into the MakerMap +// McCadEXPlug_ExchangePlugin* tripoliPlugin =_McCadEXPlug_PluginMaker(); +// PluginMakerMap[".d"] = tripoliPlugin; +// PluginMakerMap[".tri"] = tripoliPlugin; +// } +//}; +//// our one instance of the proxy +//PluginProxy TripoliPlug; +////qiu } diff --git a/src/MCCAD/McCadGTOOL/McCadGTOOL.cxx b/src/MCCAD/McCadGTOOL/McCadGTOOL.cxx new file mode 100644 index 0000000..5c5f03a --- /dev/null +++ b/src/MCCAD/McCadGTOOL/McCadGTOOL.cxx @@ -0,0 +1,391 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +Standard_Real McCadGTOOL::Evaluate(const GeomAdaptor_Surface& theSurf, const gp_Pnt& thePoint) +{ + GeomAbs_SurfaceType surfType = theSurf.GetType(); + + switch (surfType) + { + case GeomAbs_Plane: + { + //cout << " Evaluate Plane \n"; + gp_Pln aPlane = theSurf.Plane(); + return Evaluate(aPlane, thePoint); + break; + } + case GeomAbs_Cylinder: + { + //cout << " Evaluate Cylinder \n"; + gp_Cylinder aCyl = theSurf.Cylinder(); + return Evaluate(aCyl, thePoint); + break; + } + case GeomAbs_Cone: + { + //cout << " Evaluate Cone \n"; + gp_Cone aCone = theSurf.Cone(); + return Evaluate(aCone, thePoint); + break; + } + case GeomAbs_Sphere: + { + //cout << " Evaluate Sphere \n"; + gp_Sphere aSp = theSurf.Sphere(); + return Evaluate(aSp, thePoint); + break; + } + case GeomAbs_Torus: + { + //cout << " Evaluate Torus \n"; + gp_Torus aTor = theSurf.Torus(); + return Evaluate(aTor, thePoint); + break; + } + + case GeomAbs_BezierSurface: + { + cout << "_#_McCadGTOOL.cxx :: No evaluation for BezierSurfaces available!" << endl; + return 0; + break; + } + case GeomAbs_BSplineSurface: + { + cout << "_#_McCadGTOOL.cxx :: No evaluation for BSplineSurfaces available!" << endl; + return 0; + break; + } + case GeomAbs_SurfaceOfRevolution: + { + // compute nearest point on surface + Handle(Geom_Surface) s = theSurf.Surface(); + GeomAPI_ProjectPointOnSurf projector(thePoint, s); + gp_Pnt nearestPnt = projector.NearestPoint(); + + Standard_Real dist = nearestPnt.Distance(thePoint); + if(dist < 1e-5) + return 0.0; + + // Make solid and check if thePoint lies on the inside or the outside + BRepBuilderAPI_MakeShell shellMaker(s, Standard_False); + TopoDS_Shell theShell = shellMaker.Shell(); + BRepBuilderAPI_MakeSolid solidMaker(theShell); + TopoDS_Shape theSolid = solidMaker.Shape(); + Standard_Integer sgn(1); + + BRepClass3d_SolidClassifier clssfr(theSolid, thePoint, 1e-7); + + if(clssfr.State() == TopAbs_IN) + sgn = -1; + else if(clssfr.State() == TopAbs_ON) + dist = 0.0; + + return dist*sgn; + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "_#_McCadGTOOL.cxx :: No evaluation extruded surfaces available!" << endl; + return 0; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "_#_McCadGTOOL.cxx :: No evaluation for this type of surface available!!!" << endl; + return 0; + break; + } + case GeomAbs_OtherSurface: + { + cout << "_#_McCadGTOOL.cxx :: No evaluation for this type of surface available!!" << endl; + return 0; + break; + } + } + cout << "_#_McCadGTOOL.cxx :: No evaluation for this type of surface available!" << endl; + return 0.0; +} + +Standard_Real McCadGTOOL::Evaluate(const gp_Pln& Pl, const gp_Pnt& thePoint) +{ + Standard_Real A=0, B=0, C=0, D=0; + Pl.Coefficients(A, B, C, D); + + //cout << "\t\t\tCOEFFICIENTS : " << A << " " << B << " " << C << " " << D << endl; + + return McCadGTOOL::PlaneEvaluate(thePoint.X(), thePoint.Y(), thePoint.Z(), A, B, C, D); +} + + +Standard_Real McCadGTOOL::Evaluate(const gp_Cone& Co, const gp_Pnt& thePoint) +{ + Standard_Real A1=0, A2=0, A3=0, B1=0, B2=0, B3=0, C1=0, C2=0, C3=0, D=0; + Co.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + return McCadGTOOL::QuadricEvaluate(thePoint.X(), thePoint.Y(), thePoint.Z(), A1, A2, A3, B1, B2, B3, C1, C2, C3, D); +} + + +Standard_Real McCadGTOOL::Evaluate(const gp_Cylinder& Cy, const gp_Pnt& thePoint) +{ + ///////////////////////////////////////////////////////////////////////////////////////////////////// + Standard_Real A1, A2, A3, B1, B2, B3, C1, C2, C3, D; + Cy.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + return McCadGTOOL::QuadricEvaluate(thePoint.X(), thePoint.Y(), thePoint.Z(), A1, A2, A3, B1, B2, B3, C1, C2, C3, D); +} + + +Standard_Real McCadGTOOL::Evaluate(const gp_Sphere& Sp, const gp_Pnt& thePoint) +{ + Standard_Real A1, A2, A3, B1, B2, B3, C1, C2, C3, D; + Sp.Coefficients(A1, A2, A3, B1, B2, B3, C1, C2, C3, D); + return McCadGTOOL::QuadricEvaluate(thePoint.X(), thePoint.Y(), thePoint.Z(), A1, A2, A3, B1, B2, B3, C1, C2, C3, D); +} + +// trac#22 evaluation failes +Standard_Real McCadGTOOL::Evaluate(const gp_Torus& To, const gp_Pnt& thePoint) +{ + // Due to problems + // calssical point location is performed. + gp_Trsf T; + gp_Ax3 s3x(gp::Origin(), gp::DZ()); + gp_Ax3 a3x = To.Position(); + T.SetTransformation(s3x, a3x); + gp_Pnt loc = a3x.Location(); + gp_Vec V(loc, thePoint); + gp_Dir d(V); + + Standard_Real dist = loc.Distance(thePoint); + Standard_Boolean OutSide = Standard_False, OnSide = Standard_False, InSide= + Standard_False, Failed = Standard_False; + + Handle(Geom_Line) L = new Geom_Line(loc,d); + Handle(Geom_ToroidalSurface) Tt = new Geom_ToroidalSurface(To); + Standard_Real s=0, b=0; + Standard_Real d1, d2, d3, d4; + GeomAPI_IntCS Inter(L, Tt); + Standard_Integer NbP; + + if (Inter.IsDone()) + { + NbP = Inter.NbPoints(); + switch (NbP) + { + + case 0: + OutSide = Standard_True; + break; + case 1: + case 2: + OnSide = Standard_True; + break; + case 3: + break; + case 4: + d1 = loc.Distance(Inter.Point(1)); + d2 = loc.Distance(Inter.Point(2)); + d3 = loc.Distance(Inter.Point(3)); + d4 = loc.Distance(Inter.Point(4)); + // cout << "Dists: d1 = " << d1 << " d2 = " << d2 << " d3 = " << d3 << " d4 = " << d4 << endl; + if (d1 <= d2) + s = d1; + else + s=d2; + if (s <= d3) + ; + else + s = d3; + if (s <= d4) + ; + else + s = d4; + if (d1 >= d2) + b = d1; + else + b=d2; + if (b >= d3) + ; + else + b = d3; + if (b >= d4) + ; + else + b = d4; + if ((dist - s) > 1.e-03 && (b - dist) > 1.e-03) + InSide = Standard_True; + else if ((s - dist) > 1.e-03 || (dist - b) > 1.e-03) + OutSide = Standard_True; + else if (fabs(dist - s) < 1.e-03 || fabs(b-dist) < 1.e-03) + OnSide = Standard_True; + else + cout << "Torus evaluation failed!!" << endl; + break; + default: + cout << "Torus evaluation failed!!" << endl; + Failed = Standard_True; + break; + } + } + else + { + cout << "Torus evaluation failed!!" << endl; + Failed = Standard_True; + } + + // cout << "Number of Points = " << NbP << endl; + if (InSide) + return -dist; + else if (OutSide) + return dist; + else if (OnSide) + return 0.0; + else + { + cout << "Unclassified Point: X = " << thePoint.X() << " Y = " << thePoint.Y() << " Z = " << thePoint.Z() << " Value = " << dist << endl; + Failed = Standard_True; + } + if (Failed) + { + cout << "Cascade Torus evaluation !!!" << endl; + TColStd_Array1OfReal Coef(1, 31); + To.Coefficients(Coef); + return McCadGTOOL::TorusEvaluate(thePoint.X(), thePoint.Y(), thePoint.Z(), Coef); + } + + return 0.0; + + /* + // + // The size of the array is upper - lower + 1. + // the McCad torus evaluation works as follows: it transforms the torus to std. coord. + // system and uses the following torus equation. + // (x2 + y2 + z2 - ( R2 - r2))2 - 4R2(r2 - z2) = 0 + gp_Trsf T; + gp_Ax3 stdAxis(gp::Origin(),gp::DZ()); + gp_Ax3 theAxis = To.Position(); + gp_Pnt loc = theAxis.Location(); + Standard_Real R = To.MajorRadius(); + Standard_Real r = To.MinorRadius(); + T.SetTransformation(theAxis,stdAxis); + gp_Torus TTo = To.Transformed(T); + gp_Ax3 newAxis = TTo.Position(); + R = TTo.MajorRadius(); + r = TTo.MinorRadius(); + gp_Dir theTorusDirect = newAxis.Direction(); + // cout << " MajorRadius = " << R << " MinorRadius = " << r << endl; + Standard_Real x=0,y=0,z=0; + x = thePoint.X(); + y = thePoint.Y(); + z = thePoint.Z(); + cout << " Directions : X = " << theTorusDirect.X() << " Y = " << theTorusDirect.Y() << " Z = " << theTorusDirect.Z() << endl; + if ( (1 - fabs(theTorusDirect.Z())) < 1.e-07) + { + cout << "McCad Torus evaluation !!!" << endl; + Standard_Real Val = x*x + y*y + z*z - 2.0*R*(sqrt(x*x + y*y)) - r*r + R*R; // by IGES STD + return Val; + } + else + { + cout << "Cascade Torus evaluation !!!" << endl; + TColStd_Array1OfReal Coef(1,31); + To.Coefficients(Coef); + return McCadGTOOL::TorusEvaluate ( thePoint.X(), thePoint.Y(), thePoint.Z(), Coef); + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + else if (fabs(theTorusDirect.X()) <=1.e-07 && fabs(theTorusDirect.Y()) >=1.e-07 && fabs(theTorusDirect.Z()) <=1.e-07 ) + return x*x + y*y + z*z -2*R*(sqrt(x*x + z*z)) - r*r + R*R; + else if (fabs(theTorusDirect.X()) <=1.e-07 && fabs(theTorusDirect.Y()) <=1.e-07 && fabs(theTorusDirect.Z()) >=1.e-07 ) + return x*x + y*y + z*z -2*R*(sqrt(x*x + y*y)) - r*r + R*R; + */ +} + + +Standard_Real McCadGTOOL::PlaneEvaluate(const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real A, + const Standard_Real B, const Standard_Real C, const Standard_Real D) +{ + //cout << X << " " << Y << " " << Z << " " << endl; + return A * X + B * Y + C * Z + D; +} + + +Standard_Real McCadGTOOL::QuadricEvaluate(const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real A1, + const Standard_Real A2, const Standard_Real A3, const Standard_Real B1, const Standard_Real B2, + const Standard_Real B3, const Standard_Real C1, const Standard_Real C2, const Standard_Real C3, + const Standard_Real D) +{ + return A1*X*X + A2*Y*Y + A3*Z*Z + 2.*(B1*X*Y + B2*X*Z + B3*Y*Z) + 2.*(C1*X + C2*Y + C3*Z) + D; +} + + +Standard_Real McCadGTOOL::CylinderEvaluate(const Standard_Real X, + const Standard_Real Y, const Standard_Real Z, const Standard_Real A1, + const Standard_Real A2, const Standard_Real A3, const Standard_Real B1, + const Standard_Real B2, const Standard_Real B3, const Standard_Real C1, + const Standard_Real C2, const Standard_Real C3, const Standard_Real D) +{ + return A1*X*X + A2*Y*Y + A3*Z*Z + 2.*(B1*X*Y + B2*X*Z + B3*Y*Z) + 2.*(C1*X + C2*Y + C3*Z) + D; +} + + + +Standard_Real McCadGTOOL::ConeEvaluate(const Standard_Real X, + const Standard_Real Y, const Standard_Real Z, const Standard_Real A1, + const Standard_Real A2, const Standard_Real A3, const Standard_Real B1, + const Standard_Real B2, const Standard_Real B3, const Standard_Real C1, + const Standard_Real C2, const Standard_Real C3, const Standard_Real D) +{ + return A1*X*X + A2*Y*Y + A3*Z*Z + 2.*(B1*X*Y + B2*X*Z + B3*Y*Z) + 2.*(C1*X + C2*Y + C3*Z) + D; +} + + + +Standard_Real McCadGTOOL::SphereEvaluate(const Standard_Real X, + const Standard_Real Y, const Standard_Real Z, const Standard_Real A1, + const Standard_Real A2, const Standard_Real A3, const Standard_Real B1, + const Standard_Real B2, const Standard_Real B3, const Standard_Real C1, + const Standard_Real C2, const Standard_Real C3, const Standard_Real D) +{ + return A1*X*X + A2*Y*Y + A3*Z*Z + 2.*(B1*X*Y + B2*X*Z + B3*Y*Z) + 2.*(C1*X + C2*Y + C3*Z) + D; +} + + +Standard_Real McCadGTOOL::TorusEvaluate(const Standard_Real X, + const Standard_Real Y, const Standard_Real Z, + const TColStd_Array1OfReal& Coef) +{ + + return Coef(1)*Pow(X, 4) + Coef(2)*Pow(Y, 4) + Coef(3)*Pow(Z, 4) + Coef(4) + *Pow(X, 3)*Y + Coef(5)*Pow(X, 3)*Z + Coef(6)*Pow(Y, 3)*X + Coef(7) + *Pow(Y, 3)*Z + Coef(8)*Pow(Z, 3)*X + Coef(9)*Pow(Z, 3)*Y + Coef(10) + *X*X*Y*Y + Coef(11)*X*X*Z*Z + Coef(12)*Y*Y*Z*Z + Coef(13)*Pow(X, 3) + + Coef(14)*Pow(Y, 3) + Coef(15)*Pow(Z, 3) + Coef(16)*X*X*Y + + Coef(17)*X*X*Z + Coef(18)*Y*Y*X + Coef(19)*Y*Y*Z + Coef(20)*Z*Z*X + + Coef(21)*Z*Z*Y + Coef(22)*X*X + Coef(23)*Y*Y + Coef(24)*Z*Z + + Coef(25)*X*Y + Coef(26)*X*Z + Coef(27)*Y*Z + Coef(28)*X + + Coef(29)*Y + Coef(30)*Z; + +} + diff --git a/src/MCCAD/McCadGUI/McCadGUI_BaseDialog.cxx b/src/MCCAD/McCadGUI/McCadGUI_BaseDialog.cxx new file mode 100644 index 0000000..a8eb7b9 --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_BaseDialog.cxx @@ -0,0 +1,139 @@ +#include +#include +#include + +McCadGUI_BaseDialog::McCadGUI_BaseDialog() +{ + myType = McCadGUI_Message; + myLevel = McCadGUI_Warning_Level; + myText = " "; + // std::streambuf *myBuffer = myStream.rdbuf(); + // std::cout.rdbuf(myStream.rdbuf()); + // myStream.rdbuf(cout.rdbuf()); +} + +void McCadGUI_BaseDialog::Destroy() +{ + +} + +void McCadGUI_BaseDialog::SetType(const McCadGUI_TypeOfDialog theType) +{ + myType = theType; +} + +McCadGUI_TypeOfDialog McCadGUI_BaseDialog::GetType() const +{ + return myType; +} + +void McCadGUI_BaseDialog::SetLevel(const McCadGUI_LevelOfDialog theLevel) +{ + myLevel = theLevel; +} + +McCadGUI_LevelOfDialog McCadGUI_BaseDialog::GetLevel() const +{ + return myLevel; +} + +void McCadGUI_BaseDialog::SetText(const TCollection_AsciiString& theText) +{ + myText = theText; +} + +TCollection_AsciiString McCadGUI_BaseDialog::GetText() const +{ + return myText; +} + +void McCadGUI_BaseDialog::Print() +{ + // myStream << myText << endl; +} + +void McCadGUI_BaseDialog::Print(const TCollection_AsciiString& theText) +{ + myText = theText; + // myStream << myText << endl; +} + +void McCadGUI_BaseDialog::Print(const McCadGUI_LevelOfDialog theLevel, const TCollection_AsciiString& theText) +{ + myLevel = theLevel; + myText = theText; + // myStream << myText << endl; +} + +void McCadGUI_BaseDialog::SetStream(Standard_OStream& theStream) +{ + // std::streambuf *myBuffer = myStream.rdbuf(); + // myStream.rdbuf(theStream.rdbuf()); +} + +Quantity_Color McCadGUI_BaseDialog::GetColor() const +{ + Quantity_Color aColor(Quantity_NOC_WHITE); + return aColor; +} + +void McCadGUI_BaseDialog::SetColor(const Quantity_Color& theColor) +{ +} + +TCollection_AsciiString McCadGUI_BaseDialog::SelectedFile() const +{ + TCollection_AsciiString aSelectedFile("none"); + return aSelectedFile; +} + +TCollection_AsciiString McCadGUI_BaseDialog::SelectedFilter() const +{ + TCollection_AsciiString aSelectedFilter("none"); + return aSelectedFilter; +} + +void McCadGUI_BaseDialog::SetSelectedFilter( + const TCollection_AsciiString& theMask) +{ +} + +void McCadGUI_BaseDialog::SetSelection( + const TCollection_AsciiString& theFileName) +{ +} + +Standard_Integer McCadGUI_BaseDialog::GetInteger() const +{ + Standard_Integer anInt(0); + return anInt; +} + +Standard_Real McCadGUI_BaseDialog::GetReal() const +{ + Standard_Real aReal(0.0); + return aReal; +} + +void McCadGUI_BaseDialog::SetTotalSteps(const Standard_Integer theTotalSteps) +{ +} + +void McCadGUI_BaseDialog::SetProgress(const Standard_Integer theProgressPositin) +{ +} + +void McCadGUI_BaseDialog::SetLabelText( + const TCollection_AsciiString& theLabelText) +{ +} + +void McCadGUI_BaseDialog::SetCancelButtonText( + const TCollection_AsciiString& theCancelButtonText) +{ +} + +void McCadGUI_BaseDialog::Cancel() +{ +} + diff --git a/src/MCCAD/McCadGUI/McCadGUI_ColorDialog.cxx b/src/MCCAD/McCadGUI/McCadGUI_ColorDialog.cxx new file mode 100644 index 0000000..e584f92 --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_ColorDialog.cxx @@ -0,0 +1,19 @@ +#include + +McCadGUI_ColorDialog::McCadGUI_ColorDialog() +{ +} + +Quantity_Color McCadGUI_ColorDialog::GetColor() const +{ + return myColor; +} + +void McCadGUI_ColorDialog::SetColor(const Quantity_Color& theColor) +{ + myColor = theColor; +} + + + + diff --git a/src/MCCAD/McCadGUI/McCadGUI_FileDialog.cxx b/src/MCCAD/McCadGUI/McCadGUI_FileDialog.cxx new file mode 100644 index 0000000..9544856 --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_FileDialog.cxx @@ -0,0 +1,32 @@ +#include + +McCadGUI_FileDialog::McCadGUI_FileDialog() +{ + myFileName = " "; + myFilter = " "; +} + +TCollection_AsciiString McCadGUI_FileDialog::SelectedFile() const +{ + + return myFileName; + +} + +TCollection_AsciiString McCadGUI_FileDialog::SelectedFilter() const +{ + return myFilter; +} + +void McCadGUI_FileDialog::SetSelectedFilter(const TCollection_AsciiString& theMask) +{ + myFilter = theMask; +} + +void McCadGUI_FileDialog::SetSelection(const TCollection_AsciiString& theFileName) +{ + + myFileName = theFileName; +} + + diff --git a/src/MCCAD/McCadGUI/McCadGUI_GuiFactory.cxx b/src/MCCAD/McCadGUI/McCadGUI_GuiFactory.cxx new file mode 100644 index 0000000..0435a85 --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_GuiFactory.cxx @@ -0,0 +1,60 @@ +#include +#include +#include +#include +#include + + +McCadGUI_GuiFactoryPtr McCadGUI_GuiFactory::myInstance = 0; + +McCadGUI_GuiFactory::McCadGUI_GuiFactory() +{ + myCurrentType = McCadGUI_None; +} + +McCadGUI_GuiFactoryPtr McCadGUI_GuiFactory::Instance() +{ + if (myInstance == 0) + { + myInstance = new McCadGUI_GuiFactory; + } + return myInstance; +} + +void McCadGUI_GuiFactory::SetType(const McCadGUI_TypeOfDialog theType) +{ + myCurrentType = theType; +} + +McCadGUI_TypeOfDialog McCadGUI_GuiFactory::GetType() const +{ + return myCurrentType; +} + +McCadGUI_BaseDialogPtr McCadGUI_GuiFactory::MakeDialog() const +{ + if (myCurrentType == McCadGUI_None) + return 0; + switch (myCurrentType) + { + case McCadGUI_Base: + return new McCadGUI_BaseDialog(); + case McCadGUI_Progress: + return new McCadGUI_ProgressDialog(); + case McCadGUI_File: + return new McCadGUI_FileDialog(); + case McCadGUI_Message: + return new McCadGUI_BaseDialog(); + case McCadGUI_Error: + return new McCadGUI_BaseDialog(); + case McCadGUI_Debug: + return new McCadGUI_BaseDialog(); + case McCadGUI_Input: + return new McCadGUI_InputDialog(); + case McCadGUI_Color: + return new McCadGUI_ColorDialog(); + default: + return 0; + } +} + diff --git a/src/MCCAD/McCadGUI/McCadGUI_InputDialog.cxx b/src/MCCAD/McCadGUI/McCadGUI_InputDialog.cxx new file mode 100644 index 0000000..9c5ff4b --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_InputDialog.cxx @@ -0,0 +1,18 @@ +#include + +McCadGUI_InputDialog::McCadGUI_InputDialog() +{ +} + +Standard_Integer McCadGUI_InputDialog::GetInteger() const +{ + Standard_Integer anInt(0); + return anInt; +} + +Standard_Real McCadGUI_InputDialog::GetReal() const +{ + Standard_Real aReal(0.0); + return aReal; +} + diff --git a/src/MCCAD/McCadGUI/McCadGUI_Messenger.cxx b/src/MCCAD/McCadGUI/McCadGUI_Messenger.cxx new file mode 100644 index 0000000..df3fc60 --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_Messenger.cxx @@ -0,0 +1,165 @@ +#include + +#ifndef MCCAD_NONGUI +McCadGUI_Messenger::McCadGUI_Messenger(QMcCad_Application* theApp) +{ + myApp = theApp; + myMsgType = McCadGUI_DefaultMsg; + myMessage = ""; +} +#endif + +//ctor +McCadGUI_Messenger::McCadGUI_Messenger() +{ +#ifndef MCCAD_NONGUI + GetApplication(); + myMsgType = McCadGUI_DefaultMsg; + myMessage = ""; + GetApplication(); +#else + myMsgType = McCadGUI_CoutMsg; +#endif +} + +// dtor +McCadGUI_Messenger::~McCadGUI_Messenger() +{ + if(myMessage != "") + { + myMsgType = McCadGUI_DefaultMsg; + Broadcast(); + } + +} + +// append operator +void McCadGUI_Messenger::operator<<(TCollection_AsciiString opStr) +{ + Append(opStr); +} + +//append +void McCadGUI_Messenger::Append(TCollection_AsciiString apStr) +{ + myMessage += apStr; +} + + +// standard message +void McCadGUI_Messenger::Message() +{ + myMsgType = McCadGUI_DefaultMsg; + Broadcast(); +} + +void McCadGUI_Messenger::Message(TCollection_AsciiString msg) +{ + myMessage = msg; + Message(); +} + + +// warning +void McCadGUI_Messenger::Warning() +{ + myMsgType = McCadGUI_WarningMsg; +// cout << myMessage.ToCString() << endl; + Broadcast(); +} + + +void McCadGUI_Messenger::Warning(TCollection_AsciiString msg) +{ + myMessage = msg; + Warning(); +} + + +// error message +void McCadGUI_Messenger::Error() +{ + myMsgType = McCadGUI_ErrorMsg; +// cout << myMessage.ToCString() << endl; + Broadcast(); +} + +void McCadGUI_Messenger::Error(TCollection_AsciiString msg) +{ + myMessage = msg; + Error(); +} + + +// only output to shell +void McCadGUI_Messenger::Cout() +{ + myMsgType = McCadGUI_CoutMsg; + Broadcast(); +} + +void McCadGUI_Messenger::Cout(TCollection_AsciiString msg) +{ + myMessage = msg; + Cout(); +} + + +// make printout font bold +void McCadGUI_Messenger::Heading() +{ + myMsgType = McCadGUI_HeadingMsg; + Broadcast(); +} + +void McCadGUI_Messenger::Heading(TCollection_AsciiString msg) +{ + myMessage = msg; + Heading(); +} + + +// set output type +void McCadGUI_Messenger::SetOutType(McCadGUI_MessageType theOutType) +{ + myMsgType = theOutType; +} + +// get output type +McCadGUI_MessageType McCadGUI_Messenger::OutType() +{ + return myMsgType; +} + +///////////////////////////////////////////// +// PRIVAT + +// find application window +void McCadGUI_Messenger::GetApplication() +{ +#ifndef MCCAD_NONGUI + myApp = QMcCad_Application::GetAppMainWin(); +#endif + +/* if(myApp == NULL) + cout << "_#_McCadGUI_Messenger.cxx :: Application Window not found!!!\n";*/ +} + + +// submit message to QApplication +void McCadGUI_Messenger::Broadcast() +{ +#ifndef MCCAD_NONGUI + if(myApp == NULL) + myMsgType = McCadGUI_CoutMsg; + + if(myMsgType != McCadGUI_CoutMsg) + { + myApp->Mcout(myMessage.ToCString(), myMsgType); + } + else +#endif + cout << myMessage.ToCString() << endl; + + myMessage = ""; // flush message buffer +} diff --git a/src/MCCAD/McCadGUI/McCadGUI_ProgressDialog.cxx b/src/MCCAD/McCadGUI/McCadGUI_ProgressDialog.cxx new file mode 100644 index 0000000..d1ae2d4 --- /dev/null +++ b/src/MCCAD/McCadGUI/McCadGUI_ProgressDialog.cxx @@ -0,0 +1,66 @@ +#include +#include + +McCadGUI_ProgressDialog::McCadGUI_ProgressDialog(QWidget* theParent) +{ + if(theParent!=NULL) + { + myQProgress = new QProgressDialog(theParent); + myQProgress->setMinimum(0); + myQProgress->setMaximum(100); + myQProgress->setMinimumDuration(500); + myTotalSteps = 0; + myLableText = ""; + myCancelButtonText= "Cancel"; + } +} + +void McCadGUI_ProgressDialog::SetTotalSteps(const Standard_Integer theTotalSteps) +{ + myTotalSteps = theTotalSteps; +} + +void McCadGUI_ProgressDialog::SetProgress(const Standard_Integer theProgressPosition) +{ + if(theProgressPosition) + ; +} + +void McCadGUI_ProgressDialog::SetLabelText(const TCollection_AsciiString& theLabelText) +{ + myLableText = theLabelText; + if(myQProgress) + myQProgress->setLabelText(theLabelText.ToCString()); +} + +void McCadGUI_ProgressDialog::SetCancelButtonText(const TCollection_AsciiString& theCancelButtonText) +{ + myCancelButtonText = theCancelButtonText; +} + +void McCadGUI_ProgressDialog::Cancel() +{ + +} + +Standard_Boolean McCadGUI_ProgressDialog::Show(Standard_Boolean force) +{ + if(myQProgress != NULL) + { + Standard_Real aPc = GetPosition(); //always within [0,1] + int aVal = myQProgress->minimum() + aPc * (myQProgress->maximum() - myQProgress->minimum()); + myQProgress->setValue (aVal); + QApplication::processEvents(); //to let redraw and keep GUI responsive + return Standard_True; + } + return Standard_False; +} + +Standard_Boolean McCadGUI_ProgressDialog::UserBreak() +{ + if(myQProgress != NULL) + return myQProgress->wasCanceled(); + + return Standard_False; +} + diff --git a/src/MCCAD/McCadHeaders/CADProperties.h b/src/MCCAD/McCadHeaders/CADProperties.h new file mode 100644 index 0000000..10ff72f --- /dev/null +++ b/src/MCCAD/McCadHeaders/CADProperties.h @@ -0,0 +1,72 @@ +#ifndef MCCAD_CAD_PROPERTIES_H +#define MCCAD_CAD_PROPERTIES_H + +#include "ui_CADProperties.h" +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +class CADProperties : public QWidget +{ + Q_OBJECT + +public: + CADProperties(QWidget* theFather = NULL); + + QSlider* GetSlider(); + QToolButton* GetColorButton(); + //QToolButton* GetMaterialButton(); + QComboBox* GetMaterialCombo(); + QToolButton* GetViewSolidButton(); + QToolButton* GetViewWireFrameButton(); + QToolButton* GetBackgroundColorButton(); + QTreeWidget* GetTreeWidget(); + + void NewEditorAdded(const int theEditorID, const QString& theName); + //void AddAssembliesToTree(int theEditorID, const McCadMDReader_DataMapOfLabelAsciiString& theLabelNameMap); + void AddAssembliesToTree(int theEditorID, const Handle(TDocStd_Document) theTDoc ); + void EditorClosed(const int theEditorID); + void SetModelName(const int theEditorID, const QString& theName); + +signals: + void MaterialSelected(Graphic3d_NameOfMaterial); + + +private slots: + void ResetSlider(); + void SlotItemSelectionChanged(); + void SlotMaterialSelected(QString); + +private: + + void FillMaterialBox(); + Standard_Integer CountNumberOfColons(const TCollection_AsciiString theLabelString); + + Ui::CADProperties uiProps; + QSlider* myTransSlider; + QLCDNumber* myTransLCD; + QToolButton* myColorButton; + //QToolButton* myMaterialButton; + QComboBox* myMaterialCombo; + QToolButton* myViewSolidButton; + QToolButton* myViewWireFrameButton; + QToolButton* myBackgroundColorButton; + QTreeWidget* myTreeWidget; + QMap myEditorTreeMap; + QMap myQTWItemLabelMap; + QList myLabelList; +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfEditor.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfEditor.hxx new file mode 100644 index 0000000..5687e6e --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfEditor.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditor_HeaderFile +#define _Handle_McCadAEV_ListNodeOfListOfEditor_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadAEV_ListNodeOfListOfEditor; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditor); + +class Handle(McCadAEV_ListNodeOfListOfEditor) : public Handle(TCollection_MapNode) { + public: + Handle(McCadAEV_ListNodeOfListOfEditor)():Handle(TCollection_MapNode)() {} + Handle(McCadAEV_ListNodeOfListOfEditor)(const Handle(McCadAEV_ListNodeOfListOfEditor)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadAEV_ListNodeOfListOfEditor)(const McCadAEV_ListNodeOfListOfEditor* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadAEV_ListNodeOfListOfEditor)& operator=(const Handle(McCadAEV_ListNodeOfListOfEditor)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_ListNodeOfListOfEditor)& operator=(const McCadAEV_ListNodeOfListOfEditor* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_ListNodeOfListOfEditor* operator->() const + { + return (McCadAEV_ListNodeOfListOfEditor *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_ListNodeOfListOfEditor)(); + + Standard_EXPORT static const Handle(McCadAEV_ListNodeOfListOfEditor) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfEditorPtr.hxx new file mode 100644 index 0000000..f713041 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfEditorPtr.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#define _Handle_McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadAEV_ListNodeOfListOfEditorPtr; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_ListNodeOfListOfEditorPtr); + +class Handle(McCadAEV_ListNodeOfListOfEditorPtr) : public Handle(TCollection_MapNode) { + public: + Handle(McCadAEV_ListNodeOfListOfEditorPtr)():Handle(TCollection_MapNode)() {} + Handle(McCadAEV_ListNodeOfListOfEditorPtr)(const Handle(McCadAEV_ListNodeOfListOfEditorPtr)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadAEV_ListNodeOfListOfEditorPtr)(const McCadAEV_ListNodeOfListOfEditorPtr* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadAEV_ListNodeOfListOfEditorPtr)& operator=(const Handle(McCadAEV_ListNodeOfListOfEditorPtr)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_ListNodeOfListOfEditorPtr)& operator=(const McCadAEV_ListNodeOfListOfEditorPtr* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_ListNodeOfListOfEditorPtr* operator->() const + { + return (McCadAEV_ListNodeOfListOfEditorPtr *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_ListNodeOfListOfEditorPtr)(); + + Standard_EXPORT static const Handle(McCadAEV_ListNodeOfListOfEditorPtr) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfViewer.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfViewer.hxx new file mode 100644 index 0000000..1036654 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfViewer.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewer_HeaderFile +#define _Handle_McCadAEV_ListNodeOfListOfViewer_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadAEV_ListNodeOfListOfViewer; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewer); + +class Handle(McCadAEV_ListNodeOfListOfViewer) : public Handle(TCollection_MapNode) { + public: + Handle(McCadAEV_ListNodeOfListOfViewer)():Handle(TCollection_MapNode)() {} + Handle(McCadAEV_ListNodeOfListOfViewer)(const Handle(McCadAEV_ListNodeOfListOfViewer)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadAEV_ListNodeOfListOfViewer)(const McCadAEV_ListNodeOfListOfViewer* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadAEV_ListNodeOfListOfViewer)& operator=(const Handle(McCadAEV_ListNodeOfListOfViewer)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_ListNodeOfListOfViewer)& operator=(const McCadAEV_ListNodeOfListOfViewer* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_ListNodeOfListOfViewer* operator->() const + { + return (McCadAEV_ListNodeOfListOfViewer *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_ListNodeOfListOfViewer)(); + + Standard_EXPORT static const Handle(McCadAEV_ListNodeOfListOfViewer) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfViewerPtr.hxx new file mode 100644 index 0000000..5699bab --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_ListNodeOfListOfViewerPtr.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#define _Handle_McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadAEV_ListNodeOfListOfViewerPtr; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_ListNodeOfListOfViewerPtr); + +class Handle(McCadAEV_ListNodeOfListOfViewerPtr) : public Handle(TCollection_MapNode) { + public: + Handle(McCadAEV_ListNodeOfListOfViewerPtr)():Handle(TCollection_MapNode)() {} + Handle(McCadAEV_ListNodeOfListOfViewerPtr)(const Handle(McCadAEV_ListNodeOfListOfViewerPtr)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadAEV_ListNodeOfListOfViewerPtr)(const McCadAEV_ListNodeOfListOfViewerPtr* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadAEV_ListNodeOfListOfViewerPtr)& operator=(const Handle(McCadAEV_ListNodeOfListOfViewerPtr)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_ListNodeOfListOfViewerPtr)& operator=(const McCadAEV_ListNodeOfListOfViewerPtr* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_ListNodeOfListOfViewerPtr* operator->() const + { + return (McCadAEV_ListNodeOfListOfViewerPtr *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_ListNodeOfListOfViewerPtr)(); + + Standard_EXPORT static const Handle(McCadAEV_ListNodeOfListOfViewerPtr) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfEditor.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfEditor.hxx new file mode 100644 index 0000000..c6d47b3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfEditor.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile +#define _Handle_McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadAEV_SequenceNodeOfSequenceOfEditor; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditor); + +class Handle(McCadAEV_SequenceNodeOfSequenceOfEditor) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)():Handle(TCollection_SeqNode)() {} + Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)(const Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)(const McCadAEV_SequenceNodeOfSequenceOfEditor* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)& operator=(const Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)& operator=(const McCadAEV_SequenceNodeOfSequenceOfEditor* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_SequenceNodeOfSequenceOfEditor* operator->() const + { + return (McCadAEV_SequenceNodeOfSequenceOfEditor *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_SequenceNodeOfSequenceOfEditor)(); + + Standard_EXPORT static const Handle(McCadAEV_SequenceNodeOfSequenceOfEditor) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr.hxx new file mode 100644 index 0000000..2fc2105 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile +#define _Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadAEV_SequenceNodeOfSequenceOfEditorPtr; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfEditorPtr); + +class Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)():Handle(TCollection_SeqNode)() {} + Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)(const Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)(const McCadAEV_SequenceNodeOfSequenceOfEditorPtr* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)& operator=(const Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)& operator=(const McCadAEV_SequenceNodeOfSequenceOfEditorPtr* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_SequenceNodeOfSequenceOfEditorPtr* operator->() const + { + return (McCadAEV_SequenceNodeOfSequenceOfEditorPtr *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr)(); + + Standard_EXPORT static const Handle(McCadAEV_SequenceNodeOfSequenceOfEditorPtr) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfViewer.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfViewer.hxx new file mode 100644 index 0000000..843250b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfViewer.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile +#define _Handle_McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadAEV_SequenceNodeOfSequenceOfViewer; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewer); + +class Handle(McCadAEV_SequenceNodeOfSequenceOfViewer) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)():Handle(TCollection_SeqNode)() {} + Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)(const Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)(const McCadAEV_SequenceNodeOfSequenceOfViewer* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)& operator=(const Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)& operator=(const McCadAEV_SequenceNodeOfSequenceOfViewer* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_SequenceNodeOfSequenceOfViewer* operator->() const + { + return (McCadAEV_SequenceNodeOfSequenceOfViewer *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_SequenceNodeOfSequenceOfViewer)(); + + Standard_EXPORT static const Handle(McCadAEV_SequenceNodeOfSequenceOfViewer) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr.hxx new file mode 100644 index 0000000..413d36c --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile +#define _Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadAEV_SequenceNodeOfSequenceOfViewerPtr; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadAEV_SequenceNodeOfSequenceOfViewerPtr); + +class Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)():Handle(TCollection_SeqNode)() {} + Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)(const Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)(const McCadAEV_SequenceNodeOfSequenceOfViewerPtr* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)& operator=(const Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)& operator=(const McCadAEV_SequenceNodeOfSequenceOfViewerPtr* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadAEV_SequenceNodeOfSequenceOfViewerPtr* operator->() const + { + return (McCadAEV_SequenceNodeOfSequenceOfViewerPtr *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr)(); + + Standard_EXPORT static const Handle(McCadAEV_SequenceNodeOfSequenceOfViewerPtr) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGBuild_HSequenceOfSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGBuild_HSequenceOfSolid.hxx new file mode 100644 index 0000000..1286672 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGBuild_HSequenceOfSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGBuild_HSequenceOfSolid_HeaderFile +#define _Handle_McCadCSGBuild_HSequenceOfSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGBuild_HSequenceOfSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGBuild_HSequenceOfSolid); + +class Handle(McCadCSGBuild_HSequenceOfSolid) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGBuild_HSequenceOfSolid)():Handle(MMgt_TShared)() {} + Handle(McCadCSGBuild_HSequenceOfSolid)(const Handle(McCadCSGBuild_HSequenceOfSolid)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGBuild_HSequenceOfSolid)(const McCadCSGBuild_HSequenceOfSolid* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGBuild_HSequenceOfSolid)& operator=(const Handle(McCadCSGBuild_HSequenceOfSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGBuild_HSequenceOfSolid)& operator=(const McCadCSGBuild_HSequenceOfSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGBuild_HSequenceOfSolid* operator->() const + { + return (McCadCSGBuild_HSequenceOfSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGBuild_HSequenceOfSolid)(); + + Standard_EXPORT static const Handle(McCadCSGBuild_HSequenceOfSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid.hxx new file mode 100644 index 0000000..00d250f --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid_HeaderFile +#define _Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCSGBuild_SequenceNodeOfSequenceOfSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGBuild_SequenceNodeOfSequenceOfSolid); + +class Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)():Handle(TCollection_SeqNode)() {} + Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)(const Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)(const McCadCSGBuild_SequenceNodeOfSequenceOfSolid* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)& operator=(const Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)& operator=(const McCadCSGBuild_SequenceNodeOfSequenceOfSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGBuild_SequenceNodeOfSequenceOfSolid* operator->() const + { + return (McCadCSGBuild_SequenceNodeOfSequenceOfSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid)(); + + Standard_EXPORT static const Handle(McCadCSGBuild_SequenceNodeOfSequenceOfSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cell.hxx new file mode 100644 index 0000000..f190f97 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#define _Handle_McCadCSGGeom_Cell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGGeom_Cell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Cell); + +class Handle(McCadCSGGeom_Cell) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGGeom_Cell)():Handle(MMgt_TShared)() {} + Handle(McCadCSGGeom_Cell)(const Handle(McCadCSGGeom_Cell)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGGeom_Cell)(const McCadCSGGeom_Cell* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGGeom_Cell)& operator=(const Handle(McCadCSGGeom_Cell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Cell)& operator=(const McCadCSGGeom_Cell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Cell* operator->() const + { + return (McCadCSGGeom_Cell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Cell)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Cell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cone.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cone.hxx new file mode 100644 index 0000000..99243f2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cone.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Cone_HeaderFile +#define _Handle_McCadCSGGeom_Cone_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_Cone; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Cone); + +class Handle(McCadCSGGeom_Cone) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_Cone)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_Cone)(const Handle(McCadCSGGeom_Cone)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_Cone)(const McCadCSGGeom_Cone* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_Cone)& operator=(const Handle(McCadCSGGeom_Cone)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Cone)& operator=(const McCadCSGGeom_Cone* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Cone* operator->() const + { + return (McCadCSGGeom_Cone *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Cone)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Cone) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cylinder.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cylinder.hxx new file mode 100644 index 0000000..318a433 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Cylinder.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Cylinder_HeaderFile +#define _Handle_McCadCSGGeom_Cylinder_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_Cylinder; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Cylinder); + +class Handle(McCadCSGGeom_Cylinder) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_Cylinder)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_Cylinder)(const Handle(McCadCSGGeom_Cylinder)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_Cylinder)(const McCadCSGGeom_Cylinder* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_Cylinder)& operator=(const Handle(McCadCSGGeom_Cylinder)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Cylinder)& operator=(const McCadCSGGeom_Cylinder* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Cylinder* operator->() const + { + return (McCadCSGGeom_Cylinder *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Cylinder)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Cylinder) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell.hxx new file mode 100644 index 0000000..24d00c7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#define _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell); + +class Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)():Handle(TCollection_MapNode)() {} + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)(const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)(const McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)& operator=(const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)& operator=(const McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell* operator->() const + { + return (McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface.hxx new file mode 100644 index 0000000..1529c36 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#define _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface); + +class Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)():Handle(TCollection_MapNode)() {} + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)(const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)(const McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)& operator=(const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)& operator=(const McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface* operator->() const + { + return (McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation.hxx new file mode 100644 index 0000000..4b8c045 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#define _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation); + +class Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)():Handle(TCollection_MapNode)() {} + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)(const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)(const McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)& operator=(const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)& operator=(const McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation* operator->() const + { + return (McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_GQ.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_GQ.hxx new file mode 100644 index 0000000..3ca5a64 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_GQ.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_GQ_HeaderFile +#define _Handle_McCadCSGGeom_GQ_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_GQ; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_GQ); + +class Handle(McCadCSGGeom_GQ) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_GQ)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_GQ)(const Handle(McCadCSGGeom_GQ)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_GQ)(const McCadCSGGeom_GQ* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_GQ)& operator=(const Handle(McCadCSGGeom_GQ)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_GQ)& operator=(const McCadCSGGeom_GQ* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_GQ* operator->() const + { + return (McCadCSGGeom_GQ *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_GQ)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_GQ) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfCell.hxx new file mode 100644 index 0000000..fb1a7c9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfCell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_HSequenceOfCell_HeaderFile +#define _Handle_McCadCSGGeom_HSequenceOfCell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGGeom_HSequenceOfCell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_HSequenceOfCell); + +class Handle(McCadCSGGeom_HSequenceOfCell) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGGeom_HSequenceOfCell)():Handle(MMgt_TShared)() {} + Handle(McCadCSGGeom_HSequenceOfCell)(const Handle(McCadCSGGeom_HSequenceOfCell)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGGeom_HSequenceOfCell)(const McCadCSGGeom_HSequenceOfCell* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGGeom_HSequenceOfCell)& operator=(const Handle(McCadCSGGeom_HSequenceOfCell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_HSequenceOfCell)& operator=(const McCadCSGGeom_HSequenceOfCell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_HSequenceOfCell* operator->() const + { + return (McCadCSGGeom_HSequenceOfCell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_HSequenceOfCell)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_HSequenceOfCell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfSurface.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfSurface.hxx new file mode 100644 index 0000000..194bbce --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfSurface.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_HSequenceOfSurface_HeaderFile +#define _Handle_McCadCSGGeom_HSequenceOfSurface_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGGeom_HSequenceOfSurface; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_HSequenceOfSurface); + +class Handle(McCadCSGGeom_HSequenceOfSurface) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGGeom_HSequenceOfSurface)():Handle(MMgt_TShared)() {} + Handle(McCadCSGGeom_HSequenceOfSurface)(const Handle(McCadCSGGeom_HSequenceOfSurface)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGGeom_HSequenceOfSurface)(const McCadCSGGeom_HSequenceOfSurface* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGGeom_HSequenceOfSurface)& operator=(const Handle(McCadCSGGeom_HSequenceOfSurface)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_HSequenceOfSurface)& operator=(const McCadCSGGeom_HSequenceOfSurface* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_HSequenceOfSurface* operator->() const + { + return (McCadCSGGeom_HSequenceOfSurface *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_HSequenceOfSurface)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_HSequenceOfSurface) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfTransformation.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfTransformation.hxx new file mode 100644 index 0000000..54b618a --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_HSequenceOfTransformation.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_HSequenceOfTransformation_HeaderFile +#define _Handle_McCadCSGGeom_HSequenceOfTransformation_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGGeom_HSequenceOfTransformation; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_HSequenceOfTransformation); + +class Handle(McCadCSGGeom_HSequenceOfTransformation) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGGeom_HSequenceOfTransformation)():Handle(MMgt_TShared)() {} + Handle(McCadCSGGeom_HSequenceOfTransformation)(const Handle(McCadCSGGeom_HSequenceOfTransformation)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGGeom_HSequenceOfTransformation)(const McCadCSGGeom_HSequenceOfTransformation* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGGeom_HSequenceOfTransformation)& operator=(const Handle(McCadCSGGeom_HSequenceOfTransformation)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_HSequenceOfTransformation)& operator=(const McCadCSGGeom_HSequenceOfTransformation* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_HSequenceOfTransformation* operator->() const + { + return (McCadCSGGeom_HSequenceOfTransformation *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_HSequenceOfTransformation)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_HSequenceOfTransformation) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Plane.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Plane.hxx new file mode 100644 index 0000000..90c017d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Plane.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Plane_HeaderFile +#define _Handle_McCadCSGGeom_Plane_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_Plane; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Plane); + +class Handle(McCadCSGGeom_Plane) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_Plane)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_Plane)(const Handle(McCadCSGGeom_Plane)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_Plane)(const McCadCSGGeom_Plane* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_Plane)& operator=(const Handle(McCadCSGGeom_Plane)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Plane)& operator=(const McCadCSGGeom_Plane* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Plane* operator->() const + { + return (McCadCSGGeom_Plane *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Plane)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Plane) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell.hxx new file mode 100644 index 0000000..60b9539 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile +#define _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCSGGeom_SequenceNodeOfSequenceOfCell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfCell); + +class Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)():Handle(TCollection_SeqNode)() {} + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)(const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)(const McCadCSGGeom_SequenceNodeOfSequenceOfCell* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)& operator=(const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)& operator=(const McCadCSGGeom_SequenceNodeOfSequenceOfCell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_SequenceNodeOfSequenceOfCell* operator->() const + { + return (McCadCSGGeom_SequenceNodeOfSequenceOfCell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfCell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface.hxx new file mode 100644 index 0000000..3c973da --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile +#define _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCSGGeom_SequenceNodeOfSequenceOfSurface; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfSurface); + +class Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)():Handle(TCollection_SeqNode)() {} + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)(const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)(const McCadCSGGeom_SequenceNodeOfSequenceOfSurface* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)& operator=(const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)& operator=(const McCadCSGGeom_SequenceNodeOfSequenceOfSurface* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_SequenceNodeOfSequenceOfSurface* operator->() const + { + return (McCadCSGGeom_SequenceNodeOfSequenceOfSurface *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfSurface) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation.hxx new file mode 100644 index 0000000..328b91d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile +#define _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCSGGeom_SequenceNodeOfSequenceOfTransformation; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation); + +class Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)():Handle(TCollection_SeqNode)() {} + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)(const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)(const McCadCSGGeom_SequenceNodeOfSequenceOfTransformation* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)& operator=(const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)& operator=(const McCadCSGGeom_SequenceNodeOfSequenceOfTransformation* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_SequenceNodeOfSequenceOfTransformation* operator->() const + { + return (McCadCSGGeom_SequenceNodeOfSequenceOfTransformation *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_SequenceNodeOfSequenceOfTransformation) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Sphere.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Sphere.hxx new file mode 100644 index 0000000..f3e22da --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Sphere.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Sphere_HeaderFile +#define _Handle_McCadCSGGeom_Sphere_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_Sphere; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Sphere); + +class Handle(McCadCSGGeom_Sphere) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_Sphere)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_Sphere)(const Handle(McCadCSGGeom_Sphere)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_Sphere)(const McCadCSGGeom_Sphere* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_Sphere)& operator=(const Handle(McCadCSGGeom_Sphere)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Sphere)& operator=(const McCadCSGGeom_Sphere* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Sphere* operator->() const + { + return (McCadCSGGeom_Sphere *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Sphere)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Sphere) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Surface.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Surface.hxx new file mode 100644 index 0000000..728925a --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Surface.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#define _Handle_McCadCSGGeom_Surface_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGGeom_Surface; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Surface); + +class Handle(McCadCSGGeom_Surface) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGGeom_Surface)():Handle(MMgt_TShared)() {} + Handle(McCadCSGGeom_Surface)(const Handle(McCadCSGGeom_Surface)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGGeom_Surface)(const McCadCSGGeom_Surface* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGGeom_Surface)& operator=(const Handle(McCadCSGGeom_Surface)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Surface)& operator=(const McCadCSGGeom_Surface* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Surface* operator->() const + { + return (McCadCSGGeom_Surface *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Surface)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Surface) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SurfaceOfRevolution.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SurfaceOfRevolution.hxx new file mode 100644 index 0000000..632d23f --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_SurfaceOfRevolution.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_SurfaceOfRevolution_HeaderFile +#define _Handle_McCadCSGGeom_SurfaceOfRevolution_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_SurfaceOfRevolution; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_SurfaceOfRevolution); + +class Handle(McCadCSGGeom_SurfaceOfRevolution) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_SurfaceOfRevolution)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_SurfaceOfRevolution)(const Handle(McCadCSGGeom_SurfaceOfRevolution)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_SurfaceOfRevolution)(const McCadCSGGeom_SurfaceOfRevolution* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_SurfaceOfRevolution)& operator=(const Handle(McCadCSGGeom_SurfaceOfRevolution)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_SurfaceOfRevolution)& operator=(const McCadCSGGeom_SurfaceOfRevolution* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_SurfaceOfRevolution* operator->() const + { + return (McCadCSGGeom_SurfaceOfRevolution *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_SurfaceOfRevolution)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_SurfaceOfRevolution) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Torus.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Torus.hxx new file mode 100644 index 0000000..7033dc3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Torus.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Torus_HeaderFile +#define _Handle_McCadCSGGeom_Torus_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Surface); +class McCadCSGGeom_Torus; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Torus); + +class Handle(McCadCSGGeom_Torus) : public Handle(McCadCSGGeom_Surface) { + public: + Handle(McCadCSGGeom_Torus)():Handle(McCadCSGGeom_Surface)() {} + Handle(McCadCSGGeom_Torus)(const Handle(McCadCSGGeom_Torus)& aHandle) : Handle(McCadCSGGeom_Surface)(aHandle) + { + } + + Handle(McCadCSGGeom_Torus)(const McCadCSGGeom_Torus* anItem) : Handle(McCadCSGGeom_Surface)((McCadCSGGeom_Surface *)anItem) + { + } + + Handle(McCadCSGGeom_Torus)& operator=(const Handle(McCadCSGGeom_Torus)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Torus)& operator=(const McCadCSGGeom_Torus* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Torus* operator->() const + { + return (McCadCSGGeom_Torus *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Torus)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Torus) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Transformation.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Transformation.hxx new file mode 100644 index 0000000..0cd9ae9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCSGGeom_Transformation.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#define _Handle_McCadCSGGeom_Transformation_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCSGGeom_Transformation; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCSGGeom_Transformation); + +class Handle(McCadCSGGeom_Transformation) : public Handle(MMgt_TShared) { + public: + Handle(McCadCSGGeom_Transformation)():Handle(MMgt_TShared)() {} + Handle(McCadCSGGeom_Transformation)(const Handle(McCadCSGGeom_Transformation)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCSGGeom_Transformation)(const McCadCSGGeom_Transformation* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCSGGeom_Transformation)& operator=(const Handle(McCadCSGGeom_Transformation)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCSGGeom_Transformation)& operator=(const McCadCSGGeom_Transformation* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCSGGeom_Transformation* operator->() const + { + return (McCadCSGGeom_Transformation *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCSGGeom_Transformation)(); + + Standard_EXPORT static const Handle(McCadCSGGeom_Transformation) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_CasDocument.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_CasDocument.hxx new file mode 100644 index 0000000..8e4e6d5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_CasDocument.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#define _Handle_McCadCom_CasDocument_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCom_Document); +class McCadCom_CasDocument; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_CasDocument); + +class Handle(McCadCom_CasDocument) : public Handle(McCadCom_Document) { + public: + Handle(McCadCom_CasDocument)():Handle(McCadCom_Document)() {} + Handle(McCadCom_CasDocument)(const Handle(McCadCom_CasDocument)& aHandle) : Handle(McCadCom_Document)(aHandle) + { + } + + Handle(McCadCom_CasDocument)(const McCadCom_CasDocument* anItem) : Handle(McCadCom_Document)((McCadCom_Document *)anItem) + { + } + + Handle(McCadCom_CasDocument)& operator=(const Handle(McCadCom_CasDocument)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_CasDocument)& operator=(const McCadCom_CasDocument* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_CasDocument* operator->() const + { + return (McCadCom_CasDocument *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_CasDocument)(); + + Standard_EXPORT static const Handle(McCadCom_CasDocument) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_CasView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_CasView.hxx new file mode 100644 index 0000000..5f263b2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_CasView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_CasView_HeaderFile +#define _Handle_McCadCom_CasView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCom_View); +class McCadCom_CasView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_CasView); + +class Handle(McCadCom_CasView) : public Handle(McCadCom_View) { + public: + Handle(McCadCom_CasView)():Handle(McCadCom_View)() {} + Handle(McCadCom_CasView)(const Handle(McCadCom_CasView)& aHandle) : Handle(McCadCom_View)(aHandle) + { + } + + Handle(McCadCom_CasView)(const McCadCom_CasView* anItem) : Handle(McCadCom_View)((McCadCom_View *)anItem) + { + } + + Handle(McCadCom_CasView)& operator=(const Handle(McCadCom_CasView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_CasView)& operator=(const McCadCom_CasView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_CasView* operator->() const + { + return (McCadCom_CasView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_CasView)(); + + Standard_EXPORT static const Handle(McCadCom_CasView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView.hxx new file mode 100644 index 0000000..ec166d9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#define _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView); + +class Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)(const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)(const McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)& operator=(const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)& operator=(const McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView* operator->() const + { + return (McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView)(); + + Standard_EXPORT static const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument.hxx new file mode 100644 index 0000000..9c25016 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#define _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument); + +class Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)(const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)(const McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)& operator=(const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)& operator=(const McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument* operator->() const + { + return (McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument)(); + + Standard_EXPORT static const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView.hxx new file mode 100644 index 0000000..f352fe6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#define _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_DataMapNodeOfDataMapofIntegerListOfView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_DataMapNodeOfDataMapofIntegerListOfView); + +class Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)(const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)(const McCadCom_DataMapNodeOfDataMapofIntegerListOfView* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)& operator=(const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)& operator=(const McCadCom_DataMapNodeOfDataMapofIntegerListOfView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_DataMapNodeOfDataMapofIntegerListOfView* operator->() const + { + return (McCadCom_DataMapNodeOfDataMapofIntegerListOfView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView)(); + + Standard_EXPORT static const Handle(McCadCom_DataMapNodeOfDataMapofIntegerListOfView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_Document.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_Document.hxx new file mode 100644 index 0000000..27b6233 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_Document.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_Document_HeaderFile +#define _Handle_McCadCom_Document_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCom_Document; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_Document); + +class Handle(McCadCom_Document) : public Handle(MMgt_TShared) { + public: + Handle(McCadCom_Document)():Handle(MMgt_TShared)() {} + Handle(McCadCom_Document)(const Handle(McCadCom_Document)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCom_Document)(const McCadCom_Document* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCom_Document)& operator=(const Handle(McCadCom_Document)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_Document)& operator=(const McCadCom_Document* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_Document* operator->() const + { + return (McCadCom_Document *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_Document)(); + + Standard_EXPORT static const Handle(McCadCom_Document) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfCasView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfCasView.hxx new file mode 100644 index 0000000..9782503 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfCasView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_ListNodeOfListOfCasView_HeaderFile +#define _Handle_McCadCom_ListNodeOfListOfCasView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_ListNodeOfListOfCasView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_ListNodeOfListOfCasView); + +class Handle(McCadCom_ListNodeOfListOfCasView) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_ListNodeOfListOfCasView)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_ListNodeOfListOfCasView)(const Handle(McCadCom_ListNodeOfListOfCasView)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_ListNodeOfListOfCasView)(const McCadCom_ListNodeOfListOfCasView* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_ListNodeOfListOfCasView)& operator=(const Handle(McCadCom_ListNodeOfListOfCasView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_ListNodeOfListOfCasView)& operator=(const McCadCom_ListNodeOfListOfCasView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_ListNodeOfListOfCasView* operator->() const + { + return (McCadCom_ListNodeOfListOfCasView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_ListNodeOfListOfCasView)(); + + Standard_EXPORT static const Handle(McCadCom_ListNodeOfListOfCasView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfDocument.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfDocument.hxx new file mode 100644 index 0000000..2171bfa --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfDocument.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_ListNodeOfListOfDocument_HeaderFile +#define _Handle_McCadCom_ListNodeOfListOfDocument_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_ListNodeOfListOfDocument; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_ListNodeOfListOfDocument); + +class Handle(McCadCom_ListNodeOfListOfDocument) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_ListNodeOfListOfDocument)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_ListNodeOfListOfDocument)(const Handle(McCadCom_ListNodeOfListOfDocument)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_ListNodeOfListOfDocument)(const McCadCom_ListNodeOfListOfDocument* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_ListNodeOfListOfDocument)& operator=(const Handle(McCadCom_ListNodeOfListOfDocument)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_ListNodeOfListOfDocument)& operator=(const McCadCom_ListNodeOfListOfDocument* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_ListNodeOfListOfDocument* operator->() const + { + return (McCadCom_ListNodeOfListOfDocument *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_ListNodeOfListOfDocument)(); + + Standard_EXPORT static const Handle(McCadCom_ListNodeOfListOfDocument) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfView.hxx new file mode 100644 index 0000000..8fbcdde --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_ListNodeOfListOfView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_ListNodeOfListOfView_HeaderFile +#define _Handle_McCadCom_ListNodeOfListOfView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_ListNodeOfListOfView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_ListNodeOfListOfView); + +class Handle(McCadCom_ListNodeOfListOfView) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_ListNodeOfListOfView)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_ListNodeOfListOfView)(const Handle(McCadCom_ListNodeOfListOfView)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_ListNodeOfListOfView)(const McCadCom_ListNodeOfListOfView* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_ListNodeOfListOfView)& operator=(const Handle(McCadCom_ListNodeOfListOfView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_ListNodeOfListOfView)& operator=(const McCadCom_ListNodeOfListOfView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_ListNodeOfListOfView* operator->() const + { + return (McCadCom_ListNodeOfListOfView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_ListNodeOfListOfView)(); + + Standard_EXPORT static const Handle(McCadCom_ListNodeOfListOfView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfCasView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfCasView.hxx new file mode 100644 index 0000000..eeb2414 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfCasView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile +#define _Handle_McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCom_SequenceNodeOfSequenceOfCasView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfCasView); + +class Handle(McCadCom_SequenceNodeOfSequenceOfCasView) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCom_SequenceNodeOfSequenceOfCasView)():Handle(TCollection_SeqNode)() {} + Handle(McCadCom_SequenceNodeOfSequenceOfCasView)(const Handle(McCadCom_SequenceNodeOfSequenceOfCasView)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCom_SequenceNodeOfSequenceOfCasView)(const McCadCom_SequenceNodeOfSequenceOfCasView* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCom_SequenceNodeOfSequenceOfCasView)& operator=(const Handle(McCadCom_SequenceNodeOfSequenceOfCasView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_SequenceNodeOfSequenceOfCasView)& operator=(const McCadCom_SequenceNodeOfSequenceOfCasView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_SequenceNodeOfSequenceOfCasView* operator->() const + { + return (McCadCom_SequenceNodeOfSequenceOfCasView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_SequenceNodeOfSequenceOfCasView)(); + + Standard_EXPORT static const Handle(McCadCom_SequenceNodeOfSequenceOfCasView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfDocument.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfDocument.hxx new file mode 100644 index 0000000..9f84412 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfDocument.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile +#define _Handle_McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCom_SequenceNodeOfSequenceOfDocument; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfDocument); + +class Handle(McCadCom_SequenceNodeOfSequenceOfDocument) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCom_SequenceNodeOfSequenceOfDocument)():Handle(TCollection_SeqNode)() {} + Handle(McCadCom_SequenceNodeOfSequenceOfDocument)(const Handle(McCadCom_SequenceNodeOfSequenceOfDocument)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCom_SequenceNodeOfSequenceOfDocument)(const McCadCom_SequenceNodeOfSequenceOfDocument* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCom_SequenceNodeOfSequenceOfDocument)& operator=(const Handle(McCadCom_SequenceNodeOfSequenceOfDocument)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_SequenceNodeOfSequenceOfDocument)& operator=(const McCadCom_SequenceNodeOfSequenceOfDocument* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_SequenceNodeOfSequenceOfDocument* operator->() const + { + return (McCadCom_SequenceNodeOfSequenceOfDocument *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_SequenceNodeOfSequenceOfDocument)(); + + Standard_EXPORT static const Handle(McCadCom_SequenceNodeOfSequenceOfDocument) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfView.hxx new file mode 100644 index 0000000..d6ffe54 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_SequenceNodeOfSequenceOfView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfView_HeaderFile +#define _Handle_McCadCom_SequenceNodeOfSequenceOfView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadCom_SequenceNodeOfSequenceOfView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_SequenceNodeOfSequenceOfView); + +class Handle(McCadCom_SequenceNodeOfSequenceOfView) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadCom_SequenceNodeOfSequenceOfView)():Handle(TCollection_SeqNode)() {} + Handle(McCadCom_SequenceNodeOfSequenceOfView)(const Handle(McCadCom_SequenceNodeOfSequenceOfView)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadCom_SequenceNodeOfSequenceOfView)(const McCadCom_SequenceNodeOfSequenceOfView* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadCom_SequenceNodeOfSequenceOfView)& operator=(const Handle(McCadCom_SequenceNodeOfSequenceOfView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_SequenceNodeOfSequenceOfView)& operator=(const McCadCom_SequenceNodeOfSequenceOfView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_SequenceNodeOfSequenceOfView* operator->() const + { + return (McCadCom_SequenceNodeOfSequenceOfView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_SequenceNodeOfSequenceOfView)(); + + Standard_EXPORT static const Handle(McCadCom_SequenceNodeOfSequenceOfView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfCasView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfCasView.hxx new file mode 100644 index 0000000..add38d4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfCasView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#define _Handle_McCadCom_StdMapNodeOfMapOfCasView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_StdMapNodeOfMapOfCasView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfCasView); + +class Handle(McCadCom_StdMapNodeOfMapOfCasView) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_StdMapNodeOfMapOfCasView)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_StdMapNodeOfMapOfCasView)(const Handle(McCadCom_StdMapNodeOfMapOfCasView)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_StdMapNodeOfMapOfCasView)(const McCadCom_StdMapNodeOfMapOfCasView* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_StdMapNodeOfMapOfCasView)& operator=(const Handle(McCadCom_StdMapNodeOfMapOfCasView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_StdMapNodeOfMapOfCasView)& operator=(const McCadCom_StdMapNodeOfMapOfCasView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_StdMapNodeOfMapOfCasView* operator->() const + { + return (McCadCom_StdMapNodeOfMapOfCasView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_StdMapNodeOfMapOfCasView)(); + + Standard_EXPORT static const Handle(McCadCom_StdMapNodeOfMapOfCasView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfDocument.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfDocument.hxx new file mode 100644 index 0000000..bded6e9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfDocument.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#define _Handle_McCadCom_StdMapNodeOfMapOfDocument_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_StdMapNodeOfMapOfDocument; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfDocument); + +class Handle(McCadCom_StdMapNodeOfMapOfDocument) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_StdMapNodeOfMapOfDocument)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_StdMapNodeOfMapOfDocument)(const Handle(McCadCom_StdMapNodeOfMapOfDocument)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_StdMapNodeOfMapOfDocument)(const McCadCom_StdMapNodeOfMapOfDocument* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_StdMapNodeOfMapOfDocument)& operator=(const Handle(McCadCom_StdMapNodeOfMapOfDocument)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_StdMapNodeOfMapOfDocument)& operator=(const McCadCom_StdMapNodeOfMapOfDocument* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_StdMapNodeOfMapOfDocument* operator->() const + { + return (McCadCom_StdMapNodeOfMapOfDocument *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_StdMapNodeOfMapOfDocument)(); + + Standard_EXPORT static const Handle(McCadCom_StdMapNodeOfMapOfDocument) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfView.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfView.hxx new file mode 100644 index 0000000..591e2a8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_StdMapNodeOfMapOfView.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfView_HeaderFile +#define _Handle_McCadCom_StdMapNodeOfMapOfView_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadCom_StdMapNodeOfMapOfView; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_StdMapNodeOfMapOfView); + +class Handle(McCadCom_StdMapNodeOfMapOfView) : public Handle(TCollection_MapNode) { + public: + Handle(McCadCom_StdMapNodeOfMapOfView)():Handle(TCollection_MapNode)() {} + Handle(McCadCom_StdMapNodeOfMapOfView)(const Handle(McCadCom_StdMapNodeOfMapOfView)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadCom_StdMapNodeOfMapOfView)(const McCadCom_StdMapNodeOfMapOfView* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadCom_StdMapNodeOfMapOfView)& operator=(const Handle(McCadCom_StdMapNodeOfMapOfView)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_StdMapNodeOfMapOfView)& operator=(const McCadCom_StdMapNodeOfMapOfView* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_StdMapNodeOfMapOfView* operator->() const + { + return (McCadCom_StdMapNodeOfMapOfView *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_StdMapNodeOfMapOfView)(); + + Standard_EXPORT static const Handle(McCadCom_StdMapNodeOfMapOfView) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadCom_View.hxx b/src/MCCAD/McCadHeaders/Handle_McCadCom_View.hxx new file mode 100644 index 0000000..804477d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadCom_View.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadCom_View_HeaderFile +#define _Handle_McCadCom_View_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadCom_View; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadCom_View); + +class Handle(McCadCom_View) : public Handle(MMgt_TShared) { + public: + Handle(McCadCom_View)():Handle(MMgt_TShared)() {} + Handle(McCadCom_View)(const Handle(McCadCom_View)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadCom_View)(const McCadCom_View* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadCom_View)& operator=(const Handle(McCadCom_View)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadCom_View)& operator=(const McCadCom_View* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadCom_View* operator->() const + { + return (McCadCom_View *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadCom_View)(); + + Standard_EXPORT static const Handle(McCadCom_View) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfDiscFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfDiscFace.hxx new file mode 100644 index 0000000..71ece02 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfDiscFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#define _Handle_McCadDiscDs_HSequenceOfDiscFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadDiscDs_HSequenceOfDiscFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscFace); + +class Handle(McCadDiscDs_HSequenceOfDiscFace) : public Handle(MMgt_TShared) { + public: + Handle(McCadDiscDs_HSequenceOfDiscFace)():Handle(MMgt_TShared)() {} + Handle(McCadDiscDs_HSequenceOfDiscFace)(const Handle(McCadDiscDs_HSequenceOfDiscFace)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadDiscDs_HSequenceOfDiscFace)(const McCadDiscDs_HSequenceOfDiscFace* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadDiscDs_HSequenceOfDiscFace)& operator=(const Handle(McCadDiscDs_HSequenceOfDiscFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_HSequenceOfDiscFace)& operator=(const McCadDiscDs_HSequenceOfDiscFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_HSequenceOfDiscFace* operator->() const + { + return (McCadDiscDs_HSequenceOfDiscFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_HSequenceOfDiscFace)(); + + Standard_EXPORT static const Handle(McCadDiscDs_HSequenceOfDiscFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfDiscSolid.hxx new file mode 100644 index 0000000..4b0c688 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfDiscSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#define _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadDiscDs_HSequenceOfDiscSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_HSequenceOfDiscSolid); + +class Handle(McCadDiscDs_HSequenceOfDiscSolid) : public Handle(MMgt_TShared) { + public: + Handle(McCadDiscDs_HSequenceOfDiscSolid)():Handle(MMgt_TShared)() {} + Handle(McCadDiscDs_HSequenceOfDiscSolid)(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadDiscDs_HSequenceOfDiscSolid)(const McCadDiscDs_HSequenceOfDiscSolid* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadDiscDs_HSequenceOfDiscSolid)& operator=(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_HSequenceOfDiscSolid)& operator=(const McCadDiscDs_HSequenceOfDiscSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_HSequenceOfDiscSolid* operator->() const + { + return (McCadDiscDs_HSequenceOfDiscSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_HSequenceOfDiscSolid)(); + + Standard_EXPORT static const Handle(McCadDiscDs_HSequenceOfDiscSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid.hxx new file mode 100644 index 0000000..3122588 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid_HeaderFile +#define _Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadDiscDs_HSequenceOfHSeqOfDiscSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_HSequenceOfHSeqOfDiscSolid); + +class Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid) : public Handle(MMgt_TShared) { + public: + Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)():Handle(MMgt_TShared)() {} + Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)(const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)(const McCadDiscDs_HSequenceOfHSeqOfDiscSolid* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& operator=(const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& operator=(const McCadDiscDs_HSequenceOfHSeqOfDiscSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_HSequenceOfHSeqOfDiscSolid* operator->() const + { + return (McCadDiscDs_HSequenceOfHSeqOfDiscSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)(); + + Standard_EXPORT static const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_ListNodeOfListOfDiscFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_ListNodeOfListOfDiscFace.hxx new file mode 100644 index 0000000..7b5924d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_ListNodeOfListOfDiscFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#define _Handle_McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadDiscDs_ListNodeOfListOfDiscFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscFace); + +class Handle(McCadDiscDs_ListNodeOfListOfDiscFace) : public Handle(TCollection_MapNode) { + public: + Handle(McCadDiscDs_ListNodeOfListOfDiscFace)():Handle(TCollection_MapNode)() {} + Handle(McCadDiscDs_ListNodeOfListOfDiscFace)(const Handle(McCadDiscDs_ListNodeOfListOfDiscFace)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadDiscDs_ListNodeOfListOfDiscFace)(const McCadDiscDs_ListNodeOfListOfDiscFace* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadDiscDs_ListNodeOfListOfDiscFace)& operator=(const Handle(McCadDiscDs_ListNodeOfListOfDiscFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_ListNodeOfListOfDiscFace)& operator=(const McCadDiscDs_ListNodeOfListOfDiscFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_ListNodeOfListOfDiscFace* operator->() const + { + return (McCadDiscDs_ListNodeOfListOfDiscFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_ListNodeOfListOfDiscFace)(); + + Standard_EXPORT static const Handle(McCadDiscDs_ListNodeOfListOfDiscFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_ListNodeOfListOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_ListNodeOfListOfDiscSolid.hxx new file mode 100644 index 0000000..03bc450 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_ListNodeOfListOfDiscSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#define _Handle_McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadDiscDs_ListNodeOfListOfDiscSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_ListNodeOfListOfDiscSolid); + +class Handle(McCadDiscDs_ListNodeOfListOfDiscSolid) : public Handle(TCollection_MapNode) { + public: + Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)():Handle(TCollection_MapNode)() {} + Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)(const Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)(const McCadDiscDs_ListNodeOfListOfDiscSolid* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)& operator=(const Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)& operator=(const McCadDiscDs_ListNodeOfListOfDiscSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_ListNodeOfListOfDiscSolid* operator->() const + { + return (McCadDiscDs_ListNodeOfListOfDiscSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_ListNodeOfListOfDiscSolid)(); + + Standard_EXPORT static const Handle(McCadDiscDs_ListNodeOfListOfDiscSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace.hxx new file mode 100644 index 0000000..57bbadb --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile +#define _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadDiscDs_SequenceNodeOfSequenceOfDiscFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace); + +class Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)():Handle(TCollection_SeqNode)() {} + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)(const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)(const McCadDiscDs_SequenceNodeOfSequenceOfDiscFace* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)& operator=(const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)& operator=(const McCadDiscDs_SequenceNodeOfSequenceOfDiscFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_SequenceNodeOfSequenceOfDiscFace* operator->() const + { + return (McCadDiscDs_SequenceNodeOfSequenceOfDiscFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace)(); + + Standard_EXPORT static const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid.hxx new file mode 100644 index 0000000..0a202f5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile +#define _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid); + +class Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)():Handle(TCollection_SeqNode)() {} + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)(const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)(const McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)& operator=(const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)& operator=(const McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid* operator->() const + { + return (McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid)(); + + Standard_EXPORT static const Handle(McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid.hxx new file mode 100644 index 0000000..bb02afa --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile +#define _Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid); + +class Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)():Handle(TCollection_SeqNode)() {} + Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)(const Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)(const McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)& operator=(const Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)& operator=(const McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid* operator->() const + { + return (McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid)(); + + Standard_EXPORT static const Handle(McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary.hxx b/src/MCCAD/McCadHeaders/Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary.hxx new file mode 100644 index 0000000..fc34452 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile +#define _Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary); + +class Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)():Handle(TCollection_SeqNode)() {} + Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)(const Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)(const McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)& operator=(const Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)& operator=(const McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary* operator->() const + { + return (McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary)(); + + Standard_EXPORT static const Handle(McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString.hxx new file mode 100644 index 0000000..e4b846b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#define _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString); + +class Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString) : public Handle(TCollection_MapNode) { + public: + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)():Handle(TCollection_MapNode)() {} + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)(const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)(const McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)& operator=(const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)& operator=(const McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString* operator->() const + { + return (McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)(); + + Standard_EXPORT static const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal.hxx new file mode 100644 index 0000000..624c43f --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#define _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal); + +class Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal) : public Handle(TCollection_MapNode) { + public: + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)():Handle(TCollection_MapNode)() {} + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)(const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)(const McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)& operator=(const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)& operator=(const McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal* operator->() const + { + return (McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)(); + + Standard_EXPORT static const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString.hxx new file mode 100644 index 0000000..882324a --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#define _Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString); + +class Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString) : public Handle(TCollection_MapNode) { + public: + Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)():Handle(TCollection_MapNode)() {} + Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)(const Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)(const McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)& operator=(const Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)& operator=(const McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString* operator->() const + { + return (McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)(); + + Standard_EXPORT static const Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_Cell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_Cell.hxx new file mode 100644 index 0000000..bea475e --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_Cell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#define _Handle_McCadMcRead_Cell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadCSGGeom_Cell); +class McCadMcRead_Cell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_Cell); + +class Handle(McCadMcRead_Cell) : public Handle(McCadCSGGeom_Cell) { + public: + Handle(McCadMcRead_Cell)():Handle(McCadCSGGeom_Cell)() {} + Handle(McCadMcRead_Cell)(const Handle(McCadMcRead_Cell)& aHandle) : Handle(McCadCSGGeom_Cell)(aHandle) + { + } + + Handle(McCadMcRead_Cell)(const McCadMcRead_Cell* anItem) : Handle(McCadCSGGeom_Cell)((McCadCSGGeom_Cell *)anItem) + { + } + + Handle(McCadMcRead_Cell)& operator=(const Handle(McCadMcRead_Cell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_Cell)& operator=(const McCadMcRead_Cell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_Cell* operator->() const + { + return (McCadMcRead_Cell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_Cell)(); + + Standard_EXPORT static const Handle(McCadMcRead_Cell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell.hxx new file mode 100644 index 0000000..64a0c58 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#define _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadMcRead_DataMapNodeOfDataMapOfIntegerCell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell); + +class Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell) : public Handle(TCollection_MapNode) { + public: + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)():Handle(TCollection_MapNode)() {} + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)(const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)(const McCadMcRead_DataMapNodeOfDataMapOfIntegerCell* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)& operator=(const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)& operator=(const McCadMcRead_DataMapNodeOfDataMapOfIntegerCell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_DataMapNodeOfDataMapOfIntegerCell* operator->() const + { + return (McCadMcRead_DataMapNodeOfDataMapOfIntegerCell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)(); + + Standard_EXPORT static const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill.hxx new file mode 100644 index 0000000..5169076 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#define _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadMcRead_DataMapNodeOfDataMapOfIntegerFill; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill); + +class Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill) : public Handle(TCollection_MapNode) { + public: + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)():Handle(TCollection_MapNode)() {} + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)(const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)(const McCadMcRead_DataMapNodeOfDataMapOfIntegerFill* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)& operator=(const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)& operator=(const McCadMcRead_DataMapNodeOfDataMapOfIntegerFill* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_DataMapNodeOfDataMapOfIntegerFill* operator->() const + { + return (McCadMcRead_DataMapNodeOfDataMapOfIntegerFill *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)(); + + Standard_EXPORT static const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_Fill.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_Fill.hxx new file mode 100644 index 0000000..35058ad --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_Fill.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#define _Handle_McCadMcRead_Fill_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadMcRead_Fill; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_Fill); + +class Handle(McCadMcRead_Fill) : public Handle(MMgt_TShared) { + public: + Handle(McCadMcRead_Fill)():Handle(MMgt_TShared)() {} + Handle(McCadMcRead_Fill)(const Handle(McCadMcRead_Fill)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadMcRead_Fill)(const McCadMcRead_Fill* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadMcRead_Fill)& operator=(const Handle(McCadMcRead_Fill)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_Fill)& operator=(const McCadMcRead_Fill* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_Fill* operator->() const + { + return (McCadMcRead_Fill *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_Fill)(); + + Standard_EXPORT static const Handle(McCadMcRead_Fill) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfCell.hxx new file mode 100644 index 0000000..a397bf8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfCell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_HSequenceOfCell_HeaderFile +#define _Handle_McCadMcRead_HSequenceOfCell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadMcRead_HSequenceOfCell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_HSequenceOfCell); + +class Handle(McCadMcRead_HSequenceOfCell) : public Handle(MMgt_TShared) { + public: + Handle(McCadMcRead_HSequenceOfCell)():Handle(MMgt_TShared)() {} + Handle(McCadMcRead_HSequenceOfCell)(const Handle(McCadMcRead_HSequenceOfCell)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadMcRead_HSequenceOfCell)(const McCadMcRead_HSequenceOfCell* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadMcRead_HSequenceOfCell)& operator=(const Handle(McCadMcRead_HSequenceOfCell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_HSequenceOfCell)& operator=(const McCadMcRead_HSequenceOfCell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_HSequenceOfCell* operator->() const + { + return (McCadMcRead_HSequenceOfCell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_HSequenceOfCell)(); + + Standard_EXPORT static const Handle(McCadMcRead_HSequenceOfCell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfCellPtr.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfCellPtr.hxx new file mode 100644 index 0000000..105b284 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfCellPtr.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_HSequenceOfCellPtr_HeaderFile +#define _Handle_McCadMcRead_HSequenceOfCellPtr_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadMcRead_HSequenceOfCellPtr; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_HSequenceOfCellPtr); + +class Handle(McCadMcRead_HSequenceOfCellPtr) : public Handle(MMgt_TShared) { + public: + Handle(McCadMcRead_HSequenceOfCellPtr)():Handle(MMgt_TShared)() {} + Handle(McCadMcRead_HSequenceOfCellPtr)(const Handle(McCadMcRead_HSequenceOfCellPtr)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadMcRead_HSequenceOfCellPtr)(const McCadMcRead_HSequenceOfCellPtr* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadMcRead_HSequenceOfCellPtr)& operator=(const Handle(McCadMcRead_HSequenceOfCellPtr)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_HSequenceOfCellPtr)& operator=(const McCadMcRead_HSequenceOfCellPtr* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_HSequenceOfCellPtr* operator->() const + { + return (McCadMcRead_HSequenceOfCellPtr *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_HSequenceOfCellPtr)(); + + Standard_EXPORT static const Handle(McCadMcRead_HSequenceOfCellPtr) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfFill.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfFill.hxx new file mode 100644 index 0000000..41639fa --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_HSequenceOfFill.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_HSequenceOfFill_HeaderFile +#define _Handle_McCadMcRead_HSequenceOfFill_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadMcRead_HSequenceOfFill; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_HSequenceOfFill); + +class Handle(McCadMcRead_HSequenceOfFill) : public Handle(MMgt_TShared) { + public: + Handle(McCadMcRead_HSequenceOfFill)():Handle(MMgt_TShared)() {} + Handle(McCadMcRead_HSequenceOfFill)(const Handle(McCadMcRead_HSequenceOfFill)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadMcRead_HSequenceOfFill)(const McCadMcRead_HSequenceOfFill* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadMcRead_HSequenceOfFill)& operator=(const Handle(McCadMcRead_HSequenceOfFill)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_HSequenceOfFill)& operator=(const McCadMcRead_HSequenceOfFill* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_HSequenceOfFill* operator->() const + { + return (McCadMcRead_HSequenceOfFill *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_HSequenceOfFill)(); + + Standard_EXPORT static const Handle(McCadMcRead_HSequenceOfFill) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfCell.hxx new file mode 100644 index 0000000..cdcf7bb --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfCell.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile +#define _Handle_McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadMcRead_SequenceNodeOfSequenceOfCell; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCell); + +class Handle(McCadMcRead_SequenceNodeOfSequenceOfCell) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)():Handle(TCollection_SeqNode)() {} + Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)(const Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)(const McCadMcRead_SequenceNodeOfSequenceOfCell* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)& operator=(const Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)& operator=(const McCadMcRead_SequenceNodeOfSequenceOfCell* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_SequenceNodeOfSequenceOfCell* operator->() const + { + return (McCadMcRead_SequenceNodeOfSequenceOfCell *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)(); + + Standard_EXPORT static const Handle(McCadMcRead_SequenceNodeOfSequenceOfCell) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr.hxx new file mode 100644 index 0000000..71d711f --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile +#define _Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadMcRead_SequenceNodeOfSequenceOfCellPtr; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCellPtr); + +class Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)():Handle(TCollection_SeqNode)() {} + Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)(const Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)(const McCadMcRead_SequenceNodeOfSequenceOfCellPtr* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)& operator=(const Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)& operator=(const McCadMcRead_SequenceNodeOfSequenceOfCellPtr* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_SequenceNodeOfSequenceOfCellPtr* operator->() const + { + return (McCadMcRead_SequenceNodeOfSequenceOfCellPtr *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)(); + + Standard_EXPORT static const Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfFill.hxx b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfFill.hxx new file mode 100644 index 0000000..60628df --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadMcRead_SequenceNodeOfSequenceOfFill.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile +#define _Handle_McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadMcRead_SequenceNodeOfSequenceOfFill; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfFill); + +class Handle(McCadMcRead_SequenceNodeOfSequenceOfFill) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)():Handle(TCollection_SeqNode)() {} + Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)(const Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)(const McCadMcRead_SequenceNodeOfSequenceOfFill* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)& operator=(const Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)& operator=(const McCadMcRead_SequenceNodeOfSequenceOfFill* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadMcRead_SequenceNodeOfSequenceOfFill* operator->() const + { + return (McCadMcRead_SequenceNodeOfSequenceOfFill *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)(); + + Standard_EXPORT static const Handle(McCadMcRead_SequenceNodeOfSequenceOfFill) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart.hxx b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart.hxx new file mode 100644 index 0000000..62c9292 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile +#define _Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadModelManager_DataMapNodeOfDataMapOfIntegerPart; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart); + +class Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart) : public Handle(TCollection_MapNode) { + public: + Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)():Handle(TCollection_MapNode)() {} + Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)(const Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)(const McCadModelManager_DataMapNodeOfDataMapOfIntegerPart* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)& operator=(const Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)& operator=(const McCadModelManager_DataMapNodeOfDataMapOfIntegerPart* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadModelManager_DataMapNodeOfDataMapOfIntegerPart* operator->() const + { + return (McCadModelManager_DataMapNodeOfDataMapOfIntegerPart *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart)(); + + Standard_EXPORT static const Handle(McCadModelManager_DataMapNodeOfDataMapOfIntegerPart) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger.hxx b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger.hxx new file mode 100644 index 0000000..afa7190 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile +#define _Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger); + +class Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger) : public Handle(TCollection_MapNode) { + public: + Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)():Handle(TCollection_MapNode)() {} + Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)(const Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)(const McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)& operator=(const Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)& operator=(const McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger* operator->() const + { + return (McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger)(); + + Standard_EXPORT static const Handle(McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadModelManager_HSequenceOfModelParties.hxx b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_HSequenceOfModelParties.hxx new file mode 100644 index 0000000..3b82022 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_HSequenceOfModelParties.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadModelManager_HSequenceOfModelParties_HeaderFile +#define _Handle_McCadModelManager_HSequenceOfModelParties_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadModelManager_HSequenceOfModelParties; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadModelManager_HSequenceOfModelParties); + +class Handle(McCadModelManager_HSequenceOfModelParties) : public Handle(MMgt_TShared) { + public: + Handle(McCadModelManager_HSequenceOfModelParties)():Handle(MMgt_TShared)() {} + Handle(McCadModelManager_HSequenceOfModelParties)(const Handle(McCadModelManager_HSequenceOfModelParties)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadModelManager_HSequenceOfModelParties)(const McCadModelManager_HSequenceOfModelParties* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadModelManager_HSequenceOfModelParties)& operator=(const Handle(McCadModelManager_HSequenceOfModelParties)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadModelManager_HSequenceOfModelParties)& operator=(const McCadModelManager_HSequenceOfModelParties* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadModelManager_HSequenceOfModelParties* operator->() const + { + return (McCadModelManager_HSequenceOfModelParties *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadModelManager_HSequenceOfModelParties)(); + + Standard_EXPORT static const Handle(McCadModelManager_HSequenceOfModelParties) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties.hxx b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties.hxx new file mode 100644 index 0000000..3b7d936 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties_HeaderFile +#define _Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadModelManager_SequenceNodeOfSequenceOfModelParties; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadModelManager_SequenceNodeOfSequenceOfModelParties); + +class Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)():Handle(TCollection_SeqNode)() {} + Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)(const Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)(const McCadModelManager_SequenceNodeOfSequenceOfModelParties* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)& operator=(const Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)& operator=(const McCadModelManager_SequenceNodeOfSequenceOfModelParties* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadModelManager_SequenceNodeOfSequenceOfModelParties* operator->() const + { + return (McCadModelManager_SequenceNodeOfSequenceOfModelParties *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties)(); + + Standard_EXPORT static const Handle(McCadModelManager_SequenceNodeOfSequenceOfModelParties) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_AISInfo.hxx b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_AISInfo.hxx new file mode 100644 index 0000000..346b2fd --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_AISInfo.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#define _Handle_McCadPrsStd_AISInfo_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadPrsStd_AISInfo; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadPrsStd_AISInfo); + +class Handle(McCadPrsStd_AISInfo) : public Handle(MMgt_TShared) { + public: + Handle(McCadPrsStd_AISInfo)():Handle(MMgt_TShared)() {} + Handle(McCadPrsStd_AISInfo)(const Handle(McCadPrsStd_AISInfo)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadPrsStd_AISInfo)(const McCadPrsStd_AISInfo* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadPrsStd_AISInfo)& operator=(const Handle(McCadPrsStd_AISInfo)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadPrsStd_AISInfo)& operator=(const McCadPrsStd_AISInfo* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadPrsStd_AISInfo* operator->() const + { + return (McCadPrsStd_AISInfo *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadPrsStd_AISInfo)(); + + Standard_EXPORT static const Handle(McCadPrsStd_AISInfo) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo.hxx b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo.hxx new file mode 100644 index 0000000..e545cc5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile +#define _Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo); + +class Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo) : public Handle(TCollection_MapNode) { + public: + Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)():Handle(TCollection_MapNode)() {} + Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)(const Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)(const McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)& operator=(const Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)& operator=(const McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo* operator->() const + { + return (McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo)(); + + Standard_EXPORT static const Handle(McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_ListNodeOfListOfAISInfo.hxx b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_ListNodeOfListOfAISInfo.hxx new file mode 100644 index 0000000..a6d21cd --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_ListNodeOfListOfAISInfo.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile +#define _Handle_McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadPrsStd_ListNodeOfListOfAISInfo; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadPrsStd_ListNodeOfListOfAISInfo); + +class Handle(McCadPrsStd_ListNodeOfListOfAISInfo) : public Handle(TCollection_MapNode) { + public: + Handle(McCadPrsStd_ListNodeOfListOfAISInfo)():Handle(TCollection_MapNode)() {} + Handle(McCadPrsStd_ListNodeOfListOfAISInfo)(const Handle(McCadPrsStd_ListNodeOfListOfAISInfo)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadPrsStd_ListNodeOfListOfAISInfo)(const McCadPrsStd_ListNodeOfListOfAISInfo* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadPrsStd_ListNodeOfListOfAISInfo)& operator=(const Handle(McCadPrsStd_ListNodeOfListOfAISInfo)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadPrsStd_ListNodeOfListOfAISInfo)& operator=(const McCadPrsStd_ListNodeOfListOfAISInfo* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadPrsStd_ListNodeOfListOfAISInfo* operator->() const + { + return (McCadPrsStd_ListNodeOfListOfAISInfo *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadPrsStd_ListNodeOfListOfAISInfo)(); + + Standard_EXPORT static const Handle(McCadPrsStd_ListNodeOfListOfAISInfo) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo.hxx b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo.hxx new file mode 100644 index 0000000..3b05cbd --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_HeaderFile +#define _Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadPrsStd_SequenceNodeOfSequenceOfAISInfo; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo); + +class Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)():Handle(TCollection_SeqNode)() {} + Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)(const Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)(const McCadPrsStd_SequenceNodeOfSequenceOfAISInfo* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)& operator=(const Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)& operator=(const McCadPrsStd_SequenceNodeOfSequenceOfAISInfo* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadPrsStd_SequenceNodeOfSequenceOfAISInfo* operator->() const + { + return (McCadPrsStd_SequenceNodeOfSequenceOfAISInfo *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo)(); + + Standard_EXPORT static const Handle(McCadPrsStd_SequenceNodeOfSequenceOfAISInfo) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo.hxx b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo.hxx new file mode 100644 index 0000000..53c6a52 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile +#define _Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadPrsStd_StdMapNodeOfMapOfAISInfo; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadPrsStd_StdMapNodeOfMapOfAISInfo); + +class Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo) : public Handle(TCollection_MapNode) { + public: + Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)():Handle(TCollection_MapNode)() {} + Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)(const Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)(const McCadPrsStd_StdMapNodeOfMapOfAISInfo* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)& operator=(const Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)& operator=(const McCadPrsStd_StdMapNodeOfMapOfAISInfo* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadPrsStd_StdMapNodeOfMapOfAISInfo* operator->() const + { + return (McCadPrsStd_StdMapNodeOfMapOfAISInfo *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo)(); + + Standard_EXPORT static const Handle(McCadPrsStd_StdMapNodeOfMapOfAISInfo) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace.hxx new file mode 100644 index 0000000..579c4fd --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#define _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace); + +class Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace) : public Handle(TCollection_MapNode) { + public: + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)():Handle(TCollection_MapNode)() {} + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)(const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)(const McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)& operator=(const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)& operator=(const McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace* operator->() const + { + return (McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)(); + + Standard_EXPORT static const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid.hxx new file mode 100644 index 0000000..4a089b4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#define _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadTDS_DataMapNodeOfDataMapOfIntegerSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid); + +class Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid) : public Handle(TCollection_MapNode) { + public: + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)():Handle(TCollection_MapNode)() {} + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)(const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)(const McCadTDS_DataMapNodeOfDataMapOfIntegerSolid* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)& operator=(const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)& operator=(const McCadTDS_DataMapNodeOfDataMapOfIntegerSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_DataMapNodeOfDataMapOfIntegerSolid* operator->() const + { + return (McCadTDS_DataMapNodeOfDataMapOfIntegerSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)(); + + Standard_EXPORT static const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_ExtFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_ExtFace.hxx new file mode 100644 index 0000000..4e0e00b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_ExtFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#define _Handle_McCadTDS_ExtFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTDS_ExtFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_ExtFace); + +class Handle(McCadTDS_ExtFace) : public Handle(MMgt_TShared) { + public: + Handle(McCadTDS_ExtFace)():Handle(MMgt_TShared)() {} + Handle(McCadTDS_ExtFace)(const Handle(McCadTDS_ExtFace)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTDS_ExtFace)(const McCadTDS_ExtFace* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTDS_ExtFace)& operator=(const Handle(McCadTDS_ExtFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_ExtFace)& operator=(const McCadTDS_ExtFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_ExtFace* operator->() const + { + return (McCadTDS_ExtFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_ExtFace)(); + + Standard_EXPORT static const Handle(McCadTDS_ExtFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_ExtSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_ExtSolid.hxx new file mode 100644 index 0000000..ec99003 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_ExtSolid.hxx @@ -0,0 +1,76 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#define _Handle_McCadTDS_ExtSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTDS_ExtSolid; + +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_ExtSolid); + +class Handle(McCadTDS_ExtSolid) : public Handle(MMgt_TShared) { + public: + Handle(McCadTDS_ExtSolid)():Handle(MMgt_TShared)() {} + Handle(McCadTDS_ExtSolid)(const Handle(McCadTDS_ExtSolid)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTDS_ExtSolid)(const McCadTDS_ExtSolid* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTDS_ExtSolid)& operator=(const Handle(McCadTDS_ExtSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_ExtSolid)& operator=(const McCadTDS_ExtSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_ExtSolid* operator->() const + { + return (McCadTDS_ExtSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_ExtSolid)(); + + Standard_EXPORT static const Handle(McCadTDS_ExtSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_HSequenceOfExtFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_HSequenceOfExtFace.hxx new file mode 100644 index 0000000..91fc601 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_HSequenceOfExtFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_HSequenceOfExtFace_HeaderFile +#define _Handle_McCadTDS_HSequenceOfExtFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTDS_HSequenceOfExtFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_HSequenceOfExtFace); + +class Handle(McCadTDS_HSequenceOfExtFace) : public Handle(MMgt_TShared) { + public: + Handle(McCadTDS_HSequenceOfExtFace)():Handle(MMgt_TShared)() {} + Handle(McCadTDS_HSequenceOfExtFace)(const Handle(McCadTDS_HSequenceOfExtFace)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTDS_HSequenceOfExtFace)(const McCadTDS_HSequenceOfExtFace* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTDS_HSequenceOfExtFace)& operator=(const Handle(McCadTDS_HSequenceOfExtFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_HSequenceOfExtFace)& operator=(const McCadTDS_HSequenceOfExtFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_HSequenceOfExtFace* operator->() const + { + return (McCadTDS_HSequenceOfExtFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_HSequenceOfExtFace)(); + + Standard_EXPORT static const Handle(McCadTDS_HSequenceOfExtFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_HSequenceOfExtSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_HSequenceOfExtSolid.hxx new file mode 100644 index 0000000..de24975 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_HSequenceOfExtSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_HSequenceOfExtSolid_HeaderFile +#define _Handle_McCadTDS_HSequenceOfExtSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTDS_HSequenceOfExtSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_HSequenceOfExtSolid); + +class Handle(McCadTDS_HSequenceOfExtSolid) : public Handle(MMgt_TShared) { + public: + Handle(McCadTDS_HSequenceOfExtSolid)():Handle(MMgt_TShared)() {} + Handle(McCadTDS_HSequenceOfExtSolid)(const Handle(McCadTDS_HSequenceOfExtSolid)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTDS_HSequenceOfExtSolid)(const McCadTDS_HSequenceOfExtSolid* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTDS_HSequenceOfExtSolid)& operator=(const Handle(McCadTDS_HSequenceOfExtSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_HSequenceOfExtSolid)& operator=(const McCadTDS_HSequenceOfExtSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_HSequenceOfExtSolid* operator->() const + { + return (McCadTDS_HSequenceOfExtSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_HSequenceOfExtSolid)(); + + Standard_EXPORT static const Handle(McCadTDS_HSequenceOfExtSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace.hxx new file mode 100644 index 0000000..6b63757 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile +#define _Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadTDS_SequenceNodeOfSequenceOfExtFace; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtFace); + +class Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)():Handle(TCollection_SeqNode)() {} + Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)(const Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)(const McCadTDS_SequenceNodeOfSequenceOfExtFace* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)& operator=(const Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)& operator=(const McCadTDS_SequenceNodeOfSequenceOfExtFace* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_SequenceNodeOfSequenceOfExtFace* operator->() const + { + return (McCadTDS_SequenceNodeOfSequenceOfExtFace *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)(); + + Standard_EXPORT static const Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid.hxx new file mode 100644 index 0000000..326f767 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile +#define _Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_SeqNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_SeqNode); +class McCadTDS_SequenceNodeOfSequenceOfExtSolid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtSolid); + +class Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid) : public Handle(TCollection_SeqNode) { + public: + Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)():Handle(TCollection_SeqNode)() {} + Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)(const Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)& aHandle) : Handle(TCollection_SeqNode)(aHandle) + { + } + + Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)(const McCadTDS_SequenceNodeOfSequenceOfExtSolid* anItem) : Handle(TCollection_SeqNode)((TCollection_SeqNode *)anItem) + { + } + + Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)& operator=(const Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)& operator=(const McCadTDS_SequenceNodeOfSequenceOfExtSolid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTDS_SequenceNodeOfSequenceOfExtSolid* operator->() const + { + return (McCadTDS_SequenceNodeOfSequenceOfExtSolid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)(); + + Standard_EXPORT static const Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTool_ListNodeOfListOfTask.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTool_ListNodeOfListOfTask.hxx new file mode 100644 index 0000000..07040ff --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTool_ListNodeOfListOfTask.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTool_ListNodeOfListOfTask_HeaderFile +#define _Handle_McCadTool_ListNodeOfListOfTask_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class McCadTool_ListNodeOfListOfTask; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTool_ListNodeOfListOfTask); + +class Handle(McCadTool_ListNodeOfListOfTask) : public Handle(TCollection_MapNode) { + public: + Handle(McCadTool_ListNodeOfListOfTask)():Handle(TCollection_MapNode)() {} + Handle(McCadTool_ListNodeOfListOfTask)(const Handle(McCadTool_ListNodeOfListOfTask)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(McCadTool_ListNodeOfListOfTask)(const McCadTool_ListNodeOfListOfTask* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(McCadTool_ListNodeOfListOfTask)& operator=(const Handle(McCadTool_ListNodeOfListOfTask)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTool_ListNodeOfListOfTask)& operator=(const McCadTool_ListNodeOfListOfTask* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTool_ListNodeOfListOfTask* operator->() const + { + return (McCadTool_ListNodeOfListOfTask *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTool_ListNodeOfListOfTask)(); + + Standard_EXPORT static const Handle(McCadTool_ListNodeOfListOfTask) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTool_Task.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTool_Task.hxx new file mode 100644 index 0000000..5e2536c --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTool_Task.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTool_Task_HeaderFile +#define _Handle_McCadTool_Task_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTool_Task; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTool_Task); + +class Handle(McCadTool_Task) : public Handle(MMgt_TShared) { + public: + Handle(McCadTool_Task)():Handle(MMgt_TShared)() {} + Handle(McCadTool_Task)(const Handle(McCadTool_Task)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTool_Task)(const McCadTool_Task* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTool_Task)& operator=(const Handle(McCadTool_Task)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTool_Task)& operator=(const McCadTool_Task* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTool_Task* operator->() const + { + return (McCadTool_Task *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTool_Task)(); + + Standard_EXPORT static const Handle(McCadTool_Task) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTool_TaskHistory.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTool_TaskHistory.hxx new file mode 100644 index 0000000..7af6c0b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTool_TaskHistory.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTool_TaskHistory_HeaderFile +#define _Handle_McCadTool_TaskHistory_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTool_TaskHistory; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTool_TaskHistory); + +class Handle(McCadTool_TaskHistory) : public Handle(MMgt_TShared) { + public: + Handle(McCadTool_TaskHistory)():Handle(MMgt_TShared)() {} + Handle(McCadTool_TaskHistory)(const Handle(McCadTool_TaskHistory)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTool_TaskHistory)(const McCadTool_TaskHistory* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTool_TaskHistory)& operator=(const Handle(McCadTool_TaskHistory)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTool_TaskHistory)& operator=(const McCadTool_TaskHistory* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTool_TaskHistory* operator->() const + { + return (McCadTool_TaskHistory *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTool_TaskHistory)(); + + Standard_EXPORT static const Handle(McCadTool_TaskHistory) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTool_TaskMaster.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTool_TaskMaster.hxx new file mode 100644 index 0000000..10e11a6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTool_TaskMaster.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTool_TaskMaster_HeaderFile +#define _Handle_McCadTool_TaskMaster_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTool_TaskMaster; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTool_TaskMaster); + +class Handle(McCadTool_TaskMaster) : public Handle(MMgt_TShared) { + public: + Handle(McCadTool_TaskMaster)():Handle(MMgt_TShared)() {} + Handle(McCadTool_TaskMaster)(const Handle(McCadTool_TaskMaster)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTool_TaskMaster)(const McCadTool_TaskMaster* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTool_TaskMaster)& operator=(const Handle(McCadTool_TaskMaster)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTool_TaskMaster)& operator=(const McCadTool_TaskMaster* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTool_TaskMaster* operator->() const + { + return (McCadTool_TaskMaster *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTool_TaskMaster)(); + + Standard_EXPORT static const Handle(McCadTool_TaskMaster) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTree_NodeDataPrototype.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTree_NodeDataPrototype.hxx new file mode 100644 index 0000000..3171cba --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTree_NodeDataPrototype.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTree_NodeDataPrototype_HeaderFile +#define _Handle_McCadTree_NodeDataPrototype_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTree_NodeDataPrototype; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTree_NodeDataPrototype); + +class Handle(McCadTree_NodeDataPrototype) : public Handle(MMgt_TShared) { + public: + Handle(McCadTree_NodeDataPrototype)():Handle(MMgt_TShared)() {} + Handle(McCadTree_NodeDataPrototype)(const Handle(McCadTree_NodeDataPrototype)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTree_NodeDataPrototype)(const McCadTree_NodeDataPrototype* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTree_NodeDataPrototype)& operator=(const Handle(McCadTree_NodeDataPrototype)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTree_NodeDataPrototype)& operator=(const McCadTree_NodeDataPrototype* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTree_NodeDataPrototype* operator->() const + { + return (McCadTree_NodeDataPrototype *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTree_NodeDataPrototype)(); + + Standard_EXPORT static const Handle(McCadTree_NodeDataPrototype) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadTree_Tree.hxx b/src/MCCAD/McCadHeaders/Handle_McCadTree_Tree.hxx new file mode 100644 index 0000000..0032d60 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadTree_Tree.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadTree_Tree_HeaderFile +#define _Handle_McCadTree_Tree_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_MMgt_TShared_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(MMgt_TShared); +class McCadTree_Tree; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadTree_Tree); + +class Handle(McCadTree_Tree) : public Handle(MMgt_TShared) { + public: + Handle(McCadTree_Tree)():Handle(MMgt_TShared)() {} + Handle(McCadTree_Tree)(const Handle(McCadTree_Tree)& aHandle) : Handle(MMgt_TShared)(aHandle) + { + } + + Handle(McCadTree_Tree)(const McCadTree_Tree* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + { + } + + Handle(McCadTree_Tree)& operator=(const Handle(McCadTree_Tree)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadTree_Tree)& operator=(const McCadTree_Tree* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadTree_Tree* operator->() const + { + return (McCadTree_Tree *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadTree_Tree)(); + + Standard_EXPORT static const Handle(McCadTree_Tree) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Axis.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Axis.hxx new file mode 100644 index 0000000..383040b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Axis.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Axis_HeaderFile +#define _Handle_McCadViewTool_Axis_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Axis; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Axis); + +class Handle(McCadViewTool_Axis) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Axis)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Axis)(const Handle(McCadViewTool_Axis)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Axis)(const McCadViewTool_Axis* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Axis)& operator=(const Handle(McCadViewTool_Axis)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Axis)& operator=(const McCadViewTool_Axis* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Axis* operator->() const + { + return (McCadViewTool_Axis *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Axis)(); + + Standard_EXPORT static const Handle(McCadViewTool_Axis) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Axo.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Axo.hxx new file mode 100644 index 0000000..b652562 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Axo.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Axo_HeaderFile +#define _Handle_McCadViewTool_Axo_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Axo; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Axo); + +class Handle(McCadViewTool_Axo) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Axo)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Axo)(const Handle(McCadViewTool_Axo)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Axo)(const McCadViewTool_Axo* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Axo)& operator=(const Handle(McCadViewTool_Axo)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Axo)& operator=(const McCadViewTool_Axo* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Axo* operator->() const + { + return (McCadViewTool_Axo *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Axo)(); + + Standard_EXPORT static const Handle(McCadViewTool_Axo) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_BackProject.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_BackProject.hxx new file mode 100644 index 0000000..c921a77 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_BackProject.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_BackProject_HeaderFile +#define _Handle_McCadViewTool_BackProject_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_BackProject; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_BackProject); + +class Handle(McCadViewTool_BackProject) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_BackProject)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_BackProject)(const Handle(McCadViewTool_BackProject)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_BackProject)(const McCadViewTool_BackProject* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_BackProject)& operator=(const Handle(McCadViewTool_BackProject)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_BackProject)& operator=(const McCadViewTool_BackProject* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_BackProject* operator->() const + { + return (McCadViewTool_BackProject *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_BackProject)(); + + Standard_EXPORT static const Handle(McCadViewTool_BackProject) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_BottomProject.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_BottomProject.hxx new file mode 100644 index 0000000..5f0742b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_BottomProject.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_BottomProject_HeaderFile +#define _Handle_McCadViewTool_BottomProject_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_BottomProject; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_BottomProject); + +class Handle(McCadViewTool_BottomProject) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_BottomProject)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_BottomProject)(const Handle(McCadViewTool_BottomProject)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_BottomProject)(const McCadViewTool_BottomProject* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_BottomProject)& operator=(const Handle(McCadViewTool_BottomProject)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_BottomProject)& operator=(const McCadViewTool_BottomProject* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_BottomProject* operator->() const + { + return (McCadViewTool_BottomProject *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_BottomProject)(); + + Standard_EXPORT static const Handle(McCadViewTool_BottomProject) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Default.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Default.hxx new file mode 100644 index 0000000..2fd9cb9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Default.hxx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Default_HeaderFile +#define _Handle_McCadViewTool_Default_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Default; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Default); + +class Handle(McCadViewTool_Default) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Default)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Default)(const Handle(McCadViewTool_Default)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Default)(const McCadViewTool_Default* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Default)& operator=(const Handle(McCadViewTool_Default)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Default)& operator=(const McCadViewTool_Default* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Default* operator->() const + { + return (McCadViewTool_Default *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Default)(); + + Standard_EXPORT static const Handle(McCadViewTool_Default) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif + diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Delete.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Delete.hxx new file mode 100644 index 0000000..1a17dac --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Delete.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Delete_HeaderFile +#define _Handle_McCadViewTool_Delete_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Delete; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Delete); + +class Handle(McCadViewTool_Delete) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Delete)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Delete)(const Handle(McCadViewTool_Delete)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Delete)(const McCadViewTool_Delete* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Delete)& operator=(const Handle(McCadViewTool_Delete)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Delete)& operator=(const McCadViewTool_Delete* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Delete* operator->() const + { + return (McCadViewTool_Delete *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Delete)(); + + Standard_EXPORT static const Handle(McCadViewTool_Delete) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_DisplaySelectedOnly.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_DisplaySelectedOnly.hxx new file mode 100644 index 0000000..4c618cd --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_DisplaySelectedOnly.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_DisplaySelectedOnly_HeaderFile +#define _Handle_McCadViewTool_DisplaySelectedOnly_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_DisplaySelectedOnly; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_DisplaySelectedOnly); + +class Handle(McCadViewTool_DisplaySelectedOnly) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_DisplaySelectedOnly)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_DisplaySelectedOnly)(const Handle(McCadViewTool_DisplaySelectedOnly)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_DisplaySelectedOnly)(const McCadViewTool_DisplaySelectedOnly* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_DisplaySelectedOnly)& operator=(const Handle(McCadViewTool_DisplaySelectedOnly)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_DisplaySelectedOnly)& operator=(const McCadViewTool_DisplaySelectedOnly* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_DisplaySelectedOnly* operator->() const + { + return (McCadViewTool_DisplaySelectedOnly *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_DisplaySelectedOnly)(); + + Standard_EXPORT static const Handle(McCadViewTool_DisplaySelectedOnly) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Dump.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Dump.hxx new file mode 100644 index 0000000..f77dbd8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Dump.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Dump_HeaderFile +#define _Handle_McCadViewTool_Dump_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Dump; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Dump); + +class Handle(McCadViewTool_Dump) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Dump)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Dump)(const Handle(McCadViewTool_Dump)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Dump)(const McCadViewTool_Dump* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Dump)& operator=(const Handle(McCadViewTool_Dump)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Dump)& operator=(const McCadViewTool_Dump* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Dump* operator->() const + { + return (McCadViewTool_Dump *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Dump)(); + + Standard_EXPORT static const Handle(McCadViewTool_Dump) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_FitAll.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_FitAll.hxx new file mode 100644 index 0000000..b1205ad --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_FitAll.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_FitAll_HeaderFile +#define _Handle_McCadViewTool_FitAll_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_FitAll; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_FitAll); + +class Handle(McCadViewTool_FitAll) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_FitAll)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_FitAll)(const Handle(McCadViewTool_FitAll)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_FitAll)(const McCadViewTool_FitAll* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_FitAll)& operator=(const Handle(McCadViewTool_FitAll)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_FitAll)& operator=(const McCadViewTool_FitAll* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_FitAll* operator->() const + { + return (McCadViewTool_FitAll *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_FitAll)(); + + Standard_EXPORT static const Handle(McCadViewTool_FitAll) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_FrontProject.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_FrontProject.hxx new file mode 100644 index 0000000..d12e57f --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_FrontProject.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_FrontProject_HeaderFile +#define _Handle_McCadViewTool_FrontProject_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_FrontProject; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_FrontProject); + +class Handle(McCadViewTool_FrontProject) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_FrontProject)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_FrontProject)(const Handle(McCadViewTool_FrontProject)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_FrontProject)(const McCadViewTool_FrontProject* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_FrontProject)& operator=(const Handle(McCadViewTool_FrontProject)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_FrontProject)& operator=(const McCadViewTool_FrontProject* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_FrontProject* operator->() const + { + return (McCadViewTool_FrontProject *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_FrontProject)(); + + Standard_EXPORT static const Handle(McCadViewTool_FrontProject) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Grid.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Grid.hxx new file mode 100644 index 0000000..071ae4b --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Grid.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Grid_HeaderFile +#define _Handle_McCadViewTool_Grid_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Grid; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Grid); + +class Handle(McCadViewTool_Grid) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Grid)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Grid)(const Handle(McCadViewTool_Grid)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Grid)(const McCadViewTool_Grid* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Grid)& operator=(const Handle(McCadViewTool_Grid)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Grid)& operator=(const McCadViewTool_Grid* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Grid* operator->() const + { + return (McCadViewTool_Grid *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Grid)(); + + Standard_EXPORT static const Handle(McCadViewTool_Grid) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_HideSelected.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_HideSelected.hxx new file mode 100644 index 0000000..cd92abc --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_HideSelected.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_HideSelected_HeaderFile +#define _Handle_McCadViewTool_HideSelected_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_HideSelected; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_HideSelected); + +class Handle(McCadViewTool_HideSelected) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_HideSelected)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_HideSelected)(const Handle(McCadViewTool_HideSelected)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_HideSelected)(const McCadViewTool_HideSelected* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_HideSelected)& operator=(const Handle(McCadViewTool_HideSelected)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_HideSelected)& operator=(const McCadViewTool_HideSelected* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_HideSelected* operator->() const + { + return (McCadViewTool_HideSelected *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_HideSelected)(); + + Standard_EXPORT static const Handle(McCadViewTool_HideSelected) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_LeftProject.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_LeftProject.hxx new file mode 100644 index 0000000..95060f8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_LeftProject.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_LeftProject_HeaderFile +#define _Handle_McCadViewTool_LeftProject_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_LeftProject; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_LeftProject); + +class Handle(McCadViewTool_LeftProject) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_LeftProject)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_LeftProject)(const Handle(McCadViewTool_LeftProject)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_LeftProject)(const McCadViewTool_LeftProject* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_LeftProject)& operator=(const Handle(McCadViewTool_LeftProject)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_LeftProject)& operator=(const McCadViewTool_LeftProject* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_LeftProject* operator->() const + { + return (McCadViewTool_LeftProject *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_LeftProject)(); + + Standard_EXPORT static const Handle(McCadViewTool_LeftProject) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Pan.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Pan.hxx new file mode 100644 index 0000000..edccb53 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Pan.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Pan_HeaderFile +#define _Handle_McCadViewTool_Pan_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Pan; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Pan); + +class Handle(McCadViewTool_Pan) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Pan)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Pan)(const Handle(McCadViewTool_Pan)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Pan)(const McCadViewTool_Pan* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Pan)& operator=(const Handle(McCadViewTool_Pan)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Pan)& operator=(const McCadViewTool_Pan* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Pan* operator->() const + { + return (McCadViewTool_Pan *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Pan)(); + + Standard_EXPORT static const Handle(McCadViewTool_Pan) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ReadValueList.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ReadValueList.hxx new file mode 100644 index 0000000..d37f12f --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ReadValueList.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_ReadValueList_HeaderFile +#define _Handle_McCadViewTool_ReadValueList_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_ReadValueList; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_ReadValueList); + +class Handle(McCadViewTool_ReadValueList) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_ReadValueList)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_ReadValueList)(const Handle(McCadViewTool_ReadValueList)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_ReadValueList)(const McCadViewTool_ReadValueList* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_ReadValueList)& operator=(const Handle(McCadViewTool_ReadValueList)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_ReadValueList)& operator=(const McCadViewTool_ReadValueList* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_ReadValueList* operator->() const + { + return (McCadViewTool_ReadValueList *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_ReadValueList)(); + + Standard_EXPORT static const Handle(McCadViewTool_ReadValueList) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_RedisplaySelected.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_RedisplaySelected.hxx new file mode 100644 index 0000000..3fc5a6d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_RedisplaySelected.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_RedisplaySelected_HeaderFile +#define _Handle_McCadViewTool_RedisplaySelected_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_RedisplaySelected; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_RedisplaySelected); + +class Handle(McCadViewTool_RedisplaySelected) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_RedisplaySelected)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_RedisplaySelected)(const Handle(McCadViewTool_RedisplaySelected)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_RedisplaySelected)(const McCadViewTool_RedisplaySelected* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_RedisplaySelected)& operator=(const Handle(McCadViewTool_RedisplaySelected)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_RedisplaySelected)& operator=(const McCadViewTool_RedisplaySelected* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_RedisplaySelected* operator->() const + { + return (McCadViewTool_RedisplaySelected *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_RedisplaySelected)(); + + Standard_EXPORT static const Handle(McCadViewTool_RedisplaySelected) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Redraw.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Redraw.hxx new file mode 100644 index 0000000..9cd2287 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Redraw.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Redraw_HeaderFile +#define _Handle_McCadViewTool_Redraw_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Redraw; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Redraw); + +class Handle(McCadViewTool_Redraw) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Redraw)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Redraw)(const Handle(McCadViewTool_Redraw)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Redraw)(const McCadViewTool_Redraw* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Redraw)& operator=(const Handle(McCadViewTool_Redraw)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Redraw)& operator=(const McCadViewTool_Redraw* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Redraw* operator->() const + { + return (McCadViewTool_Redraw *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Redraw)(); + + Standard_EXPORT static const Handle(McCadViewTool_Redraw) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Reset.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Reset.hxx new file mode 100644 index 0000000..0b8b639 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Reset.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Reset_HeaderFile +#define _Handle_McCadViewTool_Reset_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Reset; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Reset); + +class Handle(McCadViewTool_Reset) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Reset)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Reset)(const Handle(McCadViewTool_Reset)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Reset)(const McCadViewTool_Reset* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Reset)& operator=(const Handle(McCadViewTool_Reset)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Reset)& operator=(const McCadViewTool_Reset* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Reset* operator->() const + { + return (McCadViewTool_Reset *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Reset)(); + + Standard_EXPORT static const Handle(McCadViewTool_Reset) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_RightProject.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_RightProject.hxx new file mode 100644 index 0000000..9dbb5ee --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_RightProject.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_RightProject_HeaderFile +#define _Handle_McCadViewTool_RightProject_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_RightProject; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_RightProject); + +class Handle(McCadViewTool_RightProject) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_RightProject)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_RightProject)(const Handle(McCadViewTool_RightProject)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_RightProject)(const McCadViewTool_RightProject* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_RightProject)& operator=(const Handle(McCadViewTool_RightProject)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_RightProject)& operator=(const McCadViewTool_RightProject* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_RightProject* operator->() const + { + return (McCadViewTool_RightProject *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_RightProject)(); + + Standard_EXPORT static const Handle(McCadViewTool_RightProject) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Rotate.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Rotate.hxx new file mode 100644 index 0000000..736a7e1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Rotate.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Rotate_HeaderFile +#define _Handle_McCadViewTool_Rotate_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Rotate; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Rotate); + +class Handle(McCadViewTool_Rotate) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Rotate)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Rotate)(const Handle(McCadViewTool_Rotate)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Rotate)(const McCadViewTool_Rotate* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Rotate)& operator=(const Handle(McCadViewTool_Rotate)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Rotate)& operator=(const McCadViewTool_Rotate* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Rotate* operator->() const + { + return (McCadViewTool_Rotate *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Rotate)(); + + Standard_EXPORT static const Handle(McCadViewTool_Rotate) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetAntialiasing.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetAntialiasing.hxx new file mode 100644 index 0000000..c77170d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetAntialiasing.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_SetAntialiasing_HeaderFile +#define _Handle_McCadViewTool_SetAntialiasing_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_SetAntialiasing; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_SetAntialiasing); + +class Handle(McCadViewTool_SetAntialiasing) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_SetAntialiasing)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_SetAntialiasing)(const Handle(McCadViewTool_SetAntialiasing)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_SetAntialiasing)(const McCadViewTool_SetAntialiasing* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_SetAntialiasing)& operator=(const Handle(McCadViewTool_SetAntialiasing)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_SetAntialiasing)& operator=(const McCadViewTool_SetAntialiasing* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_SetAntialiasing* operator->() const + { + return (McCadViewTool_SetAntialiasing *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_SetAntialiasing)(); + + Standard_EXPORT static const Handle(McCadViewTool_SetAntialiasing) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetBackgroundColor.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetBackgroundColor.hxx new file mode 100644 index 0000000..460bd26 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetBackgroundColor.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_SetBackgroundColor_HeaderFile +#define _Handle_McCadViewTool_SetBackgroundColor_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_SetBackgroundColor; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_SetBackgroundColor); + +class Handle(McCadViewTool_SetBackgroundColor) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_SetBackgroundColor)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_SetBackgroundColor)(const Handle(McCadViewTool_SetBackgroundColor)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_SetBackgroundColor)(const McCadViewTool_SetBackgroundColor* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_SetBackgroundColor)& operator=(const Handle(McCadViewTool_SetBackgroundColor)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_SetBackgroundColor)& operator=(const McCadViewTool_SetBackgroundColor* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_SetBackgroundColor* operator->() const + { + return (McCadViewTool_SetBackgroundColor *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_SetBackgroundColor)(); + + Standard_EXPORT static const Handle(McCadViewTool_SetBackgroundColor) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetHiddenLine.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetHiddenLine.hxx new file mode 100644 index 0000000..c7d3c21 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetHiddenLine.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_SetHiddenLine_HeaderFile +#define _Handle_McCadViewTool_SetHiddenLine_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_SetHiddenLine; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_SetHiddenLine); + +class Handle(McCadViewTool_SetHiddenLine) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_SetHiddenLine)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_SetHiddenLine)(const Handle(McCadViewTool_SetHiddenLine)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_SetHiddenLine)(const McCadViewTool_SetHiddenLine* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_SetHiddenLine)& operator=(const Handle(McCadViewTool_SetHiddenLine)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_SetHiddenLine)& operator=(const McCadViewTool_SetHiddenLine* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_SetHiddenLine* operator->() const + { + return (McCadViewTool_SetHiddenLine *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_SetHiddenLine)(); + + Standard_EXPORT static const Handle(McCadViewTool_SetHiddenLine) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetShadingMode.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetShadingMode.hxx new file mode 100644 index 0000000..ebc617d --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetShadingMode.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_SetShadingMode_HeaderFile +#define _Handle_McCadViewTool_SetShadingMode_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_SetShadingMode; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_SetShadingMode); + +class Handle(McCadViewTool_SetShadingMode) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_SetShadingMode)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_SetShadingMode)(const Handle(McCadViewTool_SetShadingMode)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_SetShadingMode)(const McCadViewTool_SetShadingMode* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_SetShadingMode)& operator=(const Handle(McCadViewTool_SetShadingMode)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_SetShadingMode)& operator=(const McCadViewTool_SetShadingMode* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_SetShadingMode* operator->() const + { + return (McCadViewTool_SetShadingMode *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_SetShadingMode)(); + + Standard_EXPORT static const Handle(McCadViewTool_SetShadingMode) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetShapeColor.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetShapeColor.hxx new file mode 100644 index 0000000..8bbd523 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetShapeColor.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_SetShapeColor_HeaderFile +#define _Handle_McCadViewTool_SetShapeColor_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_SetShapeColor; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_SetShapeColor); + +class Handle(McCadViewTool_SetShapeColor) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_SetShapeColor)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_SetShapeColor)(const Handle(McCadViewTool_SetShapeColor)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_SetShapeColor)(const McCadViewTool_SetShapeColor* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_SetShapeColor)& operator=(const Handle(McCadViewTool_SetShapeColor)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_SetShapeColor)& operator=(const McCadViewTool_SetShapeColor* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_SetShapeColor* operator->() const + { + return (McCadViewTool_SetShapeColor *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_SetShapeColor)(); + + Standard_EXPORT static const Handle(McCadViewTool_SetShapeColor) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetVisuMaterial.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetVisuMaterial.hxx new file mode 100644 index 0000000..0dd55ae --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_SetVisuMaterial.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_SetVisuMaterial_HeaderFile +#define _Handle_McCadViewTool_SetVisuMaterial_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_SetVisuMaterial; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_SetVisuMaterial); + +class Handle(McCadViewTool_SetVisuMaterial) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_SetVisuMaterial)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_SetVisuMaterial)(const Handle(McCadViewTool_SetVisuMaterial)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_SetVisuMaterial)(const McCadViewTool_SetVisuMaterial* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_SetVisuMaterial)& operator=(const Handle(McCadViewTool_SetVisuMaterial)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_SetVisuMaterial)& operator=(const McCadViewTool_SetVisuMaterial* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_SetVisuMaterial* operator->() const + { + return (McCadViewTool_SetVisuMaterial *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_SetVisuMaterial)(); + + Standard_EXPORT static const Handle(McCadViewTool_SetVisuMaterial) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ShowAll.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ShowAll.hxx new file mode 100644 index 0000000..31cdfc8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ShowAll.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_ShowAll_HeaderFile +#define _Handle_McCadViewTool_ShowAll_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_ShowAll; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_ShowAll); + +class Handle(McCadViewTool_ShowAll) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_ShowAll)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_ShowAll)(const Handle(McCadViewTool_ShowAll)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_ShowAll)(const McCadViewTool_ShowAll* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_ShowAll)& operator=(const Handle(McCadViewTool_ShowAll)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_ShowAll)& operator=(const McCadViewTool_ShowAll* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_ShowAll* operator->() const + { + return (McCadViewTool_ShowAll *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_ShowAll)(); + + Standard_EXPORT static const Handle(McCadViewTool_ShowAll) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_TopProject.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_TopProject.hxx new file mode 100644 index 0000000..a6945bd --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_TopProject.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_TopProject_HeaderFile +#define _Handle_McCadViewTool_TopProject_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_TopProject; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_TopProject); + +class Handle(McCadViewTool_TopProject) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_TopProject)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_TopProject)(const Handle(McCadViewTool_TopProject)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_TopProject)(const McCadViewTool_TopProject* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_TopProject)& operator=(const Handle(McCadViewTool_TopProject)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_TopProject)& operator=(const McCadViewTool_TopProject* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_TopProject* operator->() const + { + return (McCadViewTool_TopProject *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_TopProject)(); + + Standard_EXPORT static const Handle(McCadViewTool_TopProject) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Transparency.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Transparency.hxx new file mode 100644 index 0000000..07b99f3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Transparency.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Transparency_HeaderFile +#define _Handle_McCadViewTool_Transparency_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Transparency; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Transparency); + +class Handle(McCadViewTool_Transparency) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Transparency)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Transparency)(const Handle(McCadViewTool_Transparency)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Transparency)(const McCadViewTool_Transparency* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Transparency)& operator=(const Handle(McCadViewTool_Transparency)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Transparency)& operator=(const McCadViewTool_Transparency* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Transparency* operator->() const + { + return (McCadViewTool_Transparency *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Transparency)(); + + Standard_EXPORT static const Handle(McCadViewTool_Transparency) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_WireFrame.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_WireFrame.hxx new file mode 100644 index 0000000..ed23284 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_WireFrame.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_WireFrame_HeaderFile +#define _Handle_McCadViewTool_WireFrame_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_WireFrame; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_WireFrame); + +class Handle(McCadViewTool_WireFrame) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_WireFrame)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_WireFrame)(const Handle(McCadViewTool_WireFrame)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_WireFrame)(const McCadViewTool_WireFrame* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_WireFrame)& operator=(const Handle(McCadViewTool_WireFrame)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_WireFrame)& operator=(const McCadViewTool_WireFrame* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_WireFrame* operator->() const + { + return (McCadViewTool_WireFrame *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_WireFrame)(); + + Standard_EXPORT static const Handle(McCadViewTool_WireFrame) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Zoom.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Zoom.hxx new file mode 100644 index 0000000..70c4bc4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_Zoom.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_Zoom_HeaderFile +#define _Handle_McCadViewTool_Zoom_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_Zoom; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_Zoom); + +class Handle(McCadViewTool_Zoom) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_Zoom)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_Zoom)(const Handle(McCadViewTool_Zoom)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_Zoom)(const McCadViewTool_Zoom* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_Zoom)& operator=(const Handle(McCadViewTool_Zoom)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_Zoom)& operator=(const McCadViewTool_Zoom* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_Zoom* operator->() const + { + return (McCadViewTool_Zoom *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_Zoom)(); + + Standard_EXPORT static const Handle(McCadViewTool_Zoom) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ZoomIn.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ZoomIn.hxx new file mode 100644 index 0000000..2f3950c --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ZoomIn.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_ZoomIn_HeaderFile +#define _Handle_McCadViewTool_ZoomIn_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_ZoomIn; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_ZoomIn); + +class Handle(McCadViewTool_ZoomIn) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_ZoomIn)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_ZoomIn)(const Handle(McCadViewTool_ZoomIn)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_ZoomIn)(const McCadViewTool_ZoomIn* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_ZoomIn)& operator=(const Handle(McCadViewTool_ZoomIn)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_ZoomIn)& operator=(const McCadViewTool_ZoomIn* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_ZoomIn* operator->() const + { + return (McCadViewTool_ZoomIn *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_ZoomIn)(); + + Standard_EXPORT static const Handle(McCadViewTool_ZoomIn) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ZoomOut.hxx b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ZoomOut.hxx new file mode 100644 index 0000000..e656409 --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadViewTool_ZoomOut.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadViewTool_ZoomOut_HeaderFile +#define _Handle_McCadViewTool_ZoomOut_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(McCadTool_Task); +class McCadViewTool_ZoomOut; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadViewTool_ZoomOut); + +class Handle(McCadViewTool_ZoomOut) : public Handle(McCadTool_Task) { + public: + Handle(McCadViewTool_ZoomOut)():Handle(McCadTool_Task)() {} + Handle(McCadViewTool_ZoomOut)(const Handle(McCadViewTool_ZoomOut)& aHandle) : Handle(McCadTool_Task)(aHandle) + { + } + + Handle(McCadViewTool_ZoomOut)(const McCadViewTool_ZoomOut* anItem) : Handle(McCadTool_Task)((McCadTool_Task *)anItem) + { + } + + Handle(McCadViewTool_ZoomOut)& operator=(const Handle(McCadViewTool_ZoomOut)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadViewTool_ZoomOut)& operator=(const McCadViewTool_ZoomOut* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadViewTool_ZoomOut* operator->() const + { + return (McCadViewTool_ZoomOut *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadViewTool_ZoomOut)(); + + Standard_EXPORT static const Handle(McCadViewTool_ZoomOut) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/Handle_McCadXCAF_Application.hxx b/src/MCCAD/McCadHeaders/Handle_McCadXCAF_Application.hxx new file mode 100644 index 0000000..73b610e --- /dev/null +++ b/src/MCCAD/McCadHeaders/Handle_McCadXCAF_Application.hxx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Handle_McCadXCAF_Application_HeaderFile +#define _Handle_McCadXCAF_Application_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TDocStd_Application_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TDocStd_Application); +class McCadXCAF_Application; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(McCadXCAF_Application); + +class Handle(McCadXCAF_Application) : public Handle(TDocStd_Application) { + public: + Handle(McCadXCAF_Application)():Handle(TDocStd_Application)() {} + Handle(McCadXCAF_Application)(const Handle(McCadXCAF_Application)& aHandle) : Handle(TDocStd_Application)(aHandle) + { + } + + Handle(McCadXCAF_Application)(const McCadXCAF_Application* anItem) : Handle(TDocStd_Application)((TDocStd_Application *)anItem) + { + } + + Handle(McCadXCAF_Application)& operator=(const Handle(McCadXCAF_Application)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(McCadXCAF_Application)& operator=(const McCadXCAF_Application* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + McCadXCAF_Application* operator->() const + { + return (McCadXCAF_Application *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(McCadXCAF_Application)(); + + Standard_EXPORT static const Handle(McCadXCAF_Application) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Application.hxx b/src/MCCAD/McCadHeaders/McCadAEV_Application.hxx new file mode 100644 index 0000000..8072d07 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Application.hxx @@ -0,0 +1,167 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_Application_HeaderFile +#define _McCadAEV_Application_HeaderFile + +#ifndef _OSD_Directory_HeaderFile +#include +#endif +#ifndef _OSD_Path_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_PluginManagerPtr_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePluginPtr_HeaderFile +#include +#endif +#ifndef _McCadAEV_EditorPtr_HeaderFile +#include +#endif +class OSD_Directory; +class OSD_Path; +class TColStd_HSequenceOfAsciiString; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! This class is the root class
+//! application.
+class McCadAEV_Application { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_Application(); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadAEV_Application() +{ + Destroy(); +} + + + +Standard_EXPORT virtual OSD_Directory ResourceDir() const; + + +Standard_EXPORT virtual void SetResourceDir(const OSD_Directory& theDir) ; + + +Standard_EXPORT virtual void SetPluginPath(const OSD_Path& thePath) ; + + +Standard_EXPORT virtual OSD_Path GetPluginPath() const; + + +Standard_EXPORT virtual Standard_Boolean LoadPlugins() ; + + +Standard_EXPORT virtual Standard_Boolean UnLoadPlugins() ; + + +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString Formats() const; + + +Standard_EXPORT virtual McCadEXPlug_ExchangePluginPtr GetPlugin(const TCollection_AsciiString& theExtension) const; + + +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + + +Standard_EXPORT virtual Standard_Boolean CheckExtension(const TCollection_AsciiString& theExtension) const; + + +Standard_EXPORT virtual void CloseEditor(const McCadAEV_EditorPtr& theEdPtr) ; + + +Standard_EXPORT virtual void OpenEditor(const McCadAEV_EditorPtr& theEdPtr) ; + + +Standard_EXPORT virtual void AddEditor(const McCadAEV_EditorPtr& theEdPtr) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +OSD_Directory myResourceDir; +OSD_Path myPluginPath; +McCadEXPlug_PluginManagerPtr myPluginManager; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Application.ixx b/src/MCCAD/McCadHeaders/McCadAEV_Application.ixx new file mode 100644 index 0000000..bd8eb53 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Application.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Application.jxx b/src/MCCAD/McCadHeaders/McCadAEV_Application.jxx new file mode 100644 index 0000000..c60ad31 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Application.jxx @@ -0,0 +1,15 @@ +#ifndef _OSD_Directory_HeaderFile +#include +#endif +#ifndef _OSD_Path_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadAEV_Application_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ApplicationPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ApplicationPtr.hxx new file mode 100644 index 0000000..1e02221 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ApplicationPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ApplicationPtr_HeaderFile +#define _McCadAEV_ApplicationPtr_HeaderFile + +class McCadAEV_Application; + +typedef McCadAEV_Application* McCadAEV_ApplicationPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Editor.hxx b/src/MCCAD/McCadHeaders/McCadAEV_Editor.hxx new file mode 100644 index 0000000..1e13fba --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Editor.hxx @@ -0,0 +1,131 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_Editor_HeaderFile +#define _McCadAEV_Editor_HeaderFile + +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#include +#endif +class McCadCom_Document; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! Editor class all application must
+//! use this class.
+class McCadAEV_Editor { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_Editor(); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +virtual ~McCadAEV_Editor() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Open() ; + + +Standard_EXPORT virtual void Close() ; + + +Standard_EXPORT virtual void Update() ; + + +Standard_EXPORT virtual void SetDocument(const Handle(McCadCom_Document)& theDoc) ; + + +Standard_EXPORT virtual Handle_McCadCom_Document GetDocument() const; + + +Standard_EXPORT virtual McCadAEV_ViewerPtr GetViewer() const; + + +Standard_EXPORT virtual void SetViewer(const McCadAEV_ViewerPtr& theViewerPtr) ; + + +Standard_EXPORT virtual void InitViewer() ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Editor.ixx b/src/MCCAD/McCadHeaders/McCadAEV_Editor.ixx new file mode 100644 index 0000000..a795342 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Editor.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Editor.jxx b/src/MCCAD/McCadHeaders/McCadAEV_Editor.jxx new file mode 100644 index 0000000..269d96d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Editor.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_EditorPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_EditorPtr.hxx new file mode 100644 index 0000000..1ee98fa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_EditorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_EditorPtr_HeaderFile +#define _McCadAEV_EditorPtr_HeaderFile + +class McCadAEV_Editor; + +typedef McCadAEV_Editor* McCadAEV_EditorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfEditor.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfEditor.hxx new file mode 100644 index 0000000..e07914d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfEditor.hxx @@ -0,0 +1,143 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListIteratorOfListOfEditor_HeaderFile +#define _McCadAEV_ListIteratorOfListOfEditor_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditor_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadAEV_ListOfEditor; +class McCadAEV_Editor; +class McCadAEV_ListNodeOfListOfEditor; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListIteratorOfListOfEditor { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfEditor(); + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfEditor(const McCadAEV_ListOfEditor& L); + + +Standard_EXPORT void Initialize(const McCadAEV_ListOfEditor& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT McCadAEV_Editor& Value() const; + + +friend class McCadAEV_ListOfEditor; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item McCadAEV_Editor +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditor +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditor_Type_() +#define TCollection_List McCadAEV_ListOfEditor +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfEditorPtr.hxx new file mode 100644 index 0000000..b7cc045 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfEditorPtr.hxx @@ -0,0 +1,145 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListIteratorOfListOfEditorPtr_HeaderFile +#define _McCadAEV_ListIteratorOfListOfEditorPtr_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _McCadAEV_EditorPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadAEV_ListOfEditorPtr; +class McCadAEV_ListNodeOfListOfEditorPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListIteratorOfListOfEditorPtr { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfEditorPtr(); + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfEditorPtr(const McCadAEV_ListOfEditorPtr& L); + + +Standard_EXPORT void Initialize(const McCadAEV_ListOfEditorPtr& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT McCadAEV_EditorPtr& Value() const; + + +friend class McCadAEV_ListOfEditorPtr; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item McCadAEV_EditorPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditorPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditorPtr_Type_() +#define TCollection_List McCadAEV_ListOfEditorPtr +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfViewer.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfViewer.hxx new file mode 100644 index 0000000..1372a93 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfViewer.hxx @@ -0,0 +1,143 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListIteratorOfListOfViewer_HeaderFile +#define _McCadAEV_ListIteratorOfListOfViewer_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadAEV_ListOfViewer; +class McCadAEV_Viewer; +class McCadAEV_ListNodeOfListOfViewer; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListIteratorOfListOfViewer { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfViewer(); + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfViewer(const McCadAEV_ListOfViewer& L); + + +Standard_EXPORT void Initialize(const McCadAEV_ListOfViewer& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT McCadAEV_Viewer& Value() const; + + +friend class McCadAEV_ListOfViewer; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item McCadAEV_Viewer +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewer +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewer_Type_() +#define TCollection_List McCadAEV_ListOfViewer +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfViewerPtr.hxx new file mode 100644 index 0000000..0b0a316 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListIteratorOfListOfViewerPtr.hxx @@ -0,0 +1,145 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListIteratorOfListOfViewerPtr_HeaderFile +#define _McCadAEV_ListIteratorOfListOfViewerPtr_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadAEV_ListOfViewerPtr; +class McCadAEV_ListNodeOfListOfViewerPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListIteratorOfListOfViewerPtr { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfViewerPtr(); + + +Standard_EXPORT McCadAEV_ListIteratorOfListOfViewerPtr(const McCadAEV_ListOfViewerPtr& L); + + +Standard_EXPORT void Initialize(const McCadAEV_ListOfViewerPtr& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT McCadAEV_ViewerPtr& Value() const; + + +friend class McCadAEV_ListOfViewerPtr; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item McCadAEV_ViewerPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewerPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewerPtr_Type_() +#define TCollection_List McCadAEV_ListOfViewerPtr +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfEditor.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfEditor.hxx new file mode 100644 index 0000000..fcbbdde --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfEditor.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListNodeOfListOfEditor_HeaderFile +#define _McCadAEV_ListNodeOfListOfEditor_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditor_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadAEV_Editor; +class McCadAEV_ListOfEditor; +class McCadAEV_ListIteratorOfListOfEditor; + + + +class McCadAEV_ListNodeOfListOfEditor : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadAEV_ListNodeOfListOfEditor(const McCadAEV_Editor& I,const TCollection_MapNodePtr& n); + + McCadAEV_Editor& Value() const; +//Standard_EXPORT ~McCadAEV_ListNodeOfListOfEditor(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_Editor myValue; + + +}; + +#define Item McCadAEV_Editor +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditor +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditor_Type_() +#define TCollection_List McCadAEV_ListOfEditor +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfEditorPtr.hxx new file mode 100644 index 0000000..971f2d8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfEditorPtr.hxx @@ -0,0 +1,118 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#define _McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#include +#endif + +#ifndef _McCadAEV_EditorPtr_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadAEV_ListOfEditorPtr; +class McCadAEV_ListIteratorOfListOfEditorPtr; + + + +class McCadAEV_ListNodeOfListOfEditorPtr : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadAEV_ListNodeOfListOfEditorPtr(const McCadAEV_EditorPtr& I,const TCollection_MapNodePtr& n); + + McCadAEV_EditorPtr& Value() const; +//Standard_EXPORT ~McCadAEV_ListNodeOfListOfEditorPtr(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_EditorPtr myValue; + + +}; + +#define Item McCadAEV_EditorPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditorPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditorPtr_Type_() +#define TCollection_List McCadAEV_ListOfEditorPtr +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfViewer.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfViewer.hxx new file mode 100644 index 0000000..cc25f0f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfViewer.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListNodeOfListOfViewer_HeaderFile +#define _McCadAEV_ListNodeOfListOfViewer_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewer_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadAEV_Viewer; +class McCadAEV_ListOfViewer; +class McCadAEV_ListIteratorOfListOfViewer; + + + +class McCadAEV_ListNodeOfListOfViewer : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadAEV_ListNodeOfListOfViewer(const McCadAEV_Viewer& I,const TCollection_MapNodePtr& n); + + McCadAEV_Viewer& Value() const; +//Standard_EXPORT ~McCadAEV_ListNodeOfListOfViewer(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_Viewer myValue; + + +}; + +#define Item McCadAEV_Viewer +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewer +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewer_Type_() +#define TCollection_List McCadAEV_ListOfViewer +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfViewerPtr.hxx new file mode 100644 index 0000000..c856147 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListNodeOfListOfViewerPtr.hxx @@ -0,0 +1,118 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#define _McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#include +#endif + +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadAEV_ListOfViewerPtr; +class McCadAEV_ListIteratorOfListOfViewerPtr; + + + +class McCadAEV_ListNodeOfListOfViewerPtr : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadAEV_ListNodeOfListOfViewerPtr(const McCadAEV_ViewerPtr& I,const TCollection_MapNodePtr& n); + + McCadAEV_ViewerPtr& Value() const; +//Standard_EXPORT ~McCadAEV_ListNodeOfListOfViewerPtr(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_ViewerPtr myValue; + + +}; + +#define Item McCadAEV_ViewerPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewerPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewerPtr_Type_() +#define TCollection_List McCadAEV_ListOfViewerPtr +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListOfEditor.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListOfEditor.hxx new file mode 100644 index 0000000..3b4601a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListOfEditor.hxx @@ -0,0 +1,197 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListOfEditor_HeaderFile +#define _McCadAEV_ListOfEditor_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditor_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadAEV_ListIteratorOfListOfEditor; +class McCadAEV_Editor; +class McCadAEV_ListNodeOfListOfEditor; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListOfEditor { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListOfEditor(); + + +Standard_EXPORT void Assign(const McCadAEV_ListOfEditor& Other) ; + void operator=(const McCadAEV_ListOfEditor& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadAEV_ListOfEditor() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const McCadAEV_Editor& I) ; + + +Standard_EXPORT void Prepend(const McCadAEV_Editor& I,McCadAEV_ListIteratorOfListOfEditor& theIt) ; + + +Standard_EXPORT void Prepend(McCadAEV_ListOfEditor& Other) ; + + +Standard_EXPORT void Append(const McCadAEV_Editor& I) ; + + +Standard_EXPORT void Append(const McCadAEV_Editor& I,McCadAEV_ListIteratorOfListOfEditor& theIt) ; + + +Standard_EXPORT void Append(McCadAEV_ListOfEditor& Other) ; + + +Standard_EXPORT McCadAEV_Editor& First() const; + + +Standard_EXPORT McCadAEV_Editor& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadAEV_ListIteratorOfListOfEditor& It) ; + + +Standard_EXPORT void InsertBefore(const McCadAEV_Editor& I,McCadAEV_ListIteratorOfListOfEditor& It) ; + + +Standard_EXPORT void InsertBefore(McCadAEV_ListOfEditor& Other,McCadAEV_ListIteratorOfListOfEditor& It) ; + + +Standard_EXPORT void InsertAfter(const McCadAEV_Editor& I,McCadAEV_ListIteratorOfListOfEditor& It) ; + + +Standard_EXPORT void InsertAfter(McCadAEV_ListOfEditor& Other,McCadAEV_ListIteratorOfListOfEditor& It) ; + + +friend class McCadAEV_ListIteratorOfListOfEditor; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_ListOfEditor(const McCadAEV_ListOfEditor& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item McCadAEV_Editor +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditor +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditor +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditor_Type_() +#define TCollection_List McCadAEV_ListOfEditor +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListOfEditorPtr.hxx new file mode 100644 index 0000000..9bbbb39 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListOfEditorPtr.hxx @@ -0,0 +1,199 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListOfEditorPtr_HeaderFile +#define _McCadAEV_ListOfEditorPtr_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _McCadAEV_EditorPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfEditorPtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadAEV_ListIteratorOfListOfEditorPtr; +class McCadAEV_ListNodeOfListOfEditorPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListOfEditorPtr { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListOfEditorPtr(); + + +Standard_EXPORT void Assign(const McCadAEV_ListOfEditorPtr& Other) ; + void operator=(const McCadAEV_ListOfEditorPtr& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadAEV_ListOfEditorPtr() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const McCadAEV_EditorPtr& I) ; + + +Standard_EXPORT void Prepend(const McCadAEV_EditorPtr& I,McCadAEV_ListIteratorOfListOfEditorPtr& theIt) ; + + +Standard_EXPORT void Prepend(McCadAEV_ListOfEditorPtr& Other) ; + + +Standard_EXPORT void Append(const McCadAEV_EditorPtr& I) ; + + +Standard_EXPORT void Append(const McCadAEV_EditorPtr& I,McCadAEV_ListIteratorOfListOfEditorPtr& theIt) ; + + +Standard_EXPORT void Append(McCadAEV_ListOfEditorPtr& Other) ; + + +Standard_EXPORT McCadAEV_EditorPtr& First() const; + + +Standard_EXPORT McCadAEV_EditorPtr& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadAEV_ListIteratorOfListOfEditorPtr& It) ; + + +Standard_EXPORT void InsertBefore(const McCadAEV_EditorPtr& I,McCadAEV_ListIteratorOfListOfEditorPtr& It) ; + + +Standard_EXPORT void InsertBefore(McCadAEV_ListOfEditorPtr& Other,McCadAEV_ListIteratorOfListOfEditorPtr& It) ; + + +Standard_EXPORT void InsertAfter(const McCadAEV_EditorPtr& I,McCadAEV_ListIteratorOfListOfEditorPtr& It) ; + + +Standard_EXPORT void InsertAfter(McCadAEV_ListOfEditorPtr& Other,McCadAEV_ListIteratorOfListOfEditorPtr& It) ; + + +friend class McCadAEV_ListIteratorOfListOfEditorPtr; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_ListOfEditorPtr(const McCadAEV_ListOfEditorPtr& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item McCadAEV_EditorPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfEditorPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfEditorPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfEditorPtr_Type_() +#define TCollection_List McCadAEV_ListOfEditorPtr +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListOfViewer.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListOfViewer.hxx new file mode 100644 index 0000000..788c704 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListOfViewer.hxx @@ -0,0 +1,197 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListOfViewer_HeaderFile +#define _McCadAEV_ListOfViewer_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewer_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadAEV_ListIteratorOfListOfViewer; +class McCadAEV_Viewer; +class McCadAEV_ListNodeOfListOfViewer; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListOfViewer { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListOfViewer(); + + +Standard_EXPORT void Assign(const McCadAEV_ListOfViewer& Other) ; + void operator=(const McCadAEV_ListOfViewer& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadAEV_ListOfViewer() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const McCadAEV_Viewer& I) ; + + +Standard_EXPORT void Prepend(const McCadAEV_Viewer& I,McCadAEV_ListIteratorOfListOfViewer& theIt) ; + + +Standard_EXPORT void Prepend(McCadAEV_ListOfViewer& Other) ; + + +Standard_EXPORT void Append(const McCadAEV_Viewer& I) ; + + +Standard_EXPORT void Append(const McCadAEV_Viewer& I,McCadAEV_ListIteratorOfListOfViewer& theIt) ; + + +Standard_EXPORT void Append(McCadAEV_ListOfViewer& Other) ; + + +Standard_EXPORT McCadAEV_Viewer& First() const; + + +Standard_EXPORT McCadAEV_Viewer& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadAEV_ListIteratorOfListOfViewer& It) ; + + +Standard_EXPORT void InsertBefore(const McCadAEV_Viewer& I,McCadAEV_ListIteratorOfListOfViewer& It) ; + + +Standard_EXPORT void InsertBefore(McCadAEV_ListOfViewer& Other,McCadAEV_ListIteratorOfListOfViewer& It) ; + + +Standard_EXPORT void InsertAfter(const McCadAEV_Viewer& I,McCadAEV_ListIteratorOfListOfViewer& It) ; + + +Standard_EXPORT void InsertAfter(McCadAEV_ListOfViewer& Other,McCadAEV_ListIteratorOfListOfViewer& It) ; + + +friend class McCadAEV_ListIteratorOfListOfViewer; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_ListOfViewer(const McCadAEV_ListOfViewer& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item McCadAEV_Viewer +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewer +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewer +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewer_Type_() +#define TCollection_List McCadAEV_ListOfViewer +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ListOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ListOfViewerPtr.hxx new file mode 100644 index 0000000..0febd0e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ListOfViewerPtr.hxx @@ -0,0 +1,199 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ListOfViewerPtr_HeaderFile +#define _McCadAEV_ListOfViewerPtr_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_ListNodeOfListOfViewerPtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadAEV_ListIteratorOfListOfViewerPtr; +class McCadAEV_ListNodeOfListOfViewerPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_ListOfViewerPtr { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_ListOfViewerPtr(); + + +Standard_EXPORT void Assign(const McCadAEV_ListOfViewerPtr& Other) ; + void operator=(const McCadAEV_ListOfViewerPtr& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadAEV_ListOfViewerPtr() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const McCadAEV_ViewerPtr& I) ; + + +Standard_EXPORT void Prepend(const McCadAEV_ViewerPtr& I,McCadAEV_ListIteratorOfListOfViewerPtr& theIt) ; + + +Standard_EXPORT void Prepend(McCadAEV_ListOfViewerPtr& Other) ; + + +Standard_EXPORT void Append(const McCadAEV_ViewerPtr& I) ; + + +Standard_EXPORT void Append(const McCadAEV_ViewerPtr& I,McCadAEV_ListIteratorOfListOfViewerPtr& theIt) ; + + +Standard_EXPORT void Append(McCadAEV_ListOfViewerPtr& Other) ; + + +Standard_EXPORT McCadAEV_ViewerPtr& First() const; + + +Standard_EXPORT McCadAEV_ViewerPtr& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadAEV_ListIteratorOfListOfViewerPtr& It) ; + + +Standard_EXPORT void InsertBefore(const McCadAEV_ViewerPtr& I,McCadAEV_ListIteratorOfListOfViewerPtr& It) ; + + +Standard_EXPORT void InsertBefore(McCadAEV_ListOfViewerPtr& Other,McCadAEV_ListIteratorOfListOfViewerPtr& It) ; + + +Standard_EXPORT void InsertAfter(const McCadAEV_ViewerPtr& I,McCadAEV_ListIteratorOfListOfViewerPtr& It) ; + + +Standard_EXPORT void InsertAfter(McCadAEV_ListOfViewerPtr& Other,McCadAEV_ListIteratorOfListOfViewerPtr& It) ; + + +friend class McCadAEV_ListIteratorOfListOfViewerPtr; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_ListOfViewerPtr(const McCadAEV_ListOfViewerPtr& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item McCadAEV_ViewerPtr +#define Item_hxx +#define TCollection_ListNode McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadAEV_ListIteratorOfListOfViewerPtr +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadAEV_ListNodeOfListOfViewerPtr +#define TCollection_ListNode_Type_() McCadAEV_ListNodeOfListOfViewerPtr_Type_() +#define TCollection_List McCadAEV_ListOfViewerPtr +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfEditor.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfEditor.hxx new file mode 100644 index 0000000..d8395b1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfEditor.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile +#define _McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Editor_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadAEV_Editor; +class McCadAEV_SequenceOfEditor; + + + +class McCadAEV_SequenceNodeOfSequenceOfEditor : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadAEV_SequenceNodeOfSequenceOfEditor(const McCadAEV_Editor& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadAEV_Editor& Value() const; +//Standard_EXPORT ~McCadAEV_SequenceNodeOfSequenceOfEditor(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_Editor myValue; + + +}; + +#define SeqItem McCadAEV_Editor +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditor_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditor +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfEditorPtr.hxx new file mode 100644 index 0000000..758375e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfEditorPtr.hxx @@ -0,0 +1,113 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile +#define _McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile +#include +#endif + +#ifndef _McCadAEV_EditorPtr_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadAEV_SequenceOfEditorPtr; + + + +class McCadAEV_SequenceNodeOfSequenceOfEditorPtr : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadAEV_SequenceNodeOfSequenceOfEditorPtr(const McCadAEV_EditorPtr& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadAEV_EditorPtr& Value() const; +//Standard_EXPORT ~McCadAEV_SequenceNodeOfSequenceOfEditorPtr(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_EditorPtr myValue; + + +}; + +#define SeqItem McCadAEV_EditorPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditorPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditorPtr +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfViewer.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfViewer.hxx new file mode 100644 index 0000000..252cab3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfViewer.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile +#define _McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile +#include +#endif + +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadAEV_Viewer; +class McCadAEV_SequenceOfViewer; + + + +class McCadAEV_SequenceNodeOfSequenceOfViewer : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadAEV_SequenceNodeOfSequenceOfViewer(const McCadAEV_Viewer& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadAEV_Viewer& Value() const; +//Standard_EXPORT ~McCadAEV_SequenceNodeOfSequenceOfViewer(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_Viewer myValue; + + +}; + +#define SeqItem McCadAEV_Viewer +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewer_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewer +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfViewerPtr.hxx new file mode 100644 index 0000000..a26f177 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceNodeOfSequenceOfViewerPtr.hxx @@ -0,0 +1,113 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile +#define _McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile +#include +#endif + +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadAEV_SequenceOfViewerPtr; + + + +class McCadAEV_SequenceNodeOfSequenceOfViewerPtr : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadAEV_SequenceNodeOfSequenceOfViewerPtr(const McCadAEV_ViewerPtr& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadAEV_ViewerPtr& Value() const; +//Standard_EXPORT ~McCadAEV_SequenceNodeOfSequenceOfViewerPtr(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadAEV_ViewerPtr myValue; + + +}; + +#define SeqItem McCadAEV_ViewerPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewerPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewerPtr +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfEditor.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfEditor.hxx new file mode 100644 index 0000000..e9040a2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfEditor.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceOfEditor_HeaderFile +#define _McCadAEV_SequenceOfEditor_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfEditor_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadAEV_Editor; +class McCadAEV_SequenceNodeOfSequenceOfEditor; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_SequenceOfEditor : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadAEV_SequenceOfEditor(); + + +Standard_EXPORT void Clear() ; +~McCadAEV_SequenceOfEditor() +{ + Clear(); +} + + + +Standard_EXPORT const McCadAEV_SequenceOfEditor& Assign(const McCadAEV_SequenceOfEditor& Other) ; + const McCadAEV_SequenceOfEditor& operator =(const McCadAEV_SequenceOfEditor& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadAEV_Editor& T) ; + + void Append(McCadAEV_SequenceOfEditor& S) ; + + +Standard_EXPORT void Prepend(const McCadAEV_Editor& T) ; + + void Prepend(McCadAEV_SequenceOfEditor& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadAEV_Editor& T) ; + + void InsertBefore(const Standard_Integer Index,McCadAEV_SequenceOfEditor& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadAEV_Editor& T) ; + + void InsertAfter(const Standard_Integer Index,McCadAEV_SequenceOfEditor& S) ; + + +Standard_EXPORT const McCadAEV_Editor& First() const; + + +Standard_EXPORT const McCadAEV_Editor& Last() const; + + void Split(const Standard_Integer Index,McCadAEV_SequenceOfEditor& Sub) ; + + +Standard_EXPORT const McCadAEV_Editor& Value(const Standard_Integer Index) const; + const McCadAEV_Editor& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadAEV_Editor& I) ; + + +Standard_EXPORT McCadAEV_Editor& ChangeValue(const Standard_Integer Index) ; + McCadAEV_Editor& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_SequenceOfEditor(const McCadAEV_SequenceOfEditor& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadAEV_Editor +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditor +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditor_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditor +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfEditorPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfEditorPtr.hxx new file mode 100644 index 0000000..ea2a791 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfEditorPtr.hxx @@ -0,0 +1,193 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceOfEditorPtr_HeaderFile +#define _McCadAEV_SequenceOfEditorPtr_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _McCadAEV_EditorPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadAEV_SequenceNodeOfSequenceOfEditorPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_SequenceOfEditorPtr : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadAEV_SequenceOfEditorPtr(); + + +Standard_EXPORT void Clear() ; +~McCadAEV_SequenceOfEditorPtr() +{ + Clear(); +} + + + +Standard_EXPORT const McCadAEV_SequenceOfEditorPtr& Assign(const McCadAEV_SequenceOfEditorPtr& Other) ; + const McCadAEV_SequenceOfEditorPtr& operator =(const McCadAEV_SequenceOfEditorPtr& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadAEV_EditorPtr& T) ; + + void Append(McCadAEV_SequenceOfEditorPtr& S) ; + + +Standard_EXPORT void Prepend(const McCadAEV_EditorPtr& T) ; + + void Prepend(McCadAEV_SequenceOfEditorPtr& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadAEV_EditorPtr& T) ; + + void InsertBefore(const Standard_Integer Index,McCadAEV_SequenceOfEditorPtr& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadAEV_EditorPtr& T) ; + + void InsertAfter(const Standard_Integer Index,McCadAEV_SequenceOfEditorPtr& S) ; + + +Standard_EXPORT const McCadAEV_EditorPtr& First() const; + + +Standard_EXPORT const McCadAEV_EditorPtr& Last() const; + + void Split(const Standard_Integer Index,McCadAEV_SequenceOfEditorPtr& Sub) ; + + +Standard_EXPORT const McCadAEV_EditorPtr& Value(const Standard_Integer Index) const; + const McCadAEV_EditorPtr& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadAEV_EditorPtr& I) ; + + +Standard_EXPORT McCadAEV_EditorPtr& ChangeValue(const Standard_Integer Index) ; + McCadAEV_EditorPtr& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_SequenceOfEditorPtr(const McCadAEV_SequenceOfEditorPtr& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadAEV_EditorPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfEditorPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfEditorPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfEditorPtr +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfViewer.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfViewer.hxx new file mode 100644 index 0000000..3275ad2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfViewer.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceOfViewer_HeaderFile +#define _McCadAEV_SequenceOfViewer_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfViewer_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadAEV_Viewer; +class McCadAEV_SequenceNodeOfSequenceOfViewer; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_SequenceOfViewer : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadAEV_SequenceOfViewer(); + + +Standard_EXPORT void Clear() ; +~McCadAEV_SequenceOfViewer() +{ + Clear(); +} + + + +Standard_EXPORT const McCadAEV_SequenceOfViewer& Assign(const McCadAEV_SequenceOfViewer& Other) ; + const McCadAEV_SequenceOfViewer& operator =(const McCadAEV_SequenceOfViewer& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadAEV_Viewer& T) ; + + void Append(McCadAEV_SequenceOfViewer& S) ; + + +Standard_EXPORT void Prepend(const McCadAEV_Viewer& T) ; + + void Prepend(McCadAEV_SequenceOfViewer& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadAEV_Viewer& T) ; + + void InsertBefore(const Standard_Integer Index,McCadAEV_SequenceOfViewer& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadAEV_Viewer& T) ; + + void InsertAfter(const Standard_Integer Index,McCadAEV_SequenceOfViewer& S) ; + + +Standard_EXPORT const McCadAEV_Viewer& First() const; + + +Standard_EXPORT const McCadAEV_Viewer& Last() const; + + void Split(const Standard_Integer Index,McCadAEV_SequenceOfViewer& Sub) ; + + +Standard_EXPORT const McCadAEV_Viewer& Value(const Standard_Integer Index) const; + const McCadAEV_Viewer& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadAEV_Viewer& I) ; + + +Standard_EXPORT McCadAEV_Viewer& ChangeValue(const Standard_Integer Index) ; + McCadAEV_Viewer& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_SequenceOfViewer(const McCadAEV_SequenceOfViewer& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadAEV_Viewer +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewer +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewer_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewer +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfViewerPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfViewerPtr.hxx new file mode 100644 index 0000000..456e582 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_SequenceOfViewerPtr.hxx @@ -0,0 +1,193 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_SequenceOfViewerPtr_HeaderFile +#define _McCadAEV_SequenceOfViewerPtr_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadAEV_SequenceNodeOfSequenceOfViewerPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadAEV_SequenceOfViewerPtr : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadAEV_SequenceOfViewerPtr(); + + +Standard_EXPORT void Clear() ; +~McCadAEV_SequenceOfViewerPtr() +{ + Clear(); +} + + + +Standard_EXPORT const McCadAEV_SequenceOfViewerPtr& Assign(const McCadAEV_SequenceOfViewerPtr& Other) ; + const McCadAEV_SequenceOfViewerPtr& operator =(const McCadAEV_SequenceOfViewerPtr& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadAEV_ViewerPtr& T) ; + + void Append(McCadAEV_SequenceOfViewerPtr& S) ; + + +Standard_EXPORT void Prepend(const McCadAEV_ViewerPtr& T) ; + + void Prepend(McCadAEV_SequenceOfViewerPtr& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadAEV_ViewerPtr& T) ; + + void InsertBefore(const Standard_Integer Index,McCadAEV_SequenceOfViewerPtr& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadAEV_ViewerPtr& T) ; + + void InsertAfter(const Standard_Integer Index,McCadAEV_SequenceOfViewerPtr& S) ; + + +Standard_EXPORT const McCadAEV_ViewerPtr& First() const; + + +Standard_EXPORT const McCadAEV_ViewerPtr& Last() const; + + void Split(const Standard_Integer Index,McCadAEV_SequenceOfViewerPtr& Sub) ; + + +Standard_EXPORT const McCadAEV_ViewerPtr& Value(const Standard_Integer Index) const; + const McCadAEV_ViewerPtr& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadAEV_ViewerPtr& I) ; + + +Standard_EXPORT McCadAEV_ViewerPtr& ChangeValue(const Standard_Integer Index) ; + McCadAEV_ViewerPtr& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadAEV_SequenceOfViewerPtr(const McCadAEV_SequenceOfViewerPtr& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadAEV_ViewerPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadAEV_SequenceNodeOfSequenceOfViewerPtr +#define TCollection_SequenceNode_Type_() McCadAEV_SequenceNodeOfSequenceOfViewerPtr_Type_() +#define TCollection_Sequence McCadAEV_SequenceOfViewerPtr +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Viewer.hxx b/src/MCCAD/McCadHeaders/McCadAEV_Viewer.hxx new file mode 100644 index 0000000..2475763 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Viewer.hxx @@ -0,0 +1,158 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_Viewer_HeaderFile +#define _McCadAEV_Viewer_HeaderFile + +#ifndef _Handle_V3d_Viewer_HeaderFile +#include +#endif +#ifndef _Handle_AIS_InteractiveContext_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_CString_HeaderFile +#include +#endif +#ifndef _Standard_ExtString_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _V3d_TypeOfOrientation_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class V3d_Viewer; +class AIS_InteractiveContext; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! Viewer class all application must
+//! use this class.
+class McCadAEV_Viewer { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadAEV_Viewer(); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadAEV_Viewer() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Update() ; + + +Standard_EXPORT virtual void Reconfigure() ; + + +Standard_EXPORT virtual Handle_AIS_InteractiveContext GetContext() const; + + +Standard_EXPORT virtual void SetContext(const Handle(AIS_InteractiveContext)& theContext) ; + + +Standard_EXPORT virtual Handle_V3d_Viewer MakeCasViewer(const Standard_CString theDisplay,const Standard_ExtString theName,const Standard_CString theDomain,const Standard_Real theViewSize,const V3d_TypeOfOrientation theViewProj,const Standard_Boolean theCompMode,const Standard_Boolean theDefCompMode) ; + + +Standard_EXPORT virtual Handle_V3d_Viewer GetViewer() const; + + +Standard_EXPORT virtual void SetViewer(const Handle(V3d_Viewer)& theViewer) ; + + +Standard_EXPORT virtual TCollection_AsciiString GetName() const; + + +Standard_EXPORT virtual void SetName(const TCollection_AsciiString& theName) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Handle_V3d_Viewer myViewer; +Handle_V3d_Viewer myCollector; +Handle_AIS_InteractiveContext myContext; +TCollection_AsciiString myName; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Viewer.ixx b/src/MCCAD/McCadHeaders/McCadAEV_Viewer.ixx new file mode 100644 index 0000000..8df6758 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Viewer.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadAEV_Viewer.jxx b/src/MCCAD/McCadHeaders/McCadAEV_Viewer.jxx new file mode 100644 index 0000000..ab49bcf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_Viewer.jxx @@ -0,0 +1,12 @@ +#ifndef _V3d_Viewer_HeaderFile +#include +#endif +#ifndef _AIS_InteractiveContext_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadAEV_Viewer_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadAEV_ViewerPtr.hxx b/src/MCCAD/McCadHeaders/McCadAEV_ViewerPtr.hxx new file mode 100644 index 0000000..eb84862 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadAEV_ViewerPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadAEV_ViewerPtr_HeaderFile +#define _McCadAEV_ViewerPtr_HeaderFile + +class McCadAEV_Viewer; + +typedef McCadAEV_Viewer* McCadAEV_ViewerPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.hxx b/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.hxx new file mode 100644 index 0000000..48f0f14 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.hxx @@ -0,0 +1,134 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadBoolExp_ExprParser_HeaderFile +#define _McCadBoolExp_ExprParser_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + + +class McCadBoolExp_ExprParser { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Creates a postfix CSG expr. from infix MCNP syntax.
+//! uses ExprParser to complete the infix expression
+//!
+Standard_EXPORT McCadBoolExp_ExprParser(); + + +Standard_EXPORT McCadBoolExp_ExprParser(const Handle(TColStd_HSequenceOfAsciiString)& inputCSGSeq); + + +Standard_EXPORT void Init(const Handle(TColStd_HSequenceOfAsciiString)& inputCSGSeq) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void SetInFix(const Handle(TColStd_HSequenceOfAsciiString)& inputCSGSeq) ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetInFix() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT void Expression() ; + + +Standard_EXPORT void Term() ; + + +Standard_EXPORT void Factor() ; + + + // Fields PRIVATE + // +Standard_Boolean myIsDone; +Handle_TColStd_HSequenceOfAsciiString myInputInFixCSG; +Handle_TColStd_HSequenceOfAsciiString myInFixCSG; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.ixx b/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.ixx new file mode 100644 index 0000000..4f25728 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.jxx b/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.jxx new file mode 100644 index 0000000..02e2cda --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadBoolExp_ExprParser.jxx @@ -0,0 +1,6 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _McCadBoolExp_ExprParser_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.hxx b/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.hxx new file mode 100644 index 0000000..df880e9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.hxx @@ -0,0 +1,147 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadBoolExp_PostFixer_HeaderFile +#define _McCadBoolExp_PostFixer_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadBoolExp_PostFixer { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Creates a postfix CSG expr. from infix MCNP syntax.
+//! uses ExprParser to complete the infix expression
+//!
+Standard_EXPORT McCadBoolExp_PostFixer(); + + +Standard_EXPORT McCadBoolExp_PostFixer(const TCollection_AsciiString& theCSG); + + +Standard_EXPORT void Init(const TCollection_AsciiString& theCSG) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetPostFix() const; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetInFix() const; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetInput() const; + + +Standard_EXPORT void PrintInFix(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintPostFix(Standard_OStream& theStream) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Standard_Integer Priority(const TCollection_AsciiString& theToken) const; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString PostFix(const Handle(TColStd_HSequenceOfAsciiString)& theInFix) ; + + + // Fields PRIVATE + // +Standard_Boolean myIsDone; +Handle_TColStd_HSequenceOfAsciiString myInPutCSG; +Handle_TColStd_HSequenceOfAsciiString myInFixCSG; +Handle_TColStd_HSequenceOfAsciiString myPostFixCSG; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.ixx b/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.ixx new file mode 100644 index 0000000..90eb11a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.jxx b/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.jxx new file mode 100644 index 0000000..f650004 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadBoolExp_PostFixer.jxx @@ -0,0 +1,9 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadBoolExp_PostFixer_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.hxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.hxx new file mode 100644 index 0000000..22bc7dd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.hxx @@ -0,0 +1,145 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGAdapt_FaceAnalyser_HeaderFile +#define _McCadCSGAdapt_FaceAnalyser_HeaderFile + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _TopoDS_Shell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class TopoDS_Shell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGAdapt_FaceAnalyser { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! analysis and repair of shells, faces and edges.
+//! This is just a primitive, temporary solution mimicking cascade.
+//! Should be replaced soon!!!
+Standard_EXPORT McCadCSGAdapt_FaceAnalyser(); + + +Standard_EXPORT McCadCSGAdapt_FaceAnalyser(const TopoDS_Shell& theShell); + + +Standard_EXPORT void Init(const TopoDS_Shell& theShell) ; + + +Standard_EXPORT void SetPrecision(const Standard_Real thePrecision) ; + + +Standard_EXPORT Standard_Real GetPrecision() const; + + +Standard_EXPORT TopoDS_Shell FixedShell() ; + + +Standard_EXPORT Standard_Boolean HaveSmallFaces() const; + + +Standard_EXPORT void DeleteSmallFaces() ; + + +Standard_EXPORT Standard_Boolean HaveSmallEdges() const; + + +Standard_EXPORT void DeleteSmallEdges() ; + + +Standard_EXPORT Standard_Boolean HaveInDirectFaces() const; + + +Standard_EXPORT void DoDirectFaces() ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Fix() ; + + + // Fields PRIVATE + // +Standard_Real myPrecision; +TopoDS_Shell myShell; +Standard_Boolean isFixed; +Standard_Boolean haveSmallFaces; +Standard_Boolean haveSmallEdges; +Standard_Boolean haveIndirect; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.ixx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.ixx new file mode 100644 index 0000000..335e0bc --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.jxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.jxx new file mode 100644 index 0000000..b713650 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_FaceAnalyser.jxx @@ -0,0 +1,6 @@ +#ifndef _TopoDS_Shell_HeaderFile +#include +#endif +#ifndef _McCadCSGAdapt_FaceAnalyser_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.hxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.hxx new file mode 100644 index 0000000..3065357 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.hxx @@ -0,0 +1,126 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGAdapt_ShapeAnalyser_HeaderFile +#define _McCadCSGAdapt_ShapeAnalyser_HeaderFile + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TopoDS_Shape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGAdapt_ShapeAnalyser { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! analysis and repair of shapes
+Standard_EXPORT McCadCSGAdapt_ShapeAnalyser(); + + +Standard_EXPORT McCadCSGAdapt_ShapeAnalyser(const TopoDS_Shape& theShape); + + +Standard_EXPORT void Init(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT void SetTolerance(const Standard_Real theTol) ; + + +Standard_EXPORT Standard_Real GetTolerance() const; + + +Standard_EXPORT void PrintContent(Standard_OStream& theStream) const; + + +Standard_EXPORT void PrintInfo(Standard_OStream& theStream) const; + + +Standard_EXPORT void ScaleShape(const Standard_Real theFactor) ; + + +Standard_EXPORT TopoDS_Shape Shape() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Shape myShape; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.ixx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.ixx new file mode 100644 index 0000000..03445f3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.jxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.jxx new file mode 100644 index 0000000..8c94bee --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeAnalyser.jxx @@ -0,0 +1,6 @@ +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _McCadCSGAdapt_ShapeAnalyser_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.hxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.hxx new file mode 100644 index 0000000..efa4afa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.hxx @@ -0,0 +1,207 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGAdapt_ShapeGeomAnalyser_HeaderFile +#define _McCadCSGAdapt_ShapeGeomAnalyser_HeaderFile + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TopoDS_Shape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGAdapt_ShapeGeomAnalyser { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! geometric analysis of a shape
+Standard_EXPORT McCadCSGAdapt_ShapeGeomAnalyser(); + + +Standard_EXPORT McCadCSGAdapt_ShapeGeomAnalyser(const TopoDS_Shape& theShape); + + +Standard_EXPORT void SetShape(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT TopoDS_Shape GetShape() const; + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT void PrintSurfaceInfo(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintShapeInfo(Standard_OStream& theStream) const; + + +Standard_EXPORT Standard_Boolean Convertibly() const; + + +Standard_EXPORT Standard_Integer GetNbPlane() const; + + +Standard_EXPORT Standard_Integer GetNbCylinder() const; + + +Standard_EXPORT Standard_Integer GetNbCone() const; + + +Standard_EXPORT Standard_Integer GetNbSphere() const; + + +Standard_EXPORT Standard_Integer GetNbTorus() const; + + +Standard_EXPORT Standard_Integer GetNbBezierSurface() const; + + +Standard_EXPORT Standard_Integer GetNbBSplineSurface() const; + + +Standard_EXPORT Standard_Integer GetNbSurfaceOfRevolution() const; + + +Standard_EXPORT Standard_Integer GetNbSurfaceOfExtrusion() const; + + +Standard_EXPORT Standard_Integer GetNbOffsetSurface() const; + + +Standard_EXPORT Standard_Integer GetNbUnspecifiedSurf() const; + + +Standard_EXPORT Standard_Integer GetNbLine() const; + + +Standard_EXPORT Standard_Integer GetNbCircle() const; + + +Standard_EXPORT Standard_Integer GetNbEllipse() const; + + +Standard_EXPORT Standard_Integer GetNbHyperbola() const; + + +Standard_EXPORT Standard_Integer GetNbParabola() const; + + +Standard_EXPORT Standard_Integer GetNbBezierCurve() const; + + +Standard_EXPORT Standard_Integer GetNbBSplineCurve() const; + + +Standard_EXPORT Standard_Integer GetNbUnspecifiedCurves() const; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Shape myShape; +Standard_Boolean myConvertibly; +Standard_Boolean myIsDone; +Standard_Integer myNbPlane; +Standard_Integer myNbCylinder; +Standard_Integer myNbCone; +Standard_Integer myNbSphere; +Standard_Integer myNbTorus; +Standard_Integer myNbBezierSurface; +Standard_Integer myNbBSplineSurface; +Standard_Integer myNbSurfaceOfRevolution; +Standard_Integer myNbSurfaceOfExtrusion; +Standard_Integer myNbOffsetSurface; +Standard_Integer myNbUnspecifiedSurf; +Standard_Integer myNbLine; +Standard_Integer myNbCircle; +Standard_Integer myNbEllipse; +Standard_Integer myNbHyperbola; +Standard_Integer myNbParabola; +Standard_Integer myNbBezierCurve; +Standard_Integer myNbBSplineCurve; +Standard_Integer myNbUnspecifiedCurves; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.ixx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.ixx new file mode 100644 index 0000000..573a73e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.jxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.jxx new file mode 100644 index 0000000..1f4742a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShapeGeomAnalyser.jxx @@ -0,0 +1,6 @@ +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _McCadCSGAdapt_ShapeGeomAnalyser_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.hxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.hxx new file mode 100644 index 0000000..9ab23ee --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.hxx @@ -0,0 +1,117 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGAdapt_ShellAnalyser_HeaderFile +#define _McCadCSGAdapt_ShellAnalyser_HeaderFile + +#ifndef _TopoDS_Shell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class TopoDS_Shell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGAdapt_ShellAnalyser { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! analysis and repair of shells, faces and edges.
+//! This is just a primitive, temporary solution mimicking cascade.
+//! Should be replaced soon!!!
+Standard_EXPORT McCadCSGAdapt_ShellAnalyser(); + + +Standard_EXPORT McCadCSGAdapt_ShellAnalyser(const TopoDS_Shell& theShell); + + +Standard_EXPORT void Init(const TopoDS_Shell& theShell) ; + + +Standard_EXPORT Standard_Boolean CheckShell() const; + + +Standard_EXPORT TopoDS_Shell FixedShell() ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Fix() ; + + + // Fields PRIVATE + // +TopoDS_Shell myShell; +Standard_Boolean isFixed; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.ixx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.ixx new file mode 100644 index 0000000..3086cbf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.jxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.jxx new file mode 100644 index 0000000..1396061 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_ShellAnalyser.jxx @@ -0,0 +1,6 @@ +#ifndef _TopoDS_Shell_HeaderFile +#include +#endif +#ifndef _McCadCSGAdapt_ShellAnalyser_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.hxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.hxx new file mode 100644 index 0000000..fbe34fd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.hxx @@ -0,0 +1,120 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGAdapt_SolidAnalyser_HeaderFile +#define _McCadCSGAdapt_SolidAnalyser_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class TopoDS_Solid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +/** Encapsulation of the OCC shape fixer ShapeFix_Solid*/ +class McCadCSGAdapt_SolidAnalyser { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +/** analysis and repair of shapes
*/ +Standard_EXPORT McCadCSGAdapt_SolidAnalyser(); + +/** ctor with initialization */ +Standard_EXPORT McCadCSGAdapt_SolidAnalyser(const TopoDS_Solid& theSolid); + +/** initialize values */ +Standard_EXPORT void Init(const TopoDS_Solid& theSolid) ; + +/** call Fix() and return fixed solid */ +Standard_EXPORT TopoDS_Solid FixedSolid() ; + +/** returns status of fixing state (true/false) */ +bool IsFixed(); + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Fix() ; + + + // Fields PRIVATE + // +Standard_Boolean myIsFixed; +Standard_Boolean isDecomposed; +Handle_TopTools_HSequenceOfShape myResultSolid; +TopoDS_Solid myFirstSolid; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.ixx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.ixx new file mode 100644 index 0000000..40115f0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.jxx b/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.jxx new file mode 100644 index 0000000..a551468 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGAdapt_SolidAnalyser.jxx @@ -0,0 +1,9 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGAdapt_SolidAnalyser_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_HSequenceOfSolid.hxx b/src/MCCAD/McCadHeaders/McCadCSGBuild_HSequenceOfSolid.hxx new file mode 100644 index 0000000..21978a1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_HSequenceOfSolid.hxx @@ -0,0 +1,183 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGBuild_HSequenceOfSolid_HeaderFile +#define _McCadCSGBuild_HSequenceOfSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGBuild_HSequenceOfSolid_HeaderFile +#include +#endif + +#ifndef _McCadCSGBuild_SequenceOfSolid_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class TopoDS_Solid; +class McCadCSGBuild_SequenceOfSolid; + + + +class McCadCSGBuild_HSequenceOfSolid : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadCSGBuild_HSequenceOfSolid(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const TopoDS_Solid& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadCSGBuild_HSequenceOfSolid)& aSequence) ; + + +Standard_EXPORT void Prepend(const TopoDS_Solid& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGBuild_HSequenceOfSolid)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const TopoDS_Solid& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGBuild_HSequenceOfSolid)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const TopoDS_Solid& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGBuild_HSequenceOfSolid)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadCSGBuild_HSequenceOfSolid Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const TopoDS_Solid& anItem) ; + + +Standard_EXPORT const TopoDS_Solid& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT TopoDS_Solid& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadCSGBuild_SequenceOfSolid& Sequence() const; + + McCadCSGBuild_SequenceOfSolid& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadCSGBuild_HSequenceOfSolid ShallowCopy() const; +//Standard_EXPORT ~McCadCSGBuild_HSequenceOfSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadCSGBuild_SequenceOfSolid mySequence; + + +}; + +#define Item TopoDS_Solid +#define Item_hxx +#define TheSequence McCadCSGBuild_SequenceOfSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGBuild_HSequenceOfSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGBuild_HSequenceOfSolid +#define TCollection_HSequence_Type_() McCadCSGBuild_HSequenceOfSolid_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadCSGBuild_HSequenceOfSolid ShallowCopy(const Handle_McCadCSGBuild_HSequenceOfSolid& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_SequenceNodeOfSequenceOfSolid.hxx b/src/MCCAD/McCadHeaders/McCadCSGBuild_SequenceNodeOfSequenceOfSolid.hxx new file mode 100644 index 0000000..1f2551f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_SequenceNodeOfSequenceOfSolid.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGBuild_SequenceNodeOfSequenceOfSolid_HeaderFile +#define _McCadCSGBuild_SequenceNodeOfSequenceOfSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid_HeaderFile +#include +#endif + +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class TopoDS_Solid; +class McCadCSGBuild_SequenceOfSolid; + + + +class McCadCSGBuild_SequenceNodeOfSequenceOfSolid : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCSGBuild_SequenceNodeOfSequenceOfSolid(const TopoDS_Solid& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + TopoDS_Solid& Value() const; +//Standard_EXPORT ~McCadCSGBuild_SequenceNodeOfSequenceOfSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Solid myValue; + + +}; + +#define SeqItem TopoDS_Solid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGBuild_SequenceNodeOfSequenceOfSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid +#define TCollection_SequenceNode_Type_() McCadCSGBuild_SequenceNodeOfSequenceOfSolid_Type_() +#define TCollection_Sequence McCadCSGBuild_SequenceOfSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_SequenceOfSolid.hxx b/src/MCCAD/McCadHeaders/McCadCSGBuild_SequenceOfSolid.hxx new file mode 100644 index 0000000..dac7792 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_SequenceOfSolid.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGBuild_SequenceOfSolid_HeaderFile +#define _McCadCSGBuild_SequenceOfSolid_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class TopoDS_Solid; +class McCadCSGBuild_SequenceNodeOfSequenceOfSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGBuild_SequenceOfSolid : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCSGBuild_SequenceOfSolid(); + + +Standard_EXPORT void Clear() ; +~McCadCSGBuild_SequenceOfSolid() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCSGBuild_SequenceOfSolid& Assign(const McCadCSGBuild_SequenceOfSolid& Other) ; + const McCadCSGBuild_SequenceOfSolid& operator =(const McCadCSGBuild_SequenceOfSolid& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const TopoDS_Solid& T) ; + + void Append(McCadCSGBuild_SequenceOfSolid& S) ; + + +Standard_EXPORT void Prepend(const TopoDS_Solid& T) ; + + void Prepend(McCadCSGBuild_SequenceOfSolid& S) ; + + void InsertBefore(const Standard_Integer Index,const TopoDS_Solid& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCSGBuild_SequenceOfSolid& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const TopoDS_Solid& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCSGBuild_SequenceOfSolid& S) ; + + +Standard_EXPORT const TopoDS_Solid& First() const; + + +Standard_EXPORT const TopoDS_Solid& Last() const; + + void Split(const Standard_Integer Index,McCadCSGBuild_SequenceOfSolid& Sub) ; + + +Standard_EXPORT const TopoDS_Solid& Value(const Standard_Integer Index) const; + const TopoDS_Solid& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const TopoDS_Solid& I) ; + + +Standard_EXPORT TopoDS_Solid& ChangeValue(const Standard_Integer Index) ; + TopoDS_Solid& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGBuild_SequenceOfSolid(const McCadCSGBuild_SequenceOfSolid& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem TopoDS_Solid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGBuild_SequenceNodeOfSequenceOfSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGBuild_SequenceNodeOfSequenceOfSolid +#define TCollection_SequenceNode_Type_() McCadCSGBuild_SequenceNodeOfSequenceOfSolid_Type_() +#define TCollection_Sequence McCadCSGBuild_SequenceOfSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.hxx b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.hxx new file mode 100644 index 0000000..bd1627b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGBuild_SolidFromCSG_HeaderFile +#define _McCadCSGBuild_SolidFromCSG_HeaderFile + +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _McCadCSGBuild_SolidType_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class McCadCSGGeom_Cell; +class TopoDS_Solid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGBuild_SolidFromCSG { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class builds solids guided by CSG expression of
+//! a cell. Two version of solids can be creted: fused and unfused.
+Standard_EXPORT McCadCSGBuild_SolidFromCSG(); + + +Standard_EXPORT McCadCSGBuild_SolidFromCSG(const Handle(McCadCSGGeom_Cell)& theCell); + + +Standard_EXPORT void Init(const Handle(McCadCSGGeom_Cell)& theCell) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape Solids() const; + + +Standard_EXPORT TopoDS_Solid Fused() const; + + +Standard_EXPORT Standard_Integer NbSolids() const; + + +Standard_EXPORT McCadCSGBuild_SolidType Type() const; + +//qiu add two functions + +Standard_EXPORT Standard_Real VolumeOfShape(const TopoDS_Shape& theShape) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void MakeSolids() ; + + + // Fields PRIVATE + // +Handle_TopTools_HSequenceOfShape mySolids; +Handle_McCadCSGGeom_Cell myCell; +McCadCSGBuild_SolidType myType; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.ixx b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.ixx new file mode 100644 index 0000000..d97f8bf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.jxx b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.jxx new file mode 100644 index 0000000..cac43e4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidFromCSG.jxx @@ -0,0 +1,12 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGBuild_SolidFromCSG_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidType.hxx b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidType.hxx new file mode 100644 index 0000000..663f86a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGBuild_SolidType.hxx @@ -0,0 +1,39 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGBuild_SolidType_HeaderFile +#define _McCadCSGBuild_SolidType_HeaderFile + + +//! This package classes needed for Brep building from CSG (cells).
+enum McCadCSGBuild_SolidType { + McCadCSGBuild_Planar, +McCadCSGBuild_Qaudric, +McCadCSGBuild_Toroidal, +McCadCSGBuild_Other +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.hxx new file mode 100644 index 0000000..88afaf0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.hxx @@ -0,0 +1,227 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Cell_HeaderFile +#define _McCadCSGGeom_Cell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TColStd_HSequenceOfInteger; +class McCadCSGGeom_DataMapOfIntegerSurface; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface; +class TCollection_AsciiString; + +#include + + +//! \brief MC Code independent description of sign-constant geometry + +class McCadCSGGeom_Cell : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +//! Creates an infinite plane for use in
+//! CSG representation
+//!
+Standard_EXPORT McCadCSGGeom_Cell(); + + +Standard_EXPORT McCadCSGGeom_Cell(const Standard_Integer theCNum,const Standard_Integer theMNum,const Standard_Real theDensity); + + +Standard_EXPORT void SetCellNumber(const Standard_Integer theCNum) ; + + +Standard_EXPORT Standard_Integer GetCellNumber() const; + + +Standard_EXPORT void SetMaterialNumber(const Standard_Integer theMNum) ; + + +Standard_EXPORT Standard_Integer GetMaterialNumber() const; + + +Standard_EXPORT void SetDensity(const Standard_Real theDensity) ; + + +Standard_EXPORT Standard_Real GetDensity() const; + + +Standard_EXPORT void SetSurface(const McCadCSGGeom_DataMapOfIntegerSurface& theSurfaces) ; + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface GetSurface() const; + + +Standard_EXPORT void PrintCell(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintSurfaces(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintSurfaceTrsfMat(Standard_OStream& theStream) ; + + +Standard_EXPORT void SetCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG) ; + + +Standard_EXPORT void AppendToCSG(const TCollection_AsciiString& theCSG) ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetCSG() const; + + +Standard_EXPORT void SetSurfCounter(const Standard_Integer theSCount) ; + + +Standard_EXPORT Standard_Integer GetSurfCounter() const; + + +Standard_EXPORT void SetTrsfCounter(const Standard_Integer theTCount) ; + + +Standard_EXPORT Standard_Integer GetTrsfCounter() const; + + +Standard_EXPORT Standard_Integer GetNbOfSurf() const; + + +Standard_EXPORT Standard_Integer GetNbOfSurfTrsf() const; + + +Standard_EXPORT void SetComment(const TCollection_AsciiString& theComment) ; + + +Standard_EXPORT TCollection_AsciiString GetComment() const; + + +Standard_EXPORT void PrintComment(Standard_OStream& theStream) ; + + +Standard_EXPORT void SetComplementCells(const Handle(TColStd_HSequenceOfInteger)& theIntSeq) ; + + +Standard_EXPORT void SetVoid(const Standard_Boolean& isVoid) ; + + +Standard_EXPORT void SetOuterVoid(Standard_Boolean isVoid) ; + + +Standard_EXPORT Standard_Boolean IsVoid() ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetComplementCells() const; +//Standard_EXPORT ~McCadCSGGeom_Cell(); + +Standard_EXPORT void SetMCType(const McCadCSGGeom_MCType& theMCType) ; + +Standard_EXPORT McCadCSGGeom_MCType GetMCType() ; + + +Standard_EXPORT void SetVolume(const Standard_Real& theVol) ; + + +Standard_EXPORT Standard_Real GetVolume() ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myCellNumber; +Standard_Integer myMaterialNumber; +Standard_Real myDensity; +McCadCSGGeom_DataMapOfIntegerSurface mySurfaces; +Standard_Integer mySurfCounter; +Standard_Integer myTrsfCounter; +TCollection_AsciiString myComment; +Handle_TColStd_HSequenceOfInteger myComplementCells; +Standard_Boolean myIsVoid; +Standard_Boolean myIsOuterVoid; +McCadCSGGeom_MCType myMCType; +Standard_Real myVolume; + +protected: +Handle_TColStd_HSequenceOfAsciiString myCSG; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.ixx new file mode 100644 index 0000000..3f8504c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Cell::~McCadCSGGeom_Cell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Cell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Cell", + sizeof(McCadCSGGeom_Cell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Cell) Handle(McCadCSGGeom_Cell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Cell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Cell))) { + _anOtherObject = Handle(McCadCSGGeom_Cell)((Handle(McCadCSGGeom_Cell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Cell::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Cell) ; +} +//Standard_Boolean McCadCSGGeom_Cell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Cell) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Cell::~Handle_McCadCSGGeom_Cell() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.jxx new file mode 100644 index 0000000..e37ca23 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cell.jxx @@ -0,0 +1,18 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfInteger_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.hxx new file mode 100644 index 0000000..08a15c7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.hxx @@ -0,0 +1,157 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Cone_HeaderFile +#define _McCadCSGGeom_Cone_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cone_HeaderFile +#include +#endif + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +class gp_Ax3; +class gp_Pnt; +class GeomAdaptor_Surface; +class Geom_Surface; +class McCadCSGGeom_Surface; + +//! \brief Conical surface class + +class McCadCSGGeom_Cone : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates an infinite plane for use in
+//! CSG representation
+//!
+Standard_EXPORT McCadCSGGeom_Cone(); + +//! set axes as KX,KY,KZ
+Standard_EXPORT McCadCSGGeom_Cone(const gp_Ax3& A3,const Standard_Real Ang,const Standard_Real theRadius); + +//! set axes as KX,KY,KZ - take into account that single sheets can be selected
+Standard_EXPORT McCadCSGGeom_Cone(const gp_Ax3& A3,const Standard_Real Ang,const Standard_Real theRadius, const int sheet); + + +//! Set the Radius +Standard_EXPORT void SetRadius(const Standard_Real theRadius) ; + +//! Set the semi angle +Standard_EXPORT void SetSemiAngle(const Standard_Real Ang) ; + +//! Return the radius +Standard_EXPORT Standard_Real GetRadius() const; + +//! Return the semi angle +Standard_EXPORT Standard_Real GetSemiAngle() const; + + +//! Returns the coefficients
+Standard_EXPORT void Coefficients(Standard_Real& A1,Standard_Real& A2,Standard_Real& A3,Standard_Real& B1,Standard_Real& B2,Standard_Real& B3,Standard_Real& C1,Standard_Real& C2,Standard_Real& C3,Standard_Real& D) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs Point evaluation
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_Cone(); + +//! return the sheet value (+/-1, 0), if 0 both sheets are equally valid +Standard_EXPORT int Sheet(); + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Real myRadius; +Standard_Real mySemiAngle; +gp_Pnt myApex; +int mySheet; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.ixx new file mode 100644 index 0000000..15ba760 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Cone::~McCadCSGGeom_Cone() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Cone_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Cone", + sizeof(McCadCSGGeom_Cone), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Cone) Handle(McCadCSGGeom_Cone)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Cone) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Cone))) { + _anOtherObject = Handle(McCadCSGGeom_Cone)((Handle(McCadCSGGeom_Cone)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Cone::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Cone) ; +} +//Standard_Boolean McCadCSGGeom_Cone::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Cone) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Cone::~Handle_McCadCSGGeom_Cone() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.jxx new file mode 100644 index 0000000..051eb5a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cone.jxx @@ -0,0 +1,18 @@ +#ifndef _gp_Ax3_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cone_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.hxx new file mode 100644 index 0000000..04566c7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.hxx @@ -0,0 +1,145 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Cylinder_HeaderFile +#define _McCadCSGGeom_Cylinder_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cylinder_HeaderFile +#include +#endif + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +class gp_Ax3; +class gp_Pnt; +class GeomAdaptor_Surface; +class Geom_Surface; +class McCadCSGGeom_Surface; + +//! \brief Cylinder class + +class McCadCSGGeom_Cylinder : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates an infinite plane for use in
+//! CSG representation
+//!
+Standard_EXPORT McCadCSGGeom_Cylinder(); + +//! set axes as cX,cY,cZ and radius
+Standard_EXPORT McCadCSGGeom_Cylinder(const gp_Ax3& A3,const Standard_Real theRadius); + + +//! Set the radius +Standard_EXPORT void SetRadius(const Standard_Real theRadius) ; + +//! Return the radius +Standard_EXPORT Standard_Real GetRadius() const; + + +//! Returns the coefficients
+Standard_EXPORT void Coefficients(Standard_Real& A1,Standard_Real& A2,Standard_Real& A3,Standard_Real& B1,Standard_Real& B2,Standard_Real& B3,Standard_Real& C1,Standard_Real& C2,Standard_Real& C3,Standard_Real& D) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs point evaluation
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! returns the Cas surface
+Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_Cylinder(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Real myRadius; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.ixx new file mode 100644 index 0000000..3d3602c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Cylinder::~McCadCSGGeom_Cylinder() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Cylinder_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Cylinder", + sizeof(McCadCSGGeom_Cylinder), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Cylinder) Handle(McCadCSGGeom_Cylinder)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Cylinder) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Cylinder))) { + _anOtherObject = Handle(McCadCSGGeom_Cylinder)((Handle(McCadCSGGeom_Cylinder)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Cylinder::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Cylinder) ; +} +//Standard_Boolean McCadCSGGeom_Cylinder::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Cylinder) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Cylinder::~Handle_McCadCSGGeom_Cylinder() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.jxx new file mode 100644 index 0000000..3784fa0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Cylinder.jxx @@ -0,0 +1,18 @@ +#ifndef _gp_Ax3_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cylinder_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell.hxx new file mode 100644 index 0000000..1af466b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell.hxx @@ -0,0 +1,120 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile +#define _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCSGGeom_Cell; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapOfIntegerCell; +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell(); + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell(const McCadCSGGeom_DataMapOfIntegerCell& aMap); + + +Standard_EXPORT void Initialize(const McCadCSGGeom_DataMapOfIntegerCell& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadCSGGeom_Cell& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface.hxx new file mode 100644 index 0000000..6fcdc9a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface.hxx @@ -0,0 +1,120 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_HeaderFile +#define _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCSGGeom_Surface; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapOfIntegerSurface; +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface(); + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface(const McCadCSGGeom_DataMapOfIntegerSurface& aMap); + + +Standard_EXPORT void Initialize(const McCadCSGGeom_DataMapOfIntegerSurface& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadCSGGeom_Surface& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation.hxx new file mode 100644 index 0000000..02e59bd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation.hxx @@ -0,0 +1,120 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_HeaderFile +#define _McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCSGGeom_Transformation; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapOfIntegerTransformation; +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation(); + + +Standard_EXPORT McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation(const McCadCSGGeom_DataMapOfIntegerTransformation& aMap); + + +Standard_EXPORT void Initialize(const McCadCSGGeom_DataMapOfIntegerTransformation& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadCSGGeom_Transformation& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell.hxx new file mode 100644 index 0000000..5fd779a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell.hxx @@ -0,0 +1,134 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#define _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCSGGeom_Cell; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapOfIntegerCell; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell; + + + +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell(const Standard_Integer& K,const Handle(McCadCSGGeom_Cell)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadCSGGeom_Cell& Value() const; +//Standard_EXPORT ~McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadCSGGeom_Cell myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerCell +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface.hxx new file mode 100644 index 0000000..b319694 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface.hxx @@ -0,0 +1,134 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#define _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCSGGeom_Surface; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapOfIntegerSurface; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface; + + + +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface(const Standard_Integer& K,const Handle(McCadCSGGeom_Surface)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadCSGGeom_Surface& Value() const; +//Standard_EXPORT ~McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadCSGGeom_Surface myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Surface +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerSurface +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation.hxx new file mode 100644 index 0000000..6a5e224 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation.hxx @@ -0,0 +1,134 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#define _McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCSGGeom_Transformation; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapOfIntegerTransformation; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation; + + + +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation(const Standard_Integer& K,const Handle(McCadCSGGeom_Transformation)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadCSGGeom_Transformation& Value() const; +//Standard_EXPORT ~McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadCSGGeom_Transformation myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadCSGGeom_Transformation +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation +#define TCollection_DataMapNode_Type_() McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_Type_() +#define TCollection_DataMap McCadCSGGeom_DataMapOfIntegerTransformation +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerCell.hxx new file mode 100644 index 0000000..4afb509 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerCell.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapOfIntegerCell_HeaderFile +#define _McCadCSGGeom_DataMapOfIntegerCell_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadCSGGeom_Cell; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerCell; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerCell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_DataMapOfIntegerCell : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerCell(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerCell& Assign(const McCadCSGGeom_DataMapOfIntegerCell& Other) ; + McCadCSGGeom_DataMapOfIntegerCell& operator =(const McCadCSGGeom_DataMapOfIntegerCell& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCSGGeom_DataMapOfIntegerCell() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadCSGGeom_Cell)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Cell& Find(const Standard_Integer& K) const; + const Handle_McCadCSGGeom_Cell& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadCSGGeom_Cell& ChangeFind(const Standard_Integer& K) ; + Handle_McCadCSGGeom_Cell& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerCell(const McCadCSGGeom_DataMapOfIntegerCell& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerSurface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerSurface.hxx new file mode 100644 index 0000000..2a55b2b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerSurface.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#define _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadCSGGeom_Surface; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerSurface; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_DataMapOfIntegerSurface : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerSurface(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerSurface& Assign(const McCadCSGGeom_DataMapOfIntegerSurface& Other) ; + McCadCSGGeom_DataMapOfIntegerSurface& operator =(const McCadCSGGeom_DataMapOfIntegerSurface& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCSGGeom_DataMapOfIntegerSurface() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadCSGGeom_Surface)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Surface& Find(const Standard_Integer& K) const; + const Handle_McCadCSGGeom_Surface& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + +Standard_EXPORT Handle_McCadCSGGeom_Surface& ChangeFind(const Standard_Integer& K) ; + Handle_McCadCSGGeom_Surface& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerSurface(const McCadCSGGeom_DataMapOfIntegerSurface& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerTransformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerTransformation.hxx new file mode 100644 index 0000000..83943e4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_DataMapOfIntegerTransformation.hxx @@ -0,0 +1,161 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_DataMapOfIntegerTransformation_HeaderFile +#define _McCadCSGGeom_DataMapOfIntegerTransformation_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadCSGGeom_Transformation; +class TColStd_MapIntegerHasher; +class McCadCSGGeom_DataMapNodeOfDataMapOfIntegerTransformation; +class McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_DataMapOfIntegerTransformation : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerTransformation(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerTransformation& Assign(const McCadCSGGeom_DataMapOfIntegerTransformation& Other) ; + McCadCSGGeom_DataMapOfIntegerTransformation& operator =(const McCadCSGGeom_DataMapOfIntegerTransformation& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCSGGeom_DataMapOfIntegerTransformation() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadCSGGeom_Transformation)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Transformation& Find(const Standard_Integer& K) const; + const Handle_McCadCSGGeom_Transformation& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadCSGGeom_Transformation& ChangeFind(const Standard_Integer& K) ; + Handle_McCadCSGGeom_Transformation& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGGeom_DataMapOfIntegerTransformation(const McCadCSGGeom_DataMapOfIntegerTransformation& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.hxx new file mode 100644 index 0000000..fcdeccf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.hxx @@ -0,0 +1,150 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_GQ_HeaderFile +#define _McCadCSGGeom_GQ_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_GQ_HeaderFile +#include +#endif + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +class Geom_Surface; +class gp_Pnt; +class GeomAdaptor_Surface; +class McCadCSGGeom_Surface; + +//! \brief General Quadric class of McCad + +class McCadCSGGeom_GQ : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates a generic quadric
+//! CSG representation
+//!
+//! Creates a generic quadric from coeficients:
+//! A * X^2 + B * Y^2 + C * Z^2 +
+//! D*xy + E*yz + F*zx + G*x + H*y + I*z + J= 0
+ +Standard_EXPORT McCadCSGGeom_GQ(); + +Standard_EXPORT McCadCSGGeom_GQ(const Standard_Real A,const Standard_Real B,const Standard_Real C,const Standard_Real D,const Standard_Real E,const Standard_Real F,const Standard_Real G,const Standard_Real H,const Standard_Real I,const Standard_Real J); + + +//! Returns the coefficients of the cartesian equation :
+Standard_EXPORT void Coefficients(Standard_Real& A,Standard_Real& B,Standard_Real& C,Standard_Real& D,Standard_Real& E,Standard_Real& F,Standard_Real& G,Standard_Real& H,Standard_Real& I,Standard_Real& J) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs Point evaluation
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! returns the Cas surface
+Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_GQ(); + + +Standard_EXPORT void MakeSurface( ) ; + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // +Standard_Integer ComputeMatrixRank(gp_Mat m) ; + + // Fields PRIVATE + // +Standard_Real myA; +Standard_Real myB; +Standard_Real myC; +Standard_Real myD; +Standard_Real myE; +Standard_Real myF; +Standard_Real myG; +Standard_Real myH; +Standard_Real myI; +Standard_Real myJ; +Handle_Geom_Surface mySurface; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.ixx new file mode 100644 index 0000000..44cded0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_GQ::~McCadCSGGeom_GQ() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_GQ_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_GQ", + sizeof(McCadCSGGeom_GQ), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_GQ) Handle(McCadCSGGeom_GQ)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_GQ) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_GQ))) { + _anOtherObject = Handle(McCadCSGGeom_GQ)((Handle(McCadCSGGeom_GQ)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_GQ::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_GQ) ; +} +//Standard_Boolean McCadCSGGeom_GQ::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_GQ) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_GQ::~Handle_McCadCSGGeom_GQ() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.jxx new file mode 100644 index 0000000..0e6eea5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_GQ.jxx @@ -0,0 +1,15 @@ +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_GQ_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfCell.hxx new file mode 100644 index 0000000..1fe5a54 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfCell.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_HSequenceOfCell_HeaderFile +#define _McCadCSGGeom_HSequenceOfCell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_HSequenceOfCell_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_SequenceOfCell_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCSGGeom_Cell; +class McCadCSGGeom_SequenceOfCell; + + + +class McCadCSGGeom_HSequenceOfCell : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_HSequenceOfCell(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_Cell)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_Cell)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Cell)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGGeom_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Cell)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGGeom_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfCell Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Cell)& anItem) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Cell& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadCSGGeom_Cell& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadCSGGeom_SequenceOfCell& Sequence() const; + + McCadCSGGeom_SequenceOfCell& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfCell ShallowCopy() const; +//Standard_EXPORT ~McCadCSGGeom_HSequenceOfCell(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadCSGGeom_SequenceOfCell mySequence; + + +}; + +#define Item Handle_McCadCSGGeom_Cell +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfCell_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadCSGGeom_HSequenceOfCell ShallowCopy(const Handle_McCadCSGGeom_HSequenceOfCell& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfCellPtr.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfCellPtr.hxx new file mode 100644 index 0000000..7467cfa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfCellPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_HSequenceOfCellPtr_HeaderFile +#define _McCadCSGGeom_HSequenceOfCellPtr_HeaderFile + +class McCadCSGGeom_HSequenceOfCell; + +typedef McCadCSGGeom_HSequenceOfCell* McCadCSGGeom_HSequenceOfCellPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfSurface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfSurface.hxx new file mode 100644 index 0000000..f1bfd9b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfSurface.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_HSequenceOfSurface_HeaderFile +#define _McCadCSGGeom_HSequenceOfSurface_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_HSequenceOfSurface_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_SequenceOfSurface_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCSGGeom_Surface; +class McCadCSGGeom_SequenceOfSurface; + + + +class McCadCSGGeom_HSequenceOfSurface : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_HSequenceOfSurface(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_Surface)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_HSequenceOfSurface)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_Surface)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_HSequenceOfSurface)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Surface)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGGeom_HSequenceOfSurface)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Surface)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGGeom_HSequenceOfSurface)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfSurface Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Surface)& anItem) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Surface& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadCSGGeom_Surface& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadCSGGeom_SequenceOfSurface& Sequence() const; + + McCadCSGGeom_SequenceOfSurface& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfSurface ShallowCopy() const; +//Standard_EXPORT ~McCadCSGGeom_HSequenceOfSurface(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadCSGGeom_SequenceOfSurface mySequence; + + +}; + +#define Item Handle_McCadCSGGeom_Surface +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfSurface +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfSurface +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfSurface +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfSurface_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadCSGGeom_HSequenceOfSurface ShallowCopy(const Handle_McCadCSGGeom_HSequenceOfSurface& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfTransformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfTransformation.hxx new file mode 100644 index 0000000..94e80af --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_HSequenceOfTransformation.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_HSequenceOfTransformation_HeaderFile +#define _McCadCSGGeom_HSequenceOfTransformation_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_HSequenceOfTransformation_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_SequenceOfTransformation_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCSGGeom_Transformation; +class McCadCSGGeom_SequenceOfTransformation; + + + +class McCadCSGGeom_HSequenceOfTransformation : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_HSequenceOfTransformation(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_Transformation)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_HSequenceOfTransformation)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_Transformation)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_HSequenceOfTransformation)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Transformation)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadCSGGeom_HSequenceOfTransformation)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Transformation)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadCSGGeom_HSequenceOfTransformation)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfTransformation Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadCSGGeom_Transformation)& anItem) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Transformation& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadCSGGeom_Transformation& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadCSGGeom_SequenceOfTransformation& Sequence() const; + + McCadCSGGeom_SequenceOfTransformation& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfTransformation ShallowCopy() const; +//Standard_EXPORT ~McCadCSGGeom_HSequenceOfTransformation(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadCSGGeom_SequenceOfTransformation mySequence; + + +}; + +#define Item Handle_McCadCSGGeom_Transformation +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfTransformation +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfTransformation +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfTransformation +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfTransformation_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadCSGGeom_HSequenceOfTransformation ShallowCopy(const Handle_McCadCSGGeom_HSequenceOfTransformation& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_MCType.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_MCType.hxx new file mode 100644 index 0000000..c7086b7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_MCType.hxx @@ -0,0 +1,37 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_MCType_HeaderFile +#define _McCadCSGGeom_MCType_HeaderFile + +//! Units used in CAD Model
+//! =============================
+enum McCadCSGGeom_MCType { + McCadCSGGeom_MCNP, + McCadCSGGeom_TRIPOLI, +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.hxx new file mode 100644 index 0000000..7394af6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.hxx @@ -0,0 +1,140 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Plane_HeaderFile +#define _McCadCSGGeom_Plane_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Plane_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +class gp_Pnt; +class GeomAdaptor_Surface; +class Geom_Surface; +class McCadCSGGeom_Surface; + +//! \brief Planar Surface + +class McCadCSGGeom_Plane : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates an infinite plane for use in
+//! CSG representation
+//!
+Standard_EXPORT McCadCSGGeom_Plane(); + + +//! Creates a plane from its cartesian equation :
+//! A * X + B * Y + C * Z + D = 0.0
+Standard_EXPORT McCadCSGGeom_Plane(const Standard_Real A,const Standard_Real B,const Standard_Real C,const Standard_Real D); + + +//! Returns the coefficients of the plane's cartesian equation :
+//! A * X + B * Y + C * Z + D = 0.
+Standard_EXPORT void Coefficients(Standard_Real& A,Standard_Real& B,Standard_Real& C,Standard_Real& D) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs Point evaluation
+//! A * X + B * Y + C * Z + D = value.
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! returns the Cas surface
+Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_Plane(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.ixx new file mode 100644 index 0000000..5c45833 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Plane::~McCadCSGGeom_Plane() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Plane_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Plane", + sizeof(McCadCSGGeom_Plane), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Plane) Handle(McCadCSGGeom_Plane)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Plane) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Plane))) { + _anOtherObject = Handle(McCadCSGGeom_Plane)((Handle(McCadCSGGeom_Plane)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Plane::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Plane) ; +} +//Standard_Boolean McCadCSGGeom_Plane::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Plane) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Plane::~Handle_McCadCSGGeom_Plane() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.jxx new file mode 100644 index 0000000..1361dd1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Plane.jxx @@ -0,0 +1,15 @@ +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Plane_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfCell.hxx new file mode 100644 index 0000000..b9facda --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfCell.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile +#define _McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadCSGGeom_Cell; +class McCadCSGGeom_SequenceOfCell; + + + +class McCadCSGGeom_SequenceNodeOfSequenceOfCell : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_SequenceNodeOfSequenceOfCell(const Handle(McCadCSGGeom_Cell)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadCSGGeom_Cell& Value() const; +//Standard_EXPORT ~McCadCSGGeom_SequenceNodeOfSequenceOfCell(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCSGGeom_Cell myValue; + + +}; + +#define SeqItem Handle_McCadCSGGeom_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfCell +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfSurface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfSurface.hxx new file mode 100644 index 0000000..a2e7f3b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfSurface.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile +#define _McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadCSGGeom_Surface; +class McCadCSGGeom_SequenceOfSurface; + + + +class McCadCSGGeom_SequenceNodeOfSequenceOfSurface : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_SequenceNodeOfSequenceOfSurface(const Handle(McCadCSGGeom_Surface)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadCSGGeom_Surface& Value() const; +//Standard_EXPORT ~McCadCSGGeom_SequenceNodeOfSequenceOfSurface(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCSGGeom_Surface myValue; + + +}; + +#define SeqItem Handle_McCadCSGGeom_Surface +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfSurface_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfSurface +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation.hxx new file mode 100644 index 0000000..288225d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceNodeOfSequenceOfTransformation.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile +#define _McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadCSGGeom_Transformation; +class McCadCSGGeom_SequenceOfTransformation; + + + +class McCadCSGGeom_SequenceNodeOfSequenceOfTransformation : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCSGGeom_SequenceNodeOfSequenceOfTransformation(const Handle(McCadCSGGeom_Transformation)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadCSGGeom_Transformation& Value() const; +//Standard_EXPORT ~McCadCSGGeom_SequenceNodeOfSequenceOfTransformation(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCSGGeom_Transformation myValue; + + +}; + +#define SeqItem Handle_McCadCSGGeom_Transformation +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfTransformation +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfCell.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfCell.hxx new file mode 100644 index 0000000..76a4eae --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfCell.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SequenceOfCell_HeaderFile +#define _McCadCSGGeom_SequenceOfCell_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCSGGeom_Cell; +class McCadCSGGeom_SequenceNodeOfSequenceOfCell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_SequenceOfCell : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCSGGeom_SequenceOfCell(); + + +Standard_EXPORT void Clear() ; +~McCadCSGGeom_SequenceOfCell() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCSGGeom_SequenceOfCell& Assign(const McCadCSGGeom_SequenceOfCell& Other) ; + const McCadCSGGeom_SequenceOfCell& operator =(const McCadCSGGeom_SequenceOfCell& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_Cell)& T) ; + + void Append(McCadCSGGeom_SequenceOfCell& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_Cell)& T) ; + + void Prepend(McCadCSGGeom_SequenceOfCell& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadCSGGeom_Cell)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCSGGeom_SequenceOfCell& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadCSGGeom_Cell)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCSGGeom_SequenceOfCell& S) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Cell& First() const; + + +Standard_EXPORT const Handle_McCadCSGGeom_Cell& Last() const; + + void Split(const Standard_Integer Index,McCadCSGGeom_SequenceOfCell& Sub) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Cell& Value(const Standard_Integer Index) const; + const Handle_McCadCSGGeom_Cell& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadCSGGeom_Cell)& I) ; + + +Standard_EXPORT Handle_McCadCSGGeom_Cell& ChangeValue(const Standard_Integer Index) ; + Handle_McCadCSGGeom_Cell& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGGeom_SequenceOfCell(const McCadCSGGeom_SequenceOfCell& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadCSGGeom_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfCell +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfSurface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfSurface.hxx new file mode 100644 index 0000000..c71f207 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfSurface.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SequenceOfSurface_HeaderFile +#define _McCadCSGGeom_SequenceOfSurface_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCSGGeom_Surface; +class McCadCSGGeom_SequenceNodeOfSequenceOfSurface; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_SequenceOfSurface : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCSGGeom_SequenceOfSurface(); + + +Standard_EXPORT void Clear() ; +~McCadCSGGeom_SequenceOfSurface() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCSGGeom_SequenceOfSurface& Assign(const McCadCSGGeom_SequenceOfSurface& Other) ; + const McCadCSGGeom_SequenceOfSurface& operator =(const McCadCSGGeom_SequenceOfSurface& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_Surface)& T) ; + + void Append(McCadCSGGeom_SequenceOfSurface& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_Surface)& T) ; + + void Prepend(McCadCSGGeom_SequenceOfSurface& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadCSGGeom_Surface)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCSGGeom_SequenceOfSurface& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadCSGGeom_Surface)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCSGGeom_SequenceOfSurface& S) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Surface& First() const; + + +Standard_EXPORT const Handle_McCadCSGGeom_Surface& Last() const; + + void Split(const Standard_Integer Index,McCadCSGGeom_SequenceOfSurface& Sub) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Surface& Value(const Standard_Integer Index) const; + const Handle_McCadCSGGeom_Surface& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadCSGGeom_Surface)& I) ; + + +Standard_EXPORT Handle_McCadCSGGeom_Surface& ChangeValue(const Standard_Integer Index) ; + Handle_McCadCSGGeom_Surface& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGGeom_SequenceOfSurface(const McCadCSGGeom_SequenceOfSurface& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadCSGGeom_Surface +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfSurface +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfSurface_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfSurface +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfTransformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfTransformation.hxx new file mode 100644 index 0000000..e556c4d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SequenceOfTransformation.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SequenceOfTransformation_HeaderFile +#define _McCadCSGGeom_SequenceOfTransformation_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCSGGeom_Transformation; +class McCadCSGGeom_SequenceNodeOfSequenceOfTransformation; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCSGGeom_SequenceOfTransformation : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCSGGeom_SequenceOfTransformation(); + + +Standard_EXPORT void Clear() ; +~McCadCSGGeom_SequenceOfTransformation() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCSGGeom_SequenceOfTransformation& Assign(const McCadCSGGeom_SequenceOfTransformation& Other) ; + const McCadCSGGeom_SequenceOfTransformation& operator =(const McCadCSGGeom_SequenceOfTransformation& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadCSGGeom_Transformation)& T) ; + + void Append(McCadCSGGeom_SequenceOfTransformation& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCSGGeom_Transformation)& T) ; + + void Prepend(McCadCSGGeom_SequenceOfTransformation& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadCSGGeom_Transformation)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCSGGeom_SequenceOfTransformation& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadCSGGeom_Transformation)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCSGGeom_SequenceOfTransformation& S) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Transformation& First() const; + + +Standard_EXPORT const Handle_McCadCSGGeom_Transformation& Last() const; + + void Split(const Standard_Integer Index,McCadCSGGeom_SequenceOfTransformation& Sub) ; + + +Standard_EXPORT const Handle_McCadCSGGeom_Transformation& Value(const Standard_Integer Index) const; + const Handle_McCadCSGGeom_Transformation& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadCSGGeom_Transformation)& I) ; + + +Standard_EXPORT Handle_McCadCSGGeom_Transformation& ChangeValue(const Standard_Integer Index) ; + Handle_McCadCSGGeom_Transformation& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCSGGeom_SequenceOfTransformation(const McCadCSGGeom_SequenceOfTransformation& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadCSGGeom_Transformation +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCSGGeom_SequenceNodeOfSequenceOfTransformation +#define TCollection_SequenceNode_Type_() McCadCSGGeom_SequenceNodeOfSequenceOfTransformation_Type_() +#define TCollection_Sequence McCadCSGGeom_SequenceOfTransformation +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.hxx new file mode 100644 index 0000000..2ffa46f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.hxx @@ -0,0 +1,151 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Sphere_HeaderFile +#define _McCadCSGGeom_Sphere_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Sphere_HeaderFile +#include +#endif + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +class gp_Ax3; +class gp_Pnt; +class GeomAdaptor_Surface; +class Geom_Surface; +class McCadCSGGeom_Surface; + + +//! \brief Spherical Surface + + +class McCadCSGGeom_Sphere : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates an infinite plane for use in
+//! CSG representation
+//!
+Standard_EXPORT McCadCSGGeom_Sphere(); + + +Standard_EXPORT McCadCSGGeom_Sphere(const Standard_Real theRadius); + + +//! used for csg input mostly implicit surfaces;
+Standard_EXPORT McCadCSGGeom_Sphere(const gp_Ax3& A3,const Standard_Real theRadius); + +//! Set the Radius +Standard_EXPORT void SetRadius(const Standard_Real theRadius) ; + + +//! Returns the Radius +Standard_EXPORT Standard_Real GetRadius() const; + + +//! Returns the coefficients
+Standard_EXPORT void Coefficients(Standard_Real& A1,Standard_Real& A2,Standard_Real& A3,Standard_Real& B1,Standard_Real& B2,Standard_Real& B3,Standard_Real& C1,Standard_Real& C2,Standard_Real& C3,Standard_Real& D) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs Point evaluation
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! returns the Cas surface
+Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + +//! See McCadCSGGeom_Surface.hxx +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_Sphere(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Real myRadius; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.ixx new file mode 100644 index 0000000..5e22084 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Sphere::~McCadCSGGeom_Sphere() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Sphere_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Sphere", + sizeof(McCadCSGGeom_Sphere), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Sphere) Handle(McCadCSGGeom_Sphere)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Sphere) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Sphere))) { + _anOtherObject = Handle(McCadCSGGeom_Sphere)((Handle(McCadCSGGeom_Sphere)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Sphere::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Sphere) ; +} +//Standard_Boolean McCadCSGGeom_Sphere::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Sphere) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Sphere::~Handle_McCadCSGGeom_Sphere() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.jxx new file mode 100644 index 0000000..81c3420 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Sphere.jxx @@ -0,0 +1,18 @@ +#ifndef _gp_Ax3_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Sphere_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.hxx new file mode 100644 index 0000000..0e39fde --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.hxx @@ -0,0 +1,230 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Surface_HeaderFile +#define _McCadCSGGeom_Surface_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif + +#ifndef _gp_Ax3_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SurfaceType_HeaderFile +#include +#endif +#ifndef _gp_Trsf_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#include +#include +#include + +class gp_Trsf; +class gp_Pnt; +class gp_Ax3; +class GeomAdaptor_Surface; +class Geom_Surface; + +//! \brief Base class for all McCad surfaces + + +//! This class is inherited by all surface classes in McCadCSGGeom.
+//! Functions are commented only here, not in its children. +class McCadCSGGeom_Surface : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +//! Returns true if the surface (not for planes) has a transformation +Standard_EXPORT virtual Standard_Boolean HaveTransformation() const; + +//! Set the transformation number which will be given in the MC (MCNP) output.
+//! In MCNP a surface can have a transformation number. The number is linked to
+//! a transformation matrix in the data section. Set the transformation number here. +Standard_EXPORT virtual void SetTrsfNumber(const Standard_Integer theTNumber) ; + +//! Receive transformation number. See SetTrsfNumber() +Standard_EXPORT virtual Standard_Integer GetTrsfNumber() const; + +//! Set the transformation for this surface. See SetTrsfNumber() +Standard_EXPORT virtual void SetTrsf(const gp_Trsf& theTrsf) ; + +//! Returns the Transformation for this surface +Standard_EXPORT virtual gp_Trsf GetTrsf() const; + +//! Define the location of the surface +Standard_EXPORT virtual void SetLocation(const gp_Pnt& Loc) ; + +//! Returns the location of the surface +Standard_EXPORT virtual gp_Pnt GetLocation() const; + +//! get the transformation mat.
+Standard_EXPORT virtual gp_Ax3 GetAxis() const; + +//! set the transformation mat.
+Standard_EXPORT virtual void SetAxis(const gp_Ax3& theAx) ; + +//! Returns the type of Surface (McCadCSGGeom_Plane, ...) +Standard_EXPORT virtual McCadCSGGeom_SurfaceType GetType() const; + +//! Set the Surface type +Standard_EXPORT virtual void SetType(const McCadCSGGeom_SurfaceType theType) ; + +//! Get surface number
+//! Each surface has it's own unique ID in MC codes. +Standard_EXPORT virtual Standard_Integer GetNumber() const; + +//! Set unique Surface ID for MC code +Standard_EXPORT virtual void SetNumber(const Standard_Integer theNumber) ; + +//! Performs Point evaluation
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const = 0; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const = 0; + +//! Print the surface description for the chosen MC type
+//! See SetMCType() +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const = 0; + +//! Set the OpenCascade geometrical description of this surface +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) = 0; + +//! Return OpenCascade surface +Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const = 0; + +//! Is equal to other surface? Regardless of orientation +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const = 0; + +//! Is identical to other surface? +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const = 0; + +//! Set the Units which are used in the input model.
+//! Possible choices are McCadCSGGeom_MM, McCadCSGGeom_CM
+//! CAD systems usually use 'mm' while MC codes are based on 'cm' description of geometry +Standard_EXPORT virtual void SetUnits(McCadCSGGeom_Unit theUnit) ; + +//! Returns the defined units. See SetUnits() +Standard_EXPORT virtual McCadCSGGeom_Unit GetUnits() const ; + +//! If input units are not McCadCSGGeom_CM, all surface description has to be scaled to cm +Standard_EXPORT virtual Standard_Real Scale() const; + +//! Defines the Type of Monte Carlo Code the Print function should adress. +Standard_EXPORT virtual void SetMCType(const McCadCSGGeom_MCType& theMCType) ; + +//! Returns the chosen Monte Carlo type - default is McCadCSGGeom_MCNP +Standard_EXPORT virtual McCadCSGGeom_MCType GetMCType() const ; + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + + //! Set the surface to a macrobody.
+ //! For MCNP input reader. Macrobodies have to be expanded to single surfaces. + Standard_EXPORT virtual void SetIsMacroBody() ; + + + //! Returns true, if surface is a macrobody + Standard_EXPORT virtual Standard_Boolean IsMacroBody() ; + + //! Add the surface number of a newly generated surface for this macrobody. See SetIsMacrobody() + Standard_EXPORT virtual void AddMacroBodySurface(const Standard_Integer& surfNum); + + //! Returns a list of all surfaces this macrobody consists of. See SetIsMacrobody() + Standard_EXPORT virtual Handle(TColStd_HSequenceOfInteger) GetMacroBodySurfaces(); + + //! Set a Sequence of surface numbers (int) as the surfaces the macrobody consists of. + Standard_EXPORT virtual void SetMacroBodySurfaceNumbers(const Handle(TColStd_HSequenceOfInteger)& mbsn) ; + +protected: + + // Methods PROTECTED + // + + +//! Defines the root class Surface for use in csg construction.
+//!
+Standard_EXPORT McCadCSGGeom_Surface(); + + + // Fields PROTECTED + // +gp_Ax3 myTransformedAxis; +gp_Ax3 myAxis; +Standard_Integer myNumber; +Standard_Integer myTNumber; +McCadCSGGeom_SurfaceType myType; +gp_Trsf myTrsf; +Standard_Boolean haveTrsf; +McCadCSGGeom_Unit myUnit; +McCadCSGGeom_MCType myMCType; +Handle(TColStd_HSequenceOfInteger) myMacroBodySurfaceHSequence; +Standard_Boolean myIsMacroBody; +static const int myOutputPrecision=7; + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.ixx new file mode 100644 index 0000000..6ed8203 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Surface::~McCadCSGGeom_Surface() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Surface_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Surface", + sizeof(McCadCSGGeom_Surface), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Surface) Handle(McCadCSGGeom_Surface)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Surface) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Surface))) { + _anOtherObject = Handle(McCadCSGGeom_Surface)((Handle(McCadCSGGeom_Surface)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Surface::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Surface) ; +} +//Standard_Boolean McCadCSGGeom_Surface::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Surface) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Surface::~Handle_McCadCSGGeom_Surface() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.jxx new file mode 100644 index 0000000..8cbb5e4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Surface.jxx @@ -0,0 +1,18 @@ +#ifndef _gp_Trsf_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _gp_Ax3_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.hxx new file mode 100644 index 0000000..b2933d4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.hxx @@ -0,0 +1,155 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SurfaceOfRevolution_HeaderFile +#define _McCadCSGGeom_SurfaceOfRevolution_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_SurfaceOfRevolution_HeaderFile +#include +#endif + +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#include +class gp_Pnt; +class GeomAdaptor_Surface; +class Geom_Surface; +class McCadCSGGeom_Surface; +#include +#include + + + +class McCadCSGGeom_SurfaceOfRevolution : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates an infinite plane for use in
+//! CSG representation
+//!
+Standard_EXPORT McCadCSGGeom_SurfaceOfRevolution(); + + +//! Creates a plane from its cartesian equation :
+//! A * X + B * Y + C * Z + D = 0.0
+Standard_EXPORT McCadCSGGeom_SurfaceOfRevolution(gp_Ax1& revAxis, Handle(Geom_Curve)& basisCurve); + + +Standard_EXPORT McCadCSGGeom_SurfaceOfRevolution(gp_Ax1& revAxis, Handle(Geom_Curve)& basisCurve, Handle(TColStd_HSequenceOfReal)& realSeq); + +//! Returns the coefficients of the plane's cartesian equation :
+//! A * X + B * Y + C * Z + D = 0.
+//Standard_EXPORT void Coefficients(Standard_Real& A,Standard_Real& B,Standard_Real& C,Standard_Real& D) const; + + +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs Point evaluation
+//! A * X + B * Y + C * Z + D = value.
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + + +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! returns the Cas surface
+Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + + +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + + +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_SurfaceOfRevolution(); + +Standard_EXPORT Handle_Geom_SurfaceOfRevolution SurfaceOfRevolution() const; + + +Standard_EXPORT void SetParameter(Handle(TColStd_HSequenceOfReal)& realSeq) ; + + +Standard_EXPORT void GetParameter(Handle(TColStd_HSequenceOfReal)& realSeq) const; + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + gp_Ax1 myRevAxis; + Handle(Geom_Curve) myBasisCurve; + Handle(TColStd_HSequenceOfReal) myRealSeq; + Handle(Geom_Surface) mySurf; + Standard_Real myR; + Standard_Real myA; + Standard_Real myB; +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.ixx new file mode 100644 index 0000000..669ec24 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_SurfaceOfRevolution::~McCadCSGGeom_SurfaceOfRevolution() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_SurfaceOfRevolution_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_SurfaceOfRevolution", + sizeof(McCadCSGGeom_SurfaceOfRevolution), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_SurfaceOfRevolution) Handle(McCadCSGGeom_SurfaceOfRevolution)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_SurfaceOfRevolution) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_SurfaceOfRevolution))) { + _anOtherObject = Handle(McCadCSGGeom_SurfaceOfRevolution)((Handle(McCadCSGGeom_SurfaceOfRevolution)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_SurfaceOfRevolution::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_SurfaceOfRevolution) ; +} +//Standard_Boolean McCadCSGGeom_SurfaceOfRevolution::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_SurfaceOfRevolution) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_SurfaceOfRevolution::~Handle_McCadCSGGeom_SurfaceOfRevolution() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.jxx new file mode 100644 index 0000000..e573b3f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceOfRevolution.jxx @@ -0,0 +1,15 @@ +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_SurfaceOfRevolution_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceType.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceType.hxx new file mode 100644 index 0000000..c4d695a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_SurfaceType.hxx @@ -0,0 +1,43 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_SurfaceType_HeaderFile +#define _McCadCSGGeom_SurfaceType_HeaderFile + + +//! This package contains the definition of the geometric objects
+enum McCadCSGGeom_SurfaceType { + McCadCSGGeom_Planar, +McCadCSGGeom_Conical, +McCadCSGGeom_Cylindrical, +McCadCSGGeom_Spherical, +McCadCSGGeom_Toroidal, +McCadCSGGeom_Quadric, +McCadCSGGeom_SurfOfRev, +McCadCSGGeom_OtherSurface +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.hxx new file mode 100644 index 0000000..39d78ea --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.hxx @@ -0,0 +1,183 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Torus_HeaderFile +#define _McCadCSGGeom_Torus_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Torus_HeaderFile +#include +#endif + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Handle_Geom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +class gp_Ax3; +class TColStd_Array1OfReal; +class gp_Pnt; +class GeomAdaptor_Surface; +class Geom_Surface; +class McCadCSGGeom_Surface; + +//! \brief Toroidal Surface + +class McCadCSGGeom_Torus : public McCadCSGGeom_Surface { + +public: + // Methods PUBLIC + // + +//! Creates an infinite Torus for use in
+//! CSG representation
+//!
//! creates an indefinite Torus.
+Standard_EXPORT McCadCSGGeom_Torus(); + + +//!
+Standard_EXPORT McCadCSGGeom_Torus(const gp_Ax3& A3,const Standard_Real theMajorRadius,const Standard_Real theMinorRadius); + +//! Changes the major radius.
+Standard_EXPORT void SetMajorRadius(const Standard_Real theMajorRadius) ; + +//! Changes the minor radius.
+Standard_EXPORT void SetMinorRadius(const Standard_Real theMinorRadius) ; + +//! Changes the minor radius of the elliptical torus, which is perpendicular to the major radius +Standard_EXPORT void SetMinorEllipticalRadius(const Standard_Real theMinorEllipsRadius) ; + +//! Return the major radius +Standard_EXPORT Standard_Real GetMajorRadius() const; + +//! Return the minor radius +Standard_EXPORT Standard_Real GetMinorRadius() const; + +//! return minor radius for elliptical torus
+//! If the torus is elliptical, the Minor radius splits into one part
+//! parallel to the main axis (MinorRadius) and one part perpendicular
+//! to the main axis (MinorEllipticalRadius) +Standard_EXPORT Standard_Real GetMinorEllipticalRadius() const; + +//!Returns true if torus is elliptical +Standard_EXPORT Standard_Boolean IsElliptical() const ; + +Standard_EXPORT void SetElliptical(const Standard_Boolean theState = Standard_True); + + +//! Computes the coefficients of the implicit equation of the surface
+//! in the absolute cartesian coordinate system :
+//! Coef(1) * X**4 + Coef(2) * Y**4 + Coef(3) * Z**4 +
+//! Coef(4) * X**3 * Y + Coef(5) * X**3 * Z + Coef(6) * Y**3 * X +
+//! Coef(7) * Y**3 * Z + Coef(8) * Z**3 * X + Coef(9) * Z**3 * Y +
+//! Coef(10) * X**2 * Y**2 + Coef(11) * X**2 * Z**2 +
+//! Coef(12) * Y**2 * Z**2 + Coef(13) * X**3 + Coef(14) * Y**3 +
+//! Coef(15) * Z**3 + Coef(16) * X**2 * Y + Coef(17) * X**2 * Z +
+//! Coef(18) * Y**2 * X + Coef(19) * Y**2 * Z + Coef(20) * Z**2 * X +
+//! Coef(21) * Z**2 * Y + Coef(22) * X**2 + Coef(23) * Y**2 +
+//! Coef(24) * Z**2 + Coef(25) * X * Y + Coef(26) * X * Z +
+//! Coef(27) * Y * Z + Coef(28) * X + Coef(29) * Y + Coef(30) * Z +
+//! Coef(31) = 0.0
+Standard_EXPORT void Coefficients(TColStd_Array1OfReal& Coef) const; + + +Standard_EXPORT virtual void Print(Standard_OStream& theStream) const; + +//! Performs Point evaluation
+Standard_EXPORT virtual Standard_Real Evaluate(const gp_Pnt& thePoint) const; + +//! findes a point on the surface;
+Standard_EXPORT virtual gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + + +Standard_EXPORT virtual void SetCasSurf(const GeomAdaptor_Surface& theSurf) ; + +//! returns the Cas surface
+Standard_EXPORT virtual Handle_Geom_Surface CasSurf() const; + + +Standard_EXPORT virtual Standard_Boolean IsEqual(const Handle(McCadCSGGeom_Surface)& another) const; + + +Standard_EXPORT virtual Standard_Boolean IsGeomEqual(const Handle(McCadCSGGeom_Surface)& another) const; +//Standard_EXPORT ~McCadCSGGeom_Torus(); + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Real myMajorRadius; +Standard_Real myMinorRadius; +// for elliptical tori myMinorRadius is defined as the radius collinear to myMajorRadius +// while myMinorEllipsRadius defines the radius of the ellipse which is perpendicular +// to myMajorRadius +Standard_Real myMinorEllipsRadius; + +Standard_Boolean myIsElliptical; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.ixx new file mode 100644 index 0000000..04c3b2a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Torus::~McCadCSGGeom_Torus() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Torus_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Surface); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Torus", + sizeof(McCadCSGGeom_Torus), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Torus) Handle(McCadCSGGeom_Torus)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Torus) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Torus))) { + _anOtherObject = Handle(McCadCSGGeom_Torus)((Handle(McCadCSGGeom_Torus)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Torus::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Torus) ; +} +//Standard_Boolean McCadCSGGeom_Torus::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Torus) == AType || McCadCSGGeom_Surface::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Torus::~Handle_McCadCSGGeom_Torus() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.jxx new file mode 100644 index 0000000..b5bc6e6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Torus.jxx @@ -0,0 +1,21 @@ +#ifndef _gp_Ax3_HeaderFile +#include +#endif +#ifndef _TColStd_Array1OfReal_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _Geom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Torus_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.hxx new file mode 100644 index 0000000..3898b77 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.hxx @@ -0,0 +1,131 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#define _McCadCSGGeom_Transformation_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _gp_Trsf_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +class gp_Trsf; + +//! \brief Class of geometrical transformation + + +class McCadCSGGeom_Transformation : public MMgt_TShared { + +public: + // Methods PUBLIC + // + + +//! Defines of a transformation in 3D space:
+//! . Translation, Rotation, Scale
+//! . Symmetry with respect to a point, a line, a plane.
+//! The transformations can be represented as follow :
+//!
+//! V1 V2 V3 T XYZ XYZ
+//! | a11 a12 a13 a14 | | x | | x'|
+//! | a21 a22 a23 a24 | | y | | y'|
+//! | a31 a32 a33 a34 | | z | = | z'|
+//! | 0 0 0 1 | | 1 | | 1 |
//! creation
+Standard_EXPORT McCadCSGGeom_Transformation(); + + +Standard_EXPORT McCadCSGGeom_Transformation(const Standard_Real a14,const Standard_Real a24,const Standard_Real a34,const Standard_Real a11,const Standard_Real a12,const Standard_Real a13,const Standard_Real a21,const Standard_Real a22,const Standard_Real a23,const Standard_Real a31,const Standard_Real a32,const Standard_Real a33); + + +Standard_EXPORT void SetValues(const Standard_Real a14,const Standard_Real a24,const Standard_Real a34,const Standard_Real a11,const Standard_Real a12,const Standard_Real a13,const Standard_Real a21,const Standard_Real a22,const Standard_Real a23,const Standard_Real a31,const Standard_Real a32,const Standard_Real a33) ; + + +Standard_EXPORT void SetVValues(const Standard_Real a14,const Standard_Real a24,const Standard_Real a34) ; + + +Standard_EXPORT void SetIdNum(const Standard_Integer theId) ; + + +Standard_EXPORT Standard_Integer GetIdNum() const; + + +Standard_EXPORT void SetTrsf(const gp_Trsf& theTrsf) ; + + +Standard_EXPORT gp_Trsf GetTrsf() const; +//Standard_EXPORT ~McCadCSGGeom_Transformation(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myID; +gp_Trsf myTrsf; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.ixx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.ixx new file mode 100644 index 0000000..251e9ac --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCSGGeom_Transformation::~McCadCSGGeom_Transformation() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCSGGeom_Transformation_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCSGGeom_Transformation", + sizeof(McCadCSGGeom_Transformation), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCSGGeom_Transformation) Handle(McCadCSGGeom_Transformation)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCSGGeom_Transformation) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCSGGeom_Transformation))) { + _anOtherObject = Handle(McCadCSGGeom_Transformation)((Handle(McCadCSGGeom_Transformation)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCSGGeom_Transformation::DynamicType() const +{ + return STANDARD_TYPE(McCadCSGGeom_Transformation) ; +} +//Standard_Boolean McCadCSGGeom_Transformation::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCSGGeom_Transformation) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCSGGeom_Transformation::~Handle_McCadCSGGeom_Transformation() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.jxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.jxx new file mode 100644 index 0000000..c341bad --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Transformation.jxx @@ -0,0 +1,6 @@ +#ifndef _gp_Trsf_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGGeom_Unit.hxx b/src/MCCAD/McCadHeaders/McCadCSGGeom_Unit.hxx new file mode 100644 index 0000000..3ecc1ce --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGGeom_Unit.hxx @@ -0,0 +1,38 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGGeom_Unit_HeaderFile +#define _McCadCSGGeom_Unit_HeaderFile + +//! Units used in CAD Model
+//! =============================
+enum McCadCSGGeom_Unit { + McCadCSGGeom_CM, + McCadCSGGeom_MM, + McCadCSGGeom_Inch, +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool.hxx new file mode 100644 index 0000000..c64919d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool.hxx @@ -0,0 +1,184 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_HeaderFile +#define _McCadCSGTool_HeaderFile + +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif + +class TopTools_HSequenceOfShape; +class TopoDS_Face; +class TColgp_HSequenceOfPnt; +class TopoDS_Shape; +class TopoDS_Solid; +class McCadCSGTool_CellBuilder; +class McCadCSGTool_Decomposer; +class McCadCSGTool_Extender; +class McCadCSGTool_Cutter; +class McCadCSGTool_TrivialCheck; +class McCadCSGTool_SignCheck; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Collection of useful CSG Tools + +//! Implementation of useful Tools for Constructive Solid Geometries.
+ +class McCadCSGTool { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! returns non-redundant points from vertices and all points from face triangulation
+//! used for sign computation;
+Standard_EXPORT static Handle_TColgp_HSequenceOfPnt AllSamplePoints(const TopoDS_Shape& theShape) ; + +/* +//! computes resultants using BBox method.
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape AppBoxResultants(const TopoDS_Face& theFace) ;*/ + +//! computes resultants using BBox method.
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape BoxResultants(const TopoDS_Face& theFace) ; + +//! computes partial drivatives
+//! temporary implementation only for conical surfaces!!!!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape Partials(const TopoDS_Face& theFace) ; + +Standard_EXPORT static Standard_Boolean GenAuxFaceOfTorus(Handle(TopTools_HSequenceOfShape) & seqResultant, + const TopoDS_Face & aFace); + +Standard_EXPORT static Standard_Boolean AddAuxSurf(const TopoDS_Face& aFace, + Handle(TopTools_HSequenceOfShape) & seqResultant); + +Standard_EXPORT static Standard_Boolean GenAuxFaceOfCylinder(Handle(TopTools_HSequenceOfShape) & seqResultant, + const TopoDS_Face& aFace); + +//! returns non-redundant points from vertices and non-free nodes from
+//! face triangulation.
+//! used for sign computation;
+Standard_EXPORT static Handle_TColgp_HSequenceOfPnt SamplePoints(const TopoDS_Shape& theShape) ; + +//! returns non-redundant sample points computed around a face.
+//! The method used here is scale transformation.
+Standard_EXPORT static Handle_TColgp_HSequenceOfPnt FaceSamplePoints(const TopoDS_Face& theFace,const Standard_Integer MAXNUMPNT,const Standard_Integer MINNUMPNT) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedLinFace(Handle_TopTools_HSequenceOfShape& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedCylFace(Handle_TopTools_HSequenceOfShape& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedConFace(Handle_TopTools_HSequenceOfShape& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedSphFace(Handle_TopTools_HSequenceOfShape& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedTorFace(Handle_TopTools_HSequenceOfShape& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedSORFace(Handle_TopTools_HSequenceOfShape& aFaceSeq) ; + +/* +//! Linearizing small faces of a solid
+//! in odrder to make Boolean evaluation easy and reduce model comlexity.
+Standard_EXPORT static TopoDS_Solid LinSolid(const TopoDS_Solid& aSolid) ;*/ + +//! computes resultants using BBox method.
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape Resultants(const TopoDS_Face& theFace) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + +friend class McCadCSGTool_CellBuilder; +friend class McCadCSGTool_Decomposer; +friend class McCadCSGTool_Extender; +friend class McCadCSGTool_Cutter; +friend class McCadCSGTool_TrivialCheck; +friend class McCadCSGTool_SignCheck; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool.ixx b/src/MCCAD/McCadHeaders/McCadCSGTool.ixx new file mode 100644 index 0000000..8cbbc7b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool.jxx b/src/MCCAD/McCadHeaders/McCadCSGTool.jxx new file mode 100644 index 0000000..0635cd1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool.jxx @@ -0,0 +1,18 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGTool_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.hxx new file mode 100644 index 0000000..95d55bd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.hxx @@ -0,0 +1,170 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_CellBuilder_HeaderFile +#define _McCadCSGTool_CellBuilder_HeaderFile + +#ifndef _Handle_McCadTDS_HSequenceOfExtSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadTDS_HSequenceOfExtSolid; +class McCadCSGGeom_Cell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +//! \brief builds a McCadCSGGeom_Cell from a McCadTDS_ExtSolid + +//! This class builds cells from extended solids.
+//!
+class McCadCSGTool_CellBuilder { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +Standard_EXPORT McCadCSGTool_CellBuilder(); + + +Standard_EXPORT McCadCSGTool_CellBuilder(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq); + + +Standard_EXPORT McCadCSGTool_CellBuilder(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq,const Standard_Integer theMatNumber); + +Standard_EXPORT McCadCSGTool_CellBuilder(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq,const Standard_Integer theMatNumber, const Standard_Real +theDensity); + + +Standard_EXPORT void Init(const Handle(McCadTDS_HSequenceOfExtSolid)& theExtSolidSeq) ; + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT void SetMatNumber(const Standard_Integer theMatNumber) ; + + +Standard_EXPORT void SetDensity(const Standard_Real theDensity); + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_McCadCSGGeom_Cell GetCell() const; + + +Standard_EXPORT Standard_Integer NbExtSolids() const; + + +Standard_EXPORT Standard_Integer NbFaces() const; + + +Standard_EXPORT Standard_Boolean IsSimpleSolid() const; + + +Standard_EXPORT void SetUnits(McCadCSGGeom_Unit theUnit) ; + + +Standard_EXPORT McCadCSGGeom_Unit GetUnits() const ; + + +Standard_EXPORT void MakeOuterVoid(Standard_Boolean state) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // +Standard_EXPORT Standard_Boolean ComputeGQ(const TopoDS_Face& theFace, math_Vector& pVec); +Standard_EXPORT Standard_Real DjFunc(const gp_Pnt& pnt, const Standard_Integer& indx); + // Fields PRIVATE + // +Handle_McCadTDS_HSequenceOfExtSolid myExtSolidSeq; +Standard_Integer myMatNumber; +Handle_McCadCSGGeom_Cell myCell; +Standard_Boolean myIsDone; +Standard_Real myDensity; +Standard_Boolean myIsVoid; +McCadCSGGeom_Unit myUnits; +Standard_Boolean myMakeOuterVoid; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.ixx b/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.ixx new file mode 100644 index 0000000..88c2892 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.jxx b/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.jxx new file mode 100644 index 0000000..1913286 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_CellBuilder.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadTDS_HSequenceOfExtSolid_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _McCadCSGTool_CellBuilder_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.hxx new file mode 100644 index 0000000..c3f3b1a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.hxx @@ -0,0 +1,139 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_Cutter_HeaderFile +#define _McCadCSGTool_Cutter_HeaderFile + +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class McCadTDS_ExtFace; +class TopoDS_Solid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Performs a slicing operation of a solid with a planar face + +//! This class generates a cut of a solid by a given face
+//! and direction.
+class McCadCSGTool_Cutter { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +Standard_EXPORT McCadCSGTool_Cutter(); + + +Standard_EXPORT McCadCSGTool_Cutter(const TopoDS_Shape& theSolid,const Handle(McCadTDS_ExtFace)& theExtFace); + + +Standard_EXPORT void Init(const TopoDS_Shape& theSolid,const Handle(McCadTDS_ExtFace)& theExtFace) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape Solids() const; + + +Standard_EXPORT void SetLastCut(const Standard_Boolean isLast) ; + + +Standard_EXPORT Standard_Boolean IsLastCut() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Shape mySolid; +Handle_TopTools_HSequenceOfShape myResultSolids; +Standard_Boolean myIsDone; +Handle_McCadTDS_ExtFace myExtFace; +TopoDS_Shape myPosPartSol; +TopoDS_Shape myNegPartSol; +Standard_Boolean myLastCut; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.ixx b/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.ixx new file mode 100644 index 0000000..b11b52f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.jxx b/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.jxx new file mode 100644 index 0000000..42b5c70 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Cutter.jxx @@ -0,0 +1,12 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGTool_Cutter_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.hxx new file mode 100644 index 0000000..29e49e3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.hxx @@ -0,0 +1,130 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_Decomposer_HeaderFile +#define _McCadCSGTool_Decomposer_HeaderFile + +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class TopoDS_Solid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Performs a sign constant decomposition + +//! This class performs sign constant decomposition
+//! of a given solid. It uses the classes SignCheck and Cutter.
+//! The algorithm works as follows: call SingCheck, if sign state is
+//! changing then cutt by a linear face. There are two sequence for
+//! processed(sign constant) and unprocessed solids.
+ +class McCadCSGTool_Decomposer { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +Standard_EXPORT McCadCSGTool_Decomposer(); + + +Standard_EXPORT McCadCSGTool_Decomposer(const TopoDS_Solid& theSolid); + + +Standard_EXPORT void Init(const TopoDS_Solid& theSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetProcessedSolids() const; + + +Standard_EXPORT Standard_Integer NbProcessedSolids() const; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_TopTools_HSequenceOfShape myProcessedSolids; +Handle_TopTools_HSequenceOfShape myUnProcessedSolids; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.ixx b/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.ixx new file mode 100644 index 0000000..123748e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.jxx b/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.jxx new file mode 100644 index 0000000..4f9cdfd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Decomposer.jxx @@ -0,0 +1,9 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGTool_Decomposer_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.hxx new file mode 100644 index 0000000..d82f491 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.hxx @@ -0,0 +1,128 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_Extender_HeaderFile +#define _McCadCSGTool_Extender_HeaderFile + +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadTDS_ExtSolid; +class TopoDS_Solid; + +#include +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Extends the boundary set of a solid + + +class McCadCSGTool_Extender { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class extends a solid by adding resultant faces
+//! whenever necessary.
+Standard_EXPORT McCadCSGTool_Extender(); + + +Standard_EXPORT McCadCSGTool_Extender(const TopoDS_Solid& theSolid); + + +Standard_EXPORT void Init(const TopoDS_Solid& theSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_McCadTDS_ExtSolid ExtSolid() const; + + +Standard_EXPORT void FuseFaces(Handle(TopTools_HSequenceOfShape)& fcSeq, Standard_Boolean reversedOnly = Standard_True); + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Solid mySolid; +Handle_McCadTDS_ExtSolid myExtSolid; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.ixx b/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.ixx new file mode 100644 index 0000000..5808994 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.jxx b/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.jxx new file mode 100644 index 0000000..6013c13 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_Extender.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGTool_Extender_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_FaceFuser.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_FaceFuser.hxx new file mode 100644 index 0000000..52e50bc --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_FaceFuser.hxx @@ -0,0 +1,124 @@ +/* + * McCadCSGTool_FaceFuser.hxx + * + * Created on: Dec 15, 2010 + * Author: grosse + */ + +#ifndef MCCADCSGTOOL_FACEFUSER_HXX_ +#define MCCADCSGTOOL_FACEFUSER_HXX_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +//#include + + +//! This class provides an algorithm to fuse + +class McCadCSGTool_FaceFuser +{ + +public: + // ctors + ///////////////// + //! Standard ctor + McCadCSGTool_FaceFuser(); + /** Initialize _FaceFuser with a Sequence of Objects, that contain faces + skipForwardOriented is used when only reverse oriented faces should be + taken into account. + */ + McCadCSGTool_FaceFuser(Handle_TopTools_HSequenceOfShape& faceSeq, Standard_Boolean skipForwardOriented=Standard_False); + //! To fuse just two faces + McCadCSGTool_FaceFuser(TopoDS_Face& f1, TopoDS_Face& f2); + + + // public Methods + //////////////////// + //! returns false if all fusion operations were successful + Standard_Boolean FusionFailed(); + //! Returns true if fusion has been performed + Standard_Boolean IsDone(); + //! Return fused faces. If fuse failed for one pair of faces, a warning will be printed. + Handle_TopTools_HSequenceOfShape GetFused(); + //! Return original faces + Handle_TopTools_HSequenceOfShape GetOriginal(); + //! Add any kind of shape that includes faces (Solid, Face, Shell,..) + void AddShapes(Handle_TopTools_HSequenceOfShape& theShapes); + //! Reset all settings + void Init(); + //! Test if two faces share the same surface and are neighbours + Standard_Boolean IsLateral(const TopoDS_Face& f1, const TopoDS_Face& f2); + //! switch; don't handle Forward oriented faces;
+ //! this comes in handy during the search for a boundary expansion for
+ //! non-linear solids
+ void SkipForwardOriented(Standard_Boolean& state) ; + //! Master fusion method, calls the slave fusion methods + void Fuse(); + +private: + + // Methods + /////////////// + + //! fuses lateral cylinders + void CylinderFuse(Handle_TopTools_HSequenceOfShape& faces); + //! fuses lateral cones + void ConeFuse(Handle_TopTools_HSequenceOfShape& faces); + //! fuses lateral spheres + void SphereFuse(Handle_TopTools_HSequenceOfShape& faces); + //! fuses lateral tori + void TorusFuse(Handle_TopTools_HSequenceOfShape& faces); + //! fuses lateral planes + void PlaneFuse(Handle_TopTools_HSequenceOfShape& faces); + //! try OCC BOP_Fuse + Standard_Boolean OCCFuse(Handle_TopTools_HSequenceOfShape& faces); + //! Check if the boundary of the faces ly on UV-Iso-Lines.
+ Standard_Boolean FaceBoundaryOnUVIsoLines(const TopoDS_Face& theFaces) ; + + // Fields + /////////////// + + Standard_Boolean myIsDone; + Standard_Boolean myFusionFailed; + + Handle_TopTools_HSequenceOfShape myFusedFaces; + Handle_TopTools_HSequenceOfShape myOriginalFaces; + GeomAbs_SurfaceType myCurrentSurfaceType; + Standard_Boolean myUseReverseOrientedOnly; + +}; + + + +#endif /* MCCADCSGTOOL_FACEFUSER_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.hxx new file mode 100644 index 0000000..d3a7a47 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.hxx @@ -0,0 +1,162 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_SignCheck_HeaderFile +#define _McCadCSGTool_SignCheck_HeaderFile + +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_HSequenceOfExtFace_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +class McCadTDS_ExtFace; +class McCadTDS_HSequenceOfExtFace; +class TColgp_HSequenceOfPnt; +class TopoDS_Solid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Tests solids for sign constancy + + +class McCadCSGTool_SignCheck { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class checks the sign constancy of the boundary
+//! supports of a given sold. Result of computation is deepest linear face
+//! changin sign. The deepest linear face is detemined by comparing the number of
+//! sign changin points. For faces deg.> 2 the corresponding resultants are used.
+//! For the computation of resultants see documentation.
+Standard_EXPORT McCadCSGTool_SignCheck(); + + +Standard_EXPORT McCadCSGTool_SignCheck(const TopoDS_Shape& theSolid); + + +Standard_EXPORT void Init(const TopoDS_Shape& theSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_McCadTDS_ExtFace GetExtFace() ; + + +Standard_EXPORT Standard_Integer NbExtFace() const; + + +Standard_EXPORT Standard_Boolean SignStateChanges() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Classify() ; + + +Standard_EXPORT Handle_McCadTDS_ExtFace Rank(Handle(McCadTDS_HSequenceOfExtFace)& theExtFaceSeq) ; + + +Standard_EXPORT void AdjustFaceUV() ; + + +Standard_EXPORT Handle_McCadTDS_HSequenceOfExtFace SingChangingResultants(const Handle(McCadTDS_ExtFace)& theExtFace) const; + + + // Fields PRIVATE + // +TopoDS_Shape mySolid; +Handle_McCadTDS_ExtFace myExtFace; +Standard_Integer myExtFaceIndex; +Handle_McCadTDS_HSequenceOfExtFace myAllExtFace; +Standard_Boolean mySignIsConstant; +Standard_Boolean myIsDone; +Handle_TColgp_HSequenceOfPnt mySamplePnt; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.ixx b/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.ixx new file mode 100644 index 0000000..0e0cbb7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.jxx b/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.jxx new file mode 100644 index 0000000..5155551 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_SignCheck.jxx @@ -0,0 +1,15 @@ +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_HSequenceOfExtFace_HeaderFile +#include +#endif +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadCSGTool_SignCheck_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_SurfaceChecker.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_SurfaceChecker.hxx new file mode 100644 index 0000000..b3e438b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_SurfaceChecker.hxx @@ -0,0 +1,31 @@ +/* + * McCadCSGTool_SurfaceChecker.hxx + * + * Created on: Jun 7, 2010 + * Author: grosse + */ + +#ifndef MCCADCSGTOOL_SURFACECHECKER_HXX_ +#define MCCADCSGTOOL_SURFACECHECKER_HXX_ + +//! \brief perform a check for all surfaces in a CAD file + +//! Tests for Surface Types and prints a list of all used surfaces in a STP file
+//! to the outputfile outp + +#include +#include + +class McCadCSGTool_SurfaceChecker { +public: +Standard_EXPORT bool readFile(TCollection_AsciiString inName, TCollection_AsciiString logFileName="surfaceCheck.log"); +Standard_EXPORT void readDirectory(TCollection_AsciiString astring, TCollection_AsciiString logFileName="surfaceCheck.log"); +Standard_EXPORT bool printSurfaceInfo(Handle_TopTools_HSequenceOfShape& shapes, + TCollection_AsciiString inName="undefined", + TCollection_AsciiString logFileName="surfaceCheck.log"); + +Standard_EXPORT McCadCSGTool_SurfaceChecker(); +Standard_EXPORT ~McCadCSGTool_SurfaceChecker(); +}; + +#endif /* MCCADCSGTOOL_SURFACECHECKER_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadCSGTool_TrivialCheck.hxx b/src/MCCAD/McCadHeaders/McCadCSGTool_TrivialCheck.hxx new file mode 100644 index 0000000..0cfeca4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGTool_TrivialCheck.hxx @@ -0,0 +1,131 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGTool_TrivialCheck_HeaderFile +#define _McCadCSGTool_TrivialCheck_HeaderFile + +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class TopoDS_Solid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Tests if a solid is an elementary shape + +//! This class tests whether the solid is elemantary:
+//! linear convex, single sphere or single Torus;
+ +class McCadCSGTool_TrivialCheck { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +Standard_EXPORT McCadCSGTool_TrivialCheck(); + + +Standard_EXPORT McCadCSGTool_TrivialCheck(const TopoDS_Shape& theSolid); + + +Standard_EXPORT void Init(const TopoDS_Shape& theSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Standard_Boolean LinearConvex() const; + + +Standard_EXPORT Standard_Boolean SingleSphere() const; + + +Standard_EXPORT Standard_Boolean SingleTorus() const; + + +Standard_EXPORT Standard_Boolean Elementary() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Shape mySolid; +Standard_Boolean myElementary; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.hxx b/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.hxx new file mode 100644 index 0000000..b7d6f25 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.hxx @@ -0,0 +1,172 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCSGUtil_SolidBuilder_HeaderFile +#define _McCadCSGUtil_SolidBuilder_HeaderFile + +#ifndef _TopTools_DataMapOfIntegerShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _McCadCSGBuild_SolidType_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +class McCadMcRead_Cell; +class TopoDS_Shape; +class McCadCSGGeom_Surface; +class TopTools_HSequenceOfShape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Build a TopoDS_Solid from a CSG description + +class McCadCSGUtil_SolidBuilder { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Creates a postfix CSG expr. from infix MCNP syntax.
+//! uses ExprParser to complete the infix expression
+//!
+Standard_EXPORT McCadCSGUtil_SolidBuilder(); + + +Standard_EXPORT McCadCSGUtil_SolidBuilder(const Handle(McCadMcRead_Cell)& theCell); + + +Standard_EXPORT void Init(const Handle(McCadMcRead_Cell)& theCell) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT TopoDS_Shape MakeHalfSpace(const Handle(McCadCSGGeom_Surface)& theCSGSurf,const Standard_Integer sNum) ; + + +Standard_EXPORT TopoDS_Shape Reverse(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT TopoDS_Shape Common(const TopoDS_Shape& theShape1,const TopoDS_Shape& theShape2) ; + + +Standard_EXPORT TopoDS_Shape Fuse(const TopoDS_Shape& theShape1,const TopoDS_Shape& theShape2) ; + + +Standard_EXPORT Standard_Boolean CheckShape(const TopoDS_Shape& theShape) const; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape HalfSpaces() const; + + +Standard_EXPORT TopoDS_Shape Result() const; + + +Standard_EXPORT Standard_Integer NbHSolids() const; + + +Standard_EXPORT McCadCSGBuild_SolidType ResultType() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT void MakeSolid() ; + + + // Fields PRIVATE + // +TopTools_DataMapOfIntegerShape myHSolidMap; +TopoDS_Shape myShape; +Handle_McCadMcRead_Cell myCell; +McCadCSGBuild_SolidType myType; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.ixx b/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.ixx new file mode 100644 index 0000000..a03c7b6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.jxx b/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.jxx new file mode 100644 index 0000000..ec98607 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCSGUtil_SolidBuilder.jxx @@ -0,0 +1,15 @@ +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadCSGUtil_SolidBuilder_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_CasDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_CasDocument.hxx new file mode 100644 index 0000000..576dfa8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_CasDocument.hxx @@ -0,0 +1,150 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_CasDocument_HeaderFile +#define _McCadCom_CasDocument_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif + +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _Handle_AIS_InteractiveContext_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_AIS_Shape_HeaderFile +#include +#endif + +#include +#include + +class AIS_InteractiveContext; +class McCadCom_CasView; +class AIS_Shape; +class McCadCom_ListOfCasView; + + +//! base Document class
+class McCadCom_CasDocument : public McCadCom_Document/*, public TDocStd_Document*/{ + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_CasDocument(); + + +Standard_EXPORT McCadCom_CasDocument(const Handle(AIS_InteractiveContext)& theContext); + + +Standard_EXPORT McCadCom_CasDocument(const Standard_Integer& theID); + + +Standard_EXPORT virtual void Notify() const; + + +Standard_EXPORT virtual void Attach(const Handle(McCadCom_CasView)& theView) ; + + +Standard_EXPORT virtual void AddShape(const Handle(AIS_Shape)& theAISShape) ; + + +Standard_EXPORT virtual void RemoveShape(const Handle(AIS_Shape)& theAISShape) ; + + +Standard_EXPORT virtual void SetContext(const Handle(AIS_InteractiveContext)& theContext) ; + + +Standard_EXPORT virtual void SetBgColor(const Quantity_Color& theCol) ; + + +Standard_EXPORT virtual Quantity_Color GetBgColor() const; + + +Standard_EXPORT virtual Handle_AIS_InteractiveContext GetContext() const; + + +Standard_EXPORT virtual Handle_McCadCom_CasView NewView() ; + + +Standard_EXPORT virtual void Views(McCadCom_ListOfCasView& theViewList) ; +//Standard_EXPORT ~McCadCom_CasDocument(); + + +Standard_EXPORT void SetTDoc(const Handle_TDocStd_Document& theTDoc) ; + + +Standard_EXPORT Handle_TDocStd_Document GetTDoc() ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +McCadCom_ListOfCasView myViews; +Handle_AIS_InteractiveContext myContext; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + Handle_TDocStd_Document myTDoc; + Quantity_Color myBgCol; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_CasDocument.ixx b/src/MCCAD/McCadHeaders/McCadCom_CasDocument.ixx new file mode 100644 index 0000000..1566394 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_CasDocument.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCom_CasDocument::~McCadCom_CasDocument() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_CasDocument_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCom_Document); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_CasDocument", + sizeof(McCadCom_CasDocument), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_CasDocument) Handle(McCadCom_CasDocument)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_CasDocument) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_CasDocument))) { + _anOtherObject = Handle(McCadCom_CasDocument)((Handle(McCadCom_CasDocument)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_CasDocument::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_CasDocument) ; +} +//Standard_Boolean McCadCom_CasDocument::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_CasDocument) == AType || McCadCom_Document::IsKind(AType)); +//} +//Handle_McCadCom_CasDocument::~Handle_McCadCom_CasDocument() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCom_CasDocument.jxx b/src/MCCAD/McCadHeaders/McCadCom_CasDocument.jxx new file mode 100644 index 0000000..f2810a0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_CasDocument.jxx @@ -0,0 +1,15 @@ +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _AIS_InteractiveContext_HeaderFile +#include +#endif +#ifndef _AIS_Shape_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_CasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_CasView.hxx new file mode 100644 index 0000000..4849a01 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_CasView.hxx @@ -0,0 +1,306 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_CasView_HeaderFile +#define _McCadCom_CasView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif + +#ifndef _Handle_V3d_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_TaskMaster_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +//qiu comment out because the Window in old McCad is not used any more +//qiu #ifndef _Handle_Xw_Window_HeaderFile +//qiu #include +//qiu #endif +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _V3d_TypeOfShadingModel_HeaderFile +#include +#endif +#ifndef _V3d_TypeOfVisualization_HeaderFile +#include +#endif +#ifndef _Standard_CString_HeaderFile +#include +#endif +#ifndef _Aspect_FormatOfSheetPaper_HeaderFile +#include +#endif +class V3d_View; +class McCadTool_TaskMaster; +class McCadCom_CasDocument; +//qiu class Xw_Window; +class McCadTool_Task; +class QMouseEvent; +class Quantity_Color; + + +//! base View class
+class McCadCom_CasView : public McCadCom_View { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_CasView(); + + +Standard_EXPORT McCadCom_CasView(const Handle(McCadCom_CasDocument)& theDocument /*qiu = NULL*/); + +//qiu comment out because the Window in old McCad is not used any more +//qiu Standard_EXPORT virtual void Init(const Handle(Xw_Window)& theWin) ; + + +Standard_EXPORT Standard_Boolean IsInit() const; + + +Standard_EXPORT virtual void SetTaskMaster(const Handle(McCadTool_TaskMaster)& theTaskMaster) ; + + +Standard_EXPORT virtual Handle_McCadTool_TaskMaster GetTaskMaster() const; + + +Standard_EXPORT virtual void SetDefaultTask(const Handle(McCadTool_Task)& theTask) ; + + +Standard_EXPORT virtual Handle_McCadTool_Task GetDefaultTask() const; + + +Standard_EXPORT virtual void SetCurrentTask(const Handle(McCadTool_Task)& theTask) ; + + +Standard_EXPORT virtual Handle_McCadTool_Task GetCurrentTask() const; + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void SetState(const McCadTool_State theState) ; + + +Standard_EXPORT McCadTool_State State() const; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent& e) ; + + +Standard_EXPORT void MouseMoveEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Handle_V3d_View View() const; + + +Standard_EXPORT void Redraw() const; + + +Standard_EXPORT void Reset() const; + + +Standard_EXPORT void FitAll() const; + + +Standard_EXPORT void FitAll(const Standard_Integer Xmin,const Standard_Integer Ymin,const Standard_Integer Xmax,const Standard_Integer Ymax) ; + + +Standard_EXPORT void Back() const; + + +Standard_EXPORT void Front() const; + + +Standard_EXPORT void Top() const; + + +Standard_EXPORT void Bottom() const; + + +Standard_EXPORT void Left() const; + + +Standard_EXPORT void Right() const; + + +Standard_EXPORT void Iso() const; + + +Standard_EXPORT void Pan(const Standard_Integer Dx,const Standard_Integer Dy) ; + + +Standard_EXPORT void Rotate(const Standard_Real Ax,const Standard_Real Ay,const Standard_Real Az) ; + + +Standard_EXPORT void Rotate(const Standard_Real Ax,const Standard_Real Ay,const Standard_Real Az,const Standard_Integer X,const Standard_Integer Y,const Standard_Integer Z) ; + + +Standard_EXPORT void WindowFitAll(const Standard_Integer Xmin,const Standard_Integer Ymin,const Standard_Integer Xmax,const Standard_Integer Ymax) ; + + +Standard_EXPORT void Resize() ; + + +Standard_EXPORT void Size(Standard_Integer& theWidth,Standard_Integer& theHeight) ; + + +Standard_EXPORT void Zoom() ; + + +Standard_EXPORT void SetBackgroundColor(const Quantity_Color& theColor) ; + + +Standard_EXPORT void SetBackgroundColor(const Standard_Real R,const Standard_Real G,const Standard_Real B) ; + + +Standard_EXPORT Quantity_Color BackgroundColor() const; + + +Standard_EXPORT void SetShadingModel(const V3d_TypeOfShadingModel Model) ; + + +Standard_EXPORT void SetVisualization(const V3d_TypeOfVisualization Mode) ; + + +Standard_EXPORT void SetHiddenLineOn() ; + + +Standard_EXPORT void SetHiddenLineOff() ; + + +Standard_EXPORT void SetAntialiasingOn() ; + + +Standard_EXPORT void SetAntialiasingOff() ; + + +Standard_EXPORT void Dump(const Standard_CString aFile,const Aspect_FormatOfSheetPaper aFormat) ; + + +Standard_EXPORT void SetMinMaxPoints(const Standard_Integer Xmin,const Standard_Integer Ymin,const Standard_Integer Xmax,const Standard_Integer Ymax) ; + + +Standard_EXPORT void SetMinPoints(const Standard_Integer Xmin,const Standard_Integer Ymin) ; + + +Standard_EXPORT void SetMaxPoints(const Standard_Integer Xmax,const Standard_Integer Ymax) ; + + +Standard_EXPORT void GetMinMaxPoints(Standard_Integer& Xmin,Standard_Integer& Ymin,Standard_Integer& Xmax,Standard_Integer& Ymax) ; + + +Standard_EXPORT void GetMinPoints(Standard_Integer& Xmin,Standard_Integer& Ymin) ; + + +Standard_EXPORT void GetMaxPoints(Standard_Integer& Xmax,Standard_Integer& Ymax) ; +//Standard_EXPORT ~McCadCom_CasView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Handle_V3d_View myView; +Handle_McCadTool_TaskMaster myTaskMaster; +Standard_Integer myXmin; +Standard_Integer myYmin; +Standard_Integer myXmax; +Standard_Integer myYmax; +Standard_Boolean myIsInitialized; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_CasView.ixx b/src/MCCAD/McCadHeaders/McCadCom_CasView.ixx new file mode 100644 index 0000000..06ed90e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_CasView.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCom_CasView::~McCadCom_CasView() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_CasView_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCom_View); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_CasView", + sizeof(McCadCom_CasView), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_CasView) Handle(McCadCom_CasView)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_CasView) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_CasView))) { + _anOtherObject = Handle(McCadCom_CasView)((Handle(McCadCom_CasView)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_CasView::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_CasView) ; +} +//Standard_Boolean McCadCom_CasView::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_CasView) == AType || McCadCom_View::IsKind(AType)); +//} +//Handle_McCadCom_CasView::~Handle_McCadCom_CasView() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCom_CasView.jxx b/src/MCCAD/McCadHeaders/McCadCom_CasView.jxx new file mode 100644 index 0000000..ed3d03f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_CasView.jxx @@ -0,0 +1,24 @@ +#ifndef _V3d_View_HeaderFile +#include +#endif +#ifndef _McCadTool_TaskMaster_HeaderFile +#include +#endif +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Xw_Window_HeaderFile +#include +#endif +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _Quantity_Color_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView.hxx new file mode 100644 index 0000000..bb39c71 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView.hxx @@ -0,0 +1,118 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_HeaderFile +#define _McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_ListOfCasView; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapofIntegerListOfCasView; +class McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView(); + + +Standard_EXPORT McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView(const McCadCom_DataMapofIntegerListOfCasView& aMap); + + +Standard_EXPORT void Initialize(const McCadCom_DataMapofIntegerListOfCasView& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const McCadCom_ListOfCasView& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument.hxx new file mode 100644 index 0000000..2664f6f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument.hxx @@ -0,0 +1,118 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_HeaderFile +#define _McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_ListOfDocument; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapofIntegerListOfDocument; +class McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument(); + + +Standard_EXPORT McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument(const McCadCom_DataMapofIntegerListOfDocument& aMap); + + +Standard_EXPORT void Initialize(const McCadCom_DataMapofIntegerListOfDocument& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const McCadCom_ListOfDocument& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView.hxx new file mode 100644 index 0000000..982710f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapIteratorOfDataMapofIntegerListOfView.hxx @@ -0,0 +1,118 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_HeaderFile +#define _McCadCom_DataMapIteratorOfDataMapofIntegerListOfView_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_ListOfView; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapofIntegerListOfView; +class McCadCom_DataMapNodeOfDataMapofIntegerListOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfView : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_DataMapIteratorOfDataMapofIntegerListOfView(); + + +Standard_EXPORT McCadCom_DataMapIteratorOfDataMapofIntegerListOfView(const McCadCom_DataMapofIntegerListOfView& aMap); + + +Standard_EXPORT void Initialize(const McCadCom_DataMapofIntegerListOfView& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const McCadCom_ListOfView& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView.hxx new file mode 100644 index 0000000..9f2003c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView.hxx @@ -0,0 +1,134 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#define _McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfCasView_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_ListOfCasView; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapofIntegerListOfCasView; +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView; + + + +class McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView(const Standard_Integer& K,const McCadCom_ListOfCasView& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + McCadCom_ListOfCasView& Value() const; +//Standard_EXPORT ~McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +McCadCom_ListOfCasView myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfCasView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfCasView +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument.hxx new file mode 100644 index 0000000..e1e3ac3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#define _McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfDocument_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_ListOfDocument; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapofIntegerListOfDocument; +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument; + + + +class McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument(const Standard_Integer& K,const McCadCom_ListOfDocument& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + McCadCom_ListOfDocument& Value() const; +//Standard_EXPORT ~McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument(); + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +McCadCom_ListOfDocument myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfDocument +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfDocument +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfView.hxx new file mode 100644 index 0000000..8b4f28f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapNodeOfDataMapofIntegerListOfView.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#define _McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadCom_ListOfView_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_ListOfView; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapofIntegerListOfView; +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfView; + + + +class McCadCom_DataMapNodeOfDataMapofIntegerListOfView : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_DataMapNodeOfDataMapofIntegerListOfView(const Standard_Integer& K,const McCadCom_ListOfView& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + McCadCom_ListOfView& Value() const; +//Standard_EXPORT ~McCadCom_DataMapNodeOfDataMapofIntegerListOfView(); + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +McCadCom_ListOfView myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadCom_ListOfView +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadCom_DataMapIteratorOfDataMapofIntegerListOfView +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView +#define TCollection_DataMapNode_Type_() McCadCom_DataMapNodeOfDataMapofIntegerListOfView_Type_() +#define TCollection_DataMap McCadCom_DataMapofIntegerListOfView +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfCasView.hxx new file mode 100644 index 0000000..ea23d6d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfCasView.hxx @@ -0,0 +1,157 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapofIntegerListOfCasView_HeaderFile +#define _McCadCom_DataMapofIntegerListOfCasView_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadCom_ListOfCasView; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapNodeOfDataMapofIntegerListOfCasView; +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_DataMapofIntegerListOfCasView : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfCasView(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfCasView& Assign(const McCadCom_DataMapofIntegerListOfCasView& Other) ; + McCadCom_DataMapofIntegerListOfCasView& operator =(const McCadCom_DataMapofIntegerListOfCasView& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCom_DataMapofIntegerListOfCasView() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const McCadCom_ListOfCasView& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const McCadCom_ListOfCasView& Find(const Standard_Integer& K) const; + const McCadCom_ListOfCasView& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT McCadCom_ListOfCasView& ChangeFind(const Standard_Integer& K) ; + McCadCom_ListOfCasView& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfCasView(const McCadCom_DataMapofIntegerListOfCasView& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfDocument.hxx new file mode 100644 index 0000000..1f946f8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfDocument.hxx @@ -0,0 +1,157 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapofIntegerListOfDocument_HeaderFile +#define _McCadCom_DataMapofIntegerListOfDocument_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadCom_ListOfDocument; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapNodeOfDataMapofIntegerListOfDocument; +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_DataMapofIntegerListOfDocument : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfDocument(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfDocument& Assign(const McCadCom_DataMapofIntegerListOfDocument& Other) ; + McCadCom_DataMapofIntegerListOfDocument& operator =(const McCadCom_DataMapofIntegerListOfDocument& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCom_DataMapofIntegerListOfDocument() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const McCadCom_ListOfDocument& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const McCadCom_ListOfDocument& Find(const Standard_Integer& K) const; + const McCadCom_ListOfDocument& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT McCadCom_ListOfDocument& ChangeFind(const Standard_Integer& K) ; + McCadCom_ListOfDocument& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfDocument(const McCadCom_DataMapofIntegerListOfDocument& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfView.hxx new file mode 100644 index 0000000..bcd0580 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_DataMapofIntegerListOfView.hxx @@ -0,0 +1,157 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_DataMapofIntegerListOfView_HeaderFile +#define _McCadCom_DataMapofIntegerListOfView_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_DataMapNodeOfDataMapofIntegerListOfView_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadCom_ListOfView; +class TColStd_MapIntegerHasher; +class McCadCom_DataMapNodeOfDataMapofIntegerListOfView; +class McCadCom_DataMapIteratorOfDataMapofIntegerListOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_DataMapofIntegerListOfView : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfView(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfView& Assign(const McCadCom_DataMapofIntegerListOfView& Other) ; + McCadCom_DataMapofIntegerListOfView& operator =(const McCadCom_DataMapofIntegerListOfView& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCom_DataMapofIntegerListOfView() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const McCadCom_ListOfView& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const McCadCom_ListOfView& Find(const Standard_Integer& K) const; + const McCadCom_ListOfView& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT McCadCom_ListOfView& ChangeFind(const Standard_Integer& K) ; + McCadCom_ListOfView& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_DataMapofIntegerListOfView(const McCadCom_DataMapofIntegerListOfView& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_Document.hxx b/src/MCCAD/McCadHeaders/McCadCom_Document.hxx new file mode 100644 index 0000000..168e4a2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_Document.hxx @@ -0,0 +1,143 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_Document_HeaderFile +#define _McCadCom_Document_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif + +#ifndef _TCollection_ExtendedString_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif + +#include + +class TCollection_ExtendedString; +class McCadCom_View; + + +//! base Document class
+class McCadCom_Document : public MMgt_TShared{ + +public: + // Methods PUBLIC + // + + +Standard_EXPORT virtual Standard_Boolean NewDocument(const Standard_Integer& theID = -1) ; + + +Standard_EXPORT Standard_Boolean IsInitialized() const; + + +Standard_EXPORT virtual Standard_Boolean OpenFile(const TCollection_ExtendedString& aFileName) ; + + +Standard_EXPORT virtual Standard_Boolean SaveFile() ; + + +Standard_EXPORT virtual Standard_Boolean SaveAsFile(const TCollection_ExtendedString& aFileName) ; + + +Standard_EXPORT virtual Standard_Boolean IsNew() ; + + +Standard_EXPORT virtual void Update() const; + + +Standard_EXPORT virtual void Notify() const; + + +Standard_EXPORT virtual void Detach(const Handle(McCadCom_View)& theView) ; + + +Standard_EXPORT virtual void SetDocName(const TCollection_ExtendedString& theName) ; + + +Standard_EXPORT virtual TCollection_ExtendedString GetDocName() const; + + +Standard_EXPORT virtual void SetIsModified(const Standard_Boolean theMod) ; + + +Standard_EXPORT Standard_Boolean IsSetModified() const; +//Standard_EXPORT ~McCadCom_Document(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + +Standard_EXPORT McCadCom_Document(); + + + // Fields PROTECTED + // +TCollection_ExtendedString myName; +Standard_Boolean myIsModified; +Standard_Boolean myIsInitialized; +Standard_Boolean myIsNew; + + +private: + + // Methods PRIVATE + // + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_Document.ixx b/src/MCCAD/McCadHeaders/McCadCom_Document.ixx new file mode 100644 index 0000000..95d6744 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_Document.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCom_Document::~McCadCom_Document() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_Document_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_Document", + sizeof(McCadCom_Document), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_Document) Handle(McCadCom_Document)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_Document) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_Document))) { + _anOtherObject = Handle(McCadCom_Document)((Handle(McCadCom_Document)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_Document::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_Document) ; +} +//Standard_Boolean McCadCom_Document::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_Document) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCom_Document::~Handle_McCadCom_Document() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCom_Document.jxx b/src/MCCAD/McCadHeaders/McCadCom_Document.jxx new file mode 100644 index 0000000..801cdb6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_Document.jxx @@ -0,0 +1,9 @@ +#ifndef _TCollection_ExtendedString_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif +#ifndef _McCadCom_Document_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfCasView.hxx new file mode 100644 index 0000000..5704132 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfCasView.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListIteratorOfListOfCasView_HeaderFile +#define _McCadCom_ListIteratorOfListOfCasView_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfCasView_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadCom_ListOfCasView; +class McCadCom_CasView; +class McCadCom_ListNodeOfListOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_ListIteratorOfListOfCasView { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_ListIteratorOfListOfCasView(); + + +Standard_EXPORT McCadCom_ListIteratorOfListOfCasView(const McCadCom_ListOfCasView& L); + + +Standard_EXPORT void Initialize(const McCadCom_ListOfCasView& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT Handle_McCadCom_CasView& Value() const; + + +friend class McCadCom_ListOfCasView; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item Handle_McCadCom_CasView +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfCasView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfCasView_Type_() +#define TCollection_List McCadCom_ListOfCasView +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfDocument.hxx new file mode 100644 index 0000000..e79c746 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfDocument.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListIteratorOfListOfDocument_HeaderFile +#define _McCadCom_ListIteratorOfListOfDocument_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfDocument_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadCom_ListOfDocument; +class McCadCom_Document; +class McCadCom_ListNodeOfListOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_ListIteratorOfListOfDocument { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_ListIteratorOfListOfDocument(); + + +Standard_EXPORT McCadCom_ListIteratorOfListOfDocument(const McCadCom_ListOfDocument& L); + + +Standard_EXPORT void Initialize(const McCadCom_ListOfDocument& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT Handle_McCadCom_Document& Value() const; + + +friend class McCadCom_ListOfDocument; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item Handle_McCadCom_Document +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfDocument +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfDocument_Type_() +#define TCollection_List McCadCom_ListOfDocument +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfView.hxx new file mode 100644 index 0000000..1563e8e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListIteratorOfListOfView.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListIteratorOfListOfView_HeaderFile +#define _McCadCom_ListIteratorOfListOfView_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfView_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadCom_ListOfView; +class McCadCom_View; +class McCadCom_ListNodeOfListOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_ListIteratorOfListOfView { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_ListIteratorOfListOfView(); + + +Standard_EXPORT McCadCom_ListIteratorOfListOfView(const McCadCom_ListOfView& L); + + +Standard_EXPORT void Initialize(const McCadCom_ListOfView& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT Handle_McCadCom_View& Value() const; + + +friend class McCadCom_ListOfView; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item Handle_McCadCom_View +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfView_Type_() +#define TCollection_List McCadCom_ListOfView +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfCasView.hxx new file mode 100644 index 0000000..ffb2f3a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfCasView.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListNodeOfListOfCasView_HeaderFile +#define _McCadCom_ListNodeOfListOfCasView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfCasView_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_CasView; +class McCadCom_ListOfCasView; +class McCadCom_ListIteratorOfListOfCasView; + + + +class McCadCom_ListNodeOfListOfCasView : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_ListNodeOfListOfCasView(const Handle(McCadCom_CasView)& I,const TCollection_MapNodePtr& n); + + Handle_McCadCom_CasView& Value() const; +//Standard_EXPORT ~McCadCom_ListNodeOfListOfCasView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_CasView myValue; + + +}; + +#define Item Handle_McCadCom_CasView +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfCasView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfCasView_Type_() +#define TCollection_List McCadCom_ListOfCasView +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfDocument.hxx new file mode 100644 index 0000000..e3181dd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfDocument.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListNodeOfListOfDocument_HeaderFile +#define _McCadCom_ListNodeOfListOfDocument_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfDocument_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_Document; +class McCadCom_ListOfDocument; +class McCadCom_ListIteratorOfListOfDocument; + + + +class McCadCom_ListNodeOfListOfDocument : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_ListNodeOfListOfDocument(const Handle(McCadCom_Document)& I,const TCollection_MapNodePtr& n); + + Handle_McCadCom_Document& Value() const; +//Standard_EXPORT ~McCadCom_ListNodeOfListOfDocument(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_Document myValue; + + +}; + +#define Item Handle_McCadCom_Document +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfDocument +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfDocument_Type_() +#define TCollection_List McCadCom_ListOfDocument +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfView.hxx new file mode 100644 index 0000000..9948fef --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListNodeOfListOfView.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListNodeOfListOfView_HeaderFile +#define _McCadCom_ListNodeOfListOfView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfView_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_View; +class McCadCom_ListOfView; +class McCadCom_ListIteratorOfListOfView; + + + +class McCadCom_ListNodeOfListOfView : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_ListNodeOfListOfView(const Handle(McCadCom_View)& I,const TCollection_MapNodePtr& n); + + Handle_McCadCom_View& Value() const; +//Standard_EXPORT ~McCadCom_ListNodeOfListOfView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_View myValue; + + +}; + +#define Item Handle_McCadCom_View +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfView_Type_() +#define TCollection_List McCadCom_ListOfView +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListOfCasView.hxx new file mode 100644 index 0000000..384dc11 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListOfCasView.hxx @@ -0,0 +1,200 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListOfCasView_HeaderFile +#define _McCadCom_ListOfCasView_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfCasView_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_ListIteratorOfListOfCasView; +class McCadCom_CasView; +class McCadCom_ListNodeOfListOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_ListOfCasView { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_ListOfCasView(); + + +Standard_EXPORT void Assign(const McCadCom_ListOfCasView& Other) ; + void operator=(const McCadCom_ListOfCasView& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadCom_ListOfCasView() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_CasView)& I) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_CasView)& I,McCadCom_ListIteratorOfListOfCasView& theIt) ; + + +Standard_EXPORT void Prepend(McCadCom_ListOfCasView& Other) ; + + +Standard_EXPORT void Append(const Handle(McCadCom_CasView)& I) ; + + +Standard_EXPORT void Append(const Handle(McCadCom_CasView)& I,McCadCom_ListIteratorOfListOfCasView& theIt) ; + + +Standard_EXPORT void Append(McCadCom_ListOfCasView& Other) ; + + +Standard_EXPORT Handle_McCadCom_CasView& First() const; + + +Standard_EXPORT Handle_McCadCom_CasView& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadCom_ListIteratorOfListOfCasView& It) ; + + +Standard_EXPORT void InsertBefore(const Handle(McCadCom_CasView)& I,McCadCom_ListIteratorOfListOfCasView& It) ; + + +Standard_EXPORT void InsertBefore(McCadCom_ListOfCasView& Other,McCadCom_ListIteratorOfListOfCasView& It) ; + + +Standard_EXPORT void InsertAfter(const Handle(McCadCom_CasView)& I,McCadCom_ListIteratorOfListOfCasView& It) ; + + +Standard_EXPORT void InsertAfter(McCadCom_ListOfCasView& Other,McCadCom_ListIteratorOfListOfCasView& It) ; + + +friend class McCadCom_ListIteratorOfListOfCasView; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_ListOfCasView(const McCadCom_ListOfCasView& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item Handle_McCadCom_CasView +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfCasView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfCasView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfCasView_Type_() +#define TCollection_List McCadCom_ListOfCasView +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListOfDocument.hxx new file mode 100644 index 0000000..2ddf360 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListOfDocument.hxx @@ -0,0 +1,200 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListOfDocument_HeaderFile +#define _McCadCom_ListOfDocument_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfDocument_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_ListIteratorOfListOfDocument; +class McCadCom_Document; +class McCadCom_ListNodeOfListOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_ListOfDocument { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_ListOfDocument(); + + +Standard_EXPORT void Assign(const McCadCom_ListOfDocument& Other) ; + void operator=(const McCadCom_ListOfDocument& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadCom_ListOfDocument() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_Document)& I) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_Document)& I,McCadCom_ListIteratorOfListOfDocument& theIt) ; + + +Standard_EXPORT void Prepend(McCadCom_ListOfDocument& Other) ; + + +Standard_EXPORT void Append(const Handle(McCadCom_Document)& I) ; + + +Standard_EXPORT void Append(const Handle(McCadCom_Document)& I,McCadCom_ListIteratorOfListOfDocument& theIt) ; + + +Standard_EXPORT void Append(McCadCom_ListOfDocument& Other) ; + + +Standard_EXPORT Handle_McCadCom_Document& First() const; + + +Standard_EXPORT Handle_McCadCom_Document& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadCom_ListIteratorOfListOfDocument& It) ; + + +Standard_EXPORT void InsertBefore(const Handle(McCadCom_Document)& I,McCadCom_ListIteratorOfListOfDocument& It) ; + + +Standard_EXPORT void InsertBefore(McCadCom_ListOfDocument& Other,McCadCom_ListIteratorOfListOfDocument& It) ; + + +Standard_EXPORT void InsertAfter(const Handle(McCadCom_Document)& I,McCadCom_ListIteratorOfListOfDocument& It) ; + + +Standard_EXPORT void InsertAfter(McCadCom_ListOfDocument& Other,McCadCom_ListIteratorOfListOfDocument& It) ; + + +friend class McCadCom_ListIteratorOfListOfDocument; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_ListOfDocument(const McCadCom_ListOfDocument& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item Handle_McCadCom_Document +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfDocument +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfDocument +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfDocument_Type_() +#define TCollection_List McCadCom_ListOfDocument +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_ListOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_ListOfView.hxx new file mode 100644 index 0000000..c1fa5c1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_ListOfView.hxx @@ -0,0 +1,200 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_ListOfView_HeaderFile +#define _McCadCom_ListOfView_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_ListNodeOfListOfView_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_ListIteratorOfListOfView; +class McCadCom_View; +class McCadCom_ListNodeOfListOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_ListOfView { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_ListOfView(); + + +Standard_EXPORT void Assign(const McCadCom_ListOfView& Other) ; + void operator=(const McCadCom_ListOfView& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadCom_ListOfView() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_View)& I) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_View)& I,McCadCom_ListIteratorOfListOfView& theIt) ; + + +Standard_EXPORT void Prepend(McCadCom_ListOfView& Other) ; + + +Standard_EXPORT void Append(const Handle(McCadCom_View)& I) ; + + +Standard_EXPORT void Append(const Handle(McCadCom_View)& I,McCadCom_ListIteratorOfListOfView& theIt) ; + + +Standard_EXPORT void Append(McCadCom_ListOfView& Other) ; + + +Standard_EXPORT Handle_McCadCom_View& First() const; + + +Standard_EXPORT Handle_McCadCom_View& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadCom_ListIteratorOfListOfView& It) ; + + +Standard_EXPORT void InsertBefore(const Handle(McCadCom_View)& I,McCadCom_ListIteratorOfListOfView& It) ; + + +Standard_EXPORT void InsertBefore(McCadCom_ListOfView& Other,McCadCom_ListIteratorOfListOfView& It) ; + + +Standard_EXPORT void InsertAfter(const Handle(McCadCom_View)& I,McCadCom_ListIteratorOfListOfView& It) ; + + +Standard_EXPORT void InsertAfter(McCadCom_ListOfView& Other,McCadCom_ListIteratorOfListOfView& It) ; + + +friend class McCadCom_ListIteratorOfListOfView; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_ListOfView(const McCadCom_ListOfView& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item Handle_McCadCom_View +#define Item_hxx +#define TCollection_ListNode McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadCom_ListIteratorOfListOfView +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadCom_ListNodeOfListOfView +#define TCollection_ListNode_Type_() McCadCom_ListNodeOfListOfView_Type_() +#define TCollection_List McCadCom_ListOfView +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfCasView.hxx new file mode 100644 index 0000000..31c357f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfCasView.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_MapIteratorOfMapOfCasView_HeaderFile +#define _McCadCom_MapIteratorOfMapOfCasView_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_CasView; +class TColStd_MapTransientHasher; +class McCadCom_MapOfCasView; +class McCadCom_StdMapNodeOfMapOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_MapIteratorOfMapOfCasView : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_MapIteratorOfMapOfCasView(); + + +Standard_EXPORT McCadCom_MapIteratorOfMapOfCasView(const McCadCom_MapOfCasView& aMap); + + +Standard_EXPORT void Initialize(const McCadCom_MapOfCasView& aMap) ; + + +Standard_EXPORT const Handle_McCadCom_CasView& Key() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfDocument.hxx new file mode 100644 index 0000000..ff701af --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfDocument.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_MapIteratorOfMapOfDocument_HeaderFile +#define _McCadCom_MapIteratorOfMapOfDocument_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_Document; +class TColStd_MapTransientHasher; +class McCadCom_MapOfDocument; +class McCadCom_StdMapNodeOfMapOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_MapIteratorOfMapOfDocument : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_MapIteratorOfMapOfDocument(); + + +Standard_EXPORT McCadCom_MapIteratorOfMapOfDocument(const McCadCom_MapOfDocument& aMap); + + +Standard_EXPORT void Initialize(const McCadCom_MapOfDocument& aMap) ; + + +Standard_EXPORT const Handle_McCadCom_Document& Key() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfView.hxx new file mode 100644 index 0000000..be76a58 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_MapIteratorOfMapOfView.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_MapIteratorOfMapOfView_HeaderFile +#define _McCadCom_MapIteratorOfMapOfView_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfView_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadCom_View; +class TColStd_MapTransientHasher; +class McCadCom_MapOfView; +class McCadCom_StdMapNodeOfMapOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_MapIteratorOfMapOfView : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_MapIteratorOfMapOfView(); + + +Standard_EXPORT McCadCom_MapIteratorOfMapOfView(const McCadCom_MapOfView& aMap); + + +Standard_EXPORT void Initialize(const McCadCom_MapOfView& aMap) ; + + +Standard_EXPORT const Handle_McCadCom_View& Key() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_MapOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_MapOfCasView.hxx new file mode 100644 index 0000000..0428978 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_MapOfCasView.hxx @@ -0,0 +1,142 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_MapOfCasView_HeaderFile +#define _McCadCom_MapOfCasView_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class McCadCom_CasView; +class TColStd_MapTransientHasher; +class McCadCom_StdMapNodeOfMapOfCasView; +class McCadCom_MapIteratorOfMapOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_MapOfCasView : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_MapOfCasView(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCom_MapOfCasView& Assign(const McCadCom_MapOfCasView& Other) ; + McCadCom_MapOfCasView& operator =(const McCadCom_MapOfCasView& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCom_MapOfCasView() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Add(const Handle(McCadCom_CasView)& aKey) ; + + +Standard_EXPORT Standard_Boolean Contains(const Handle(McCadCom_CasView)& aKey) const; + + +Standard_EXPORT Standard_Boolean Remove(const Handle(McCadCom_CasView)& aKey) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_MapOfCasView(const McCadCom_MapOfCasView& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_MapOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_MapOfDocument.hxx new file mode 100644 index 0000000..c124399 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_MapOfDocument.hxx @@ -0,0 +1,142 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_MapOfDocument_HeaderFile +#define _McCadCom_MapOfDocument_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class McCadCom_Document; +class TColStd_MapTransientHasher; +class McCadCom_StdMapNodeOfMapOfDocument; +class McCadCom_MapIteratorOfMapOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_MapOfDocument : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_MapOfDocument(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCom_MapOfDocument& Assign(const McCadCom_MapOfDocument& Other) ; + McCadCom_MapOfDocument& operator =(const McCadCom_MapOfDocument& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCom_MapOfDocument() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Add(const Handle(McCadCom_Document)& aKey) ; + + +Standard_EXPORT Standard_Boolean Contains(const Handle(McCadCom_Document)& aKey) const; + + +Standard_EXPORT Standard_Boolean Remove(const Handle(McCadCom_Document)& aKey) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_MapOfDocument(const McCadCom_MapOfDocument& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_MapOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_MapOfView.hxx new file mode 100644 index 0000000..d95ba21 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_MapOfView.hxx @@ -0,0 +1,142 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_MapOfView_HeaderFile +#define _McCadCom_MapOfView_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfView_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class McCadCom_View; +class TColStd_MapTransientHasher; +class McCadCom_StdMapNodeOfMapOfView; +class McCadCom_MapIteratorOfMapOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_MapOfView : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadCom_MapOfView(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadCom_MapOfView& Assign(const McCadCom_MapOfView& Other) ; + McCadCom_MapOfView& operator =(const McCadCom_MapOfView& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadCom_MapOfView() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Add(const Handle(McCadCom_View)& aKey) ; + + +Standard_EXPORT Standard_Boolean Contains(const Handle(McCadCom_View)& aKey) const; + + +Standard_EXPORT Standard_Boolean Remove(const Handle(McCadCom_View)& aKey) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_MapOfView(const McCadCom_MapOfView& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfCasView.hxx new file mode 100644 index 0000000..3696e28 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfCasView.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile +#define _McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadCom_CasView; +class McCadCom_SequenceOfCasView; + + + +class McCadCom_SequenceNodeOfSequenceOfCasView : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCom_SequenceNodeOfSequenceOfCasView(const Handle(McCadCom_CasView)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadCom_CasView& Value() const; +//Standard_EXPORT ~McCadCom_SequenceNodeOfSequenceOfCasView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_CasView myValue; + + +}; + +#define SeqItem Handle_McCadCom_CasView +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfCasView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfCasView +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfDocument.hxx new file mode 100644 index 0000000..279270d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfDocument.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile +#define _McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadCom_Document; +class McCadCom_SequenceOfDocument; + + + +class McCadCom_SequenceNodeOfSequenceOfDocument : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCom_SequenceNodeOfSequenceOfDocument(const Handle(McCadCom_Document)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadCom_Document& Value() const; +//Standard_EXPORT ~McCadCom_SequenceNodeOfSequenceOfDocument(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_Document myValue; + + +}; + +#define SeqItem Handle_McCadCom_Document +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfDocument_Type_() +#define TCollection_Sequence McCadCom_SequenceOfDocument +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfView.hxx new file mode 100644 index 0000000..d9b2dfd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_SequenceNodeOfSequenceOfView.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_SequenceNodeOfSequenceOfView_HeaderFile +#define _McCadCom_SequenceNodeOfSequenceOfView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfView_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadCom_View; +class McCadCom_SequenceOfView; + + + +class McCadCom_SequenceNodeOfSequenceOfView : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadCom_SequenceNodeOfSequenceOfView(const Handle(McCadCom_View)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadCom_View& Value() const; +//Standard_EXPORT ~McCadCom_SequenceNodeOfSequenceOfView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_View myValue; + + +}; + +#define SeqItem Handle_McCadCom_View +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfView +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_SequenceOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_SequenceOfCasView.hxx new file mode 100644 index 0000000..162f985 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_SequenceOfCasView.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_SequenceOfCasView_HeaderFile +#define _McCadCom_SequenceOfCasView_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfCasView_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCom_CasView; +class McCadCom_SequenceNodeOfSequenceOfCasView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_SequenceOfCasView : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCom_SequenceOfCasView(); + + +Standard_EXPORT void Clear() ; +~McCadCom_SequenceOfCasView() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCom_SequenceOfCasView& Assign(const McCadCom_SequenceOfCasView& Other) ; + const McCadCom_SequenceOfCasView& operator =(const McCadCom_SequenceOfCasView& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadCom_CasView)& T) ; + + void Append(McCadCom_SequenceOfCasView& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_CasView)& T) ; + + void Prepend(McCadCom_SequenceOfCasView& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadCom_CasView)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCom_SequenceOfCasView& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadCom_CasView)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCom_SequenceOfCasView& S) ; + + +Standard_EXPORT const Handle_McCadCom_CasView& First() const; + + +Standard_EXPORT const Handle_McCadCom_CasView& Last() const; + + void Split(const Standard_Integer Index,McCadCom_SequenceOfCasView& Sub) ; + + +Standard_EXPORT const Handle_McCadCom_CasView& Value(const Standard_Integer Index) const; + const Handle_McCadCom_CasView& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadCom_CasView)& I) ; + + +Standard_EXPORT Handle_McCadCom_CasView& ChangeValue(const Standard_Integer Index) ; + Handle_McCadCom_CasView& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_SequenceOfCasView(const McCadCom_SequenceOfCasView& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadCom_CasView +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfCasView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfCasView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfCasView +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_SequenceOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_SequenceOfDocument.hxx new file mode 100644 index 0000000..9854ebf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_SequenceOfDocument.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_SequenceOfDocument_HeaderFile +#define _McCadCom_SequenceOfDocument_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfDocument_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCom_Document; +class McCadCom_SequenceNodeOfSequenceOfDocument; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_SequenceOfDocument : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCom_SequenceOfDocument(); + + +Standard_EXPORT void Clear() ; +~McCadCom_SequenceOfDocument() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCom_SequenceOfDocument& Assign(const McCadCom_SequenceOfDocument& Other) ; + const McCadCom_SequenceOfDocument& operator =(const McCadCom_SequenceOfDocument& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadCom_Document)& T) ; + + void Append(McCadCom_SequenceOfDocument& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_Document)& T) ; + + void Prepend(McCadCom_SequenceOfDocument& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadCom_Document)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCom_SequenceOfDocument& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadCom_Document)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCom_SequenceOfDocument& S) ; + + +Standard_EXPORT const Handle_McCadCom_Document& First() const; + + +Standard_EXPORT const Handle_McCadCom_Document& Last() const; + + void Split(const Standard_Integer Index,McCadCom_SequenceOfDocument& Sub) ; + + +Standard_EXPORT const Handle_McCadCom_Document& Value(const Standard_Integer Index) const; + const Handle_McCadCom_Document& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadCom_Document)& I) ; + + +Standard_EXPORT Handle_McCadCom_Document& ChangeValue(const Standard_Integer Index) ; + Handle_McCadCom_Document& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_SequenceOfDocument(const McCadCom_SequenceOfDocument& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadCom_Document +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfDocument +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfDocument_Type_() +#define TCollection_Sequence McCadCom_SequenceOfDocument +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_SequenceOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_SequenceOfView.hxx new file mode 100644 index 0000000..b2914c0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_SequenceOfView.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_SequenceOfView_HeaderFile +#define _McCadCom_SequenceOfView_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_SequenceNodeOfSequenceOfView_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadCom_View; +class McCadCom_SequenceNodeOfSequenceOfView; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadCom_SequenceOfView : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadCom_SequenceOfView(); + + +Standard_EXPORT void Clear() ; +~McCadCom_SequenceOfView() +{ + Clear(); +} + + + +Standard_EXPORT const McCadCom_SequenceOfView& Assign(const McCadCom_SequenceOfView& Other) ; + const McCadCom_SequenceOfView& operator =(const McCadCom_SequenceOfView& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadCom_View)& T) ; + + void Append(McCadCom_SequenceOfView& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadCom_View)& T) ; + + void Prepend(McCadCom_SequenceOfView& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadCom_View)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadCom_SequenceOfView& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadCom_View)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadCom_SequenceOfView& S) ; + + +Standard_EXPORT const Handle_McCadCom_View& First() const; + + +Standard_EXPORT const Handle_McCadCom_View& Last() const; + + void Split(const Standard_Integer Index,McCadCom_SequenceOfView& Sub) ; + + +Standard_EXPORT const Handle_McCadCom_View& Value(const Standard_Integer Index) const; + const Handle_McCadCom_View& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadCom_View)& I) ; + + +Standard_EXPORT Handle_McCadCom_View& ChangeValue(const Standard_Integer Index) ; + Handle_McCadCom_View& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadCom_SequenceOfView(const McCadCom_SequenceOfView& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadCom_View +#define SeqItem_hxx +#define TCollection_SequenceNode McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadCom_SequenceNodeOfSequenceOfView +#define TCollection_SequenceNode_Type_() McCadCom_SequenceNodeOfSequenceOfView_Type_() +#define TCollection_Sequence McCadCom_SequenceOfView +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfCasView.hxx b/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfCasView.hxx new file mode 100644 index 0000000..b4305c2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfCasView.hxx @@ -0,0 +1,124 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#define _McCadCom_StdMapNodeOfMapOfCasView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfCasView_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_CasView; +class TColStd_MapTransientHasher; +class McCadCom_MapOfCasView; +class McCadCom_MapIteratorOfMapOfCasView; + + + +class McCadCom_StdMapNodeOfMapOfCasView : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_StdMapNodeOfMapOfCasView(const Handle(McCadCom_CasView)& K,const TCollection_MapNodePtr& n); + + Handle_McCadCom_CasView& Key() const; +//Standard_EXPORT ~McCadCom_StdMapNodeOfMapOfCasView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_CasView myKey; + + +}; + +#define TheKey Handle_McCadCom_CasView +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfCasView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfCasView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfCasView_Type_() +#define TCollection_Map McCadCom_MapOfCasView +#define TCollection_Map_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_StdMapNode +#undef TCollection_StdMapNode_hxx +#undef TCollection_MapIterator +#undef TCollection_MapIterator_hxx +#undef Handle_TCollection_StdMapNode +#undef TCollection_StdMapNode_Type_ +#undef TCollection_Map +#undef TCollection_Map_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfDocument.hxx b/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfDocument.hxx new file mode 100644 index 0000000..ace52f8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfDocument.hxx @@ -0,0 +1,124 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#define _McCadCom_StdMapNodeOfMapOfDocument_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfDocument_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_Document; +class TColStd_MapTransientHasher; +class McCadCom_MapOfDocument; +class McCadCom_MapIteratorOfMapOfDocument; + + + +class McCadCom_StdMapNodeOfMapOfDocument : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_StdMapNodeOfMapOfDocument(const Handle(McCadCom_Document)& K,const TCollection_MapNodePtr& n); + + Handle_McCadCom_Document& Key() const; +//Standard_EXPORT ~McCadCom_StdMapNodeOfMapOfDocument(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_Document myKey; + + +}; + +#define TheKey Handle_McCadCom_Document +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfDocument +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfDocument +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfDocument_Type_() +#define TCollection_Map McCadCom_MapOfDocument +#define TCollection_Map_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_StdMapNode +#undef TCollection_StdMapNode_hxx +#undef TCollection_MapIterator +#undef TCollection_MapIterator_hxx +#undef Handle_TCollection_StdMapNode +#undef TCollection_StdMapNode_Type_ +#undef TCollection_Map +#undef TCollection_Map_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfView.hxx b/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfView.hxx new file mode 100644 index 0000000..1224d20 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_StdMapNodeOfMapOfView.hxx @@ -0,0 +1,124 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_StdMapNodeOfMapOfView_HeaderFile +#define _McCadCom_StdMapNodeOfMapOfView_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_StdMapNodeOfMapOfView_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadCom_View; +class TColStd_MapTransientHasher; +class McCadCom_MapOfView; +class McCadCom_MapIteratorOfMapOfView; + + + +class McCadCom_StdMapNodeOfMapOfView : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadCom_StdMapNodeOfMapOfView(const Handle(McCadCom_View)& K,const TCollection_MapNodePtr& n); + + Handle_McCadCom_View& Key() const; +//Standard_EXPORT ~McCadCom_StdMapNodeOfMapOfView(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadCom_View myKey; + + +}; + +#define TheKey Handle_McCadCom_View +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadCom_MapIteratorOfMapOfView +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadCom_StdMapNodeOfMapOfView +#define TCollection_StdMapNode_Type_() McCadCom_StdMapNodeOfMapOfView_Type_() +#define TCollection_Map McCadCom_MapOfView +#define TCollection_Map_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_StdMapNode +#undef TCollection_StdMapNode_hxx +#undef TCollection_MapIterator +#undef TCollection_MapIterator_hxx +#undef Handle_TCollection_StdMapNode +#undef TCollection_StdMapNode_Type_ +#undef TCollection_Map +#undef TCollection_Map_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_View.hxx b/src/MCCAD/McCadHeaders/McCadCom_View.hxx new file mode 100644 index 0000000..7f3b5ac --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_View.hxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadCom_View_HeaderFile +#define _McCadCom_View_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_View_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_Document_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +class McCadCom_Document; + + +//! base view class
+class McCadCom_View : public MMgt_TShared { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT virtual void Update() const; + + +Standard_EXPORT virtual Handle_McCadCom_Document GetDocument() const; +//Standard_EXPORT ~McCadCom_View(); + + +friend class McCadCom_Document; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + +Standard_EXPORT McCadCom_View(); + + +Standard_EXPORT virtual void SetDocument(const Handle(McCadCom_Document)& theDoc) ; + + + // Fields PROTECTED + // +Handle_McCadCom_Document myDocument; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadCom_View.ixx b/src/MCCAD/McCadHeaders/McCadCom_View.ixx new file mode 100644 index 0000000..841f428 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_View.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadCom_View::~McCadCom_View() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadCom_View_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadCom_View", + sizeof(McCadCom_View), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadCom_View) Handle(McCadCom_View)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadCom_View) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadCom_View))) { + _anOtherObject = Handle(McCadCom_View)((Handle(McCadCom_View)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadCom_View::DynamicType() const +{ + return STANDARD_TYPE(McCadCom_View) ; +} +//Standard_Boolean McCadCom_View::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadCom_View) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadCom_View::~Handle_McCadCom_View() {} + diff --git a/src/MCCAD/McCadHeaders/McCadCom_View.jxx b/src/MCCAD/McCadHeaders/McCadCom_View.jxx new file mode 100644 index 0000000..8318ad0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadCom_View.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadCom_Document_HeaderFile +#include +#endif +#ifndef _McCadCom_View_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadConfig.h b/src/MCCAD/McCadHeaders/McCadConfig.h new file mode 100644 index 0000000..9aae484 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadConfig.h @@ -0,0 +1,3 @@ +#define MCCAD_VERSION_MAJOR 0 +#define MCCAD_VERSION_MINOR 4 +#define MCCAD_VERSION_PATCH 1 diff --git a/src/MCCAD/McCadHeaders/McCadConfig.h.in b/src/MCCAD/McCadHeaders/McCadConfig.h.in new file mode 100644 index 0000000..382fe14 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadConfig.h.in @@ -0,0 +1,3 @@ +#define MCCAD_VERSION_MAJOR @MCCAD_VERSION_MAJOR@ +#define MCCAD_VERSION_MINOR @MCCAD_VERSION_MINOR@ +#define MCCAD_VERSION_PATCH @MCCAD_VERSION_PATCH@ diff --git a/src/MCCAD/McCadHeaders/McCadConvertTools_Convertor.hxx b/src/MCCAD/McCadHeaders/McCadConvertTools_Convertor.hxx new file mode 100644 index 0000000..29dcf4b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadConvertTools_Convertor.hxx @@ -0,0 +1,110 @@ +#ifndef _McCadConvertTools_Convertor_HeaderFile +#define _McCadConvertTools_Convertor_HeaderFile + +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//! \brief Decomposition Master Class
+ +//! The Convertor performes a sign-constant decomposition on input solids.
+//! Besides the standard constructor one can initialize an object of this class
+//! with a HSequenceOfShape (Sequence of TopoDS_Solids), a CAD file (step, iges, brep),
+//! and a directory and an additional file filter (latter defines the type of CAD file that
+//! should be read). If a directory and file filter are given each CAD file of the
+//! given file format will be read. A sign constant decomposition
+//! for all TopoDS_Solids found will be executed by calling McCadCSGTool_Decomposer.
+ +class McCadConvertTools_Convertor { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Standard c-tor returns a McCadConvertTools_Convertor +//qiu add Standard_EXPORT +McCadConvertTools_Convertor(); + +//! Ctor which takes a Sequence of TopoDS_Shapes (solids) as input. +Standard_EXPORT McCadConvertTools_Convertor(const Handle(TopTools_HSequenceOfShape)& theHSeqOfShp); + +//! Initialize the object. All c-tors call this method.
+//! It can be used to reset an object to the ground state. +Standard_EXPORT void Init() ; + +//! Perform sign constant decomposition on input solids
+//! This method calls the McCadCSGTool_Decomposer which performes a sign constant
+//! decomposition.
+//! Before the decomposition begins an analyses of all surfaces is performed and
+//! printed to the screen. Only the first five surface types can be processed
+//! if surfaces of other surface type occure, the file can not be converted into
+//! MC-syntax.
+//! After the surface check each solid is tested for geometrical/topological errors.
+//! McCad uses the standard OCC features for error detection and repair.
+//! The volumes of the unprocessed CAD files and the decomposed objects are recorded
+//! and compared. If a solid is not decomposed correctly, i.e. parts are missing,
+//! the name of the corresponing file and information about the volume comparision
+//! are written in the file ".failedVolumeControl" in the working directory.
+Standard_EXPORT Standard_Boolean Convert() ; + +//! Perform a sign constant decomposition on all input solids, which are given as parameter
+//! to this method. Calls Convert() internally
+//! Returns the converted model.
+Standard_EXPORT Handle_TopTools_HSequenceOfShape Convert(const Handle(TopTools_HSequenceOfShape)& theHSeqOfShp) ; + +//! Return the converted Model as a HSequenceOfShape +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetConvertedModel() ; + +//! Return the file name +Standard_EXPORT TCollection_AsciiString GetFileName() const { return myFileName; } + +//! Set the file name of the input file +Standard_EXPORT void SetFileName(const TCollection_AsciiString& theFileName) { myFileName = theFileName; } + +//! Returns true, if the conversion has been successfully performed. +Standard_EXPORT Standard_Boolean IsConverted() const; + +//! Return progress dialog +//! Allows the visualization of the progress in the decomposition phase. +Standard_EXPORT McCadGUI_ProgressDialogPtr GetProgressDialog(); + +private: + + // Fields + Handle_TopTools_HSequenceOfShape myInputSolids; + Handle_TopTools_HSequenceOfShape myConvertedSolids; + TCollection_AsciiString myFileName; + Standard_Boolean myIsConverted; + + McCadGUI_ProgressDialogPtr myProgress; +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadConvertTools_ConvertorPtr.hxx b/src/MCCAD/McCadHeaders/McCadConvertTools_ConvertorPtr.hxx new file mode 100644 index 0000000..739c91f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadConvertTools_ConvertorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadConvertTools_ConvertorPtr_HeaderFile +#define _McCadConvertTools_ConvertorPtr_HeaderFile + +class McCadConvertTools_Convertor; + +typedef McCadConvertTools_Convertor* McCadConvertTools_ConvertorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadConvertTools_VoidGenerator.hxx b/src/MCCAD/McCadHeaders/McCadConvertTools_VoidGenerator.hxx new file mode 100644 index 0000000..3a25531 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadConvertTools_VoidGenerator.hxx @@ -0,0 +1,213 @@ +#ifndef _McCadConvertTools_VoidGenerator_HeaderFile +#define _McCadConvertTools_VoidGenerator_HeaderFile + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +//! \brief Master Class for the void completion + +//! Purpose: The VoidGenerator takes as Input the sign-constant decomposed CAD-Model.
+//! It uses the faces of the sign-constant model to slice up a bounding box.
+//! The resulting Boxes are the potential void cells. Overlap tests allow
+//! to delete redundant void cells and to finalize the void cells by using the
+//! complement operator of the MC-Code selected.
+//!
+//! One can pass a Parameter-File to this class which contains the following information:
+//!
+//! # Example: McCadInputFile.txt {comments begin with a '#'}
+//! WriteCollisionFile 1
+//! WriteDiscreteModel 1
+//! Units {MM | CM} # defines the used units in the input model...
+//! InitSurfNb 1000 # defines the initial surface number for the output model
+//! InitCellNb 1000 # defines the initial cell number for the output model
+//! MinimumInputSolidVolume 1.00
+//! MinimumVoidVolume 1.25e2
+//! MinimumSizeOfDecompositionFaceArea 50
+//! MinimumSizeOfRedecompositionFaceArea 5
+//! MaximumNumberOfPreDecompositionCells 500
+//! MaximumNumberOfComplementedCells 10
+//! MinimumNumberOfSamplePoints 10
+//! MaximumNumberOfSamplePoints 50
+//! XResolution 50
+//! YResolution 50
+//! Tolerance 1e-7
+//! # Bounding Box as step file
+//! BoundingBox /home/user/Testarea/Bounding_Box/BB.stp
+//! # Material List
+//! MaterialList /home/user/Testarea/MaterialList.txt
+//! # directories of converted files
+//! /home/user/Testarea/stp/
+//!
+//! \e WriteCollisionFile {0|1} : makes the VoidGenerator write (1) or read (0) the results of a collision
+//! detection between input solids. The collision information will be stored in the file .CollisionFile
+//! in the working directory.
+//! \e WriteDiscreteModel {0|1} : write (1) or read (0) the voxel files for each solid. For each face of each
+//! solid sample points will be generated for a latter overlapp test. This takes a while. If the sample
+//! points have been generated once they can fastly be read in a following run. If this parameter is set
+//! to cero but no '.voxel' files can be found the voxelization will take place, but the voxel files will
+//! not be written.
+//! Voxel files will be searched in the subdirectory voxels.
+//! \e MinimumInputSolid {real} : defines the minimum volume of an input solid. Each solid with a
+//! smaller volume will be ignored and do not appear in th final MC model.
+//! \e MinimumVoidVolume {real} : defines the minimum volume for void solids in the cad system.
+//! this assures that the number of generated potential void cells is not too big.
+//! \e MinimumSizeOfDecompositionFaceArea {real} : For the void generation a bounding box is split
+//! by all planar, sign-changing faces of the solid model. This parameter defines a minimum size for the
+//! splitting planes.
+//! MinimumSizeOfRedecompositionFaceArea {real} : if a void volume collides with too many solid volumes
+//! the void volume will be decomposed further. This value defines the minimum face area for the second
+//! cut.
+//! \e MaximumNumberOfPreDecompositionCells {integer} : sets an upper limit for the number of potential
+//! void cells after the first decomposition
+//! \e MaximumNumberOfComplementedCells {integer} : McCad makes use of the complement operator to exclude
+//! colliding solid volumes from void volumes. This parameter defines the maximum number of allowd collisions.
+//! If the number of collisions is exceeded, the void will be further decomposed with planar faces with the
+//! minimum size MinimumSizeOfRedecompositionFaceArea
+//! \e MinimumNumberOfSamplePoints {integer} , \e MaximumNumberOfSamplePoints {integer} : defines the bounds
+//! for the number of sample points along one edge of a solids face. The higher the values, the more sample
+//! points will be generated and the less the possibility for an undetected collision is. But this also
+//! affects the computation time and, very important for big models,the usage of memory.
+//! \e XResolution {real}, \e YResolution {real} : space between sample points on edges along x,y direction
+//! in local coordinate system (in mm). The smaller the resolution, the more sample points will be generated.
+//! \e BoundingBox {path to a bounding box as step file} : defines a bounding box for the void generation
+//! if no bounding box is defined, an axis parallel BB will be generated. This might lead to more void cells
+//! than necessary.
+//! \e MaterialList {path to a material list} : this is a MCNP feature only. The file list contains a list
+//! of solid names and a corresponding material number and density:
+//!
+//! Example: # name materialNumber Density
+//! solid1 1 -0.89
+//!
+//! If a line is not a comment (#) and not introduced by a codeword, it will be interpreted as path to a
+//! directory which contains all converted (McCadConvertTools_Convertor) files of the current model to be
+//! converted. All files 'converted*.stp' will be added.
+ +class McCadConvertTools_VoidGenerator { + public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + // Methods + + //! ctor + Standard_EXPORT McCadConvertTools_VoidGenerator(); + + //! ctor with parameter input + Standard_EXPORT McCadConvertTools_VoidGenerator( McCadIOHelper_VGParameters& parameters); + + //! initialize internal parameters + void Init() ; + + //! Expand bounding box, so that addBB does fit in. + void AddBoundingBox(Handle_TopTools_HSequenceOfShape& addBB) ; + + //! Main call to generate the voids. This method starts the voxelization and the decomposition
+ //! of the bounding box into potential void volumes. + Standard_Boolean GenerateVoids() ; + + //! Return the Voxelized predecomposed void volumes + Handle_McCadDiscDs_HSequenceOfDiscSolid GetVVoids() ; + + //! Return the voxelized solid volumes + Handle_McCadDiscDs_HSequenceOfDiscSolid GetVSolids() ; + + //! Return the voxelized outer voids. In MCNP all universe has to be defined. McCad generates a sphere
+ //! around the bounding box. Everything inside the sphere, but outside the bouning box is the one outer void
+ //! with importance 1. Everything outside of the Sphere has importance 0 and is the infinite outer wordl.
+ //! This function returns the sphere which will be used in the McCadMcWrite_McInputGenerator classes to generate
+ //! the outer world. + Handle_McCadDiscDs_HSequenceOfDiscSolid GetVOuterVoids() ; + + //! If no Bounding Box has been passed, create one. + Standard_Boolean MakeBoundingBox() ; + + //! Check for small volumes to delete and call GenerateVoids() + Standard_Boolean Perform() ; + + //! Return the defined units {McCadCSGGeom_MM, McCadCSGGeom_CM} + McCadCSGGeom_Unit GetUnits(); + + //! Return the initial surface number of the MC file to be generated + Standard_Integer GetInitSurfNb(); + + //! Return the initial Volume (solid) number of the MC file to be generated + Standard_Integer GetInitCellNb(); + + //! Initialize with a ParameterFile + Standard_Boolean Init( McCadIOHelper_VGParameters& parameters) ; + + void SetProgressIndicator(Handle_Message_ProgressIndicator& thePI); + + //! Add discretized solids to VSolids + void AddDiscSolids(Handle_McCadDiscDs_HSequenceOfDiscSolid& theNamedSolids); + + //! Define the Material Density Reader. MCNP only. The MD-Reader will read the MaterialList
+ //! and links a solid name to a material composition. + void SetMDReader(McCadMDReader_Reader& theMDReader); + + //! Return the MDReader, see SetMDReader() + McCadMDReader_Reader& GetMDReader( ); + + //! Sets the parameter + void SetParameters( McCadIOHelper_VGParameters& parameters ); + + private: + + // Methods + //! Test the input solids for collisions. Save collisions in .CollisionFile in the working directory. + void CheckInputCollision() ; + + //! delete small volumes due to the Parameter \e MinimumInputSolidVolume + void DeleteSmallVolumes() ; + + //! Discretize the Input Solids + void Voxelize() ; + + // Fields + bool myFirstFile; + + Handle_McCadDiscDs_HSequenceOfDiscSolid myVOuterVoids; + Handle_McCadDiscDs_HSequenceOfDiscSolid myVSolids; + Handle_McCadDiscDs_HSequenceOfDiscSolid myVVoids; + + McCadIOHelper_VGParameters m_parameters; + McCadMDReader_Reader myMDReader; + + TopoDS_Shape myOuterSpace; + + //For Progress Visualization + McCadGUI_ProgressDialogPtr myProgress; + Handle_Message_ProgressIndicator m_progressIndicator; +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadConvertTools_VoidGeneratorPtr.hxx b/src/MCCAD/McCadHeaders/McCadConvertTools_VoidGeneratorPtr.hxx new file mode 100644 index 0000000..9bc3fd9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadConvertTools_VoidGeneratorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadConvertTools_VoidGeneratorPtr_HeaderFile +#define _McCadConvertTools_VoidGeneratorPtr_HeaderFile + +class McCadConvertTools_VoidGenerator; + +typedef McCadConvertTools_VoidGenerator* McCadConvertTools_VoidGeneratorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDesign_CopyTo.hxx b/src/MCCAD/McCadHeaders/McCadDesign_CopyTo.hxx new file mode 100644 index 0000000..ba6fded --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_CopyTo.hxx @@ -0,0 +1,34 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_COPYTO_HXX_ +#define MCCADDESIGN_COPYTO_HXX_ + +#include "ui_McCadDesign_CopyTo.h" +#include +#include +#include + +//! \brief implements a copy algorithm for solids registered in the TDocStd_Document + +class McCadDesign_CopyTo : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_CopyTo(QWidget* theParent = NULL); + +public slots: + void CreateCopy(); + +private: + //fields + Standard_Real myOriX, myOriY, myOriZ; + Ui::copyToDialog theCopyToDialog; +}; + +#endif /* MCCADDESIGN_CopyTo_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_MakeBox.hxx b/src/MCCAD/McCadHeaders/McCadDesign_MakeBox.hxx new file mode 100644 index 0000000..34bcb73 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_MakeBox.hxx @@ -0,0 +1,45 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_MAKEBOX_HXX_ +#define MCCADDESIGN_MAKEBOX_HXX_ + +#include "ui_McCadDesign_MakeBox.h" +#include +#include + +//! \brief creates a box + + +class McCadDesign_MakeBox : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_MakeBox(QWidget* theParent = NULL); + //void SetCurrentEditor(QMcCad_Editor* theEditor); + + +public slots: + void CreateBox(); + +signals: + +private: + + //functions + //Standard_Real GetRealValue(const QString& theVal); + + //fields + Standard_Real myOriX, myOriY, myOriZ, myDimX, myDimY, myDimZ; + + Ui::MakeBoxDialog theBoxDialog; + QMcCad_Editor* myEditor; + +}; + +#endif /* MCCADDESIGN_MAKEBOX_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_MakeCone.hxx b/src/MCCAD/McCadHeaders/McCadDesign_MakeCone.hxx new file mode 100644 index 0000000..e78a57c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_MakeCone.hxx @@ -0,0 +1,35 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_MAKECONE_HXX_ +#define MCCADDESIGN_MAKECONE_HXX_ + +#include "ui_McCadDesign_MakeCone.h" +#include +#include + +//! \brief Creates a cone + +class McCadDesign_MakeCone : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_MakeCone(QWidget* theParent = NULL); + +public slots: + void CreateCone(); + +private: + //fields + Standard_Real myOriX, myOriY, myOriZ, myDirX, myDirY, myDirZ, myHeight, myRmin, myRmaj; + + Ui::ConeDialog theConeDialog; + QMcCad_Editor* myEditor; +}; + +#endif /* MCCADDESIGN_MAKECone_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_MakeCylinder.hxx b/src/MCCAD/McCadHeaders/McCadDesign_MakeCylinder.hxx new file mode 100644 index 0000000..45605d8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_MakeCylinder.hxx @@ -0,0 +1,36 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_MAKECylinder_HXX_ +#define MCCADDESIGN_MAKECylinder_HXX_ + +#include "ui_McCadDesign_MakeCylinder.h" +#include +#include + +//! \brief creates a cylinder + + +class McCadDesign_MakeCylinder : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_MakeCylinder(QWidget* theParent = NULL); + +public slots: + void CreateCylinder(); + +private: + //fields + Standard_Real myOriX, myOriY, myOriZ, myDirX, myDirY, myDirZ, myHeight, myRadius; + + Ui::CylinderDialog theCylinderDialog; + QMcCad_Editor* myEditor; +}; + +#endif /* MCCADDESIGN_MAKECylinder_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_MakeSphere.hxx b/src/MCCAD/McCadHeaders/McCadDesign_MakeSphere.hxx new file mode 100644 index 0000000..e448db7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_MakeSphere.hxx @@ -0,0 +1,35 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_MAKESPHERE_HXX_ +#define MCCADDESIGN_MAKESPHERE_HXX_ + +#include "ui_McCadDesign_MakeSphere.h" +#include +#include + +//! \brief Creates a sphere + +class McCadDesign_MakeSphere : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_MakeSphere(QWidget* theParent = NULL); + +public slots: + void CreateSphere(); + +private: + //fields + Standard_Real myOriX, myOriY, myOriZ, myRadius; + + Ui::SphereDialog theSphereDialog; + QMcCad_Editor* myEditor; +}; + +#endif /* MCCADDESIGN_MAKESphere_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_MoveTo.hxx b/src/MCCAD/McCadHeaders/McCadDesign_MoveTo.hxx new file mode 100644 index 0000000..f7746d0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_MoveTo.hxx @@ -0,0 +1,38 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_MoveTO_HXX_ +#define MCCADDESIGN_MoveTO_HXX_ + +#include "ui_McCadDesign_MoveTo.h" +#include +#include + +//! \brief Moves object to location + + +class McCadDesign_MoveTo : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_MoveTo(QWidget* theParent = NULL); + void PerformMove(TopoDS_Shape& theShp, gp_Pnt locPnt); + +public slots: + void CreateMove(); + void ConfirmMoveToPnt(const QString& dummyStr ); + +private: + //fields + Standard_Real myOriX, myOriY, myOriZ, myDistX, myDistY, myDistZ; + Ui::moveToDialog theMoveToDialog; + Standard_Real myMoveToPnt; + Standard_Boolean myExternCall; +}; + +#endif /* MCCADDESIGN_MoveTo_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_Rotate.hxx b/src/MCCAD/McCadHeaders/McCadDesign_Rotate.hxx new file mode 100644 index 0000000..e8fe8be --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_Rotate.hxx @@ -0,0 +1,37 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_ROTATE_HXX_ +#define MCCADDESIGN_ROTATE_HXX_ + +#include "ui_McCadDesign_Rotate.h" +#include +#include + +//! \brief Performs a rotation of a shape registered in the TDocStd_Document + + +class McCadDesign_Rotate : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_Rotate(QWidget* theParent = NULL); + +public slots: + void Rotate(); + void SwitchRadDeg(bool radState); + void UpdateAngle(); + +private: + //fields + Standard_Real myOriX, myOriY, myOriZ, myAngle; + bool myIsRad; + Ui::rotateDialog theRotateDialog; +}; + +#endif /* MCCADDESIGN_Rotate_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_Scale.hxx b/src/MCCAD/McCadHeaders/McCadDesign_Scale.hxx new file mode 100644 index 0000000..1afcb95 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_Scale.hxx @@ -0,0 +1,36 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_SCALE_HXX_ +#define MCCADDESIGN_SCALE_HXX_ + +#include "ui_McCadDesign_Scale.h" +#include +#include + +//! \brief Axis(in)dependent scaling + + +class McCadDesign_Scale : public QDialog, public McCadDesign_Tool +{ + Q_OBJECT + +public: + McCadDesign_Scale(QWidget* theParent = NULL); + +public slots: + void PerformScale(); + void SetAxisDependent(const QString& aString); + +private: + //fields + Standard_Real mySf_X, mySf_Y, mySf_Z, mySf_All; + Standard_Boolean myIsAll; + Ui::scaleDialog theScaleDialog; +}; + +#endif /* MCCADDESIGN_Scale_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDesign_Tool.hxx b/src/MCCAD/McCadHeaders/McCadDesign_Tool.hxx new file mode 100644 index 0000000..33f2655 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDesign_Tool.hxx @@ -0,0 +1,29 @@ +/* + * McCadDesign_MakeBox.hxx + * + * Created on: Apr 21, 2009 + * Author: grosse + */ + +#ifndef MCCADDESIGN_TOOL_HXX_ +#define MCCADDESIGN_TOOL_HXX_ + +#include + +//! \brief Base class for all McCadDesign Tools + + +class McCadDesign_Tool +{ +public: + McCadDesign_Tool(); + virtual void SetCurrentEditor(QMcCad_Editor* theEditor); + QMcCad_Editor* Editor(); + +protected: + Standard_Real GetRealValue(const QString& theVal); +private: + QMcCad_Editor* myEditor; +}; + +#endif /* MCCADDESIGN_TOOL_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.hxx new file mode 100644 index 0000000..304a082 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.hxx @@ -0,0 +1,157 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#define _McCadDiscDs_DiscFace_HeaderFile + +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _GeomAbs_SurfaceType_HeaderFile +#include +#endif +class TColgp_HSequenceOfPnt; +class TopoDS_Face; +class Bnd_Box; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief A discretized face, i.e. a face with discrete sample points. + + +class McCadDiscDs_DiscFace { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! discrete face class
+//! Face with points on it
+//!
+Standard_EXPORT McCadDiscDs_DiscFace(); + + +//!
+Standard_EXPORT McCadDiscDs_DiscFace(const TopoDS_Face& theFace); + + +Standard_EXPORT void SetFace(const TopoDS_Face& theFace) ; + + +Standard_EXPORT TopoDS_Face GetFace() const; + + +Standard_EXPORT Standard_Boolean IsDiscret() const; + + +Standard_EXPORT void SetPoints(const Handle(TColgp_HSequenceOfPnt)& thePntSeq) ; + + +Standard_EXPORT Handle_TColgp_HSequenceOfPnt GetPoints() const; + + +Standard_EXPORT void SetBBox(const Bnd_Box& theBBox) ; + + +Standard_EXPORT Bnd_Box GetBBox() const; + + +Standard_EXPORT Standard_Integer NbOfPoints() const; + + +Standard_EXPORT Standard_Real FaceArea() const; + + +Standard_EXPORT GeomAbs_SurfaceType FaceSurfaceType() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Face myFace; +Handle_TColgp_HSequenceOfPnt myVoxelSeq; +Bnd_Box myBBox; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.ixx b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.ixx new file mode 100644 index 0000000..a88b2c8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.jxx b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.jxx new file mode 100644 index 0000000..6d4883a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscFace.jxx @@ -0,0 +1,12 @@ +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.hxx new file mode 100644 index 0000000..f1782fd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.hxx @@ -0,0 +1,262 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#define _McCadDiscDs_DiscSolid_HeaderFile + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +class TColgp_HSequenceOfPnt; +class McCadDiscDs_HSequenceOfDiscFace; +class TColStd_HSequenceOfInteger; +class TopoDS_Shape; +class TCollection_AsciiString; +class Bnd_Box; +class McCadDiscDs_DiscFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Discretized Solid, i.e. bounded by discretized McCadDiscDs_DiscFace s + + +class McCadDiscDs_DiscSolid { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! discrete face class
+//! Solid with points on it
+//!
+Standard_EXPORT McCadDiscDs_DiscSolid(); + + +//!
+Standard_EXPORT McCadDiscDs_DiscSolid(const TopoDS_Shape& theSolid); + + +Standard_EXPORT void SetIndex(const Standard_Integer theIndex) ; + + +Standard_EXPORT Standard_Integer GetIndex() const; + + +Standard_EXPORT void SetSolid(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT TopoDS_Shape GetSolid() const; + + +Standard_EXPORT void Init(); + + +Standard_EXPORT void SetVoxel(const Handle(TColgp_HSequenceOfPnt)& theVoxelSeq) ; + + +Standard_EXPORT Handle_TColgp_HSequenceOfPnt GetVoxel() const; + + +Standard_EXPORT void SetName(const TCollection_AsciiString& aName) ; + + +Standard_EXPORT void SetName(const TCollection_AsciiString& aName,const Standard_Integer i) ; + + +Standard_EXPORT TCollection_AsciiString GetName() const; + + +Standard_EXPORT TCollection_AsciiString GetComment() const; + + +Standard_EXPORT TCollection_AsciiString GetFileName() const; + + +Standard_EXPORT void SetBBox(const Bnd_Box& theBBox) ; + + +Standard_EXPORT Bnd_Box GetBBox(); + + +Standard_EXPORT void SetIsDiscret(const Standard_Boolean theState) ; + + +Standard_EXPORT Standard_Boolean IsDiscret() const; + + +Standard_EXPORT void SetOwnVFaces(const Handle(McCadDiscDs_HSequenceOfDiscFace)& vFaces) ; + + +Standard_EXPORT void AppendOwnVFace(const McCadDiscDs_DiscFace& vFace) ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscFace GetOwnVFaces() const; + + +Standard_EXPORT Standard_Integer NbOfOwnVFace() const; + + +Standard_EXPORT void SetOtherVSolids(const Handle(TColStd_HSequenceOfInteger)& vSolidsIndexList) ; + + +Standard_EXPORT void AppendOtherVSolid(Standard_Integer& theIndex) ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetOtherVSolids() const; + + +Standard_EXPORT Standard_Integer NbOfOtherVSolids() const; + + +Standard_EXPORT Standard_Integer NbOfPoints() const; + + +Standard_EXPORT Standard_Real Volume() const; + + +Standard_EXPORT void SetIsVoid(const Standard_Boolean theVoidStatus) ; + + +Standard_EXPORT Standard_Boolean IsVoid() const; + + +Standard_EXPORT void SetIsOuterVoid(const Standard_Boolean theStatus) ; + + +Standard_EXPORT Standard_Boolean IsOuterVoid() const; + + +Standard_EXPORT Standard_Boolean HasDensity() const; + + +Standard_EXPORT Standard_Boolean HasMaterial() const; + + +Standard_EXPORT void UnsetDensity(); + + +Standard_EXPORT void UnsetMaterial(); + + +Standard_EXPORT Standard_Real GetDensity() const; + + +Standard_EXPORT Standard_Integer GetMaterialNumber() const; + + +Standard_EXPORT void SetMaterialNumber(const Standard_Integer theMaterialNumber); + + +Standard_EXPORT void SetDensity(const Standard_Real theDensity); + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void MakeOwnVFaces() ; + + + // Fields PRIVATE + // +TCollection_AsciiString myFileName; +TCollection_AsciiString myName; +TCollection_AsciiString myComment; +TopoDS_Shape myShape; +Handle_TColgp_HSequenceOfPnt myVoxelSeq; +Bnd_Box myBBox; +Handle_McCadDiscDs_HSequenceOfDiscFace myOwnVFaces; +Handle_TColStd_HSequenceOfInteger myOtherVSolidsIndexList; +Standard_Integer myIndex; +Standard_Boolean myIsDiscret; +Standard_Boolean myIsVoid; +Standard_Boolean myIsOuterVoid; +Standard_Integer myMaterialNumber; +Standard_Real myDensity; +Standard_Boolean myHaveMaterial; +Standard_Boolean myHaveDensity; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.ixx b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.ixx new file mode 100644 index 0000000..6676fe2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.jxx b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.jxx new file mode 100644 index 0000000..7585a46 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_DiscSolid.jxx @@ -0,0 +1,24 @@ +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfInteger_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscFace.hxx new file mode 100644 index 0000000..17dcc32 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscFace.hxx @@ -0,0 +1,183 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#define _McCadDiscDs_HSequenceOfDiscFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_SequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadDiscDs_DiscFace; +class McCadDiscDs_SequenceOfDiscFace; + + + +class McCadDiscDs_HSequenceOfDiscFace : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadDiscDs_HSequenceOfDiscFace(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const McCadDiscDs_DiscFace& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadDiscDs_HSequenceOfDiscFace)& aSequence) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscFace& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadDiscDs_HSequenceOfDiscFace)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const McCadDiscDs_DiscFace& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadDiscDs_HSequenceOfDiscFace)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const McCadDiscDs_DiscFace& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadDiscDs_HSequenceOfDiscFace)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscFace Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const McCadDiscDs_DiscFace& anItem) ; + + +Standard_EXPORT const McCadDiscDs_DiscFace& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT McCadDiscDs_DiscFace& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadDiscDs_SequenceOfDiscFace& Sequence() const; + + McCadDiscDs_SequenceOfDiscFace& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscFace ShallowCopy() const; +//Standard_EXPORT ~McCadDiscDs_HSequenceOfDiscFace(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_SequenceOfDiscFace mySequence; + + +}; + +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TheSequence McCadDiscDs_SequenceOfDiscFace +#define TheSequence_hxx +#define TCollection_HSequence McCadDiscDs_HSequenceOfDiscFace +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadDiscDs_HSequenceOfDiscFace +#define TCollection_HSequence_Type_() McCadDiscDs_HSequenceOfDiscFace_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadDiscDs_HSequenceOfDiscFace ShallowCopy(const Handle_McCadDiscDs_HSequenceOfDiscFace& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscSolid.hxx new file mode 100644 index 0000000..63ccca8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscSolid.hxx @@ -0,0 +1,183 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#define _McCadDiscDs_HSequenceOfDiscSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadDiscDs_DiscSolid; +class McCadDiscDs_SequenceOfDiscSolid; + + + +class McCadDiscDs_HSequenceOfDiscSolid : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadDiscDs_HSequenceOfDiscSolid(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const McCadDiscDs_DiscSolid& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscSolid& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const McCadDiscDs_DiscSolid& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadDiscDs_HSequenceOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const McCadDiscDs_DiscSolid& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadDiscDs_HSequenceOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscSolid Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const McCadDiscDs_DiscSolid& anItem) ; + + +Standard_EXPORT const McCadDiscDs_DiscSolid& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT McCadDiscDs_DiscSolid& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadDiscDs_SequenceOfDiscSolid& Sequence() const; + + McCadDiscDs_SequenceOfDiscSolid& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscSolid ShallowCopy() const; +//Standard_EXPORT ~McCadDiscDs_HSequenceOfDiscSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_SequenceOfDiscSolid mySequence; + + +}; + +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TheSequence McCadDiscDs_SequenceOfDiscSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadDiscDs_HSequenceOfDiscSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadDiscDs_HSequenceOfDiscSolid +#define TCollection_HSequence_Type_() McCadDiscDs_HSequenceOfDiscSolid_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadDiscDs_HSequenceOfDiscSolid ShallowCopy(const Handle_McCadDiscDs_HSequenceOfDiscSolid& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscSolidPtr.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscSolidPtr.hxx new file mode 100644 index 0000000..6b18e2c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfDiscSolidPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_HSequenceOfDiscSolidPtr_HeaderFile +#define _McCadDiscDs_HSequenceOfDiscSolidPtr_HeaderFile + +class McCadDiscDs_HSequenceOfDiscSolid; + +typedef McCadDiscDs_HSequenceOfDiscSolid* McCadDiscDs_HSequenceOfDiscSolidPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfHSeqOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfHSeqOfDiscSolid.hxx new file mode 100644 index 0000000..f9cb87e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_HSequenceOfHSeqOfDiscSolid.hxx @@ -0,0 +1,183 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_HSequenceOfHSeqOfDiscSolid_HeaderFile +#define _McCadDiscDs_HSequenceOfHSeqOfDiscSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_SequenceOfSeqOfDiscSolid_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadDiscDs_SequenceOfDiscSolid; +class McCadDiscDs_SequenceOfSeqOfDiscSolid; + + + +class McCadDiscDs_HSequenceOfHSeqOfDiscSolid : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadDiscDs_HSequenceOfHSeqOfDiscSolid(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const McCadDiscDs_SequenceOfDiscSolid& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_SequenceOfDiscSolid& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const McCadDiscDs_SequenceOfDiscSolid& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const McCadDiscDs_SequenceOfDiscSolid& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadDiscDs_HSequenceOfHSeqOfDiscSolid)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const McCadDiscDs_SequenceOfDiscSolid& anItem) ; + + +Standard_EXPORT const McCadDiscDs_SequenceOfDiscSolid& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT McCadDiscDs_SequenceOfDiscSolid& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadDiscDs_SequenceOfSeqOfDiscSolid& Sequence() const; + + McCadDiscDs_SequenceOfSeqOfDiscSolid& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid ShallowCopy() const; +//Standard_EXPORT ~McCadDiscDs_HSequenceOfHSeqOfDiscSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_SequenceOfSeqOfDiscSolid mySequence; + + +}; + +#define Item McCadDiscDs_SequenceOfDiscSolid +#define Item_hxx +#define TheSequence McCadDiscDs_SequenceOfSeqOfDiscSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadDiscDs_HSequenceOfHSeqOfDiscSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid +#define TCollection_HSequence_Type_() McCadDiscDs_HSequenceOfHSeqOfDiscSolid_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid ShallowCopy(const Handle_McCadDiscDs_HSequenceOfHSeqOfDiscSolid& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_ListIteratorOfListOfDiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_ListIteratorOfListOfDiscFace.hxx new file mode 100644 index 0000000..90a5e1c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_ListIteratorOfListOfDiscFace.hxx @@ -0,0 +1,143 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_ListIteratorOfListOfDiscFace_HeaderFile +#define _McCadDiscDs_ListIteratorOfListOfDiscFace_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadDiscDs_ListOfDiscFace; +class McCadDiscDs_DiscFace; +class McCadDiscDs_ListNodeOfListOfDiscFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_ListIteratorOfListOfDiscFace { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadDiscDs_ListIteratorOfListOfDiscFace(); + + +Standard_EXPORT McCadDiscDs_ListIteratorOfListOfDiscFace(const McCadDiscDs_ListOfDiscFace& L); + + +Standard_EXPORT void Initialize(const McCadDiscDs_ListOfDiscFace& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT McCadDiscDs_DiscFace& Value() const; + + +friend class McCadDiscDs_ListOfDiscFace; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscFace +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscFace +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_ListIteratorOfListOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_ListIteratorOfListOfDiscSolid.hxx new file mode 100644 index 0000000..2e79ba5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_ListIteratorOfListOfDiscSolid.hxx @@ -0,0 +1,143 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_ListIteratorOfListOfDiscSolid_HeaderFile +#define _McCadDiscDs_ListIteratorOfListOfDiscSolid_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadDiscDs_ListOfDiscSolid; +class McCadDiscDs_DiscSolid; +class McCadDiscDs_ListNodeOfListOfDiscSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_ListIteratorOfListOfDiscSolid { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadDiscDs_ListIteratorOfListOfDiscSolid(); + + +Standard_EXPORT McCadDiscDs_ListIteratorOfListOfDiscSolid(const McCadDiscDs_ListOfDiscSolid& L); + + +Standard_EXPORT void Initialize(const McCadDiscDs_ListOfDiscSolid& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT McCadDiscDs_DiscSolid& Value() const; + + +friend class McCadDiscDs_ListOfDiscSolid; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscSolid +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscSolid +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_ListNodeOfListOfDiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_ListNodeOfListOfDiscFace.hxx new file mode 100644 index 0000000..80abed5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_ListNodeOfListOfDiscFace.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#define _McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadDiscDs_DiscFace; +class McCadDiscDs_ListOfDiscFace; +class McCadDiscDs_ListIteratorOfListOfDiscFace; + + + +class McCadDiscDs_ListNodeOfListOfDiscFace : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadDiscDs_ListNodeOfListOfDiscFace(const McCadDiscDs_DiscFace& I,const TCollection_MapNodePtr& n); + + McCadDiscDs_DiscFace& Value() const; +//Standard_EXPORT ~McCadDiscDs_ListNodeOfListOfDiscFace(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_DiscFace myValue; + + +}; + +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscFace +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscFace +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_ListNodeOfListOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_ListNodeOfListOfDiscSolid.hxx new file mode 100644 index 0000000..e3aba3c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_ListNodeOfListOfDiscSolid.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#define _McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadDiscDs_DiscSolid; +class McCadDiscDs_ListOfDiscSolid; +class McCadDiscDs_ListIteratorOfListOfDiscSolid; + + + +class McCadDiscDs_ListNodeOfListOfDiscSolid : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadDiscDs_ListNodeOfListOfDiscSolid(const McCadDiscDs_DiscSolid& I,const TCollection_MapNodePtr& n); + + McCadDiscDs_DiscSolid& Value() const; +//Standard_EXPORT ~McCadDiscDs_ListNodeOfListOfDiscSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_DiscSolid myValue; + + +}; + +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscSolid +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscSolid +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_ListOfDiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_ListOfDiscFace.hxx new file mode 100644 index 0000000..f3b58fb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_ListOfDiscFace.hxx @@ -0,0 +1,197 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_ListOfDiscFace_HeaderFile +#define _McCadDiscDs_ListOfDiscFace_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscFace_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadDiscDs_ListIteratorOfListOfDiscFace; +class McCadDiscDs_DiscFace; +class McCadDiscDs_ListNodeOfListOfDiscFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_ListOfDiscFace { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadDiscDs_ListOfDiscFace(); + + +Standard_EXPORT void Assign(const McCadDiscDs_ListOfDiscFace& Other) ; + void operator=(const McCadDiscDs_ListOfDiscFace& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadDiscDs_ListOfDiscFace() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscFace& I) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscFace& I,McCadDiscDs_ListIteratorOfListOfDiscFace& theIt) ; + + +Standard_EXPORT void Prepend(McCadDiscDs_ListOfDiscFace& Other) ; + + +Standard_EXPORT void Append(const McCadDiscDs_DiscFace& I) ; + + +Standard_EXPORT void Append(const McCadDiscDs_DiscFace& I,McCadDiscDs_ListIteratorOfListOfDiscFace& theIt) ; + + +Standard_EXPORT void Append(McCadDiscDs_ListOfDiscFace& Other) ; + + +Standard_EXPORT McCadDiscDs_DiscFace& First() const; + + +Standard_EXPORT McCadDiscDs_DiscFace& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadDiscDs_ListIteratorOfListOfDiscFace& It) ; + + +Standard_EXPORT void InsertBefore(const McCadDiscDs_DiscFace& I,McCadDiscDs_ListIteratorOfListOfDiscFace& It) ; + + +Standard_EXPORT void InsertBefore(McCadDiscDs_ListOfDiscFace& Other,McCadDiscDs_ListIteratorOfListOfDiscFace& It) ; + + +Standard_EXPORT void InsertAfter(const McCadDiscDs_DiscFace& I,McCadDiscDs_ListIteratorOfListOfDiscFace& It) ; + + +Standard_EXPORT void InsertAfter(McCadDiscDs_ListOfDiscFace& Other,McCadDiscDs_ListIteratorOfListOfDiscFace& It) ; + + +friend class McCadDiscDs_ListIteratorOfListOfDiscFace; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadDiscDs_ListOfDiscFace(const McCadDiscDs_ListOfDiscFace& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item McCadDiscDs_DiscFace +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscFace +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscFace +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscFace_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscFace +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_ListOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_ListOfDiscSolid.hxx new file mode 100644 index 0000000..73ca487 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_ListOfDiscSolid.hxx @@ -0,0 +1,197 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_ListOfDiscSolid_HeaderFile +#define _McCadDiscDs_ListOfDiscSolid_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_ListNodeOfListOfDiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadDiscDs_ListIteratorOfListOfDiscSolid; +class McCadDiscDs_DiscSolid; +class McCadDiscDs_ListNodeOfListOfDiscSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_ListOfDiscSolid { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadDiscDs_ListOfDiscSolid(); + + +Standard_EXPORT void Assign(const McCadDiscDs_ListOfDiscSolid& Other) ; + void operator=(const McCadDiscDs_ListOfDiscSolid& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadDiscDs_ListOfDiscSolid() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscSolid& I) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscSolid& I,McCadDiscDs_ListIteratorOfListOfDiscSolid& theIt) ; + + +Standard_EXPORT void Prepend(McCadDiscDs_ListOfDiscSolid& Other) ; + + +Standard_EXPORT void Append(const McCadDiscDs_DiscSolid& I) ; + + +Standard_EXPORT void Append(const McCadDiscDs_DiscSolid& I,McCadDiscDs_ListIteratorOfListOfDiscSolid& theIt) ; + + +Standard_EXPORT void Append(McCadDiscDs_ListOfDiscSolid& Other) ; + + +Standard_EXPORT McCadDiscDs_DiscSolid& First() const; + + +Standard_EXPORT McCadDiscDs_DiscSolid& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadDiscDs_ListIteratorOfListOfDiscSolid& It) ; + + +Standard_EXPORT void InsertBefore(const McCadDiscDs_DiscSolid& I,McCadDiscDs_ListIteratorOfListOfDiscSolid& It) ; + + +Standard_EXPORT void InsertBefore(McCadDiscDs_ListOfDiscSolid& Other,McCadDiscDs_ListIteratorOfListOfDiscSolid& It) ; + + +Standard_EXPORT void InsertAfter(const McCadDiscDs_DiscSolid& I,McCadDiscDs_ListIteratorOfListOfDiscSolid& It) ; + + +Standard_EXPORT void InsertAfter(McCadDiscDs_ListOfDiscSolid& Other,McCadDiscDs_ListIteratorOfListOfDiscSolid& It) ; + + +friend class McCadDiscDs_ListIteratorOfListOfDiscSolid; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadDiscDs_ListOfDiscSolid(const McCadDiscDs_ListOfDiscSolid& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item McCadDiscDs_DiscSolid +#define Item_hxx +#define TCollection_ListNode McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadDiscDs_ListIteratorOfListOfDiscSolid +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadDiscDs_ListNodeOfListOfDiscSolid +#define TCollection_ListNode_Type_() McCadDiscDs_ListNodeOfListOfDiscSolid_Type_() +#define TCollection_List McCadDiscDs_ListOfDiscSolid +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace.hxx new file mode 100644 index 0000000..905731f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfDiscFace.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile +#define _McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadDiscDs_DiscFace; +class McCadDiscDs_SequenceOfDiscFace; + + + +class McCadDiscDs_SequenceNodeOfSequenceOfDiscFace : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadDiscDs_SequenceNodeOfSequenceOfDiscFace(const McCadDiscDs_DiscFace& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadDiscDs_DiscFace& Value() const; +//Standard_EXPORT ~McCadDiscDs_SequenceNodeOfSequenceOfDiscFace(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_DiscFace myValue; + + +}; + +#define SeqItem McCadDiscDs_DiscFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscFace +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid.hxx new file mode 100644 index 0000000..72d9196 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile +#define _McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadDiscDs_DiscSolid; +class McCadDiscDs_SequenceOfDiscSolid; + + + +class McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid(const McCadDiscDs_DiscSolid& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadDiscDs_DiscSolid& Value() const; +//Standard_EXPORT ~McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_DiscSolid myValue; + + +}; + +#define SeqItem McCadDiscDs_DiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid.hxx new file mode 100644 index 0000000..74e19f5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile +#define _McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile +#include +#endif + +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadDiscDs_SequenceOfDiscSolid; +class McCadDiscDs_SequenceOfSeqOfDiscSolid; + + + +class McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid(const McCadDiscDs_SequenceOfDiscSolid& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadDiscDs_SequenceOfDiscSolid& Value() const; +//Standard_EXPORT ~McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_SequenceOfDiscSolid myValue; + + +}; + +#define SeqItem McCadDiscDs_SequenceOfDiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfSeqOfDiscSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfDiscFace.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfDiscFace.hxx new file mode 100644 index 0000000..6ddc9d9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfDiscFace.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_SequenceOfDiscFace_HeaderFile +#define _McCadDiscDs_SequenceOfDiscFace_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadDiscDs_DiscFace; +class McCadDiscDs_SequenceNodeOfSequenceOfDiscFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_SequenceOfDiscFace : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadDiscDs_SequenceOfDiscFace(); + + +Standard_EXPORT void Clear() ; +~McCadDiscDs_SequenceOfDiscFace() +{ + Clear(); +} + + + +Standard_EXPORT const McCadDiscDs_SequenceOfDiscFace& Assign(const McCadDiscDs_SequenceOfDiscFace& Other) ; + const McCadDiscDs_SequenceOfDiscFace& operator =(const McCadDiscDs_SequenceOfDiscFace& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadDiscDs_DiscFace& T) ; + + void Append(McCadDiscDs_SequenceOfDiscFace& S) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscFace& T) ; + + void Prepend(McCadDiscDs_SequenceOfDiscFace& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadDiscDs_DiscFace& T) ; + + void InsertBefore(const Standard_Integer Index,McCadDiscDs_SequenceOfDiscFace& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadDiscDs_DiscFace& T) ; + + void InsertAfter(const Standard_Integer Index,McCadDiscDs_SequenceOfDiscFace& S) ; + + +Standard_EXPORT const McCadDiscDs_DiscFace& First() const; + + +Standard_EXPORT const McCadDiscDs_DiscFace& Last() const; + + void Split(const Standard_Integer Index,McCadDiscDs_SequenceOfDiscFace& Sub) ; + + +Standard_EXPORT const McCadDiscDs_DiscFace& Value(const Standard_Integer Index) const; + const McCadDiscDs_DiscFace& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadDiscDs_DiscFace& I) ; + + +Standard_EXPORT McCadDiscDs_DiscFace& ChangeValue(const Standard_Integer Index) ; + McCadDiscDs_DiscFace& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadDiscDs_SequenceOfDiscFace(const McCadDiscDs_SequenceOfDiscFace& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadDiscDs_DiscFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscFace +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscFace_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscFace +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfDiscSolid.hxx new file mode 100644 index 0000000..63b7f2c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfDiscSolid.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_SequenceOfDiscSolid_HeaderFile +#define _McCadDiscDs_SequenceOfDiscSolid_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadDiscDs_DiscSolid; +class McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_SequenceOfDiscSolid : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadDiscDs_SequenceOfDiscSolid(); + + +Standard_EXPORT void Clear() ; +~McCadDiscDs_SequenceOfDiscSolid() +{ + Clear(); +} + + + +Standard_EXPORT const McCadDiscDs_SequenceOfDiscSolid& Assign(const McCadDiscDs_SequenceOfDiscSolid& Other) ; + const McCadDiscDs_SequenceOfDiscSolid& operator =(const McCadDiscDs_SequenceOfDiscSolid& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadDiscDs_DiscSolid& T) ; + + void Append(McCadDiscDs_SequenceOfDiscSolid& S) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_DiscSolid& T) ; + + void Prepend(McCadDiscDs_SequenceOfDiscSolid& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadDiscDs_DiscSolid& T) ; + + void InsertBefore(const Standard_Integer Index,McCadDiscDs_SequenceOfDiscSolid& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadDiscDs_DiscSolid& T) ; + + void InsertAfter(const Standard_Integer Index,McCadDiscDs_SequenceOfDiscSolid& S) ; + + +Standard_EXPORT const McCadDiscDs_DiscSolid& First() const; + + +Standard_EXPORT const McCadDiscDs_DiscSolid& Last() const; + + void Split(const Standard_Integer Index,McCadDiscDs_SequenceOfDiscSolid& Sub) ; + + +Standard_EXPORT const McCadDiscDs_DiscSolid& Value(const Standard_Integer Index) const; + const McCadDiscDs_DiscSolid& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadDiscDs_DiscSolid& I) ; + + +Standard_EXPORT McCadDiscDs_DiscSolid& ChangeValue(const Standard_Integer Index) ; + McCadDiscDs_DiscSolid& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadDiscDs_SequenceOfDiscSolid(const McCadDiscDs_SequenceOfDiscSolid& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadDiscDs_DiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfDiscSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfSeqOfDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfSeqOfDiscSolid.hxx new file mode 100644 index 0000000..4e1a406 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_SequenceOfSeqOfDiscSolid.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscDs_SequenceOfSeqOfDiscSolid_HeaderFile +#define _McCadDiscDs_SequenceOfSeqOfDiscSolid_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadDiscDs_SequenceOfDiscSolid; +class McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadDiscDs_SequenceOfSeqOfDiscSolid : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadDiscDs_SequenceOfSeqOfDiscSolid(); + + +Standard_EXPORT void Clear() ; +~McCadDiscDs_SequenceOfSeqOfDiscSolid() +{ + Clear(); +} + + + +Standard_EXPORT const McCadDiscDs_SequenceOfSeqOfDiscSolid& Assign(const McCadDiscDs_SequenceOfSeqOfDiscSolid& Other) ; + const McCadDiscDs_SequenceOfSeqOfDiscSolid& operator =(const McCadDiscDs_SequenceOfSeqOfDiscSolid& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadDiscDs_SequenceOfDiscSolid& T) ; + + void Append(McCadDiscDs_SequenceOfSeqOfDiscSolid& S) ; + + +Standard_EXPORT void Prepend(const McCadDiscDs_SequenceOfDiscSolid& T) ; + + void Prepend(McCadDiscDs_SequenceOfSeqOfDiscSolid& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadDiscDs_SequenceOfDiscSolid& T) ; + + void InsertBefore(const Standard_Integer Index,McCadDiscDs_SequenceOfSeqOfDiscSolid& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadDiscDs_SequenceOfDiscSolid& T) ; + + void InsertAfter(const Standard_Integer Index,McCadDiscDs_SequenceOfSeqOfDiscSolid& S) ; + + +Standard_EXPORT const McCadDiscDs_SequenceOfDiscSolid& First() const; + + +Standard_EXPORT const McCadDiscDs_SequenceOfDiscSolid& Last() const; + + void Split(const Standard_Integer Index,McCadDiscDs_SequenceOfSeqOfDiscSolid& Sub) ; + + +Standard_EXPORT const McCadDiscDs_SequenceOfDiscSolid& Value(const Standard_Integer Index) const; + const McCadDiscDs_SequenceOfDiscSolid& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadDiscDs_SequenceOfDiscSolid& I) ; + + +Standard_EXPORT McCadDiscDs_SequenceOfDiscSolid& ChangeValue(const Standard_Integer Index) ; + McCadDiscDs_SequenceOfDiscSolid& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadDiscDs_SequenceOfSeqOfDiscSolid(const McCadDiscDs_SequenceOfSeqOfDiscSolid& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadDiscDs_SequenceOfDiscSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid +#define TCollection_SequenceNode_Type_() McCadDiscDs_SequenceNodeOfSequenceOfSeqOfDiscSolid_Type_() +#define TCollection_Sequence McCadDiscDs_SequenceOfSeqOfDiscSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscDs_TDiscSolid.hxx b/src/MCCAD/McCadHeaders/McCadDiscDs_TDiscSolid.hxx new file mode 100644 index 0000000..fce3f4f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscDs_TDiscSolid.hxx @@ -0,0 +1,33 @@ +#include +#include +#include + +#ifndef _McCadDiscDs_DiscSolid +#define _McCadDiscDs_DiscSolid + + + +class Standard_GUID; +class TDF_Label; +class TDF_Attribute; +class TDF_RelocationTable; + +class McCadDiscDs_TDiscSolid : public TDF_Attribute +{ +public: + Standard_EXPORT static const Standard_GUID& GetID() ; + Standard_EXPORT const Standard_GUID& ID() const; + Standard_EXPORT void Restore(const Handle(TDF_Attribute)& With) ; + Standard_EXPORT void Paste(const Handle(TDF_Attribute)& Into,const Handle(TDF_RelocationTable)& RT) const; + Standard_EXPORT Handle_TDF_Attribute NewEmpty() const; + Standard_EXPORT virtual Standard_OStream& Dump(Standard_OStream& anOS) const; + + Standard_EXPORT McCadDiscDs_TDiscSolid(); + + +}; + +#endif + + + diff --git a/src/MCCAD/McCadHeaders/McCadDiscretization_Face.hxx b/src/MCCAD/McCadHeaders/McCadDiscretization_Face.hxx new file mode 100644 index 0000000..a4e2a9e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscretization_Face.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscretization_Face_HeaderFile +#define _McCadDiscretization_Face_HeaderFile + +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadDiscDs_DiscFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Algorithm to discretize a TopoDS_Face + + +class McCadDiscretization_Face { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! face Discretization class
+//! method implementation
+Standard_EXPORT McCadDiscretization_Face(); + + +Standard_EXPORT McCadDiscretization_Face(McCadDiscDs_DiscFace& theDsFace); + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT void SetFace(McCadDiscDs_DiscFace& theDsFace) ; + + +Standard_EXPORT McCadDiscDs_DiscFace GetFace() const; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void SetMinNbPnt(const Standard_Integer theNumb) ; + + +Standard_EXPORT Standard_Integer GetMinNbPnt() const; + + +Standard_EXPORT void SetMaxNbPnt(const Standard_Integer theNumb) ; + + +Standard_EXPORT Standard_Integer GetMaxNbPnt() const; + + +Standard_EXPORT void SetXresolution(const Standard_Real theXlen) ; + + +Standard_EXPORT Standard_Real GetXresolution() const; + + +Standard_EXPORT void SetYresolution(const Standard_Real theYlen) ; + + +Standard_EXPORT Standard_Real GetYresolution() const; + + +Standard_EXPORT void SetTolerance(const Standard_Real theTol) ; + + +Standard_EXPORT Standard_Real GetTolerance() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_DiscFace myDiscFace; +Standard_Integer myMaxNbPnt; +Standard_Integer myMinNbPnt; +Standard_Real myXlen; +Standard_Real myYlen; +Standard_Real myRlen; +Standard_Real myTolerance; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscretization_Face.ixx b/src/MCCAD/McCadHeaders/McCadDiscretization_Face.ixx new file mode 100644 index 0000000..3b05603 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscretization_Face.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadDiscretization_Face.jxx b/src/MCCAD/McCadHeaders/McCadDiscretization_Face.jxx new file mode 100644 index 0000000..6029cbe --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscretization_Face.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadDiscretization_Face_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.hxx b/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.hxx new file mode 100644 index 0000000..f83cdf8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadDiscretization_Solid_HeaderFile +#define _McCadDiscretization_Solid_HeaderFile + +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadDiscDs_DiscSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Algorithm to discretize a TopoDS_Solid + + +class McCadDiscretization_Solid { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! face Discretization class
+//! method implementation the same as in the face class
+Standard_EXPORT McCadDiscretization_Solid(); + + +Standard_EXPORT McCadDiscretization_Solid(McCadDiscDs_DiscSolid& theDsSolid); + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT void SetSolid(McCadDiscDs_DiscSolid& theDsSolid) ; + + +Standard_EXPORT McCadDiscDs_DiscSolid GetSolid() const; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void SetMinNbPnt(const Standard_Integer theNumb) ; + + +Standard_EXPORT Standard_Integer GetMinNbPnt() const; + + +Standard_EXPORT void SetMaxNbPnt(const Standard_Integer theNumb) ; + + +Standard_EXPORT Standard_Integer GetMaxNbPnt() const; + + +Standard_EXPORT void SetXresolution(const Standard_Real theXlen) ; + + +Standard_EXPORT Standard_Real GetXresolution() const; + + +Standard_EXPORT void SetYresolution(const Standard_Real theYlen) ; + + +Standard_EXPORT Standard_Real GetYresolution() const; + + +Standard_EXPORT void SetTolerance(const Standard_Real theTol) ; + + +Standard_EXPORT Standard_Real GetTolerance() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadDiscDs_DiscSolid myDiscSolid; +Standard_Integer myMaxNbPnt; +Standard_Integer myMinNbPnt; +Standard_Real myXlen; +Standard_Real myYlen; +Standard_Real myRlen; +Standard_Real myTolrenace; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.ixx b/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.ixx new file mode 100644 index 0000000..44a0816 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.jxx b/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.jxx new file mode 100644 index 0000000..19b4e3b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadDiscretization_Solid.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadDiscDs_DiscSolid_HeaderFile +#include +#endif +#ifndef _McCadDiscretization_Solid_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Brep.ixx b/src/MCCAD/McCadHeaders/McCadEXLib_Brep.ixx new file mode 100644 index 0000000..45cdc43 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Brep.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Brep.jxx b/src/MCCAD/McCadHeaders/McCadEXLib_Brep.jxx new file mode 100644 index 0000000..339a479 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Brep.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadEXLib_Brep_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Iges.ixx b/src/MCCAD/McCadHeaders/McCadEXLib_Iges.ixx new file mode 100644 index 0000000..e6ba781 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Iges.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Iges.jxx b/src/MCCAD/McCadHeaders/McCadEXLib_Iges.jxx new file mode 100644 index 0000000..d1a8823 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Iges.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadEXLib_Iges_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Mcnp.ixx b/src/MCCAD/McCadHeaders/McCadEXLib_Mcnp.ixx new file mode 100644 index 0000000..1ee1670 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Mcnp.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Mcnp.jxx b/src/MCCAD/McCadHeaders/McCadEXLib_Mcnp.jxx new file mode 100644 index 0000000..a46a307 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Mcnp.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadEXLib_Mcnp_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Step.ixx b/src/MCCAD/McCadHeaders/McCadEXLib_Step.ixx new file mode 100644 index 0000000..c5c5973 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Step.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXLib_Step.jxx b/src/MCCAD/McCadHeaders/McCadEXLib_Step.jxx new file mode 100644 index 0000000..10174ea --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXLib_Step.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadEXLib_Step_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug.hxx new file mode 100644 index 0000000..5208ab6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug.hxx @@ -0,0 +1,107 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_HeaderFile +#define _McCadEXPlug_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class OSD_Path; +class McCadEXPlug_PluginManager; +class McCadEXPlug_ExchangePlugin; +class McCadEXPlug_SequenceOfSharedLibrary; +class McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! This package provides
+//! plugable date Import/Export interfaces.
+class McCadEXPlug { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Returns TRUE if exists.
+Standard_EXPORT static Standard_Boolean PathExists(const OSD_Path& thePath) ; + +//! Returns TRUE if is radable
+Standard_EXPORT static Standard_Boolean PathIsReadable(const OSD_Path& thePath) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + +friend class McCadEXPlug_PluginManager; +friend class McCadEXPlug_ExchangePlugin; +friend class McCadEXPlug_SequenceOfSharedLibrary; +friend class McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug.ixx b/src/MCCAD/McCadHeaders/McCadEXPlug.ixx new file mode 100644 index 0000000..f2dab3a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug.jxx b/src/MCCAD/McCadHeaders/McCadEXPlug.jxx new file mode 100644 index 0000000..4fa8dcd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug.jxx @@ -0,0 +1,6 @@ +#ifndef _OSD_Path_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.hxx new file mode 100644 index 0000000..4c03dd2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.hxx @@ -0,0 +1,161 @@ +#ifndef _McCadEXPlug_ExchangePlugin_HeaderFile +#define _McCadEXPlug_ExchangePlugin_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class McCadDiscDs_HSequenceOfDiscSolid; +class TCollection_AsciiString; +class TColStd_HSequenceOfAsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +//! \brief Base class for all Data Exchange between CAD and MC + +//! This is the base class for all data exchange for CAD and MC data. + + +class McCadEXPlug_ExchangePlugin { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This is Plugin proxy
+Standard_EXPORT McCadEXPlug_ExchangePlugin(); + +//! Export a HSequenceOfShape to a selected file type +Standard_EXPORT virtual Standard_Boolean Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) ; + +//! Export a HSequenceOfDiscSolid to a selected file type - naming information will be preserved +Standard_EXPORT virtual Standard_Boolean Export(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theVEntitySequence) ; + +//! Import a file of given file type +Standard_EXPORT virtual Handle_TopTools_HSequenceOfShape Import() ; + +//! Returns the model type - depends on the file type, e.g. for STEP it would be
+// STEPControl_AsIs, STEPControl_ManifoldSolid,... +Standard_EXPORT virtual Standard_Integer GetModelType() const; + +//! Define the model type for export, see GetModelType() +Standard_EXPORT virtual void SetModelType(const Standard_Integer theType) ; + +//! Returns the filename +Standard_EXPORT virtual TCollection_AsciiString GetFilename() ; + +//! define the filename +Standard_EXPORT virtual void SetFilename(const TCollection_AsciiString& theFileName) ; + +//! ??? not used! +Standard_EXPORT virtual Standard_Integer GetSize() const; + +//! Returns all extensions of chosen implementation of proxy +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + +//! Get main extension +Standard_EXPORT virtual TCollection_AsciiString GetExtension() const; + +//! Gets the selected fileformat +Standard_EXPORT virtual TCollection_AsciiString GetFormat() const; + +//! true if Export is enabled +Standard_EXPORT virtual Standard_Boolean ExportEnabled() const; + +//! true if Import is enabled +Standard_EXPORT virtual Standard_Boolean ImportEnabled() const; + +//! import to TDocStd_Document +Standard_EXPORT virtual Standard_Boolean ImportToDocument(Handle(TDocStd_Document)& theDoc); + +//! Export from a TDocStd_Document +Standard_EXPORT virtual Standard_Boolean ExportFromDocument(const Handle(TDocStd_Document)& theDoc); + +//! Define the initial Surface number. This is necessary if a part for an already
+//! existing model should be converted. +Standard_EXPORT void SetInitSurfNb(Standard_Integer nb){myInitSurfNb = nb;} + +//! Define the initial Volume number. This is necessary if a part for an already
+//! existing model should be converted. +Standard_EXPORT void SetInitCellNb(Standard_Integer nb){myInitCellNb = nb;} + +//! Define the unit of the CAD model to be converted. Default is MM. If CM is chosen,
+//! the units will be recalculated. +Standard_EXPORT void SetUnits(McCadCSGGeom_Unit unit){myUnits = unit;} + +//! Define the Material Density reader. MCNP only. It reads material information and
+//! prepares them for the cell description. This is not necessary in Tripoli, because
+//! material compositions can easily be defined with scripts. In MCNP for each volume
+//! individual material number and density have to be defined in the lines of
+//! geometrical description of the volume. +Standard_EXPORT void SetMDReader(McCadMDReader_Reader& rdr){myMDReader = rdr;} + +#ifndef MCCAD_NONGUI +Standard_EXPORT McCadGUI_ProgressDialogPtr GetProgressDialog(); +#endif + +protected: + McCadGUI_ProgressDialogPtr myProgress; + Standard_Integer myInitCellNb, myInitSurfNb; + McCadCSGGeom_Unit myUnits; + McCadMDReader_Reader myMDReader; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.ixx b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.ixx new file mode 100644 index 0000000..4275969 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.jxx b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.jxx new file mode 100644 index 0000000..fa5fba9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePlugin.jxx @@ -0,0 +1,15 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePlugin_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePluginPtr.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePluginPtr.hxx new file mode 100644 index 0000000..9235bef --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_ExchangePluginPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_ExchangePluginPtr_HeaderFile +#define _McCadEXPlug_ExchangePluginPtr_HeaderFile + +class McCadEXPlug_ExchangePlugin; + +typedef McCadEXPlug_ExchangePlugin* McCadEXPlug_ExchangePluginPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_MCBase.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_MCBase.hxx new file mode 100644 index 0000000..43568c1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_MCBase.hxx @@ -0,0 +1,57 @@ +#ifndef _McCadEXPlug_MCBase_hxx_ +#define _McCadEXPlug_MCBase_hxx_ +/* + McCadEXPlug_MCBase.hxx + +Purpose: Base Class for import and export classes for Monte-Carlo codes + Besides the McCadEXPlug_PluginManager which offers a basis for + all kind of Data-Exchanges CAD & MC, the MC class will provide + only features needed for MC data exchange + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +//! \brief Base Class for all Import/Export classes for Monte Carlo codes. + +//! Base Class for all Import and Export related classes for Monte Carlo codes.
+ +class McCadEXPlug_MCBase : public McCadEXPlug_ExchangePlugin { +public: // functions + +//! ctor + McCadEXPlug_MCBase(); + +//! Perform decomposition and void generation of CAD model from a XCAF-Document + virtual Handle_McCadDiscDs_HSequenceOfDiscSolid PrepareExport(const Handle(TDocStd_Document)& theTDoc); + +//! By default void volumes will not be built when reading a MC file in McCad.
+//! Setting state to true will activate conversion from Void volumes in MC->CAD process. + virtual void RecoverVoids(const Standard_Boolean& state); + +protected : // fields + Standard_Boolean myRecoverVoids; // for MC input reader, recover voids; or material volumes only? + Handle_Message_ProgressIndicator myPI; +}; + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_PluginMaker.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginMaker.hxx new file mode 100644 index 0000000..b5deeed --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginMaker.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_PluginMaker_HeaderFile +#define _McCadEXPlug_PluginMaker_HeaderFile + +class McCadEXPlug_ExchangePlugin; + +typedef McCadEXPlug_ExchangePlugin* McCadEXPlug_PluginMaker; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.hxx new file mode 100644 index 0000000..9ebc37b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.hxx @@ -0,0 +1,162 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_PluginManager_HeaderFile +#define _McCadEXPlug_PluginManager_HeaderFile + +#ifndef _McCadEXPlug_PluginManagerPtr_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_SequenceOfSharedLibrary_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _OSD_Path_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePluginPtr_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TCollection_AsciiString; +class OSD_Path; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadEXPlug_PluginManager { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static McCadEXPlug_PluginManagerPtr Instance() ; + + +Standard_EXPORT void Initialize() ; + + +Standard_EXPORT McCadEXPlug_ExchangePluginPtr GetPlugin(const TCollection_AsciiString& theExtension) const; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetFormats() const; + + +Standard_EXPORT Standard_Boolean CheckExtension(const TCollection_AsciiString& theExtension) const; + + +Standard_EXPORT Standard_Boolean CheckFormat(const TCollection_AsciiString& theFormat) const; + + +Standard_EXPORT Standard_Boolean LoadSharedLibrary(const OSD_Path& thePath) ; + + +Standard_EXPORT void UnLoadSharedLibrary() const; + + +Standard_EXPORT OSD_Path SharedLibraryPath() const; + + +Standard_EXPORT TCollection_AsciiString GetPathName() const; + + +Standard_EXPORT Standard_Boolean IsSharedLibOpen() const; + + + + + +protected: + + // Methods PROTECTED + // + +//! This is Plugin Manager as a singelton.
+Standard_EXPORT McCadEXPlug_PluginManager(); + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +static McCadEXPlug_PluginManagerPtr myInstance; +McCadEXPlug_SequenceOfSharedLibrary mySharedLibs; +Handle_TColStd_HSequenceOfAsciiString myExtensions; +Handle_TColStd_HSequenceOfAsciiString myFormats; +Standard_Integer myPluginCount; +OSD_Path myPath; +TCollection_AsciiString myPathName; +Standard_Boolean mySharedLibIsOpen; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.ixx b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.ixx new file mode 100644 index 0000000..817acdf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.jxx b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.jxx new file mode 100644 index 0000000..58ad55e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManager.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _OSD_Path_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_PluginManager_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManagerPtr.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManagerPtr.hxx new file mode 100644 index 0000000..50735cf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_PluginManagerPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_PluginManagerPtr_HeaderFile +#define _McCadEXPlug_PluginManagerPtr_HeaderFile + +class McCadEXPlug_PluginManager; + +typedef McCadEXPlug_PluginManager* McCadEXPlug_PluginManagerPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary.hxx new file mode 100644 index 0000000..3f88d81 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile +#define _McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile +#include +#endif + +#ifndef _OSD_SharedLibrary_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class OSD_SharedLibrary; +class McCadEXPlug_SequenceOfSharedLibrary; + + + +class McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary(const OSD_SharedLibrary& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + OSD_SharedLibrary& Value() const; +//Standard_EXPORT ~McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +OSD_SharedLibrary myValue; + + +}; + +#define SeqItem OSD_SharedLibrary +#define SeqItem_hxx +#define TCollection_SequenceNode McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_Type_() McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_Type_() +#define TCollection_Sequence McCadEXPlug_SequenceOfSharedLibrary +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadEXPlug_SequenceOfSharedLibrary.hxx b/src/MCCAD/McCadHeaders/McCadEXPlug_SequenceOfSharedLibrary.hxx new file mode 100644 index 0000000..61ec82e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadEXPlug_SequenceOfSharedLibrary.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadEXPlug_SequenceOfSharedLibrary_HeaderFile +#define _McCadEXPlug_SequenceOfSharedLibrary_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class OSD_SharedLibrary; +class McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadEXPlug_SequenceOfSharedLibrary : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadEXPlug_SequenceOfSharedLibrary(); + + +Standard_EXPORT void Clear() ; +~McCadEXPlug_SequenceOfSharedLibrary() +{ + Clear(); +} + + + +Standard_EXPORT const McCadEXPlug_SequenceOfSharedLibrary& Assign(const McCadEXPlug_SequenceOfSharedLibrary& Other) ; + const McCadEXPlug_SequenceOfSharedLibrary& operator =(const McCadEXPlug_SequenceOfSharedLibrary& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const OSD_SharedLibrary& T) ; + + void Append(McCadEXPlug_SequenceOfSharedLibrary& S) ; + + +Standard_EXPORT void Prepend(const OSD_SharedLibrary& T) ; + + void Prepend(McCadEXPlug_SequenceOfSharedLibrary& S) ; + + void InsertBefore(const Standard_Integer Index,const OSD_SharedLibrary& T) ; + + void InsertBefore(const Standard_Integer Index,McCadEXPlug_SequenceOfSharedLibrary& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const OSD_SharedLibrary& T) ; + + void InsertAfter(const Standard_Integer Index,McCadEXPlug_SequenceOfSharedLibrary& S) ; + + +Standard_EXPORT const OSD_SharedLibrary& First() const; + + +Standard_EXPORT const OSD_SharedLibrary& Last() const; + + void Split(const Standard_Integer Index,McCadEXPlug_SequenceOfSharedLibrary& Sub) ; + + +Standard_EXPORT const OSD_SharedLibrary& Value(const Standard_Integer Index) const; + const OSD_SharedLibrary& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const OSD_SharedLibrary& I) ; + + +Standard_EXPORT OSD_SharedLibrary& ChangeValue(const Standard_Integer Index) ; + OSD_SharedLibrary& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadEXPlug_SequenceOfSharedLibrary(const McCadEXPlug_SequenceOfSharedLibrary& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem OSD_SharedLibrary +#define SeqItem_hxx +#define TCollection_SequenceNode McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary +#define TCollection_SequenceNode_Type_() McCadEXPlug_SequenceNodeOfSequenceOfSharedLibrary_Type_() +#define TCollection_Sequence McCadEXPlug_SequenceOfSharedLibrary +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.hxx b/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.hxx new file mode 100644 index 0000000..78d2988 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.hxx @@ -0,0 +1,156 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllBrep_Brep_HeaderFile +#define _McCadExDllBrep_Brep_HeaderFile + +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePlugin_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TopTools_HSequenceOfShape; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Import-Export-Class for BREP files + +//! BREP is the OCC internally file structure. This class allows to dump
+//! and read BREP files. + +class McCadExDllBrep_Brep : public McCadEXPlug_ExchangePlugin { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This is Plugin proxy
+Standard_EXPORT McCadExDllBrep_Brep(); + + +Standard_EXPORT virtual Standard_Boolean Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) ; + + +Standard_EXPORT virtual Handle_TopTools_HSequenceOfShape Import() ; + + +Standard_EXPORT virtual TCollection_AsciiString GetFilename() const; + + +Standard_EXPORT virtual void SetFilename(const TCollection_AsciiString& theFileName) ; + + +Standard_EXPORT virtual Standard_Integer GetSize() const; + + +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + + +Standard_EXPORT virtual TCollection_AsciiString GetExtension() const; + + +Standard_EXPORT virtual TCollection_AsciiString GetFormat() const; + + +Standard_EXPORT virtual Standard_Boolean ExportEnabled() const; + + +Standard_EXPORT virtual Standard_Boolean ImportEnabled() const; + +Standard_EXPORT virtual Standard_Boolean ImportToDocument(Handle(TDocStd_Document)& theDoc); + +Standard_EXPORT virtual Standard_Boolean ExportFromDocument(const Handle(TDocStd_Document)& theDoc); + +//Standard_EXPORT McCadGUI_ProgressDialogPtr GetProgressDialog(); + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +TCollection_AsciiString myFormat; +Standard_Boolean myExportEnabled; +Standard_Boolean myImportEnabled; +TCollection_AsciiString myFileName; +Standard_Integer mySize; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_TColStd_HSequenceOfAsciiString myExtensions; +//McCadGUI_ProgressDialogPtr myProgress; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.ixx b/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.ixx new file mode 100644 index 0000000..88ac0f1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.jxx b/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.jxx new file mode 100644 index 0000000..00c8749 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllBrep_Brep.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadExDllBrep_Brep_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllBrep_BrepPtr.hxx b/src/MCCAD/McCadHeaders/McCadExDllBrep_BrepPtr.hxx new file mode 100644 index 0000000..11b4e7c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllBrep_BrepPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllBrep_BrepPtr_HeaderFile +#define _McCadExDllBrep_BrepPtr_HeaderFile + +class McCadExDllBrep_Brep; + +typedef McCadExDllBrep_Brep* McCadExDllBrep_BrepPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.hxx b/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.hxx new file mode 100644 index 0000000..3b0e915 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.hxx @@ -0,0 +1,154 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllIges_Iges_HeaderFile +#define _McCadExDllIges_Iges_HeaderFile + +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePlugin_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TopTools_HSequenceOfShape; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Import-Export-Class for IGES files + +//! IGES is a little bit outdated but still supported. Use STEP instead. + +class McCadExDllIges_Iges : public McCadEXPlug_ExchangePlugin { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This is Plugin proxy
+Standard_EXPORT McCadExDllIges_Iges(); + +Standard_EXPORT virtual ~McCadExDllIges_Iges(){} + +Standard_EXPORT virtual Standard_Boolean Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) ; + + +Standard_EXPORT virtual Handle_TopTools_HSequenceOfShape Import() ; + + +Standard_EXPORT virtual TCollection_AsciiString GetFilename() const; + + +Standard_EXPORT virtual void SetFilename(const TCollection_AsciiString& theFileName) ; + + +Standard_EXPORT virtual Standard_Integer GetSize() const; + + +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + + +Standard_EXPORT virtual TCollection_AsciiString GetExtension() const; + + +Standard_EXPORT virtual TCollection_AsciiString GetFormat() const; + + +Standard_EXPORT virtual Standard_Boolean ExportEnabled() const; + + +Standard_EXPORT virtual Standard_Boolean ImportEnabled() const; + +Standard_EXPORT virtual Standard_Boolean ImportToDocument(Handle(TDocStd_Document)& theDoc); + +Standard_EXPORT virtual Standard_Boolean ExportFromDocument(const Handle(TDocStd_Document)& theDoc); + +//Standard_EXPORT McCadGUI_ProgressDialogPtr GetProgressDialog(); + +protected: + + // Methods PROTECTED + // + + Standard_EXPORT void run() ; + // Fields PROTECTED + // +TCollection_AsciiString myFormat; +Standard_Boolean myExportEnabled; +Standard_Boolean myImportEnabled; +TCollection_AsciiString myFileName; +Standard_Integer mySize; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_TColStd_HSequenceOfAsciiString myExtensions; +//McCadGUI_ProgressDialogPtr myProgress; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.ixx b/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.ixx new file mode 100644 index 0000000..564b788 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.jxx b/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.jxx new file mode 100644 index 0000000..dbe922d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllIges_Iges.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadExDllIges_Iges_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllIges_IgesPtr.hxx b/src/MCCAD/McCadHeaders/McCadExDllIges_IgesPtr.hxx new file mode 100644 index 0000000..9980dd1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllIges_IgesPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllIges_IgesPtr_HeaderFile +#define _McCadExDllIges_IgesPtr_HeaderFile + +class McCadExDllIges_Iges; + +typedef McCadExDllIges_Iges* McCadExDllIges_IgesPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.hxx b/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.hxx new file mode 100644 index 0000000..0bb9d16 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.hxx @@ -0,0 +1,184 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllMcnp_Mcnp_HeaderFile +#define _McCadExDllMcnp_Mcnp_HeaderFile + +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePlugin_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#include +#include + +#include + +class TColStd_HSequenceOfAsciiString; +class TopTools_HSequenceOfShape; +class McCadDiscDs_HSequenceOfDiscSolid; +class TCollection_AsciiString; +#include +#include + + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief CAD<->MCNP Exchange class + +//! This class is the top level class of data exchange between CAD and MCNP geometry. + +class McCadExDllMcnp_Mcnp :/* public McCadEXPlug_ExchangePlugin,*/ public McCadEXPlug_MCBase{ + + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This is Plugin proxy
+Standard_EXPORT McCadExDllMcnp_Mcnp(); + + +//! Export a HSequenceOfShape - no naming information +Standard_EXPORT virtual Standard_Boolean Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) ; + +//! Export a HSequenceOfDiscSolid. This allows the transport of naming information from CAD to MCNP
+Standard_EXPORT virtual Standard_Boolean Export(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theVEntitySequence) ; + +//! Import MCNP file and translate the MCNP geometry to CAD geometry description. +Standard_EXPORT virtual Handle_TopTools_HSequenceOfShape Import() ; + +//! Return the filename of input/output file +Standard_EXPORT virtual TCollection_AsciiString GetFilename() const; + +//! Define the filename +Standard_EXPORT virtual void SetFilename(const TCollection_AsciiString& theFileName) ; + +//! ??? - no idea. this funnction isn't used +Standard_EXPORT virtual Standard_Integer GetSize() const; + +//! Get File Extensions +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + +//! Get main file extension +Standard_EXPORT virtual TCollection_AsciiString GetExtension() const; + +//! Get selected file format +Standard_EXPORT virtual TCollection_AsciiString GetFormat() const; + +//! Returns true, if export is enabled +Standard_EXPORT virtual Standard_Boolean ExportEnabled() const; + +//! returns true, if Import is enabled +Standard_EXPORT virtual Standard_Boolean ImportEnabled() const; + +//! Import a MCNP file to a TDocStd_Document +Standard_EXPORT virtual Standard_Boolean ImportToDocument(Handle(TDocStd_Document)& theDoc); + +//! Export CAD geometry from a TDocStd_Document +//! this allows to transport naming and material information +Standard_EXPORT virtual Standard_Boolean ExportFromDocument(const Handle(TDocStd_Document)& theDoc); + +//! enables or disables the Build of Void Cells to Solids in CAD-Model
+//Standard_EXPORT void SetBuildVoids(const Standard_Boolean theStat) ; + +//Standard_EXPORT McCadGUI_ProgressDialogPtr GetProgressDialog(); + + +protected: + + // Methods PROTECTED + // + + Standard_EXPORT void run() ; + // Fields PROTECTED + // +TCollection_AsciiString myFormat; +Standard_Boolean myExportEnabled; +Standard_Boolean myImportEnabled; +TCollection_AsciiString myFileName; +Standard_Integer mySize; +//Standard_Integer myInitCellNb; +//Standard_Integer myInitSurfNb; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_TColStd_HSequenceOfAsciiString myExtensions; +//Standard_Boolean myBuildVoids; +Handle(TopTools_HSequenceOfShape) myDecomposedModel; +//McCadMDReader_Reader myMDReader; +//McCadCSGGeom_Unit myUnits; +//Handle_Message_ProgressIndicator myPI; +//McCadGUI_ProgressDialogPtr myProgress; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.ixx b/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.ixx new file mode 100644 index 0000000..6aa1c6a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.jxx b/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.jxx new file mode 100644 index 0000000..4323992 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllMcnp_Mcnp.jxx @@ -0,0 +1,15 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadExDllMcnp_Mcnp_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllMcnp_McnpPtr.hxx b/src/MCCAD/McCadHeaders/McCadExDllMcnp_McnpPtr.hxx new file mode 100644 index 0000000..4f7b041 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllMcnp_McnpPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllMcnp_McnpPtr_HeaderFile +#define _McCadExDllMcnp_McnpPtr_HeaderFile + +class McCadExDllMcnp_Mcnp; + +typedef McCadExDllMcnp_Mcnp* McCadExDllMcnp_McnpPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllStep_Step.hxx b/src/MCCAD/McCadHeaders/McCadExDllStep_Step.hxx new file mode 100644 index 0000000..e5b5d43 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllStep_Step.hxx @@ -0,0 +1,161 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllStep_Step_HeaderFile +#define _McCadExDllStep_Step_HeaderFile + +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadEXPlug_ExchangePlugin_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TopTools_HSequenceOfShape; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Import-Export-Class for STEP files + + +//! STEP is the most suitable independent file format for CAD geometry. + +class McCadExDllStep_Step : public McCadEXPlug_ExchangePlugin { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This is Plugin proxy
+Standard_EXPORT McCadExDllStep_Step(); + +Standard_EXPORT virtual ~McCadExDllStep_Step(){} + +Standard_EXPORT virtual Standard_Boolean Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) ; + + +Standard_EXPORT virtual Handle_TopTools_HSequenceOfShape Import() ; + + +Standard_EXPORT virtual TCollection_AsciiString GetFilename() const; + + +Standard_EXPORT virtual void SetFilename(const TCollection_AsciiString& theFileName) ; + + +Standard_EXPORT virtual Standard_Integer GetSize() const; + + +Standard_EXPORT virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + + +Standard_EXPORT virtual TCollection_AsciiString GetExtension() const; + + +Standard_EXPORT virtual TCollection_AsciiString GetFormat() const; + + +Standard_EXPORT virtual Standard_Boolean ExportEnabled() const; + + +Standard_EXPORT virtual Standard_Boolean ImportEnabled() const; + +Standard_EXPORT virtual Standard_Boolean ImportToDocument(Handle(TDocStd_Document)& theDoc); + +Standard_EXPORT virtual Standard_Boolean ExportFromDocument(const Handle(TDocStd_Document)& theDoc); + +//Standard_EXPORT McCadGUI_ProgressDialogPtr GetProgressDialog(); + +protected: + + // Methods PROTECTED + // + + Standard_EXPORT void run() ; + + // Fields PROTECTED + // +TCollection_AsciiString myFormat; +Standard_Boolean myExportEnabled; +Standard_Boolean myImportEnabled; +TCollection_AsciiString myFileName; +Standard_Integer mySize; +Standard_Integer myType; + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT Standard_Boolean IsFacetedBrep(const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape) ; + + + // Fields PRIVATE + // +Handle_TColStd_HSequenceOfAsciiString myExtensions; +//McCadGUI_ProgressDialogPtr myProgress; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllStep_Step.ixx b/src/MCCAD/McCadHeaders/McCadExDllStep_Step.ixx new file mode 100644 index 0000000..6dc59c9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllStep_Step.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadExDllStep_Step.jxx b/src/MCCAD/McCadHeaders/McCadExDllStep_Step.jxx new file mode 100644 index 0000000..be3a192 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllStep_Step.jxx @@ -0,0 +1,12 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadExDllStep_Step_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllStep_StepPtr.hxx b/src/MCCAD/McCadHeaders/McCadExDllStep_StepPtr.hxx new file mode 100644 index 0000000..716a7db --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllStep_StepPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadExDllStep_StepPtr_HeaderFile +#define _McCadExDllStep_StepPtr_HeaderFile + +class McCadExDllStep_Step; + +typedef McCadExDllStep_Step* McCadExDllStep_StepPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadExDllTripoli_Tripoli.hxx b/src/MCCAD/McCadHeaders/McCadExDllTripoli_Tripoli.hxx new file mode 100644 index 0000000..7a28f8a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadExDllTripoli_Tripoli.hxx @@ -0,0 +1,87 @@ +#ifndef MCCADEXDLLTRIPOLI_TRIPOLI_HXX_ +#define MCCADEXDLLTRIPOLI_TRIPOLI_HXX_ + + +#include +#include + +//! \brief Master Class for the export to Tripoli output
+ +/*! This class is the implementation of the CAD to Tripoli interface
+ *! It exports all discretized solids in McCadDiscDs_HSequenceOfDiscSolid to
+ *! a file with the file filter .d, or .tri.
+ *! The import function is not yet enabled. + */ + + +class McCadExDllTripoli_Tripoli : /*public McCadEXPlug_ExchangePlugin,*/ public McCadEXPlug_MCBase +{ + +public: + McCadExDllTripoli_Tripoli(); + +// virtual Standard_Boolean Export(const Handle(TopTools_HSequenceOfShape)& theEntitySequence) ; + + //! Exports a Sequence of DiscSolids to a previously specified filename. + virtual Standard_Boolean Export(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theVEntitySequence) ; + + //! Not yet implemented!!! + virtual Handle_TopTools_HSequenceOfShape Import() ; + + //! Returns the defined filename for the export + virtual TCollection_AsciiString GetFilename() const; + + //! Set the export filename + virtual void SetFilename(const TCollection_AsciiString& theFileName) ; + + //! ??? - No function at all + virtual Standard_Integer GetSize() const; + + //! return a Sequence of file extension for this class (.d, .tri) + virtual Handle_TColStd_HSequenceOfAsciiString GetExtensions() const; + + //! Get first extension in list of extensions. ".d" by default. + virtual TCollection_AsciiString GetExtension() const; + + //! Returns the file format + virtual TCollection_AsciiString GetFormat() const; + + //! Returns true, if export is enabled. + virtual Standard_Boolean ExportEnabled() const; + + //! Returns true, if import is enabled + virtual Standard_Boolean ImportEnabled() const; + + //! Import to a TDocStd_Document. McCad is based on OpenCascades Application Framework. + virtual Standard_Boolean ImportToDocument(Handle(TDocStd_Document)& theDoc); + + //! Export a TDocStd_Document to tripoli input geometry. + virtual Standard_Boolean ExportFromDocument(const Handle(TDocStd_Document)& theDoc); + + //! enables or disables the Build of Void Cells to Solids in CAD-Model
+ //void SetBuildVoids(const Standard_Boolean theStat) ; + + // McCadGUI_ProgressDialogPtr GetProgressDialog(); + + +protected: + // Fields PROTECTED + // + TCollection_AsciiString myFormat; + Standard_Boolean myExportEnabled; + Standard_Boolean myImportEnabled; + TCollection_AsciiString myFileName; + Standard_Integer mySize; + Standard_Integer myInitCellNb; + Standard_Integer myInitSurfNb; + + +private: + // Fields PRIVATE + // + Handle_TColStd_HSequenceOfAsciiString myExtensions; + Standard_Boolean myBuildVoids; + Handle(TopTools_HSequenceOfShape) myDecomposedModel; +}; + +#endif /* MCCADEXDLLTRIPOLI_TRIPOLI_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadGTOOL.hxx b/src/MCCAD/McCadHeaders/McCadGTOOL.hxx new file mode 100644 index 0000000..3d862a6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGTOOL.hxx @@ -0,0 +1,141 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGTOOL_HeaderFile +#define _McCadGTOOL_HeaderFile + +#ifndef _Standard_Real_HeaderFile +#include +#endif +class GeomAdaptor_Surface; +class gp_Pnt; +class gp_Pln; +class gp_Cone; +class gp_Cylinder; +class gp_Sphere; +class gp_Torus; +class TColStd_Array1OfReal; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +/*! + \brief Static toolbox for the evaluation of surface equations for specified points in 3D space +*/ + + +class McCadGTOOL { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +//! Evaluate a surface -> Get surface type and call responsible method from below +Standard_EXPORT static Standard_Real Evaluate(const GeomAdaptor_Surface& theSurf,const gp_Pnt& thePoint) ; + +//! Extract parameters from the plane Pl and call PlaneEvaluate(,) +Standard_EXPORT static Standard_Real Evaluate(const gp_Pln& Pl,const gp_Pnt& thePoint) ; + +//! Extract parameters from the cone Co and call ConeEvaluate(,) +Standard_EXPORT static Standard_Real Evaluate(const gp_Cone& Co,const gp_Pnt& thePoint) ; + +//! Extract parameters from the cylinder Cy and call CylinderEvaluate(,) +Standard_EXPORT static Standard_Real Evaluate(const gp_Cylinder& Cy,const gp_Pnt& thePoint) ; + +//! Extract parameters from the sphere Sp and call SphereEvaluate(,) +Standard_EXPORT static Standard_Real Evaluate(const gp_Sphere& Sp,const gp_Pnt& thePoint) ; + +//! Extract parameters from the torus To and call TorusEvaluate(,) +Standard_EXPORT static Standard_Real Evaluate(const gp_Torus& To,const gp_Pnt& thePoint) ; + +//! Evaluate surface equation of the plane Pl for the 3D point thePoint +Standard_EXPORT static Standard_Real PlaneEvaluate(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real A,const Standard_Real B,const Standard_Real C,const Standard_Real D) ; + +//! Default: try to evaluate as a quaric surface +Standard_EXPORT static Standard_Real QuadricEvaluate(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real A1,const Standard_Real A2,const Standard_Real A3,const Standard_Real B1,const Standard_Real B2,const Standard_Real B3,const Standard_Real C1,const Standard_Real C2,const Standard_Real C3,const Standard_Real D) ; + +//! Evaluate surface equation of the cylinder Cy for the 3D point thePoint +Standard_EXPORT static Standard_Real CylinderEvaluate(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real A1,const Standard_Real A2,const Standard_Real A3,const Standard_Real B1,const Standard_Real B2,const Standard_Real B3,const Standard_Real C1,const Standard_Real C2,const Standard_Real C3,const Standard_Real D) ; + +//! Evaluate surface equation of the cone Co for the 3D point thePoint +Standard_EXPORT static Standard_Real ConeEvaluate(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real A1,const Standard_Real A2,const Standard_Real A3,const Standard_Real B1,const Standard_Real B2,const Standard_Real B3,const Standard_Real C1,const Standard_Real C2,const Standard_Real C3,const Standard_Real D) ; + +//! Evaluate surface equation of the sphere Sp for the 3D point thePoint +Standard_EXPORT static Standard_Real SphereEvaluate(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real A1,const Standard_Real A2,const Standard_Real A3,const Standard_Real B1,const Standard_Real B2,const Standard_Real B3,const Standard_Real C1,const Standard_Real C2,const Standard_Real C3,const Standard_Real D) ; + +//! Evaluate surface equation of the torus To for the 3D point thePoint +Standard_EXPORT static Standard_Real TorusEvaluate(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const TColStd_Array1OfReal& Coef) ; + + +//Standard_EXPORT static Standard_Real EvaluateSurfaceOfRevolution(const GeomAdaptor_Surface& theSurf, const gp_Pnt& thePnt); + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGTOOL.ixx b/src/MCCAD/McCadHeaders/McCadGTOOL.ixx new file mode 100644 index 0000000..b7652e3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGTOOL.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGTOOL.jxx b/src/MCCAD/McCadHeaders/McCadGTOOL.jxx new file mode 100644 index 0000000..ab22543 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGTOOL.jxx @@ -0,0 +1,27 @@ +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _gp_Pln_HeaderFile +#include +#endif +#ifndef _gp_Cone_HeaderFile +#include +#endif +#ifndef _gp_Cylinder_HeaderFile +#include +#endif +#ifndef _gp_Sphere_HeaderFile +#include +#endif +#ifndef _gp_Torus_HeaderFile +#include +#endif +#ifndef _TColStd_Array1OfReal_HeaderFile +#include +#endif +#ifndef _McCadGTOOL_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.hxx new file mode 100644 index 0000000..9f97b35 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.hxx @@ -0,0 +1,193 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_BaseDialog_HeaderFile +#define _McCadGUI_BaseDialog_HeaderFile + +#ifndef _McCadGUI_TypeOfDialog_HeaderFile +#include +#endif +#ifndef _McCadGUI_LevelOfDialog_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +class TCollection_AsciiString; +class Quantity_Color; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +class McCadGUI_BaseDialog { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This is abstract gui base class:
+Standard_EXPORT McCadGUI_BaseDialog(); + + +Standard_EXPORT virtual void SetType(const McCadGUI_TypeOfDialog theType) ; + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadGUI_BaseDialog() +{ + Destroy(); +} + + + +Standard_EXPORT virtual McCadGUI_TypeOfDialog GetType() const; + + +Standard_EXPORT virtual void SetLevel(const McCadGUI_LevelOfDialog theLevel) ; + + +Standard_EXPORT virtual McCadGUI_LevelOfDialog GetLevel() const; + + +Standard_EXPORT virtual void SetText(const TCollection_AsciiString& theText) ; + + +Standard_EXPORT virtual TCollection_AsciiString GetText() const; + + +Standard_EXPORT virtual void Print() ; + + +Standard_EXPORT virtual void Print(const TCollection_AsciiString& theText) ; + + +Standard_EXPORT virtual void Print(const McCadGUI_LevelOfDialog theLevel,const TCollection_AsciiString& theText) ; + + +Standard_EXPORT virtual void SetStream(Standard_OStream& theStream) ; + + +Standard_EXPORT virtual Quantity_Color GetColor() const; + + +Standard_EXPORT virtual void SetColor(const Quantity_Color& theColor) ; + + +Standard_EXPORT virtual TCollection_AsciiString SelectedFile() const; + + +Standard_EXPORT virtual TCollection_AsciiString SelectedFilter() const; + + +Standard_EXPORT virtual void SetSelectedFilter(const TCollection_AsciiString& theMask) ; + + +Standard_EXPORT virtual void SetSelection(const TCollection_AsciiString& theFileName) ; + + +Standard_EXPORT virtual Standard_Integer GetInteger() const; + + +Standard_EXPORT virtual Standard_Real GetReal() const; + + +Standard_EXPORT virtual void SetTotalSteps(const Standard_Integer theTotalSteps) ; + + +Standard_EXPORT virtual void SetProgress(const Standard_Integer theProgressPositin) ; + + +Standard_EXPORT virtual void SetLabelText(const TCollection_AsciiString& theLabelText) ; + + +Standard_EXPORT virtual void SetCancelButtonText(const TCollection_AsciiString& theCancelButtonText) ; + + +Standard_EXPORT virtual void Cancel() ; + + + +//signals: +// void updateProgress(int); //updates Progress relative to total amount of steps +// void setRange(int,int);//define range of steps (0,NumberOfSteps) to update progress + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +McCadGUI_TypeOfDialog myType; +McCadGUI_LevelOfDialog myLevel; +TCollection_AsciiString myText; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.ixx b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.ixx new file mode 100644 index 0000000..83a29f5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.jxx b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.jxx new file mode 100644 index 0000000..c743e5a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialog.jxx @@ -0,0 +1,9 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Quantity_Color_HeaderFile +#include +#endif +#ifndef _McCadGUI_BaseDialog_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_BaseDialogPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialogPtr.hxx new file mode 100644 index 0000000..7808b50 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_BaseDialogPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_BaseDialogPtr_HeaderFile +#define _McCadGUI_BaseDialogPtr_HeaderFile + +class McCadGUI_BaseDialog; + +typedef McCadGUI_BaseDialog* McCadGUI_BaseDialogPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.hxx new file mode 100644 index 0000000..7f42606 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.hxx @@ -0,0 +1,105 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_ColorDialog_HeaderFile +#define _McCadGUI_ColorDialog_HeaderFile + +#ifndef _Quantity_Color_HeaderFile +#include +#endif +#ifndef _McCadGUI_BaseDialog_HeaderFile +#include +#endif +class Quantity_Color; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadGUI_ColorDialog : public McCadGUI_BaseDialog { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! this is a color dialog
+Standard_EXPORT McCadGUI_ColorDialog(); + + +Standard_EXPORT virtual Quantity_Color GetColor() const; + + +Standard_EXPORT virtual void SetColor(const Quantity_Color& theColor) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Quantity_Color myColor; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.ixx b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.ixx new file mode 100644 index 0000000..f7e41a7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.jxx b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.jxx new file mode 100644 index 0000000..d865638 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialog.jxx @@ -0,0 +1,6 @@ +#ifndef _Quantity_Color_HeaderFile +#include +#endif +#ifndef _McCadGUI_ColorDialog_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ColorDialogPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialogPtr.hxx new file mode 100644 index 0000000..b2702eb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ColorDialogPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_ColorDialogPtr_HeaderFile +#define _McCadGUI_ColorDialogPtr_HeaderFile + +class McCadGUI_ColorDialog; + +typedef McCadGUI_ColorDialog* McCadGUI_ColorDialogPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.hxx new file mode 100644 index 0000000..b8e54d3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.hxx @@ -0,0 +1,112 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_FileDialog_HeaderFile +#define _McCadGUI_FileDialog_HeaderFile + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadGUI_BaseDialog_HeaderFile +#include +#endif +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadGUI_FileDialog : public McCadGUI_BaseDialog { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadGUI_FileDialog(); + + +Standard_EXPORT virtual TCollection_AsciiString SelectedFile() const; + + +Standard_EXPORT virtual TCollection_AsciiString SelectedFilter() const; + + +Standard_EXPORT virtual void SetSelectedFilter(const TCollection_AsciiString& theMask) ; + + +Standard_EXPORT virtual void SetSelection(const TCollection_AsciiString& theFileName) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TCollection_AsciiString myFileName; +TCollection_AsciiString myFilter; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.ixx b/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.ixx new file mode 100644 index 0000000..bc6d651 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.jxx b/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.jxx new file mode 100644 index 0000000..64e780d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_FileDialog.jxx @@ -0,0 +1,6 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadGUI_FileDialog_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_FileDialogPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_FileDialogPtr.hxx new file mode 100644 index 0000000..0464d6d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_FileDialogPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_FileDialogPtr_HeaderFile +#define _McCadGUI_FileDialogPtr_HeaderFile + +class McCadGUI_FileDialog; + +typedef McCadGUI_FileDialog* McCadGUI_FileDialogPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.hxx b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.hxx new file mode 100644 index 0000000..4829ef0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_GuiFactory_HeaderFile +#define _McCadGUI_GuiFactory_HeaderFile + +#ifndef _McCadGUI_GuiFactoryPtr_HeaderFile +#include +#endif +#ifndef _McCadGUI_TypeOfDialog_HeaderFile +#include +#endif +#ifndef _McCadGUI_BaseDialogPtr_HeaderFile +#include +#endif + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#include + +class McCadGUI_GuiFactory { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static McCadGUI_GuiFactoryPtr Instance() ; + + +Standard_EXPORT virtual void SetType(const McCadGUI_TypeOfDialog theType) ; + + +Standard_EXPORT virtual McCadGUI_TypeOfDialog GetType() const; + +//! creates a Progress Dialog interface
+Standard_EXPORT virtual McCadGUI_BaseDialogPtr MakeDialog() const; + + + + + +protected: + + // Methods PROTECTED + // + +//! This is abstract gui factory as a singelton.
+Standard_EXPORT McCadGUI_GuiFactory(); + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +static McCadGUI_GuiFactoryPtr myInstance; +McCadGUI_TypeOfDialog myCurrentType; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.ixx b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.ixx new file mode 100644 index 0000000..67a5925 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.jxx b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.jxx new file mode 100644 index 0000000..2ab91ff --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactory.jxx @@ -0,0 +1,3 @@ +#ifndef _McCadGUI_GuiFactory_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_GuiFactoryPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactoryPtr.hxx new file mode 100644 index 0000000..df3962d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_GuiFactoryPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_GuiFactoryPtr_HeaderFile +#define _McCadGUI_GuiFactoryPtr_HeaderFile + +class McCadGUI_GuiFactory; + +typedef McCadGUI_GuiFactory* McCadGUI_GuiFactoryPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.hxx new file mode 100644 index 0000000..4491a46 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.hxx @@ -0,0 +1,106 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_InputDialog_HeaderFile +#define _McCadGUI_InputDialog_HeaderFile + +#ifndef _McCadGUI_BaseDialog_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadGUI_InputDialog : public McCadGUI_BaseDialog { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadGUI_InputDialog(); + + +Standard_EXPORT virtual Standard_Integer GetInteger() const; + + +Standard_EXPORT virtual Standard_Real GetReal() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.ixx b/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.ixx new file mode 100644 index 0000000..58b32bb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.jxx b/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.jxx new file mode 100644 index 0000000..724b3c8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_InputDialog.jxx @@ -0,0 +1,3 @@ +#ifndef _McCadGUI_InputDialog_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_InputDialogPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_InputDialogPtr.hxx new file mode 100644 index 0000000..30f6528 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_InputDialogPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_InputDialogPtr_HeaderFile +#define _McCadGUI_InputDialogPtr_HeaderFile + +class McCadGUI_InputDialog; + +typedef McCadGUI_InputDialog* McCadGUI_InputDialogPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_LevelOfDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_LevelOfDialog.hxx new file mode 100644 index 0000000..209578c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_LevelOfDialog.hxx @@ -0,0 +1,38 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_LevelOfDialog_HeaderFile +#define _McCadGUI_LevelOfDialog_HeaderFile + + +enum McCadGUI_LevelOfDialog { + McCadGUI_Warning_Level, +McCadGUI_Error_Level, +McCadGUI_Information_Level, +McCadGUI_Debug_Level +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_MessageType.hxx b/src/MCCAD/McCadHeaders/McCadGUI_MessageType.hxx new file mode 100644 index 0000000..668b3a3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_MessageType.hxx @@ -0,0 +1,21 @@ +/* + * McCadGUI_MessageType.hxx + * + * Created on: Feb 2, 2010 + * Author: grosse + */ + +#ifndef MCCADGUI_MESSAGETYPE_HXX_ +#define MCCADGUI_MESSAGETYPE_HXX_ + +enum McCadGUI_MessageType +{ + McCadGUI_DefaultMsg, + McCadGUI_WarningMsg, + McCadGUI_ErrorMsg, + McCadGUI_HeadingMsg, + McCadGUI_CoutMsg +}; + + +#endif /* MCCADGUI_MESSAGETYPE_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadGUI_OStreamPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_OStreamPtr.hxx new file mode 100644 index 0000000..f33d0e1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_OStreamPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_OStreamPtr_HeaderFile +#define _McCadGUI_OStreamPtr_HeaderFile + +class Standard_OStream; + +typedef Standard_OStream* McCadGUI_OStreamPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.hxx new file mode 100644 index 0000000..cf89d73 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.hxx @@ -0,0 +1,132 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_ProgressDialog_HeaderFile +#define _McCadGUI_ProgressDialog_HeaderFile + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadGUI_BaseDialog_HeaderFile +#include +#endif +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#include +#include + + +class McCadGUI_ProgressDialog : public McCadGUI_BaseDialog, public Message_ProgressIndicator{ + +// Q_OBJECT + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadGUI_ProgressDialog(QWidget* theParent=NULL); + + +Standard_EXPORT virtual void SetTotalSteps(const Standard_Integer theTotalSteps) ; + + +Standard_EXPORT virtual void SetProgress(const Standard_Integer theProgressPositin) ; + + +Standard_EXPORT virtual void SetLabelText(const TCollection_AsciiString& theLabelText) ; + + +Standard_EXPORT virtual void SetCancelButtonText(const TCollection_AsciiString& theCancelButtonText) ; + + +Standard_EXPORT virtual void Cancel() ; + + +Standard_EXPORT virtual Standard_Boolean Show(Standard_Boolean force = Standard_True) ; + + +Standard_EXPORT virtual Standard_Boolean UserBreak(); + + +//signals: +// void updateProgress(int); + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // +QProgressDialog* myQProgress; + + // Fields PRIVATE + // +TCollection_AsciiString myLableText; +Standard_Integer myTotalSteps; +TCollection_AsciiString myCancelButtonText; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.ixx b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.ixx new file mode 100644 index 0000000..9f5b9a1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.jxx b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.jxx new file mode 100644 index 0000000..9b7e393 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialog.jxx @@ -0,0 +1,6 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadGUI_ProgressDialog_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialogPtr.hxx b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialogPtr.hxx new file mode 100644 index 0000000..c6fcc56 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_ProgressDialogPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_ProgressDialogPtr_HeaderFile +#define _McCadGUI_ProgressDialogPtr_HeaderFile + +class McCadGUI_ProgressDialog; + +typedef McCadGUI_ProgressDialog* McCadGUI_ProgressDialogPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadGUI_TypeOfDialog.hxx b/src/MCCAD/McCadHeaders/McCadGUI_TypeOfDialog.hxx new file mode 100644 index 0000000..187dd1e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadGUI_TypeOfDialog.hxx @@ -0,0 +1,43 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadGUI_TypeOfDialog_HeaderFile +#define _McCadGUI_TypeOfDialog_HeaderFile + + +enum McCadGUI_TypeOfDialog { + McCadGUI_None, +McCadGUI_Base, +McCadGUI_Progress, +McCadGUI_File, +McCadGUI_Input, +McCadGUI_Color, +McCadGUI_Message, +McCadGUI_Error, +McCadGUI_Debug +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadIOHelper_Expander.hxx b/src/MCCAD/McCadHeaders/McCadIOHelper_Expander.hxx new file mode 100644 index 0000000..a086b60 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOHelper_Expander.hxx @@ -0,0 +1,69 @@ +#ifndef _McCadIOHelper_Expander_HeaderFile +#define _McCadIOHelper_Expander_HeaderFile + +#include +#include +#include +#include +#include + +#include +#include + +//! \brief Class to explode an assembly file to several files.
+ +//! The McCadIOHelper_Expander can be used to explode a step file which contains
+//! an assembly where the single solids are not visible.
+//! Example: 'McCad -e Infile.stp' creates the files
+//! ExOutInfile_1.stp
+//! ExOutInfile_2.stp
+//! ExOutInfile_3.stp
+//! ...
+//! where every single file contains one single solid.
+ + +class McCadIOHelper_Expander { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! ctor - returns McCadIOHelper_Expander + McCadIOHelper_Expander(); + +//! ctor - returns McCadIOHelper_Expander
+//! initialization with a HSequenceOfShape
+//! a file name must be specified elsewhere + McCadIOHelper_Expander(const Handle(TopTools_HSequenceOfShape)& theHSeqOfShp); + +//! Explode the assemblies in the HSequenceOfShape and return all single solids
+//! in another HSequenceOfShape + Handle_TopTools_HSequenceOfShape Explode(const Handle(TopTools_HSequenceOfShape)& aHSeqOfShp) ; + +//! Explode the assemblies and return all single solids
+//! in another HSequenceOfShape + Handle_TopTools_HSequenceOfShape Explode() ; + +//! Returns exploded shapes + Handle_TopTools_HSequenceOfShape GetExplodedShapes(); + +private: + + Handle_TopTools_HSequenceOfShape m_shapesToExplode; + Handle_TopTools_HSequenceOfShape m_explodedShapes; +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadIOHelper_InputFileParser.hxx b/src/MCCAD/McCadHeaders/McCadIOHelper_InputFileParser.hxx new file mode 100644 index 0000000..2670a84 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOHelper_InputFileParser.hxx @@ -0,0 +1,66 @@ +#ifndef MCCADIOHELPER_INPUTFILEPARSER_HXX +#define MCCADIOHELPER_INPUTFILEPARSER_HXX + +#include +#include + +#include +#include + + +/* + McCadIOHELPER_InputFileParser reads the parameter file for McCadIOHELPER_VoidGenerator +*/ + +class McCadIOHelper_InputFileParser{ +public: + //std ctor + McCadIOHelper_InputFileParser(); + + // ctor with filename as input + McCadIOHelper_InputFileParser( const TCollection_AsciiString& inputFileName ); + + // parse + bool Parse(); + + // parse input file + bool Parse(const TCollection_AsciiString& inputFileName ); + + // Inline Getters + //////////////////////////////// + + inline McCadIOHelper_VGParameters GetVGParameters() { return m_parameters; } + + // done? + bool IsDone() const { return m_isDone; } + +private: + // methods + void Init(); + + // print missmatch message + void MissmatchMessage(TCollection_AsciiString& keyword, TCollection_AsciiString& parameter); + + // read bounding box from geometry file (stp) and save in in m_parameters.boundingBox + bool ReadBoundingBoxFile() ; + + // read geometry for void generation and save it in m_parameters.inputSolids (McCadDiscDs_Solids) + bool ReadGeometryFiles() ; + + // add all converted files from directory + bool AddDirectory(const TCollection_AsciiString& directory) ; + + // add converted* file + bool AddFile(const TCollection_AsciiString &file); + + // fields + bool m_isDone; + bool m_isFirstFile; + unsigned int m_partieIndex; + TCollection_AsciiString m_directories; + TCollection_AsciiString m_inputFileName; + TCollection_AsciiString m_currentGeometryFileName; + McCadIOHelper_VGParameters m_parameters; +}; + +#endif // MCCADIOHELPER_INPUTFILEPARSER_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOHelper_Merger.hxx b/src/MCCAD/McCadHeaders/McCadIOHelper_Merger.hxx new file mode 100644 index 0000000..0ad3b66 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOHelper_Merger.hxx @@ -0,0 +1,111 @@ +#ifndef _McCadIOHelper_Merger_HeaderFile +#define _McCadIOHelper_Merger_HeaderFile + +#include +#include +#include +#include +#include + +#include +#include + +//! \brief Fuse all step files in one directory in a single file. + +//! Merges all files in a given directory into one single file.
+//! This class is implemented in the fusion call in McCad.
+//! 'McCad -f ./ outfilename.stp' fuses all STEP files in the
+//! working directory into the file outfilename.stp
+ +class McCadIOHelper_Merger { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! ctor +McCadIOHelper_Merger(); + +//! ctor plus path to directory +McCadIOHelper_Merger(const TCollection_AsciiString& thePath); + +//! set to ground state + void Init() ; + +//! define the file filter for the input file + void SetInFilter(const TCollection_AsciiString& theInFilter) ; + +//! define the file filter for the output file + void SetOutFilter(const TCollection_AsciiString& theOutFilter) ; + +//! add a file to be merged + Standard_Boolean AddFile(const TCollection_AsciiString& anotherFile) ; + +//! add a directory that contains files to be merged + Standard_Boolean AddDirectory(const TCollection_AsciiString& thePath) ; + +//! perform merging process + Standard_Boolean Merge() ; + +//! call Merge() and write results into theOutFile + Standard_Boolean MergeToFile(const TCollection_AsciiString& theOutFile) ; + +//! return a HSequenceOfShape containing all shapes which have been added so far. + Handle_TopTools_HSequenceOfShape GetHSeqOfShp() ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_TopTools_HSequenceOfShape myHSeqOfShp; +TCollection_AsciiString myFileName; +TCollection_AsciiString myOutFilter; +TCollection_AsciiString myInFilter; +TCollection_AsciiString myPath; +McCadEXPlug_PluginManagerPtr myPluginManager; +McCadEXPlug_ExchangePluginPtr myImpoExpo; +Standard_Boolean myIsFirstShape; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadIOHelper_VGParameters.hxx b/src/MCCAD/McCadHeaders/McCadIOHelper_VGParameters.hxx new file mode 100644 index 0000000..cb3b733 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOHelper_VGParameters.hxx @@ -0,0 +1,101 @@ +#ifndef MCCADIOHELPER_VGPARAMETERS_HXX +#define MCCADIOHELPER_VGPARAMETERS_HXX + +#include +#include + +#include +#include +#include + +/** This is a container for all neccessary parameters passed to the Void Generation algorithm (VG) + of McCad. The values will be read from a file parser or from UI. +*/ + +struct McCadIOHelper_VGParameters{ + + McCadIOHelper_VGParameters(){ + boundingBox = new TopTools_HSequenceOfShape(); + inputSolids = new McCadDiscDs_HSequenceOfDiscSolid(); + m_listMatSolids = new TopTools_HSequenceOfShape(); + } + + McCadIOHelper_VGParameters(const McCadIOHelper_VGParameters& parameters){ + *this = parameters; + } + + McCadIOHelper_VGParameters& operator=(const McCadIOHelper_VGParameters& parameters){ + if( this != ¶meters ){ + boundingBox = new TopTools_HSequenceOfShape; + inputSolids = new McCadDiscDs_HSequenceOfDiscSolid; + + m_listMatSolids = new TopTools_HSequenceOfShape(); + + writeCollisionFile = parameters.writeCollisionFile; + writeVoxelFile = parameters.writeVoxelFile; + + minInputSolidVolume = parameters.minInputSolidVolume; + minSizeOfDecompositionFace = parameters.minSizeOfDecompositionFace; + minSizeOfRedecompositionFace = parameters.minSizeOfRedecompositionFace; + minVoidVolume = parameters.minVoidVolume; + tolerance = parameters.tolerance; + + initCellNumber = parameters.initCellNumber; + initSurfaceNumber = parameters.initSurfaceNumber; + maxNumberOfPreDecompositionCells = parameters.maxNumberOfPreDecompositionCells; + xResolution = parameters.xResolution; + yResolution = parameters.yResolution; + + maxNumberOfComplementCells = parameters.maxNumberOfComplementCells; + maxSamplePoints = parameters.maxSamplePoints; + minSamplePoints = parameters.minSamplePoints; + + inputFileName = parameters.inputFileName; + materialDensityFileName = parameters.materialDensityFileName; + directories = parameters.directories; + boundingBoxName = parameters.boundingBoxName; + + boundingBox->Append(parameters.boundingBox); + inputSolids->Append(parameters.inputSolids); + + m_listMatSolids->Append(parameters.m_listMatSolids); + + units = parameters.units; + } + + return *this; + } + + bool writeCollisionFile; + bool writeVoxelFile; + + double minInputSolidVolume; + double minSizeOfDecompositionFace; + double minSizeOfRedecompositionFace; + double minVoidVolume; + double tolerance; + + unsigned int initCellNumber; + unsigned int initSurfaceNumber; + unsigned int maxNumberOfPreDecompositionCells; + unsigned int xResolution; + unsigned int yResolution; + + unsigned short maxNumberOfComplementCells; + unsigned short maxSamplePoints; + unsigned short minSamplePoints; + + TCollection_AsciiString inputFileName; + TCollection_AsciiString materialDensityFileName; + TCollection_AsciiString directories; + TCollection_AsciiString boundingBoxName; + + Handle_TopTools_HSequenceOfShape boundingBox; + Handle_McCadDiscDs_HSequenceOfDiscSolid inputSolids; + + Handle_TopTools_HSequenceOfShape m_listMatSolids; // Add by Lei, 13/08/2012 + + McCadCSGGeom_Unit units; +}; + +#endif // MCCADIOHELPER_VGPARAMETERS_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools.hxx b/src/MCCAD/McCadHeaders/McCadIOTools.hxx new file mode 100644 index 0000000..c90a6e5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools.hxx @@ -0,0 +1,14 @@ +#ifndef MCCADIOTOOLS_HXX +#define MCCADIOTOOLS_HXX + +#include +#include + +class McCadIOTools { +public: + static void Export( const TCollection_AsciiString& extension, Handle_McCadCom_CasDocument& document ); + static void Import( const TCollection_AsciiString& extension, Handle_McCadCom_CasDocument& document ); +}; + + +#endif // MCCADIOTOOLS_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ExportBrep.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ExportBrep.hxx new file mode 100644 index 0000000..2a09b51 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ExportBrep.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_EXPORTBREP_HXX +#define MCCADIOTOOLS_EXPORTBREP_HXX + +#include + +class McCadIOTools_ExportBrep : public McCadTool_Task { +public: + McCadIOTools_ExportBrep(); + McCadIOTools_ExportBrep(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // McCadIOTools_ExportBrep_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ExportIges.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ExportIges.hxx new file mode 100644 index 0000000..d06590c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ExportIges.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_EXPORTIGES_HXX +#define MCCADIOTOOLS_EXPORTIGES_HXX + +#include + +class McCadIOTools_ExportIges : public McCadTool_Task { +public: + McCadIOTools_ExportIges(); + McCadIOTools_ExportIges(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_EXPORTIGES_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ExportMcnp.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ExportMcnp.hxx new file mode 100644 index 0000000..a23bda7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ExportMcnp.hxx @@ -0,0 +1,22 @@ +#ifndef MCCADIOTOOLS_EXPORTMCNP_HXX +#define MCCADIOTOOLS_EXPORTMCNP_HXX + +#include + +/*! GUI entrance point for file export into MCNP geometry description +*/ + + +class McCadIOTools_ExportMcnp : public McCadIOTools_MCExportBase { +public: + McCadIOTools_ExportMcnp(); + McCadIOTools_ExportMcnp(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_EXPORTMCNP_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ExportStep.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ExportStep.hxx new file mode 100644 index 0000000..7364bf4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ExportStep.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_EXPORTSTEP_HXX +#define MCCADIOTOOLS_EXPORTSTEP_HXX + +#include + +class McCadIOTools_ExportStep : public McCadTool_Task { +public: + McCadIOTools_ExportStep(); + McCadIOTools_ExportStep(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_EXPORTSTEP_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ExportTripoli.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ExportTripoli.hxx new file mode 100644 index 0000000..a8cf533 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ExportTripoli.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_EXPORTTRIPOLI_HXX +#define MCCADIOTOOLS_EXPORTTRIPOLI_HXX + +#include + +class McCadIOTools_ExportTripoli : public McCadIOTools_MCExportBase { +public: + McCadIOTools_ExportTripoli(); + McCadIOTools_ExportTripoli(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_EXPORTTRIPOLI_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ImportBrep.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ImportBrep.hxx new file mode 100644 index 0000000..789bfd7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ImportBrep.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_IMPORTBREP_HXX +#define MCCADIOTOOLS_IMPORTBREP_HXX + +#include + +class McCadIOTools_ImportBrep : public McCadTool_Task { +public: + McCadIOTools_ImportBrep(); + McCadIOTools_ImportBrep(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_IMPORTBREP_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ImportIges.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ImportIges.hxx new file mode 100644 index 0000000..531d0ed --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ImportIges.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_IMPORTIGES_HXX +#define MCCADIOTOOLS_IMPORTIGES_HXX + +#include + +class McCadIOTools_ImportIges : public McCadTool_Task { +public: + McCadIOTools_ImportIges(); + McCadIOTools_ImportIges(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_IMPORTIGES_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ImportMcnp.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ImportMcnp.hxx new file mode 100644 index 0000000..ae9042f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ImportMcnp.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_IMPORTMCNP_HXX +#define MCCADIOTOOLS_IMPORTMCNP_HXX + +#include + +class McCadIOTools_ImportMcnp : public McCadTool_Task { +public: + McCadIOTools_ImportMcnp(); + McCadIOTools_ImportMcnp(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_IMPORTMCNP_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_ImportStep.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_ImportStep.hxx new file mode 100644 index 0000000..6d5d76a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_ImportStep.hxx @@ -0,0 +1,18 @@ +#ifndef MCCADIOTOOLS_IMPORTSTEP_HXX +#define MCCADIOTOOLS_IMPORTSTEP_HXX + +#include + +class McCadIOTools_ImportStep : public McCadTool_Task { +public: + McCadIOTools_ImportStep(); + McCadIOTools_ImportStep(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +}; + +#endif // MCCADIOTOOLS_IMPORTSTEP_HXX diff --git a/src/MCCAD/McCadHeaders/McCadIOTools_MCExportBase.hxx b/src/MCCAD/McCadHeaders/McCadIOTools_MCExportBase.hxx new file mode 100644 index 0000000..5393d32 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadIOTools_MCExportBase.hxx @@ -0,0 +1,35 @@ +#ifndef MCCADIOTOOLS_MCEXPORTBASE_HXX +#define MCCADIOTOOLS_MCEXPORTBASE_HXX + +#include + +#include +#include +#include +#include + +/*! Base class for all export tools for Monte Carlo Codes + This class manages the decomposition and the generation + of void space from the GUI level. +*/ + +class McCadIOTools_MCExportBase : public McCadTool_Task { +public: + McCadIOTools_MCExportBase(); + McCadIOTools_MCExportBase(const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState); + + void Execute(); +protected: + void PrepareExport(); + + Handle_McCadDiscDs_HSequenceOfDiscSolid m_voxelizedOutputGeometry; + McCadIOHelper_VGParameters m_parameters; + McCadMDReader_Reader m_mdReader; +}; + +#endif // MCCADIOTOOLS_MCEXPORTBASE_HXX + diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx new file mode 100644 index 0000000..1226ab1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString.hxx @@ -0,0 +1,116 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_HeaderFile +#define _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class TCollection_AsciiString; +class McCadMDReader_MapAsciiStringHasher; +class McCadMDReader_DataMapOfAsciiStringAsciiString; +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString(); + + +Standard_EXPORT McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString(const McCadMDReader_DataMapOfAsciiStringAsciiString& aMap); + + +Standard_EXPORT void Initialize(const McCadMDReader_DataMapOfAsciiStringAsciiString& aMap) ; + + +Standard_EXPORT const TCollection_AsciiString& Key() const; + + +Standard_EXPORT const TCollection_AsciiString& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal.hxx new file mode 100644 index 0000000..bb376be --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_HeaderFile +#define _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class TCollection_AsciiString; +class McCadMDReader_MapAsciiStringHasher; +class McCadMDReader_DataMapOfAsciiStringReal; +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal(); + + +Standard_EXPORT McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal(const McCadMDReader_DataMapOfAsciiStringReal& aMap); + + +Standard_EXPORT void Initialize(const McCadMDReader_DataMapOfAsciiStringReal& aMap) ; + + +Standard_EXPORT const TCollection_AsciiString& Key() const; + + +Standard_EXPORT const Standard_Real& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString.hxx new file mode 100644 index 0000000..0e7103a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString.hxx @@ -0,0 +1,117 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_HeaderFile +#define _McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class TDF_Label; +class TCollection_AsciiString; +class TDF_LabelMapHasher; +class McCadMDReader_DataMapOfLabelAsciiString; +class McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString(); + + +Standard_EXPORT McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString(const McCadMDReader_DataMapOfLabelAsciiString& aMap); + + +Standard_EXPORT void Initialize(const McCadMDReader_DataMapOfLabelAsciiString& aMap) ; + + +Standard_EXPORT const TDF_Label& Key() const; + + +Standard_EXPORT const TCollection_AsciiString& Value() const; + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString.hxx new file mode 100644 index 0000000..9e13ebd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString.hxx @@ -0,0 +1,133 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#define _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class TCollection_AsciiString; +class McCadMDReader_MapAsciiStringHasher; +class McCadMDReader_DataMapOfAsciiStringAsciiString; +class McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString; + + + +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString(const TCollection_AsciiString& K,const TCollection_AsciiString& I,const TCollection_MapNodePtr& n); + + TCollection_AsciiString& Key() const; + + TCollection_AsciiString& Value() const; +//Standard_EXPORT ~McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString(); + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TCollection_AsciiString myKey; +TCollection_AsciiString myValue; + + +}; + +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringAsciiString +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal.hxx new file mode 100644 index 0000000..66fa878 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#define _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class TCollection_AsciiString; +class McCadMDReader_MapAsciiStringHasher; +class McCadMDReader_DataMapOfAsciiStringReal; +class McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal; + + + +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal(const TCollection_AsciiString& K,const Standard_Real& I,const TCollection_MapNodePtr& n); + + TCollection_AsciiString& Key() const; + + Standard_Real& Value() const; +//Standard_EXPORT ~McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal(); + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TCollection_AsciiString myKey; +Standard_Real myValue; + + +}; + +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem Standard_Real +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringReal +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString.hxx new file mode 100644 index 0000000..dabf93d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString.hxx @@ -0,0 +1,137 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#define _McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif + +#ifndef _TDF_Label_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class TDF_Label; +class TCollection_AsciiString; +class TDF_LabelMapHasher; +class McCadMDReader_DataMapOfLabelAsciiString; +class McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString; + + + +class McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString(const TDF_Label& K,const TCollection_AsciiString& I,const TCollection_MapNodePtr& n); + + TDF_Label& Key() const; + + TCollection_AsciiString& Value() const; +//Standard_EXPORT ~McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString(); + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TDF_Label myKey; +TCollection_AsciiString myValue; + + +}; + +#define TheKey TDF_Label +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher TDF_LabelMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfLabelAsciiString +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfAsciiStringAsciiString.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfAsciiStringAsciiString.hxx new file mode 100644 index 0000000..b7428fd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfAsciiStringAsciiString.hxx @@ -0,0 +1,158 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapOfAsciiStringAsciiString_HeaderFile +#define _McCadMDReader_DataMapOfAsciiStringAsciiString_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class TCollection_AsciiString; +class McCadMDReader_MapAsciiStringHasher; +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString; +class McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_DataMapOfAsciiStringAsciiString : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_DataMapOfAsciiStringAsciiString(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadMDReader_DataMapOfAsciiStringAsciiString& Assign(const McCadMDReader_DataMapOfAsciiStringAsciiString& Other) ; + McCadMDReader_DataMapOfAsciiStringAsciiString& operator =(const McCadMDReader_DataMapOfAsciiStringAsciiString& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadMDReader_DataMapOfAsciiStringAsciiString() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const TCollection_AsciiString& K,const TCollection_AsciiString& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const TCollection_AsciiString& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const TCollection_AsciiString& K) ; + + +Standard_EXPORT const TCollection_AsciiString& Find(const TCollection_AsciiString& K) const; + const TCollection_AsciiString& operator()(const TCollection_AsciiString& K) const +{ + return Find(K); +} + + + +Standard_EXPORT TCollection_AsciiString& ChangeFind(const TCollection_AsciiString& K) ; + TCollection_AsciiString& operator()(const TCollection_AsciiString& K) +{ + return ChangeFind(K); +} + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMDReader_DataMapOfAsciiStringAsciiString(const McCadMDReader_DataMapOfAsciiStringAsciiString& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfAsciiStringReal.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfAsciiStringReal.hxx new file mode 100644 index 0000000..71104ca --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfAsciiStringReal.hxx @@ -0,0 +1,161 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapOfAsciiStringReal_HeaderFile +#define _McCadMDReader_DataMapOfAsciiStringReal_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class TCollection_AsciiString; +class McCadMDReader_MapAsciiStringHasher; +class McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal; +class McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_DataMapOfAsciiStringReal : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_DataMapOfAsciiStringReal(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadMDReader_DataMapOfAsciiStringReal& Assign(const McCadMDReader_DataMapOfAsciiStringReal& Other) ; + McCadMDReader_DataMapOfAsciiStringReal& operator =(const McCadMDReader_DataMapOfAsciiStringReal& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadMDReader_DataMapOfAsciiStringReal() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const TCollection_AsciiString& K,const Standard_Real& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const TCollection_AsciiString& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const TCollection_AsciiString& K) ; + + +Standard_EXPORT const Standard_Real& Find(const TCollection_AsciiString& K) const; + const Standard_Real& operator()(const TCollection_AsciiString& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Standard_Real& ChangeFind(const TCollection_AsciiString& K) ; + Standard_Real& operator()(const TCollection_AsciiString& K) +{ + return ChangeFind(K); +} + + + +void* Find1(const TCollection_AsciiString& K) const; +void* ChangeFind1(const TCollection_AsciiString& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMDReader_DataMapOfAsciiStringReal(const McCadMDReader_DataMapOfAsciiStringReal& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfLabelAsciiString.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfLabelAsciiString.hxx new file mode 100644 index 0000000..829ca44 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_DataMapOfLabelAsciiString.hxx @@ -0,0 +1,159 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_DataMapOfLabelAsciiString_HeaderFile +#define _McCadMDReader_DataMapOfLabelAsciiString_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class TDF_Label; +class TCollection_AsciiString; +class TDF_LabelMapHasher; +class McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString; +class McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_DataMapOfLabelAsciiString : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_DataMapOfLabelAsciiString(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadMDReader_DataMapOfLabelAsciiString& Assign(const McCadMDReader_DataMapOfLabelAsciiString& Other) ; + McCadMDReader_DataMapOfLabelAsciiString& operator =(const McCadMDReader_DataMapOfLabelAsciiString& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadMDReader_DataMapOfLabelAsciiString() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const TDF_Label& K,const TCollection_AsciiString& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const TDF_Label& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const TDF_Label& K) ; + + +Standard_EXPORT const TCollection_AsciiString& Find(const TDF_Label& K) const; + const TCollection_AsciiString& operator()(const TDF_Label& K) const +{ + return Find(K); +} + + + +Standard_EXPORT TCollection_AsciiString& ChangeFind(const TDF_Label& K) ; + TCollection_AsciiString& operator()(const TDF_Label& K) +{ + return ChangeFind(K); +} + + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMDReader_DataMapOfLabelAsciiString(const McCadMDReader_DataMapOfLabelAsciiString& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_MapAsciiStringHasher.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_MapAsciiStringHasher.hxx new file mode 100644 index 0000000..e75de39 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_MapAsciiStringHasher.hxx @@ -0,0 +1,101 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#define _McCadMDReader_MapAsciiStringHasher_HeaderFile + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMDReader_MapAsciiStringHasher { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static Standard_Integer HashCode(const TCollection_AsciiString& K,const Standard_Integer Upper) ; + + +Standard_EXPORT static Standard_Boolean IsEqual(const TCollection_AsciiString& K1,const TCollection_AsciiString& K2) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_Reader.hxx b/src/MCCAD/McCadHeaders/McCadMDReader_Reader.hxx new file mode 100644 index 0000000..1cd6ea0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_Reader.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMDReader_Reader_HeaderFile +#define _McCadMDReader_Reader_HeaderFile + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfAsciiStringReal_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#include + +#include +#include +#include + +//! \brief Material Density Reader for MCNP + +//! Reads a Material Density List and assigns material information to MCNP cells. + +class McCadMDReader_Reader { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMDReader_Reader() ; + + +Standard_EXPORT McCadMDReader_Reader(const Handle_TDocStd_Document& theTDoc) ; + + +Standard_EXPORT Standard_Boolean ReadFile(const TCollection_AsciiString& theFileName) ; + + +Standard_EXPORT Standard_Real GetDensity(const TCollection_AsciiString& theName) ; + + +Standard_EXPORT Standard_Integer GetMaterial(const TCollection_AsciiString& theName) ; + + +Standard_EXPORT void SetDensity(const TCollection_AsciiString& theName, const Standard_Real& theDens) ; + + +Standard_EXPORT void SetMaterial(const TCollection_AsciiString& theName, const Standard_Integer& theMat) ; + + +Standard_EXPORT void SetMCard(const Standard_Integer& theMat, const TCollection_AsciiString& theMCard) ; + + +Standard_EXPORT void GetMCard(const Standard_Integer& theMat, TCollection_AsciiString& theMCard) ; + + +Standard_EXPORT Standard_Boolean HasMCard() ; + + +Standard_EXPORT void ClearMCard() ; + + +Standard_EXPORT void ReadTDoc(const Handle_TDocStd_Document& theTDoc) ; + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT TCollection_AsciiString GetFileName() ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetMCardNumbers(); + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + +Standard_EXPORT Standard_Integer ExtractMCardNumber(const TCollection_AsciiString& theMCard) ; + + // Fields PRIVATE + // +TCollection_AsciiString myFileName; +McCadMDReader_DataMapOfAsciiStringReal myDensMap; +TColStd_DataMapOfAsciiStringInteger myMatMap; +MeshVS_DataMapOfIntegerAsciiString myMCardMap; +Standard_Boolean myHasMCard; +Handle_TColStd_HSequenceOfInteger myMCardNumbers; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_Reader.ixx b/src/MCCAD/McCadHeaders/McCadMDReader_Reader.ixx new file mode 100644 index 0000000..eeb3516 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_Reader.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMDReader_Reader.jxx b/src/MCCAD/McCadHeaders/McCadMDReader_Reader.jxx new file mode 100644 index 0000000..51d89ab --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMDReader_Reader.jxx @@ -0,0 +1,6 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_Reader_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead.hxx b/src/MCCAD/McCadHeaders/McCadMcRead.hxx new file mode 100644 index 0000000..0be1266 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead.hxx @@ -0,0 +1,171 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_HeaderFile +#define _McCadMcRead_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfReal_HeaderFile +#include +#endif +class TCollection_AsciiString; +class TColStd_HSequenceOfReal; +class McCadMcRead_Cell; +class McCadMcRead_CellBuilder; +class McCadMcRead_TrsfBuilder; +class McCadMcRead_SurfaceFactory; +class McCadMcRead_Fill; +class McCadMcRead_FillBuilder; +class McCadMcRead_Reader; +class McCadMcRead_SequenceOfCell; +class McCadMcRead_HSequenceOfCell; +class McCadMcRead_DataMapOfIntegerCell; +class McCadMcRead_SequenceOfCellPtr; +class McCadMcRead_HSequenceOfCellPtr; +class McCadMcRead_SequenceOfFill; +class McCadMcRead_HSequenceOfFill; +class McCadMcRead_DataMapOfIntegerFill; +class McCadMcRead_SequenceNodeOfSequenceOfCell; +class McCadMcRead_DataMapNodeOfDataMapOfIntegerCell; +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell; +class McCadMcRead_SequenceNodeOfSequenceOfCellPtr; +class McCadMcRead_SequenceNodeOfSequenceOfFill; +class McCadMcRead_DataMapNodeOfDataMapOfIntegerFill; +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief useful tools for McCadMcReader + +class McCadMcRead { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static Standard_Boolean ExtractInt(TCollection_AsciiString& sIn,Standard_Integer& nVal) ; + + +Standard_EXPORT static Standard_Boolean ExtractInt(TCollection_AsciiString& sIn,Standard_Integer& nStart,Standard_Integer& nVal) ; + + +Standard_EXPORT static Standard_Boolean ExtractReal(TCollection_AsciiString& sIn,Standard_Real& nVal) ; + + +Standard_EXPORT static Standard_Boolean ExtractParenthesisPair(TCollection_AsciiString& sIn,Standard_Integer& nStart,TCollection_AsciiString& sOut) ; + + +Standard_EXPORT static Standard_Boolean ExtractFloat(TCollection_AsciiString& sIn,Standard_Integer& nStart,Standard_Real& fVal) ; + + +Standard_EXPORT static Standard_Boolean ExtractFloat(TCollection_AsciiString& sIn,Standard_Integer& nStart,Handle(TColStd_HSequenceOfReal)& fValVec) ; + + +Standard_EXPORT static void TrimLeft(TCollection_AsciiString& sIn) ; + + +Standard_EXPORT static void TrimRight(TCollection_AsciiString& sIn) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + +friend class McCadMcRead_Cell; +friend class McCadMcRead_CellBuilder; +friend class McCadMcRead_TrsfBuilder; +friend class McCadMcRead_SurfaceFactory; +friend class McCadMcRead_Fill; +friend class McCadMcRead_FillBuilder; +friend class McCadMcRead_Reader; +friend class McCadMcRead_SequenceOfCell; +friend class McCadMcRead_HSequenceOfCell; +friend class McCadMcRead_DataMapOfIntegerCell; +friend class McCadMcRead_SequenceOfCellPtr; +friend class McCadMcRead_HSequenceOfCellPtr; +friend class McCadMcRead_SequenceOfFill; +friend class McCadMcRead_HSequenceOfFill; +friend class McCadMcRead_DataMapOfIntegerFill; +friend class McCadMcRead_SequenceNodeOfSequenceOfCell; +friend class McCadMcRead_DataMapNodeOfDataMapOfIntegerCell; +friend class McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell; +friend class McCadMcRead_SequenceNodeOfSequenceOfCellPtr; +friend class McCadMcRead_SequenceNodeOfSequenceOfFill; +friend class McCadMcRead_DataMapNodeOfDataMapOfIntegerFill; +friend class McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead.ixx b/src/MCCAD/McCadHeaders/McCadMcRead.ixx new file mode 100644 index 0000000..cc23235 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead.jxx b/src/MCCAD/McCadHeaders/McCadMcRead.jxx new file mode 100644 index 0000000..b567c65 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead.jxx @@ -0,0 +1,9 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfReal_HeaderFile +#include +#endif +#ifndef _McCadMcRead_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Cell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_Cell.hxx new file mode 100644 index 0000000..92e7aeb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Cell.hxx @@ -0,0 +1,292 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_Cell_HeaderFile +#define _McCadMcRead_Cell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_HSequenceOfFill_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _McCadMcRead_CellPtr_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfInteger_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_HSequenceOfCellPtr_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Cell_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +class McCadMcRead_Fill; +class McCadMcRead_HSequenceOfFill; +class TColgp_HSequenceOfPnt; +class TColStd_HSequenceOfInteger; +class McCadMcRead_HSequenceOfCellPtr; +class TColStd_HSequenceOfAsciiString; +class McCadCSGGeom_Transformation; + +//! \brief Cell description of MCNP file how it's read + +class McCadMcRead_Cell : public McCadCSGGeom_Cell { + +public: + // Methods PUBLIC + // + +//! Creates an MCNP Cell with MCNP syntax.
+//!
+//!
+Standard_EXPORT McCadMcRead_Cell(); + + +Standard_EXPORT McCadMcRead_Cell(const Standard_Integer theCNum,const Standard_Integer theMNum,const Standard_Real theDensity); + + +Standard_EXPORT void SetPseudo(const Standard_Boolean thePseudo) ; + + +Standard_EXPORT Standard_Boolean IsPseudo() const; + + +Standard_EXPORT void SetHaveTRCL(const Standard_Boolean theIndic) ; + + +Standard_EXPORT Standard_Boolean IsTRCL() const; + + +Standard_EXPORT void SetTRCLNumber(const Standard_Integer theCount) ; + + +Standard_EXPORT Standard_Integer GetTRCLNumber() const; + + +Standard_EXPORT void SetHaveLat(const Standard_Boolean theIndic) ; + + +Standard_EXPORT void SetLat(const Standard_Integer theNum) ; + + +Standard_EXPORT Standard_Integer GetLatNum() const; + + +Standard_EXPORT Standard_Boolean IsLat() const; + + +Standard_EXPORT void SetHaveLike(const Standard_Boolean theIndic) ; + + +Standard_EXPORT Standard_Integer GetLikeNum() const; + + +Standard_EXPORT McCadMcRead_CellPtr GetLikePtr() const; + + +Standard_EXPORT void SetLikeNum(const Standard_Integer theIndex) ; + + +Standard_EXPORT void SetLikePtr(const McCadMcRead_CellPtr& thePtr) ; + + +Standard_EXPORT Standard_Boolean IsLike() const; + + +Standard_EXPORT void SetHaveU(const Standard_Boolean theIn) ; + + +Standard_EXPORT void SetUNum(const Standard_Integer theIndex) ; + + +Standard_EXPORT Standard_Integer GetUNum() const; + + +Standard_EXPORT void SetPseudoNum(const Standard_Integer theIndex) ; + + +Standard_EXPORT Standard_Integer GetPseudoNum() const; + + +Standard_EXPORT void SetCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG, bool updatePostFixCSG=true) ; + + +Standard_EXPORT Standard_Boolean IsU() const; + + +Standard_EXPORT void SetHaveFill(const Standard_Boolean theIn) ; + + +Standard_EXPORT void SetFill(const Handle(McCadMcRead_Fill)& theFiller) ; + + +Standard_EXPORT Standard_Boolean IsFill() const; + + +Standard_EXPORT void SetHaveMacro(const Standard_Boolean theIn) ; + + +Standard_EXPORT Standard_Boolean HaveMacro() const; + + +Standard_EXPORT void SetMacroIndex(const Handle(TColStd_HSequenceOfInteger)& theInSeq) ; + + +Standard_EXPORT void SetMacroPtrs(const Handle(McCadMcRead_HSequenceOfCellPtr)& theInPtrSeq) ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfInteger GetMacroIndex() const; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfCellPtr GetMacroPtrs() const; + + +Standard_EXPORT void SetInFixCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG) ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetInFixCSG() const; + + +Standard_EXPORT void SetPostFixCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG) ; + + +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetPostFixCSG(); + + +Standard_EXPORT Handle_McCadMcRead_Fill GetFill() const; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfFill GetFillSeq() const; + + +Standard_EXPORT void SetFillSeq(const Handle(McCadMcRead_HSequenceOfFill)& theFillerSeq) ; + + +Standard_EXPORT Handle_TColgp_HSequenceOfPnt GetFillPlaceSeq() const; + + +Standard_EXPORT void SetFillPlaceSeq(const Handle(TColgp_HSequenceOfPnt)& thePlaceSeq) ; + + +Standard_EXPORT void SetTrsf(const Handle(McCadCSGGeom_Transformation)& theTrsf) ; + + +Standard_EXPORT Handle_McCadCSGGeom_Transformation GetTrsf() const; + + + + +Standard_EXPORT void SetInfiniteLattice(); +Standard_EXPORT Standard_Boolean IsInfiniteLattice(); +Standard_EXPORT void SetOuterCSG(Handle_TColStd_HSequenceOfAsciiString& csg); +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetOuterCSG(); +Standard_EXPORT void SetLatFillBoundary(Handle_TColStd_HSequenceOfAsciiString& csg); +Standard_EXPORT Handle_TColStd_HSequenceOfAsciiString GetLatFillBoundary(); + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Boolean myIsPseudo; +Standard_Integer myTRCLNumber; +Standard_Boolean myHaveLat; +Standard_Boolean myHaveLike; +Standard_Boolean myHaveU; +Standard_Boolean myHaveFill; +Standard_Boolean myHaveTRCL; +Standard_Boolean myHaveMacro; +Standard_Integer myLat; +Standard_Integer myLike; +Standard_Integer myU; +Standard_Integer myPseudoNum; +Handle_McCadMcRead_Fill myFill; +Handle_McCadMcRead_HSequenceOfFill myFillSeq; +Handle_TColgp_HSequenceOfPnt myFillPlaceSeq; +Standard_Integer myLikeNum; +McCadMcRead_CellPtr myLikePtr; +Handle_TColStd_HSequenceOfInteger myCompsNum; +Handle_McCadMcRead_HSequenceOfCellPtr myCompPtrs; +Handle_TColStd_HSequenceOfAsciiString myInFixCSG; +Handle_TColStd_HSequenceOfAsciiString myPostFixCSG; +Handle_TColStd_HSequenceOfAsciiString myOuterCSG; +Handle_TColStd_HSequenceOfAsciiString myLatFillBoundary; +Handle_McCadCSGGeom_Transformation myTrsf; +Standard_Boolean myIsInfiniteLattice; +bool myCSGHasChanged; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Cell.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_Cell.ixx new file mode 100644 index 0000000..737c436 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Cell.ixx @@ -0,0 +1,75 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadMcRead_Cell::~McCadMcRead_Cell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_Cell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadCSGGeom_Cell); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_Cell", + sizeof(McCadMcRead_Cell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_Cell) Handle(McCadMcRead_Cell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_Cell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_Cell))) { + _anOtherObject = Handle(McCadMcRead_Cell)((Handle(McCadMcRead_Cell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_Cell::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_Cell) ; +} +//Standard_Boolean McCadMcRead_Cell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_Cell) == AType || McCadCSGGeom_Cell::IsKind(AType)); +//} +//Handle_McCadMcRead_Cell::~Handle_McCadMcRead_Cell() {} + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Cell.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_Cell.jxx new file mode 100644 index 0000000..64db57c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Cell.jxx @@ -0,0 +1,24 @@ +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_HSequenceOfFill_HeaderFile +#include +#endif +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfInteger_HeaderFile +#include +#endif +#ifndef _McCadMcRead_HSequenceOfCellPtr_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.hxx new file mode 100644 index 0000000..b709e36 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_CellBuilder_HeaderFile +#define _McCadMcRead_CellBuilder_HeaderFile + +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadMcRead_Cell; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Builds a McCadMcRead_Cell from MCNP input description + +class McCadMcRead_CellBuilder { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Creates an MCNP Cell with MCNP syntax.
+//!
+//!
+Standard_EXPORT McCadMcRead_CellBuilder(); + + +Standard_EXPORT void BuildCell(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean Parse(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT Handle_McCadMcRead_Cell GetCell() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Standard_Boolean ExtractNo(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractMat(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractTRCL(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractBOOLEXPR(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractLIKE(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractFill(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractLatFill(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractUCard(const TCollection_AsciiString& sDesc) ; + + + // Fields PRIVATE + // +Handle_McCadMcRead_Cell myCell; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.ixx new file mode 100644 index 0000000..3b0f5f8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.jxx new file mode 100644 index 0000000..b77af14 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_CellBuilder.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMcRead_CellBuilder_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_CellPtr.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_CellPtr.hxx new file mode 100644 index 0000000..12161ca --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_CellPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_CellPtr_HeaderFile +#define _McCadMcRead_CellPtr_HeaderFile + +class McCadMcRead_Cell; + +typedef McCadMcRead_Cell* McCadMcRead_CellPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell.hxx new file mode 100644 index 0000000..212d727 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell.hxx @@ -0,0 +1,121 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile +#define _McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadMcRead_Cell; +class TColStd_MapIntegerHasher; +class McCadMcRead_DataMapOfIntegerCell; +class McCadMcRead_DataMapNodeOfDataMapOfIntegerCell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell(); + + +Standard_EXPORT McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell(const McCadMcRead_DataMapOfIntegerCell& aMap); + + +Standard_EXPORT void Initialize(const McCadMcRead_DataMapOfIntegerCell& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadMcRead_Cell& Value() const; + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill.hxx new file mode 100644 index 0000000..4d32124 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill.hxx @@ -0,0 +1,121 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_HeaderFile +#define _McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadMcRead_Fill; +class TColStd_MapIntegerHasher; +class McCadMcRead_DataMapOfIntegerFill; +class McCadMcRead_DataMapNodeOfDataMapOfIntegerFill; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill(); + + +Standard_EXPORT McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill(const McCadMcRead_DataMapOfIntegerFill& aMap); + + +Standard_EXPORT void Initialize(const McCadMcRead_DataMapOfIntegerFill& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadMcRead_Fill& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell.hxx new file mode 100644 index 0000000..47782da --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#define _McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadMcRead_Cell; +class TColStd_MapIntegerHasher; +class McCadMcRead_DataMapOfIntegerCell; +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell; + + + +class McCadMcRead_DataMapNodeOfDataMapOfIntegerCell : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadMcRead_DataMapNodeOfDataMapOfIntegerCell(const Standard_Integer& K,const Handle(McCadMcRead_Cell)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadMcRead_Cell& Value() const; +//Standard_EXPORT ~McCadMcRead_DataMapNodeOfDataMapOfIntegerCell(); + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadMcRead_Cell myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerCell +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill.hxx new file mode 100644 index 0000000..49c5ade --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#define _McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadMcRead_Fill; +class TColStd_MapIntegerHasher; +class McCadMcRead_DataMapOfIntegerFill; +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill; + + + +class McCadMcRead_DataMapNodeOfDataMapOfIntegerFill : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadMcRead_DataMapNodeOfDataMapOfIntegerFill(const Standard_Integer& K,const Handle(McCadMcRead_Fill)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadMcRead_Fill& Value() const; +//Standard_EXPORT ~McCadMcRead_DataMapNodeOfDataMapOfIntegerFill(); + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadMcRead_Fill myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Fill +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerFill +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_DataMapOfIntegerCell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapOfIntegerCell.hxx new file mode 100644 index 0000000..2301c54 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapOfIntegerCell.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_DataMapOfIntegerCell_HeaderFile +#define _McCadMcRead_DataMapOfIntegerCell_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadMcRead_Cell; +class TColStd_MapIntegerHasher; +class McCadMcRead_DataMapNodeOfDataMapOfIntegerCell; +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_DataMapOfIntegerCell : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_DataMapOfIntegerCell(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadMcRead_DataMapOfIntegerCell& Assign(const McCadMcRead_DataMapOfIntegerCell& Other) ; + McCadMcRead_DataMapOfIntegerCell& operator =(const McCadMcRead_DataMapOfIntegerCell& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadMcRead_DataMapOfIntegerCell() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadMcRead_Cell)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadMcRead_Cell& Find(const Standard_Integer& K) const; + const Handle_McCadMcRead_Cell& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadMcRead_Cell& ChangeFind(const Standard_Integer& K) ; + Handle_McCadMcRead_Cell& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMcRead_DataMapOfIntegerCell(const McCadMcRead_DataMapOfIntegerCell& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_DataMapOfIntegerFill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapOfIntegerFill.hxx new file mode 100644 index 0000000..51b6ac5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_DataMapOfIntegerFill.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_DataMapOfIntegerFill_HeaderFile +#define _McCadMcRead_DataMapOfIntegerFill_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadMcRead_Fill; +class TColStd_MapIntegerHasher; +class McCadMcRead_DataMapNodeOfDataMapOfIntegerFill; +class McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_DataMapOfIntegerFill : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_DataMapOfIntegerFill(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadMcRead_DataMapOfIntegerFill& Assign(const McCadMcRead_DataMapOfIntegerFill& Other) ; + McCadMcRead_DataMapOfIntegerFill& operator =(const McCadMcRead_DataMapOfIntegerFill& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadMcRead_DataMapOfIntegerFill() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadMcRead_Fill)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadMcRead_Fill& Find(const Standard_Integer& K) const; + const Handle_McCadMcRead_Fill& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadMcRead_Fill& ChangeFind(const Standard_Integer& K) ; + Handle_McCadMcRead_Fill& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMcRead_DataMapOfIntegerFill(const McCadMcRead_DataMapOfIntegerFill& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Fill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_Fill.hxx new file mode 100644 index 0000000..194b84d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Fill.hxx @@ -0,0 +1,128 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_Fill_HeaderFile +#define _McCadMcRead_Fill_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +class McCadCSGGeom_Transformation; + +//! \brief MCNP fill card + +//! Creates an MCNP Fill Card with MCNP syntax.
+//!
+//!
+ +class McCadMcRead_Fill : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +Standard_EXPORT McCadMcRead_Fill(); + + +Standard_EXPORT McCadMcRead_Fill(const Standard_Integer theNum); + + +Standard_EXPORT void SetFillNum(const Standard_Integer theNum) ; + + +Standard_EXPORT Standard_Integer GetFillNum() const; + + +Standard_EXPORT void SetTrsfMatNum(const Standard_Integer theNum) ; + + +Standard_EXPORT Standard_Integer GetTrsfMatNum() const; + + +Standard_EXPORT void SetTrsfMatTyp(const Standard_Integer theNum) ; + + +Standard_EXPORT Standard_Integer GetTrsfMatTyp() const; + + +Standard_EXPORT void SetTrsfMat(const Handle(McCadCSGGeom_Transformation)& theTrsf) ; + + +Standard_EXPORT Handle_McCadCSGGeom_Transformation GetTrsfMat() const; +//Standard_EXPORT ~McCadMcRead_Fill(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myFillNum; +Standard_Integer myTrsfMatNum; +Handle_McCadCSGGeom_Transformation myTrsf; +Standard_Integer myTrsfMatType; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Fill.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_Fill.ixx new file mode 100644 index 0000000..5f4baf5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Fill.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadMcRead_Fill::~McCadMcRead_Fill() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_Fill_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_Fill", + sizeof(McCadMcRead_Fill), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_Fill) Handle(McCadMcRead_Fill)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_Fill) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_Fill))) { + _anOtherObject = Handle(McCadMcRead_Fill)((Handle(McCadMcRead_Fill)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_Fill::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_Fill) ; +} +//Standard_Boolean McCadMcRead_Fill::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_Fill) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadMcRead_Fill::~Handle_McCadMcRead_Fill() {} + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Fill.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_Fill.jxx new file mode 100644 index 0000000..5b8c98b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Fill.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.hxx new file mode 100644 index 0000000..813b602 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.hxx @@ -0,0 +1,128 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_FillBuilder_HeaderFile +#define _McCadMcRead_FillBuilder_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +class McCadMcRead_Fill; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Make MCNP Fill Card for MCNP reader + +//! Builds Fill Card with MCNP syntax.
+//!
+//!
+ +class McCadMcRead_FillBuilder { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_FillBuilder(); + + +Standard_EXPORT Standard_Boolean Build(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT Handle_McCadMcRead_Fill GetFiller() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Standard_Boolean ExtractPrefix(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ExtractEntry(const TCollection_AsciiString& sDesc) ; + + + // Fields PRIVATE + // +Standard_Boolean myIsDone; +Handle_McCadMcRead_Fill myFill; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.ixx new file mode 100644 index 0000000..fb07dd3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.jxx new file mode 100644 index 0000000..8ae7eb3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_FillBuilder.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMcRead_FillBuilder_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfCell.hxx new file mode 100644 index 0000000..4a28d3c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfCell.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_HSequenceOfCell_HeaderFile +#define _McCadMcRead_HSequenceOfCell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_HSequenceOfCell_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_SequenceOfCell_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadMcRead_Cell; +class McCadMcRead_SequenceOfCell; + + + +class McCadMcRead_HSequenceOfCell : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadMcRead_HSequenceOfCell(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadMcRead_Cell)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadMcRead_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_Cell)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadMcRead_Cell)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadMcRead_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadMcRead_Cell)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadMcRead_HSequenceOfCell)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfCell Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadMcRead_Cell)& anItem) ; + + +Standard_EXPORT const Handle_McCadMcRead_Cell& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadMcRead_Cell& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadMcRead_SequenceOfCell& Sequence() const; + + McCadMcRead_SequenceOfCell& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfCell ShallowCopy() const; +//Standard_EXPORT ~McCadMcRead_HSequenceOfCell(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadMcRead_SequenceOfCell mySequence; + + +}; + +#define Item Handle_McCadMcRead_Cell +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfCell_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadMcRead_HSequenceOfCell ShallowCopy(const Handle_McCadMcRead_HSequenceOfCell& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfCellPtr.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfCellPtr.hxx new file mode 100644 index 0000000..bbdf9a7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfCellPtr.hxx @@ -0,0 +1,185 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_HSequenceOfCellPtr_HeaderFile +#define _McCadMcRead_HSequenceOfCellPtr_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_HSequenceOfCellPtr_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_SequenceOfCellPtr_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _McCadMcRead_CellPtr_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadMcRead_SequenceOfCellPtr; + + + +class McCadMcRead_HSequenceOfCellPtr : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadMcRead_HSequenceOfCellPtr(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const McCadMcRead_CellPtr& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadMcRead_HSequenceOfCellPtr)& aSequence) ; + + +Standard_EXPORT void Prepend(const McCadMcRead_CellPtr& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_HSequenceOfCellPtr)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const McCadMcRead_CellPtr& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadMcRead_HSequenceOfCellPtr)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const McCadMcRead_CellPtr& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadMcRead_HSequenceOfCellPtr)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfCellPtr Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const McCadMcRead_CellPtr& anItem) ; + + +Standard_EXPORT const McCadMcRead_CellPtr& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT McCadMcRead_CellPtr& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadMcRead_SequenceOfCellPtr& Sequence() const; + + McCadMcRead_SequenceOfCellPtr& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfCellPtr ShallowCopy() const; +//Standard_EXPORT ~McCadMcRead_HSequenceOfCellPtr(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadMcRead_SequenceOfCellPtr mySequence; + + +}; + +#define Item McCadMcRead_CellPtr +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfCellPtr +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfCellPtr +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfCellPtr +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfCellPtr_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadMcRead_HSequenceOfCellPtr ShallowCopy(const Handle_McCadMcRead_HSequenceOfCellPtr& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfFill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfFill.hxx new file mode 100644 index 0000000..c11a736 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_HSequenceOfFill.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_HSequenceOfFill_HeaderFile +#define _McCadMcRead_HSequenceOfFill_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_HSequenceOfFill_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_SequenceOfFill_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadMcRead_Fill; +class McCadMcRead_SequenceOfFill; + + + +class McCadMcRead_HSequenceOfFill : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadMcRead_HSequenceOfFill(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadMcRead_Fill)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadMcRead_HSequenceOfFill)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_Fill)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_HSequenceOfFill)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadMcRead_Fill)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadMcRead_HSequenceOfFill)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadMcRead_Fill)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadMcRead_HSequenceOfFill)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfFill Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadMcRead_Fill)& anItem) ; + + +Standard_EXPORT const Handle_McCadMcRead_Fill& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadMcRead_Fill& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadMcRead_SequenceOfFill& Sequence() const; + + McCadMcRead_SequenceOfFill& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadMcRead_HSequenceOfFill ShallowCopy() const; +//Standard_EXPORT ~McCadMcRead_HSequenceOfFill(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadMcRead_SequenceOfFill mySequence; + + +}; + +#define Item Handle_McCadMcRead_Fill +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfFill +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfFill +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfFill +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfFill_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadMcRead_HSequenceOfFill ShallowCopy(const Handle_McCadMcRead_HSequenceOfFill& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Reader.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_Reader.hxx new file mode 100644 index 0000000..7e68f43 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Reader.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_Reader_HeaderFile +#define _McCadMcRead_Reader_HeaderFile + +#ifndef _McCadMcRead_DataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerTransformation_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class OSD_File; +class TCollection_AsciiString; +class McCadMcRead_DataMapOfIntegerCell; +class McCadCSGGeom_DataMapOfIntegerSurface; +class McCadCSGGeom_DataMapOfIntegerTransformation; + +#include +#include +#include + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Parses MCNP input files + +//! Creates an MCNP Cell with MCNP syntax.
+//!
+//!
+ +class McCadMcRead_Reader { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_Reader(); + + +Standard_EXPORT Standard_Boolean Parse(OSD_File& theStream) ; + + +Standard_EXPORT Standard_Boolean ParseMessage(OSD_File& theStream) ; + + +Standard_EXPORT Standard_Boolean ParseTitle(OSD_File& theStream) ; + + +Standard_EXPORT Standard_Boolean ParseCell(OSD_File& theStream) ; + + +Standard_EXPORT Standard_Boolean ParseSurface(OSD_File& theStream) ; + + +//Standard_EXPORT Standard_Boolean ParseTRC(OSD_File& theStream) ; + + +Standard_EXPORT Standard_Boolean ParseDataCard(OSD_File& theStream) ; + + +Standard_EXPORT void RemoveComment(TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean IsBlankDeliminter(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean IsContinuation(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean IsComment(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean CreatCellInst(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean CreatSurfInst(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean CreatTRInst(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT Standard_Boolean CreatMCardInst(const TCollection_AsciiString& sline) ; + + +Standard_EXPORT void ResolveLattices() ; + + +Standard_EXPORT void ResolveFiller() ; + + +Standard_EXPORT void GetCells(McCadMcRead_DataMapOfIntegerCell& theMap) ; + + +Standard_EXPORT void GetSurfaces(McCadCSGGeom_DataMapOfIntegerSurface& theMap) ; + + +Standard_EXPORT void GetTrsfs(McCadCSGGeom_DataMapOfIntegerTransformation& theMap) ; + + +Standard_EXPORT void GetMDReader(McCadMDReader_Reader& theMDReader) ; + + +Standard_EXPORT void MakeLatticeCellTransformation(const Standard_Integer& dim, const Handle_TColStd_HSequenceOfInteger& surfNum, + const gp_Pnt& thePlace, const Standard_Integer& latType); + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + // Fields PRIVATE + // +McCadMcRead_DataMapOfIntegerCell myCellMap; +McCadCSGGeom_DataMapOfIntegerSurface mySurfMap; +McCadCSGGeom_DataMapOfIntegerTransformation myTrsfMap; +Standard_Boolean myTitleSkipped; +McCadMDReader_Reader myMDReader; +Standard_Boolean myUnsorted; +Standard_Integer myMacroBodySurfNumCnt; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Reader.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_Reader.ixx new file mode 100644 index 0000000..9f9c3c2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Reader.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_Reader.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_Reader.jxx new file mode 100644 index 0000000..53ba75a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_Reader.jxx @@ -0,0 +1,18 @@ +#ifndef _OSD_File_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerTransformation_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Reader_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfCell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfCell.hxx new file mode 100644 index 0000000..eeb5163 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfCell.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile +#define _McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile +#include +#endif + +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadMcRead_Cell; +class McCadMcRead_SequenceOfCell; + + + +class McCadMcRead_SequenceNodeOfSequenceOfCell : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadMcRead_SequenceNodeOfSequenceOfCell(const Handle(McCadMcRead_Cell)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadMcRead_Cell& Value() const; +//Standard_EXPORT ~McCadMcRead_SequenceNodeOfSequenceOfCell(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadMcRead_Cell myValue; + + +}; + +#define SeqItem Handle_McCadMcRead_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCell +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfCellPtr.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfCellPtr.hxx new file mode 100644 index 0000000..b274532 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfCellPtr.hxx @@ -0,0 +1,113 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile +#define _McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_CellPtr_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadMcRead_SequenceOfCellPtr; + + + +class McCadMcRead_SequenceNodeOfSequenceOfCellPtr : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadMcRead_SequenceNodeOfSequenceOfCellPtr(const McCadMcRead_CellPtr& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadMcRead_CellPtr& Value() const; +//Standard_EXPORT ~McCadMcRead_SequenceNodeOfSequenceOfCellPtr(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadMcRead_CellPtr myValue; + + +}; + +#define SeqItem McCadMcRead_CellPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCellPtr_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCellPtr +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfFill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfFill.hxx new file mode 100644 index 0000000..e6e341a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceNodeOfSequenceOfFill.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile +#define _McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile +#include +#endif + +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadMcRead_Fill; +class McCadMcRead_SequenceOfFill; + + + +class McCadMcRead_SequenceNodeOfSequenceOfFill : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadMcRead_SequenceNodeOfSequenceOfFill(const Handle(McCadMcRead_Fill)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadMcRead_Fill& Value() const; +//Standard_EXPORT ~McCadMcRead_SequenceNodeOfSequenceOfFill(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadMcRead_Fill myValue; + + +}; + +#define SeqItem Handle_McCadMcRead_Fill +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfFill_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfFill +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfCell.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfCell.hxx new file mode 100644 index 0000000..166f9dc --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfCell.hxx @@ -0,0 +1,192 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SequenceOfCell_HeaderFile +#define _McCadMcRead_SequenceOfCell_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadMcRead_Cell; +class McCadMcRead_SequenceNodeOfSequenceOfCell; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_SequenceOfCell : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadMcRead_SequenceOfCell(); + + +Standard_EXPORT void Clear() ; +~McCadMcRead_SequenceOfCell() +{ + Clear(); +} + + + +Standard_EXPORT const McCadMcRead_SequenceOfCell& Assign(const McCadMcRead_SequenceOfCell& Other) ; + const McCadMcRead_SequenceOfCell& operator =(const McCadMcRead_SequenceOfCell& Other) +{ + return Assign(Other); +} + +Standard_EXPORT void Append(const Handle(McCadMcRead_Cell)& T) ; + + void Append(McCadMcRead_SequenceOfCell& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_Cell)& T) ; + + void Prepend(McCadMcRead_SequenceOfCell& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadMcRead_Cell)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadMcRead_SequenceOfCell& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadMcRead_Cell)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadMcRead_SequenceOfCell& S) ; + + +Standard_EXPORT const Handle_McCadMcRead_Cell& First() const; + + +Standard_EXPORT const Handle_McCadMcRead_Cell& Last() const; + + void Split(const Standard_Integer Index,McCadMcRead_SequenceOfCell& Sub) ; + + +Standard_EXPORT const Handle_McCadMcRead_Cell& Value(const Standard_Integer Index) const; + const Handle_McCadMcRead_Cell& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadMcRead_Cell)& I) ; + + +Standard_EXPORT Handle_McCadMcRead_Cell& ChangeValue(const Standard_Integer Index) ; + Handle_McCadMcRead_Cell& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMcRead_SequenceOfCell(const McCadMcRead_SequenceOfCell& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadMcRead_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCell +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfCellPtr.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfCellPtr.hxx new file mode 100644 index 0000000..9232150 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfCellPtr.hxx @@ -0,0 +1,193 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SequenceOfCellPtr_HeaderFile +#define _McCadMcRead_SequenceOfCellPtr_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _McCadMcRead_CellPtr_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadMcRead_SequenceNodeOfSequenceOfCellPtr; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_SequenceOfCellPtr : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadMcRead_SequenceOfCellPtr(); + + +Standard_EXPORT void Clear() ; +~McCadMcRead_SequenceOfCellPtr() +{ + Clear(); +} + + + +Standard_EXPORT const McCadMcRead_SequenceOfCellPtr& Assign(const McCadMcRead_SequenceOfCellPtr& Other) ; + const McCadMcRead_SequenceOfCellPtr& operator =(const McCadMcRead_SequenceOfCellPtr& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadMcRead_CellPtr& T) ; + + void Append(McCadMcRead_SequenceOfCellPtr& S) ; + + +Standard_EXPORT void Prepend(const McCadMcRead_CellPtr& T) ; + + void Prepend(McCadMcRead_SequenceOfCellPtr& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadMcRead_CellPtr& T) ; + + void InsertBefore(const Standard_Integer Index,McCadMcRead_SequenceOfCellPtr& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadMcRead_CellPtr& T) ; + + void InsertAfter(const Standard_Integer Index,McCadMcRead_SequenceOfCellPtr& S) ; + + +Standard_EXPORT const McCadMcRead_CellPtr& First() const; + + +Standard_EXPORT const McCadMcRead_CellPtr& Last() const; + + void Split(const Standard_Integer Index,McCadMcRead_SequenceOfCellPtr& Sub) ; + + +Standard_EXPORT const McCadMcRead_CellPtr& Value(const Standard_Integer Index) const; + const McCadMcRead_CellPtr& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadMcRead_CellPtr& I) ; + + +Standard_EXPORT McCadMcRead_CellPtr& ChangeValue(const Standard_Integer Index) ; + McCadMcRead_CellPtr& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMcRead_SequenceOfCellPtr(const McCadMcRead_SequenceOfCellPtr& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadMcRead_CellPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCellPtr_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCellPtr +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfFill.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfFill.hxx new file mode 100644 index 0000000..96f221a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SequenceOfFill.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SequenceOfFill_HeaderFile +#define _McCadMcRead_SequenceOfFill_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _Handle_McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadMcRead_Fill; +class McCadMcRead_SequenceNodeOfSequenceOfFill; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadMcRead_SequenceOfFill : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadMcRead_SequenceOfFill(); + + +Standard_EXPORT void Clear() ; +~McCadMcRead_SequenceOfFill() +{ + Clear(); +} + + + +Standard_EXPORT const McCadMcRead_SequenceOfFill& Assign(const McCadMcRead_SequenceOfFill& Other) ; + const McCadMcRead_SequenceOfFill& operator =(const McCadMcRead_SequenceOfFill& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadMcRead_Fill)& T) ; + + void Append(McCadMcRead_SequenceOfFill& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadMcRead_Fill)& T) ; + + void Prepend(McCadMcRead_SequenceOfFill& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadMcRead_Fill)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadMcRead_SequenceOfFill& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadMcRead_Fill)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadMcRead_SequenceOfFill& S) ; + + +Standard_EXPORT const Handle_McCadMcRead_Fill& First() const; + + +Standard_EXPORT const Handle_McCadMcRead_Fill& Last() const; + + void Split(const Standard_Integer Index,McCadMcRead_SequenceOfFill& Sub) ; + + +Standard_EXPORT const Handle_McCadMcRead_Fill& Value(const Standard_Integer Index) const; + const Handle_McCadMcRead_Fill& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadMcRead_Fill)& I) ; + + +Standard_EXPORT Handle_McCadMcRead_Fill& ChangeValue(const Standard_Integer Index) ; + Handle_McCadMcRead_Fill& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadMcRead_SequenceOfFill(const McCadMcRead_SequenceOfFill& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadMcRead_Fill +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfFill_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfFill +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.hxx new file mode 100644 index 0000000..91cf8d8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.hxx @@ -0,0 +1,171 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_SurfaceFactory_HeaderFile +#define _McCadMcRead_SurfaceFactory_HeaderFile + +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCSGGeom_Surface; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#include +#include + +//! \brief Make McCad_Surface from MCNP geometry description + +//! Creates an McCad_Surface from MCNP surface syntax.
+//!
+//!
+ +class McCadMcRead_SurfaceFactory { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadMcRead_SurfaceFactory(); + + +Standard_EXPORT McCadMcRead_SurfaceFactory(const Handle_McCadCSGGeom_Surface& oldSurf) ; + + +Standard_EXPORT Standard_Boolean MakeSurface(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT Handle_McCadCSGGeom_Surface GetSurface() const; + +Standard_EXPORT Handle(McCadCSGGeom_HSequenceOfSurface) GetMacroBodySurfaces(); + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Standard_Boolean MakePlane(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeCylinder(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeCone(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeSphere(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeTorus(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeGQ(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeAxissymmetricSurfaceByPoints(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean MakeBOX(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeRPP(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeRCC(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeHEX(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeREC(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeTRC(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeELL(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeWED(const TCollection_AsciiString& sDesc) ; +Standard_EXPORT Standard_Boolean MakeARB(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean PointPlane(const gp_Dir& dir, Handle_TColStd_HSequenceOfReal& thePntSeq) ; + + +Standard_EXPORT Standard_Boolean PointCylinder(const gp_Dir& dir, Handle_TColStd_HSequenceOfReal& thePntSeq) ; + + +Standard_EXPORT Standard_Boolean PointCone(const gp_Dir& dir, Handle_TColStd_HSequenceOfReal& thePntSeq) ; + +Standard_EXPORT void InitMacroBodySurfaces(); + + // Fields PRIVATE + // +Handle_McCadCSGGeom_Surface mySurface; +Standard_Boolean myIsDone; +Handle(McCadCSGGeom_HSequenceOfSurface) myMacroBodySurfaces; +Standard_Boolean myIsMacroBody; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.ixx new file mode 100644 index 0000000..6a5310d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.jxx new file mode 100644 index 0000000..272bf32 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_SurfaceFactory.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SurfaceFactory_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.hxx b/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.hxx new file mode 100644 index 0000000..b5dcd8f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.hxx @@ -0,0 +1,140 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcRead_TrsfBuilder_HeaderFile +#define _McCadMcRead_TrsfBuilder_HeaderFile + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _Handle_TColStd_HSequenceOfReal_HeaderFile +#include +#endif +class McCadCSGGeom_Transformation; +class TCollection_AsciiString; +class TColStd_HSequenceOfReal; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Creates Trsf Matrix from MCNP Card.
+ +//! Creates Trsf Matrix from MCNP Card.
+//!
+//!
+ +class McCadMcRead_TrsfBuilder { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +Standard_EXPORT McCadMcRead_TrsfBuilder(); + + +Standard_EXPORT void BuildTrsf(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT Handle_McCadCSGGeom_Transformation GetTrsf() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Standard_Boolean Parse(const TCollection_AsciiString& sDesc) ; + + +Standard_EXPORT Standard_Boolean ParseNine(const Handle(TColStd_HSequenceOfReal)& entries) const; + + +Standard_EXPORT Standard_Boolean ParseSix(const Handle(TColStd_HSequenceOfReal)& entries) const; + + +Standard_EXPORT Standard_Boolean ParseThree(const Handle(TColStd_HSequenceOfReal)& entries) const; + + +Standard_EXPORT Standard_Boolean ParsePrefix(const TCollection_AsciiString& sDesc) ; + + + // Fields PRIVATE + // +Standard_Boolean myIsDone; +Handle_McCadCSGGeom_Transformation myTrsf; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.ixx b/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.ixx new file mode 100644 index 0000000..f8f3d14 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.jxx b/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.jxx new file mode 100644 index 0000000..2b4351f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcRead_TrsfBuilder.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCSGGeom_Transformation_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TColStd_HSequenceOfReal_HeaderFile +#include +#endif +#ifndef _McCadMcRead_TrsfBuilder_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid.hxx b/src/MCCAD/McCadHeaders/McCadMcVoid.hxx new file mode 100644 index 0000000..14d7c36 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid.hxx @@ -0,0 +1,175 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcVoid_HeaderFile +#define _McCadMcVoid_HeaderFile + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopAbs_State_HeaderFile +#include +#endif +class TopoDS_Shape; +class gp_Pnt; +class McCadCSGGeom_Surface; +class GeomAdaptor_Surface; +class TopoDS_Face; +class McCadDiscDs_HSequenceOfDiscFace; +class TopTools_HSequenceOfShape; +class TopoDS_Solid; +class McCadDiscDs_DiscFace; +class McCadMcVoid_Generator; +class McCadMcVoid_ForwardCollision; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief usefull tools for McCadMcVoid... + +class McCadMcVoid { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static Standard_Real AreaOfShape(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT static Standard_Real VolumeOfShape(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT static gp_Pnt ApproxBaryCenter(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT static TopoDS_Shape RelScale(const TopoDS_Shape& theShape,const gp_Pnt& thePnt,const Standard_Real theFact) ; + + +Standard_EXPORT static TopoDS_Shape Scale(const TopoDS_Shape& theShape,const Standard_Real theFact) ; + + +Standard_EXPORT static Handle_McCadCSGGeom_Surface MakeMcCadSurf(GeomAdaptor_Surface& theAdapSurface) ; + + +Standard_EXPORT static Standard_Boolean ApproxGeomEqual(Handle(McCadCSGGeom_Surface)& S1,Handle(McCadCSGGeom_Surface)& S2) ; + + +Standard_EXPORT static Standard_Boolean ApproxGeomEqualFaces(TopoDS_Face& F1,TopoDS_Face& F2,const Standard_Real theCFRes) ; + + +Standard_EXPORT static Handle_McCadDiscDs_HSequenceOfDiscFace DeleteApproxRedundant(Handle(McCadDiscDs_HSequenceOfDiscFace)& theVCutFace,const Standard_Real theCFRes) ; + + +//! Receives a Sequence containing to faces. DeleteOne checks if these
+//! faces are the same but for the orientation. In that case, both
+//! faces are identical and form an interface between two body parts.
+//! One of these faces is deleted out of the Sequence, which is returned.
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteOne(Handle(TopTools_HSequenceOfShape)& theFaceSeq) ; + + +Standard_EXPORT static Handle_TopTools_HSequenceOfShape ShellOrder(Handle(TopTools_HSequenceOfShape)& theFaceSeq,Handle(TopTools_HSequenceOfShape)& theSolidSeq) ; + + +Standard_EXPORT static Standard_Boolean SignChanging(TopoDS_Solid& baseSolid,const McCadDiscDs_DiscFace& theVFace) ; + + +//! Creates a half space. Therefor it requires an oriented face and
+//! a Point that indicates on which side of the face the matter side
+//! should be.
+Standard_EXPORT static TopoDS_Shape MakeHalfSpace(TopoDS_Shape& aSolid, gp_Pnt& theLPnt, gp_Pnt& theUPnt) ; +Standard_EXPORT static TopoDS_Shape MakeHalfSpace(TopoDS_Shape& aSolid) ; + + +Standard_EXPORT static TopoDS_Shape MakeTrimmHalf(TopoDS_Shape& aSolid,TopoDS_Shape& aFace) ; + + +//! Returns the State of the point that is tested to be IN the Solid.
+//! Is called by MakeHalfSpace.
+Standard_EXPORT static TopAbs_State PointState(const TopoDS_Shape& aShape,const gp_Pnt& aPnt) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + +friend class McCadMcVoid_Generator; +friend class McCadMcVoid_ForwardCollision; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid.ixx b/src/MCCAD/McCadHeaders/McCadMcVoid.ixx new file mode 100644 index 0000000..4a21f80 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid.jxx b/src/MCCAD/McCadHeaders/McCadMcVoid.jxx new file mode 100644 index 0000000..29b44d8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid.jxx @@ -0,0 +1,30 @@ +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_Surface_HeaderFile +#include +#endif +#ifndef _GeomAdaptor_Surface_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_DiscFace_HeaderFile +#include +#endif +#ifndef _McCadMcVoid_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.hxx b/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.hxx new file mode 100644 index 0000000..9c580aa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.hxx @@ -0,0 +1,122 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcVoid_ForwardCollision_HeaderFile +#define _McCadMcVoid_ForwardCollision_HeaderFile + +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadDiscDs_HSequenceOfDiscSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief perform Forward Collision Test + +//! Forward Collision check and pseudo
+//! repair method implementation
+class McCadMcVoid_ForwardCollision { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +Standard_EXPORT McCadMcVoid_ForwardCollision(); + + +Standard_EXPORT McCadMcVoid_ForwardCollision(Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape); + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT void SetDsSolid(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void SetTolerance(const Standard_Real theTol) ; + + +Standard_EXPORT Standard_Real GetTolerance() const; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadDiscDs_HSequenceOfDiscSolid myVSolids; +Standard_Real myTolerance; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.ixx b/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.ixx new file mode 100644 index 0000000..237f8e2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.jxx b/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.jxx new file mode 100644 index 0000000..bc3154b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid_ForwardCollision.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _McCadMcVoid_ForwardCollision_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.hxx b/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.hxx new file mode 100644 index 0000000..f49f793 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.hxx @@ -0,0 +1,259 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcVoid_Generator_HeaderFile +#define _McCadMcVoid_Generator_HeaderFile + +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Handle_McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif +class McCadDiscDs_HSequenceOfDiscSolid; +class TopoDS_Shape; +class TopTools_HSequenceOfShape; +class McCadDiscDs_HSequenceOfDiscFace; +#include +#include + +//#include +/* +#include +#include +#include +#include +#include +#include +#include +#include +*/ + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Core of Void Completion + +//! The input is a bounding box for the whole input model.
+//! The bounding box will be cut with all linear faces of the input solids beginning +//! with the face with the largest face area. The threshold for the cut face area is +//! defined by myMinDecompositionFaceArea. All faces smaller than this value will not +//! be used for decomposition. This feature is neccessary for large models with loads +//! of small faces. +//! The number of volumes produced by the cutting algorithm can be restricted by the +//! parameter myMaxNbOfPreDecomposition
+//! After the cutting an overlap test among the void volumes and the input solids will +//! be performed. The number of overlapps allowed for one single void volume is defined +//! by myMaxComplementedShapes.
+//! Void volumes which have a higher number of collisions are called monster voids +//! Monster voids will be decomposed further with a smaller cut face threshold defined +//! by myMinRedecompositionFaceArea +//! if the second cut still leaves a monster void, the resulting monster void will +//! be handled as a usual void volume. + +class McCadMcVoid_Generator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // +//! std ctor +Standard_EXPORT McCadMcVoid_Generator(); + +//! ctor accepting a sequence of discretized solids +Standard_EXPORT McCadMcVoid_Generator(Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape); + +//! set the discretized solids +//! OBSOLETE! +Standard_EXPORT void SetDiscSolids(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theSolids) ; + +//! returns the discretized solids +//! OBSOLETE! +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscSolid GetDiscSolids() const; + +//! Returns a list of discretized void volumes +Standard_EXPORT Handle_McCadDiscDs_HSequenceOfDiscSolid GetDiscVoids() const; + +//! perform generation of void volumes +//! calls this->PreDecompose() and this->VoidGenerate() +Standard_EXPORT void Init() ; + +//! Set input bounding box as a Sequence of Solids +//! Bounding box is meant to be cut by all planar faces of the input model. +//! Input solid can already be predecomposed, hence the sequence instead of one single solid. +//! This might be neccessary to avoid excessive decomposition of the bounding box. +Standard_EXPORT void SetBSolid(const Handle_TopTools_HSequenceOfShape& theBSolid) ; + +//! Return the input bounding box +//! OBSOLETE! +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetBSolid() const; + +//! Generate a sphere which contains the bounding box +//! The sphere is used for MCNP to be able to easile describe the whole universe. +//! Everything outside the sphere is the outer space which is unintersting for the +//! computations. The space between the sphere and the bounding box is unintersting also for the +//! calculations but is quite handy for geometry bug tracking. +//! So the space inbetween will have neutron importance 1 in MCNP. +//! Then one can define a surface source on the sphere with an inward direction. +//! Lost particles will lead to geometry bugs. +Standard_EXPORT TopoDS_Shape MkOuterSpace() ; + +//! defines the minimum volume of predecomposed void volumes +Standard_EXPORT void SetMinVolume(const Standard_Real theVol) ; + +//! Sets the number of maximal allowed overlaps between one void volume and +//! input solids. A void volume which collides with more input solids than this +//! value is called monster void. +//! Monster voids will be processed a second time with a smaller cutting face +//! threshold. +Standard_EXPORT void SetMaxComplementedShapes(const Standard_Integer theNumb) ; + +//! Defines the maximal number of void volumes for the decomposition process. +Standard_EXPORT void SetMaxNbOfPreDecomposition(const Standard_Integer theNumb) ; + +//! Set the minimum threshold for linear face of the input model to be considered +//! as a cut face for the decomposition of the bounding box +Standard_EXPORT void SetMinDecompositionFaceArea(const Standard_Real theArea) ; + +//! Set the minimum threshold for linear face of the input model to be considered +//! as a cut face for the decomposition of monster voids +Standard_EXPORT void SetMinRedecompositionFaceArea(const Standard_Real theArea) ; + +//! Sets the tolerance for cutting +//! OBSOLETE! +Standard_EXPORT void SetTolerance(const Standard_Real theTol) ; + +//! returns true if the void generation was finished succesfully +Standard_EXPORT Standard_Boolean IsDone() const; + +//! Set parameters for the discretization of the generated void volumes +//! Discretization means, that sample points will be spread over all faces +//! of all void volumes to perform overlap tests with the input solids. +Standard_EXPORT void SetDiscParameter(const Standard_Integer theMaxNbPnt,const Standard_Integer theMinNbPnt,const Standard_Real theXRes,const Standard_Real theYRes,const Standard_Real theTol) ; + +//! ??? closer investigation neccessary: somehow used by McCadMcVoid::ApproxGeomEqualFaces(,,theCFRes) +Standard_EXPORT void SetCutFaceResolution(const Standard_Real theCFRes) ; + +//! Discretize the decomposed void volumes, i.e. spread sample points on their +//! faces for overlap test +Standard_EXPORT void VoidVoxelization(Handle(TopTools_HSequenceOfShape)& voidSolids) ; + +//! Tests if an input solid is polyhedral, i.e. consists of planar faces only +Standard_EXPORT Standard_Boolean IsPolyhedral(TopoDS_Shape& shp) ; + +//! perform fast overlap test for polyhedra +Standard_EXPORT Standard_Boolean PolyhedralOverlap(TopoDS_Shape& shp1, TopoDS_Shape& shp2) ; + +//! sets the GUI related progress indicator +Standard_EXPORT void SetProgressIndicator(Handle_Message_ProgressIndicator& thePI); + +//! perform the decomposition of the volumes of the bounding box with a face +//! from the input solids +Standard_EXPORT Handle_TopTools_HSequenceOfShape Decompose(Handle(TopTools_HSequenceOfShape)& tmpBoxSeq,TopoDS_Shape& aFaceSolid) ; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + + +private: + + // Methods PRIVATE + // + +Standard_EXPORT void PreDecompose() ; + + +Standard_EXPORT void VoidGenerate() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GoDecompose(Handle(TopTools_HSequenceOfShape)& BoxSeq,const Handle(McCadDiscDs_HSequenceOfDiscFace)& theVCutFace,const Standard_Integer MaxNbVoids) ; + + +Standard_EXPORT Standard_Boolean FacesIntersect(TopoDS_Shape& shp1, TopoDS_Shape& shp2); + + // Fields PRIVATE + // +Handle_McCadDiscDs_HSequenceOfDiscSolid myVSolids; +Handle_McCadDiscDs_HSequenceOfDiscSolid myVVoids; +Handle_TopTools_HSequenceOfShape myBSolid; +TopoDS_Shape mySphere; +Standard_Real myMinVolume; +Standard_Integer myMaxComplementedShapes; +Standard_Integer myMaxNbOfPreDecomposition; +Standard_Real myMinDecompositionFaceArea; +Standard_Real myMinRedecompositionFaceArea; +Standard_Real myTolerance; +Standard_Boolean myIsDone; +Standard_Integer myMaxNbPnt; +Standard_Integer myMinNbPnt; +Standard_Real myXlen; +Standard_Real myYlen; +Standard_Real myCFRes; + +Handle_Message_ProgressIndicator myPI; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.ixx b/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.ixx new file mode 100644 index 0000000..e5dde19 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.jxx b/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.jxx new file mode 100644 index 0000000..8115e9d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcVoid_Generator.jxx @@ -0,0 +1,15 @@ +#ifndef _McCadDiscDs_HSequenceOfDiscSolid_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadDiscDs_HSequenceOfDiscFace_HeaderFile +#include +#endif +#ifndef _McCadMcVoid_Generator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.hxx b/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.hxx new file mode 100644 index 0000000..8c2325d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.hxx @@ -0,0 +1,118 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcWrite_McInputGenerator_HeaderFile +#define _McCadMcWrite_McInputGenerator_HeaderFile + +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class TCollection_AsciiString; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! \brief Base class for MC input generators + +//! This class is the base class for MC input generators. Every class to generate an MC
+//! output should inherit this class +class McCadMcWrite_McInputGenerator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + + +Standard_EXPORT virtual void MakeHeader() const; + + +Standard_EXPORT virtual void AddHeaderText(const TCollection_AsciiString& theText) ; + + +Standard_EXPORT virtual void PrintHeader(Standard_OStream& theStream) ; + + +Standard_EXPORT virtual void PrintAll(Standard_OStream& theStream) ; + + + + + +protected: + + // Methods PROTECTED + // + +//! discrete face class
+//! Face with points on it
+//!
+Standard_EXPORT McCadMcWrite_McInputGenerator(); + + + // Fields PROTECTED + // +Handle_TColStd_HSequenceOfAsciiString myHeader; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.ixx b/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.ixx new file mode 100644 index 0000000..7fb0df4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.jxx b/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.jxx new file mode 100644 index 0000000..10af12c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_McInputGenerator.jxx @@ -0,0 +1,9 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMcWrite_McInputGenerator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.hxx b/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.hxx new file mode 100644 index 0000000..8d57336 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.hxx @@ -0,0 +1,203 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadMcWrite_McnpInputGenerator_HeaderFile +#define _McCadMcWrite_McnpInputGenerator_HeaderFile + +#ifndef _Handle_TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _Handle_McCadCSGGeom_HSequenceOfCell_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_DataMapOfIntegerSurface_HeaderFile +#include +#endif +#ifndef _McCadMcWrite_McInputGenerator_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TColStd_HSequenceOfAsciiString; +class McCadCSGGeom_HSequenceOfCell; +class TCollection_AsciiString; +class OSD_File; + +#include + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +//! \brief Generate MCNP Geometry Description + +//! Generates MCNP Geometry Description from a independent McCad internally volume description. + +class McCadMcWrite_McnpInputGenerator : public McCadMcWrite_McInputGenerator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Mcnp input generator
+//! simple
+//!
+Standard_EXPORT McCadMcWrite_McnpInputGenerator(); + + +//!
+Standard_EXPORT McCadMcWrite_McnpInputGenerator(const Handle(McCadCSGGeom_HSequenceOfCell)& theCellSeq); + + +Standard_EXPORT void SetCells(const Handle(McCadCSGGeom_HSequenceOfCell)& theCells) ; + + +Standard_EXPORT Handle_McCadCSGGeom_HSequenceOfCell GetCells() const; + + +Standard_EXPORT void SetNbOfMatCells(const Standard_Integer theNumber) ; + + +Standard_EXPORT Standard_Integer GetNbOfMatCells() const; + + +Standard_EXPORT void SetNbOfVoidCells(const Standard_Integer theNumber) ; + + +Standard_EXPORT Standard_Integer GetNbOfVoidCells() const; + + +Standard_EXPORT void SetNbOfOuterCells(const Standard_Integer theNumber) ; + + +Standard_EXPORT Standard_Integer GetNbOfOuterCells() const; + + +Standard_EXPORT virtual void MakeHeader() ; + + +Standard_EXPORT void AppendToHeader(const TCollection_AsciiString& theText) ; + + +Standard_EXPORT void SurfNumbering() ; + + +Standard_EXPORT virtual void PrintHeader(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintCell(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintSurface(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintTrsf(Standard_OStream& theStream) ; + + +Standard_EXPORT virtual void PrintAll(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintAll(OSD_File& theFile) ; + + +Standard_EXPORT void PrintAllCells(Standard_OStream& theStream) ; + + +Standard_EXPORT void PrintMaterial(Standard_OStream& theStream) ; + + +Standard_EXPORT void SetMDReader(const McCadMDReader_Reader& theMDReader); + + +Standard_EXPORT void SetInitialSurfaceNumber(Standard_Integer& theInt); + + +Standard_EXPORT void SetInitialCellNumber(Standard_Integer& theInt); + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_TColStd_HSequenceOfAsciiString myHeader; +Handle_McCadCSGGeom_HSequenceOfCell myCellSeq; +Standard_Integer myNbMatCells; +Standard_Integer myNbVoidCells; +Standard_Integer myNbOuterCells; +Standard_Integer myNbTrsfCards; +Standard_Integer myNbSurfCards; +Standard_Boolean myIsHeaded; +Standard_Boolean myIsNumbered; +McCadCSGGeom_DataMapOfIntegerSurface myGlSurfaceMap; +McCadMDReader_Reader myMDReader; +Standard_Integer myInitSurfNb; +Standard_Integer myInitCellNb; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.ixx b/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.ixx new file mode 100644 index 0000000..a4bd329 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.jxx b/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.jxx new file mode 100644 index 0000000..327de07 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_McnpInputGenerator.jxx @@ -0,0 +1,15 @@ +#ifndef _TColStd_HSequenceOfAsciiString_HeaderFile +#include +#endif +#ifndef _McCadCSGGeom_HSequenceOfCell_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _OSD_File_HeaderFile +#include +#endif +#ifndef _McCadMcWrite_McnpInputGenerator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMcWrite_TripoliInputGenerator.hxx b/src/MCCAD/McCadHeaders/McCadMcWrite_TripoliInputGenerator.hxx new file mode 100644 index 0000000..08634b6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMcWrite_TripoliInputGenerator.hxx @@ -0,0 +1,95 @@ +/* + * McCadMcWrite_TripoliInputGenerator.hxx + * + * Created on: Aug 7, 2009 + * Author: grosse + */ + +#ifndef MCCADMCWRITE_TRIPOLIINPUTGENERATOR_HXX_ +#define MCCADMCWRITE_TRIPOLIINPUTGENERATOR_HXX_ + + +#include +#include +#include +#include +#include +#include + +//! \brief Generate Tripoli Geometry Description + +//! Generates Tripoli Geometry Description from a independent McCad internally volume description. + +class McCadMcWrite_TripoliInputGenerator : public McCadMcWrite_McInputGenerator { + +public: + Standard_EXPORT McCadMcWrite_TripoliInputGenerator(); + + McCadMcWrite_TripoliInputGenerator(const Handle(McCadCSGGeom_HSequenceOfCell)& theCellSeq); + + void SetCells(const Handle(McCadCSGGeom_HSequenceOfCell)& theCells) ; + + Handle_McCadCSGGeom_HSequenceOfCell GetCells() const; + + void SetNbOfMatCells(const Standard_Integer theNumber) ; + + Standard_Integer GetNbOfMatCells() const; + + void SetNbOfVoidCells(const Standard_Integer theNumber) ; + + Standard_Integer GetNbOfVoidCells() const; + + void SetNbOfOuterCells(const Standard_Integer theNumber) ; + + Standard_Integer GetNbOfOuterCells() const; + + virtual void MakeHeader() ; + + void AppendToHeader(const TCollection_AsciiString& theText) ; + + void SurfNumbering() ; + + virtual void PrintHeader(Standard_OStream& theStream) ; + + void PrintCell(Standard_OStream& theStream) ; + + void PrintSurface(Standard_OStream& theStream) ; + + void PrintTrsf(Standard_OStream& theStream) ; + + virtual void PrintAll(Standard_OStream& theStream) ; + + void PrintAll(OSD_File& theFile) ; + + void PrintAllCells(Standard_OStream& theStream) ; + + void PrintMaterial(Standard_OStream& theStream) ; + + void SetMDReader(const McCadMDReader_Reader& theMDReader); + + void SetInitialSurfaceNumber(Standard_Integer& theInt); + + void SetInitialCellNumber(Standard_Integer& theInt); + +private: + // Fields PRIVATE + // + Handle_TColStd_HSequenceOfAsciiString myHeader; + Handle_McCadCSGGeom_HSequenceOfCell myCellSeq; + Standard_Integer myNbMatCells; + Standard_Integer myNbVoidCells; + Standard_Integer myNbOuterCells; + Standard_Integer myNbTrsfCards; + Standard_Integer myNbSurfCards; + Standard_Boolean myIsHeaded; + Standard_Boolean myIsNumbered; + McCadCSGGeom_DataMapOfIntegerSurface myGlSurfaceMap; + McCadMDReader_Reader myMDReader; + Standard_Integer myInitSurfNb; + Standard_Integer myInitCellNb; +}; + + + + +#endif /* MCCADMCWRITE_TRIPOLIINPUTGENERATOR_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadMessenger_MessageType.hxx b/src/MCCAD/McCadHeaders/McCadMessenger_MessageType.hxx new file mode 100644 index 0000000..444b571 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMessenger_MessageType.hxx @@ -0,0 +1,21 @@ +/* + * McCadMessenger_MessageType.hxx + * + * Created on: Feb 2, 2010 + * Author: grosse + */ + +#ifndef MCCADMESSENGER_MESSAGETYPE_HXX_ +#define MCCADMESSENGER_MESSAGETYPE_HXX_ + +enum McCadMessenger_MessageType +{ + McCadMessenger_DefaultMsg, + McCadMessenger_WarningMsg, + McCadMessenger_ErrorMsg, + McCadMessenger_HeadingMsg, + McCadMessenger_CoutMsg +}; + + +#endif /* MCCADMESSENGER_MESSAGETYPE_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/McCadMessenger_ObserverInterface.hxx b/src/MCCAD/McCadHeaders/McCadMessenger_ObserverInterface.hxx new file mode 100644 index 0000000..fdeef5c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMessenger_ObserverInterface.hxx @@ -0,0 +1,20 @@ +#ifndef MCCADMESSENGER_OBSERVERINTERFACE_HXX +#define MCCADMESSENGER_OBSERVERINTERFACE_HXX + +/* + Interface for observers for the McCadMessenger_Singleton class +*/ + +#include +#include + +class McCadMessenger_ObserverInterface{ +private: + +public: + virtual ~McCadMessenger_ObserverInterface(){} + virtual void PrintMessage( std::string message, + McCadMessenger_MessageType type = McCadMessenger_DefaultMsg ) = 0; +}; + +#endif // MCCADMESSENGER_OBSERVERINTERFACE_HXX diff --git a/src/MCCAD/McCadHeaders/McCadMessenger_Singleton.hxx b/src/MCCAD/McCadHeaders/McCadMessenger_Singleton.hxx new file mode 100644 index 0000000..8d7fc85 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMessenger_Singleton.hxx @@ -0,0 +1,49 @@ +#ifndef MCCADMESSENGER_SINGLETON_HXX +#define MCCADMESSENGER_SINGLETON_HXX + +/** + Singleton class for framework wide messages + Inherit the abstract interface McCadMessenger_ObserverInterface + and use the register function of this class to register a new observer +*/ + +#include +#include +#include +#include + + +//qiu add Standard_EXPORT +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +class McCadMessenger_Singleton +{ + +public: + //! returns static instance +Standard_EXPORT static McCadMessenger_Singleton* Instance(){ + if(m_instance == 0) + m_instance = new McCadMessenger_Singleton; + + return m_instance; + } + + //! register new printing mechanism + void Register(McCadMessenger_ObserverInterface* observer); + + //! send message to all registered observers to print (std out, log file, status window,...) +Standard_EXPORT void Message( std::string msg, + McCadMessenger_MessageType msgType = McCadMessenger_DefaultMsg); + +private: + McCadMessenger_Singleton() {} +Standard_EXPORT static McCadMessenger_Singleton *m_instance; + std::vector m_observers; +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadMessenger_StdOut.hxx b/src/MCCAD/McCadHeaders/McCadMessenger_StdOut.hxx new file mode 100644 index 0000000..bdd5bed --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadMessenger_StdOut.hxx @@ -0,0 +1,16 @@ +#ifndef MCCADMESSENGER_STDOUT_HXX +#define MCCADMESSENGER_STDOUT_HXX + +#include + +class McCadMessenger_StdOut: public McCadMessenger_ObserverInterface { +private: + +public: + McCadMessenger_StdOut(); + ~McCadMessenger_StdOut() {} + void PrintMessage( std::string message, + McCadMessenger_MessageType type = McCadMessenger_DefaultMsg ); +}; + +#endif // MCCADMESSENGER_STDOUT_HXX diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart.hxx new file mode 100644 index 0000000..0ed437e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart.hxx @@ -0,0 +1,117 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart_HeaderFile +#define _McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadModelManager_Part; +class McCadModelManager_MapIntegerHasher; +class McCadModelManager_DataMapOfIntegerPart; +class McCadModelManager_DataMapNodeOfDataMapOfIntegerPart; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart(); + + +Standard_EXPORT McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart(const McCadModelManager_DataMapOfIntegerPart& aMap); + + +Standard_EXPORT void Initialize(const McCadModelManager_DataMapOfIntegerPart& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const McCadModelManager_Part& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger.hxx new file mode 100644 index 0000000..6596cf1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger_HeaderFile +#define _McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _McCadModelManager_ShapePtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadModelManager_MapShapePtrHasher; +class McCadModelManager_DataMapOfShapePtrInteger; +class McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger(); + + +Standard_EXPORT McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger(const McCadModelManager_DataMapOfShapePtrInteger& aMap); + + +Standard_EXPORT void Initialize(const McCadModelManager_DataMapOfShapePtrInteger& aMap) ; + + +Standard_EXPORT const McCadModelManager_ShapePtr& Key() const; + + +Standard_EXPORT const Standard_Integer& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_DataMapNodeOfDataMapOfIntegerPart.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapNodeOfDataMapOfIntegerPart.hxx new file mode 100644 index 0000000..6f0d41b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapNodeOfDataMapOfIntegerPart.hxx @@ -0,0 +1,134 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile +#define _McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadModelManager_Part_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadModelManager_Part; +class McCadModelManager_MapIntegerHasher; +class McCadModelManager_DataMapOfIntegerPart; +class McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart; + + + +class McCadModelManager_DataMapNodeOfDataMapOfIntegerPart : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadModelManager_DataMapNodeOfDataMapOfIntegerPart(const Standard_Integer& K,const McCadModelManager_Part& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + McCadModelManager_Part& Value() const; +//Standard_EXPORT ~McCadModelManager_DataMapNodeOfDataMapOfIntegerPart(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +McCadModelManager_Part myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem McCadModelManager_Part +#define TheItem_hxx +#define Hasher McCadModelManager_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadModelManager_DataMapNodeOfDataMapOfIntegerPart +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart +#define TCollection_DataMapNode_Type_() McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_Type_() +#define TCollection_DataMap McCadModelManager_DataMapOfIntegerPart +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger.hxx new file mode 100644 index 0000000..73bf0f4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger.hxx @@ -0,0 +1,133 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile +#define _McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile +#include +#endif + +#ifndef _McCadModelManager_ShapePtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadModelManager_MapShapePtrHasher; +class McCadModelManager_DataMapOfShapePtrInteger; +class McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger; + + + +class McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger(const McCadModelManager_ShapePtr& K,const Standard_Integer& I,const TCollection_MapNodePtr& n); + + McCadModelManager_ShapePtr& Key() const; + + Standard_Integer& Value() const; +//Standard_EXPORT ~McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadModelManager_ShapePtr myKey; +Standard_Integer myValue; + + +}; + +#define TheKey McCadModelManager_ShapePtr +#define TheKey_hxx +#define TheItem Standard_Integer +#define TheItem_hxx +#define Hasher McCadModelManager_MapShapePtrHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger +#define TCollection_DataMapNode_Type_() McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_Type_() +#define TCollection_DataMap McCadModelManager_DataMapOfShapePtrInteger +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_DataMapOfIntegerPart.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapOfIntegerPart.hxx new file mode 100644 index 0000000..70fdcbc --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapOfIntegerPart.hxx @@ -0,0 +1,156 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_DataMapOfIntegerPart_HeaderFile +#define _McCadModelManager_DataMapOfIntegerPart_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfIntegerPart_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadModelManager_Part; +class McCadModelManager_MapIntegerHasher; +class McCadModelManager_DataMapNodeOfDataMapOfIntegerPart; +class McCadModelManager_DataMapIteratorOfDataMapOfIntegerPart; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_DataMapOfIntegerPart : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadModelManager_DataMapOfIntegerPart(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadModelManager_DataMapOfIntegerPart& Assign(const McCadModelManager_DataMapOfIntegerPart& Other) ; + McCadModelManager_DataMapOfIntegerPart& operator =(const McCadModelManager_DataMapOfIntegerPart& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadModelManager_DataMapOfIntegerPart() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const McCadModelManager_Part& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const McCadModelManager_Part& Find(const Standard_Integer& K) const; + const McCadModelManager_Part& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT McCadModelManager_Part& ChangeFind(const Standard_Integer& K) ; + McCadModelManager_Part& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadModelManager_DataMapOfIntegerPart(const McCadModelManager_DataMapOfIntegerPart& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_DataMapOfShapePtrInteger.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapOfShapePtrInteger.hxx new file mode 100644 index 0000000..12264b3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_DataMapOfShapePtrInteger.hxx @@ -0,0 +1,158 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_DataMapOfShapePtrInteger_HeaderFile +#define _McCadModelManager_DataMapOfShapePtrInteger_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _McCadModelManager_ShapePtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadModelManager_MapShapePtrHasher; +class McCadModelManager_DataMapNodeOfDataMapOfShapePtrInteger; +class McCadModelManager_DataMapIteratorOfDataMapOfShapePtrInteger; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_DataMapOfShapePtrInteger : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadModelManager_DataMapOfShapePtrInteger(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadModelManager_DataMapOfShapePtrInteger& Assign(const McCadModelManager_DataMapOfShapePtrInteger& Other) ; + McCadModelManager_DataMapOfShapePtrInteger& operator =(const McCadModelManager_DataMapOfShapePtrInteger& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadModelManager_DataMapOfShapePtrInteger() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const McCadModelManager_ShapePtr& K,const Standard_Integer& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const McCadModelManager_ShapePtr& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const McCadModelManager_ShapePtr& K) ; + + +Standard_EXPORT const Standard_Integer& Find(const McCadModelManager_ShapePtr& K) const; + const Standard_Integer& operator()(const McCadModelManager_ShapePtr& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Standard_Integer& ChangeFind(const McCadModelManager_ShapePtr& K) ; + Standard_Integer& operator()(const McCadModelManager_ShapePtr& K) +{ + return ChangeFind(K); +} + + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadModelManager_DataMapOfShapePtrInteger(const McCadModelManager_DataMapOfShapePtrInteger& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_HSequenceOfModelParties.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_HSequenceOfModelParties.hxx new file mode 100644 index 0000000..d1639f6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_HSequenceOfModelParties.hxx @@ -0,0 +1,183 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_HSequenceOfModelParties_HeaderFile +#define _McCadModelManager_HSequenceOfModelParties_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_HSequenceOfModelParties_HeaderFile +#include +#endif + +#ifndef _McCadModelManager_SequenceOfModelParties_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadModelManager_Part; +class McCadModelManager_SequenceOfModelParties; + + + +class McCadModelManager_HSequenceOfModelParties : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadModelManager_HSequenceOfModelParties(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const McCadModelManager_Part& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadModelManager_HSequenceOfModelParties)& aSequence) ; + + +Standard_EXPORT void Prepend(const McCadModelManager_Part& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadModelManager_HSequenceOfModelParties)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const McCadModelManager_Part& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadModelManager_HSequenceOfModelParties)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const McCadModelManager_Part& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadModelManager_HSequenceOfModelParties)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadModelManager_HSequenceOfModelParties Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const McCadModelManager_Part& anItem) ; + + +Standard_EXPORT const McCadModelManager_Part& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT McCadModelManager_Part& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadModelManager_SequenceOfModelParties& Sequence() const; + + McCadModelManager_SequenceOfModelParties& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadModelManager_HSequenceOfModelParties ShallowCopy() const; +//Standard_EXPORT ~McCadModelManager_HSequenceOfModelParties(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadModelManager_SequenceOfModelParties mySequence; + + +}; + +#define Item McCadModelManager_Part +#define Item_hxx +#define TheSequence McCadModelManager_SequenceOfModelParties +#define TheSequence_hxx +#define TCollection_HSequence McCadModelManager_HSequenceOfModelParties +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadModelManager_HSequenceOfModelParties +#define TCollection_HSequence_Type_() McCadModelManager_HSequenceOfModelParties_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadModelManager_HSequenceOfModelParties ShallowCopy(const Handle_McCadModelManager_HSequenceOfModelParties& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_MapIntegerHasher.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_MapIntegerHasher.hxx new file mode 100644 index 0000000..76ab18f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_MapIntegerHasher.hxx @@ -0,0 +1,100 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_MapIntegerHasher_HeaderFile +#define _McCadModelManager_MapIntegerHasher_HeaderFile + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_MapIntegerHasher { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static Standard_Integer HashCode(const Standard_Integer& K,const Standard_Integer Upper) ; + + +Standard_EXPORT static Standard_Boolean IsEqual(const Standard_Integer& K1,const Standard_Integer& K2) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_MapShapePtrHasher.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_MapShapePtrHasher.hxx new file mode 100644 index 0000000..7d77eaa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_MapShapePtrHasher.hxx @@ -0,0 +1,103 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_MapShapePtrHasher_HeaderFile +#define _McCadModelManager_MapShapePtrHasher_HeaderFile + +#ifndef _McCadModelManager_ShapePtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_MapShapePtrHasher { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT static Standard_Integer HashCode(const McCadModelManager_ShapePtr& K,const Standard_Integer Upper) ; + + +Standard_EXPORT static Standard_Boolean IsEqual(const McCadModelManager_ShapePtr& K1,const McCadModelManager_ShapePtr& K2) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_Model.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_Model.hxx new file mode 100644 index 0000000..dff4659 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_Model.hxx @@ -0,0 +1,245 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_Model_HeaderFile +#define _McCadModelManager_Model_HeaderFile + +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _McCadConvertTools_ConvertorPtr_HeaderFile +#include +#endif +#ifndef _McCadConvertTools_VoidGeneratorPtr_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _MeshVS_DataMapOfIntegerAsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile +#include +#endif +#ifndef _McCadModelManager_DataMapOfShapePtrInteger_HeaderFile +#include +#endif +#ifndef _McCadModelManager_DataMapOfIntegerPart_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Quantity_NameOfColor_HeaderFile +#include +#endif +#ifndef _Graphic3d_NameOfMaterial_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class TCollection_AsciiString; +class TopoDS_Shape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_Model { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadModelManager_Model(); + + +Standard_EXPORT void Init() ; + + +Standard_EXPORT void SetModelName(const TCollection_AsciiString& theName) ; + + +Standard_EXPORT TCollection_AsciiString GetModelName() ; + + +Standard_EXPORT void SetComponentName(const Standard_Integer theCID,const TCollection_AsciiString& theName) ; + + +Standard_EXPORT TCollection_AsciiString GetComponentName(const Standard_Integer theCID) ; + + +Standard_EXPORT void AddComponent(const Handle(TopTools_HSequenceOfShape)& theHSeqOfShp) ; + + +Standard_EXPORT void AddPartToComponent(const Standard_Integer theCID,const TopoDS_Shape& theShape) ; + + +Standard_EXPORT void MovePartToComponent(const Standard_Integer theID,const Standard_Integer theCID) ; + + +Standard_EXPORT void FreePartFromComponent(const Standard_Integer theID,const Standard_Integer theCID) ; + + +Standard_EXPORT void DeletePart(const Standard_Integer theID) ; + + +Standard_EXPORT void DeleteComponent(const Standard_Integer theCID) ; + + +Standard_EXPORT void HidePart(const Standard_Integer theID) ; + + +Standard_EXPORT void UnHidePart(const Standard_Integer theID) ; + + +Standard_EXPORT Standard_Integer NumberOfShapes() ; + + +Standard_EXPORT TopoDS_Shape GetShapeByID(const Standard_Integer theID) ; + + +Standard_EXPORT Standard_Integer GetID(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetComponent(const Standard_Integer theCID) ; + + +Standard_EXPORT Standard_Integer GetCIDbyID(const Standard_Integer theID) ; + + +Standard_EXPORT Standard_Integer GetCIDbyShape(const TopoDS_Shape& theShape) ; + + +Standard_EXPORT TCollection_AsciiString GetCName(const Standard_Integer theCID) ; + + +Standard_EXPORT TCollection_AsciiString GetNameByID(const Standard_Integer theID) ; + + +Standard_EXPORT Quantity_NameOfColor GetComponentColor(const Standard_Integer theID) ; + + +Standard_EXPORT Graphic3d_NameOfMaterial GetComponentMaterial(const Standard_Integer theID) ; + + +Standard_EXPORT Standard_Integer GetComponentTransparency(const Standard_Integer theID) ; + + +Standard_EXPORT McCadConvertTools_ConvertorPtr GetConvertor() ; + + +Standard_EXPORT McCadConvertTools_VoidGeneratorPtr GetVoidGenerator() ; + + +Standard_EXPORT Standard_Boolean ConvertModel() ; + + +Standard_EXPORT Standard_Boolean DecomposeModel() ; + + +Standard_EXPORT Standard_Boolean GenerateVoids() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetModel() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetDecomposedModel() ; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetVoidCellModel() ; + + +Standard_EXPORT Standard_Boolean WriteMCNPfile(const TCollection_AsciiString& theFile) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void DeleteShape(const TopoDS_Shape& theShape) ; + + + // Fields PRIVATE + // +Handle_TopTools_HSequenceOfShape myModelShapes; +Handle_TopTools_HSequenceOfShape myConvertedModelShapes; +McCadConvertTools_ConvertorPtr myConvertor; +McCadConvertTools_VoidGeneratorPtr myVG; +TCollection_AsciiString myModelName; +MeshVS_DataMapOfIntegerAsciiString myComponentNames; +Standard_Integer myIDCount; +TColStd_DataMapOfIntegerListOfInteger myComponentMap; +McCadModelManager_DataMapOfShapePtrInteger myShapeIDMap; +McCadModelManager_DataMapOfIntegerPart myIDPartMap; +Standard_Integer myComponentsCount; +Standard_Boolean myIsConverted; +Standard_Boolean myIsDecomposed; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_Model.ixx b/src/MCCAD/McCadHeaders/McCadModelManager_Model.ixx new file mode 100644 index 0000000..99862c8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_Model.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_Model.jxx b/src/MCCAD/McCadHeaders/McCadModelManager_Model.jxx new file mode 100644 index 0000000..3f4a9c3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_Model.jxx @@ -0,0 +1,12 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _McCadModelManager_Model_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_Part.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_Part.hxx new file mode 100644 index 0000000..6fdb9f9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_Part.hxx @@ -0,0 +1,159 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_Part_HeaderFile +#define _McCadModelManager_Part_HeaderFile + +#ifndef _Quantity_NameOfColor_HeaderFile +#include +#endif +#ifndef _Graphic3d_NameOfMaterial_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _McCadModelManager_ShapePtr_HeaderFile +#include +#endif + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_Part { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadModelManager_Part(const Standard_Integer aCID = -1,const Quantity_NameOfColor aColor = Quantity_NOC_ORANGE,const Graphic3d_NameOfMaterial aMaterial = Graphic3d_NOM_PLASTIC); + + +Standard_EXPORT McCadModelManager_ShapePtr Shape() const; + + +Standard_EXPORT Standard_Boolean IsTransparent() const; + + +Standard_EXPORT Standard_Integer Transparency() const; + + +Standard_EXPORT Quantity_NameOfColor Color() const; + + +Standard_EXPORT Standard_Integer ID() const; + + +Standard_EXPORT Graphic3d_NameOfMaterial Material() const; + + +Standard_EXPORT Standard_Boolean Visible() const; + + +Standard_EXPORT Standard_Integer ParentComponent() const; + + +Standard_EXPORT void SetTransparency(const Standard_Integer theTransparency) ; + + +Standard_EXPORT void SetColor(const Quantity_NameOfColor theColor) ; + + +Standard_EXPORT void SetMaterial(const Graphic3d_NameOfMaterial theMaterial) ; + + +Standard_EXPORT void SetShape(const McCadModelManager_ShapePtr& theShape) ; + + +Standard_EXPORT void SetVisible(const Standard_Boolean Visible) ; + + +Standard_EXPORT void SetParentComponent(const Standard_Integer theCID) ; + + +Standard_EXPORT void SetID(const Standard_Integer theID) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Quantity_NameOfColor myOCCColor; +Graphic3d_NameOfMaterial myOCCMaterial; +Standard_Integer myOCCTransparency; +Standard_Boolean myHaveTransparency; +McCadModelManager_ShapePtr myShape; +Standard_Boolean myIsVisible; +Standard_Integer myParentComponent; +Standard_Integer myID; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_Part.ixx b/src/MCCAD/McCadHeaders/McCadModelManager_Part.ixx new file mode 100644 index 0000000..6b3b70b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_Part.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_Part.jxx b/src/MCCAD/McCadHeaders/McCadModelManager_Part.jxx new file mode 100644 index 0000000..d5876ea --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_Part.jxx @@ -0,0 +1,3 @@ +#ifndef _McCadModelManager_Part_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_SequenceNodeOfSequenceOfModelParties.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_SequenceNodeOfSequenceOfModelParties.hxx new file mode 100644 index 0000000..8b44d08 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_SequenceNodeOfSequenceOfModelParties.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_SequenceNodeOfSequenceOfModelParties_HeaderFile +#define _McCadModelManager_SequenceNodeOfSequenceOfModelParties_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties_HeaderFile +#include +#endif + +#ifndef _McCadModelManager_Part_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadModelManager_Part; +class McCadModelManager_SequenceOfModelParties; + + + +class McCadModelManager_SequenceNodeOfSequenceOfModelParties : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadModelManager_SequenceNodeOfSequenceOfModelParties(const McCadModelManager_Part& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + McCadModelManager_Part& Value() const; +//Standard_EXPORT ~McCadModelManager_SequenceNodeOfSequenceOfModelParties(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadModelManager_Part myValue; + + +}; + +#define SeqItem McCadModelManager_Part +#define SeqItem_hxx +#define TCollection_SequenceNode McCadModelManager_SequenceNodeOfSequenceOfModelParties +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties +#define TCollection_SequenceNode_Type_() McCadModelManager_SequenceNodeOfSequenceOfModelParties_Type_() +#define TCollection_Sequence McCadModelManager_SequenceOfModelParties +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_SequenceOfModelParties.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_SequenceOfModelParties.hxx new file mode 100644 index 0000000..b6af8b2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_SequenceOfModelParties.hxx @@ -0,0 +1,191 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_SequenceOfModelParties_HeaderFile +#define _McCadModelManager_SequenceOfModelParties_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadModelManager_Part; +class McCadModelManager_SequenceNodeOfSequenceOfModelParties; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadModelManager_SequenceOfModelParties : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadModelManager_SequenceOfModelParties(); + + +Standard_EXPORT void Clear() ; +~McCadModelManager_SequenceOfModelParties() +{ + Clear(); +} + + + +Standard_EXPORT const McCadModelManager_SequenceOfModelParties& Assign(const McCadModelManager_SequenceOfModelParties& Other) ; + const McCadModelManager_SequenceOfModelParties& operator =(const McCadModelManager_SequenceOfModelParties& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const McCadModelManager_Part& T) ; + + void Append(McCadModelManager_SequenceOfModelParties& S) ; + + +Standard_EXPORT void Prepend(const McCadModelManager_Part& T) ; + + void Prepend(McCadModelManager_SequenceOfModelParties& S) ; + + void InsertBefore(const Standard_Integer Index,const McCadModelManager_Part& T) ; + + void InsertBefore(const Standard_Integer Index,McCadModelManager_SequenceOfModelParties& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const McCadModelManager_Part& T) ; + + void InsertAfter(const Standard_Integer Index,McCadModelManager_SequenceOfModelParties& S) ; + + +Standard_EXPORT const McCadModelManager_Part& First() const; + + +Standard_EXPORT const McCadModelManager_Part& Last() const; + + void Split(const Standard_Integer Index,McCadModelManager_SequenceOfModelParties& Sub) ; + + +Standard_EXPORT const McCadModelManager_Part& Value(const Standard_Integer Index) const; + const McCadModelManager_Part& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const McCadModelManager_Part& I) ; + + +Standard_EXPORT McCadModelManager_Part& ChangeValue(const Standard_Integer Index) ; + McCadModelManager_Part& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadModelManager_SequenceOfModelParties(const McCadModelManager_SequenceOfModelParties& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem McCadModelManager_Part +#define SeqItem_hxx +#define TCollection_SequenceNode McCadModelManager_SequenceNodeOfSequenceOfModelParties +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadModelManager_SequenceNodeOfSequenceOfModelParties +#define TCollection_SequenceNode_Type_() McCadModelManager_SequenceNodeOfSequenceOfModelParties_Type_() +#define TCollection_Sequence McCadModelManager_SequenceOfModelParties +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadModelManager_ShapePtr.hxx b/src/MCCAD/McCadHeaders/McCadModelManager_ShapePtr.hxx new file mode 100644 index 0000000..701b9c4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadModelManager_ShapePtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadModelManager_ShapePtr_HeaderFile +#define _McCadModelManager_ShapePtr_HeaderFile + +class TopoDS_Shape; + +typedef TopoDS_Shape* McCadModelManager_ShapePtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrintUsage.h b/src/MCCAD/McCadHeaders/McCadPrintUsage.h new file mode 100644 index 0000000..fab0780 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrintUsage.h @@ -0,0 +1,39 @@ +#ifndef MCCADPRINTUSAGE_H +#define MCCADPRINTUSAGE_H +#include + +// Print usage message +////////////////////////////// +void printUsage(const TCollection_AsciiString& theProg = "McCad") { + cout << "=============================================\n" << + " " << theProg.ToCString() << " " << MCCAD_VERSION_MAJOR << "." << + MCCAD_VERSION_MINOR << "." << + MCCAD_VERSION_PATCH << endl << + "=============================================\n\n" << + theProg.ToCString() << " is a CAD interface for Monte Carlo Transport Codes.\n\n" << + "Usage: " << theProg.ToCString() <<" [Options] [File | Path]\n\n" << + "Options:\n" << + "\t -d, --decompose :\n" << + "\t\t\t Decomposes the CAD input file, requires a STEP-FILE\n" << + "\t\t\t If no output file is defined, the output will be saved as\n" << + "\t\t\t converted'FILE'. \n" << + "\t -e, --explode: \n" << + "\t\t\t Calls the Exploder, requires a STEP-FILE\n" << + "\t\t\t Explodes all solids in a STEP file to distinct files.\n" << + "\t\t\t Does not accept an Output File.\n" << + "\t -f, --fuse : \n" << + "\t\t\t Calls the Fusioner, requires a DIRECTORY\n" << + "\t\t\t Fuses all STEP-FILES in the passed Directory into one single file.\n" << + "\t -m, --mcnp: \n" << + "\t\t\t Calls the VoidGenerator to generate void volumes,\n" << + "\t\t\t and prints the mcnp geometry into a file; requires an McCad_InputFile.\n" << + "\t\t\t See manual for more details on the InputFile.\n" << + "\t -s, --surface-check: \n" << + "\t\t\t Prints a list of all surface types of a given model into the output file.\n" << + "\t -t, --tripoli: \n" << + "\t\t\t Calls the VoidGenerator to generate void volumes,\n" << + "\t\t\t and prints the tripoli geometry into a file; requires an McCad_InputFile.\n" << + "\t\t\t See manual for more details on the InputFile.\n\n"; +} + +#endif // MCCADPRINTUSAGE_H diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.hxx new file mode 100644 index 0000000..432b2d5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.hxx @@ -0,0 +1,131 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_AISInfo_HeaderFile +#define _McCadPrsStd_AISInfo_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif + +#ifndef _Quantity_NameOfColor_HeaderFile +#include +#endif +#ifndef _Graphic3d_NameOfMaterial_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +class TCollection_AsciiString; + + +//! decorates the AIS_InteractiveObject
+class McCadPrsStd_AISInfo : public MMgt_TShared { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_AISInfo(); + + +Standard_EXPORT McCadPrsStd_AISInfo(const TCollection_AsciiString& theName); + + +Standard_EXPORT Graphic3d_NameOfMaterial Material() const; + + +Standard_EXPORT void SetMaterial(const Graphic3d_NameOfMaterial aMatName) ; + + +Standard_EXPORT Quantity_NameOfColor Color() const; + + +Standard_EXPORT void SetColor(const Quantity_NameOfColor aColor) ; + + +Standard_EXPORT TCollection_AsciiString Name() const; + + +Standard_EXPORT void SetName(const TCollection_AsciiString& theName) ; + + +Standard_EXPORT Standard_Integer Status() const; + + +Standard_EXPORT void SetStatus(const Standard_Integer theMode) ; +//Standard_EXPORT ~McCadPrsStd_AISInfo(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Quantity_NameOfColor myColor; +Graphic3d_NameOfMaterial myMaterial; +TCollection_AsciiString myName; +Standard_Integer myStatus; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.ixx b/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.ixx new file mode 100644 index 0000000..acf4a33 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadPrsStd_AISInfo::~McCadPrsStd_AISInfo() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadPrsStd_AISInfo_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadPrsStd_AISInfo", + sizeof(McCadPrsStd_AISInfo), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadPrsStd_AISInfo) Handle(McCadPrsStd_AISInfo)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadPrsStd_AISInfo) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadPrsStd_AISInfo))) { + _anOtherObject = Handle(McCadPrsStd_AISInfo)((Handle(McCadPrsStd_AISInfo)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadPrsStd_AISInfo::DynamicType() const +{ + return STANDARD_TYPE(McCadPrsStd_AISInfo) ; +} +//Standard_Boolean McCadPrsStd_AISInfo::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadPrsStd_AISInfo) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadPrsStd_AISInfo::~Handle_McCadPrsStd_AISInfo() {} + diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.jxx b/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.jxx new file mode 100644 index 0000000..9f40827 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_AISInfo.jxx @@ -0,0 +1,6 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadPrsStd_AISInfo_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo.hxx new file mode 100644 index 0000000..f6b5e3b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo.hxx @@ -0,0 +1,121 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo_HeaderFile +#define _McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_AIS_InteractiveObject_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class AIS_InteractiveObject; +class McCadPrsStd_AISInfo; +class TColStd_MapTransientHasher; +class McCadPrsStd_DataMapOfAISWithInfo; +class McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo(); + + +Standard_EXPORT McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo(const McCadPrsStd_DataMapOfAISWithInfo& aMap); + + +Standard_EXPORT void Initialize(const McCadPrsStd_DataMapOfAISWithInfo& aMap) ; + + +Standard_EXPORT const Handle_AIS_InteractiveObject& Key() const; + + +Standard_EXPORT const Handle_McCadPrsStd_AISInfo& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo.hxx new file mode 100644 index 0000000..0954c01 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile +#define _McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile +#include +#endif + +#ifndef _Handle_AIS_InteractiveObject_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class AIS_InteractiveObject; +class McCadPrsStd_AISInfo; +class TColStd_MapTransientHasher; +class McCadPrsStd_DataMapOfAISWithInfo; +class McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo; + + + +class McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo(const Handle(AIS_InteractiveObject)& K,const Handle(McCadPrsStd_AISInfo)& I,const TCollection_MapNodePtr& n); + + Handle_AIS_InteractiveObject& Key() const; + + Handle_McCadPrsStd_AISInfo& Value() const; +//Standard_EXPORT ~McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_AIS_InteractiveObject myKey; +Handle_McCadPrsStd_AISInfo myValue; + + +}; + +#define TheKey Handle_AIS_InteractiveObject +#define TheKey_hxx +#define TheItem Handle_McCadPrsStd_AISInfo +#define TheItem_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo +#define TCollection_DataMapNode_Type_() McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_Type_() +#define TCollection_DataMap McCadPrsStd_DataMapOfAISWithInfo +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapOfAISWithInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapOfAISWithInfo.hxx new file mode 100644 index 0000000..832e4e1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_DataMapOfAISWithInfo.hxx @@ -0,0 +1,163 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_DataMapOfAISWithInfo_HeaderFile +#define _McCadPrsStd_DataMapOfAISWithInfo_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_AIS_InteractiveObject_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class AIS_InteractiveObject; +class McCadPrsStd_AISInfo; +class TColStd_MapTransientHasher; +class McCadPrsStd_DataMapNodeOfDataMapOfAISWithInfo; +class McCadPrsStd_DataMapIteratorOfDataMapOfAISWithInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_DataMapOfAISWithInfo : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_DataMapOfAISWithInfo(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadPrsStd_DataMapOfAISWithInfo& Assign(const McCadPrsStd_DataMapOfAISWithInfo& Other) ; + McCadPrsStd_DataMapOfAISWithInfo& operator =(const McCadPrsStd_DataMapOfAISWithInfo& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadPrsStd_DataMapOfAISWithInfo() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Handle(AIS_InteractiveObject)& K,const Handle(McCadPrsStd_AISInfo)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Handle(AIS_InteractiveObject)& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Handle(AIS_InteractiveObject)& K) ; + + +Standard_EXPORT const Handle_McCadPrsStd_AISInfo& Find(const Handle(AIS_InteractiveObject)& K) const; + const Handle_McCadPrsStd_AISInfo& operator()(const Handle(AIS_InteractiveObject)& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadPrsStd_AISInfo& ChangeFind(const Handle(AIS_InteractiveObject)& K) ; + Handle_McCadPrsStd_AISInfo& operator()(const Handle(AIS_InteractiveObject)& K) +{ + return ChangeFind(K); +} + + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadPrsStd_DataMapOfAISWithInfo(const McCadPrsStd_DataMapOfAISWithInfo& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_ListIteratorOfListOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_ListIteratorOfListOfAISInfo.hxx new file mode 100644 index 0000000..ea92f86 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_ListIteratorOfListOfAISInfo.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_ListIteratorOfListOfAISInfo_HeaderFile +#define _McCadPrsStd_ListIteratorOfListOfAISInfo_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadPrsStd_ListOfAISInfo; +class McCadPrsStd_AISInfo; +class McCadPrsStd_ListNodeOfListOfAISInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_ListIteratorOfListOfAISInfo { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_ListIteratorOfListOfAISInfo(); + + +Standard_EXPORT McCadPrsStd_ListIteratorOfListOfAISInfo(const McCadPrsStd_ListOfAISInfo& L); + + +Standard_EXPORT void Initialize(const McCadPrsStd_ListOfAISInfo& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT Handle_McCadPrsStd_AISInfo& Value() const; + + +friend class McCadPrsStd_ListOfAISInfo; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item Handle_McCadPrsStd_AISInfo +#define Item_hxx +#define TCollection_ListNode McCadPrsStd_ListNodeOfListOfAISInfo +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadPrsStd_ListIteratorOfListOfAISInfo +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadPrsStd_ListNodeOfListOfAISInfo +#define TCollection_ListNode_Type_() McCadPrsStd_ListNodeOfListOfAISInfo_Type_() +#define TCollection_List McCadPrsStd_ListOfAISInfo +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_ListNodeOfListOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_ListNodeOfListOfAISInfo.hxx new file mode 100644 index 0000000..bb6d892 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_ListNodeOfListOfAISInfo.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile +#define _McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile +#include +#endif + +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadPrsStd_AISInfo; +class McCadPrsStd_ListOfAISInfo; +class McCadPrsStd_ListIteratorOfListOfAISInfo; + + + +class McCadPrsStd_ListNodeOfListOfAISInfo : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadPrsStd_ListNodeOfListOfAISInfo(const Handle(McCadPrsStd_AISInfo)& I,const TCollection_MapNodePtr& n); + + Handle_McCadPrsStd_AISInfo& Value() const; +//Standard_EXPORT ~McCadPrsStd_ListNodeOfListOfAISInfo(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadPrsStd_AISInfo myValue; + + +}; + +#define Item Handle_McCadPrsStd_AISInfo +#define Item_hxx +#define TCollection_ListNode McCadPrsStd_ListNodeOfListOfAISInfo +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadPrsStd_ListIteratorOfListOfAISInfo +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadPrsStd_ListNodeOfListOfAISInfo +#define TCollection_ListNode_Type_() McCadPrsStd_ListNodeOfListOfAISInfo_Type_() +#define TCollection_List McCadPrsStd_ListOfAISInfo +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_ListOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_ListOfAISInfo.hxx new file mode 100644 index 0000000..1c3b23f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_ListOfAISInfo.hxx @@ -0,0 +1,200 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_ListOfAISInfo_HeaderFile +#define _McCadPrsStd_ListOfAISInfo_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_ListNodeOfListOfAISInfo_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadPrsStd_ListIteratorOfListOfAISInfo; +class McCadPrsStd_AISInfo; +class McCadPrsStd_ListNodeOfListOfAISInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_ListOfAISInfo { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_ListOfAISInfo(); + + +Standard_EXPORT void Assign(const McCadPrsStd_ListOfAISInfo& Other) ; + void operator=(const McCadPrsStd_ListOfAISInfo& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadPrsStd_ListOfAISInfo() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const Handle(McCadPrsStd_AISInfo)& I) ; + + +Standard_EXPORT void Prepend(const Handle(McCadPrsStd_AISInfo)& I,McCadPrsStd_ListIteratorOfListOfAISInfo& theIt) ; + + +Standard_EXPORT void Prepend(McCadPrsStd_ListOfAISInfo& Other) ; + + +Standard_EXPORT void Append(const Handle(McCadPrsStd_AISInfo)& I) ; + + +Standard_EXPORT void Append(const Handle(McCadPrsStd_AISInfo)& I,McCadPrsStd_ListIteratorOfListOfAISInfo& theIt) ; + + +Standard_EXPORT void Append(McCadPrsStd_ListOfAISInfo& Other) ; + + +Standard_EXPORT Handle_McCadPrsStd_AISInfo& First() const; + + +Standard_EXPORT Handle_McCadPrsStd_AISInfo& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadPrsStd_ListIteratorOfListOfAISInfo& It) ; + + +Standard_EXPORT void InsertBefore(const Handle(McCadPrsStd_AISInfo)& I,McCadPrsStd_ListIteratorOfListOfAISInfo& It) ; + + +Standard_EXPORT void InsertBefore(McCadPrsStd_ListOfAISInfo& Other,McCadPrsStd_ListIteratorOfListOfAISInfo& It) ; + + +Standard_EXPORT void InsertAfter(const Handle(McCadPrsStd_AISInfo)& I,McCadPrsStd_ListIteratorOfListOfAISInfo& It) ; + + +Standard_EXPORT void InsertAfter(McCadPrsStd_ListOfAISInfo& Other,McCadPrsStd_ListIteratorOfListOfAISInfo& It) ; + + +friend class McCadPrsStd_ListIteratorOfListOfAISInfo; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadPrsStd_ListOfAISInfo(const McCadPrsStd_ListOfAISInfo& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item Handle_McCadPrsStd_AISInfo +#define Item_hxx +#define TCollection_ListNode McCadPrsStd_ListNodeOfListOfAISInfo +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadPrsStd_ListIteratorOfListOfAISInfo +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadPrsStd_ListNodeOfListOfAISInfo +#define TCollection_ListNode_Type_() McCadPrsStd_ListNodeOfListOfAISInfo_Type_() +#define TCollection_List McCadPrsStd_ListOfAISInfo +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_MapIteratorOfMapOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_MapIteratorOfMapOfAISInfo.hxx new file mode 100644 index 0000000..b366a8d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_MapIteratorOfMapOfAISInfo.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_MapIteratorOfMapOfAISInfo_HeaderFile +#define _McCadPrsStd_MapIteratorOfMapOfAISInfo_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadPrsStd_AISInfo; +class TColStd_MapTransientHasher; +class McCadPrsStd_MapOfAISInfo; +class McCadPrsStd_StdMapNodeOfMapOfAISInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_MapIteratorOfMapOfAISInfo : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_MapIteratorOfMapOfAISInfo(); + + +Standard_EXPORT McCadPrsStd_MapIteratorOfMapOfAISInfo(const McCadPrsStd_MapOfAISInfo& aMap); + + +Standard_EXPORT void Initialize(const McCadPrsStd_MapOfAISInfo& aMap) ; + + +Standard_EXPORT const Handle_McCadPrsStd_AISInfo& Key() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_MapOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_MapOfAISInfo.hxx new file mode 100644 index 0000000..481e9b1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_MapOfAISInfo.hxx @@ -0,0 +1,142 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_MapOfAISInfo_HeaderFile +#define _McCadPrsStd_MapOfAISInfo_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class McCadPrsStd_AISInfo; +class TColStd_MapTransientHasher; +class McCadPrsStd_StdMapNodeOfMapOfAISInfo; +class McCadPrsStd_MapIteratorOfMapOfAISInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_MapOfAISInfo : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadPrsStd_MapOfAISInfo(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadPrsStd_MapOfAISInfo& Assign(const McCadPrsStd_MapOfAISInfo& Other) ; + McCadPrsStd_MapOfAISInfo& operator =(const McCadPrsStd_MapOfAISInfo& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadPrsStd_MapOfAISInfo() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Add(const Handle(McCadPrsStd_AISInfo)& aKey) ; + + +Standard_EXPORT Standard_Boolean Contains(const Handle(McCadPrsStd_AISInfo)& aKey) const; + + +Standard_EXPORT Standard_Boolean Remove(const Handle(McCadPrsStd_AISInfo)& aKey) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadPrsStd_MapOfAISInfo(const McCadPrsStd_MapOfAISInfo& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_SequenceNodeOfSequenceOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_SequenceNodeOfSequenceOfAISInfo.hxx new file mode 100644 index 0000000..701ef18 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_SequenceNodeOfSequenceOfAISInfo.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_HeaderFile +#define _McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_HeaderFile +#include +#endif + +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadPrsStd_AISInfo; +class McCadPrsStd_SequenceOfAISInfo; + + + +class McCadPrsStd_SequenceNodeOfSequenceOfAISInfo : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadPrsStd_SequenceNodeOfSequenceOfAISInfo(const Handle(McCadPrsStd_AISInfo)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadPrsStd_AISInfo& Value() const; +//Standard_EXPORT ~McCadPrsStd_SequenceNodeOfSequenceOfAISInfo(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadPrsStd_AISInfo myValue; + + +}; + +#define SeqItem Handle_McCadPrsStd_AISInfo +#define SeqItem_hxx +#define TCollection_SequenceNode McCadPrsStd_SequenceNodeOfSequenceOfAISInfo +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo +#define TCollection_SequenceNode_Type_() McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_Type_() +#define TCollection_Sequence McCadPrsStd_SequenceOfAISInfo +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_SequenceOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_SequenceOfAISInfo.hxx new file mode 100644 index 0000000..8928ff8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_SequenceOfAISInfo.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_SequenceOfAISInfo_HeaderFile +#define _McCadPrsStd_SequenceOfAISInfo_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadPrsStd_AISInfo; +class McCadPrsStd_SequenceNodeOfSequenceOfAISInfo; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPrsStd_SequenceOfAISInfo : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadPrsStd_SequenceOfAISInfo(); + + +Standard_EXPORT void Clear() ; +~McCadPrsStd_SequenceOfAISInfo() +{ + Clear(); +} + + + +Standard_EXPORT const McCadPrsStd_SequenceOfAISInfo& Assign(const McCadPrsStd_SequenceOfAISInfo& Other) ; + const McCadPrsStd_SequenceOfAISInfo& operator =(const McCadPrsStd_SequenceOfAISInfo& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadPrsStd_AISInfo)& T) ; + + void Append(McCadPrsStd_SequenceOfAISInfo& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadPrsStd_AISInfo)& T) ; + + void Prepend(McCadPrsStd_SequenceOfAISInfo& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadPrsStd_AISInfo)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadPrsStd_SequenceOfAISInfo& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadPrsStd_AISInfo)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadPrsStd_SequenceOfAISInfo& S) ; + + +Standard_EXPORT const Handle_McCadPrsStd_AISInfo& First() const; + + +Standard_EXPORT const Handle_McCadPrsStd_AISInfo& Last() const; + + void Split(const Standard_Integer Index,McCadPrsStd_SequenceOfAISInfo& Sub) ; + + +Standard_EXPORT const Handle_McCadPrsStd_AISInfo& Value(const Standard_Integer Index) const; + const Handle_McCadPrsStd_AISInfo& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadPrsStd_AISInfo)& I) ; + + +Standard_EXPORT Handle_McCadPrsStd_AISInfo& ChangeValue(const Standard_Integer Index) ; + Handle_McCadPrsStd_AISInfo& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadPrsStd_SequenceOfAISInfo(const McCadPrsStd_SequenceOfAISInfo& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadPrsStd_AISInfo +#define SeqItem_hxx +#define TCollection_SequenceNode McCadPrsStd_SequenceNodeOfSequenceOfAISInfo +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadPrsStd_SequenceNodeOfSequenceOfAISInfo +#define TCollection_SequenceNode_Type_() McCadPrsStd_SequenceNodeOfSequenceOfAISInfo_Type_() +#define TCollection_Sequence McCadPrsStd_SequenceOfAISInfo +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPrsStd_StdMapNodeOfMapOfAISInfo.hxx b/src/MCCAD/McCadHeaders/McCadPrsStd_StdMapNodeOfMapOfAISInfo.hxx new file mode 100644 index 0000000..c6a6471 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPrsStd_StdMapNodeOfMapOfAISInfo.hxx @@ -0,0 +1,124 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile +#define _McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo_HeaderFile +#include +#endif + +#ifndef _Handle_McCadPrsStd_AISInfo_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadPrsStd_AISInfo; +class TColStd_MapTransientHasher; +class McCadPrsStd_MapOfAISInfo; +class McCadPrsStd_MapIteratorOfMapOfAISInfo; + + + +class McCadPrsStd_StdMapNodeOfMapOfAISInfo : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadPrsStd_StdMapNodeOfMapOfAISInfo(const Handle(McCadPrsStd_AISInfo)& K,const TCollection_MapNodePtr& n); + + Handle_McCadPrsStd_AISInfo& Key() const; +//Standard_EXPORT ~McCadPrsStd_StdMapNodeOfMapOfAISInfo(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadPrsStd_AISInfo myKey; + + +}; + +#define TheKey Handle_McCadPrsStd_AISInfo +#define TheKey_hxx +#define Hasher TColStd_MapTransientHasher +#define Hasher_hxx +#define TCollection_StdMapNode McCadPrsStd_StdMapNodeOfMapOfAISInfo +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator McCadPrsStd_MapIteratorOfMapOfAISInfo +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_McCadPrsStd_StdMapNodeOfMapOfAISInfo +#define TCollection_StdMapNode_Type_() McCadPrsStd_StdMapNodeOfMapOfAISInfo_Type_() +#define TCollection_Map McCadPrsStd_MapOfAISInfo +#define TCollection_Map_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_StdMapNode +#undef TCollection_StdMapNode_hxx +#undef TCollection_MapIterator +#undef TCollection_MapIterator_hxx +#undef Handle_TCollection_StdMapNode +#undef TCollection_StdMapNode_Type_ +#undef TCollection_Map +#undef TCollection_Map_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool.hxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool.hxx new file mode 100644 index 0000000..0af939e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool.hxx @@ -0,0 +1,155 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPsCSGTool_HeaderFile +#define _McCadPsCSGTool_HeaderFile + +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class TopoDS_Face; +class TColgp_HSequenceOfPnt; +class TopoDS_Shape; +class gp_Pnt; +class McCadPsCSGTool_Converter; +class McCadPsCSGTool_Extender; +class McCadPsCSGTool_BEvaluater; +class McCadPsCSGTool_Voxelizer; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPsCSGTool { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! computes resultants using BBox method.
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape Resultants(const TopoDS_Face& theFace) ; + +//! computes resultants using BBox method.
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape BoxResultants(const TopoDS_Face& theFace) ; + +//! computes partial drivatives
+//! temporary implementation only for conical surfaces!!!!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape Partials(const TopoDS_Face& theFace) ; + +//! returns non-redundant points from vertices and non-free nodes from
+//! face triangulation.
+//! used for sign computation;
+Standard_EXPORT static Handle_TColgp_HSequenceOfPnt SamplePoints(const TopoDS_Shape& theShape) ; + +//! returns non-redundant points from vertices and all points from face triangulation
+//! used for sign computation;
+Standard_EXPORT static Handle_TColgp_HSequenceOfPnt AllSamplePoints(const TopoDS_Shape& theShape) ; + +//! returns non-redundant sample points computed around a face.
+//! The method used here is scale transformation.
+Standard_EXPORT static Handle_TColgp_HSequenceOfPnt FaceSamplePoints(const TopoDS_Face& theFace,const gp_Pnt& thePnt,const Standard_Real theFact) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedLinFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedCylFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedConFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedSphFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) ; + +//! deletes redundant faces from the sequence
+//!
+Standard_EXPORT static Handle_TopTools_HSequenceOfShape DeleteRedTorFace(Handle(TopTools_HSequenceOfShape)& aFaceSeq) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + +friend class McCadPsCSGTool_Converter; +friend class McCadPsCSGTool_Extender; +friend class McCadPsCSGTool_BEvaluater; +friend class McCadPsCSGTool_Voxelizer; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool.ixx b/src/MCCAD/McCadHeaders/McCadPsCSGTool.ixx new file mode 100644 index 0000000..f231e11 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool.jxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool.jxx new file mode 100644 index 0000000..64a4c50 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool.jxx @@ -0,0 +1,18 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _McCadPsCSGTool_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.hxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.hxx new file mode 100644 index 0000000..d0093fe --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPsCSGTool_BEvaluater_HeaderFile +#define _McCadPsCSGTool_BEvaluater_HeaderFile + +#ifndef _Handle_McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadTDS_PsSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPsCSGTool_BEvaluater { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class performs the extension of a PsSolid
+Standard_EXPORT McCadPsCSGTool_BEvaluater(); + + +Standard_EXPORT McCadPsCSGTool_BEvaluater(const Handle(McCadTDS_PsSolid)& thePsSolid); + + +Standard_EXPORT void Init(const Handle(McCadTDS_PsSolid)& thePsSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_McCadTDS_PsSolid GetPsSolid() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTDS_PsSolid myMotherPsSolid; +Handle_McCadTDS_PsSolid myPsSolids; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.ixx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.ixx new file mode 100644 index 0000000..52bd56c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.jxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.jxx new file mode 100644 index 0000000..1d194da --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_BEvaluater.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _McCadPsCSGTool_BEvaluater_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.hxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.hxx new file mode 100644 index 0000000..5872579 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.hxx @@ -0,0 +1,157 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPsCSGTool_Converter_HeaderFile +#define _McCadPsCSGTool_Converter_HeaderFile + +#ifndef _Handle_McCadTDS_HSequenceOfCutFace_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_HSequenceOfPsSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_PsSolid_HeaderFile +#include +#endif +class McCadTDS_HSequenceOfCutFace; +class McCadTDS_HSequenceOfPsSolid; +class TopoDS_Solid; +class McCadTDS_PsSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPsCSGTool_Converter { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class performs sign constant decomposition
+//! of a given solid without BOP and BEV.
+//! The result is a ps-solid as describen in the documentation.
+Standard_EXPORT McCadPsCSGTool_Converter(); + + +Standard_EXPORT McCadPsCSGTool_Converter(const TopoDS_Solid& theSolid); + + +Standard_EXPORT void Init(const TopoDS_Solid& theSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT TopoDS_Solid GetMotherSolid() const; + + +Standard_EXPORT Handle_McCadTDS_HSequenceOfPsSolid ProcessedPsSolids() const; + + +Standard_EXPORT Standard_Integer NbPsSolids() const; + + +Standard_EXPORT Standard_Boolean IsTirivialSolid() const; + + +Standard_EXPORT void GenerateCutSet() ; + + +Standard_EXPORT Handle_McCadTDS_PsSolid StripOffVertices(const Handle(McCadTDS_PsSolid)& tmpPsSolid) ; + + +Standard_EXPORT void Checkresults() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTDS_HSequenceOfCutFace myCutSet; +TopoDS_Solid myMatherSolid; +Handle_McCadTDS_HSequenceOfPsSolid myPsSolids; +Standard_Integer myNbofPsSolids; +Standard_Boolean myIsDone; +Standard_Boolean myIsTrivial; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.ixx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.ixx new file mode 100644 index 0000000..ee28541 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.jxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.jxx new file mode 100644 index 0000000..826e389 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Converter.jxx @@ -0,0 +1,15 @@ +#ifndef _McCadTDS_HSequenceOfCutFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_HSequenceOfPsSolid_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _McCadPsCSGTool_Converter_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.hxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.hxx new file mode 100644 index 0000000..bf827c2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPsCSGTool_Extender_HeaderFile +#define _McCadPsCSGTool_Extender_HeaderFile + +#ifndef _Handle_McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadTDS_PsSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPsCSGTool_Extender { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class performs the extension of a PsSolid
+Standard_EXPORT McCadPsCSGTool_Extender(); + + +Standard_EXPORT McCadPsCSGTool_Extender(const Handle(McCadTDS_PsSolid)& thePsSolid); + + +Standard_EXPORT void Init(const Handle(McCadTDS_PsSolid)& thePsSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_McCadTDS_PsSolid GetPsSolid() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTDS_PsSolid myMotherPsSolid; +Handle_McCadTDS_PsSolid myPsSolids; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.ixx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.ixx new file mode 100644 index 0000000..f356d83 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.jxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.jxx new file mode 100644 index 0000000..56d3bb4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Extender.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _McCadPsCSGTool_Extender_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.hxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.hxx new file mode 100644 index 0000000..f725f52 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.hxx @@ -0,0 +1,121 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadPsCSGTool_Voxelizer_HeaderFile +#define _McCadPsCSGTool_Voxelizer_HeaderFile + +#ifndef _Handle_McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadTDS_PsSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadPsCSGTool_Voxelizer { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class performs the extension of a PsSolid
+Standard_EXPORT McCadPsCSGTool_Voxelizer(); + + +Standard_EXPORT McCadPsCSGTool_Voxelizer(const Handle(McCadTDS_PsSolid)& thePsSolid); + + +Standard_EXPORT void Init(const Handle(McCadTDS_PsSolid)& thePsSolid) ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT void Done() ; + + +Standard_EXPORT void NotDone() ; + + +Standard_EXPORT Handle_McCadTDS_PsSolid GetPsSolid() const; + + +Standard_EXPORT void VoxelizeFaces() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTDS_PsSolid myPsSolids; +Standard_Boolean myIsDone; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.ixx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.ixx new file mode 100644 index 0000000..2e4408d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.jxx b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.jxx new file mode 100644 index 0000000..96bbfe7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadPsCSGTool_Voxelizer.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadTDS_PsSolid_HeaderFile +#include +#endif +#ifndef _McCadPsCSGTool_Voxelizer_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_CutFaceType.hxx b/src/MCCAD/McCadHeaders/McCadTDS_CutFaceType.hxx new file mode 100644 index 0000000..45fcce8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_CutFaceType.hxx @@ -0,0 +1,39 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_CutFaceType_HeaderFile +#define _McCadTDS_CutFaceType_HeaderFile + + +//! This package provides extended Topological DS
+//! modified- on Tue Jul 5 10:39:10 CEST 2005
+//! New Classes PsSolid, DisPsSolid, NormFace, CutFace
//! Cut face type.
+enum McCadTDS_CutFaceType { + McCadTDS_NORMAL, +McCadTDS_RESULTANT +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace.hxx new file mode 100644 index 0000000..b4026f0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace.hxx @@ -0,0 +1,121 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_HeaderFile +#define _McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadTDS_ExtFace; +class TColStd_MapIntegerHasher; +class McCadTDS_DataMapOfIntegerExtFace; +class McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace(); + + +Standard_EXPORT McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace(const McCadTDS_DataMapOfIntegerExtFace& aMap); + + +Standard_EXPORT void Initialize(const McCadTDS_DataMapOfIntegerExtFace& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadTDS_ExtFace& Value() const; + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid.hxx new file mode 100644 index 0000000..98d7c86 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid.hxx @@ -0,0 +1,121 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_HeaderFile +#define _McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadTDS_ExtSolid; +class TColStd_MapIntegerHasher; +class McCadTDS_DataMapOfIntegerSolid; +class McCadTDS_DataMapNodeOfDataMapOfIntegerSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid(); + + +Standard_EXPORT McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid(const McCadTDS_DataMapOfIntegerSolid& aMap); + + +Standard_EXPORT void Initialize(const McCadTDS_DataMapOfIntegerSolid& aMap) ; + + +Standard_EXPORT const Standard_Integer& Key() const; + + +Standard_EXPORT const Handle_McCadTDS_ExtSolid& Value() const; + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace.hxx new file mode 100644 index 0000000..e22c8f4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#define _McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadTDS_ExtFace; +class TColStd_MapIntegerHasher; +class McCadTDS_DataMapOfIntegerExtFace; +class McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace; + + + +class McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace(const Standard_Integer& K,const Handle(McCadTDS_ExtFace)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadTDS_ExtFace& Value() const; +//Standard_EXPORT ~McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace(); + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadTDS_ExtFace myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtFace +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerExtFace +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid.hxx new file mode 100644 index 0000000..f260b5b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid.hxx @@ -0,0 +1,135 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#define _McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadTDS_ExtSolid; +class TColStd_MapIntegerHasher; +class McCadTDS_DataMapOfIntegerSolid; +class McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid; + + + +class McCadTDS_DataMapNodeOfDataMapOfIntegerSolid : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadTDS_DataMapNodeOfDataMapOfIntegerSolid(const Standard_Integer& K,const Handle(McCadTDS_ExtSolid)& I,const TCollection_MapNodePtr& n); + + Standard_Integer& Key() const; + + Handle_McCadTDS_ExtSolid& Value() const; +//Standard_EXPORT ~McCadTDS_DataMapNodeOfDataMapOfIntegerSolid(); + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey; +Handle_McCadTDS_ExtSolid myValue; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtSolid +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerSolid +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_DataMapOfIntegerExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_DataMapOfIntegerExtFace.hxx new file mode 100644 index 0000000..3f9ee43 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_DataMapOfIntegerExtFace.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_DataMapOfIntegerExtFace_HeaderFile +#define _McCadTDS_DataMapOfIntegerExtFace_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadTDS_ExtFace; +class TColStd_MapIntegerHasher; +class McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace; +class McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTDS_DataMapOfIntegerExtFace : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTDS_DataMapOfIntegerExtFace(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadTDS_DataMapOfIntegerExtFace& Assign(const McCadTDS_DataMapOfIntegerExtFace& Other) ; + McCadTDS_DataMapOfIntegerExtFace& operator =(const McCadTDS_DataMapOfIntegerExtFace& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadTDS_DataMapOfIntegerExtFace() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadTDS_ExtFace)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtFace& Find(const Standard_Integer& K) const; + const Handle_McCadTDS_ExtFace& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadTDS_ExtFace& ChangeFind(const Standard_Integer& K) ; + Handle_McCadTDS_ExtFace& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadTDS_DataMapOfIntegerExtFace(const McCadTDS_DataMapOfIntegerExtFace& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_DataMapOfIntegerSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_DataMapOfIntegerSolid.hxx new file mode 100644 index 0000000..9d65697 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_DataMapOfIntegerSolid.hxx @@ -0,0 +1,160 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_DataMapOfIntegerSolid_HeaderFile +#define _McCadTDS_DataMapOfIntegerSolid_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class McCadTDS_ExtSolid; +class TColStd_MapIntegerHasher; +class McCadTDS_DataMapNodeOfDataMapOfIntegerSolid; +class McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTDS_DataMapOfIntegerSolid : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTDS_DataMapOfIntegerSolid(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT McCadTDS_DataMapOfIntegerSolid& Assign(const McCadTDS_DataMapOfIntegerSolid& Other) ; + McCadTDS_DataMapOfIntegerSolid& operator =(const McCadTDS_DataMapOfIntegerSolid& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~McCadTDS_DataMapOfIntegerSolid() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const Handle(McCadTDS_ExtSolid)& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtSolid& Find(const Standard_Integer& K) const; + const Handle_McCadTDS_ExtSolid& operator()(const Standard_Integer& K) const +{ + return Find(K); +} + + + +Standard_EXPORT Handle_McCadTDS_ExtSolid& ChangeFind(const Standard_Integer& K) ; + Handle_McCadTDS_ExtSolid& operator()(const Standard_Integer& K) +{ + return ChangeFind(K); +} + + + +void* Find1(const Standard_Integer& K) const; +void* ChangeFind1(const Standard_Integer& K) ; + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadTDS_DataMapOfIntegerSolid(const McCadTDS_DataMapOfIntegerSolid& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.hxx new file mode 100644 index 0000000..2768449 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.hxx @@ -0,0 +1,149 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_ExtFace_HeaderFile +#define _McCadTDS_ExtFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif + +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _Handle_TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class TColgp_HSequenceOfPnt; +class TopoDS_Face; +class gp_Pnt; + + +//! \brief This is an extended face
+ +//! This is an extended face
+ + +class McCadTDS_ExtFace : public MMgt_TShared { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadTDS_ExtFace(); + + +Standard_EXPORT McCadTDS_ExtFace(const TopoDS_Face& theFace); + + +Standard_EXPORT void SetFace(const TopoDS_Face& theFace) ; + + +Standard_EXPORT TopoDS_Face GetFace() const; + + +Standard_EXPORT void AppendPosPnt(const gp_Pnt& thePnt) ; + + +Standard_EXPORT void AppendNegPnt(const gp_Pnt& thePnt) ; + + +Standard_EXPORT gp_Pnt GetPosPnt() const; + + +Standard_EXPORT gp_Pnt GetNegPnt() const; + + +Standard_EXPORT Standard_Integer NbPosPnt() const; + + +Standard_EXPORT Standard_Integer NbNegPnt() const; + + +Standard_EXPORT Handle_TColgp_HSequenceOfPnt GetPosPoints() const; + + +Standard_EXPORT Handle_TColgp_HSequenceOfPnt GetNegPoints() const; + + +Standard_EXPORT void SetHaveExt(const Standard_Boolean theHaveExt) ; + + +Standard_EXPORT Standard_Boolean HaveExt() const; +//Standard_EXPORT ~McCadTDS_ExtFace(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Standard_Boolean myHaveExt; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Face myFace; +Handle_TColgp_HSequenceOfPnt myPosPoints; +Handle_TColgp_HSequenceOfPnt myNegPoints; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.ixx b/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.ixx new file mode 100644 index 0000000..b2b6e62 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadTDS_ExtFace::~McCadTDS_ExtFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_ExtFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_ExtFace", + sizeof(McCadTDS_ExtFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_ExtFace) Handle(McCadTDS_ExtFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_ExtFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_ExtFace))) { + _anOtherObject = Handle(McCadTDS_ExtFace)((Handle(McCadTDS_ExtFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_ExtFace::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_ExtFace) ; +} +//Standard_Boolean McCadTDS_ExtFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_ExtFace) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTDS_ExtFace::~Handle_McCadTDS_ExtFace() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.jxx b/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.jxx new file mode 100644 index 0000000..27a7a27 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_ExtFace.jxx @@ -0,0 +1,12 @@ +#ifndef _TColgp_HSequenceOfPnt_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _gp_Pnt_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.hxx new file mode 100644 index 0000000..d1f61db --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.hxx @@ -0,0 +1,168 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_ExtSolid_HeaderFile +#define _McCadTDS_ExtSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif + +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _Handle_TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Standard_OStream_HeaderFile +#include +#endif +class TopTools_HSequenceOfShape; +class TopoDS_Solid; +class TopoDS_Face; +class TCollection_AsciiString; + + +//! \brief This is an extended solid
+ +//! This is an extended solid
+ +class McCadTDS_ExtSolid : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +Standard_EXPORT McCadTDS_ExtSolid(); + + +Standard_EXPORT McCadTDS_ExtSolid(const TopoDS_Solid& theSolid); + + +Standard_EXPORT void SetSolid(const TopoDS_Solid& theSolid) ; + + +Standard_EXPORT TopoDS_Solid GetSolid() const; + + +Standard_EXPORT void AppendFace(const TopoDS_Face& theFace) ; + + +Standard_EXPORT void AppendFaces(const Handle(TopTools_HSequenceOfShape)& theFaceSeq) ; + + +Standard_EXPORT TopoDS_Face GetFace() const; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetFaces() const; + + +Standard_EXPORT void SetHaveExt(const Standard_Boolean theHaveExt) ; + + +Standard_EXPORT Standard_Boolean HaveExt() const; + + +Standard_EXPORT void SetHaveComp(const Standard_Boolean theHaveComp) ; + + +Standard_EXPORT Standard_Boolean HaveComp() const; + + +Standard_EXPORT void AppendCompFace(const TopoDS_Face& theFace) ; + + +Standard_EXPORT void AppendCompFaces(const Handle(TopTools_HSequenceOfShape)& theFaceSeq) ; + + +Standard_EXPORT TopoDS_Face GetCompFace() const; + + +Standard_EXPORT Handle_TopTools_HSequenceOfShape GetCompFaces() const; + + +Standard_EXPORT void SetComment(const TCollection_AsciiString& theComment) ; + + +Standard_EXPORT TCollection_AsciiString GetComment() const; + + +Standard_EXPORT void PrintComment(Standard_OStream& theStream) ; +//Standard_EXPORT ~McCadTDS_ExtSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Standard_Boolean myHaveExt; +Standard_Boolean myHaveComplement; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Solid mySolid; +Handle_TopTools_HSequenceOfShape myFaces; +Handle_TopTools_HSequenceOfShape myComplementFaces; +TCollection_AsciiString myComment; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.ixx b/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.ixx new file mode 100644 index 0000000..e284f47 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadTDS_ExtSolid::~McCadTDS_ExtSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_ExtSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_ExtSolid", + sizeof(McCadTDS_ExtSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_ExtSolid) Handle(McCadTDS_ExtSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_ExtSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_ExtSolid))) { + _anOtherObject = Handle(McCadTDS_ExtSolid)((Handle(McCadTDS_ExtSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_ExtSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_ExtSolid) ; +} +//Standard_Boolean McCadTDS_ExtSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_ExtSolid) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTDS_ExtSolid::~Handle_McCadTDS_ExtSolid() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.jxx b/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.jxx new file mode 100644 index 0000000..6c9a7de --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_ExtSolid.jxx @@ -0,0 +1,15 @@ +#ifndef _TopTools_HSequenceOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Solid_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_HSequenceOfExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_HSequenceOfExtFace.hxx new file mode 100644 index 0000000..ed68e8c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_HSequenceOfExtFace.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_HSequenceOfExtFace_HeaderFile +#define _McCadTDS_HSequenceOfExtFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_HSequenceOfExtFace_HeaderFile +#include +#endif + +#ifndef _McCadTDS_SequenceOfExtFace_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadTDS_ExtFace; +class McCadTDS_SequenceOfExtFace; + + + +class McCadTDS_HSequenceOfExtFace : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadTDS_HSequenceOfExtFace(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadTDS_ExtFace)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadTDS_HSequenceOfExtFace)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTDS_ExtFace)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTDS_HSequenceOfExtFace)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadTDS_ExtFace)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadTDS_HSequenceOfExtFace)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadTDS_ExtFace)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadTDS_HSequenceOfExtFace)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadTDS_HSequenceOfExtFace Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadTDS_ExtFace)& anItem) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtFace& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadTDS_ExtFace& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadTDS_SequenceOfExtFace& Sequence() const; + + McCadTDS_SequenceOfExtFace& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadTDS_HSequenceOfExtFace ShallowCopy() const; +//Standard_EXPORT ~McCadTDS_HSequenceOfExtFace(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadTDS_SequenceOfExtFace mySequence; + + +}; + +#define Item Handle_McCadTDS_ExtFace +#define Item_hxx +#define TheSequence McCadTDS_SequenceOfExtFace +#define TheSequence_hxx +#define TCollection_HSequence McCadTDS_HSequenceOfExtFace +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadTDS_HSequenceOfExtFace +#define TCollection_HSequence_Type_() McCadTDS_HSequenceOfExtFace_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadTDS_HSequenceOfExtFace ShallowCopy(const Handle_McCadTDS_HSequenceOfExtFace& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_HSequenceOfExtSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_HSequenceOfExtSolid.hxx new file mode 100644 index 0000000..1f3d40d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_HSequenceOfExtSolid.hxx @@ -0,0 +1,186 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_HSequenceOfExtSolid_HeaderFile +#define _McCadTDS_HSequenceOfExtSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_HSequenceOfExtSolid_HeaderFile +#include +#endif + +#ifndef _McCadTDS_SequenceOfExtSolid_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadTDS_ExtSolid; +class McCadTDS_SequenceOfExtSolid; + + + +class McCadTDS_HSequenceOfExtSolid : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +McCadTDS_HSequenceOfExtSolid(); + + Standard_Boolean IsEmpty() const; + + Standard_Integer Length() const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT void Append(const Handle(McCadTDS_ExtSolid)& anItem) ; + + +Standard_EXPORT void Append(const Handle(McCadTDS_HSequenceOfExtSolid)& aSequence) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTDS_ExtSolid)& anItem) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTDS_HSequenceOfExtSolid)& aSequence) ; + + +Standard_EXPORT void Reverse() ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadTDS_ExtSolid)& anItem) ; + + +Standard_EXPORT void InsertBefore(const Standard_Integer anIndex,const Handle(McCadTDS_HSequenceOfExtSolid)& aSequence) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadTDS_ExtSolid)& anItem) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer anIndex,const Handle(McCadTDS_HSequenceOfExtSolid)& aSequence) ; + + +Standard_EXPORT void Exchange(const Standard_Integer anIndex,const Standard_Integer anOtherIndex) ; + + +Standard_EXPORT Handle_McCadTDS_HSequenceOfExtSolid Split(const Standard_Integer anIndex) ; + + +Standard_EXPORT void SetValue(const Standard_Integer anIndex,const Handle(McCadTDS_ExtSolid)& anItem) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtSolid& Value(const Standard_Integer anIndex) const; + + +Standard_EXPORT Handle_McCadTDS_ExtSolid& ChangeValue(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + + +Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const McCadTDS_SequenceOfExtSolid& Sequence() const; + + McCadTDS_SequenceOfExtSolid& ChangeSequence() ; + + +Standard_EXPORT Handle_McCadTDS_HSequenceOfExtSolid ShallowCopy() const; +//Standard_EXPORT ~McCadTDS_HSequenceOfExtSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadTDS_SequenceOfExtSolid mySequence; + + +}; + +#define Item Handle_McCadTDS_ExtSolid +#define Item_hxx +#define TheSequence McCadTDS_SequenceOfExtSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadTDS_HSequenceOfExtSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadTDS_HSequenceOfExtSolid +#define TCollection_HSequence_Type_() McCadTDS_HSequenceOfExtSolid_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_McCadTDS_HSequenceOfExtSolid ShallowCopy(const Handle_McCadTDS_HSequenceOfExtSolid& me) { + return me->ShallowCopy(); +} + + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_SequenceNodeOfSequenceOfExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_SequenceNodeOfSequenceOfExtFace.hxx new file mode 100644 index 0000000..8bba8eb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_SequenceNodeOfSequenceOfExtFace.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile +#define _McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadTDS_ExtFace; +class McCadTDS_SequenceOfExtFace; + + + +class McCadTDS_SequenceNodeOfSequenceOfExtFace : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadTDS_SequenceNodeOfSequenceOfExtFace(const Handle(McCadTDS_ExtFace)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadTDS_ExtFace& Value() const; +//Standard_EXPORT ~McCadTDS_SequenceNodeOfSequenceOfExtFace(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTDS_ExtFace myValue; + + +}; + +#define SeqItem Handle_McCadTDS_ExtFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtFace_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtFace +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_SequenceNodeOfSequenceOfExtSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_SequenceNodeOfSequenceOfExtSolid.hxx new file mode 100644 index 0000000..a9307f9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_SequenceNodeOfSequenceOfExtSolid.hxx @@ -0,0 +1,114 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile +#define _McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNode_HeaderFile +#include +#endif +#ifndef _TCollection_SeqNodePtr_HeaderFile +#include +#endif +class McCadTDS_ExtSolid; +class McCadTDS_SequenceOfExtSolid; + + + +class McCadTDS_SequenceNodeOfSequenceOfExtSolid : public TCollection_SeqNode { + +public: + // Methods PUBLIC + // + +McCadTDS_SequenceNodeOfSequenceOfExtSolid(const Handle(McCadTDS_ExtSolid)& I,const TCollection_SeqNodePtr& n,const TCollection_SeqNodePtr& p); + + Handle_McCadTDS_ExtSolid& Value() const; +//Standard_EXPORT ~McCadTDS_SequenceNodeOfSequenceOfExtSolid(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTDS_ExtSolid myValue; + + +}; + +#define SeqItem Handle_McCadTDS_ExtSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtSolid_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_SequenceOfExtFace.hxx b/src/MCCAD/McCadHeaders/McCadTDS_SequenceOfExtFace.hxx new file mode 100644 index 0000000..46f6b37 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_SequenceOfExtFace.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_SequenceOfExtFace_HeaderFile +#define _McCadTDS_SequenceOfExtFace_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadTDS_ExtFace; +class McCadTDS_SequenceNodeOfSequenceOfExtFace; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTDS_SequenceOfExtFace : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadTDS_SequenceOfExtFace(); + + +Standard_EXPORT void Clear() ; +~McCadTDS_SequenceOfExtFace() +{ + Clear(); +} + + + +Standard_EXPORT const McCadTDS_SequenceOfExtFace& Assign(const McCadTDS_SequenceOfExtFace& Other) ; + const McCadTDS_SequenceOfExtFace& operator =(const McCadTDS_SequenceOfExtFace& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadTDS_ExtFace)& T) ; + + void Append(McCadTDS_SequenceOfExtFace& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTDS_ExtFace)& T) ; + + void Prepend(McCadTDS_SequenceOfExtFace& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadTDS_ExtFace)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadTDS_SequenceOfExtFace& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadTDS_ExtFace)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadTDS_SequenceOfExtFace& S) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtFace& First() const; + + +Standard_EXPORT const Handle_McCadTDS_ExtFace& Last() const; + + void Split(const Standard_Integer Index,McCadTDS_SequenceOfExtFace& Sub) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtFace& Value(const Standard_Integer Index) const; + const Handle_McCadTDS_ExtFace& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadTDS_ExtFace)& I) ; + + +Standard_EXPORT Handle_McCadTDS_ExtFace& ChangeValue(const Standard_Integer Index) ; + Handle_McCadTDS_ExtFace& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadTDS_SequenceOfExtFace(const McCadTDS_SequenceOfExtFace& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadTDS_ExtFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtFace_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtFace +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTDS_SequenceOfExtSolid.hxx b/src/MCCAD/McCadHeaders/McCadTDS_SequenceOfExtSolid.hxx new file mode 100644 index 0000000..8d51be0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTDS_SequenceOfExtSolid.hxx @@ -0,0 +1,194 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTDS_SequenceOfExtSolid_HeaderFile +#define _McCadTDS_SequenceOfExtSolid_HeaderFile + +#ifndef _TCollection_BaseSequence_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class Standard_OutOfRange; +class McCadTDS_ExtSolid; +class McCadTDS_SequenceNodeOfSequenceOfExtSolid; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTDS_SequenceOfExtSolid : public TCollection_BaseSequence { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +McCadTDS_SequenceOfExtSolid(); + + +Standard_EXPORT void Clear() ; +~McCadTDS_SequenceOfExtSolid() +{ + Clear(); +} + + + +Standard_EXPORT const McCadTDS_SequenceOfExtSolid& Assign(const McCadTDS_SequenceOfExtSolid& Other) ; + const McCadTDS_SequenceOfExtSolid& operator =(const McCadTDS_SequenceOfExtSolid& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void Append(const Handle(McCadTDS_ExtSolid)& T) ; + + void Append(McCadTDS_SequenceOfExtSolid& S) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTDS_ExtSolid)& T) ; + + void Prepend(McCadTDS_SequenceOfExtSolid& S) ; + + void InsertBefore(const Standard_Integer Index,const Handle(McCadTDS_ExtSolid)& T) ; + + void InsertBefore(const Standard_Integer Index,McCadTDS_SequenceOfExtSolid& S) ; + + +Standard_EXPORT void InsertAfter(const Standard_Integer Index,const Handle(McCadTDS_ExtSolid)& T) ; + + void InsertAfter(const Standard_Integer Index,McCadTDS_SequenceOfExtSolid& S) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtSolid& First() const; + + +Standard_EXPORT const Handle_McCadTDS_ExtSolid& Last() const; + + void Split(const Standard_Integer Index,McCadTDS_SequenceOfExtSolid& Sub) ; + + +Standard_EXPORT const Handle_McCadTDS_ExtSolid& Value(const Standard_Integer Index) const; + const Handle_McCadTDS_ExtSolid& operator()(const Standard_Integer Index) const +{ + return Value(Index); +} + + + +Standard_EXPORT void SetValue(const Standard_Integer Index,const Handle(McCadTDS_ExtSolid)& I) ; + + +Standard_EXPORT Handle_McCadTDS_ExtSolid& ChangeValue(const Standard_Integer Index) ; + Handle_McCadTDS_ExtSolid& operator()(const Standard_Integer Index) +{ + return ChangeValue(Index); +} + + + +Standard_EXPORT void Remove(const Standard_Integer Index) ; + + +Standard_EXPORT void Remove(const Standard_Integer FromIndex,const Standard_Integer ToIndex) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadTDS_SequenceOfExtSolid(const McCadTDS_SequenceOfExtSolid& Other); + + + // Fields PRIVATE + // + + +}; + +#define SeqItem Handle_McCadTDS_ExtSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtSolid_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtSolid +#define TCollection_Sequence_hxx + +#include + +#undef SeqItem +#undef SeqItem_hxx +#undef TCollection_SequenceNode +#undef TCollection_SequenceNode_hxx +#undef Handle_TCollection_SequenceNode +#undef TCollection_SequenceNode_Type_ +#undef TCollection_Sequence +#undef TCollection_Sequence_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_ListIteratorOfListOfTask.hxx b/src/MCCAD/McCadHeaders/McCadTool_ListIteratorOfListOfTask.hxx new file mode 100644 index 0000000..42a73bd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_ListIteratorOfListOfTask.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_ListIteratorOfListOfTask_HeaderFile +#define _McCadTool_ListIteratorOfListOfTask_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_ListNodeOfListOfTask_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class McCadTool_ListOfTask; +class McCadTool_Task; +class McCadTool_ListNodeOfListOfTask; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTool_ListIteratorOfListOfTask { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTool_ListIteratorOfListOfTask(); + + +Standard_EXPORT McCadTool_ListIteratorOfListOfTask(const McCadTool_ListOfTask& L); + + +Standard_EXPORT void Initialize(const McCadTool_ListOfTask& L) ; + + Standard_Boolean More() const; + + +Standard_EXPORT void Next() ; + + +Standard_EXPORT Handle_McCadTool_Task& Value() const; + + +friend class McCadTool_ListOfTask; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item Handle_McCadTool_Task +#define Item_hxx +#define TCollection_ListNode McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadTool_ListIteratorOfListOfTask +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_Type_() McCadTool_ListNodeOfListOfTask_Type_() +#define TCollection_List McCadTool_ListOfTask +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_ListNodeOfListOfTask.hxx b/src/MCCAD/McCadHeaders/McCadTool_ListNodeOfListOfTask.hxx new file mode 100644 index 0000000..492b59f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_ListNodeOfListOfTask.hxx @@ -0,0 +1,119 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_ListNodeOfListOfTask_HeaderFile +#define _McCadTool_ListNodeOfListOfTask_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_ListNodeOfListOfTask_HeaderFile +#include +#endif + +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class McCadTool_Task; +class McCadTool_ListOfTask; +class McCadTool_ListIteratorOfListOfTask; + + + +class McCadTool_ListNodeOfListOfTask : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +McCadTool_ListNodeOfListOfTask(const Handle(McCadTool_Task)& I,const TCollection_MapNodePtr& n); + + Handle_McCadTool_Task& Value() const; +//Standard_EXPORT ~McCadTool_ListNodeOfListOfTask(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Handle_McCadTool_Task myValue; + + +}; + +#define Item Handle_McCadTool_Task +#define Item_hxx +#define TCollection_ListNode McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadTool_ListIteratorOfListOfTask +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_Type_() McCadTool_ListNodeOfListOfTask_Type_() +#define TCollection_List McCadTool_ListOfTask +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_ListOfTask.hxx b/src/MCCAD/McCadHeaders/McCadTool_ListOfTask.hxx new file mode 100644 index 0000000..75cff2d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_ListOfTask.hxx @@ -0,0 +1,200 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_ListOfTask_HeaderFile +#define _McCadTool_ListOfTask_HeaderFile + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_ListNodeOfListOfTask_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class McCadTool_ListIteratorOfListOfTask; +class McCadTool_Task; +class McCadTool_ListNodeOfListOfTask; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTool_ListOfTask { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTool_ListOfTask(); + + +Standard_EXPORT void Assign(const McCadTool_ListOfTask& Other) ; + void operator=(const McCadTool_ListOfTask& Other) +{ + Assign(Other); +} + + + +Standard_EXPORT Standard_Integer Extent() const; + + +Standard_EXPORT void Clear() ; +~McCadTool_ListOfTask() +{ + Clear(); +} + + + Standard_Boolean IsEmpty() const; + + +Standard_EXPORT void Prepend(const Handle(McCadTool_Task)& I) ; + + +Standard_EXPORT void Prepend(const Handle(McCadTool_Task)& I,McCadTool_ListIteratorOfListOfTask& theIt) ; + + +Standard_EXPORT void Prepend(McCadTool_ListOfTask& Other) ; + + +Standard_EXPORT void Append(const Handle(McCadTool_Task)& I) ; + + +Standard_EXPORT void Append(const Handle(McCadTool_Task)& I,McCadTool_ListIteratorOfListOfTask& theIt) ; + + +Standard_EXPORT void Append(McCadTool_ListOfTask& Other) ; + + +Standard_EXPORT Handle_McCadTool_Task& First() const; + + +Standard_EXPORT Handle_McCadTool_Task& Last() const; + + +Standard_EXPORT void RemoveFirst() ; + + +Standard_EXPORT void Remove(McCadTool_ListIteratorOfListOfTask& It) ; + + +Standard_EXPORT void InsertBefore(const Handle(McCadTool_Task)& I,McCadTool_ListIteratorOfListOfTask& It) ; + + +Standard_EXPORT void InsertBefore(McCadTool_ListOfTask& Other,McCadTool_ListIteratorOfListOfTask& It) ; + + +Standard_EXPORT void InsertAfter(const Handle(McCadTool_Task)& I,McCadTool_ListIteratorOfListOfTask& It) ; + + +Standard_EXPORT void InsertAfter(McCadTool_ListOfTask& Other,McCadTool_ListIteratorOfListOfTask& It) ; + + +friend class McCadTool_ListIteratorOfListOfTask; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT McCadTool_ListOfTask(const McCadTool_ListOfTask& Other); + + + // Fields PRIVATE + // +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item Handle_McCadTool_Task +#define Item_hxx +#define TCollection_ListNode McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadTool_ListIteratorOfListOfTask +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_Type_() McCadTool_ListNodeOfListOfTask_Type_() +#define TCollection_List McCadTool_ListOfTask +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_State.hxx b/src/MCCAD/McCadHeaders/McCadTool_State.hxx new file mode 100644 index 0000000..fe0c6d6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_State.hxx @@ -0,0 +1,40 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_State_HeaderFile +#define _McCadTool_State_HeaderFile + +//! Tool & Cmd implemented as actions
+//! =============================
+enum McCadTool_State { + McCadTool_None, +McCadTool_Start, +McCadTool_Running, +McCadTool_Waiting, +McCadTool_Done +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_Task.hxx b/src/MCCAD/McCadHeaders/McCadTool_Task.hxx new file mode 100644 index 0000000..ebcef79 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_Task.hxx @@ -0,0 +1,212 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_Task_HeaderFile +#define _McCadTool_Task_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _McCadTool_TaskID_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#include +//class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + +#include + +//! \brief Base Class of tasks + +//! base Task class
+//! fully implemented this gives a cmd with a finite state machine (FSM)
+//! this is a lazy implementation; see text books for complete cmd with
+//! FSM.
+class McCadTool_Task : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadTool_Task() +{ + Destroy(); +} + + + +Standard_EXPORT void Initialize(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const Standard_Boolean theNeedSelect = Standard_False,const Standard_Boolean theNeedDlg = Standard_False,const Standard_Boolean theNeedRect = Standard_False,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False) ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void SetState(const McCadTool_State theState) ; + + +Standard_EXPORT virtual void Start() ; + + +Standard_EXPORT virtual void Running() ; + + +Standard_EXPORT virtual void Waiting() ; + + +Standard_EXPORT virtual void Done() ; + + +Standard_EXPORT McCadTool_State State() const; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent& e) ; + + +Standard_EXPORT void MouseMoveEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual void SetCanUndo(const Standard_Boolean theState) ; + + +Standard_EXPORT virtual void SetCanRedo(const Standard_Boolean theState) ; + + +Standard_EXPORT virtual Standard_Boolean CanUndo() const; + + +Standard_EXPORT virtual Standard_Boolean CanRedo() const; + + +Standard_EXPORT virtual void SetID(const McCadTool_TaskID theID) ; + + +Standard_EXPORT virtual McCadTool_TaskID GetID() const; + + +Standard_EXPORT virtual Standard_Boolean NeedRect() const; + + +Standard_EXPORT virtual void SetNeedRect(const Standard_Boolean theState) ; + + +Standard_EXPORT virtual Standard_Boolean NeedDlg() const; + + +Standard_EXPORT virtual void SetNeedDlg(const Standard_Boolean theState) ; + + +Standard_EXPORT virtual Standard_Boolean NeedSelect() const; + + +Standard_EXPORT virtual void SetNeedSelect(const Standard_Boolean theState) ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Handle_McCadCom_CasDocument myDoc; +Handle_McCadCom_CasView myView; +McCadTool_State myState; +Standard_Boolean myUndoState; +Standard_Boolean myRedoState; +McCadTool_TaskID myID; +Standard_Boolean myNeedDlg; +Standard_Boolean myNeedRect; +Standard_Boolean myNeedSelect; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_Task.ixx b/src/MCCAD/McCadHeaders/McCadTool_Task.ixx new file mode 100644 index 0000000..503bcd0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_Task.ixx @@ -0,0 +1,73 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadTool_Task_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTool_Task", + sizeof(McCadTool_Task), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTool_Task) Handle(McCadTool_Task)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTool_Task) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTool_Task))) { + _anOtherObject = Handle(McCadTool_Task)((Handle(McCadTool_Task)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTool_Task::DynamicType() const +{ + return STANDARD_TYPE(McCadTool_Task) ; +} +//Standard_Boolean McCadTool_Task::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTool_Task) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTool_Task::~Handle_McCadTool_Task() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTool_Task.jxx b/src/MCCAD/McCadHeaders/McCadTool_Task.jxx new file mode 100644 index 0000000..ec5dfad --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_Task.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadTool_Task_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.hxx b/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.hxx new file mode 100644 index 0000000..efd0441 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.hxx @@ -0,0 +1,149 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_TaskHistory_HeaderFile +#define _McCadTool_TaskHistory_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_TaskHistory_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _McCadTool_ListOfTask_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadTool_Task; + + +//! base Task class
+//! fully implemented this gives a cmd with a finite state machine (FSM)
+//! this is a lazy implementation; see text books for complete cmd with
+//! FSM.
+class McCadTool_TaskHistory : public MMgt_TShared { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadTool_TaskHistory(const Standard_Integer theSize = 10); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadTool_TaskHistory() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void SetSize(const Standard_Integer theSize = 10) ; + + +Standard_EXPORT virtual Standard_Integer GetSize() const; + + +Standard_EXPORT virtual void Log(const Handle(McCadTool_Task)& theTask) ; + + +Standard_EXPORT virtual Standard_Boolean CanUndo() const; + + +Standard_EXPORT virtual void Undo() ; + + +Standard_EXPORT virtual void Undo(const Standard_Integer theIndex) ; + + +Standard_EXPORT virtual Standard_Boolean CanRedo() const; + + +Standard_EXPORT virtual void Redo() ; + + +Standard_EXPORT virtual void Redo(const Standard_Integer theIndex) ; + + +Standard_EXPORT virtual void Clear() ; + + +Standard_EXPORT virtual void ClearUndoList() ; + + +Standard_EXPORT virtual void ClearRedoList() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Standard_Integer mySize; +McCadTool_ListOfTask myUndoList; +McCadTool_ListOfTask myRedoList; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.ixx b/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.ixx new file mode 100644 index 0000000..0b11569 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.ixx @@ -0,0 +1,73 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadTool_TaskHistory_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTool_TaskHistory", + sizeof(McCadTool_TaskHistory), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTool_TaskHistory) Handle(McCadTool_TaskHistory)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTool_TaskHistory) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTool_TaskHistory))) { + _anOtherObject = Handle(McCadTool_TaskHistory)((Handle(McCadTool_TaskHistory)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTool_TaskHistory::DynamicType() const +{ + return STANDARD_TYPE(McCadTool_TaskHistory) ; +} +//Standard_Boolean McCadTool_TaskHistory::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTool_TaskHistory) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTool_TaskHistory::~Handle_McCadTool_TaskHistory() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.jxx b/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.jxx new file mode 100644 index 0000000..88b1619 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskHistory.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadTool_TaskHistory_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskID.hxx b/src/MCCAD/McCadHeaders/McCadTool_TaskID.hxx new file mode 100644 index 0000000..0d19518 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskID.hxx @@ -0,0 +1,122 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_TaskID_HeaderFile +#define _McCadTool_TaskID_HeaderFile + + +enum McCadTool_TaskID { + McCadTool_NoID, +McCadTool_Axo, +McCadTool_Axis, +McCadTool_FileNew, +McCadTool_FileOpen, +McCadTool_FileOpenNew, +McCadTool_FileClose, +McCadTool_FileSave, +McCadTool_FileSaveAs, +McCadTool_Hardcopy, +McCadTool_ImportGeom, +McCadTool_ExportGeom, +McCadTool_ExportMCBase, +McCadTool_ImportBREP, +McCadTool_ImportIGES, +McCadTool_ImportSTEP, +McCadTool_ImportMCNP, +McCadTool_ExportBREP, +McCadTool_ExportIGES, +McCadTool_ExportSTEP, +McCadTool_ExportMCNP, +McCadTool_Printer, +McCadTool_PrinterSetup, +McCadTool_PrintPreview, +McCadTool_Print, +McCadTool_ResentFiles, +McCadTool_EditUndo, +McCadTool_EditRedo, +McCadTool_EditCut, +McCadTool_EditCopy, +McCadTool_EditPaste, +McCadTool_Select, +McCadTool_SelectAll, +McCadTool_DeselectAll, +McCadTool_Redraw, +McCadTool_ZoomWindow, +McCadTool_ZoomDynamic, +McCadTool_ZoomIn, +McCadTool_ZoomOut, +McCadTool_FitAll, +McCadTool_Pan, +McCadTool_Grid, +McCadTool_Rotate, +McCadTool_BackProject, +McCadTool_FrontProject, +McCadTool_TopProject, +McCadTool_BottomProject, +McCadTool_LeftProject, +McCadTool_RightProject, +McCadTool_WireFrame, +McCadTool_FlatShade, +McCadTool_MeasureDistance, +McCadTool_MeasureAngle, +McCadTool_MeasureArea, +McCadTool_MeasureVolume, +McCadTool_PropertyCurve, +McCadTool_PropertySurface, +McCadTool_MakeBox, +McCadTool_MakeCone, +McCadTool_MakeCylinder, +McCadTool_MakeHalfSpace, +McCadTool_MakeSphere, +McCadTool_MakeTorus, +McCadTool_MakeWedge, +McCadTool_ModelErase, +McCadTool_ModelCopy, +McCadTool_ModelMirror, +McCadTool_ModelMove, +McCadTool_ModelRotate, +McCadTool_ModelScale, +McCadTool_ModelStrech, +McCadTool_SolidUnion, +McCadTool_SolidIntersection, +McCadTool_SolidDifference, +McCadTool_BackgroundColor, +McCadTool_ShapeColor, +McCadTool_ShapeMaterial, +McCadTool_ShapeTransparency, +McCadTool_Antialiasing, +McCadTool_SetHiddenLine, +McCadTool_DispSelOnly, +McCadTool_ShowAll, +McCadTool_HideSelected, +McCadTool_RedispSelected, +McCadTool_AddToMaterialGroup, +McCadTool_ClippingPlane, +McCadTool_AddMaterialGroup, +McCadTool_ReadValueList +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.hxx b/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.hxx new file mode 100644 index 0000000..8c50ea8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.hxx @@ -0,0 +1,178 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTool_TaskMaster_HeaderFile +#define _McCadTool_TaskMaster_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_TaskMaster_HeaderFile +#include +#endif + +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadTool_TaskHistory_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +class McCadCom_CasView; +class McCadTool_Task; +class McCadTool_TaskHistory; +class McCadWin_MouseEvent; + +#include + +//! base Task class
+//! fully implemented this gives a cmd with a finite state machine (FSM)
+//! this is a lazy implementation; see text books for complete cmd with
+//! FSM.
+class McCadTool_TaskMaster : public MMgt_TShared { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadTool_TaskMaster(); + + +Standard_EXPORT McCadTool_TaskMaster(const Handle(McCadCom_CasView)& theView); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadTool_TaskMaster() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void SetView(const Handle(McCadCom_CasView)& theView) ; + + +Standard_EXPORT virtual Handle_McCadCom_CasView GetView() const; + + +Standard_EXPORT virtual void SetDefaultTask(const Handle(McCadTool_Task)& theTask) ; + + +Standard_EXPORT virtual Handle_McCadTool_Task GetDefaultTask() const; + + +Standard_EXPORT virtual void SetCurrentTask(const Handle(McCadTool_Task)& theTask) ; + + +Standard_EXPORT virtual Handle_McCadTool_Task GetCurrentTask() const; + + +Standard_EXPORT virtual void SetTaskHistory(const Handle(McCadTool_TaskHistory)& theTaskHist) ; + + +Standard_EXPORT Handle_McCadTool_TaskHistory GetTaskHistory() const; + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void SetState(const McCadTool_State theState) ; + + +Standard_EXPORT McCadTool_State State() const; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent& e) ; + + +Standard_EXPORT void MouseMoveEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +Handle_McCadCom_CasView myView; +Handle_McCadTool_Task myDefaultTask; +Handle_McCadTool_Task myCurrentTask; +Handle_McCadTool_TaskHistory myTaskHistory; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.ixx b/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.ixx new file mode 100644 index 0000000..ed14b62 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.ixx @@ -0,0 +1,73 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadTool_TaskMaster_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTool_TaskMaster", + sizeof(McCadTool_TaskMaster), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTool_TaskMaster) Handle(McCadTool_TaskMaster)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTool_TaskMaster) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTool_TaskMaster))) { + _anOtherObject = Handle(McCadTool_TaskMaster)((Handle(McCadTool_TaskMaster)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTool_TaskMaster::DynamicType() const +{ + return STANDARD_TYPE(McCadTool_TaskMaster) ; +} +//Standard_Boolean McCadTool_TaskMaster::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTool_TaskMaster) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTool_TaskMaster::~Handle_McCadTool_TaskMaster() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.jxx b/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.jxx new file mode 100644 index 0000000..f4727ff --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTool_TaskMaster.jxx @@ -0,0 +1,15 @@ +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadTool_TaskHistory_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadTool_TaskMaster_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.hxx b/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.hxx new file mode 100644 index 0000000..aed1633 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.hxx @@ -0,0 +1,170 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_BaseIterator_HeaderFile +#define _McCadTree_BaseIterator_HeaderFile + +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class McCadTree_SiblIterator; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTree_BaseIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT McCadTree_BaseIterator(); + +//! This class provides base iterator of the N-ary Tree.
+//! by default it behaves as a preorder iterator.
+Standard_EXPORT McCadTree_BaseIterator(const McCadTree_TreeNodePtr& aNodePtr); + + +Standard_EXPORT virtual McCadTree_BaseIterator& Increment() ; + McCadTree_BaseIterator& operator++() +{ + return Increment(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& Decrement() ; + McCadTree_BaseIterator& operator--() +{ + return Decrement(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& IncrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator+=(Standard_Integer& count) +{ + return IncrementBy(count); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& DecrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator-=(Standard_Integer& count) +{ + return DecrementBy(count); +} + + + +Standard_EXPORT Standard_Boolean IsEqual(const McCadTree_BaseIterator& other) const; + Standard_Boolean operator ==(const McCadTree_BaseIterator& other) const +{ + return IsEqual(other); +} + + + +Standard_EXPORT Standard_Boolean IsNotEqual(const McCadTree_BaseIterator& other) const; + Standard_Boolean operator !=(const McCadTree_BaseIterator& other) const +{ + return IsNotEqual(other); +} + + +//! skip over children of this node.
+Standard_EXPORT void SkipChildren() ; + +//! counts the number of children at this node.
+Standard_EXPORT Standard_Integer NumberOfChildren() const; + +//! counts the number of children at this node.
+Standard_EXPORT McCadTree_SiblIterator BeginSibl() const; + +//! counts the number of children at this node.
+Standard_EXPORT McCadTree_SiblIterator EndSibl() const; + +//! counts the number of children at this node.
+Standard_EXPORT McCadTree_TreeNodePtr GetNode() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +McCadTree_TreeNodePtr node; +Standard_Boolean skipCurrentChildren; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.ixx b/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.ixx new file mode 100644 index 0000000..91064d9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.jxx b/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.jxx new file mode 100644 index 0000000..e17a2cb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_BaseIterator.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadTree_SiblIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_BaseIteratorPtr.hxx b/src/MCCAD/McCadHeaders/McCadTree_BaseIteratorPtr.hxx new file mode 100644 index 0000000..4cec7db --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_BaseIteratorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_BaseIteratorPtr_HeaderFile +#define _McCadTree_BaseIteratorPtr_HeaderFile + +class McCadTree_BaseIterator; + +typedef McCadTree_BaseIterator* McCadTree_BaseIteratorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.hxx b/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.hxx new file mode 100644 index 0000000..47c5b17 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.hxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_NodeDataPrototype_HeaderFile +#define _McCadTree_NodeDataPrototype_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTree_NodeDataPrototype_HeaderFile +#include +#endif + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +class TCollection_AsciiString; + + + +class McCadTree_NodeDataPrototype : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +//! This class provides a prototype for node data.
+//! supports 3 types of traversal.
+Standard_EXPORT McCadTree_NodeDataPrototype(); + + +Standard_EXPORT McCadTree_NodeDataPrototype(const TCollection_AsciiString& myName); + +//! sets the name of the node.
+Standard_EXPORT void SetNodeName(const TCollection_AsciiString& myName) ; + +//! returns the name of the node.
+Standard_EXPORT TCollection_AsciiString GetNodeName() ; +//Standard_EXPORT ~McCadTree_NodeDataPrototype(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TCollection_AsciiString NodeName; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.ixx b/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.ixx new file mode 100644 index 0000000..007c44e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadTree_NodeDataPrototype::~McCadTree_NodeDataPrototype() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTree_NodeDataPrototype_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTree_NodeDataPrototype", + sizeof(McCadTree_NodeDataPrototype), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTree_NodeDataPrototype) Handle(McCadTree_NodeDataPrototype)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTree_NodeDataPrototype) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTree_NodeDataPrototype))) { + _anOtherObject = Handle(McCadTree_NodeDataPrototype)((Handle(McCadTree_NodeDataPrototype)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTree_NodeDataPrototype::DynamicType() const +{ + return STANDARD_TYPE(McCadTree_NodeDataPrototype) ; +} +//Standard_Boolean McCadTree_NodeDataPrototype::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTree_NodeDataPrototype) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTree_NodeDataPrototype::~Handle_McCadTree_NodeDataPrototype() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.jxx b/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.jxx new file mode 100644 index 0000000..b70c246 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_NodeDataPrototype.jxx @@ -0,0 +1,6 @@ +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadTree_NodeDataPrototype_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.hxx b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.hxx new file mode 100644 index 0000000..3896066 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.hxx @@ -0,0 +1,146 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_PostOrdIterator_HeaderFile +#define _McCadTree_PostOrdIterator_HeaderFile + +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class McCadTree_BaseIterator; +class McCadTree_SiblIterator; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTree_PostOrdIterator : public McCadTree_BaseIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class provides preoder iterator of the N-ary Tree.
+Standard_EXPORT McCadTree_PostOrdIterator(); + + +Standard_EXPORT McCadTree_PostOrdIterator(const McCadTree_TreeNodePtr& aNode); + + +Standard_EXPORT McCadTree_PostOrdIterator(const McCadTree_BaseIterator& aIter); + + +Standard_EXPORT McCadTree_PostOrdIterator(const McCadTree_SiblIterator& aIter); + + +Standard_EXPORT virtual McCadTree_BaseIterator& Increment() ; + McCadTree_BaseIterator& operator++() +{ + return Increment(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& Decrement() ; + McCadTree_BaseIterator& operator--() +{ + return Decrement(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& IncrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator+=(Standard_Integer& count) +{ + return IncrementBy(count); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& DecrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator-=(Standard_Integer& count) +{ + return DecrementBy(count); +} + + + +Standard_EXPORT void DescendAll() ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.ixx b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.ixx new file mode 100644 index 0000000..8a5e05d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.jxx b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.jxx new file mode 100644 index 0000000..33f72a1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIterator.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_SiblIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_PostOrdIterator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_PostOrdIteratorPtr.hxx b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIteratorPtr.hxx new file mode 100644 index 0000000..26f241f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PostOrdIteratorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_PostOrdIteratorPtr_HeaderFile +#define _McCadTree_PostOrdIteratorPtr_HeaderFile + +class McCadTree_PostOrdIterator; + +typedef McCadTree_PostOrdIterator* McCadTree_PostOrdIteratorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.hxx b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.hxx new file mode 100644 index 0000000..d6f8bb3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.hxx @@ -0,0 +1,143 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_PreOrdIterator_HeaderFile +#define _McCadTree_PreOrdIterator_HeaderFile + +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class McCadTree_BaseIterator; +class McCadTree_SiblIterator; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTree_PreOrdIterator : public McCadTree_BaseIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class provides preoder iterator of the N-ary Tree.
+Standard_EXPORT McCadTree_PreOrdIterator(); + + +Standard_EXPORT McCadTree_PreOrdIterator(const McCadTree_TreeNodePtr& aNode); + + +Standard_EXPORT McCadTree_PreOrdIterator(const McCadTree_BaseIterator& aIter); + + +Standard_EXPORT McCadTree_PreOrdIterator(const McCadTree_SiblIterator& aIter); + + +Standard_EXPORT virtual McCadTree_BaseIterator& Increment() ; + McCadTree_BaseIterator& operator++() +{ + return Increment(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& Decrement() ; + McCadTree_BaseIterator& operator--() +{ + return Decrement(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& IncrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator+=(Standard_Integer& count) +{ + return IncrementBy(count); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& DecrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator-=(Standard_Integer& count) +{ + return DecrementBy(count); +} + + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.ixx b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.ixx new file mode 100644 index 0000000..de2a48f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.jxx b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.jxx new file mode 100644 index 0000000..438137c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIterator.jxx @@ -0,0 +1,9 @@ +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_SiblIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_PreOrdIterator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_PreOrdIteratorPtr.hxx b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIteratorPtr.hxx new file mode 100644 index 0000000..2b15033 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_PreOrdIteratorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_PreOrdIteratorPtr_HeaderFile +#define _McCadTree_PreOrdIteratorPtr_HeaderFile + +class McCadTree_PreOrdIterator; + +typedef McCadTree_PreOrdIterator* McCadTree_PreOrdIteratorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.hxx b/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.hxx new file mode 100644 index 0000000..990b6fa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.hxx @@ -0,0 +1,155 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_SiblIterator_HeaderFile +#define _McCadTree_SiblIterator_HeaderFile + +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#include +#endif +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class McCadTree_BaseIterator; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTree_SiblIterator : public McCadTree_BaseIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class provides preoder iterator of the N-ary Tree.
+Standard_EXPORT McCadTree_SiblIterator(); + + +Standard_EXPORT McCadTree_SiblIterator(McCadTree_TreeNodePtr& aNode); + + +Standard_EXPORT McCadTree_SiblIterator(const McCadTree_BaseIterator& aIter); + + +Standard_EXPORT McCadTree_SiblIterator(const McCadTree_SiblIterator& aIter); + + +Standard_EXPORT virtual McCadTree_BaseIterator& Increment() ; + McCadTree_BaseIterator& operator++() +{ + return Increment(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& Decrement() ; + McCadTree_BaseIterator& operator--() +{ + return Decrement(); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& IncrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator+=(Standard_Integer& count) +{ + return IncrementBy(count); +} + + + +Standard_EXPORT virtual McCadTree_BaseIterator& DecrementBy(Standard_Integer& count) ; + McCadTree_BaseIterator& operator-=(Standard_Integer& count) +{ + return DecrementBy(count); +} + + + +Standard_EXPORT McCadTree_TreeNodePtr RangeFirst() const; + + +Standard_EXPORT McCadTree_TreeNodePtr RangeLast() const; + + +Standard_EXPORT void SetSiblParent() ; + + +Standard_EXPORT McCadTree_TreeNodePtr GetSiblParent() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +McCadTree_TreeNodePtr sparent; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.ixx b/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.ixx new file mode 100644 index 0000000..4f09ad9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.jxx b/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.jxx new file mode 100644 index 0000000..476338e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_SiblIterator.jxx @@ -0,0 +1,6 @@ +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_SiblIterator_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_SiblIteratorPtr.hxx b/src/MCCAD/McCadHeaders/McCadTree_SiblIteratorPtr.hxx new file mode 100644 index 0000000..8c12755 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_SiblIteratorPtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_SiblIteratorPtr_HeaderFile +#define _McCadTree_SiblIteratorPtr_HeaderFile + +class McCadTree_SiblIterator; + +typedef McCadTree_SiblIterator* McCadTree_SiblIteratorPtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_Tree.hxx b/src/MCCAD/McCadHeaders/McCadTree_Tree.hxx new file mode 100644 index 0000000..164d2f3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_Tree.hxx @@ -0,0 +1,255 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_Tree_HeaderFile +#define _McCadTree_Tree_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadTree_Tree_HeaderFile +#include +#endif + +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#include +#endif +#ifndef _MMgt_TShared_HeaderFile +#include +#endif +#ifndef _Handle_Standard_Transient_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class McCadTree_BaseIterator; +class McCadTree_PreOrdIterator; +class McCadTree_PostOrdIterator; +class McCadTree_SiblIterator; +class Standard_Transient; + + + +class McCadTree_Tree : public MMgt_TShared { + +public: + // Methods PUBLIC + // + +//! This class provides preoder iterator of the N-ary Tree.
+Standard_EXPORT McCadTree_Tree(); + + +Standard_EXPORT McCadTree_Tree(const Handle(Standard_Transient)& aNodeData); + + +Standard_EXPORT McCadTree_Tree(const McCadTree_BaseIterator& aIter); + + +Standard_EXPORT McCadTree_Tree(const Handle(McCadTree_Tree)& aTree); + + +Standard_EXPORT void Equal(const Handle(McCadTree_Tree)& aTree) ; + void operator=(const Handle(McCadTree_Tree)& aTree) +{ + Equal(aTree); +} + + + +Standard_EXPORT McCadTree_PreOrdIterator Begin() const; + + +Standard_EXPORT McCadTree_PreOrdIterator End() const; + + +Standard_EXPORT McCadTree_PostOrdIterator BeginPost() const; + + +Standard_EXPORT McCadTree_PostOrdIterator EndPost() const; + + +Standard_EXPORT McCadTree_SiblIterator Begin(const McCadTree_BaseIterator& aIter) const; + + +Standard_EXPORT McCadTree_SiblIterator End(const McCadTree_BaseIterator& aIter) const; + + +Standard_EXPORT McCadTree_BaseIterator Parent(const McCadTree_BaseIterator& aIter) const; + + +Standard_EXPORT McCadTree_SiblIterator PreviousSibling(const McCadTree_BaseIterator& aIter) const; + + +Standard_EXPORT McCadTree_SiblIterator NextSibling(const McCadTree_BaseIterator& aIter) const; + + +Standard_EXPORT void Clear() ; + + +Standard_EXPORT McCadTree_BaseIterator Erase(McCadTree_BaseIterator& aIter) ; + + +Standard_EXPORT void EraseChildren(const McCadTree_BaseIterator& aIter) ; + + +Standard_EXPORT McCadTree_BaseIterator AppendChild(McCadTree_BaseIterator& aPosition) ; + + +Standard_EXPORT McCadTree_BaseIterator AppendChild(McCadTree_BaseIterator& aPosition,const Handle(Standard_Transient)& aNodeData) ; + + +Standard_EXPORT McCadTree_BaseIterator AppendChild(McCadTree_BaseIterator& aPosition,const McCadTree_BaseIterator& otherPostion) ; + + +Standard_EXPORT McCadTree_BaseIterator AppendChildren(McCadTree_BaseIterator& aPosition,McCadTree_SiblIterator& fromPostion,McCadTree_SiblIterator& toPosition) ; + + +Standard_EXPORT McCadTree_PreOrdIterator SetHead(const Handle(Standard_Transient)& aNodeData) ; + + +Standard_EXPORT McCadTree_BaseIterator Insert(McCadTree_BaseIterator& aPosition,const Handle(Standard_Transient)& aNodeData) ; + + +Standard_EXPORT McCadTree_PreOrdIterator Insert(McCadTree_SiblIterator& aPosition,const Handle(Standard_Transient)& aNodeData) ; + + +Standard_EXPORT McCadTree_BaseIterator InsertSubTree(McCadTree_BaseIterator& aPosition,const McCadTree_BaseIterator& aSubtree) ; + + +Standard_EXPORT McCadTree_BaseIterator InsertAfter(McCadTree_BaseIterator& aPosition,const Handle(Standard_Transient)& aNodeData) ; + + +Standard_EXPORT McCadTree_BaseIterator Replace(McCadTree_BaseIterator& aPosition,const Handle(Standard_Transient)& aNodeData) ; + + +Standard_EXPORT McCadTree_BaseIterator Replace(McCadTree_BaseIterator& aPosition,const McCadTree_BaseIterator& fromPosition) ; + + +Standard_EXPORT McCadTree_SiblIterator Replace(McCadTree_SiblIterator& aBegin,McCadTree_SiblIterator& anEnd,McCadTree_SiblIterator& aNewBegin,McCadTree_SiblIterator& aNewEnd) ; + + +Standard_EXPORT McCadTree_BaseIterator Flatten(McCadTree_BaseIterator& aPosition) ; + + +Standard_EXPORT McCadTree_BaseIterator Reparent(McCadTree_BaseIterator& aPosition,McCadTree_SiblIterator& aBegin,McCadTree_SiblIterator& anEnd) ; + + +Standard_EXPORT McCadTree_BaseIterator Reparent(McCadTree_BaseIterator& aPosition,McCadTree_BaseIterator& fromPosition) ; + + +Standard_EXPORT void Merge(McCadTree_SiblIterator& iter1,McCadTree_SiblIterator& iter2,const McCadTree_SiblIterator& iter3,const McCadTree_SiblIterator& iter4,const Standard_Boolean duplLeaves) ; + + +Standard_EXPORT void Sort(McCadTree_SiblIterator& fromPosition,McCadTree_SiblIterator& toPosition,const Standard_Boolean deep) ; + + +Standard_EXPORT Standard_Boolean Equal(const McCadTree_BaseIterator& iter1,const McCadTree_BaseIterator& iter2,const McCadTree_BaseIterator& iter3) const; + + +Standard_EXPORT Handle_McCadTree_Tree SubTree(const McCadTree_SiblIterator& fromPosition,const McCadTree_SiblIterator& toPosition) ; + + +Standard_EXPORT void SubTree(Handle(McCadTree_Tree)& aTree,const McCadTree_SiblIterator& fromPosition,const McCadTree_SiblIterator& toPosition) ; + + +Standard_EXPORT void Swap(McCadTree_SiblIterator& aIter) ; + + +Standard_EXPORT Standard_Integer Size() const; + + +Standard_EXPORT Standard_Integer Depth(McCadTree_BaseIterator& iter) const; + + +Standard_EXPORT Standard_Integer NumberOfChlidren(McCadTree_BaseIterator& iter) const; + + +Standard_EXPORT Standard_Integer NumberOfSiblings(const McCadTree_BaseIterator& iter) const; + + +Standard_EXPORT Standard_Boolean IsInSubTree(const McCadTree_BaseIterator& aPosition,const McCadTree_BaseIterator& aBegin,const McCadTree_BaseIterator& anEnd) const; + + +Standard_EXPORT Standard_Boolean IsValid(const McCadTree_BaseIterator& aPosition) const; + + +Standard_EXPORT Standard_Integer Index(McCadTree_SiblIterator& iter) const; + + +Standard_EXPORT Handle_Standard_Transient Child(McCadTree_BaseIterator& aPosition,Standard_Integer& ind) const; +//Standard_EXPORT ~McCadTree_Tree(); + + +friend class McCadTree_BaseIterator; +friend class McCadTree_PreOrdIterator; +friend class McCadTree_PostOrdIterator; +friend class McCadTree_SiblIterator; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +McCadTree_TreeNodePtr head; + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT void HeadInit() ; + + +Standard_EXPORT void Copy(const Handle(McCadTree_Tree)& other) ; + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_Tree.ixx b/src/MCCAD/McCadHeaders/McCadTree_Tree.ixx new file mode 100644 index 0000000..c315431 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_Tree.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadTree_Tree::~McCadTree_Tree() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTree_Tree_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTree_Tree", + sizeof(McCadTree_Tree), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTree_Tree) Handle(McCadTree_Tree)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTree_Tree) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTree_Tree))) { + _anOtherObject = Handle(McCadTree_Tree)((Handle(McCadTree_Tree)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTree_Tree::DynamicType() const +{ + return STANDARD_TYPE(McCadTree_Tree) ; +} +//Standard_Boolean McCadTree_Tree::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTree_Tree) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTree_Tree::~Handle_McCadTree_Tree() {} + diff --git a/src/MCCAD/McCadHeaders/McCadTree_Tree.jxx b/src/MCCAD/McCadHeaders/McCadTree_Tree.jxx new file mode 100644 index 0000000..16e6925 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_Tree.jxx @@ -0,0 +1,18 @@ +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_PreOrdIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_PostOrdIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_SiblIterator_HeaderFile +#include +#endif +#ifndef _Standard_Transient_HeaderFile +#include +#endif +#ifndef _McCadTree_Tree_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_TreeNode.hxx b/src/MCCAD/McCadHeaders/McCadTree_TreeNode.hxx new file mode 100644 index 0000000..dbc5506 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_TreeNode.hxx @@ -0,0 +1,124 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_TreeNode_HeaderFile +#define _McCadTree_TreeNode_HeaderFile + +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#include +#endif +#ifndef _Handle_Standard_Transient_HeaderFile +#include +#endif +class Standard_Transient; +class McCadTree_Tree; +class McCadTree_BaseIterator; +class McCadTree_PreOrdIterator; +class McCadTree_PostOrdIterator; +class McCadTree_SiblIterator; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class McCadTree_TreeNode { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! This class provides a Node of an N-ary Tree.
+//! supports 3 types of traversal.
+Standard_EXPORT McCadTree_TreeNode(); + + +Standard_EXPORT McCadTree_TreeNode(const Handle(Standard_Transient)& myData); + +//! sets the data of the node.
+Standard_EXPORT void SetNodeData(const Handle(Standard_Transient)& aNodeData) ; + +//! sets the data of the node.
+Standard_EXPORT Handle_Standard_Transient GetNodeData() const; + + +friend class McCadTree_Tree; +friend class McCadTree_BaseIterator; +friend class McCadTree_PreOrdIterator; +friend class McCadTree_PostOrdIterator; +friend class McCadTree_SiblIterator; + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // +McCadTree_TreeNodePtr parent; +McCadTree_TreeNodePtr firstChild; +McCadTree_TreeNodePtr lastChild; +McCadTree_TreeNodePtr prevSibling; +McCadTree_TreeNodePtr nextSibling; +Handle_Standard_Transient NodeData; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_TreeNode.ixx b/src/MCCAD/McCadHeaders/McCadTree_TreeNode.ixx new file mode 100644 index 0000000..fda7691 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_TreeNode.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadTree_TreeNode.jxx b/src/MCCAD/McCadHeaders/McCadTree_TreeNode.jxx new file mode 100644 index 0000000..b4b6365 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_TreeNode.jxx @@ -0,0 +1,21 @@ +#ifndef _Standard_Transient_HeaderFile +#include +#endif +#ifndef _McCadTree_Tree_HeaderFile +#include +#endif +#ifndef _McCadTree_BaseIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_PreOrdIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_PostOrdIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_SiblIterator_HeaderFile +#include +#endif +#ifndef _McCadTree_TreeNode_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadTree_TreeNodePtr.hxx b/src/MCCAD/McCadHeaders/McCadTree_TreeNodePtr.hxx new file mode 100644 index 0000000..d03add0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadTree_TreeNodePtr.hxx @@ -0,0 +1,29 @@ +// File generated by CPPExt (Pointer) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadTree_TreeNodePtr_HeaderFile +#define _McCadTree_TreeNodePtr_HeaderFile + +class McCadTree_TreeNode; + +typedef McCadTree_TreeNode* McCadTree_TreeNodePtr; + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Axis.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Axis.hxx new file mode 100644 index 0000000..f3533b2 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Axis.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Axis_HeaderFile +#define _McCadViewTool_Axis_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Axis_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Set/Unset Axis Task class
+class McCadViewTool_Axis : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Axis(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Axis() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Axis.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Axis.ixx new file mode 100644 index 0000000..bf5352e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Axis.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Axis_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Axis", + sizeof(McCadViewTool_Axis), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Axis) Handle(McCadViewTool_Axis)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Axis) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Axis))) { + _anOtherObject = Handle(McCadViewTool_Axis)((Handle(McCadViewTool_Axis)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Axis::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Axis) ; +} +//Standard_Boolean McCadViewTool_Axis::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Axis) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Axis::~Handle_McCadViewTool_Axis() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Axis.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Axis.jxx new file mode 100644 index 0000000..65fbeac --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Axis.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Axis_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Axo.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Axo.hxx new file mode 100644 index 0000000..15de03c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Axo.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Axo_HeaderFile +#define _McCadViewTool_Axo_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Axo_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Axo Task class
+class McCadViewTool_Axo : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Axo(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Axo() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Axo.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Axo.ixx new file mode 100644 index 0000000..ed89167 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Axo.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Axo_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Axo", + sizeof(McCadViewTool_Axo), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Axo) Handle(McCadViewTool_Axo)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Axo) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Axo))) { + _anOtherObject = Handle(McCadViewTool_Axo)((Handle(McCadViewTool_Axo)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Axo::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Axo) ; +} +//Standard_Boolean McCadViewTool_Axo::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Axo) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Axo::~Handle_McCadViewTool_Axo() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Axo.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Axo.jxx new file mode 100644 index 0000000..3f66bdb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Axo.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Axo_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.hxx new file mode 100644 index 0000000..18199fe --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_BackProject_HeaderFile +#define _McCadViewTool_BackProject_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_BackProject_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! BackProject Task class
+class McCadViewTool_BackProject : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_BackProject(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_BackProject() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.ixx new file mode 100644 index 0000000..00cf3e7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_BackProject_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_BackProject", + sizeof(McCadViewTool_BackProject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_BackProject) Handle(McCadViewTool_BackProject)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_BackProject) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_BackProject))) { + _anOtherObject = Handle(McCadViewTool_BackProject)((Handle(McCadViewTool_BackProject)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_BackProject::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_BackProject) ; +} +//Standard_Boolean McCadViewTool_BackProject::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_BackProject) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_BackProject::~Handle_McCadViewTool_BackProject() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.jxx new file mode 100644 index 0000000..f940821 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_BackProject.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_BackProject_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.hxx new file mode 100644 index 0000000..64e300f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_BottomProject_HeaderFile +#define _McCadViewTool_BottomProject_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_BottomProject_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! BottomProject Task class
+class McCadViewTool_BottomProject : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_BottomProject(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_BottomProject() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.ixx new file mode 100644 index 0000000..ed52d06 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_BottomProject_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_BottomProject", + sizeof(McCadViewTool_BottomProject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_BottomProject) Handle(McCadViewTool_BottomProject)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_BottomProject) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_BottomProject))) { + _anOtherObject = Handle(McCadViewTool_BottomProject)((Handle(McCadViewTool_BottomProject)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_BottomProject::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_BottomProject) ; +} +//Standard_Boolean McCadViewTool_BottomProject::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_BottomProject) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_BottomProject::~Handle_McCadViewTool_BottomProject() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.jxx new file mode 100644 index 0000000..88d83b4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_BottomProject.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_BottomProject_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Default.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Default.hxx new file mode 100644 index 0000000..5ecfa69 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Default.hxx @@ -0,0 +1,137 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Default_HeaderFile +#define _McCadViewTool_Default_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Default_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Default Task class
+class McCadViewTool_Default : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Default(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = +McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Default() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Delete.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Delete.hxx new file mode 100644 index 0000000..b7ffe30 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Delete.hxx @@ -0,0 +1,139 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Delete_HeaderFile +#define _McCadViewTool_Delete_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Delete_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + +#include + +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Delete Task class
+class McCadViewTool_Delete : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Delete(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Delete() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +AIS_ListOfInteractive myListOfLastDeleted; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Delete.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Delete.ixx new file mode 100644 index 0000000..da065b9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Delete.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Delete_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Delete", + sizeof(McCadViewTool_Delete), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Delete) Handle(McCadViewTool_Delete)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Delete) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Delete))) { + _anOtherObject = Handle(McCadViewTool_Delete)((Handle(McCadViewTool_Delete)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Delete::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Delete) ; +} +//Standard_Boolean McCadViewTool_Delete::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Delete) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Delete::~Handle_McCadViewTool_Delete() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Delete.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Delete.jxx new file mode 100644 index 0000000..7264c63 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Delete.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Delete_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.hxx new file mode 100644 index 0000000..6695df6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_DisplaySelectedOnly_HeaderFile +#define _McCadViewTool_DisplaySelectedOnly_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_DisplaySelectedOnly_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! DisplaySelectedOnly Task class
+class McCadViewTool_DisplaySelectedOnly : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_DisplaySelectedOnly(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_DisplaySelectedOnly() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.ixx new file mode 100644 index 0000000..fae31a9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_DisplaySelectedOnly_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_DisplaySelectedOnly", + sizeof(McCadViewTool_DisplaySelectedOnly), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_DisplaySelectedOnly) Handle(McCadViewTool_DisplaySelectedOnly)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_DisplaySelectedOnly) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_DisplaySelectedOnly))) { + _anOtherObject = Handle(McCadViewTool_DisplaySelectedOnly)((Handle(McCadViewTool_DisplaySelectedOnly)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_DisplaySelectedOnly::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_DisplaySelectedOnly) ; +} +//Standard_Boolean McCadViewTool_DisplaySelectedOnly::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_DisplaySelectedOnly) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_DisplaySelectedOnly::~Handle_McCadViewTool_DisplaySelectedOnly() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.jxx new file mode 100644 index 0000000..c9993ef --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_DisplaySelectedOnly.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_DisplaySelectedOnly_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Dump.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Dump.hxx new file mode 100644 index 0000000..9ebf92b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Dump.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Dump_HeaderFile +#define _McCadViewTool_Dump_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Dump_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Dump Task class
+class McCadViewTool_Dump : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Dump(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Dump() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Dump.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Dump.ixx new file mode 100644 index 0000000..71dda5d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Dump.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Dump_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Dump", + sizeof(McCadViewTool_Dump), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Dump) Handle(McCadViewTool_Dump)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Dump) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Dump))) { + _anOtherObject = Handle(McCadViewTool_Dump)((Handle(McCadViewTool_Dump)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Dump::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Dump) ; +} +//Standard_Boolean McCadViewTool_Dump::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Dump) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Dump::~Handle_McCadViewTool_Dump() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Dump.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Dump.jxx new file mode 100644 index 0000000..3387917 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Dump.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Dump_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.hxx new file mode 100644 index 0000000..a68eefb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_FitAll_HeaderFile +#define _McCadViewTool_FitAll_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_FitAll_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! FitAll Task class
+class McCadViewTool_FitAll : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_FitAll(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_FitAll() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.ixx new file mode 100644 index 0000000..5dcd576 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_FitAll_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_FitAll", + sizeof(McCadViewTool_FitAll), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_FitAll) Handle(McCadViewTool_FitAll)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_FitAll) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_FitAll))) { + _anOtherObject = Handle(McCadViewTool_FitAll)((Handle(McCadViewTool_FitAll)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_FitAll::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_FitAll) ; +} +//Standard_Boolean McCadViewTool_FitAll::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_FitAll) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_FitAll::~Handle_McCadViewTool_FitAll() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.jxx new file mode 100644 index 0000000..10a723d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_FitAll.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_FitAll_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.hxx new file mode 100644 index 0000000..f43a343 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_FrontProject_HeaderFile +#define _McCadViewTool_FrontProject_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_FrontProject_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! FrontProject Task class
+class McCadViewTool_FrontProject : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_FrontProject(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_FrontProject() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.ixx new file mode 100644 index 0000000..2e0c835 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_FrontProject_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_FrontProject", + sizeof(McCadViewTool_FrontProject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_FrontProject) Handle(McCadViewTool_FrontProject)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_FrontProject) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_FrontProject))) { + _anOtherObject = Handle(McCadViewTool_FrontProject)((Handle(McCadViewTool_FrontProject)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_FrontProject::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_FrontProject) ; +} +//Standard_Boolean McCadViewTool_FrontProject::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_FrontProject) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_FrontProject::~Handle_McCadViewTool_FrontProject() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.jxx new file mode 100644 index 0000000..b934e21 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_FrontProject.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_FrontProject_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Grid.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Grid.hxx new file mode 100644 index 0000000..c0bc476 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Grid.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Grid_HeaderFile +#define _McCadViewTool_Grid_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Grid_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Grid Task class
+class McCadViewTool_Grid : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Grid(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Grid() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Grid.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Grid.ixx new file mode 100644 index 0000000..1e20a88 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Grid.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Grid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Grid", + sizeof(McCadViewTool_Grid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Grid) Handle(McCadViewTool_Grid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Grid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Grid))) { + _anOtherObject = Handle(McCadViewTool_Grid)((Handle(McCadViewTool_Grid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Grid::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Grid) ; +} +//Standard_Boolean McCadViewTool_Grid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Grid) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Grid::~Handle_McCadViewTool_Grid() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Grid.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Grid.jxx new file mode 100644 index 0000000..da2781d --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Grid.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Grid_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.hxx new file mode 100644 index 0000000..462a1a0 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_HideSelected_HeaderFile +#define _McCadViewTool_HideSelected_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_HideSelected_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Set/Unset HideSelected Task class
+class McCadViewTool_HideSelected : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_HideSelected(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_HideSelected() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.ixx new file mode 100644 index 0000000..b000cf8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_HideSelected_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_HideSelected", + sizeof(McCadViewTool_HideSelected), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_HideSelected) Handle(McCadViewTool_HideSelected)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_HideSelected) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_HideSelected))) { + _anOtherObject = Handle(McCadViewTool_HideSelected)((Handle(McCadViewTool_HideSelected)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_HideSelected::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_HideSelected) ; +} +//Standard_Boolean McCadViewTool_HideSelected::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_HideSelected) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_HideSelected::~Handle_McCadViewTool_HideSelected() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.jxx new file mode 100644 index 0000000..34b79a6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_HideSelected.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_HideSelected_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.hxx new file mode 100644 index 0000000..42f1a1c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_LeftProject_HeaderFile +#define _McCadViewTool_LeftProject_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_LeftProject_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! LeftProject Task class
+class McCadViewTool_LeftProject : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_LeftProject(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_LeftProject() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.ixx new file mode 100644 index 0000000..a3140aa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_LeftProject_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_LeftProject", + sizeof(McCadViewTool_LeftProject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_LeftProject) Handle(McCadViewTool_LeftProject)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_LeftProject) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_LeftProject))) { + _anOtherObject = Handle(McCadViewTool_LeftProject)((Handle(McCadViewTool_LeftProject)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_LeftProject::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_LeftProject) ; +} +//Standard_Boolean McCadViewTool_LeftProject::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_LeftProject) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_LeftProject::~Handle_McCadViewTool_LeftProject() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.jxx new file mode 100644 index 0000000..12a4f9c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_LeftProject.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_LeftProject_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Pan.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Pan.hxx new file mode 100644 index 0000000..03e1465 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Pan.hxx @@ -0,0 +1,139 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Pan_HeaderFile +#define _McCadViewTool_Pan_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Pan_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class QMouseEvent; + + +//! Pan Task class
+class McCadViewTool_Pan : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Pan(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Pan() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseMoveEvent(const QMouseEvent& e); + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_EXPORT Standard_Integer myXmin, myXmax, myYmin, myYmax; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Pan.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Pan.ixx new file mode 100644 index 0000000..3ef0680 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Pan.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Pan_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Pan", + sizeof(McCadViewTool_Pan), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Pan) Handle(McCadViewTool_Pan)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Pan) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Pan))) { + _anOtherObject = Handle(McCadViewTool_Pan)((Handle(McCadViewTool_Pan)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Pan::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Pan) ; +} +//Standard_Boolean McCadViewTool_Pan::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Pan) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Pan::~Handle_McCadViewTool_Pan() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Pan.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Pan.jxx new file mode 100644 index 0000000..905ab8b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Pan.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Pan_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.hxx new file mode 100644 index 0000000..7996556 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_ReadValueList_HeaderFile +#define _McCadViewTool_ReadValueList_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_ReadValueList_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Set/Unset Axis Task class
+class McCadViewTool_ReadValueList : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_ReadValueList(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_ReadValueList() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + bool ParseFile(); + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.ixx new file mode 100644 index 0000000..3b40a97 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_ReadValueList_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_ReadValueList", + sizeof(McCadViewTool_ReadValueList), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_ReadValueList) Handle(McCadViewTool_ReadValueList)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_ReadValueList) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_ReadValueList))) { + _anOtherObject = Handle(McCadViewTool_ReadValueList)((Handle(McCadViewTool_ReadValueList)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_ReadValueList::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_ReadValueList) ; +} +//Standard_Boolean McCadViewTool_ReadValueList::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_ReadValueList) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_ReadValueList::~Handle_McCadViewTool_ReadValueList() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.jxx new file mode 100644 index 0000000..f857332 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ReadValueList.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_ReadValueList_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.hxx new file mode 100644 index 0000000..8d77bc4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_RedisplaySelected_HeaderFile +#define _McCadViewTool_RedisplaySelected_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_RedisplaySelected_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class QMouseEvent; + + +//! RedisplaySelected Task class
+class McCadViewTool_RedisplaySelected : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_RedisplaySelected(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_RedisplaySelected() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent &e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent &e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.ixx new file mode 100644 index 0000000..8102e9e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_RedisplaySelected_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_RedisplaySelected", + sizeof(McCadViewTool_RedisplaySelected), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_RedisplaySelected) Handle(McCadViewTool_RedisplaySelected)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_RedisplaySelected) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_RedisplaySelected))) { + _anOtherObject = Handle(McCadViewTool_RedisplaySelected)((Handle(McCadViewTool_RedisplaySelected)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_RedisplaySelected::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_RedisplaySelected) ; +} +//Standard_Boolean McCadViewTool_RedisplaySelected::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_RedisplaySelected) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_RedisplaySelected::~Handle_McCadViewTool_RedisplaySelected() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.jxx new file mode 100644 index 0000000..a44ab87 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_RedisplaySelected.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_RedisplaySelected_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.hxx new file mode 100644 index 0000000..6f49b56 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Redraw_HeaderFile +#define _McCadViewTool_Redraw_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Redraw_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Redraw Task class
+class McCadViewTool_Redraw : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Redraw(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Redraw() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.ixx new file mode 100644 index 0000000..52cf6f8 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Redraw_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Redraw", + sizeof(McCadViewTool_Redraw), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Redraw) Handle(McCadViewTool_Redraw)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Redraw) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Redraw))) { + _anOtherObject = Handle(McCadViewTool_Redraw)((Handle(McCadViewTool_Redraw)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Redraw::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Redraw) ; +} +//Standard_Boolean McCadViewTool_Redraw::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Redraw) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Redraw::~Handle_McCadViewTool_Redraw() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.jxx new file mode 100644 index 0000000..408b80b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Redraw.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Redraw_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Reset.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Reset.hxx new file mode 100644 index 0000000..09b0572 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Reset.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Reset_HeaderFile +#define _McCadViewTool_Reset_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Reset_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Reset Task class
+class McCadViewTool_Reset : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Reset(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Reset() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Reset.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Reset.ixx new file mode 100644 index 0000000..462b0f1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Reset.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Reset_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Reset", + sizeof(McCadViewTool_Reset), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Reset) Handle(McCadViewTool_Reset)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Reset) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Reset))) { + _anOtherObject = Handle(McCadViewTool_Reset)((Handle(McCadViewTool_Reset)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Reset::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Reset) ; +} +//Standard_Boolean McCadViewTool_Reset::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Reset) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Reset::~Handle_McCadViewTool_Reset() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Reset.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Reset.jxx new file mode 100644 index 0000000..51fca2a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Reset.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Reset_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.hxx new file mode 100644 index 0000000..731acac --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_RightProject_HeaderFile +#define _McCadViewTool_RightProject_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_RightProject_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! RightProject Task class
+class McCadViewTool_RightProject : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_RightProject(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_RightProject() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.ixx new file mode 100644 index 0000000..08bc47b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_RightProject_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_RightProject", + sizeof(McCadViewTool_RightProject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_RightProject) Handle(McCadViewTool_RightProject)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_RightProject) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_RightProject))) { + _anOtherObject = Handle(McCadViewTool_RightProject)((Handle(McCadViewTool_RightProject)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_RightProject::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_RightProject) ; +} +//Standard_Boolean McCadViewTool_RightProject::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_RightProject) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_RightProject::~Handle_McCadViewTool_RightProject() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.jxx new file mode 100644 index 0000000..442c604 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_RightProject.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_RightProject_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.hxx new file mode 100644 index 0000000..8f3e07e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.hxx @@ -0,0 +1,139 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Rotate_HeaderFile +#define _McCadViewTool_Rotate_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Rotate_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class QMouseEvent; + + +//! Rotate Task class
+class McCadViewTool_Rotate : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Rotate(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Rotate() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MouseMoveEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.ixx new file mode 100644 index 0000000..95ce966 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Rotate_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Rotate", + sizeof(McCadViewTool_Rotate), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Rotate) Handle(McCadViewTool_Rotate)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Rotate) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Rotate))) { + _anOtherObject = Handle(McCadViewTool_Rotate)((Handle(McCadViewTool_Rotate)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Rotate::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Rotate) ; +} +//Standard_Boolean McCadViewTool_Rotate::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Rotate) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Rotate::~Handle_McCadViewTool_Rotate() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.jxx new file mode 100644 index 0000000..d68a935 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Rotate.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Rotate_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.hxx new file mode 100644 index 0000000..008d538 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_SetAntialiasing_HeaderFile +#define _McCadViewTool_SetAntialiasing_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_SetAntialiasing_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! SetAntialiasing Task class
+class McCadViewTool_SetAntialiasing : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_SetAntialiasing(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_SetAntialiasing() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.ixx new file mode 100644 index 0000000..84b1d86 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_SetAntialiasing_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_SetAntialiasing", + sizeof(McCadViewTool_SetAntialiasing), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_SetAntialiasing) Handle(McCadViewTool_SetAntialiasing)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_SetAntialiasing) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_SetAntialiasing))) { + _anOtherObject = Handle(McCadViewTool_SetAntialiasing)((Handle(McCadViewTool_SetAntialiasing)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_SetAntialiasing::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_SetAntialiasing) ; +} +//Standard_Boolean McCadViewTool_SetAntialiasing::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_SetAntialiasing) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_SetAntialiasing::~Handle_McCadViewTool_SetAntialiasing() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.jxx new file mode 100644 index 0000000..d675a7f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetAntialiasing.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_SetAntialiasing_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.hxx new file mode 100644 index 0000000..e5e1af9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_SetBackgroundColor_HeaderFile +#define _McCadViewTool_SetBackgroundColor_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_SetBackgroundColor_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; +#include + +//! SetBackgroundColor Task class
+class McCadViewTool_SetBackgroundColor : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_SetBackgroundColor(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_SetBackgroundColor() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Quantity_Color myPreviousColor; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.ixx new file mode 100644 index 0000000..33b35c1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_SetBackgroundColor_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_SetBackgroundColor", + sizeof(McCadViewTool_SetBackgroundColor), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_SetBackgroundColor) Handle(McCadViewTool_SetBackgroundColor)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_SetBackgroundColor) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_SetBackgroundColor))) { + _anOtherObject = Handle(McCadViewTool_SetBackgroundColor)((Handle(McCadViewTool_SetBackgroundColor)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_SetBackgroundColor::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_SetBackgroundColor) ; +} +//Standard_Boolean McCadViewTool_SetBackgroundColor::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_SetBackgroundColor) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_SetBackgroundColor::~Handle_McCadViewTool_SetBackgroundColor() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.jxx new file mode 100644 index 0000000..288c41c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetBackgroundColor.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_SetBackgroundColor_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.hxx new file mode 100644 index 0000000..03dc974 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_SetHiddenLine_HeaderFile +#define _McCadViewTool_SetHiddenLine_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_SetHiddenLine_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! SetHiddenLine Task class
+class McCadViewTool_SetHiddenLine : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_SetHiddenLine(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_SetHiddenLine() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.ixx new file mode 100644 index 0000000..300a544 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_SetHiddenLine_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_SetHiddenLine", + sizeof(McCadViewTool_SetHiddenLine), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_SetHiddenLine) Handle(McCadViewTool_SetHiddenLine)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_SetHiddenLine) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_SetHiddenLine))) { + _anOtherObject = Handle(McCadViewTool_SetHiddenLine)((Handle(McCadViewTool_SetHiddenLine)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_SetHiddenLine::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_SetHiddenLine) ; +} +//Standard_Boolean McCadViewTool_SetHiddenLine::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_SetHiddenLine) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_SetHiddenLine::~Handle_McCadViewTool_SetHiddenLine() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.jxx new file mode 100644 index 0000000..c48fdc5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetHiddenLine.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_SetHiddenLine_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.hxx new file mode 100644 index 0000000..3893513 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_SetShadingMode_HeaderFile +#define _McCadViewTool_SetShadingMode_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_SetShadingMode_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! SetShadingMode Task class
+class McCadViewTool_SetShadingMode : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_SetShadingMode(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_SetShadingMode() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.ixx new file mode 100644 index 0000000..c668109 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_SetShadingMode_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_SetShadingMode", + sizeof(McCadViewTool_SetShadingMode), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_SetShadingMode) Handle(McCadViewTool_SetShadingMode)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_SetShadingMode) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_SetShadingMode))) { + _anOtherObject = Handle(McCadViewTool_SetShadingMode)((Handle(McCadViewTool_SetShadingMode)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_SetShadingMode::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_SetShadingMode) ; +} +//Standard_Boolean McCadViewTool_SetShadingMode::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_SetShadingMode) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_SetShadingMode::~Handle_McCadViewTool_SetShadingMode() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.jxx new file mode 100644 index 0000000..657330e --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetShadingMode.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_SetShadingMode_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.hxx new file mode 100644 index 0000000..d6b8ef7 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_SetShapeColor_HeaderFile +#define _McCadViewTool_SetShapeColor_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_SetShapeColor_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! SetShapeColor Task class
+class McCadViewTool_SetShapeColor : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_SetShapeColor(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_SetShapeColor() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.ixx new file mode 100644 index 0000000..2a84e03 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_SetShapeColor_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_SetShapeColor", + sizeof(McCadViewTool_SetShapeColor), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_SetShapeColor) Handle(McCadViewTool_SetShapeColor)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_SetShapeColor) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_SetShapeColor))) { + _anOtherObject = Handle(McCadViewTool_SetShapeColor)((Handle(McCadViewTool_SetShapeColor)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_SetShapeColor::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_SetShapeColor) ; +} +//Standard_Boolean McCadViewTool_SetShapeColor::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_SetShapeColor) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_SetShapeColor::~Handle_McCadViewTool_SetShapeColor() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.jxx new file mode 100644 index 0000000..be05def --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetShapeColor.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_SetShapeColor_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_SetVisuMaterial.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_SetVisuMaterial.hxx new file mode 100644 index 0000000..748575f --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_SetVisuMaterial.hxx @@ -0,0 +1,142 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_SetVisuMaterial_HeaderFile +#define _McCadViewTool_SetVisuMaterial_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_SetVisuMaterial_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + +#include + +#include + +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Set/Unset SetVisuMaterial Task class
+class McCadViewTool_SetVisuMaterial : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_SetVisuMaterial(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_SetVisuMaterial() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + +Standard_EXPORT void SetMaterialName(Graphic3d_NameOfMaterial theNOM); + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // +Graphic3d_NameOfMaterial myNOM; + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.hxx new file mode 100644 index 0000000..13bfae9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_ShowAll_HeaderFile +#define _McCadViewTool_ShowAll_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_ShowAll_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Set/Unset ShowAll Task class
+class McCadViewTool_ShowAll : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_ShowAll(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_ShowAll() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.ixx new file mode 100644 index 0000000..8c005f5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_ShowAll_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_ShowAll", + sizeof(McCadViewTool_ShowAll), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_ShowAll) Handle(McCadViewTool_ShowAll)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_ShowAll) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_ShowAll))) { + _anOtherObject = Handle(McCadViewTool_ShowAll)((Handle(McCadViewTool_ShowAll)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_ShowAll::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_ShowAll) ; +} +//Standard_Boolean McCadViewTool_ShowAll::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_ShowAll) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_ShowAll::~Handle_McCadViewTool_ShowAll() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.jxx new file mode 100644 index 0000000..17ddf0a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ShowAll.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_ShowAll_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.hxx new file mode 100644 index 0000000..c1fa7cf --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_TopProject_HeaderFile +#define _McCadViewTool_TopProject_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_TopProject_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! TopProject Task class
+class McCadViewTool_TopProject : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_TopProject(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_TopProject() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.ixx new file mode 100644 index 0000000..03a5295 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_TopProject_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_TopProject", + sizeof(McCadViewTool_TopProject), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_TopProject) Handle(McCadViewTool_TopProject)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_TopProject) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_TopProject))) { + _anOtherObject = Handle(McCadViewTool_TopProject)((Handle(McCadViewTool_TopProject)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_TopProject::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_TopProject) ; +} +//Standard_Boolean McCadViewTool_TopProject::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_TopProject) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_TopProject::~Handle_McCadViewTool_TopProject() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.jxx new file mode 100644 index 0000000..326c9ab --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_TopProject.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_TopProject_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.hxx new file mode 100644 index 0000000..3627f69 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Transparency_HeaderFile +#define _McCadViewTool_Transparency_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Transparency_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! Transparency Task class
+class McCadViewTool_Transparency : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Transparency(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Transparency() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.ixx new file mode 100644 index 0000000..8cf0a1a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Transparency_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Transparency", + sizeof(McCadViewTool_Transparency), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Transparency) Handle(McCadViewTool_Transparency)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Transparency) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Transparency))) { + _anOtherObject = Handle(McCadViewTool_Transparency)((Handle(McCadViewTool_Transparency)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Transparency::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Transparency) ; +} +//Standard_Boolean McCadViewTool_Transparency::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Transparency) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Transparency::~Handle_McCadViewTool_Transparency() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.jxx new file mode 100644 index 0000000..9e18e6a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Transparency.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Transparency_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.hxx new file mode 100644 index 0000000..0661ace --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_WireFrame_HeaderFile +#define _McCadViewTool_WireFrame_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_WireFrame_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! WireFrame Task class
+class McCadViewTool_WireFrame : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_WireFrame(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_WireFrame() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.ixx new file mode 100644 index 0000000..6c2060b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_WireFrame_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_WireFrame", + sizeof(McCadViewTool_WireFrame), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_WireFrame) Handle(McCadViewTool_WireFrame)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_WireFrame) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_WireFrame))) { + _anOtherObject = Handle(McCadViewTool_WireFrame)((Handle(McCadViewTool_WireFrame)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_WireFrame::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_WireFrame) ; +} +//Standard_Boolean McCadViewTool_WireFrame::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_WireFrame) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_WireFrame::~Handle_McCadViewTool_WireFrame() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.jxx new file mode 100644 index 0000000..d5fd88a --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_WireFrame.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_WireFrame_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.hxx new file mode 100644 index 0000000..bc82101 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.hxx @@ -0,0 +1,138 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_Zoom_HeaderFile +#define _McCadViewTool_Zoom_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_Zoom_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; +//#include + +//! Zoom Task class
+class McCadViewTool_Zoom : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_Zoom(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_Zoom() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const QMouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull(); + +Standard_EXPORT virtual Standard_Boolean NeedRect() const; + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // +Standard_EXPORT void run(); + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_EXPORT Standard_Integer myXmin, myXmax, myYmin, myYmax; + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.ixx new file mode 100644 index 0000000..e35543c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_Zoom_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_Zoom", + sizeof(McCadViewTool_Zoom), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_Zoom) Handle(McCadViewTool_Zoom)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_Zoom) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_Zoom))) { + _anOtherObject = Handle(McCadViewTool_Zoom)((Handle(McCadViewTool_Zoom)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_Zoom::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_Zoom) ; +} +//Standard_Boolean McCadViewTool_Zoom::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_Zoom) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_Zoom::~Handle_McCadViewTool_Zoom() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.jxx new file mode 100644 index 0000000..2a4523b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_Zoom.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_Zoom_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.hxx new file mode 100644 index 0000000..9901389 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_ZoomIn_HeaderFile +#define _McCadViewTool_ZoomIn_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_ZoomIn_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! ZoomIn Task class
+class McCadViewTool_ZoomIn : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_ZoomIn(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_ZoomIn() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.ixx new file mode 100644 index 0000000..7cd0d56 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_ZoomIn_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_ZoomIn", + sizeof(McCadViewTool_ZoomIn), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_ZoomIn) Handle(McCadViewTool_ZoomIn)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_ZoomIn) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_ZoomIn))) { + _anOtherObject = Handle(McCadViewTool_ZoomIn)((Handle(McCadViewTool_ZoomIn)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_ZoomIn::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_ZoomIn) ; +} +//Standard_Boolean McCadViewTool_ZoomIn::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_ZoomIn) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_ZoomIn::~Handle_McCadViewTool_ZoomIn() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.jxx new file mode 100644 index 0000000..0b1071c --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomIn.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_ZoomIn_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.hxx b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.hxx new file mode 100644 index 0000000..68d03dc --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.hxx @@ -0,0 +1,136 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadViewTool_ZoomOut_HeaderFile +#define _McCadViewTool_ZoomOut_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadViewTool_ZoomOut_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _Handle_McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadTool_State_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class McCadCom_CasDocument; +class McCadCom_CasView; +class McCadWin_MouseEvent; + + +//! ZoomOut Task class
+class McCadViewTool_ZoomOut : public McCadTool_Task { + +public: + // Methods PUBLIC + // + + +Standard_EXPORT McCadViewTool_ZoomOut(const Handle(McCadCom_CasDocument)& theDoc = NULL,const Handle(McCadCom_CasView)& theView = NULL,const McCadTool_State theState = McCadTool_Start,const Standard_Boolean theUndoState = Standard_False,const Standard_Boolean theRedoState = Standard_False); + +//! Deletes t.
+Standard_EXPORT virtual void Destroy() ; +~McCadViewTool_ZoomOut() +{ + Destroy(); +} + + + +Standard_EXPORT virtual void Execute() ; + + +Standard_EXPORT virtual void UnExecute() ; + + +Standard_EXPORT virtual void Suspend() ; + + +Standard_EXPORT virtual void Resume() ; + + +Standard_EXPORT virtual void MousePressEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseReleaseEvent(const McCadWin_MouseEvent& e) ; + + +Standard_EXPORT virtual void MouseLeaveEvent() ; + + +Standard_EXPORT virtual void MouseEnterEvent() ; + + +Standard_EXPORT virtual Standard_Boolean IsNull() ; + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.ixx b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.ixx new file mode 100644 index 0000000..d41c1eb --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.ixx @@ -0,0 +1,74 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + + + + +Standard_EXPORT Handle_Standard_Type& McCadViewTool_ZoomOut_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(McCadTool_Task); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadViewTool_ZoomOut", + sizeof(McCadViewTool_ZoomOut), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadViewTool_ZoomOut) Handle(McCadViewTool_ZoomOut)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadViewTool_ZoomOut) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadViewTool_ZoomOut))) { + _anOtherObject = Handle(McCadViewTool_ZoomOut)((Handle(McCadViewTool_ZoomOut)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadViewTool_ZoomOut::DynamicType() const +{ + return STANDARD_TYPE(McCadViewTool_ZoomOut) ; +} +//Standard_Boolean McCadViewTool_ZoomOut::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadViewTool_ZoomOut) == AType || McCadTool_Task::IsKind(AType)); +//} +//Handle_McCadViewTool_ZoomOut::~Handle_McCadViewTool_ZoomOut() {} + diff --git a/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.jxx b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.jxx new file mode 100644 index 0000000..64d4b06 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadViewTool_ZoomOut.jxx @@ -0,0 +1,12 @@ +#ifndef _McCadCom_CasDocument_HeaderFile +#include +#endif +#ifndef _McCadCom_CasView_HeaderFile +#include +#endif +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif +#ifndef _McCadViewTool_ZoomOut_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadWin_EventType.hxx b/src/MCCAD/McCadHeaders/McCadWin_EventType.hxx new file mode 100644 index 0000000..0f4c4fa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadWin_EventType.hxx @@ -0,0 +1,37 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadWin_EventType_HeaderFile +#define _McCadWin_EventType_HeaderFile + + +enum McCadWin_EventType { + McCadWin_WheelTypeEvent, +McCadWin_KeyTypeEvent, +McCadWin_MouseTypeEvent +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadWin_MouseButton.hxx b/src/MCCAD/McCadHeaders/McCadWin_MouseButton.hxx new file mode 100644 index 0000000..96935fd --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadWin_MouseButton.hxx @@ -0,0 +1,38 @@ +// File generated by CPPExt (Enum) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadWin_MouseButton_HeaderFile +#define _McCadWin_MouseButton_HeaderFile + + +enum McCadWin_MouseButton { + McCadWin_NoButton, +McCadWin_LeftButton, +McCadWin_RightButton, +McCadWin_MidButton +}; + + +#ifndef _Standard_PrimitiveTypes_HeaderFile +#include +#endif + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.hxx b/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.hxx new file mode 100644 index 0000000..16a02c1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.hxx @@ -0,0 +1,109 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadWin_MouseEvent_HeaderFile +#define _McCadWin_MouseEvent_HeaderFile + +#ifndef _McCadWin_MouseButton_HeaderFile +#include +#endif +#ifndef _Standard_Real_HeaderFile +#include +#endif + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +//! MouseEvent
+class McCadWin_MouseEvent { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Mouse and keyboard events
+Standard_EXPORT McCadWin_MouseEvent(const Standard_Real X,const Standard_Real Y,const McCadWin_MouseButton button); + + +Standard_EXPORT virtual McCadWin_MouseButton button() const; + + +Standard_EXPORT virtual Standard_Real x() const; + + +Standard_EXPORT virtual Standard_Real y() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +McCadWin_MouseButton myButton; +Standard_Real myX; +Standard_Real myY; + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.ixx b/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.ixx new file mode 100644 index 0000000..ebf32c3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.ixx @@ -0,0 +1,26 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + + + + diff --git a/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.jxx b/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.jxx new file mode 100644 index 0000000..28f1322 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadWin_MouseEvent.jxx @@ -0,0 +1,3 @@ +#ifndef _McCadWin_MouseEvent_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadXCAF_Application.hxx b/src/MCCAD/McCadHeaders/McCadXCAF_Application.hxx new file mode 100644 index 0000000..d159156 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadXCAF_Application.hxx @@ -0,0 +1,106 @@ +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _McCadXCAF_Application_HeaderFile +#define _McCadXCAF_Application_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_McCadXCAF_Application_HeaderFile +#include +#endif + +#ifndef _TDocStd_Application_HeaderFile +#include +#endif +#ifndef _Standard_CString_HeaderFile +#include +#endif +#include +class TColStd_SequenceOfExtendedString; + + +//DEFINE_STANDARD_HANDLE(McCadXCAF_Application,TDocStd_Application) + +//! \brief Implementation of a TDocStd_Application + +//! this class allows the use of OCCs Application Framework + +class McCadXCAF_Application : public TDocStd_Application { + +public: + // Methods PUBLIC + // + +Standard_EXPORT static const Handle(McCadXCAF_Application)& GetApplication(); + + +Standard_EXPORT virtual void Formats(TColStd_SequenceOfExtendedString& theFormats); + + +Standard_EXPORT Standard_CString ResourcesName(); +//Standard_EXPORT ~McCadXCAF_Application(); + + +Standard_EXPORT virtual void InitDocument (const Handle(TDocStd_Document)& theDoc) const; + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + Standard_EXPORT McCadXCAF_Application(); + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +//public: +// DEFINE_STANDARD_RTTI(McCadXCAF_Application) + + +}; + +//IMPLEMENT_STANDARD_HANDLE(McCadXCAF_Application,TDocStd_Application) +//IMPLEMENT_STANDARD_RTTIEXT(McCadXCAF_Application,TDocStd_Application) + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCAD/McCadHeaders/McCadXCAF_Application.ixx b/src/MCCAD/McCadHeaders/McCadXCAF_Application.ixx new file mode 100644 index 0000000..a8c42aa --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadXCAF_Application.ixx @@ -0,0 +1,76 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +//McCadXCAF_Application::~McCadXCAF_Application() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadXCAF_Application_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TDocStd_Application); + static Handle_Standard_Type aType2 = STANDARD_TYPE(CDF_Application); + static Handle_Standard_Type aType3 = STANDARD_TYPE(CDM_Application); + static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadXCAF_Application", + sizeof(McCadXCAF_Application), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadXCAF_Application) Handle(McCadXCAF_Application)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadXCAF_Application) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadXCAF_Application))) { + _anOtherObject = Handle(McCadXCAF_Application)((Handle(McCadXCAF_Application)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadXCAF_Application::DynamicType() const +{ + return STANDARD_TYPE(McCadXCAF_Application) ; +} +//Standard_Boolean McCadXCAF_Application::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadXCAF_Application) == AType || TDocStd_Application::IsKind(AType)); +//} +//Handle_McCadXCAF_Application::~Handle_McCadXCAF_Application() {} + diff --git a/src/MCCAD/McCadHeaders/McCadXCAF_Application.jxx b/src/MCCAD/McCadHeaders/McCadXCAF_Application.jxx new file mode 100644 index 0000000..f19f821 --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadXCAF_Application.jxx @@ -0,0 +1,6 @@ +#ifndef _TColStd_SequenceOfExtendedString_HeaderFile +#include +#endif +#ifndef _McCadXCAF_Application_HeaderFile +#include +#endif diff --git a/src/MCCAD/McCadHeaders/McCadXCAF_TDocShapeLabelIterator.hxx b/src/MCCAD/McCadHeaders/McCadXCAF_TDocShapeLabelIterator.hxx new file mode 100644 index 0000000..999c20b --- /dev/null +++ b/src/MCCAD/McCadHeaders/McCadXCAF_TDocShapeLabelIterator.hxx @@ -0,0 +1,66 @@ +/* + * McCadXCAF_TDocShapeLabelIterator.hxx + * + * Created on: Mar 5, 2009 + * Author: grosse + */ + +#ifndef MCCADXCAF_TDOCSHAPELABELITERATOR_HXX_ +#define MCCADXCAF_TDOCSHAPELABELITERATOR_HXX_ + +#include +#include +#include +#include +#include +#include + + +//qiu defined Standard_EXPORT +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif +//! \brief Shape iterator for a TDocStd_Document + +/** Purpose + * + * Iterates through the free TopLevel Shapes and their children (recursively) of the given document structure + * and looks for shapes. + */ + +class McCadXCAF_TDocShapeLabelIterator +{ + +public: + + //ctor + McCadXCAF_TDocShapeLabelIterator() ; +Standard_EXPORT McCadXCAF_TDocShapeLabelIterator(const Handle_TDocStd_Document& theTDoc) ; + +Standard_EXPORT void Initialize(const Handle_TDocStd_Document& theTDoc) ; +Standard_EXPORT Standard_Boolean More() ; +Standard_EXPORT void Next() ; +Standard_EXPORT TDF_Label Current() ; +Standard_EXPORT TDF_Label Value() ; // same as Current +Standard_EXPORT TDF_Label Previous() ; +Standard_EXPORT Standard_Integer NumberOfShapes(); +Standard_EXPORT TDF_Label GetAt(int index); + +private: + //functions + //Standard_Integer NumberOfShapes(); +Standard_EXPORT TDF_Label Traverse(const TDF_Label& theLab, Standard_Integer& theInt, const Standard_Integer& stop = 0); + + //fields + Handle_XCAFDoc_ShapeTool mySTool; + TDF_LabelSequence myFreeShapes; + Standard_Integer myCurrentCnt; + Standard_Integer myEnd; + TDF_Label myPrevious; + TDF_Label myCurrent; +}; + +#endif /* MCCADXCAF_TDOCSHAPELABELITERATOR_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/QMcCadGeomeTree_AddToMGDialog.h b/src/MCCAD/McCadHeaders/QMcCadGeomeTree_AddToMGDialog.h new file mode 100644 index 0000000..889c9d3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCadGeomeTree_AddToMGDialog.h @@ -0,0 +1,30 @@ +#ifndef _QMCCADGEOMETREE_ADDTOMGDIALOG_H +#define _QMCCADGEOMETREE_ADDTOMGDIALOG_H + +#include + +#include +#include +#include +#include + +class QMcCadGeomeTree_AddToMGDialog: public QDialog +{ + Q_OBJECT + +public: + + QMcCadGeomeTree_AddToMGDialog(QWidget* parent=NULL); + + void PopulateList(QTreeWidgetItem* theTWI); + QTreeWidgetItem* GetSelected(); + + +private: + Ui::addToMGDialog myAddDialog; + QListWidget* myListWidget; + QTreeWidgetItem* myCurrentTWI; + +}; + +#endif // _QMCCADGEOMETREE_ADDTOMGDIALOG_H diff --git a/src/MCCAD/McCadHeaders/QMcCadGeomeTree_TreeWidget.hxx b/src/MCCAD/McCadHeaders/QMcCadGeomeTree_TreeWidget.hxx new file mode 100644 index 0000000..3610897 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCadGeomeTree_TreeWidget.hxx @@ -0,0 +1,105 @@ +/* + * QMcCadGeomeTree_TreeView.hxx + * + * Created on: Jan 21, 2009 + * Author: grosse + */ + +#ifndef QMCCADGEOMETREE_TREEWIDGET_HXX_ +#define QMCCADGEOMETREE_TREEWIDGET_HXX_ + +#include "ui_QMcCadGeomeTree_TreeWidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "../McCadDesign/McCadMatManageDlg.hxx" +//class AIS_ListOfInteractive; + +using namespace std; +class McCadMatManageDlg; + +class QMcCadGeomeTree_TreeWidget : public QWidget +{ + Q_OBJECT + +public: + QMcCadGeomeTree_TreeWidget(QWidget* theParent = NULL); //ctor + void AddEditor( int theID, QString theName = "unnamed "); + void RemoveEditor(int theID); + void LoadDocument(int theID); + void UpdateDocument(int theID, QList label_list); + void UpdateEditorName(int theID); + Standard_Boolean GetNameByIO(const Handle(AIS_InteractiveObject)& theIO, TCollection_AsciiString& theName); + //void RedisplaySelected(); + void GetSelected(AIS_ListOfInteractive& ioList); + void AddMaterialGroup(QString& qName, QString& densName, QString& theMCard); + void UpdateTreeWidget(int theID, int iBegin, int &iEnd, TCollection_AsciiString MatGroupName); + + + +public slots: + void SlotSelectionChanged(); + void SlotVisuSelectionChanged(); + void SlotItemNameChanged(QTreeWidgetItem* item, int column); + void SlotAddMaterialGroup(); + void SlotAddToMaterialGroup(); + void SlotEditMCard(QTreeWidgetItem* theTWI); + void SlotEditMaterialCards();//Lei 14/10/2013 + void SlotOnClickRButton(const QPoint &point); + + void SlotSaveMaterials(); + void SlotLoadMaterials(); + +private: + //functions + TCollection_AsciiString GetItemLabelEntry(QTreeWidgetItem* theItem); + QTreeWidgetItem* MakeNewTreeWidgetItem(const TCollection_AsciiString& theName, QTreeWidgetItem* theParent); + Standard_Boolean IsRegistered(TCollection_AsciiString& theID); + void LockSignalSelectionChanged(); + void UnlockSignalSelectionChanged(); + void Mcout(QString theMessage); + QMcCad_Editor* GetEditor(int id=-1); + TCollection_AsciiString QS2AS(QString& qStr); + void LoadMCards(); + void LoadMaterialLink(TDF_Label& theLab); + void AddToMaterialGroup(QTreeWidgetItem* selected, QList itemList); + QTreeWidgetItem* GetMaterialTWI(); + void RecursiveSelection(QTreeWidgetItem* theTWI, const QString& theName, QList& theList); + + //fields + Ui::McTreeView theTreeWidget; + QTreeWidget* myTreeWidget; + QTreeWidget* myMaterialTreeWidget; + //QMap myEditorItemMap; + QMap myIDLabelItemMap; //maps the extended label id to a qtreewidgetitem + bool mySignalSelectionChangedLocked; + bool myReadDocument; + bool myAddMaterialMembershipIsLocked; + QString myDoubleClickedItemName; + bool myItemDoubleClicked; + bool myLock; + + QString m_strSelectedItem; + auto_ptr pMcDialog; + /**< Create a map to store the item on the tree corresponding to each editor*/ + QMap m_EditorItemMap; +}; + + +#endif /* QMCCADGEOMETREE_TREEWIDGET_HXX_ */ diff --git a/src/MCCAD/McCadHeaders/QMcCadMessenger_MainWindowMessage.hxx b/src/MCCAD/McCadHeaders/QMcCadMessenger_MainWindowMessage.hxx new file mode 100644 index 0000000..89216d5 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCadMessenger_MainWindowMessage.hxx @@ -0,0 +1,18 @@ +#ifndef QMCCADMESSENGER_MAINWINDOWMESSAGE_HXX +#define QMCCADMESSENGER_MAINWINDOWMESSAGE_HXX + +#include +#include + +class QMcCadMessenger_MainWindowMessage : public McCadMessenger_ObserverInterface{ +public: + + QMcCadMessenger_MainWindowMessage(); + ~QMcCadMessenger_MainWindowMessage(); + void PrintMessage(std::string message, McCadMessenger_MessageType type); +private: + +}; + + +#endif // QMCCADMESSENGER_MAINWINDOWMESSAGE_HXX diff --git a/src/MCCAD/McCadHeaders/QMcCad_ActionFactory.h b/src/MCCAD/McCadHeaders/QMcCad_ActionFactory.h new file mode 100644 index 0000000..124a69a --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_ActionFactory.h @@ -0,0 +1,28 @@ +#ifndef QMcCad_ActionFactory_H +#define QMcCad_ActionFactory_H + + +#include +#include +#include + +#include + +class QMcCad_ActionFactory : public QObject +{ + Q_OBJECT + + public: + + QMcCad_ActionFactory(QWidget* theWin); + + virtual ~QMcCad_ActionFactory(); + + QAction* CreateAction(McCadTool_TaskID theID, QObject* aMaster); + +private: + QWidget* myWin; +}; + +#endif + diff --git a/src/MCCAD/McCadHeaders/QMcCad_ActionMaster.h b/src/MCCAD/McCadHeaders/QMcCad_ActionMaster.h new file mode 100644 index 0000000..1d3ed05 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_ActionMaster.h @@ -0,0 +1,122 @@ +#ifndef QMcCad_ActionMaster_H +#define QMcCad_ActionMaster_H + +#include +#include + +#include +#include +//#include "QMcCad_Editor.h" + + + +class QMcCad_ActionMaster : public QObject +{ + Q_OBJECT + + public: + + QMcCad_ActionMaster(); + virtual ~QMcCad_ActionMaster(); + + Handle(McCadTool_Task) GetCurrentAction(); + void SetCurrentAction(McCadTool_TaskID theID); + void Mcout(const QString & aMessage); + +public slots: + + //edit + + void SlotUndo(); + void SlotRedo(); + void SlotCut(); + void SlotCopy(); + void SlotPast(); + void SlotSelect(); + void SlotSelectAll(); + void SlotDeselectAll(); + + // view + void SlotRedraw(); + void SlotZooomWindow(); + void SlotZoomDynamic(); + void SlotDispSelOnly(); + void SlotRedisplaySelected(); + void SlotShowAll(); + void SlotHideSelected(); + //void SlotZoomScale(); + void SlotZoomIn(); + void SlotZoomOut(); + void SlotFitAll(); + void SlotPan(); + void SlotRotate(); + void SlotBackProject(); + void SlotFrontProject(); + void SlotTopProject(); + void SlotBottomProject(); + void SlotLeftProject(); + void SlotRightProject(); + void SlotWireFrame(); + void SlotShade(); + + // assist + void SlotDistance(); + void SlotAngle(); + void SlotArea(); + void SlotVolume(); + void SlotCurveProperty(); + void SlotSurfaceProperty(); + void SlotReadValueList(); + + // model + void SlotMakeBox(); + void SlotMakeCone(); + void SlotMakeCylinder(); + void SlotMakeHalfSpace(); + void SlotMakeSphere(); + void SlotMakeTorus(); + void SlotMakeWedge(); + + // modify + void SlotErase(); + void SlotModelCopy(); + void SlotMirror(); + void SlotMove(); + void SlotModelRotate(); + void SlotScale(); + void SlotStrech(); + void SlotUnion(); + void SlotIntersection(); + void SlotDifference(); + + //window + void SlotBackgroundColor(); + void SlotShapeColor(); + void SlotShapeMaterial(); + void SlotShapeTransparency(); + void SlotAntialiasing(); + void SlotSetHiddenLine(); + void SlotSetAxis(); + void SlotSetGrid(); + + //QMcCadGeomeTree related stuff + void SlotAddMaterialGroup(); + void SlotAddToMaterialGroup(); + + //void SlotEditMaterialCards(); // Lei 14/10/2013 + void SlotClippingPlane(); + + signals: +//MYMOD + void ActionStarted(); + + + private: +McCadTool_TaskHistory myTaskHistory; + // QMcCad_Application* myMainAppWin; + +}; + +#endif + +// EOF diff --git a/src/MCCAD/McCadHeaders/QMcCad_Application.h b/src/MCCAD/McCadHeaders/QMcCad_Application.h new file mode 100644 index 0000000..ef75b2d --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_Application.h @@ -0,0 +1,306 @@ +#ifndef QMcCad_Application_H +#define QMcCad_Application_H + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//class QMcCad_PDialog; +class QWorkspace; +// class QAssistantClient; +class QMcCad_ActionFactory; +class QMcCad_ActionMaster; +class QMcCad_Editor; +class QMcCad_View; +class QTextEdit; +class QAction; +class QEvent; +class QLabel; +class FindDialog; +class Spreadsheet; +class McCadXCAF_Application; +class QMcCadGeomeTree_TreeWidget; + +//! \brief Main GUI class + +/*! Application Class; this is the GUI's core class + * + */ + + +class QMcCad_Application : public QMainWindow, public McCadAEV_Application +{ + Q_OBJECT + +public: + + //! ctor + QMcCad_Application (QWidget *parent = 0, const char *name = 0); + + //! Returns the QWorkspace + QWorkspace* GetWorkSpace(); + + //! Return current Editor
+ QMcCad_Editor* GetEditor(); + + //! Get Editor by its ID + QMcCad_Editor* GetEditor(int theID); + + //! Returns the view from the current Editor + QMcCad_View* GetView(); + + //! Returns the Document + Handle_McCadCom_CasDocument GetDocument(); + + //! Returns a pointer on the tree widget + QMcCadGeomeTree_TreeWidget* GetTreeWidget(); + + //! This function is used to define wether a file should be opened right after start up
+ //! for when a file is passed in the command line as argument. + void SetOpenFile(const TCollection_AsciiString& inName); + + //! return singleton this + static QMcCad_Application* GetAppMainWin() + { + return myApp; + } + + //! returns a pointer on the Action master. The action master links all qactions + QMcCad_ActionMaster* GetActionMaster() + { + return myAcM; + } + + //! Returns a Handle on the TDocStd_Application - this enables OCAF (open cascade application framework) + Handle_TDocStd_Application GetXCAFApp(); + + //! cout into log window +// void Mcout(const QString& aMessage, McCadGUI_MessageType = McCadGUI_DefaultMsg); + + //! cout into log window + void Mcout(const std::string& message, McCadMessenger_MessageType = McCadMessenger_DefaultMsg); + + //! return name of current file of current editor as QString + QString GetCurrentFile(); + + //! set the background color in current editor's view window + void SetBgColor(const QColor theCol) ; + + //! Receive the background color of current editor's view window + QColor GetBgColor(); + + //! Create a new TDocStd_Document + Standard_Boolean NewDocument(Handle(TDocStd_Document)& theTDoc) ; + + protected: + //! handles a close event + void closeEvent(QCloseEvent *event); + + //! handles context menues + void contextMenuEvent(QContextMenuEvent *event); + + + +private slots: + + void SlotFileNew(); + void SlotFileOpen(); + void SlotFileOpen(QString& fileName); + void SlotFileClose(); + void SlotFileSave(); + void SlotFileSaveAs(); + void SlotImport(); + void SlotExport(); + void SlotHardcopy(); + void SlotPrint(); + void SlotQuit(); + void OpenRecentFile(); + + void SlotAbout(); + void SlotHelp(); + void SlotUpdateMenus(); + void SlotEditorClosed(int); + + void SlotUpdateMainTitle(); + + + private: + + void CreateActions(); + void CreateMenus(); + void CreateToolBars(); + void CreateStatusBar(); + void CreateLogWindow(); + //void CreateCADPropDock(); + void CreateTreeView(); + void CreateProgressDialog(); + void ReadSettings(); + void WriteSettings(); + + + void SetCurrentFile(const QString &fileName); + + void UpdateRecentFileItems(); + + + QString StrippedName(const QString &fullFileName); + + QStringList myRecentFiles; + enum { MaxRecentFiles = 10 }; + int myRecentFileIds[MaxRecentFiles]; + QAction *myRecentFileActions[MaxRecentFiles]; + + QMenu *myContextMenu; + QMenu *myFileMenu; + QMenu *myEditMenu; + QMenu *myViewMenu; + QMenu *myZoomSubMenu; + QMenu *myProjectionSubMenu; + QMenu *myShadeSubMenu; + QMenu *myInsertMenu; + QMenu *myAssistMenu; + QMenu *myDesignMenu; + QMenu *myModifyMenu; + QMenu *myConvertMenu; + QMenu *myBooleanSubMenu; + + QMenu *myWindowMenu; + QMenu *myHelpMenu; + + QToolBar *myFileToolBar; + QToolBar *myViewToolBar; + QToolBar *myConvertBar; + + // QActions + QAction *myActionFileNew; + QAction *myActionFileOpen; + QAction *myActionFileClose; + QAction *myActionFileSave; + QAction *myActionFileSaveAs; + QAction *myActionImportGeom; + QAction *myActionExportGeom; + QAction *myActionHardCopy; + QAction *myActionPrint; + QAction *myActionEditUndo; + QAction *myActionEditRedo; + QAction *myActionEditCut; + QAction *myActionEditCopy; + QAction *myActionEditPaste; + QAction *myActionSelect; + QAction *myActionSelectAll; + QAction *myActionDeselectAll; + QAction *myActionRedraw; + QAction *myActionZoomWindow; + // QAction *myActionZoomDynamic; + // QAction *myActionZoomScale; + QAction *myActionFitAll; + QAction *myActionZoomIn; + QAction *myActionZoomOut; + QAction *myActionPan; + QAction *myActionRotate; + QAction *myActionBackProject; + QAction *myActionFrontProject; + QAction *myActionTopProject; + QAction *myActionBottomProject; + QAction *myActionLeftProject; + QAction *myActionRightProject; + QAction *myActionWireFrame; + QAction *myActionFlatShade; + QAction *myActionMeasureDistance; + QAction *myActionMeasureAngle; + QAction *myActionMeasureArea; + QAction *myActionMeasureVolume; + QAction *myActionPropertyCurve; + QAction *myActionPropertySurface; + QAction *myActionMakeBox; + QAction *myActionMakeCone; + QAction *myActionMakeCylinder; + QAction *myActionMakeHalfSpace; + QAction *myActionMakeSphere; + QAction *myActionMakeTorus; + QAction *myActionMakeWedge; + QAction *myActionModelErase; + QAction *myActionModelCopy; + QAction *myActionModelMirror; + QAction *myActionModelMove; + QAction *myActionModelRotate; + QAction *myActionModelScale; + QAction *myActionModelStrech; + QAction *myActionSolidUnion; + QAction *myActionSolidIntersection; + QAction *myActionSolidDifference; + QAction *myActionBackgroundColor; + QAction *myActionShapeColor; + QAction *myActionShapeMaterial; + QAction *myActionShapeTransparency; + QAction *myActionAntialiasing; + QAction *myActionSetHiddenLine; + QAction *myActionSetGrid; + QAction *myActionSetAxis; + QAction *myActionQuit; + QAction *myActionAbout; + QAction *myActionHelp; + QAction *myActionConvertModel; + QAction *myActionGenerateVoids; + QAction *myActionExplodeModel; + QAction *myActionDecomposeModel; + QAction *myActionDisplaySelectedOnly; + QAction *myActionHideSelected; + QAction *myActionShowAll; + QAction *myActionRedisplaySelected; + QAction *myActionAddMaterialGroup; + QAction *myActionAddToMaterialGroup; + QAction *myActionClippingPlane; + QAction *myActionReadValueList; + + QList myFileActionList; + QList myEditActionList; + QList myViewActionList; + QList myAssistActionList; + QList myDesignActionList; + QList myModifyActionList; + QList myWindowActionList; + QList myConvertActionList; + + + private: + + McCadMessenger_Singleton* m_messenger; + + QLabel *myReadyLabel; + QMcCad_ActionMaster* myAcM; + static QMcCad_Application* myApp; + + QWorkspace* myWS; + QPrinter *myPrinter; + QMcCad_LogWindow* myOut; + QString myCurrentFileName; +// static QAssistantClient* myAssistant; + + Handle_McCadXCAF_Application myXCAFApp; + Standard_Integer myEditorIDCnt; + + QMcCadGeomeTree_TreeWidget* myTreeView; + QProgressDialog* myPDialog; + QString myWorkingDirectory; + QMap myIDEditorMap; + QColor myBgCol; + bool myLoadFileAtStartUp; + +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/QMcCad_ClippingPlaneDialog.h b/src/MCCAD/McCadHeaders/QMcCad_ClippingPlaneDialog.h new file mode 100644 index 0000000..a1d3727 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_ClippingPlaneDialog.h @@ -0,0 +1,50 @@ +/* + * QMcCad_TrnapsparencyDialog.h + * + * Created on: Jul 18, 2008 + * Author: grosse + */ +#ifndef QMCCAD_ClippingPlaneDialog_H_ +#define QMCCAD_ClippingPlaneDialog_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +class QMcCad_ClippingPlaneDialog : public QDialog +{ + Q_OBJECT + +public: + QMcCad_ClippingPlaneDialog(QWidget* theFather = NULL); + void SetInitialValues(Standard_Real& a, Standard_Real& b, Standard_Real& c, Standard_Real& d, Standard_Boolean& visuState); + +public slots: + void IsAccepted(); + void VisuStateChanged(int chVal); + void SliderValChanged(int slVal); + void IsCanceled(); + void LineEdited(); + +private: + +// Functions + void UpdateClippingPlane(Standard_Real a, Standard_Real b, Standard_Real c, Standard_Real d); + void GetFormData( TCollection_AsciiString& locX, TCollection_AsciiString& locY, TCollection_AsciiString& locZ , + TCollection_AsciiString& dirX, TCollection_AsciiString& dirY, TCollection_AsciiString& dirZ, + TCollection_AsciiString& a, TCollection_AsciiString& b, TCollection_AsciiString& c, TCollection_AsciiString& d); +// Fields + Ui::ui_ClippingPlaneDialog uiClipDial; + Standard_Real myA, myB, myC, myD; + Standard_Boolean myVisuState; + Handle(V3d_Plane) myPln3D; + gp_Dir myDir; + Standard_Boolean myEntriesChanged; +}; + +#endif /* QMCCAD_ClippingPlaneDialog_H_ */ diff --git a/src/MCCAD/McCadHeaders/QMcCad_Editor.h b/src/MCCAD/McCadHeaders/QMcCad_Editor.h new file mode 100644 index 0000000..6a800a4 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_Editor.h @@ -0,0 +1,295 @@ +#ifndef QMcCad_Editor_H +#define QMcCad_Editor_H + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#ifndef _OSD_File_HeaderFile +#include +#endif +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include + +#include +#include + +#include +#include + +#include + +#include +/////////////////////////////////////////////////////////// +#include + +#ifndef _OSD_File_HeaderFile +#include +#endif +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +//#include + +#include + +#include "../McCadTool/MaterialManager.hxx" +#include "../McCadTool/Material.hxx" + +using namespace std; + +class QMcCad_Viewer; +class QMcCad_View; +class QMcCad_ActionMaster; + +class QMcCad_Editor : public QMainWindow, public McCadAEV_Editor + { + Q_OBJECT + +public: + + QMcCad_Editor(QWidget* theParent, const char* theName=NULL, const Standard_Integer& theID = -1); + ~QMcCad_Editor(); + + Handle(McCadCom_CasDocument) GetDocument(); + QMcCad_View* GetView(); + QMcCad_Viewer* GetViewer(); + void SetView(QMcCad_View* theView); + + void Import( const QString& theFileName); + bool Save(); + //void Close(); + bool Save(const TCollection_AsciiString& saveName ); + bool Export(const TCollection_AsciiString& theFileName); + + bool Export(); + + void Hardcopy(const QString& theFileName); + void Print(QPrinter* thePrinter); + + void SetCurrentFilter(QString theFilter); + QString GetCurrentFilter(); + + void Mcout(const QString& aMessage, McCadMessenger_MessageType msgType = McCadMessenger_DefaultMsg); + + void SetDocument(Handle(McCadCom_CasDocument) theDoc); + void SetViewer(QMcCad_Viewer* theViewer); + + QMcCad_ActionMaster* GetActionMaster(); + + QString GetQFileName(); + + void SetID(Standard_Integer theID); + Standard_Integer ID(); + + TDF_LabelSequence* GetLabelSequence(); + Handle(TPrsStd_AISViewer) GetTViewer(); + + void UpdateWindowTitle(); + void UpdateView(); + + void GradientBackground(); + + void MakeRotationMoviePictures(); + + void SetIsLoaded(Standard_Boolean status); + + MaterialManager* GetMatManager(); + //void SetMatManager(MaterialManager *&theManager); + + // Lei Lu, 21.11.2013 + Standard_Boolean AddTreeItem(TCollection_AsciiString, QTreeWidgetItem *&); // Add a lable and corresponding tree item + QTreeWidgetItem * GetTreeItem(TCollection_AsciiString); // Get a tree item from the lable input + TCollection_AsciiString GetSolidFromItem(QTreeWidgetItem *& pItem); + void DeleteSelectedItem(TCollection_AsciiString theLabel); + + void DeleteTreeItem(); // Delete the tree items when delete this editor + +protected: + void closeEvent(QCloseEvent* e); + +private: + void InitDocument(); // create View and viewer + void InitDocument(Handle(McCadCom_CasDocument) theDoc); + void InitViewer(); // create View and viewer + void InitTDoc(); + +public slots: + void SlotViewModified(); + void updateProgress(int); + virtual void keyPressEvent(QKeyEvent* e); + virtual void keyReleaseEvent(QKeyEvent* e); + +signals: + void keyPressed(QKeyEvent*); + void keyReleased(QKeyEvent*); + void updateMainTitle(); + void saveAs(); + void destroyed(int); + void updateProgress(int, QString); + +private: + QProgressBar* myProgressBar; + Handle(McCadCom_CasDocument) myDoc; + QMcCad_Viewer* myViewer; + QString myCurrentFilter; + Standard_Integer myID; + TDF_LabelSequence myLabelSequence; + TCollection_AsciiString mySaveName; + Standard_Boolean myIsLoaded; + + MaterialManager * m_pMatManager; + /** create a map to store the relationship of tree item and each solid in view, TreeMap, Lei Lu*/ + QMap m_IDLabelItemMap; + QMap m_ItemSolidMap; +}; + + +#endif + diff --git a/src/MCCAD/McCadHeaders/QMcCad_LogWindow.h b/src/MCCAD/McCadHeaders/QMcCad_LogWindow.h new file mode 100644 index 0000000..69d97f3 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_LogWindow.h @@ -0,0 +1,35 @@ +#ifndef QMcCad_LogWindow_H +#define QMcCad_LogWindow_H +#include + + +class QMcCad_LogWindow : public QTextEdit { + Q_OBJECT + public: + + QMcCad_LogWindow(QWidget* parent); + + public: + + void Append(QString theString); + void Warning(QString theString); + void Error(QString theString); + void Heading(QString theString); + + void SetTextColor(int r, int g, int b); + void SetTextColor(QColor& c); + + QSize sizeHint () const; + + private: + + QString myString; + QWidget* myParent; + QColor myWColor; + QColor myEColor; + QColor myColor; +}; + +#endif + + diff --git a/src/MCCAD/McCadHeaders/QMcCad_ReadListDialog.hxx b/src/MCCAD/McCadHeaders/QMcCad_ReadListDialog.hxx new file mode 100644 index 0000000..f858d6e --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_ReadListDialog.hxx @@ -0,0 +1,43 @@ +#ifndef QMCCAD_READLISTDIALOG_HXX +#define QMCCAD_READLISTDIALOG_HXX + +#include +#include +#include +#include + +using namespace std; + +class QMcCad_ReadListDialog : public QDialog +{ + Q_OBJECT + +public: + QMcCad_ReadListDialog(); + TCollection_AsciiString GetFileName(); + double GetLowerBound(); + double GetUpperBound(); + bool FileSelected(); + list GetCellNumberList(); + list GetValueList(); + int GetNbColors(); + bool Done(); + + public slots: + void SlotOpenFile(); + void SlotDyeSolids(); + +private: + bool ParseFile(); + + bool myIsDone; + + Ui_McCad_LoadVisualizationList myUI; + bool myFileSelected; + double myLowerBound, myUpperBound; + TCollection_AsciiString myFileName; + list myCellNumberList; + list myValueList; +}; + +#endif // QMCCAD_READLISTDIALOG_HXX diff --git a/src/MCCAD/McCadHeaders/QMcCad_TransparencyDialog.h b/src/MCCAD/McCadHeaders/QMcCad_TransparencyDialog.h new file mode 100644 index 0000000..6543d71 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_TransparencyDialog.h @@ -0,0 +1,31 @@ +/* + * QMcCad_TrnapsparencyDialog.h + * + * Created on: Jul 18, 2008 + * Author: grosse + */ +#ifndef QMCCAD_TRANSPARENCYDIALOG_H_ +#define QMCCAD_TRANSPARENCYDIALOG_H_ + +#include +#include +#include +#include + +class QMcCad_TransparencyDialog : public QDialog +{ + Q_OBJECT + +public: + QMcCad_TransparencyDialog(QWidget* theFather = NULL); + + +public slots: + void IsAccepted(); + void SetTransparency(int value); + +private: + Ui::TransDialog uiTranspDial; +}; + +#endif /* QMCCAD_TransparencyDialog_H_ */ diff --git a/src/MCCAD/McCadHeaders/QMcCad_VGParamDialog.h b/src/MCCAD/McCadHeaders/QMcCad_VGParamDialog.h new file mode 100644 index 0000000..3dd74e9 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_VGParamDialog.h @@ -0,0 +1,67 @@ +/* + * QMcCad_VGParamDialog.h + * + * Created on: Jul 18, 2008 + * Author: grosse + */ +#ifndef QMCCAD_VGPARAMDIALOG_H_ +#define QMCCAD_VGPARAMDIALOG_H_ + +#include +#include +#include +#include + +class QMcCad_VGParamDialog : public QDialog +{ + Q_OBJECT + +public: + QMcCad_VGParamDialog(QWidget* theFather = NULL); + QPushButton* GetAcceptButton(); + QPushButton* GetCancelButton(); + QPushButton* GetLoadButton(); + + bool GetWriteCollision(); + bool GetWriteDiscretModel(); + + double GetTolerance(); + double GetXRes(); + double GetYRes(); + int GetMaxSamplePnts(); + int GetMinSamplePnts(); + int GetMaxComplemented(); + int GetMaxPreDec(); + int GetInitialCellNumber(); + int GetInitialSurfaceNumber(); + double GetMinDecFace(); + double GetMinReDecFace(); + double GetMinVoidVolume(); + double GetMinInputVolume(); + //QString* GetBoundingBox(); + bool Accepted(); + McCadCSGGeom_Unit GetUnits(); + + +public slots: + void IsAccepted(); + void SlotMMStateChanged(int theState); + void SlotCMStateChanged(int theState); + +signals: + void CanContinue(); + +private: + QPushButton* myAcceptButton; + QPushButton* myLoadButton; + QPushButton* myCancelButton; + QCheckBox* myCM; + QCheckBox* myMM; + McCadCSGGeom_Unit myUnit; + + bool myAccepted; + Ui::VGParamDialog uiVGParams; + +}; + +#endif /* QMCCAD_VGPARAMDIALOG_H_ */ diff --git a/src/MCCAD/McCadHeaders/QMcCad_View.h b/src/MCCAD/McCadHeaders/QMcCad_View.h new file mode 100644 index 0000000..664b7be --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_View.h @@ -0,0 +1,95 @@ +#ifndef QMcCad_View_H +#define QMcCad_View_H + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +class QMcCad_Viewer; +class QMcCad_ActionMaster; + + +class QMcCad_View : public QGLWidget, public McCadCom_CasView +{ + Q_OBJECT + +public: + QMcCad_View(QWidget* theParent, QMcCad_Viewer* theViewer, Handle(McCadCom_CasDocument) theDoc); + ~QMcCad_View(); + QSize minimumSizeHint() const; + QSize sizeHint() const; + void ClippingPlaneDialog(); + void SetClippingPlaneParameters(Standard_Real a, Standard_Real b, Standard_Real c, Standard_Real d, Standard_Boolean state); + +signals: + + void InitFinished(); + void viewModified(); + void SigSelectionChanged(); + +protected: + void initializeGL(); + void resizeGL(int width, int height); + void paintGL(); + +public slots: + + virtual void mousePressEvent ( QMouseEvent* e); + virtual void mouseReleaseEvent ( QMouseEvent* e); + virtual void mouseMoveEvent ( QMouseEvent* e); + //virtual void paintEvent ( QPaintEvent * e); + // virtual void resizeEvent ( QResizeEvent* e); + + virtual void LeaveEvent(QEvent*); + virtual void EnterEvent(QEvent*); + virtual void FocusInEvent(QFocusEvent*); + virtual void FocusOutEvent(QFocusEvent*); + virtual void wheelEvent(QWheelEvent* e); + virtual void keyPressEvent(QKeyEvent* e); + virtual void keyReleaseEvent(QKeyEvent* e); + void SlotInitTask(); + void PreExecute(); + + private: + + void Select(); + void ShiftSelect(); + void DrawRectangle(); + void Execute(); + Standard_Boolean ConvertToPlane(const Standard_Integer Xs, const Standard_Integer Ys, Standard_Real& X, Standard_Real& Y, Standard_Real& Z); + + + private: + + QMcCad_Viewer* myViewer; + QMcCad_ActionMaster* myAcM; + Standard_Integer myXmin; + Standard_Integer myYmin; + Standard_Integer myXmax; + Standard_Integer myYmax; + Standard_Boolean myIsInit; + Standard_Boolean mySelectionMode; + Standard_Boolean myRectangleMode; + Standard_Boolean myShiftSelect; + Standard_Boolean myControlDown; + //CAD mouse cursor + Standard_Boolean myLMBpushed; + Standard_Boolean myMMBpushed; + McCadTool_TaskID myCurrentTID; + QRubberBand* myRubberBand; + Standard_Boolean myAxisSet; + Standard_Real myCPA, myCPB, myCPC, myCPD; + Standard_Boolean myCPVisState; + +}; + +#endif diff --git a/src/MCCAD/McCadHeaders/QMcCad_Viewer.h b/src/MCCAD/McCadHeaders/QMcCad_Viewer.h new file mode 100644 index 0000000..6c2f480 --- /dev/null +++ b/src/MCCAD/McCadHeaders/QMcCad_Viewer.h @@ -0,0 +1,58 @@ +#ifndef QMcCad_Viewer_H +#define QMcCad_Viewer_H + +#include + +#include +#include + +class QMcCad_Editor; +class QMcCad_View; +class QMcCad_ActionMaster; + +class QMcCad_Viewer : public McCadAEV_Viewer +{ + // Q_OBJECT + +public: + + QMcCad_Viewer(QMcCad_Editor* theEditor); + virtual ~QMcCad_Viewer(); + + virtual void Update(); + virtual void Reconfigure(); + + QMcCad_Editor* GetEditor(); + + QMcCad_View* GetView(); + + void SetView(QMcCad_View* theView); + + void Mcout(const QString & aMessage); + + QMcCad_ActionMaster* GetActionMaster(); + + bool IsConfigured() + { + return myIsConfigured; + } + + void SetViewer(Handle(V3d_Viewer)& theViewer) + { + myViewer = theViewer; + } + + Handle(V3d_Viewer) GetViewer() const + { + return myViewer; + } + +private: + + QMcCad_View* myView; + QMcCad_Editor* myEditor; + bool myIsConfigured; +}; + +#endif + diff --git a/src/MCCAD/McCadHeaders/main.h b/src/MCCAD/McCadHeaders/main.h new file mode 100644 index 0000000..e9df935 --- /dev/null +++ b/src/MCCAD/McCadHeaders/main.h @@ -0,0 +1,14 @@ +//File: McCadTest.cdl +//Created: Fri Jan 12 11:34:09 CET 2001 +//Author: H. Tsige-Tamirat +//Copyright: Forschungszentrum Karlsruhe GmbH 2001 +#ifndef Main_H +#define Main_H +#include +#include +#include +#include + +QString theProgName; + +#endif diff --git a/src/MCCAD/McCadHeaders/mainpage.h b/src/MCCAD/McCadHeaders/mainpage.h new file mode 100644 index 0000000..b931f50 --- /dev/null +++ b/src/MCCAD/McCadHeaders/mainpage.h @@ -0,0 +1,311 @@ +/** +* @mainpage notitle +*


+* \image html McCad_KIT_Logo_1.png "version 0.1 (beta)" width=10cm +* +* @authors Dennis Große +* +*
+* Table of content: +* \li Introduction +* \li Requirements +* \li Installation +* \li Use of McCad +* \li Development +* \li Contact +* +*
+* @section intro Introduction +* McCad is a CAD interface programme for Monte Carlo (MC) particle transport codes. It has been developed at Karlsruhe Intitute of Technology (KIT).
+* In the current version the programme generates MC geometry description for the MC codes MCNP5 and Tripoli4. Additionally it reads MCNP5 input files and translates the geometry description into CAD geometry.

+* McCad uses only open source software and is conceived as open source project itself. Please take a look at the License agreement.

+* Supported CAD file formats are the CAD system independent formats STEP, IGES and BREP. The STEP file format is most suitable for the conversion process. It is supported by all major CAD systems. Due to the used CAD kernel and the capability of the MC codes to handle only algebraical surface types of order up to two (and tori) the choice for surfaces for a CAD model to be converted by McCad is restricted to the following types:
+* \li Planes +* \li Cylinders +* \li Cones +* \li Spheres +* \li Circular Tori +* +* All solids using unsuitable surface types will be neglected. One can test if a CAD file is suitable for conversion by running \c McCad \c -s \c InputFile.stp from command line.
+* +*

+* +* @section requirements Requirements +* \li Operating System: Linux / Unix +* \li cmake >= 2.6.0 (for installation) +* \li OpenCascade 6.3 +* \li Qt >= 4.2 +* \li doxygen (for documentation) +* +* For hardware requirements please take a look at the documentation of the OpenCascade 6.3 software package.
+* +*

+* +* @section install Installation +* For the install of McCad the software listed above (Requirements) section must be installed and configured properly.
+*
+* This is a step by step installation guide: +*
+ Assuming the following:
+     QT4 exists on system already
+     you have downloaded the OpenCASCADE 6.3.0 source tarball to $HOME/Downloads/OpenCASCADE_src.tgz
+     you have copied the McCad sources to $MCCADROOT
+     $HOME/opt/bin is in your path
+
+ 1. Before doing anything else, add this to your environment and startup scripts
+     export CASROOT="$HOME/opt/OCC630"
+     export MCCADROOT="$HOME/opt/McCad"
+
+ 2. Build OpenCASCADE 6.3.0 
+     mkdir -p $CASROOT/install
+     cd $CASROOT/install
+     tar xzf $HOME/Downloads/OpenCASCADE_src.tgz
+     cd OpenCASCADE6.3.0/ros
+     configure --prefix=$CASROOT --with-tcl --with-tk --enable-wok
+     make install
+
+ 3. Configure environment
+     add OpenCascade variables to your environment
+     the easiest way is to run the file $CASROOT/env_DRAW.sh after setting $CASROOT in your startup scripts
+
+ 4. Build McCad
+     mkdir $MCCADROOT/build
+     cd $MCCADROOT/build
+     cmake ../
+     make
+
+ 5. Configure environment for McCad
+     export MCCAD_LIBDIR=$MCCADROOT/lib
+
+ 6. Put a copy of the executable in your path
+     cp $MCCADROOT/bin/McCad $HOME/opt/bin
+    or set a symbolic link
+     ln -s $MCCADROOT/bin/McCad $HOME/opt/bin/McCad
+    
+                                                (Special thanks to Paul Wilson, who basically wrote this step-by-step guide)
+
+* +*

+* +* @section use Use of McCad +* McCad integrates a graphical user interface (GUI) which allows the visualization of CAD geometry and the exchange of CAD data and MC geometry description (CAD<->MCNP, CAD->Tripoli). For the conversion of complex (large) models it should be considered to omit the GUI and perform the conversion step by step from command line. The reason herefore is, that the bigger a CAD model is the higher grows the probability for the occurence of solid parts that cannot be converted. The export functions implemented in the GUI are one-click exports. The algorithmic export from CAD to MC consists of three steps, from which two are critical. The first step is the sign constant decomposition of all input solids. The second step is the generation of potential void volumes. In both cases Boolean operations on CAD solids are performed. Unfortunately, the implementation of the Boolean operations in the used CAD kernel are not failsafe. Also, this is a beta release. There are still some undiscovered bugs in the McCad source code. (For more details on the underlying algorithm please take a look at: D. Grosse, H. Tsige Tamirat, "Current Status of the CAD Interface Programme for MC Particle Transport Codes McCad", Internat. Conf. on Advances in Mathematics, Computional Methods and Reactor Physics, Saratoga Springs, N.Y., May 3-7, 2009, Proc. on CD-ROM, LaGrange Park, III.) +* +* +* @subsection gui GUI +*
+* \image html gui1.png "McCad GUI displaying MCNP geometry" +*
+* The image shows the McCad GUI displaying the solid geometry of a MCNP input file. By default the void geometry will not be constructed. The frame on the left shows the material groups found in the MCNP input file in the upper area, and below the IDs of the reconstructed volumes. A mouse click on the material group selects all members of the group.
+* To modify the visualization the GUI offers different tools.
+*
+* Visualization tools: +* \li Zoom (mouse wheel) +* \li Rotate (middle mouse button) +* \li Pan (ctrl + left mouse button) +* \li Type of visualization -> Shaded, Wireframe, Hidden Lines +* \li Coloring (context menu, right click) +* \li Transparency (context menu, right click) +* \li Definition of clipping planes (window) +* \li Hiding of selected shapes +* \li Displaying of selected shapes only +* \li Redisplaying of selected shapes +* \li different projections (display of two coordinates in the status bar) +* +* Import (ctr+i) | Export (ctrl+e) :
+*
+* The GUI imports STEP(.stp, .step), IGES(.igs, iges), BREP(.rle, brep) and MCNP(.mcn) files. Available surface types in MCNP are: P, PX, PY, PZ, SO, S, SX, SY, SZ, C/X, C/Y, C/Z, CX, CY, CZ, K/X, K/Y, K/Z, KX, KY, KZ, TX (circular), TY (circular), TZ (circular), X, Y, Z, P; as well as the following macro bodies: BOX, RPP, SPH, RCC, RHP. +* The Export function supports the three mentioned CAD formats (caution BREP allows only one solid to be exported per file) as well as MCNP(.mcn) and Tripoli(.d, .tri) geometry description. When exporting to a MC file format a dialog with (optional) conversion parameters appears. The parameters affect the computation of the void space for the MC file.
+* +* \image html parameters.png "Optional MC Export Parameters" +*
+* Optional Parameters : +* \li Write Collision File [0|1] : If this box is checked, a test for collisions between input solids is performed. The result is written to the file \c .CollisionFile in the working directory. If it is unchecked, the programme trys to read \c .CollisionFile and extract the collision data. If you convert an identical geometry with a different parameter set, you can uncheck this box. It will reduce the conversion time. +* \li Write Discrete Model [0|1] : All faces of all solids will be covered with sample points. These sample points are used for collision detection among the input solids, and between the input solids and the generated void space on CAD level. If this box is checked a \c _*.voxel file will be written for every input solid. The *_.voxel files contain the the location information of the sample points. If you rerun the same geometry with e.g. a different setting for the minimum cut face area, uncheck this box. It will reduce the conversion time. +* \li Input Units [MM|CM]: MC codes use \c cm as basis length unit. If the CAD model is not prepared in \c cm units (default in CAD systems is usually \c mm ) select \c mm as input units. Otherwise the output will be wrongly scaled. +* \li Initial Surface Number [integer] : If a CAD part for an already existing MC model will be converted, a range of surface IDs is already ocupied. This parameter sets the initial surface number for the converted CAD model. +* \li Initial Cell Number [integer] : same as Initial Surface Number but for solid volumes +* \li Minimum Input Solid Volume [real]: omits input solid volumes (input units) smaller than this value +* \li Minimum Void Volume [real]: Determines the minimum volume (input units) of a cutted part of the bounding box (see next parameter). The smaller this value, the more void volumes will be generated +* \li Minimum Decomposition Face Area [real] : The void space is generated from a bounding box which surrounds the whole CAD model. The bounding box is decomposed by all sign changing planar faces of the decomposed CAD model. This value determines the minimum area (input units) a face may have to become a cut face. This parameter is used to regulate the number of void volumes that are generated by the code. The smaller this value, the more void volumes. +* \li Minimum Redecomposition Face Area [real]: If a void volume collides with too many solids, perform a second decomposition cycle on the void volume. Use this value as minimum area (input units) for cut faces. This value must be smaller than Minimum Decomposition Face Area. This prevents an excessive use of the complement operator. +* \li Maximum Number Of Predecomposed Cells: If the number of cuts of the bounding box reaches this value, the cutting will stop. This prevents the production of too many void volumes. +* \li Maximum Number Of Complement Cells: Determines how many complement operators should be used at a max for one void volume. This value shouldn't exceed \c 10 +* \li Minimum / Maximum Number Of Sample Points: Determine the lower and upper limit for sample point generation. If too many sample points will be generated the code will become noticeable slower and the chance that the computer runs out of memory for larger models increases. If too little sample points are generated the collision test will not be reliable and the resulting MC file might become useless. The limits determine the number of sample points per edge. The desired resolution can be defined with the next parameters. +* \li X-/Y-Resolution: Determines the desired mesh size for the sample point generation. (input units) +* \li Tolerance: Determines the tolerance for all geometrical operations (measurements) in the problem. +* +* A problem specific bounding box can be loaded into the GUI. One has to rename the corresponding CAD solid "Bounding Box" or "BoundingBox". Remember these are reserved key words. Any solid carrying one of these names will be treated as a bounding box for the conversion problem.
+*These are optional parameters. For most models the predifined parameters should generate acceptable results. +*
+* Design Tools:
+*
+* The design tools allow to create new macrobodies (Box, Cylinder, Sphere, Cone) and to move them in space (rotate, translate, copy to). Boolean operations are not yet implemented.
+*
+* +* @subsection shell Command Line +* On the command line the conversion from CAD to MC is split into two steps. The first step is the sign constant decomposition of all CAD solids. The second is the completion of the model with void geometry and the printing into the MC input file. The following options are available: +* \li -d, --decomposition : perform a sign constant decomposition on a single CAD file. The decomposed geometry will be saved in a STEP file with the same name as the input file's name but with the prefix 'converted'. e.g McCad -d InputFile.stp -> convertedInputFile.stp +* \li -m, --mcnp : complete model by void and export the geometry description to an MCNP input file. This option requires a parameter file. The content of the parameter file is explained below. +* \li -t, --tripoli : complete model by void and export the geometry description to an Tripoli input file. This option requires a parameter file. The content of the parameter file is explained below. +* \li -e, --explode : explodes all solids from an input file into single STEP files named 'ExOut_FILENAME_#Nb.stp'. +* \li -f, --fuse : fuses all STEP files in a folder into a single STEP file. Requires a directory as input parameter. +* \li -s, --surface-check : Requires a STEP file as input. Prints a list of all surface types in the file. Optionally insert a file name which the information will be written into. +* +*The first three options are the relevant to converting CAD data into MC input geometry. To perform the sign constant decomposition on all STEP files in the current directory (files beginning with 'converted' will be omitted) you can use the script McCadConvertScript which is located in $MCCADROOT/bin. To convert CAD data into MCNP geometry description use the -m option, for a convertion into Tripoli use -t. These options require a parameter file as input. +* In the following the content of the parameter is presented. All parameters in the file that are defined by a keyword are optional. At least one directory which contains converted*.stp files must be given. +*The parameter file could contain all keywords mentioned in the GUI subsection and additionally the definition of a problem specific bounding box (keyword BoundingBox) and the definition of a material information file for the export into MCNP geometry description (keyword MDFile) . This is an example for a McCad parameter file:
+*
+	#
+	#      McCadInputFile.txt - EXAMPLE
+	#
+	# '#' introduces a comment line
+	# The format of this file is "keyword" "Value" where value can be a
+	# string, a real, or integer value. Order is irrelevant. 
+	# Each line that isn't a comment or begins with a key word will be 
+	# treated as input directory containing converted*.stp files.
+	#
+	# Do not put comments in keyword lines!!!
+	#
+	Units                    MM               ... CAD units MM or CM
+	InitSurfNb               500              ... Initial Surface Number of output
+	InitCellNb               100              ... Initial Volume Number of output
+	WriteCollisionFile       1                ... Write .CollisionFile of input solids (1st run only)
+	WriteDiscreteModel       1                ... Write *.voxel files for input solids
+	MinimumInputSolidVolume  1.00             ... all volumes smaller than this will be neglected
+	MinimumVoidVolume        1.25e2           ... make sure void volumes don't become to small
+	MinimumSizeOfDecompositionFaceArea   50   ... first cut surface area
+	MaximumNumberOfComplementedCells     10   ... how many complement operators may be used per void volume
+	MaximumNumberOfPreDecompositionCells 500  ... sets upper bounds for number of void volumes after first cut
+	MinimumSizeOfRedecompositionFaceArea 5    ... recut if maximum number of complement cells is exceeded
+	MinimumNumberOfSamplePoints 10            ... lower bound for discretization along a face's edge
+	MaximumNumberOfSamplePoints 50            ... upper bound for discretization along a face's edge
+	XResolution  50                           ... desired resolution of discretization in x direction
+	YResolution  50                           ... desired resolution of discretization in y direction
+	Tolerance  1e-7                           ... tolerance for all methods
+	#
+	BoundingBox  /home/user/Testarea/Bounding_Box/BB.stp       ... location and name of bounding box
+	# MDFile     /home/user/Testarea/MaterialList/MDList.txt   ... Material and Density information - MCNP only
+	#
+	# directories that contain the converted*.stp files
+	/home/user/Testarea/Model_Part1/
+	/home/user/Testarea/Model_Part2/
+	/home/user/Testarea/Model_Part3/
+ 
+*
+* For MCNP only, one can define a MDFile which contains material and density information for CAD solids. Unfortunately the material information is not transported with the STEP file. Therefore the need for a material information list arises. A MDFile is a plain ascii string text file containing three coloumns. In the first coloumn stands the name of a CAD file, e.g. convertedTestSolids.stp, without the file extension and without the conversion-prefix converted, i.e. TestSolids. The second coloumn holds the material number the solids should be given and the last coloumn contains the corresponding density. If for example the file TestSolids.stp contains three solid volumes which are supposed to consist of stainless steel, and another file testSolids2.stp containing six solids made of concrete, the corresponding MDfile could look like this: +*
+	# Name		MaterialNumber	   Density
+         TestSolids      1		    -8.3
+         TestSolids2     2                  -2.4 
+
+* When using the MDFile parameter each step file can contain only solids with identical material composition and density.
+*
+* If you want to add universe labels to the cells in the output file (MCNP only) you can export the variable MCCAD_MAKEUNIVERSE=num, where num is the number of the universe. Importances for neutrons and photons will be set to 1 for all volumes except the outer voids for which the importances are set to 0. +*
+* +* @subsection output Output +* Output from the sign constant decomposition +* \li \c .failedVolumeControl : The accumulated volume of all decomposition parts of a decomposed model will be compared to the volume of the original model. If a quotient differs more 1e-5 from 1 the name of the corresponding file and the volume information will be printed into this file. +* +* Output from the generation of void +* \li \c .Collision : Detected collisions among the input solids. Every volume is listed by the number of occurence. If a collision is detected the second number in a line will differ from 0. This value reflects the number of collisions. The next values will be the IDs of the input volumes the current solid collides with. +* \li \c *.voxel : Contain the voxel points of the input solids. +* \li \c .cadVolumes : Contains a list with two coloumns. First coloumn: the number of a solid volume in the MC output file. Second coloumn: The corresponding volume calculated by the CAD kernel. +* \li \c Mcnp_Model.mcn : Standard name of the converted MCNP model after conversion from command line. +* \li \c Tripoli_Model.d : Standard name of the converted Tripoli model after conversion from command line. +* @subsection example Example +* In $MCCADROOT/sample is a simple CAD example file (brick.stp), a parameter file (McCadInputFile.txt) and a MDFile (MaterialList.txt) located. In the following we'll see how to translate the CAD file into MCNP geometry description including material information (only available for MCNP). +* Change directory to $MCCADROOT/sample and start the McCad GUI by entering McCad. You can tell the GUI that the current directory is the working directory by passing the argument '.' , i.e. "McCad ."
+* We import the CAD file brick.stp . Open the import dialog by clicking File and then Import or use the shortcut ctrl+i . Select the file brick.stp and click the Import button. The GUI should show this picture.
+*
+* \image html brick.png "Visualization of a simple example geometry" +*
+* The following paragraph is only relevant for conversion to MCNP! This paragraph describes how to assign material information to a shape. First add a material group by right clicking on the white space in the assembly viewer on the left side and select Add new material group. In the appearing dialog enter the name for the material group you prefere, the density and the material description as it will appear in the MCNP input file in the data section. Confirm the material group. It will now appear with its name in the assembly viewer under Material Groups. Select the solid object by clicking once on it in the visualization window or on its corresponding name in the assembly viewer. For selecting multiple objects, keep the ctrl button pushed down. Right click on the assembly viewer and choose Add solids to material group. Select the material group name from the appearing dialog and confirm your choice. The object is now in the chosen material group. Clicking once on the material group name in the assembly view selects and highlights all members of this group.

+*To save a loaded geometry in an xml file (material information will be saved, too) choose File -> Save As. To export the geometry open the export dialog by choosing File -> Export or by its shortcut ctrl+e. Enter a name, choose a file type and click export.
+*If you've followed the material assignment steps above you can reimport the MCNP geometry into CAD. Remember that only material volumes will be restored from MC files.
+*
+* \image html mc2cad.png "Visualization of the reconversion MCNP -> CAD" +*
+*
+* Conversion in command line +*
+	$> McCad -h
+	   =============================================
+           	        McCad
+	   =============================================
+
+	   McCad is a CAD interface for Monte Carlo Transport Codes.
+	
+	   Usage: McCad [Options] [File | Path]  
+	
+	   Options:
+		-d, --decompose :
+				Decomposes the CAD input file, requires a STEP-FILE
+				If no output file is defined, the output will be saved as
+				converted'FILE'.
+		-e, --explode:
+				Calls the Exploder, requires a STEP-FILE
+				Explodes all solids in a STEP file to distinct files.
+				Does not accept an Output File.
+		-f, --fuse :
+				Calls the Fusioner, requires a DIRECTORY
+				Fuses all STEP-FILES in the passed Directory into one single file.
+		-m, --mcnp:
+				Calls the VoidGenerator to generate void volumes,
+				and prints the mcnp geometry into a file; requires an McCad_InputFile.
+				See manual for more details on the InputFile.
+		-s, --surface-check:
+				Prints a list of all surface types of a given model into the output file.
+		-t, --tripoli:
+				Calls the VoidGenerator to generate void volumes,
+				and prints the tripoli geometry into a file; requires an McCad_InputFile.
+				See manual for more details on the InputFile.
+
+ perform a surface check
+	$> McCad -s brick.stp
+	   ...
+	   FILE: brick.stp
+
+	   number of solids : 1
+
+	   Surface Information for Solid 1
+	   ========================================
+	   Number Of Surfaces In Model : 38
+	   ----------------------------------------
+	   Planes                  : 38
+	   Cylinder                : 0
+	   Cones                   : 0
+	   Spheres                 : 0
+	   Toroidal Surfaces       : 0
+  	   ========================================
+
+ sign constant decomposition
+	$> McCad -d brick.stp
+	   ...
+ compute void space and output to MCNP geometry description
+	$> McCad -m McCadInputFile.txt
+	   ...	
+ output file is Mcnp_Model.mcn	
+
+* You can find an example for McCadInputFile.txt and the MaterialList.txt in the $MCCADROOT/sample. +*

+* +* @section dev Development +* Implement support for the MC code XYZ: +*
+   inherit a class McCadExDllXYZ_XYZ from McCadEXPlug_MCBase. For an example take a look at McCadExDllMcnp_Mcnp 
+   add the McCadCSGGeom_XYZ to the enumeration in McCadCSGGeom_MCType.hxx
+   edit the corresponding print functions in the surface classes in McCadCSGGeom_..., e.g.: McCadCSGGeom_Plane::Print(...)
+   implement a parameter switch into main.cpp to load the export function of the newly created class
+
+*
+* Extract the export function:
+* You might want to start at McCadEXPlug_MCBase.cxx which is the base class for all exports to MC data. It is inherited by McCadExDllMcnp_Mcnp and McCadExDllTripoli_Tripoli. The conversion is the same for all MC codes except for the final printing. The base class calls the convert tools McCadConvertTools_Decomposer which performs a sign constant decomposition of the input solids and McCadConvertTools_VoidGenerator which calculates the void space for the output file.
+*

+* +* +* @section contact Contact +* Ulrich Fischer (official contact)
+* Dennis Große (technical questions) +*
+*/ diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_CopyTo.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_CopyTo.h new file mode 100644 index 0000000..bf7f651 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_CopyTo.h @@ -0,0 +1,110 @@ +#ifndef COPYTO_H +#define COPYTO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_copyToDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox; + QLabel *label_3; + QLabel *label_2; + QLabel *label; + QLineEdit *coX; + QLineEdit *coY; + QLineEdit *coZ; + + void setupUi(QDialog *copyToDialog) + { + copyToDialog->setObjectName(QString::fromUtf8("copyToDialog")); + copyToDialog->resize(QSize(205, 166).expandedTo(copyToDialog->minimumSizeHint())); + layoutWidget = new QWidget(copyToDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 130, 188, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox = new QGroupBox(copyToDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(20, 10, 171, 111)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(20, 70, 16, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(20, 50, 16, 17)); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(20, 30, 16, 17)); + coX = new QLineEdit(groupBox); + coX->setObjectName(QString::fromUtf8("coX")); + coX->setGeometry(QRect(40, 30, 113, 20)); + coX->setAlignment(Qt::AlignRight); + coY = new QLineEdit(groupBox); + coY->setObjectName(QString::fromUtf8("coY")); + coY->setGeometry(QRect(40, 50, 113, 20)); + coY->setAlignment(Qt::AlignRight); + coZ = new QLineEdit(groupBox); + coZ->setObjectName(QString::fromUtf8("coZ")); + coZ->setGeometry(QRect(40, 70, 113, 20)); + coZ->setAlignment(Qt::AlignRight); + retranslateUi(copyToDialog); + QObject::connect(okButton, SIGNAL(clicked()), copyToDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), copyToDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(copyToDialog); + } // setupUi + + void retranslateUi(QDialog *copyToDialog) + { + copyToDialog->setWindowTitle(QApplication::translate("copyToDialog", "Copy to...", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("copyToDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("copyToDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("copyToDialog", "Coordinates", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("copyToDialog", "Z", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("copyToDialog", "Y", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("copyToDialog", "X", 0, QApplication::UnicodeUTF8)); + coX->setText(QApplication::translate("copyToDialog", "0", 0, QApplication::UnicodeUTF8)); + coY->setText(QApplication::translate("copyToDialog", "0", 0, QApplication::UnicodeUTF8)); + coZ->setText(QApplication::translate("copyToDialog", "0", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(copyToDialog); + } // retranslateUi + +}; + +namespace Ui { + class copyToDialog: public Ui_copyToDialog {}; +} // namespace Ui + +#endif // COPYTO_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeBox.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeBox.h new file mode 100644 index 0000000..0cc8a6e --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeBox.h @@ -0,0 +1,147 @@ +#ifndef MAKEBOX1_H +#define MAKEBOX1_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_MakeBoxDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox; + QLineEdit *Ori_X; + QLineEdit *Ori_Y; + QLineEdit *Ori_Z; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QGroupBox *groupBox_2; + QLabel *label_5; + QLabel *label_6; + QLabel *label_4; + QLineEdit *Dim_X; + QLineEdit *Dim_Y; + QLineEdit *Dim_Z; + + void setupUi(QDialog *MakeBoxDialog) + { + MakeBoxDialog->setObjectName(QString::fromUtf8("MakeBoxDialog")); + MakeBoxDialog->resize(QSize(362, 180).expandedTo(MakeBoxDialog->minimumSizeHint())); + layoutWidget = new QWidget(MakeBoxDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 140, 341, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + groupBox_2 = new QGroupBox(MakeBoxDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(190, 10, 161, 121)); + label_5 = new QLabel(groupBox_2); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(20, 90, 21, 17)); + label_6 = new QLabel(groupBox_2); + label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setGeometry(QRect(20, 60, 21, 17)); + label_4 = new QLabel(groupBox_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(20, 30, 21, 17)); + Dim_X = new QLineEdit(groupBox_2); + Dim_X->setObjectName(QString::fromUtf8("Dim_X")); + Dim_X->setGeometry(QRect(40, 30, 113, 20)); + Dim_X->setAlignment(Qt::AlignRight); + Dim_Y = new QLineEdit(groupBox_2); + Dim_Y->setObjectName(QString::fromUtf8("Dim_Y")); + Dim_Y->setGeometry(QRect(40, 60, 113, 20)); + Dim_Y->setAlignment(Qt::AlignRight); + Dim_Z = new QLineEdit(groupBox_2); + Dim_Z->setObjectName(QString::fromUtf8("Dim_Z")); + Dim_Z->setGeometry(QRect(40, 90, 113, 20)); + Dim_Z->setAlignment(Qt::AlignRight); + + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox = new QGroupBox(MakeBoxDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 10, 161, 121)); + Ori_X = new QLineEdit(groupBox); + Ori_X->setObjectName(QString::fromUtf8("Ori_X")); + Ori_X->setGeometry(QRect(40, 30, 113, 20)); + Ori_X->setAlignment(Qt::AlignRight); + Ori_Y = new QLineEdit(groupBox); + Ori_Y->setObjectName(QString::fromUtf8("Ori_Y")); + Ori_Y->setGeometry(QRect(40, 60, 113, 20)); + Ori_Y->setAlignment(Qt::AlignRight); + Ori_Z = new QLineEdit(groupBox); + Ori_Z->setObjectName(QString::fromUtf8("Ori_Z")); + Ori_Z->setGeometry(QRect(40, 90, 113, 20)); + Ori_Z->setAlignment(Qt::AlignRight); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(20, 30, 21, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(20, 60, 21, 17)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(20, 90, 21, 17)); + retranslateUi(MakeBoxDialog); + QObject::connect(okButton, SIGNAL(clicked()), MakeBoxDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), MakeBoxDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(MakeBoxDialog); + } // setupUi + + void retranslateUi(QDialog *MakeBoxDialog) + { + MakeBoxDialog->setWindowTitle(QApplication::translate("MakeBoxDialog", "Make Box", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("MakeBoxDialog", "Dimensions", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("MakeBoxDialog", "X", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("MakeBoxDialog", "Y", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("MakeBoxDialog", "Z", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("MakeBoxDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("MakeBoxDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("MakeBoxDialog", "Origin", 0, QApplication::UnicodeUTF8)); + Ori_X->setText(QApplication::translate("MakeBoxDialog", "0", 0, QApplication::UnicodeUTF8)); + Ori_Y->setText(QApplication::translate("MakeBoxDialog", "0", 0, QApplication::UnicodeUTF8)); + Ori_Z->setText(QApplication::translate("MakeBoxDialog", "0", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MakeBoxDialog", "X", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MakeBoxDialog", "Y", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("MakeBoxDialog", "Z", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(MakeBoxDialog); + } // retranslateUi + +}; + +namespace Ui { + class MakeBoxDialog: public Ui_MakeBoxDialog {}; +} // namespace Ui + +#endif // MAKEBOX1_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeCone.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeCone.h new file mode 100644 index 0000000..32e656f --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeCone.h @@ -0,0 +1,183 @@ +#ifndef MAKECONE_H +#define MAKECONE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_ConeDialog +{ +public: + QGroupBox *groupBox_2; + QLabel *label_4; + QLabel *label_5; + QLabel *label_3; + QLabel *label_6; + QLabel *label_7; + QLabel *label_8; + QLineEdit *oriX; + QLineEdit *oriY; + QLineEdit *oriZ; + QLineEdit *dirX; + QLineEdit *dirY; + QLineEdit *dirZ; + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox; + QLabel *label; + QLabel *label_2; + QLabel *label_9; + QLineEdit *height; + QLineEdit *radius; + QLineEdit *radius_2; + + void setupUi(QDialog *ConeDialog) + { + ConeDialog->setObjectName(QString::fromUtf8("ConeDialog")); + ConeDialog->resize(QSize(207, 380).expandedTo(ConeDialog->minimumSizeHint())); + + layoutWidget = new QWidget(ConeDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 340, 191, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + groupBox = new QGroupBox(ConeDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 10, 191, 121)); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 30, 57, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(10, 60, 41, 17)); + label_9 = new QLabel(groupBox); + label_9->setObjectName(QString::fromUtf8("label_9")); + label_9->setGeometry(QRect(10, 90, 41, 17)); + height = new QLineEdit(groupBox); + height->setObjectName(QString::fromUtf8("height")); + height->setGeometry(QRect(60, 30, 113, 20)); + height->setAlignment(Qt::AlignRight); + radius = new QLineEdit(groupBox); + radius->setObjectName(QString::fromUtf8("radius")); + radius->setGeometry(QRect(60, 60, 113, 20)); + radius->setAlignment(Qt::AlignRight); + radius_2 = new QLineEdit(groupBox); + radius_2->setObjectName(QString::fromUtf8("radius_2")); + radius_2->setGeometry(QRect(60, 90, 113, 20)); + radius_2->setAlignment(Qt::AlignRight); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox_2 = new QGroupBox(ConeDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(10, 140, 191, 191)); + label_4 = new QLabel(groupBox_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(10, 50, 51, 17)); + label_5 = new QLabel(groupBox_2); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(10, 70, 51, 17)); + label_3 = new QLabel(groupBox_2); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(10, 30, 51, 17)); + label_6 = new QLabel(groupBox_2); + label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setGeometry(QRect(10, 120, 66, 17)); + label_7 = new QLabel(groupBox_2); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(10, 140, 66, 17)); + label_8 = new QLabel(groupBox_2); + label_8->setObjectName(QString::fromUtf8("label_8")); + label_8->setGeometry(QRect(10, 160, 66, 17)); + oriX = new QLineEdit(groupBox_2); + oriX->setObjectName(QString::fromUtf8("oriX")); + oriX->setGeometry(QRect(82, 30, 101, 20)); + oriX->setAlignment(Qt::AlignRight); + oriY = new QLineEdit(groupBox_2); + oriY->setObjectName(QString::fromUtf8("oriY")); + oriY->setGeometry(QRect(82, 50, 101, 20)); + oriY->setAlignment(Qt::AlignRight); + oriZ = new QLineEdit(groupBox_2); + oriZ->setObjectName(QString::fromUtf8("oriZ")); + oriZ->setGeometry(QRect(82, 70, 101, 20)); + oriZ->setAlignment(Qt::AlignRight); + dirX = new QLineEdit(groupBox_2); + dirX->setObjectName(QString::fromUtf8("dirX")); + dirX->setGeometry(QRect(80, 120, 101, 20)); + dirX->setAlignment(Qt::AlignRight); + dirY = new QLineEdit(groupBox_2); + dirY->setObjectName(QString::fromUtf8("dirY")); + dirY->setGeometry(QRect(80, 140, 101, 20)); + dirY->setAlignment(Qt::AlignRight); + dirZ = new QLineEdit(groupBox_2); + dirZ->setObjectName(QString::fromUtf8("dirZ")); + dirZ->setGeometry(QRect(80, 160, 101, 20)); + dirZ->setAlignment(Qt::AlignRight); + + retranslateUi(ConeDialog); + QObject::connect(okButton, SIGNAL(clicked()), ConeDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), ConeDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(ConeDialog); + } // setupUi + + void retranslateUi(QDialog *ConeDialog) + { + ConeDialog->setWindowTitle(QApplication::translate("ConeDialog", "Make Cone", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("ConeDialog", "Position and Direction", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("ConeDialog", "Origin Y", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("ConeDialog", "Origin Z", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("ConeDialog", "Origin X", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("ConeDialog", "Direction X", 0, QApplication::UnicodeUTF8)); + label_7->setText(QApplication::translate("ConeDialog", "Direction Y", 0, QApplication::UnicodeUTF8)); + label_8->setText(QApplication::translate("ConeDialog", "Direction Z", 0, QApplication::UnicodeUTF8)); + oriX->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + oriY->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + oriZ->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + dirX->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + dirY->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + dirZ->setText(QApplication::translate("ConeDialog", "1", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("ConeDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("ConeDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("ConeDialog", "Properties", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("ConeDialog", "Height", 0, QApplication::UnicodeUTF8)); + label_2->setWhatsThis(QApplication::translate("ConeDialog", "Minor Radius of the cone", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("ConeDialog", "Rmin", 0, QApplication::UnicodeUTF8)); + label_9->setWhatsThis(QApplication::translate("ConeDialog", "Major radius of the Cone", 0, QApplication::UnicodeUTF8)); + label_9->setText(QApplication::translate("ConeDialog", "Rmaj", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(ConeDialog); + } // retranslateUi + +}; + +namespace Ui { + class ConeDialog: public Ui_ConeDialog {}; +} // namespace Ui + +#endif // MAKECONE_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeCylinder.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeCylinder.h new file mode 100644 index 0000000..d1478e6 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeCylinder.h @@ -0,0 +1,168 @@ +#ifndef MAKECYLINDER_H +#define MAKECYLINDER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_CylinderDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox; + QLabel *label; + QLabel *label_2; + QLineEdit *height; + QLineEdit *radius; + QGroupBox *groupBox_2; + QLabel *label_4; + QLabel *label_5; + QLabel *label_3; + QLabel *label_6; + QLabel *label_7; + QLabel *label_8; + QLineEdit *oriX; + QLineEdit *oriY; + QLineEdit *oriZ; + QLineEdit *dirX; + QLineEdit *dirY; + QLineEdit *dirZ; + + void setupUi(QDialog *CylinderDialog) + { + CylinderDialog->setObjectName(QString::fromUtf8("CylinderDialog")); + CylinderDialog->resize(QSize(207, 349).expandedTo(CylinderDialog->minimumSizeHint())); + layoutWidget = new QWidget(CylinderDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 310, 191, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox = new QGroupBox(CylinderDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 10, 191, 91)); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 30, 57, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(10, 60, 41, 17)); + height = new QLineEdit(groupBox); + height->setObjectName(QString::fromUtf8("height")); + height->setGeometry(QRect(60, 30, 113, 20)); + height->setAlignment(Qt::AlignRight); + radius = new QLineEdit(groupBox); + radius->setObjectName(QString::fromUtf8("radius")); + radius->setGeometry(QRect(60, 60, 113, 20)); + radius->setAlignment(Qt::AlignRight); + groupBox_2 = new QGroupBox(CylinderDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(10, 110, 191, 191)); + label_4 = new QLabel(groupBox_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(10, 50, 51, 17)); + label_5 = new QLabel(groupBox_2); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(10, 70, 51, 17)); + label_3 = new QLabel(groupBox_2); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(10, 30, 51, 17)); + label_6 = new QLabel(groupBox_2); + label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setGeometry(QRect(10, 120, 66, 17)); + label_7 = new QLabel(groupBox_2); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(10, 140, 66, 17)); + label_8 = new QLabel(groupBox_2); + label_8->setObjectName(QString::fromUtf8("label_8")); + label_8->setGeometry(QRect(10, 160, 66, 17)); + oriX = new QLineEdit(groupBox_2); + oriX->setObjectName(QString::fromUtf8("oriX")); + oriX->setGeometry(QRect(82, 30, 101, 20)); + oriX->setAlignment(Qt::AlignRight); + oriY = new QLineEdit(groupBox_2); + oriY->setObjectName(QString::fromUtf8("oriY")); + oriY->setGeometry(QRect(82, 50, 101, 20)); + oriY->setAlignment(Qt::AlignRight); + oriZ = new QLineEdit(groupBox_2); + oriZ->setObjectName(QString::fromUtf8("oriZ")); + oriZ->setGeometry(QRect(82, 70, 101, 20)); + oriZ->setAlignment(Qt::AlignRight); + dirX = new QLineEdit(groupBox_2); + dirX->setObjectName(QString::fromUtf8("dirX")); + dirX->setGeometry(QRect(80, 120, 101, 20)); + dirX->setAlignment(Qt::AlignRight); + dirY = new QLineEdit(groupBox_2); + dirY->setObjectName(QString::fromUtf8("dirY")); + dirY->setGeometry(QRect(80, 140, 101, 20)); + dirY->setAlignment(Qt::AlignRight); + dirZ = new QLineEdit(groupBox_2); + dirZ->setObjectName(QString::fromUtf8("dirZ")); + dirZ->setGeometry(QRect(80, 160, 101, 20)); + dirZ->setAlignment(Qt::AlignRight); + retranslateUi(CylinderDialog); + QObject::connect(okButton, SIGNAL(clicked()), CylinderDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), CylinderDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(CylinderDialog); + } // setupUi + + void retranslateUi(QDialog *CylinderDialog) + { + CylinderDialog->setWindowTitle(QApplication::translate("CylinderDialog", "Make Cylinder", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("CylinderDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("CylinderDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("CylinderDialog", "Properties", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("CylinderDialog", "Height", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("CylinderDialog", "Radius", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("CylinderDialog", "Position and Direction", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("CylinderDialog", "Origin Y", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("CylinderDialog", "Origin Z", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("CylinderDialog", "Origin X", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("CylinderDialog", "Direction X", 0, QApplication::UnicodeUTF8)); + label_7->setText(QApplication::translate("CylinderDialog", "Direction Y", 0, QApplication::UnicodeUTF8)); + label_8->setText(QApplication::translate("CylinderDialog", "Direction Z", 0, QApplication::UnicodeUTF8)); + oriX->setText(QApplication::translate("CylinderDialog", "0", 0, QApplication::UnicodeUTF8)); + oriY->setText(QApplication::translate("CylinderDialog", "0", 0, QApplication::UnicodeUTF8)); + oriZ->setText(QApplication::translate("CylinderDialog", "0", 0, QApplication::UnicodeUTF8)); + dirX->setText(QApplication::translate("CylinderDialog", "0", 0, QApplication::UnicodeUTF8)); + dirY->setText(QApplication::translate("CylinderDialog", "0", 0, QApplication::UnicodeUTF8)); + dirZ->setText(QApplication::translate("CylinderDialog", "1", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(CylinderDialog); + } // retranslateUi + +}; + +namespace Ui { + class CylinderDialog: public Ui_CylinderDialog {}; +} // namespace Ui + +#endif // MAKECYLINDER_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeSphere.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeSphere.h new file mode 100644 index 0000000..090224f --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_MakeSphere.h @@ -0,0 +1,126 @@ +#ifndef MAKESPHERE_H +#define MAKESPHERE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_SphereDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox_2; + QLabel *label_4; + QLineEdit *radius; + QGroupBox *groupBox; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QLineEdit *oriX; + QLineEdit *oriY; + QLineEdit *oriZ; + + void setupUi(QDialog *SphereDialog) + { + SphereDialog->setObjectName(QString::fromUtf8("SphereDialog")); + SphereDialog->resize(QSize(193, 218).expandedTo(SphereDialog->minimumSizeHint())); + layoutWidget = new QWidget(SphereDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(0, 180, 188, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox_2 = new QGroupBox(SphereDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(10, 110, 171, 61)); + label_4 = new QLabel(groupBox_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(10, 30, 21, 17)); + + groupBox = new QGroupBox(SphereDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 10, 171, 101)); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 30, 21, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(10, 50, 21, 17)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(10, 70, 21, 17)); + oriX = new QLineEdit(groupBox); + oriX->setObjectName(QString::fromUtf8("oriX")); + oriX->setGeometry(QRect(30, 30, 131, 20)); + oriX->setAlignment(Qt::AlignRight); + oriY = new QLineEdit(groupBox); + oriY->setObjectName(QString::fromUtf8("oriY")); + oriY->setGeometry(QRect(30, 50, 131, 20)); + oriY->setAlignment(Qt::AlignRight); + oriZ = new QLineEdit(groupBox); + oriZ->setObjectName(QString::fromUtf8("oriZ")); + oriZ->setGeometry(QRect(30, 70, 131, 20)); + oriZ->setAlignment(Qt::AlignRight); + radius = new QLineEdit(groupBox_2); + radius->setObjectName(QString::fromUtf8("radius")); + radius->setGeometry(QRect(30, 30, 131, 20)); + radius->setAlignment(Qt::AlignRight); + retranslateUi(SphereDialog); + QObject::connect(okButton, SIGNAL(clicked()), SphereDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), SphereDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(SphereDialog); + } // setupUi + + void retranslateUi(QDialog *SphereDialog) + { + SphereDialog->setWindowTitle(QApplication::translate("SphereDialog", "Make Sphere", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("SphereDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("SphereDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + oriX->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + oriY->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + oriZ->setText(QApplication::translate("ConeDialog", "0", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("SphereDialog", "Radius", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("SphereDialog", "R", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("SphereDialog", "Origin", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("SphereDialog", "X", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("SphereDialog", "Y", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("SphereDialog", "Z", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(SphereDialog); + } // retranslateUi + +}; + +namespace Ui { + class SphereDialog: public Ui_SphereDialog {}; +} // namespace Ui + +#endif // MAKESPHERE_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_MoveTo.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_MoveTo.h new file mode 100644 index 0000000..7490e36 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_MoveTo.h @@ -0,0 +1,145 @@ +#ifndef MOVETO_H +#define MOVETO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_moveToDialog +{ +public: + QGroupBox *groupBox_2; + QLabel *label_4; + QLabel *label_5; + QLabel *label_6; + QLineEdit *disX; + QLineEdit *disY; + QLineEdit *disZ; + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox; + QLabel *label_3; + QLabel *label_2; + QLabel *label; + QLineEdit *coX; + QLineEdit *coY; + QLineEdit *coZ; + + void setupUi(QDialog *moveToDialog) + { + moveToDialog->setObjectName(QString::fromUtf8("moveToDialog")); + moveToDialog->resize(QSize(379, 170).expandedTo(moveToDialog->minimumSizeHint())); + groupBox_2 = new QGroupBox(moveToDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(200, 10, 171, 111)); + label_4 = new QLabel(groupBox_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(20, 70, 16, 17)); + label_5 = new QLabel(groupBox_2); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(20, 50, 16, 17)); + label_6 = new QLabel(groupBox_2); + label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setGeometry(QRect(20, 30, 16, 17)); + disX = new QLineEdit(groupBox_2); + disX->setObjectName(QString::fromUtf8("disX")); + disX->setGeometry(QRect(40, 30, 113, 20)); + disX->setAlignment(Qt::AlignRight); + disY = new QLineEdit(groupBox_2); + disY->setObjectName(QString::fromUtf8("disY")); + disY->setGeometry(QRect(40, 50, 113, 20)); + disY->setAlignment(Qt::AlignRight); + disZ = new QLineEdit(groupBox_2); + disZ->setObjectName(QString::fromUtf8("disZ")); + disZ->setGeometry(QRect(40, 70, 113, 20)); + disZ->setAlignment(Qt::AlignRight); + layoutWidget = new QWidget(moveToDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 130, 361, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox = new QGroupBox(moveToDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 10, 171, 111)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(20, 70, 16, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(20, 50, 16, 17)); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(20, 30, 16, 17)); + coX = new QLineEdit(groupBox); + coX->setObjectName(QString::fromUtf8("coX")); + coX->setGeometry(QRect(40, 30, 113, 20)); + coX->setAlignment(Qt::AlignRight); + coY = new QLineEdit(groupBox); + coY->setObjectName(QString::fromUtf8("coY")); + coY->setGeometry(QRect(40, 50, 113, 20)); + coY->setAlignment(Qt::AlignRight); + coZ = new QLineEdit(groupBox); + coZ->setObjectName(QString::fromUtf8("coZ")); + coZ->setGeometry(QRect(40, 70, 113, 20)); + coZ->setAlignment(Qt::AlignRight); + retranslateUi(moveToDialog); + QObject::connect(okButton, SIGNAL(clicked()), moveToDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), moveToDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(moveToDialog); + } // setupUi + + void retranslateUi(QDialog *moveToDialog) + { + moveToDialog->setWindowTitle(QApplication::translate("moveToDialog", "Move ...", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("moveToDialog", "a distance", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("moveToDialog", "Z", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("moveToDialog", "Y", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("moveToDialog", "X", 0, QApplication::UnicodeUTF8)); + disX->setText(QApplication::translate("moveToDialog", "0", 0, QApplication::UnicodeUTF8)); + disY->setText(QApplication::translate("moveToDialog", "0", 0, QApplication::UnicodeUTF8)); + disZ->setText(QApplication::translate("moveToDialog", "0", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("moveToDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("moveToDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("moveToDialog", "to coordinates", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("moveToDialog", "Z", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("moveToDialog", "Y", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("moveToDialog", "X", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(moveToDialog); + } // retranslateUi + +}; + +namespace Ui { + class moveToDialog: public Ui_moveToDialog {}; +} // namespace Ui + +#endif // MOVETO_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_Rotate.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_Rotate.h new file mode 100644 index 0000000..9c60c53 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_Rotate.h @@ -0,0 +1,140 @@ +#ifndef ROTATE_H +#define ROTATE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_rotateDialog +{ +public: + QGroupBox *groupBox; + QLabel *label_3; + QLabel *label_2; + QLabel *label; + QLineEdit *axX; + QLineEdit *axY; + QLineEdit *axZ; + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QGroupBox *groupBox_2; + QLabel *label_4; + QLineEdit *angle; + QRadioButton *radButton; + QRadioButton *degButton; + + void setupUi(QDialog *rotateDialog) + { + rotateDialog->setObjectName(QString::fromUtf8("rotateDialog")); + rotateDialog->resize(QSize(191, 256).expandedTo(rotateDialog->minimumSizeHint())); + groupBox = new QGroupBox(rotateDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 10, 171, 111)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(20, 70, 16, 17)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(20, 50, 16, 17)); + label = new QLabel(groupBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(20, 30, 16, 17)); + axX = new QLineEdit(groupBox); + axX->setObjectName(QString::fromUtf8("axX")); + axX->setGeometry(QRect(40, 30, 113, 20)); + axX->setAlignment(Qt::AlignRight); + axY = new QLineEdit(groupBox); + axY->setObjectName(QString::fromUtf8("axY")); + axY->setGeometry(QRect(40, 50, 113, 20)); + axY->setAlignment(Qt::AlignRight); + axZ = new QLineEdit(groupBox); + axZ->setObjectName(QString::fromUtf8("axZ")); + axZ->setGeometry(QRect(40, 70, 113, 20)); + axZ->setAlignment(Qt::AlignRight); + layoutWidget = new QWidget(rotateDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(0, 220, 188, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + groupBox_2 = new QGroupBox(rotateDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(10, 120, 171, 91)); + label_4 = new QLabel(groupBox_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(20, 30, 16, 17)); + angle = new QLineEdit(groupBox_2); + angle->setObjectName(QString::fromUtf8("angle")); + angle->setGeometry(QRect(40, 30, 113, 20)); + angle->setAlignment(Qt::AlignRight); + radButton = new QRadioButton(groupBox_2); + radButton->setObjectName(QString::fromUtf8("radButton")); + radButton->setGeometry(QRect(10, 60, 51, 23)); + radButton->setLayoutDirection(Qt::RightToLeft); + degButton = new QRadioButton(groupBox_2); + degButton->setObjectName(QString::fromUtf8("degButton")); + degButton->setGeometry(QRect(100, 60, 51, 23)); + degButton->setLayoutDirection(Qt::RightToLeft); + degButton->setChecked(true); + retranslateUi(rotateDialog); + QObject::connect(okButton, SIGNAL(clicked()), rotateDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), rotateDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(rotateDialog); + } // setupUi + + void retranslateUi(QDialog *rotateDialog) + { + rotateDialog->setWindowTitle(QApplication::translate("rotateDialog", "Rotate", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("rotateDialog", "Axis", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("rotateDialog", "Z", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("rotateDialog", "Y", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("rotateDialog", "X", 0, QApplication::UnicodeUTF8)); + axX->setText(QApplication::translate("rotateDialog", "0", 0, QApplication::UnicodeUTF8)); + axY->setText(QApplication::translate("rotateDialog", "0", 0, QApplication::UnicodeUTF8)); + axZ->setText(QApplication::translate("rotateDialog", "1", 0, QApplication::UnicodeUTF8)); + angle->setText(QApplication::translate("rotateDialog", "0", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("rotateDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("rotateDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("rotateDialog", "Angle", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("rotateDialog", "a", 0, QApplication::UnicodeUTF8)); + radButton->setText(QApplication::translate("rotateDialog", "rad", 0, QApplication::UnicodeUTF8)); + degButton->setText(QApplication::translate("rotateDialog", "deg", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(rotateDialog); + } // retranslateUi + +}; + +namespace Ui { + class rotateDialog: public Ui_rotateDialog {}; +} // namespace Ui + +#endif // ROTATE_H diff --git a/src/MCCAD/McCadHeaders/ui_McCadDesign_Scale.h b/src/MCCAD/McCadHeaders/ui_McCadDesign_Scale.h new file mode 100644 index 0000000..0cdc893 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCadDesign_Scale.h @@ -0,0 +1,121 @@ +#ifndef SCALE_H +#define SCALE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_scaleDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QLabel *label; + QGroupBox *groupBox; + QLabel *label_2; + QLabel *label_3; + QLabel *label_4; + QLineEdit *sf_Y; + QLineEdit *sf_Z; + QLineEdit *sf_X; + QLineEdit *sf_All; + + void setupUi(QDialog *scaleDialog) + { + scaleDialog->setObjectName(QString::fromUtf8("scaleDialog")); + scaleDialog->resize(QSize(197, 200).expandedTo(scaleDialog->minimumSizeHint())); + layoutWidget = new QWidget(scaleDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(0, 160, 188, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + label = new QLabel(scaleDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(20, 20, 101, 17)); + groupBox = new QGroupBox(scaleDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(20, 50, 161, 101)); + label_2 = new QLabel(groupBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(40, 30, 21, 17)); + label_3 = new QLabel(groupBox); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(40, 50, 21, 17)); + label_4 = new QLabel(groupBox); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(40, 70, 21, 17)); + sf_All = new QLineEdit(scaleDialog); + sf_All->setObjectName(QString::fromUtf8("sf_All")); + sf_All->setGeometry(QRect(120, 20, 51, 20)); + sf_All->setAlignment(Qt::AlignRight); + sf_X = new QLineEdit(groupBox); + sf_X->setObjectName(QString::fromUtf8("sf_X")); + sf_X->setGeometry(QRect(70, 30, 51, 20)); + sf_X->setAlignment(Qt::AlignRight); + sf_Y = new QLineEdit(groupBox); + sf_Y->setObjectName(QString::fromUtf8("sf_Y")); + sf_Y->setGeometry(QRect(70, 50, 51, 20)); + sf_Y->setAlignment(Qt::AlignRight); + sf_Z = new QLineEdit(groupBox); + sf_Z->setObjectName(QString::fromUtf8("sf_Z")); + sf_Z->setGeometry(QRect(70, 70, 51, 20)); + sf_Z->setAlignment(Qt::AlignRight); + retranslateUi(scaleDialog); + QObject::connect(okButton, SIGNAL(clicked()), scaleDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), scaleDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(scaleDialog); + } // setupUi + + void retranslateUi(QDialog *scaleDialog) + { + scaleDialog->setWindowTitle(QApplication::translate("scaleDialog", "Scaling", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("scaleDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("scaleDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + sf_All->setText(QApplication::translate("scaleDialog", "1.0", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("scaleDialog", "Scale Factor", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("scaleDialog", "Axis Dependent Scaling", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("scaleDialog", "X", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("scaleDialog", "Y", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("scaleDialog", "Z", 0, QApplication::UnicodeUTF8)); + sf_X->setText(QApplication::translate("scaleDialog", "", 0, QApplication::UnicodeUTF8)); + sf_Y->setText(QApplication::translate("scaleDialog", "", 0, QApplication::UnicodeUTF8)); + sf_Z->setText(QApplication::translate("scaleDialog", "", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(scaleDialog); + } // retranslateUi + +}; + +namespace Ui { + class scaleDialog: public Ui_scaleDialog {}; +} // namespace Ui + +#endif // SCALE_H diff --git a/src/MCCAD/McCadHeaders/ui_McCad_LoadVisualizationList.h b/src/MCCAD/McCadHeaders/ui_McCad_LoadVisualizationList.h new file mode 100644 index 0000000..8008a71 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_McCad_LoadVisualizationList.h @@ -0,0 +1,110 @@ +/******************************************************************************** +** Form generated from reading UI file 'McCad_LoadVisualizationList.ui' +** +** Created: Wed Jun 29 09:36:40 2011 +** by: Qt User Interface Compiler version 4.7.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_MCCAD_LOADVISUALIZATIONLIST_H +#define UI_MCCAD_LOADVISUALIZATIONLIST_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_McCad_LoadVisualizationList +{ +public: + QDialogButtonBox *buttonBox; + QPushButton *loadButton; + QGroupBox *valuesBox; + QLabel *label; + QLabel *label_2; + QLineEdit *minimumEdit; + QLineEdit *maximumEdit; + QLineEdit *nbColorsEdit; + QLabel *label_3; + + void setupUi(QDialog *McCad_LoadVisualizationList) + { + if (McCad_LoadVisualizationList->objectName().isEmpty()) + McCad_LoadVisualizationList->setObjectName(QString::fromUtf8("McCad_LoadVisualizationList")); + McCad_LoadVisualizationList->resize(451, 106); + buttonBox = new QDialogButtonBox(McCad_LoadVisualizationList); + buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setGeometry(QRect(100, 70, 341, 32)); + buttonBox->setOrientation(Qt::Horizontal); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + loadButton = new QPushButton(McCad_LoadVisualizationList); + loadButton->setObjectName(QString::fromUtf8("loadButton")); + loadButton->setEnabled(true); + loadButton->setGeometry(QRect(10, 20, 75, 24)); + loadButton->setDefault(false); + loadButton->setFlat(false); + valuesBox = new QGroupBox(McCad_LoadVisualizationList); + valuesBox->setObjectName(QString::fromUtf8("valuesBox")); + valuesBox->setGeometry(QRect(100, 10, 341, 51)); + label = new QLabel(valuesBox); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 20, 56, 14)); + label_2 = new QLabel(valuesBox); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(180, 20, 56, 14)); + minimumEdit = new QLineEdit(valuesBox); + minimumEdit->setObjectName(QString::fromUtf8("minimumEdit")); + minimumEdit->setGeometry(QRect(70, 20, 91, 20)); + minimumEdit->setReadOnly(false); + maximumEdit = new QLineEdit(valuesBox); + maximumEdit->setObjectName(QString::fromUtf8("maximumEdit")); + maximumEdit->setGeometry(QRect(240, 20, 91, 20)); + maximumEdit->setText(QString::fromUtf8("")); + maximumEdit->setReadOnly(false); + nbColorsEdit = new QLineEdit(McCad_LoadVisualizationList); + nbColorsEdit->setObjectName(QString::fromUtf8("nbColorsEdit")); + nbColorsEdit->setGeometry(QRect(222, 70, 41, 20)); + label_3 = new QLabel(McCad_LoadVisualizationList); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(110, 70, 111, 20)); + + retranslateUi(McCad_LoadVisualizationList); + QObject::connect(buttonBox, SIGNAL(accepted()), McCad_LoadVisualizationList, SLOT(accept())); + QObject::connect(buttonBox, SIGNAL(rejected()), McCad_LoadVisualizationList, SLOT(reject())); + + QMetaObject::connectSlotsByName(McCad_LoadVisualizationList); + } // setupUi + + void retranslateUi(QDialog *McCad_LoadVisualizationList) + { + McCad_LoadVisualizationList->setWindowTitle(QApplication::translate("McCad_LoadVisualizationList", "Dialog", 0, QApplication::UnicodeUTF8)); + loadButton->setText(QApplication::translate("McCad_LoadVisualizationList", "Load List", 0, QApplication::UnicodeUTF8)); + valuesBox->setTitle(QApplication::translate("McCad_LoadVisualizationList", "Value Range", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("McCad_LoadVisualizationList", "Minimum", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("McCad_LoadVisualizationList", "Maximum", 0, QApplication::UnicodeUTF8)); + minimumEdit->setText(QString()); + //minimumEdit->setPlaceholderText(QApplication::translate("McCad_LoadVisualizationList", "0", 0, QApplication::UnicodeUTF8)); + // maximumEdit->setPlaceholderText(QApplication::translate("McCad_LoadVisualizationList", "0", 0, QApplication::UnicodeUTF8)); + //nbColorsEdit->setPlaceholderText(QApplication::translate("McCad_LoadVisualizationList", "12", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("McCad_LoadVisualizationList", "Number Of Colors", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class McCad_LoadVisualizationList: public Ui_McCad_LoadVisualizationList {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MCCAD_LOADVISUALIZATIONLIST_H diff --git a/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_AddToMGDialog.h b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_AddToMGDialog.h new file mode 100644 index 0000000..fbca50c --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_AddToMGDialog.h @@ -0,0 +1,53 @@ +#ifndef QMCCADGEOMETREE_ADDTOMGDIALOG_H +#define QMCCADGEOMETREE_ADDTOMGDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_addToMGDialog +{ +public: + QPushButton *addButton; + QListWidget *listWidget; + QLabel *label; + + void setupUi(QDialog *addToMGDialog) + { + addToMGDialog->setObjectName(QString::fromUtf8("addToMGDialog")); + addToMGDialog->resize(QSize(279, 287).expandedTo(addToMGDialog->minimumSizeHint())); + addToMGDialog->setContextMenuPolicy(Qt::NoContextMenu); + addButton = new QPushButton(addToMGDialog); + addButton->setObjectName(QString::fromUtf8("addButton")); + addButton->setGeometry(QRect(100, 250, 87, 29)); + listWidget = new QListWidget(addToMGDialog); + listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setGeometry(QRect(10, 30, 261, 211)); + label = new QLabel(addToMGDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 10, 101, 17)); + retranslateUi(addToMGDialog); + QObject::connect(addButton, SIGNAL(clicked()), addToMGDialog, SLOT(accept())); + QMetaObject::connectSlotsByName(addToMGDialog); + } // setupUi + + void retranslateUi(QDialog *addToMGDialog) + { + addToMGDialog->setWindowTitle(QApplication::translate("addToMGDialog", "Add To Material Group", 0, QApplication::UnicodeUTF8)); + addButton->setText(QApplication::translate("addToMGDialog", "Add", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("addToMGDialog", "Material Groups", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(addToMGDialog); + } // retranslateUi + +}; + +namespace Ui { + class addToMGDialog: public Ui_addToMGDialog {}; +} // namespace Ui + +#endif // QMCCADGEOMETREE_ADDTOMGDIALOG_H diff --git a/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_MCardDialog.h b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_MCardDialog.h new file mode 100644 index 0000000..9cfbea1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_MCardDialog.h @@ -0,0 +1,164 @@ +#ifndef QMCCADGEOMETREE_MCARDDIALOG1_H +#define QMCCADGEOMETREE_MCARDDIALOG1_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_MCardDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + //QPushButton *saveXMLButton; + //QPushButton *loadXMLButton; + + QPushButton *btnAddMat; + QPushButton *btnDelMat; + QPushButton *btnMdfMat; + QLabel *label_1; + QLabel *label_2; + QLabel *label_3; + QLabel *label_4; + QLineEdit *IDEdit; + QLineEdit *densityEdit; + QLineEdit *nameEdit; + QTextEdit *mCardText; + QTreeWidget *mMatTree; + + void setupUi(QDialog *MCardDialog) + { + MCardDialog->setObjectName(QString::fromUtf8("MCardDialog")); + MCardDialog->resize(QSize(800, 600).expandedTo(MCardDialog->minimumSizeHint())); + layoutWidget = new QWidget(MCardDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 550, 770, 50)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(200, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + btnAddMat = new QPushButton(layoutWidget); + btnAddMat->setObjectName(QString::fromUtf8("AddButton")); + hboxLayout->addWidget(btnAddMat); + //btnMdfMat = new QPushButton(layoutWidget); + //btnMdfMat->setObjectName(QString::fromUtf8("ModifyButton")); + //hboxLayout->addWidget(btnMdfMat); + btnDelMat = new QPushButton(layoutWidget); + btnDelMat->setObjectName(QString::fromUtf8("DelButton")); + hboxLayout->addWidget(btnDelMat); + + hboxLayout->addItem(spacerItem); + //saveXMLButton = new QPushButton(layoutWidget); + //saveXMLButton->setObjectName(QString::fromUtf8("saveXMLButton")); + //hboxLayout->addWidget(saveXMLButton); + //loadXMLButton = new QPushButton(layoutWidget); + //loadXMLButton->setObjectName(QString::fromUtf8("loadXMLButton")); + //hboxLayout->addWidget(loadXMLButton); + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + hboxLayout->addWidget(okButton); + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + hboxLayout->addWidget(cancelButton); + + label_1 = new QLabel(MCardDialog); + label_1->setObjectName(QString::fromUtf8("label_1")); + label_1->setGeometry(QRect(10, 10, 780, 25)); + + label_2 = new QLabel(MCardDialog); + label_2->setObjectName(QString::fromUtf8("label_3")); + label_2->setGeometry(QRect(200, 40, 20, 25)); + label_3 = new QLabel(MCardDialog); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(310, 40, 50, 25)); + label_4 = new QLabel(MCardDialog); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(470, 40, 50, 25)); + + QIntValidator *vInt = new QIntValidator(1,1000,MCardDialog); + IDEdit = new QLineEdit(MCardDialog); + IDEdit->setObjectName(QString::fromUtf8("IDEdit")); + IDEdit->setGeometry(QRect(230, 40, 60, 25)); + IDEdit->setLayoutDirection(Qt::LeftToRight); + IDEdit->setValidator(vInt); + + QDoubleValidator *vDbl = new QDoubleValidator(-10000.0,10000.0,4,MCardDialog); + densityEdit = new QLineEdit(MCardDialog); + densityEdit->setObjectName(QString::fromUtf8("densityEdit")); + densityEdit->setGeometry(QRect(370, 40, 80, 25)); + densityEdit->setLayoutDirection(Qt::LeftToRight); + densityEdit->setValidator(vDbl); + + nameEdit = new QLineEdit(MCardDialog); + nameEdit->setObjectName(QString::fromUtf8("nameEdit")); + nameEdit->setGeometry(QRect(530, 40, 200, 25)); + nameEdit->setLayoutDirection(Qt::LeftToRight); + + mCardText = new QTextEdit(MCardDialog); + mCardText->setObjectName(QString::fromUtf8("mCardText")); + mCardText->setGeometry(QRect(200, 75, 580, 475)); + + mMatTree = new QTreeWidget(MCardDialog); + mMatTree->setGeometry(QRect(10, 40, 180, 510)); + mMatTree->setObjectName(QString::fromUtf8("mMatTree")); + mMatTree->setHeaderLabel(QString("Material")); + + /* QTreeWidgetItem *pItem1 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 1"))); + QTreeWidgetItem *pItem2 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 2"))); + QTreeWidgetItem *pItem3 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 3"))); + QTreeWidgetItem *pItem4 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 4"))); + QTreeWidgetItem *pItem5 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 5"))); + QTreeWidgetItem *pItem6 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 6"))); + QTreeWidgetItem *pItem7 = new QTreeWidgetItem(mMatTree,QStringList(QString("Mat 7")));*/ + + retranslateUi(MCardDialog); + QObject::connect(okButton, SIGNAL(clicked()), MCardDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), MCardDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(MCardDialog); + } // setupUi + + void retranslateUi(QDialog *MCardDialog) + { + MCardDialog->setWindowTitle(QApplication::translate("MCardDialog", "Material Group", 0, QApplication::UnicodeUTF8)); + + //saveXMLButton->setText(QApplication::translate("MCardDialog", "Save Material", 0, QApplication::UnicodeUTF8)); + //loadXMLButton->setText(QApplication::translate("MCardDialog", "Load Material", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("MCardDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("MCardDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + + btnAddMat->setText(QApplication::translate("MCardDialog", "Add / Modify", 0, QApplication::UnicodeUTF8)); + //btnMdfMat->setText(QApplication::translate("MCardDialog", "Modify", 0, QApplication::UnicodeUTF8)); + btnDelMat->setText(QApplication::translate("MCardDialog", "Delete", 0, QApplication::UnicodeUTF8)); + + label_1->setText(QApplication::translate("MCardDialog", "Material Card", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MCardDialog", "ID:", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("MCardDialog", "Density:", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("MCardDialog", "Name:", 0, QApplication::UnicodeUTF8)); + //nameEdit->setText(QApplication::translate("MCardDialog", "", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(MCardDialog); + } // retranslateUi + +}; + +namespace Ui { + class MCardDialog: public Ui_MCardDialog {}; + +} // namespace Ui + +#endif // QMCCADGEOMETREE_MCARDDIALOG1_H diff --git a/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_TreeView.h b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_TreeView.h new file mode 100644 index 0000000..4483e9e --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_TreeView.h @@ -0,0 +1,61 @@ +#ifndef QMCCADGEOMETREE_TREEVIEW_H +#define QMCCADGEOMETREE_TREEVIEW_H + +#include +#include +#include +#include +#include +#include +#include + +class Ui_McTreeView +{ +public: + QTreeView *myTreeView; + QGridLayout *gridLayout; + void setupUi(QWidget *McTreeView) + { + McTreeView->setObjectName(QString::fromUtf8("McTreeView")); + McTreeView->resize(QSize(1024, 350).expandedTo(McTreeView->minimumSizeHint())); + McTreeView->setWindowIcon(QIcon()); + + gridLayout = new QGridLayout(McTreeView); + gridLayout->setSpacing(6); + gridLayout->setMargin(0); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + + myTreeView = new QTreeView(McTreeView); + myTreeView->setObjectName(QString::fromUtf8("myTreeView")); + //myTreeView->setGeometry(QRect(0, 0, 300, 800)); + myTreeView->setMinimumSize(150,350); + myTreeView->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); + myTreeView->setAcceptDrops(true); + myTreeView->setFrameShape(QFrame::StyledPanel); + myTreeView->setFrameShadow(QFrame::Sunken); + myTreeView->setLineWidth(1); + myTreeView->setProperty("showDropIndicator", QVariant(true)); + myTreeView->setDragEnabled(true); + myTreeView->setSelectionMode(QAbstractItemView::MultiSelection); + myTreeView->setSelectionBehavior(QAbstractItemView::SelectItems); + + gridLayout->addWidget(myTreeView, 0, 0, 1, 1); + + retranslateUi(McTreeView); + + QMetaObject::connectSlotsByName(McTreeView); + } // setupUi + + void retranslateUi(QWidget *McTreeView) + { + McTreeView->setWindowTitle(QApplication::translate("McTreeView", "GeomeTree", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(McTreeView); + } // retranslateUi + +}; + +namespace Ui { + class McTreeView: public Ui_McTreeView {}; +} // namespace Ui + +#endif // QMCCADGEOMETREE_TREEVIEW_H diff --git a/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_TreeWidget.h b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_TreeWidget.h new file mode 100644 index 0000000..517c829 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_QMcCadGeomeTree_TreeWidget.h @@ -0,0 +1,65 @@ +#ifndef QMCCADGEOMETREE_TREEWIDGET_GRID_H +#define QMCCADGEOMETREE_TREEWIDGET_GRID_H + +#include +#include +#include +#include +#include +#include +#include + +class Ui_McTreeView +{ +public: + QGridLayout *gridLayout; + QTreeWidget *myTreeWidget; +// QTreeWidget *matTW; + + void setupUi(QWidget *McTreeView) + { + McTreeView->setObjectName(QString::fromUtf8("McTreeView")); + McTreeView->resize(QSize(236, 762).expandedTo(McTreeView->minimumSizeHint())); + McTreeView->setWindowIcon(QIcon()); + gridLayout = new QGridLayout(McTreeView); + gridLayout->setSpacing(6); + gridLayout->setMargin(0); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + myTreeWidget = new QTreeWidget(McTreeView); + myTreeWidget->setObjectName(QString::fromUtf8("myTreeWidget")); + myTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); + myTreeWidget->setSelectionBehavior(QAbstractItemView::SelectItems); + myTreeWidget->setColumnCount(1); + myTreeWidget->headerItem()->setText(0, QApplication::translate("Dialog", "Assemblies", 0, QApplication::UnicodeUTF8)); +/* matTW = new QTreeWidget(McTreeView); + matTW->setObjectName(QString::fromUtf8("myTreeWidget")); + matTW->setSelectionMode(QAbstractItemView::ExtendedSelection); + matTW->setSelectionBehavior(QAbstractItemView::SelectItems); + matTW->setColumnCount(1); + matTW->headerItem()->setText(0, QApplication::translate("Dialog", "Materials", 0, QApplication::UnicodeUTF8)); +*/ + + gridLayout->addWidget(myTreeWidget, 0, 0, 1, 1); +// gridLayout->addWidget(matTW, 1,0,1,1); +// gridLayout->setRowStretch(0,2); +// gridLayout->setRowStretch(1,1); + //gridLayout->setRowStretch(1,0); + + retranslateUi(McTreeView); + + QMetaObject::connectSlotsByName(McTreeView); + } // setupUi + + void retranslateUi(QWidget *McTreeView) + { + McTreeView->setWindowTitle(QApplication::translate("McTreeView", "GeomeTree", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(McTreeView); + } // retranslateUi + +}; + +namespace Ui { + class McTreeView: public Ui_McTreeView {}; +} // namespace Ui + +#endif // QMCCADGEOMETREE_TREEWIDGET_GRID_H diff --git a/src/MCCAD/McCadHeaders/ui_QMcCad_ClippingPlane.h b/src/MCCAD/McCadHeaders/ui_QMcCad_ClippingPlane.h new file mode 100644 index 0000000..7222b4a --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_QMcCad_ClippingPlane.h @@ -0,0 +1,198 @@ +#ifndef CLIPPINGPLANE_H +#define CLIPPINGPLANE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_ui_ClippingPlaneDialog +{ +public: + QLabel *label; + QGroupBox *groupBox_2; + QLabel *label_2; + QLabel *label_3; + QLineEdit *locX; + QLineEdit *locY; + QLineEdit *locZ; + QLineEdit *dirY; + QLineEdit *dirZ; + QLineEdit *dirX; + QGroupBox *groupBox; + QLabel *label_4; + QLabel *label_6; + QLabel *label_5; + QLabel *label_7; + QLineEdit *A; + QLineEdit *C; + QLineEdit *B; + QLineEdit *D; + QGroupBox *groupBox_3; + QSlider *plnSlider; + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QPushButton *okButton; + QPushButton *cancelButton; + QCheckBox *checkBox; + + void setupUi(QDialog *ui_ClippingPlaneDialog) + { + ui_ClippingPlaneDialog->setObjectName(QString::fromUtf8("ui_ClippingPlaneDialog")); + ui_ClippingPlaneDialog->resize(QSize(229, 410).expandedTo(ui_ClippingPlaneDialog->minimumSizeHint())); + label = new QLabel(ui_ClippingPlaneDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 10, 171, 17)); + groupBox_2 = new QGroupBox(ui_ClippingPlaneDialog); + groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setGeometry(QRect(10, 40, 211, 131)); + label_2 = new QLabel(groupBox_2); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(10, 20, 57, 17)); + label_3 = new QLabel(groupBox_2); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(130, 20, 57, 17)); + locX = new QLineEdit(groupBox_2); + locX->setObjectName(QString::fromUtf8("locX")); + locX->setGeometry(QRect(10, 40, 71, 25)); + locX->setAlignment(Qt::AlignRight); + locY = new QLineEdit(groupBox_2); + locY->setObjectName(QString::fromUtf8("locY")); + locY->setGeometry(QRect(10, 70, 71, 25)); + locY->setAlignment(Qt::AlignRight); + locZ = new QLineEdit(groupBox_2); + locZ->setObjectName(QString::fromUtf8("locZ")); + locZ->setGeometry(QRect(10, 100, 71, 25)); + locZ->setAlignment(Qt::AlignRight); + dirX = new QLineEdit(groupBox_2); + dirX->setObjectName(QString::fromUtf8("dirX")); + dirX->setGeometry(QRect(120, 40, 71, 25)); + dirX->setAlignment(Qt::AlignRight); + dirY = new QLineEdit(groupBox_2); + dirY->setObjectName(QString::fromUtf8("dirY")); + dirY->setGeometry(QRect(120, 70, 71, 25)); + dirY->setAlignment(Qt::AlignRight); + dirZ = new QLineEdit(groupBox_2); + dirZ->setObjectName(QString::fromUtf8("dirZ")); + dirZ->setGeometry(QRect(120, 100, 71, 25)); + dirZ->setAlignment(Qt::AlignRight); + groupBox = new QGroupBox(ui_ClippingPlaneDialog); + groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setGeometry(QRect(10, 180, 211, 80)); + label_4 = new QLabel(groupBox); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(10, 20, 21, 17)); + label_6 = new QLabel(groupBox); + label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setGeometry(QRect(130, 20, 21, 17)); + label_5 = new QLabel(groupBox); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(10, 50, 21, 17)); + label_7 = new QLabel(groupBox); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(130, 50, 21, 17)); + A = new QLineEdit(groupBox); + A->setObjectName(QString::fromUtf8("A")); + A->setGeometry(QRect(40, 20, 51, 25)); + A->setAlignment(Qt::AlignRight); + C = new QLineEdit(groupBox); + C->setObjectName(QString::fromUtf8("C")); + C->setGeometry(QRect(40, 50, 51, 25)); + C->setAlignment(Qt::AlignRight); + B = new QLineEdit(groupBox); + B->setObjectName(QString::fromUtf8("B")); + B->setGeometry(QRect(150, 20, 51, 25)); + B->setAlignment(Qt::AlignRight); + D = new QLineEdit(groupBox); + D->setObjectName(QString::fromUtf8("D")); + D->setGeometry(QRect(150, 50, 51, 25)); + D->setAlignment(Qt::AlignRight); + groupBox_3 = new QGroupBox(ui_ClippingPlaneDialog); + groupBox_3->setObjectName(QString::fromUtf8("groupBox_3")); + groupBox_3->setGeometry(QRect(10, 270, 211, 51)); + plnSlider = new QSlider(groupBox_3); + plnSlider->setObjectName(QString::fromUtf8("plnSlider")); + plnSlider->setGeometry(QRect(20, 20, 171, 20)); + plnSlider->setMinimum(-100000); + plnSlider->setMaximum(100000); + plnSlider->setOrientation(Qt::Horizontal); + layoutWidget = new QWidget(ui_ClippingPlaneDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 370, 211, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + okButton = new QPushButton(layoutWidget); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout->addWidget(okButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + checkBox = new QCheckBox(ui_ClippingPlaneDialog); + checkBox->setObjectName(QString::fromUtf8("checkBox")); + checkBox->setGeometry(QRect(0, 340, 161, 22)); + checkBox->setLayoutDirection(Qt::RightToLeft); + checkBox->setChecked(false); + retranslateUi(ui_ClippingPlaneDialog); + QObject::connect(okButton, SIGNAL(clicked()), ui_ClippingPlaneDialog, SLOT(accept())); + QObject::connect(cancelButton, SIGNAL(clicked()), ui_ClippingPlaneDialog, SLOT(reject())); + + QMetaObject::connectSlotsByName(ui_ClippingPlaneDialog); + } // setupUi + + void retranslateUi(QDialog *ui_ClippingPlaneDialog) + { + ui_ClippingPlaneDialog->setWindowTitle(QApplication::translate("ui_ClippingPlaneDialog", "Clipping Plane Dialog", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("ui_ClippingPlaneDialog", "Define clipping plane by ...", 0, QApplication::UnicodeUTF8)); + groupBox_2->setTitle(QApplication::translate("ui_ClippingPlaneDialog", "... location and plane normal", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("ui_ClippingPlaneDialog", "Location", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("ui_ClippingPlaneDialog", "Normal", 0, QApplication::UnicodeUTF8)); + locX->setText(QApplication::translate("ui_ClippingPlaneDialog", "X", 0, QApplication::UnicodeUTF8)); + locY->setText(QApplication::translate("ui_ClippingPlaneDialog", "Y", 0, QApplication::UnicodeUTF8)); + locZ->setText(QApplication::translate("ui_ClippingPlaneDialog", "Z", 0, QApplication::UnicodeUTF8)); + dirX->setText(QApplication::translate("ui_ClippingPlaneDialog", "X", 0, QApplication::UnicodeUTF8)); + dirY->setText(QApplication::translate("ui_ClippingPlaneDialog", "Y", 0, QApplication::UnicodeUTF8)); + dirZ->setText(QApplication::translate("ui_ClippingPlaneDialog", "Z", 0, QApplication::UnicodeUTF8)); + groupBox->setTitle(QApplication::translate("ui_ClippingPlaneDialog", "... plane coefficients", "A*x + B*y + C*z - D = 0", QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("ui_ClippingPlaneDialog", "A", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("ui_ClippingPlaneDialog", "B", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("ui_ClippingPlaneDialog", "C", 0, QApplication::UnicodeUTF8)); + label_7->setText(QApplication::translate("ui_ClippingPlaneDialog", "D", 0, QApplication::UnicodeUTF8)); + A->setText(QApplication::translate("ui_ClippingPlaneDialog", "", 0, QApplication::UnicodeUTF8)); + C->setText(QApplication::translate("ui_ClippingPlaneDialog", "", 0, QApplication::UnicodeUTF8)); + B->setText(QApplication::translate("ui_ClippingPlaneDialog", "", 0, QApplication::UnicodeUTF8)); + D->setText(QApplication::translate("ui_ClippingPlaneDialog", "", 0, QApplication::UnicodeUTF8)); + groupBox_3->setTitle(QApplication::translate("ui_ClippingPlaneDialog", "Slide plane along axis", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("ui_ClippingPlaneDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("ui_ClippingPlaneDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + checkBox->setText(QApplication::translate("ui_ClippingPlaneDialog", "Activate clipping plane", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(ui_ClippingPlaneDialog); + } // retranslateUi + +}; + +namespace Ui { + class ui_ClippingPlaneDialog: public Ui_ui_ClippingPlaneDialog {}; +} // namespace Ui + +#endif // CLIPPINGPLANE_H diff --git a/src/MCCAD/McCadHeaders/ui_QMcCad_TransparencyDialog.h b/src/MCCAD/McCadHeaders/ui_QMcCad_TransparencyDialog.h new file mode 100644 index 0000000..950d329 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_QMcCad_TransparencyDialog.h @@ -0,0 +1,93 @@ +#ifndef QMCCAD_TRANSPARENCYDIALOG_H +#define QMCCAD_TRANSPARENCYDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_TransDialog +{ +public: + QGridLayout *gridLayout; + QHBoxLayout *hboxLayout; + QSlider *horizontalSlider; + QLCDNumber *lcdNumber; + QHBoxLayout *hboxLayout1; + QSpacerItem *spacerItem; + QPushButton *okButton; + + void setupUi(QDialog *TransDialog) + { + TransDialog->setObjectName(QString::fromUtf8("TransDialog")); + TransDialog->resize(QSize(301, 94).expandedTo(TransDialog->minimumSizeHint())); + gridLayout = new QGridLayout(TransDialog); + gridLayout->setSpacing(6); + gridLayout->setMargin(9); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + hboxLayout = new QHBoxLayout(); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + horizontalSlider = new QSlider(TransDialog); + horizontalSlider->setObjectName(QString::fromUtf8("horizontalSlider")); + horizontalSlider->setMaximum(100); + horizontalSlider->setSingleStep(5); + horizontalSlider->setOrientation(Qt::Horizontal); + + hboxLayout->addWidget(horizontalSlider); + + lcdNumber = new QLCDNumber(TransDialog); + lcdNumber->setObjectName(QString::fromUtf8("lcdNumber")); + lcdNumber->setSegmentStyle(QLCDNumber::Flat); + + hboxLayout->addWidget(lcdNumber); + + + gridLayout->addLayout(hboxLayout, 0, 0, 1, 1); + + hboxLayout1 = new QHBoxLayout(); + hboxLayout1->setSpacing(6); + hboxLayout1->setMargin(0); + hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout1->addItem(spacerItem); + + okButton = new QPushButton(TransDialog); + okButton->setObjectName(QString::fromUtf8("okButton")); + + hboxLayout1->addWidget(okButton); + + + gridLayout->addLayout(hboxLayout1, 1, 0, 1, 1); + + retranslateUi(TransDialog); + QObject::connect(okButton, SIGNAL(clicked()), TransDialog, SLOT(accept())); + QObject::connect(horizontalSlider, SIGNAL(valueChanged(int)), lcdNumber, SLOT(display(int))); + QObject::connect(horizontalSlider, SIGNAL(sliderReleased()), TransDialog, SLOT(accept())); + + QMetaObject::connectSlotsByName(TransDialog); + } // setupUi + + void retranslateUi(QDialog *TransDialog) + { + TransDialog->setWindowTitle(QApplication::translate("TransDialog", "Set Transparency", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("TransDialog", "OK", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(TransDialog); + } // retranslateUi + +}; + +namespace Ui { + class TransDialog: public Ui_TransDialog {}; +} // namespace Ui + +#endif // QMCCAD_TRANSPARENCYDIALOG_H diff --git a/src/MCCAD/McCadHeaders/ui_VGParamDialog.h b/src/MCCAD/McCadHeaders/ui_VGParamDialog.h new file mode 100644 index 0000000..76e9ed1 --- /dev/null +++ b/src/MCCAD/McCadHeaders/ui_VGParamDialog.h @@ -0,0 +1,289 @@ +#ifndef QMCCAD_VGPARAMDIALOG_H +#define QMCCAD_VGPARAMDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Ui_VGParamDialog +{ +public: + QWidget *layoutWidget; + QHBoxLayout *hboxLayout; + QPushButton *acceptButton; + QSpacerItem *spacerItem; + QPushButton *cancelButton; + QPushButton *pushButton; + QFrame *line_2; + QFrame *frame; + QLabel *label; + QLabel *label_2; + QFrame *line; + QLabel *label_3; + QCheckBox *checkCollision; + QCheckBox *checkDiscrete; + QCheckBox *checkCM; + QCheckBox *checkMM; + QFrame *frame_2; + QLabel *label_4; + QLabel *label_5; + QLabel *label_6; + QLabel *label_7; + QLabel *label_8; + QLabel *label_9; + QLabel *label_10; + QLabel *label_11; + QLabel *label_12; + QLabel *label_13; + QLabel *label_14; + QLineEdit *minInputVolume; + QLineEdit *minVoidVolume; + QLineEdit *minDecFaceArea; + QLineEdit *minReDecFaceArea; + QLineEdit *maxPredecCells; + QLineEdit *maxComplementCells; + QLineEdit *minSamplePoints; + QLineEdit *maxSamplePoints; + QLineEdit *xRes; + QLineEdit *yRes; + QLineEdit *tolSet; + QFrame *frame_3; + QLabel *label_15; + QLabel *label_16; + QLineEdit *initSurfNb; + QLineEdit *initCellNb; + + void setupUi(QDialog *VGParamDialog) + { + VGParamDialog->setObjectName(QString::fromUtf8("VGParamDialog")); + VGParamDialog->resize(QSize(398, 420).expandedTo(VGParamDialog->minimumSizeHint())); + layoutWidget = new QWidget(VGParamDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(10, 380, 382, 33)); + hboxLayout = new QHBoxLayout(layoutWidget); + hboxLayout->setSpacing(6); + hboxLayout->setMargin(0); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + pushButton = new QPushButton(layoutWidget); + pushButton->setObjectName(QString::fromUtf8("pushButton")); + + hboxLayout->addWidget(pushButton); + + spacerItem = new QSpacerItem(101, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + acceptButton = new QPushButton(layoutWidget); + acceptButton->setObjectName(QString::fromUtf8("acceptButton")); + + hboxLayout->addWidget(acceptButton); + + cancelButton = new QPushButton(layoutWidget); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + + hboxLayout->addWidget(cancelButton); + + line_2 = new QFrame(VGParamDialog); + line_2->setObjectName(QString::fromUtf8("line_2")); + line_2->setGeometry(QRect(10, 370, 381, 16)); + line_2->setFrameShape(QFrame::HLine); + frame = new QFrame(VGParamDialog); + frame->setObjectName(QString::fromUtf8("frame")); + frame->setGeometry(QRect(10, 10, 381, 61)); + frame->setFrameShape(QFrame::StyledPanel); + frame->setFrameShadow(QFrame::Raised); + label = new QLabel(frame); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 10, 121, 17)); + label_2 = new QLabel(frame); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(10, 30, 141, 17)); + line = new QFrame(frame); + line->setObjectName(QString::fromUtf8("line")); + line->setGeometry(QRect(180, 0, 20, 61)); + line->setFrameShape(QFrame::VLine); + label_3 = new QLabel(frame); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(220, 10, 71, 17)); + checkCollision = new QCheckBox(frame); + checkCollision->setObjectName(QString::fromUtf8("checkCollision")); + checkCollision->setGeometry(QRect(160, 10, 21, 22)); + checkCollision->setChecked(true); + checkDiscrete = new QCheckBox(frame); + checkDiscrete->setObjectName(QString::fromUtf8("checkDiscrete")); + checkDiscrete->setGeometry(QRect(160, 30, 16, 22)); + checkDiscrete->setChecked(true); + checkCM = new QCheckBox(frame); + checkCM->setObjectName(QString::fromUtf8("checkCM")); + checkCM->setGeometry(QRect(300, 10, 41, 22)); + checkCM->setChecked(true); + checkMM = new QCheckBox(frame); + checkMM->setObjectName(QString::fromUtf8("checkMM")); + checkMM->setGeometry(QRect(300, 30, 41, 22)); + frame_2 = new QFrame(VGParamDialog); + frame_2->setObjectName(QString::fromUtf8("frame_2")); + frame_2->setGeometry(QRect(10, 130, 381, 241)); + frame_2->setFrameShape(QFrame::StyledPanel); + frame_2->setFrameShadow(QFrame::Raised); + label_4 = new QLabel(frame_2); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(10, 10, 181, 17)); + label_5 = new QLabel(frame_2); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(10, 30, 171, 17)); + label_6 = new QLabel(frame_2); + label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setGeometry(QRect(10, 50, 211, 17)); + label_7 = new QLabel(frame_2); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(10, 70, 225, 17)); + label_8 = new QLabel(frame_2); + label_8->setObjectName(QString::fromUtf8("label_8")); + label_8->setGeometry(QRect(10, 90, 271, 17)); + label_9 = new QLabel(frame_2); + label_9->setObjectName(QString::fromUtf8("label_9")); + label_9->setGeometry(QRect(10, 110, 238, 17)); + label_10 = new QLabel(frame_2); + label_10->setObjectName(QString::fromUtf8("label_10")); + label_10->setGeometry(QRect(10, 130, 209, 17)); + label_11 = new QLabel(frame_2); + label_11->setObjectName(QString::fromUtf8("label_11")); + label_11->setGeometry(QRect(10, 150, 213, 17)); + label_12 = new QLabel(frame_2); + label_12->setObjectName(QString::fromUtf8("label_12")); + label_12->setGeometry(QRect(10, 170, 75, 17)); + label_13 = new QLabel(frame_2); + label_13->setObjectName(QString::fromUtf8("label_13")); + label_13->setGeometry(QRect(10, 190, 73, 17)); + label_14 = new QLabel(frame_2); + label_14->setObjectName(QString::fromUtf8("label_14")); + label_14->setGeometry(QRect(10, 210, 71, 17)); + minInputVolume = new QLineEdit(frame_2); + minInputVolume->setObjectName(QString::fromUtf8("minInputVolume")); + minInputVolume->setGeometry(QRect(312, 10, 61, 20)); + minInputVolume->setAlignment(Qt::AlignRight); + minVoidVolume = new QLineEdit(frame_2); + minVoidVolume->setObjectName(QString::fromUtf8("minVoidVolume")); + minVoidVolume->setGeometry(QRect(312, 30, 61, 20)); + minVoidVolume->setAlignment(Qt::AlignRight); + minDecFaceArea = new QLineEdit(frame_2); + minDecFaceArea->setObjectName(QString::fromUtf8("minDecFaceArea")); + minDecFaceArea->setGeometry(QRect(312, 50, 61, 20)); + minDecFaceArea->setAlignment(Qt::AlignRight); + minReDecFaceArea = new QLineEdit(frame_2); + minReDecFaceArea->setObjectName(QString::fromUtf8("minReDecFaceArea")); + minReDecFaceArea->setGeometry(QRect(312, 70, 61, 20)); + minReDecFaceArea->setAlignment(Qt::AlignRight); + maxPredecCells = new QLineEdit(frame_2); + maxPredecCells->setObjectName(QString::fromUtf8("maxPredecCells")); + maxPredecCells->setGeometry(QRect(312, 90, 61, 20)); + maxPredecCells->setAlignment(Qt::AlignRight); + maxComplementCells = new QLineEdit(frame_2); + maxComplementCells->setObjectName(QString::fromUtf8("maxComplementCells")); + maxComplementCells->setGeometry(QRect(312, 110, 61, 20)); + maxComplementCells->setAlignment(Qt::AlignRight); + minSamplePoints = new QLineEdit(frame_2); + minSamplePoints->setObjectName(QString::fromUtf8("minSamplePoints")); + minSamplePoints->setGeometry(QRect(312, 130, 61, 20)); + minSamplePoints->setAlignment(Qt::AlignRight); + maxSamplePoints = new QLineEdit(frame_2); + maxSamplePoints->setObjectName(QString::fromUtf8("maxSamplePoints")); + maxSamplePoints->setGeometry(QRect(312, 150, 61, 20)); + maxSamplePoints->setAlignment(Qt::AlignRight); + xRes = new QLineEdit(frame_2); + xRes->setObjectName(QString::fromUtf8("xRes")); + xRes->setGeometry(QRect(312, 170, 61, 20)); + xRes->setAlignment(Qt::AlignRight); + yRes = new QLineEdit(frame_2); + yRes->setObjectName(QString::fromUtf8("yRes")); + yRes->setGeometry(QRect(312, 190, 61, 20)); + yRes->setAlignment(Qt::AlignRight); + tolSet = new QLineEdit(frame_2); + tolSet->setObjectName(QString::fromUtf8("tolSet")); + tolSet->setGeometry(QRect(312, 210, 61, 20)); + tolSet->setAlignment(Qt::AlignRight); + frame_3 = new QFrame(VGParamDialog); + frame_3->setObjectName(QString::fromUtf8("frame_3")); + frame_3->setGeometry(QRect(10, 70, 381, 61)); + frame_3->setFrameShape(QFrame::StyledPanel); + frame_3->setFrameShadow(QFrame::Raised); + label_15 = new QLabel(frame_3); + label_15->setObjectName(QString::fromUtf8("label_15")); + label_15->setGeometry(QRect(10, 10, 131, 17)); + label_16 = new QLabel(frame_3); + label_16->setObjectName(QString::fromUtf8("label_16")); + label_16->setGeometry(QRect(10, 30, 107, 17)); + initSurfNb = new QLineEdit(frame_3); + initSurfNb->setObjectName(QString::fromUtf8("initSurfNb")); + initSurfNb->setGeometry(QRect(312, 10, 61, 20)); + initSurfNb->setAlignment(Qt::AlignRight); + initCellNb = new QLineEdit(frame_3); + initCellNb->setObjectName(QString::fromUtf8("initCellNb")); + initCellNb->setGeometry(QRect(312, 30, 61, 20)); + initCellNb->setAlignment(Qt::AlignRight); + retranslateUi(VGParamDialog); + QObject::connect(cancelButton, SIGNAL(clicked()), VGParamDialog, SLOT(reject())); + QObject::connect(acceptButton, SIGNAL(clicked()), VGParamDialog, SLOT(accept())); + + QMetaObject::connectSlotsByName(VGParamDialog); + } // setupUi + + void retranslateUi(QDialog *VGParamDialog) + { + VGParamDialog->setWindowTitle(QApplication::translate("VGParamDialog", "Optional Conversion Parameters", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("VGParamDialog", "Write Collision File", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("VGParamDialog", "Write Discrete Model", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("VGParamDialog", "Input Units", 0, QApplication::UnicodeUTF8)); + checkCollision->setText(QApplication::translate("VGParamDialog", "", 0, QApplication::UnicodeUTF8)); + checkDiscrete->setText(QApplication::translate("VGParamDialog", "", 0, QApplication::UnicodeUTF8)); + checkCM->setText(QApplication::translate("VGParamDialog", "CM", 0, QApplication::UnicodeUTF8)); + checkMM->setText(QApplication::translate("VGParamDialog", "MM", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("VGParamDialog", "Minimum Input Solid Volume", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("VGParamDialog", "Minimum Void Volume", 0, QApplication::UnicodeUTF8)); + label_6->setText(QApplication::translate("VGParamDialog", "Minimum Decomposition Face Area", 0, QApplication::UnicodeUTF8)); + label_7->setText(QApplication::translate("VGParamDialog", "Minimum Redecomposition Face Area", 0, QApplication::UnicodeUTF8)); + label_8->setText(QApplication::translate("VGParamDialog", "Maximum Number Of Predecomposition Cells", 0, QApplication::UnicodeUTF8)); + label_9->setText(QApplication::translate("VGParamDialog", "Maximum Number Of Complement Cells", 0, QApplication::UnicodeUTF8)); + label_10->setText(QApplication::translate("VGParamDialog", "Minimum Number Of Sample Points", 0, QApplication::UnicodeUTF8)); + label_11->setText(QApplication::translate("VGParamDialog", "Maximum Number Of Sample Points", 0, QApplication::UnicodeUTF8)); + label_12->setText(QApplication::translate("VGParamDialog", "X-Resolution", 0, QApplication::UnicodeUTF8)); + label_13->setText(QApplication::translate("VGParamDialog", "Y-Resolution", 0, QApplication::UnicodeUTF8)); + label_14->setText(QApplication::translate("VGParamDialog", "Tolerance", 0, QApplication::UnicodeUTF8)); + minInputVolume->setText(QApplication::translate("VGParamDialog", "10", 0, QApplication::UnicodeUTF8)); + minVoidVolume->setText(QApplication::translate("VGParamDialog", "1.0", 0, QApplication::UnicodeUTF8)); + minDecFaceArea->setText(QApplication::translate("VGParamDialog", "5", 0, QApplication::UnicodeUTF8)); + minReDecFaceArea->setText(QApplication::translate("VGParamDialog", "1", 0, QApplication::UnicodeUTF8)); + maxPredecCells->setText(QApplication::translate("VGParamDialog", "500", 0, QApplication::UnicodeUTF8)); + maxComplementCells->setText(QApplication::translate("VGParamDialog", "3", 0, QApplication::UnicodeUTF8)); + minSamplePoints->setText(QApplication::translate("VGParamDialog", "10", 0, QApplication::UnicodeUTF8)); + maxSamplePoints->setText(QApplication::translate("VGParamDialog", "50", 0, QApplication::UnicodeUTF8)); + xRes->setText(QApplication::translate("VGParamDialog", "50", 0, QApplication::UnicodeUTF8)); + yRes->setText(QApplication::translate("VGParamDialog", "50", 0, QApplication::UnicodeUTF8)); + tolSet->setText(QApplication::translate("VGParamDialog", "1e-7", 0, QApplication::UnicodeUTF8)); + label_15->setText(QApplication::translate("VGParamDialog", "Initial Surface Number", 0, QApplication::UnicodeUTF8)); + label_16->setText(QApplication::translate("VGParamDialog", "Initial Cell Number", 0, QApplication::UnicodeUTF8)); + initSurfNb->setText(QApplication::translate("VGParamDialog", "1", 0, QApplication::UnicodeUTF8)); + initCellNb->setText(QApplication::translate("VGParamDialog", "1", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("VGParamDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + pushButton->setText(QApplication::translate("VGParamDialog", "Load", 0, QApplication::UnicodeUTF8)); + acceptButton->setText(QApplication::translate("VGParamDialog", "Accept", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(VGParamDialog); + } // retranslateUi + +}; + +namespace Ui { + class VGParamDialog: public Ui_VGParamDialog {}; +} // namespace Ui + +#endif // QMCCAD_VGPARAMDIALOG_H diff --git a/src/MCCAD/McCadIOHelper/McCadIOHelper_Expander.cxx b/src/MCCAD/McCadIOHelper/McCadIOHelper_Expander.cxx new file mode 100644 index 0000000..901316d --- /dev/null +++ b/src/MCCAD/McCadIOHelper/McCadIOHelper_Expander.cxx @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + + +// +// CTORS +// +McCadIOHelper_Expander::McCadIOHelper_Expander(){ + m_explodedShapes = new TopTools_HSequenceOfShape; +} + + +McCadIOHelper_Expander::McCadIOHelper_Expander(const Handle_TopTools_HSequenceOfShape& theHSeqOfShp){ + m_shapesToExplode = theHSeqOfShp; + m_explodedShapes = Explode(); +} + +Handle(TopTools_HSequenceOfShape) McCadIOHelper_Expander::Explode(const Handle_TopTools_HSequenceOfShape& aHSeqOfShp){ + m_shapesToExplode = aHSeqOfShp; + return Explode(); +} + +Handle_TopTools_HSequenceOfShape McCadIOHelper_Expander::GetExplodedShapes(){ + return m_explodedShapes; +} + +Handle_TopTools_HSequenceOfShape McCadIOHelper_Expander::Explode() +{ + int cnt(0); + + m_explodedShapes = new TopTools_HSequenceOfShape; + + TopExp_Explorer ex; + for (Standard_Integer i=1; i<= m_shapesToExplode->Length(); i++) { + for (ex.Init(m_shapesToExplode->Value(i), TopAbs_SOLID); ex.More(); ex.Next()){ + cnt++; + TopoDS_Solid tmpSol = TopoDS::Solid(ex.Current()); + m_explodedShapes->Append(tmpSol); + } + } + + return m_explodedShapes; +} + diff --git a/src/MCCAD/McCadIOHelper/McCadIOHelper_InputFileParser.cxx b/src/MCCAD/McCadIOHelper/McCadIOHelper_InputFileParser.cxx new file mode 100644 index 0000000..b3177a3 --- /dev/null +++ b/src/MCCAD/McCadIOHelper/McCadIOHelper_InputFileParser.cxx @@ -0,0 +1,471 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + + +McCadIOHelper_InputFileParser::McCadIOHelper_InputFileParser(){ + Init(); +} + + +McCadIOHelper_InputFileParser::McCadIOHelper_InputFileParser(const TCollection_AsciiString& inputFileName){ + Init(); + Parse(inputFileName); +} + + +void McCadIOHelper_InputFileParser::Init(){ + m_isDone = false; + m_isFirstFile = true; + m_parameters.writeCollisionFile = true; + m_parameters.writeVoxelFile = true; + + m_partieIndex = 0; + m_parameters.minInputSolidVolume = 1.; + m_parameters.minSizeOfDecompositionFace = 1.; + m_parameters.minSizeOfRedecompositionFace = 0.1; + m_parameters.minVoidVolume = 0.0; + m_parameters.tolerance = 1.e-7; + + m_parameters.initCellNumber = 0; + m_parameters.initSurfaceNumber = 0; + m_parameters.maxNumberOfPreDecompositionCells = 5000; + m_parameters.xResolution = 50; + m_parameters.yResolution = 50; + + m_parameters.maxNumberOfComplementCells = 5; + m_parameters.maxSamplePoints = 50; + m_parameters.minSamplePoints = 10; + + m_parameters.boundingBox = new TopTools_HSequenceOfShape; + m_parameters.inputSolids = new McCadDiscDs_HSequenceOfDiscSolid; + m_parameters.inputFileName = "none"; + m_inputFileName = "none"; + m_parameters.materialDensityFileName = "none"; + + m_parameters.m_listMatSolids = new TopTools_HSequenceOfShape; + + +} + + +bool McCadIOHelper_InputFileParser::Parse(const TCollection_AsciiString& inputFileName){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + m_inputFileName = inputFileName; + m_parameters.inputFileName = m_inputFileName; + if(!Parse()) { + msgr->Message("Error during parsing of parameter file\n") ; + return false; + } + if(!ReadBoundingBoxFile()){ + TCollection_AsciiString message("Error while reading bounding box file : "); + message.AssignCat(m_parameters.boundingBoxName); + msgr->Message(message.ToCString()) ; + return false; + } + if(!ReadGeometryFiles()){ + TCollection_AsciiString message("Error while reading geometry file : "); + message.AssignCat(m_currentGeometryFileName); + msgr->Message("Error while reading geometry file\n") ; + return false; + } + m_parameters.directories = m_directories; + m_isDone = true; + + return true; +} + + +// +// P R I V A T E +// + +bool McCadIOHelper_InputFileParser::Parse(){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString message("_#_McCadConvertTools_InputFileParser :: "); + + // open parameter file + ifstream inFile(m_inputFileName.ToCString()); + if (!inFile) { + message.AssignCat("Cannot open parameter file : "); + message.AssignCat(m_inputFileName); + msgr->Message( message.ToCString(), McCadMessenger_ErrorMsg ); + return false; + } + + // read file line by line + while(inFile) { + char str[255]; + inFile.getline(str,255); + TCollection_AsciiString iString(str); + + // skip empty lines + if(iString.IsEmpty()) + continue; + + // skip comment lines + iString.LeftAdjust(); + iString.RightAdjust(); + if(iString.Value(1) == '#') + continue; + + // turn tabs into spaces + iString.ChangeAll('\t', ' ', Standard_False); + + // directories to add + if( iString.Search(" ") < 0 ) { + iString += TCollection_AsciiString(" "); + m_directories += iString; + } + //codeword with parameter + else { + int i = iString.Search(" "); + TCollection_AsciiString numString = iString.Split(i); + numString.LeftAdjust(); + numString.RightAdjust(); + iString.LeftAdjust(); + iString.RightAdjust(); + iString.UpperCase(); + + // search for codewords + if(iString.IsEqual("WRITECOLLISIONFILE")) { + if( numString.IsEqual("1") || numString.IsEqual("true") || + numString.IsEqual("True") || numString.IsEqual("TRUE") ) + { + m_parameters.writeCollisionFile = true; + } + else + m_parameters.writeCollisionFile = false; + } + else if(iString.IsEqual("WRITEDISCRETEMODEL")) { + if( numString.IsEqual("1") || numString.IsEqual("true") || + numString.IsEqual("True") || numString.IsEqual("TRUE") ) + { + m_parameters.writeVoxelFile = true; + } + else + m_parameters.writeVoxelFile = false; + } + else if(iString.IsEqual("MINIMUMINPUTSOLIDVOLUME")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString, numString); + else + m_parameters.minInputSolidVolume = numString.RealValue(); + } + else if(iString.IsEqual("MINIMUMVOIDVOLUME")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else { + m_parameters.minVoidVolume = numString.RealValue(); + } + } + else if(iString.IsEqual("MINIMUMSIZEOFDECOMPOSITIONFACEAREA")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.minSizeOfDecompositionFace = numString.RealValue(); + } + else if(iString.IsEqual("MINIMUMSIZEOFREDECOMPOSITIONFACEAREA")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.minSizeOfRedecompositionFace = numString.RealValue(); + } + else if(iString.IsEqual("MAXIMUMNUMBEROFPREDECOMPOSITIONCELLS")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.maxNumberOfPreDecompositionCells = numString.IntegerValue(); + } + else if(iString.IsEqual("MAXIMUMNUMBEROFCOMPLEMENTEDCELLS")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.maxNumberOfComplementCells = numString.IntegerValue(); + } + else if(iString.IsEqual("BOUNDINGBOX")) { + m_parameters.boundingBoxName = numString; + } + else if(iString.IsEqual("MINIMUMNUMBEROFSAMPLEPOINTS")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.minSamplePoints = numString.IntegerValue(); + } + else if(iString.IsEqual("MAXIMUMNUMBEROFSAMPLEPOINTS")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.maxSamplePoints = numString.IntegerValue(); + } + else if(iString.IsEqual("XRESOLUTION")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.xResolution = numString.IntegerValue(); + } + else if(iString.IsEqual("YRESOLUTION")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.yResolution = numString.IntegerValue(); + } + else if(iString.IsEqual("TOLERANCE")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_parameters.tolerance = numString.RealValue(); + } + else if(iString.IsEqual("MDFILE")) { + m_parameters.materialDensityFileName = numString; + } + else if(iString.IsEqual("INITSURFNB")) { + if(!numString.IsIntegerValue()) + MissmatchMessage(iString,numString); + else + m_parameters.initSurfaceNumber = numString.IntegerValue(); + } + else if(iString.IsEqual("INITCELLNB")) { + if(!numString.IsIntegerValue()) + MissmatchMessage(iString,numString); + else + m_parameters.initCellNumber = numString.IntegerValue(); + } + else if(iString.IsEqual("UNITS")) { + if(numString.IsEqual("CM") || numString.IsEqual("cm")) + m_parameters.units = McCadCSGGeom_CM; + if(numString.IsEqual("MM") || numString.IsEqual("mm")) + m_parameters.units = McCadCSGGeom_MM; + if(numString.IsEqual("INCH") || numString.IsEqual("inch")) + m_parameters.units = McCadCSGGeom_Inch; + } + else{ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: Unknown keyword : "); + message.AssignCat(iString); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + } + } + } + return true; +} + + +void McCadIOHelper_InputFileParser::MissmatchMessage(TCollection_AsciiString &keyword, TCollection_AsciiString ¶meter){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString message("_#_McCadConvertTools_InputFileParser :: "); + message.AssignCat("unexpected data type for keyword \'"); + message.AssignCat(keyword); + message.AssignCat("\' ( "); + message.AssignCat(parameter); + message.AssignCat(" ) "); + + msgr->Message(message.ToCString()); +} + + +bool McCadIOHelper_InputFileParser::ReadBoundingBoxFile(){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + // get file type and initialize plugin manager + TCollection_AsciiString fileExtension = m_parameters.boundingBoxName; + if(fileExtension.IsEmpty()){ + msgr->Message("_#_McCadIOHelper_InputFileParser :: no bounding box defined! ", McCadMessenger_WarningMsg); + return true; + } + fileExtension = fileExtension.Split(fileExtension.SearchFromEnd(".")-1); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + if( !pluginManager->CheckFormat(fileExtension) ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: Unknown file extension : "); + message += fileExtension; + msgr->Message(message.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + McCadEXPlug_ExchangePlugin* exchangePlugin = pluginManager->GetPlugin(fileExtension); + exchangePlugin->SetFilename(m_parameters.boundingBoxName); + + // import geometry + Handle_TopTools_HSequenceOfShape importedShapes = exchangePlugin->Import(); + if(importedShapes->Length() < 1){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: Empty or non-existing file : "); + message += m_parameters.boundingBoxName; + msgr->Message(message.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + m_parameters.boundingBox->Append(importedShapes); + return true; +} + + +bool McCadIOHelper_InputFileParser::ReadGeometryFiles(){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + if(m_directories.IsEmpty()){ + msgr->Message("_#_McCadIOHelper_InputFileParser :: No input directories in parameter file defined!\n", McCadMessenger_ErrorMsg); + return false; + } + + // search for all converted*.[supported file extension] files in given directories + TCollection_AsciiString theDirectories = m_directories; + theDirectories.LeftAdjust(); + theDirectories.RightAdjust(); + while(theDirectories.Search(" ") > 0) { + TCollection_AsciiString directory = theDirectories.Split(theDirectories.SearchFromEnd(" ")); + theDirectories.RightAdjust(); + directory.LeftAdjust(); + if( !AddDirectory(directory) ) { + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: error during file reading in directory : "); + message.AssignCat(directory); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + } + } + theDirectories.RightAdjust(); + if( !AddDirectory(theDirectories) ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: error during reading file in directory : "); + message.AssignCat(theDirectories); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + } + + return true; +} + + +bool McCadIOHelper_InputFileParser::AddDirectory(const TCollection_AsciiString& directory){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + cout<Message(message.ToCString(), McCadMessenger_WarningMsg); + return false; + } + + // read all files that fit the mask ( beginning with converted, ending on known extension ) + TCollection_AsciiString theCommandString; + theCommandString = TCollection_AsciiString("ls -1 ") + directory + TCollection_AsciiString("/converted*"); + static unsigned int BUF_SIZE = 1024; + char command_string[80]; + strcpy(command_string, std::string( theCommandString.ToCString()).c_str() ); + FILE *files; +//qiu char in_buf[BUF_SIZE]; + char in_buf[1024]; + + //get list of files in given directory +//qiu +#ifdef WIN32 + files = _popen(command_string, "r"); +#else + files = popen(command_string, "r"); +#endif + + if (!files) { + perror("_#_McCadIOHelper_InputFileParser :: error in popen :"); + return false; + } + + // call AddFile for all files in current directory + while (fgets(in_buf, BUF_SIZE, files)) { + //handling line breaks + char *w; + w = strpbrk(in_buf, "\t\n"); + if (w) + *w='\0'; + + TCollection_AsciiString tmpName(in_buf); + TCollection_AsciiString fileFilter(tmpName); + fileFilter = fileFilter.Split( fileFilter.SearchFromEnd(".") -1 ); + if(! pluginManager->CheckExtension(fileFilter)) { + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: skipping file with unknown extension : "); + message.AssignCat(tmpName); + msgr->Message( message.ToCString(), McCadMessenger_WarningMsg ); + continue; + } + + cout << " -- " << tmpName.ToCString() << endl; + + //Append Files beginning with converted + if(tmpName.Search("converted") >= 0 ) { + if( !AddFile(tmpName) ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: Failed adding file : "); + message.AssignCat(tmpName); + msgr->Message( message.ToCString(), McCadMessenger_WarningMsg ); + } + } + else{ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: file doesn't contain \'converted\' prefix : "); + message.AssignCat(tmpName); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + } + } + return true; +} + + +bool McCadIOHelper_InputFileParser::AddFile(const TCollection_AsciiString &file){ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + cout << " file : " << file.ToCString() << endl; + // extract units from first file (MM/CM) + if(m_isFirstFile){ + m_isFirstFile = false; + ifstream readFile; + readFile.open(file.ToCString(), ios::in); + while(!readFile.eof()) { + char str[255]; + readFile.getline(str,255); + TCollection_AsciiString line(str); + if(line.Search("SI_UNIT")) { + if(line.Search(".MILLI.")) + m_parameters.units = McCadCSGGeom_MM; + else + m_parameters.units = McCadCSGGeom_CM; + break; + } + } + } + + // get file filter + Handle_TopTools_HSequenceOfShape inputShapes = new TopTools_HSequenceOfShape; + TCollection_AsciiString fileFilter(file); + fileFilter.Remove(1,fileFilter.SearchFromEnd(".")-1); + + // initialize import plugin and import geometry from file + if( !pluginManager->CheckFormat(fileFilter) ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: No file filter for file : "); + message.AssignCat(file); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + return false; + } + McCadEXPlug_ExchangePlugin* exchangePlugin = pluginManager->GetPlugin(fileFilter); + exchangePlugin->SetFilename(file); + inputShapes = exchangePlugin->Import(); + if( inputShapes->Length() < 1 ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: could not read shapes from file : "); + message.AssignCat(file); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + return false; + } + + // make vsolid and add to list + for (Standard_Integer i = 1; i<= inputShapes->Length(); i++) { + m_partieIndex++; + McCadDiscDs_DiscSolid aVSol; + aVSol.SetName(file, i); + TopoDS_Solid tmpSol = TopoDS::Solid(inputShapes->Value(i)); + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(m_partieIndex); + m_parameters.inputSolids->Append(aVSol); + + m_parameters.m_listMatSolids->Append(inputShapes->Value(i)); + + } + + // Read the solid and generate the MatSolidList + return true; +} diff --git a/src/MCCAD/McCadIOHelper/McCadIOHelper_Merger.cxx b/src/MCCAD/McCadIOHelper/McCadIOHelper_Merger.cxx new file mode 100644 index 0000000..a006dde --- /dev/null +++ b/src/MCCAD/McCadIOHelper/McCadIOHelper_Merger.cxx @@ -0,0 +1,222 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +using namespace std; + +McCadIOHelper_Merger::McCadIOHelper_Merger() +{ + myPath = "./"; + Init(); +} + + +McCadIOHelper_Merger::McCadIOHelper_Merger(const TCollection_AsciiString& thePath) +{ + myPath = thePath; + Init(); + AddDirectory(thePath); +} + + +void McCadIOHelper_Merger::Init() +{ + myFileName = "all.stp"; + myOutFilter = ".stp"; + myInFilter = "none"; + myIsFirstShape = Standard_True; + + McCadEXPlug_PluginManagerPtr thePluginManager = McCadEXPlug_PluginManager::Instance(); + myPluginManager = thePluginManager; +} + + +void McCadIOHelper_Merger::SetInFilter(const TCollection_AsciiString& theInFilter) +{ + myInFilter = theInFilter; +} + + +void McCadIOHelper_Merger::SetOutFilter(const TCollection_AsciiString& theOutFilter) +{ + myOutFilter = theOutFilter; +} + + +Standard_Boolean McCadIOHelper_Merger::AddFile(const TCollection_AsciiString& anotherFile) +{ + Handle(TopTools_HSequenceOfShape) tmpShpSeq = new TopTools_HSequenceOfShape; + TCollection_AsciiString aFileFilter = anotherFile; + aFileFilter.Remove(1,aFileFilter.SearchFromEnd(".")-1); + myOutFilter = aFileFilter; + + if(myPluginManager->CheckExtension(aFileFilter)) + { + myImpoExpo = myPluginManager->GetPlugin(aFileFilter); + myImpoExpo->SetFilename(anotherFile); + tmpShpSeq = myImpoExpo->Import(); + if(myIsFirstShape) + { + myHSeqOfShp = tmpShpSeq; + myIsFirstShape = Standard_False; + } + else + myHSeqOfShp->Append(tmpShpSeq); + cout << anotherFile.ToCString() << " has been appended.\n"; + } + else + { + cout << "_#_ No file filter for " << aFileFilter.ToCString() << endl; + return Standard_False; + } + + return Standard_True; +} + + +Standard_Boolean McCadIOHelper_Merger::AddDirectory(const TCollection_AsciiString& thePath) +{ + TCollection_AsciiString theCommandString; + Standard_Boolean FilesFound = Standard_False; + myPath = thePath; + if(myInFilter.IsEqual("none")) // if no file filter specified -> append all known file formats + { + cout << "No file filter specified: looking for all known file formats in directory: " << myPath << endl; + theCommandString = TCollection_AsciiString("ls -1 ") + myPath + TCollection_AsciiString("/*"); + } + else // append all files with specified file format + { + theCommandString = TCollection_AsciiString("ls -1 ") + myPath + TCollection_AsciiString("/*") + myInFilter; + } + + static unsigned int BUF_SIZE = 1024; + myPath = thePath; + + char command_string[80]; + strcpy(command_string, string(theCommandString.ToCString()).c_str()); + FILE *dl; +//qiu char in_buf[BUF_SIZE]; + char in_buf[1024]; +//qiu +#ifdef WIN32 + dl = _popen(command_string, "r"); //get list of files in given directory +#else + dl = popen(command_string, "r"); //get list of files in given directory +#endif + if (!dl) + { + perror("popen"); + exit(-1); + } + + while (fgets(in_buf, BUF_SIZE, dl)) //for all found files + { + TCollection_AsciiString tmpName; + TCollection_AsciiString tmpExtension; + + char *w; //handling line breaks + w = strpbrk(in_buf, " \t\n"); + if (w) + *w='\0'; + + if(myInFilter.IsEqual("none")) // if no file filter specified, extract extension and check for validity + { + TCollection_AsciiString tmp(in_buf); + tmpName = tmp; + tmpExtension = tmpName; + tmpExtension.Remove(1,tmpExtension.SearchFromEnd(".")-1); + } + else //use specified file filter + { + TCollection_AsciiString tmp(in_buf); + tmpName = tmp; + tmpExtension = myInFilter; + } + + if(!myPluginManager->CheckExtension(tmpExtension)) + { + cout << "unknown extension: " << tmpExtension.ToCString() << " skipping file "<< tmpName.ToCString() << endl; + continue; + } + + //Append File + if(AddFile(tmpName)) //if but just a single file has been found return success + FilesFound = Standard_True; + } + + if(FilesFound) + return Standard_True; + else + return Standard_False; +} + + +Standard_Boolean McCadIOHelper_Merger::MergeToFile(const TCollection_AsciiString& theOutFile) +{ + myFileName = theOutFile; + return Merge(); +} + + +Handle(TopTools_HSequenceOfShape) McCadIOHelper_Merger::GetHSeqOfShp() +{ + return myHSeqOfShp; +} + + +Standard_Boolean McCadIOHelper_Merger::Merge() // build output file +{ + TopoDS_CompSolid theCSolid; + BRep_Builder theBuilder; + theBuilder.MakeCompSolid(theCSolid); + TopExp_Explorer TopExp; + TCollection_AsciiString outName = myPath + TCollection_AsciiString("/") + myFileName; + + cout << "\nMerging to output file : " << myFileName.ToCString() << endl; + cout << "Number of shapes: " << myHSeqOfShp->Length() << endl; + + for (Standard_Integer i=1; i<= myHSeqOfShp->Length(); i++) + { + for (TopExp.Init(myHSeqOfShp->Value(i), TopAbs_SOLID); TopExp.More(); TopExp.Next()) + { + TopoDS_Solid tmpSol = TopoDS::Solid(TopExp.Current()); + theBuilder.Add(theCSolid, tmpSol); + } + } + + Handle(TopTools_HSequenceOfShape) tmpShpSeq = new TopTools_HSequenceOfShape(); + + for (TopExp.Init(theCSolid, TopAbs_SOLID); TopExp.More(); TopExp.Next()) + { + TopoDS_Solid tmpSol = TopoDS::Solid(TopExp.Current()); + tmpShpSeq->Append(tmpSol); + } + + if (myPluginManager->CheckExtension(myOutFilter)) + { + myImpoExpo = myPluginManager->GetPlugin(myOutFilter); + myImpoExpo->SetFilename(outName); + myImpoExpo->Export(tmpShpSeq); + } + else + return Standard_False; + + cout << "...done\n\n"; + return Standard_True; +} diff --git a/src/MCCAD/McCadIOTools/McCadIOTools.cxx b/src/MCCAD/McCadIOTools/McCadIOTools.cxx new file mode 100644 index 0000000..75128ea --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools.cxx @@ -0,0 +1,24 @@ +#include +#include +#include + +void McCadIOTools::Export(const TCollection_AsciiString &extension, Handle_McCadCom_CasDocument &document){ + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + McCadEXPlug_ExchangePlugin* exportPlugin = pluginManager->GetPlugin(extension); + + // export brep file + TCollection_AsciiString fileName = document->GetDocName(); + exportPlugin->SetFilename(fileName); + exportPlugin->ExportFromDocument( document->GetTDoc() ); +} + +void McCadIOTools::Import(const TCollection_AsciiString &extension, Handle_McCadCom_CasDocument &document){ + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + McCadEXPlug_ExchangePlugin* stepPlugin = pluginManager->GetPlugin(extension); + + // export step file + TCollection_AsciiString fileName = document->GetDocName(); + stepPlugin->SetFilename(fileName); + Handle_TDocStd_Document tDoc = document->GetTDoc(); + stepPlugin->ImportToDocument( tDoc ); +} diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ExportBrep.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ExportBrep.cxx new file mode 100644 index 0000000..b7b7b79 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ExportBrep.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ExportBrep::McCadIOTools_ExportBrep( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ExportBrep::Execute() { + // get export plugin + TCollection_AsciiString extension(".brep"); + McCadIOTools::Export( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ExportIges.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ExportIges.cxx new file mode 100644 index 0000000..30a62b4 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ExportIges.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ExportIges::McCadIOTools_ExportIges( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportIGES; +} + + +void McCadIOTools_ExportIges::Execute() { + // get export plugin + TCollection_AsciiString extension(".iges"); + McCadIOTools::Export( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ExportMcnp.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ExportMcnp.cxx new file mode 100644 index 0000000..e147ea0 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ExportMcnp.cxx @@ -0,0 +1,47 @@ +#include + +#include +#include + +McCadIOTools_ExportMcnp::McCadIOTools_ExportMcnp( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +McCadIOTools_ExportMcnp::McCadIOTools_ExportMcnp() +{ + myDoc = NULL; + myView = NULL; + myState = McCadTool_Waiting; + myUndoState = false; + myRedoState = false; + myID = McCadTool_ExportMCNP; +} + +void McCadIOTools_ExportMcnp::Execute() { + // decompose geometry and calculate void space + PrepareExport(); + + // export via McCadEXDllMcnp_Mcnp::Export() + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + TCollection_AsciiString filter(".mcn"); + McCadEXPlug_ExchangePlugin* mcnpWriter = pluginManager->GetPlugin(filter); + mcnpWriter->SetInitSurfNb(m_parameters.initSurfaceNumber); + mcnpWriter->SetInitCellNb(m_parameters.initCellNumber); + mcnpWriter->SetMDReader(m_mdReader); + mcnpWriter->SetUnits(m_parameters.units); + mcnpWriter->SetFilename(myDoc->GetDocName()); + mcnpWriter->Export(m_voxelizedOutputGeometry); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ExportStep.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ExportStep.cxx new file mode 100644 index 0000000..8f31d3a --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ExportStep.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ExportStep::McCadIOTools_ExportStep( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ExportStep::Execute() { + // get export plugin + TCollection_AsciiString extension(".stp"); + McCadIOTools::Export( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ExportTripoli.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ExportTripoli.cxx new file mode 100644 index 0000000..2a2aa44 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ExportTripoli.cxx @@ -0,0 +1,36 @@ +#include +#include +#include + +McCadIOTools_ExportTripoli::McCadIOTools_ExportTripoli( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ExportTripoli::Execute() { + // decompose geometry and calculate void space + PrepareExport(); + + // export via McCadEXDllTripoli_Tripoli::Export() + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + TCollection_AsciiString filter(".tri"); + McCadEXPlug_ExchangePlugin* tripoliWriter = pluginManager->GetPlugin(filter); + tripoliWriter->SetInitSurfNb(m_parameters.initSurfaceNumber); + tripoliWriter->SetInitCellNb(m_parameters.initCellNumber); + tripoliWriter->SetMDReader(m_mdReader); + tripoliWriter->SetUnits(m_parameters.units); + tripoliWriter->SetFilename(myDoc->GetDocName()); + tripoliWriter->Export(m_voxelizedOutputGeometry); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ImportBrep.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ImportBrep.cxx new file mode 100644 index 0000000..1cba22c --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ImportBrep.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ImportBrep::McCadIOTools_ImportBrep( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ImportBrep::Execute() { + // get export plugin + TCollection_AsciiString extension(".brep"); + McCadIOTools::Import( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ImportIges.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ImportIges.cxx new file mode 100644 index 0000000..79b1878 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ImportIges.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ImportIges::McCadIOTools_ImportIges( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ImportIges::Execute() { + // get export plugin + TCollection_AsciiString extension(".igs"); + McCadIOTools::Import( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ImportMcnp.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ImportMcnp.cxx new file mode 100644 index 0000000..e452f56 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ImportMcnp.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ImportMcnp::McCadIOTools_ImportMcnp( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ImportMcnp::Execute() { + // get export plugin + TCollection_AsciiString extension(".mcn"); + McCadIOTools::Import( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_ImportStep.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_ImportStep.cxx new file mode 100644 index 0000000..9127925 --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_ImportStep.cxx @@ -0,0 +1,25 @@ +#include +#include + +McCadIOTools_ImportStep::McCadIOTools_ImportStep( const Handle_McCadCom_CasDocument& theDoc, + const Handle_McCadCom_CasView& theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCNP; +} + + +void McCadIOTools_ImportStep::Execute() { + // get export plugin + TCollection_AsciiString extension(".stp"); + McCadIOTools::Import( extension, myDoc ); +} + + diff --git a/src/MCCAD/McCadIOTools/McCadIOTools_MCExportBase.cxx b/src/MCCAD/McCadIOTools/McCadIOTools_MCExportBase.cxx new file mode 100644 index 0000000..5abf68a --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadIOTools_MCExportBase.cxx @@ -0,0 +1,269 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//qiu remove gui, might be dangerous! #include +#include //qiu +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadIOTools_MCExportBase::McCadIOTools_MCExportBase( const Handle_McCadCom_CasDocument &theDoc, + const Handle_McCadCom_CasView &theView, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState ) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ExportMCBase; + + m_parameters.inputSolids = new McCadDiscDs_HSequenceOfDiscSolid; + m_parameters.boundingBox = new TopTools_HSequenceOfShape; +} + +McCadIOTools_MCExportBase::McCadIOTools_MCExportBase(){ + +} + + +void McCadIOTools_MCExportBase::Execute(){ + // do nothing +} + +void McCadIOTools_MCExportBase::PrepareExport(){ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + + Handle_TDocStd_Document theTDoc = myDoc->GetTDoc(); + + // count number of solids and determine face areas + McCadXCAF_TDocShapeLabelIterator shapeIterator(theTDoc); + Standard_Real smallestFaceArea(1.0e+99), biggestFaceArea(0.0); + Standard_Integer solidCnt(0); + Handle_XCAFDoc_ShapeTool shapeTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle_McCadDiscDs_HSequenceOfDiscSolid originalSolids = new McCadDiscDs_HSequenceOfDiscSolid; + for(; shapeIterator.More(); shapeIterator.Next()) { + TopoDS_Shape curSolid = shapeTool->GetShape(shapeIterator.Current()); + // find smallest and biggest face + for(TopExp_Explorer faceExp(curSolid, TopAbs_FACE); faceExp.More(); faceExp.Next()) { + TopoDS_Face f1 = TopoDS::Face(faceExp.Current()); + GProp_GProps GP1; + BRepGProp::SurfaceProperties(f1, GP1); + if(GP1.Mass() > biggestFaceArea) + biggestFaceArea = GP1.Mass(); + else if(GP1.Mass() < smallestFaceArea) + smallestFaceArea = GP1.Mass(); + } + solidCnt++; + } + + // no solids found + if(solidCnt == 0) { + msgr->Message("_#_McCadEXPlug_MCBase :: No solids found!!!\n", + McCadMessenger_ErrorMsg); + return; + } + + // print message about faces + TCollection_AsciiString faceMessage("\n Face Info\n=========\nsmallest face area : "); + faceMessage += smallestFaceArea; + faceMessage += " -- biggest face area : "; + faceMessage += biggestFaceArea; + faceMessage += "\n"; + msgr->Message(faceMessage.ToCString()); + + // start parameter dialog + QMcCad_VGParamDialog* theVGParamDialog = new QMcCad_VGParamDialog(); + theVGParamDialog->exec(); + if(!theVGParamDialog->Accepted()) + return; + + // init progress indicator +//qiu remove gui, might be dangerous! McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(/*qiu*/); + Handle_Message_ProgressIndicator progressIndicator = Handle_Message_ProgressIndicator::DownCast(theProgress); + theProgress->SetLabelText("Decomposing Geometry"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + + Standard_Real localWorkLoad = 20; + progressIndicator->SetRange(0,100); + progressIndicator->SetStep(localWorkLoad/(solidCnt+1)); + progressIndicator->Increment(); + shapeIterator.Initialize(theTDoc); + + //decompose all shapes + /////////////////////////////// + McCadConvertTools_Convertor convertor; + Handle_TopTools_HSequenceOfShape bbShapes = new TopTools_HSequenceOfShape; + msgr->Message("\nPerforming sign constant decomposition...", + McCadMessenger_HeadingMsg); + + for(; shapeIterator.More(); shapeIterator.Next(), progressIndicator->Increment()) { + TDF_Label curL = shapeIterator.Current(); + TopoDS_Shape curS; + + //progressIndicator->Increment(); + if(progressIndicator->UserBreak()) { + progressIndicator->SetValue(100); + return; + } + + if(!shapeTool->IsAssembly(curL)) + curS = shapeTool->GetShape(curL); + else + continue; + + Handle_TDataStd_Name tShpName; + TCollection_AsciiString shpName; + + if(!curL.FindAttribute(TDataStd_Name::GetID(),tShpName)) + shpName = "unnamed"; + else + shpName = TCollection_AsciiString(tShpName->Get()); + + Handle_TopTools_HSequenceOfShape shpSeq = new TopTools_HSequenceOfShape; + shpSeq->Append(curS); + + + + TCollection_AsciiString decMsg("\n+++++++++++++++++++++++++++++++++++++++++++++\n"); + decMsg += shpName; + decMsg += "\n+++++++++++++++++++++++++++++++++++++++++++++"; + msgr->Message(decMsg.ToCString()); + + // decompose solid + Handle_TopTools_HSequenceOfShape decSolid = new TopTools_HSequenceOfShape; + decSolid = convertor.Convert(shpSeq); + + // look for bounding box + TCollection_AsciiString tmpNm(shpName); + tmpNm.UpperCase(); + tmpNm.LeftAdjust(); + tmpNm.RightAdjust(); + tmpNm.RemoveAll(' '); + tmpNm.RemoveAll('_'); + tmpNm.RemoveAll('-'); + + if(tmpNm.Search("BOUNDINGBOX") > 0) { + bbShapes->Append(decSolid); + solidCnt--; + progressIndicator->SetStep(localWorkLoad/(solidCnt)); + continue; + } + + // process decomposed shapes + for(Standard_Integer i=1; i<=decSolid->Length(); i++) { + TCollection_AsciiString appendix(i); + appendix.Prepend("_"); + McCadDiscDs_DiscSolid tmpSolid; + tmpSolid.SetSolid(decSolid->Value(i)); + tmpSolid.SetName(shpName+appendix); + + originalSolids->Append(tmpSolid); + } + } + progressIndicator->SetValue(20.); + + // decomposition failed + if(originalSolids->Length() < 1) { + progressIndicator->SetValue(100); + return; + } + + //Load material and density information + /////////////////////////////////////////// + McCadMDReader_Reader mdReader(theTDoc); + m_mdReader = mdReader; + + // export decomposed model to step file + /////////////////////////////////////// +//qiu remove gui, might be dangerous! Handle_TDocStd_Application theXCAFApp = QMcCad_Application::GetAppMainWin()->GetXCAFApp(); + Handle_TDocStd_Application theXCAFApp = McCadXCAF_Application::GetApplication(); //qiu find from QMcCad_Application + Handle_TDocStd_Document decomposedTDoc; + theXCAFApp->NewDocument("XmlXCAF", decomposedTDoc); //initialize Document + Handle_XCAFDoc_ShapeTool sTool = XCAFDoc_DocumentTool::ShapeTool(decomposedTDoc->Main()); + + //append solids, names, material information to the document of decomposed solids + for(Standard_Integer i=1; i<=originalSolids->Length(); i++) { + TDataStd_Name curName; + TCollection_ExtendedString shpName(originalSolids->Value(i).GetName()); + TDF_Label curLab = sTool->AddShape(originalSolids->Value(i).GetSolid()); + curName.Set(curLab, shpName); + } + + // write decomposed geometry into CAD file + TCollection_AsciiString saveName("mc_Material_Cells.stp"); + STEPCAFControl_Writer theWriter; + theWriter.SetNameMode(true); + theWriter.SetColorMode(true); + theWriter.SetMaterialMode(true); + theWriter.Transfer(decomposedTDoc); + theWriter.Write(saveName.ToCString()); + theXCAFApp->Close(decomposedTDoc); + + msgr->Message("\nDecomposed Model has been exported...\n"); + msgr->Message("Starting Void Completion...", + McCadMessenger_HeadingMsg); + + // set parameters for VoidGenerator + if(bbShapes->Length()>0) { + m_parameters.boundingBox->Append(bbShapes); + } + m_parameters.writeCollisionFile = theVGParamDialog->GetWriteCollision(); + m_parameters.writeVoxelFile = theVGParamDialog->GetWriteDiscretModel(); + m_parameters.minInputSolidVolume = theVGParamDialog->GetMinInputVolume(); + m_parameters.minVoidVolume = theVGParamDialog->GetMinVoidVolume(); + m_parameters.minSamplePoints = theVGParamDialog->GetMinSamplePnts(); + m_parameters.maxSamplePoints = theVGParamDialog->GetMaxSamplePnts(); + m_parameters.xResolution = theVGParamDialog->GetXRes(); + m_parameters.yResolution = theVGParamDialog->GetYRes(); + m_parameters.tolerance = theVGParamDialog->GetTolerance(); + m_parameters.initCellNumber = theVGParamDialog->GetInitialCellNumber(); + m_parameters.initSurfaceNumber = theVGParamDialog->GetInitialSurfaceNumber(); + m_parameters.units = theVGParamDialog->GetUnits(); + m_parameters.minSizeOfDecompositionFace = theVGParamDialog->GetMinDecFace(); + m_parameters.minSizeOfRedecompositionFace = theVGParamDialog->GetMinReDecFace(); + m_parameters.maxNumberOfPreDecompositionCells = theVGParamDialog->GetMaxPreDec(); + m_parameters.maxNumberOfComplementCells = theVGParamDialog->GetMaxComplemented(); + + //run void completion algorithm + theProgress->SetLabelText("Generating Voids"); + McCadConvertTools_VoidGenerator voidGenerator; + voidGenerator.SetParameters(m_parameters); + voidGenerator.AddDiscSolids(originalSolids); + voidGenerator.SetProgressIndicator(progressIndicator); + if(!voidGenerator.Perform()) { + msgr->Message("Void Completion Failed, or progress has been aborted.\n", + McCadMessenger_ErrorMsg); + progressIndicator->SetValue(100); + return; + } + + theProgress->SetLabelText("Building Cells"); + m_voxelizedOutputGeometry = new McCadDiscDs_HSequenceOfDiscSolid; + m_voxelizedOutputGeometry->Append(voidGenerator.GetVSolids()); + m_voxelizedOutputGeometry->Append(voidGenerator.GetVVoids()); + m_voxelizedOutputGeometry->Append(voidGenerator.GetVOuterVoids()); +} diff --git a/src/MCCAD/McCadIOTools/McCadInputModelData.cxx b/src/MCCAD/McCadIOTools/McCadInputModelData.cxx new file mode 100644 index 0000000..dfd470f --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadInputModelData.cxx @@ -0,0 +1,163 @@ +#include "McCadInputModelData.hxx" + +#include +#include +#include +#include + +#include "../McCadTool/McCadConvertConfig.hxx" +//qiu for access() +#ifdef WIN32 +#include +#else //linux +#include +#endif + + +McCadInputModelData::McCadInputModelData() +{ + m_listModelData = new TopTools_HSequenceOfShape(); +} + + +bool McCadInputModelData::LoadSTEPModel(TCollection_AsciiString inputModel) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + + TCollection_AsciiString strDir = McCadConvertConfig::GetDirectory(); + strDir.LeftAdjust(); + strDir.RightAdjust(); + + if( strDir.IsEmpty()) // If the working directory is empty + { + TCollection_AsciiString message("_#_McCadVoidCellManager :: Working directory is empty"); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + return false; + } + + TCollection_AsciiString file_path = strDir + TCollection_AsciiString("/") + inputModel; +//qiu if (access(file_path.ToCString(),F_OK)) + if (access(file_path.ToCString(),0)) //0 is F_OK for linux, Existence only + { + return false; + } + + // read all files that fit the mask ( beginning with converted, ending on known extension ) + TCollection_AsciiString theCommandString; + theCommandString = TCollection_AsciiString("ls -1 ") + strDir + TCollection_AsciiString("/") + inputModel; + static unsigned int BUF_SIZE = 1024; + char command_string[80]; + strcpy(command_string, std::string( theCommandString.ToCString()).c_str() ); + FILE *files; +//qiu char in_buf[BUF_SIZE]; + char in_buf[1024]; + + //get list of files in given directory +//qiu +#ifdef WIN32 + files = _popen(command_string, "r"); +#else + files = popen(command_string, "r"); +#endif + + if (!files) { + perror("_#_McCadVoidCellManager :: Error in open file :"); + return false; + } + + // call AddFile for all files in current directory + while (fgets(in_buf, BUF_SIZE, files)) { + //handling line breaks + char *w; + w = strpbrk(in_buf, "\t\n"); + if (w) + *w='\0'; + + TCollection_AsciiString tmpName(in_buf); + TCollection_AsciiString fileFilter(tmpName); + fileFilter = fileFilter.Split( fileFilter.SearchFromEnd(".") -1 ); + if(! pluginManager->CheckExtension(fileFilter)) { + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: skipping file with unknown extension : "); + message.AssignCat(tmpName); + msgr->Message( message.ToCString(), McCadMessenger_WarningMsg ); + continue; + } + + cout << " -- " << tmpName.ToCString() << endl; + + //Append Files beginning with converted + if(tmpName.Search(".stp") >= 0 || tmpName.Search(".step") >= 0) { + if( !AddFile(tmpName) ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: Failed adding file : "); + message.AssignCat(tmpName); + msgr->Message( message.ToCString(), McCadMessenger_WarningMsg ); + } + } + else{ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: file doesn't contain \'converted\' prefix : "); + message.AssignCat(tmpName); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + } + } + return true; +} + + +bool McCadInputModelData::AddFile(const TCollection_AsciiString &file) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + + cout << " file : " << file.ToCString() << endl; + // extract units from first file (MM/CM) + bool m_isFirstFile = true; + + if(m_isFirstFile){ + m_isFirstFile = false; + ifstream readFile; + readFile.open(file.ToCString(), ios::in); + while(!readFile.eof()) { + char str[255]; + readFile.getline(str,255); + TCollection_AsciiString line(str); + if(line.Search("SI_UNIT")) { + // if(line.Search(".MILLI.")) + //m_parameters.units = McCadCSGGeom_MM; + //else + //m_parameters.units = McCadCSGGeom_CM; + // break; + } + } + } + + // get file filter + TCollection_AsciiString fileFilter(file); + fileFilter.Remove(1,fileFilter.SearchFromEnd(".")-1); + + // initialize import plugin and import geometry from file + if( !pluginManager->CheckFormat(fileFilter) ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: No file filter for file : "); + message.AssignCat(file); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + return false; + } + + McCadEXPlug_ExchangePlugin* exchangePlugin = pluginManager->GetPlugin(fileFilter); + exchangePlugin->SetFilename(file); + m_listModelData = exchangePlugin->Import(); + + if( m_listModelData->Length() < 1 ){ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: could not read shapes from file : "); + message.AssignCat(file); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + return false; + } + return true; +} + + +Handle_TopTools_HSequenceOfShape McCadInputModelData::GetModelData() +{ + return m_listModelData; +} diff --git a/src/MCCAD/McCadIOTools/McCadInputModelData.hxx b/src/MCCAD/McCadIOTools/McCadInputModelData.hxx new file mode 100644 index 0000000..b32b55f --- /dev/null +++ b/src/MCCAD/McCadIOTools/McCadInputModelData.hxx @@ -0,0 +1,21 @@ +#ifndef MCCADINPUTMODELDATA_HXX +#define MCCADINPUTMODELDATA_HXX + + +#include +#include + +class McCadInputModelData +{ +public: + McCadInputModelData(); + bool LoadSTEPModel(TCollection_AsciiString inputModel); + Handle_TopTools_HSequenceOfShape GetModelData(); + bool AddFile(const TCollection_AsciiString &file); + +private: + Handle_TopTools_HSequenceOfShape m_listModelData; // Add by Lei, 13/08/2012 + +}; + +#endif // MCCADINPUTMODELDATA_HXX diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_0.cxx new file mode 100644 index 0000000..ea664a4 --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif + + +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringAsciiString +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_0.cxx new file mode 100644 index 0000000..51df09b --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfAsciiStringReal_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif + + +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem Standard_Real +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringReal +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_0.cxx new file mode 100644 index 0000000..6bcd709 --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TDF_Label_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TDF_LabelMapHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfLabelAsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif + + +#define TheKey TDF_Label +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher TDF_LabelMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfLabelAsciiString +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_0.cxx new file mode 100644 index 0000000..879576c --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif +//McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString::~McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString", + sizeof(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString) Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString))) { + _anOtherObject = Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)((Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString::DynamicType() const +{ + return STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString) ; +} +//Standard_Boolean McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString::~Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString() {} +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringAsciiString +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_0.cxx new file mode 100644 index 0000000..bd35edc --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfAsciiStringReal_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif +//McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal::~McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal", + sizeof(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal) Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal))) { + _anOtherObject = Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)((Handle(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal::DynamicType() const +{ + return STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal) ; +} +//Standard_Boolean McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal::~Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal() {} +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem Standard_Real +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringReal +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_0.cxx new file mode 100644 index 0000000..7d5cc96 --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_0.cxx @@ -0,0 +1,105 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _TDF_Label_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TDF_LabelMapHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapOfLabelAsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif +//McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString::~McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString", + sizeof(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString) Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString))) { + _anOtherObject = Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)((Handle(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString::DynamicType() const +{ + return STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString) ; +} +//Standard_Boolean McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString::~Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString() {} +#define TheKey TDF_Label +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher TDF_LabelMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfLabelAsciiString +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfAsciiStringAsciiString_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfAsciiStringAsciiString_0.cxx new file mode 100644 index 0000000..5e4577d --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfAsciiStringAsciiString_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString_HeaderFile +#include +#endif + + +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringAsciiString +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfAsciiStringReal_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfAsciiStringReal_0.cxx new file mode 100644 index 0000000..b606a2a --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfAsciiStringReal_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_MapAsciiStringHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal_HeaderFile +#include +#endif + + +#define TheKey TCollection_AsciiString +#define TheKey_hxx +#define TheItem Standard_Real +#define TheItem_hxx +#define Hasher McCadMDReader_MapAsciiStringHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfAsciiStringReal +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfAsciiStringReal_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfAsciiStringReal +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfLabelAsciiString_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfLabelAsciiString_0.cxx new file mode 100644 index 0000000..b6eadbe --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_DataMapOfLabelAsciiString_0.cxx @@ -0,0 +1,62 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TDF_Label_HeaderFile +#include +#endif +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif +#ifndef _TDF_LabelMapHasher_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif +#ifndef _McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString_HeaderFile +#include +#endif + + +#define TheKey TDF_Label +#define TheKey_hxx +#define TheItem TCollection_AsciiString +#define TheItem_hxx +#define Hasher TDF_LabelMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMDReader_DataMapIteratorOfDataMapOfLabelAsciiString +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString +#define TCollection_DataMapNode_Type_() McCadMDReader_DataMapNodeOfDataMapOfLabelAsciiString_Type_() +#define TCollection_DataMap McCadMDReader_DataMapOfLabelAsciiString +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_MapAsciiStringHasher_0.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_MapAsciiStringHasher_0.cxx new file mode 100644 index 0000000..798f386 --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_MapAsciiStringHasher_0.cxx @@ -0,0 +1,34 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _TCollection_AsciiString_HeaderFile +#include +#endif + + +#define Key TCollection_AsciiString +#define Key_hxx +#define TCollection_MapHasher McCadMDReader_MapAsciiStringHasher +#define TCollection_MapHasher_hxx +#include + diff --git a/src/MCCAD/McCadMDReader/McCadMDReader_Reader.cxx b/src/MCCAD/McCadMDReader/McCadMDReader_Reader.cxx new file mode 100644 index 0000000..f42efa2 --- /dev/null +++ b/src/MCCAD/McCadMDReader/McCadMDReader_Reader.cxx @@ -0,0 +1,262 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadMDReader_Reader::McCadMDReader_Reader(){ + Init(); +} + + +McCadMDReader_Reader::McCadMDReader_Reader(const Handle_TDocStd_Document& theTDoc) { + Init(); + ReadTDoc(theTDoc); +} + + +void McCadMDReader_Reader::Init() { + myMCardNumbers = new TColStd_HSequenceOfInteger; + myFileName = TCollection_AsciiString("none"); + myHasMCard = Standard_False; +} + + +//parse through a input file to extract material,name,density,MCARD (latter not yet implemented) +Standard_Boolean McCadMDReader_Reader::ReadFile(const TCollection_AsciiString& theFileName) { + ifstream inFile(theFileName.ToCString()); + if (!inFile){ + cout << "Cannot open file :" << theFileName.ToCString() << endl; + return Standard_False; + } + myFileName = theFileName; + + while(inFile) { + char str[255]; + inFile.getline(str,255); + TCollection_AsciiString iString(str); + + // skip empty line + if(iString.IsEmpty()) + continue; + + // skip comment + iString.LeftAdjust(); + iString.RightAdjust(); + if(iString.Value(1) == '#') + continue; + + //substitute tabs with spaces + if(iString.Search("\t") > 0) { + iString.ChangeAll('\t', ' '); + } + + // invalid single words are discarded + if(iString.Search(" ") == -1 ) { + cout << "invalid line is skipped\n"; + continue; + } + + // eat string from behind, so the file name is allowed to contain spaces + //Extract Density + TCollection_AsciiString DenString, MatString; + DenString = iString.Split(iString.SearchFromEnd(" ")); + DenString.LeftAdjust(); + DenString.RightAdjust(); + if(!DenString.IsRealValue()){ + cout << "Real value expected : " << DenString.ToCString() << endl; + continue; + } + Standard_Real theDen(0.0); + theDen = DenString.RealValue(); + + if(iString.Search(" ") < 1) { + cout << "invalid line skipped\n "; + continue; + } + + //Extract Material Number + iString.RightAdjust(); + MatString = iString.Split(iString.SearchFromEnd(" ")); + MatString.LeftAdjust(); + MatString.RightAdjust(); + iString.RightAdjust(); + + if(!MatString.IsIntegerValue()) { + cout << "Integer value expected : " << MatString.ToCString() << endl; + continue; + } + + iString.RemoveAll('\\', Standard_False); + + // bind material and density to map + if(myMatMap.IsBound(iString)){ + cout << iString.ToCString() << " is already bound...\n"; + continue; + } + myDensMap.Bind(iString, theDen); + myMatMap.Bind(iString, MatString.IntegerValue()); + } + + if(myMatMap.Extent()<1) + return Standard_False; + + return Standard_True; +} + +Standard_Real McCadMDReader_Reader::GetDensity(const TCollection_AsciiString& theName) { + if(myDensMap.IsBound(theName)) + return myDensMap(theName); + else { + TCollection_AsciiString decompName(theName); + if(decompName.Search("_")) { + decompName.Remove(decompName.SearchFromEnd("_"),decompName.Length()-decompName.SearchFromEnd("_")+1); + } + if(myDensMap.IsBound(decompName)) + return myDensMap(decompName); + } + return 0.0; +} + +Standard_Integer McCadMDReader_Reader::GetMaterial(const TCollection_AsciiString& theName) { + if(myMatMap.IsBound(theName)) + return myMatMap(theName); + else { + TCollection_AsciiString decompName(theName); + if(decompName.Search("_")) { + decompName.Remove(decompName.SearchFromEnd("_"),decompName.Length()-decompName.SearchFromEnd("_")+1); + } + if(myMatMap.IsBound(decompName)) + return myMatMap(decompName); + } + return 0; +} + + +TCollection_AsciiString McCadMDReader_Reader::GetFileName(){ + return myFileName; +} + +void McCadMDReader_Reader::SetDensity(const TCollection_AsciiString& theName, const Standard_Real& theDens) { + myDensMap.Bind(theName, theDens); +} + + +void McCadMDReader_Reader::SetMaterial(const TCollection_AsciiString& theName, const Standard_Integer& theMat) { + if(myMatMap.IsBound(theName)) + myMatMap.UnBind(theName); + myMatMap.Bind(theName, theMat); +} + + +void McCadMDReader_Reader::SetMCard(const Standard_Integer& theMat, const TCollection_AsciiString& theMCard){ + if(myMCardMap.IsBound(theMat)) + myMCardMap.UnBind(theMat); + + myMCardMap.Bind(theMat, theMCard); + myHasMCard = Standard_True; +} + +void McCadMDReader_Reader::GetMCard(const Standard_Integer& theMat, TCollection_AsciiString& theMCard) { + if(!myHasMCard){ + TCollection_AsciiString mtrlNm(theMat); + mtrlNm += " undefined material"; + theMCard = mtrlNm; + return ; + } + + if(myMCardMap.IsBound(theMat)) + theMCard = myMCardMap(theMat); + else + theMCard = TCollection_AsciiString("C No such material defined"); +} + + +Standard_Boolean McCadMDReader_Reader::HasMCard(){ + return myHasMCard; +} + + +void McCadMDReader_Reader::ClearMCard(){ + myHasMCard = Standard_False; +} + + +void McCadMDReader_Reader::ReadTDoc(const Handle_TDocStd_Document& theTDoc){ + McCadXCAF_TDocShapeLabelIterator it(theTDoc); + + for( ; it.More(); it.Next()) { + TDF_Label curL = it.Current(); + + Handle(TDataStd_TreeNode) aTreeNode; + + if(curL.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), aTreeNode)) { + if(aTreeNode->HasFather()) { + TDF_Label matLab = aTreeNode->Father()->Label(); + Handle(TDataStd_Name) curName; + TCollection_AsciiString theName; + if(curL.FindAttribute(TDataStd_Name::GetID(),curName)) + theName = TCollection_AsciiString(curName->Get()); + + Handle(TDataStd_Name) mName; + Handle(TDataStd_Real) mDens; + Standard_Real matDens(0.0); + Handle(TDataStd_AsciiString) mMCard; + TCollection_AsciiString matMCard; + + if(matLab.FindAttribute(TDataStd_Real::GetID(),mDens)) + matDens = mDens->Get(); + if(matLab.FindAttribute(TDataStd_AsciiString::GetID(),mMCard)) + matMCard = mMCard->Get(); + + Standard_Integer matNo = ExtractMCardNumber(matMCard); + + SetMaterial(theName,matNo); + SetDensity(theName,matDens); + SetMCard(matNo,matMCard); + myMCardNumbers->Append(matNo); + } + }// else VOIDS + } +} + +Standard_Integer McCadMDReader_Reader::ExtractMCardNumber(const TCollection_AsciiString& theMCard) { + Standard_Integer theNo(0); + TCollection_AsciiString evalMCard(theMCard); + evalMCard.UpperCase(); + evalMCard.LeftAdjust(); + Standard_Integer firstM = evalMCard.Search("M"); + + if(firstM < 1) // not an MCard + return 0; + + Standard_Boolean comment=Standard_True; + + if(firstM > 1) { + while(comment) { + if(evalMCard.Search("C") != 1) //not a comment? that's strange, if not to say INVALID + return 0; + if(evalMCard.Search("\n") > 0) + evalMCard = evalMCard.Split(evalMCard.Search("\n")); + evalMCard.LeftAdjust(); + if(evalMCard.Search("M") == 1) + break; + } + } + + evalMCard.Remove(1,1); + evalMCard.Split(evalMCard.Search(" ")-1); + + if(evalMCard.IsIntegerValue()) + theNo = evalMCard.IntegerValue(); + + return theNo; +} + +Handle(TColStd_HSequenceOfInteger) McCadMDReader_Reader::GetMCardNumbers() { + return myMCardNumbers; +} diff --git a/src/MCCAD/McCadMcRead/McCadMcRead.cxx b/src/MCCAD/McCadMcRead/McCadMcRead.cxx new file mode 100644 index 0000000..d4e4d1e --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead.cxx @@ -0,0 +1,101 @@ +#include +#include +#include + +Standard_Boolean McCadMcRead::ExtractInt(TCollection_AsciiString& sIn,Standard_Integer& nVal) +{ + sIn.LeftAdjust(); + Standard_Integer i = sIn.Search(" "); + TCollection_AsciiString theRest = sIn.Split(i); + if (sIn.Length() == 0) return false; + nVal = sIn.IntegerValue(); + sIn =theRest; + return true; + +} + +Standard_Boolean McCadMcRead::ExtractInt(TCollection_AsciiString& sIn,Standard_Integer& nStart,Standard_Integer& nVal) +{ + if(nStart >= sIn.Length()) + { + return false; + } + TCollection_AsciiString theRest = sIn.Split(nStart); + if(! ExtractInt(theRest,nVal)) + { + sIn = sIn + theRest; + return false; + } + sIn = sIn + theRest; + return true; +} + +Standard_Boolean McCadMcRead::ExtractReal(TCollection_AsciiString& sIn,Standard_Real& nVal) +{ + + sIn.LeftAdjust(); + Standard_Integer i = sIn.Search(" "); + TCollection_AsciiString theRest = sIn.Split(i); + if (sIn.Length() == 0) return false; + nVal = sIn.RealValue(); + sIn =theRest; + return true; + + +} + +Standard_Boolean McCadMcRead::ExtractParenthesisPair(TCollection_AsciiString& sIn,Standard_Integer& nStart, +TCollection_AsciiString& sOut) +{ + if(nStart<0 || nStart >= sIn.Length()) //nStart should between [0,sIn.length()]; + { + sOut.Clear(); + return true; + } + Standard_Integer iBegin = sIn.Search("("); + Standard_Integer iEnd = sIn.Search(")"); + sOut = sIn.SubString(iBegin,iEnd); + sIn.Remove(iBegin,iEnd-iBegin); + return true; + +} + +Standard_Boolean McCadMcRead::ExtractFloat(TCollection_AsciiString& sIn,Standard_Integer& nStart,Standard_Real& fVal) +{ + if(sIn.Length() <= nStart) //Start Position exceed end of the string + { + return false; + } + Standard_Integer i = sIn.Search(" "); + TCollection_AsciiString theRest = sIn.Split(i); + if (sIn.Length() == 0) return false; + fVal = sIn.RealValue(); + sIn =sIn + theRest; + return true; +} + +Standard_Boolean McCadMcRead::ExtractFloat(TCollection_AsciiString& sIn,Standard_Integer& nStart, +Handle(TColStd_HSequenceOfReal)& fValVec) +{ + if(sIn.Length() <= nStart) //Start Position exceed end of the string + { + return false; + } + Standard_Real fVal; + while(ExtractFloat(sIn,nStart,fVal)) + { + fValVec->Append(fVal); + } + return true; +} + +void McCadMcRead::TrimLeft(TCollection_AsciiString& sIn) +{ + sIn.LeftAdjust(); +} + +void McCadMcRead::TrimRight(TCollection_AsciiString& sIn) +{ + sIn.RightAdjust(); +} + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_Cell.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_Cell.cxx new file mode 100644 index 0000000..6b92a16 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_Cell.cxx @@ -0,0 +1,376 @@ +#include +#include + +McCadMcRead_Cell::McCadMcRead_Cell() +{ + myIsPseudo = false; + + myTRCLNumber = 0; + myHaveLat = false; + myHaveLike = false; + myHaveU = false; + myHaveFill = false; + myHaveTRCL = false; + myHaveMacro = false; + + myLat = 0; + myLike= 0; + myU = 0; + myFillSeq = new McCadMcRead_HSequenceOfFill; + myFillPlaceSeq = new TColgp_HSequenceOfPnt; + + myLikeNum = 0; + myLikePtr = NULL; + + myCompsNum = new TColStd_HSequenceOfInteger; + myCompPtrs = new McCadMcRead_HSequenceOfCellPtr; + + myPseudoNum = 0; + + myInFixCSG = new TColStd_HSequenceOfAsciiString; + myPostFixCSG = new TColStd_HSequenceOfAsciiString; + myIsInfiniteLattice = Standard_False; + + myCSGHasChanged = true; + + // myTrsf McCadCSGGeom_Transformation; + +} + +McCadMcRead_Cell::McCadMcRead_Cell(const Standard_Integer theCNum,const Standard_Integer theMNum,const Standard_Real theDensity): + McCadCSGGeom_Cell(theCNum,theMNum,theDensity) +{ + myIsPseudo = false; + myTRCLNumber = 0; + myHaveLat = false; + myHaveLike = false; + myHaveU = false; + myHaveFill = false; + myHaveTRCL = false; + myHaveMacro = false; + + myLat = 0; + myLike= 0; + myU = 0; + myFillSeq = new McCadMcRead_HSequenceOfFill; + + myLikeNum = 0; + myLikePtr = NULL; + + myCompsNum = new TColStd_HSequenceOfInteger; + myCompPtrs = new McCadMcRead_HSequenceOfCellPtr; + + myPseudoNum = 0; + + myInFixCSG = new TColStd_HSequenceOfAsciiString; + myPostFixCSG = new TColStd_HSequenceOfAsciiString; + myIsInfiniteLattice = Standard_False; + + myCSGHasChanged = true; +} + +void McCadMcRead_Cell::SetPseudo(const Standard_Boolean thePseudo) +{ + myIsPseudo = thePseudo; + +} + +Standard_Boolean McCadMcRead_Cell::IsPseudo() const +{ + return myIsPseudo; +} + +void McCadMcRead_Cell::SetHaveTRCL(const Standard_Boolean theIndic) +{ + myHaveTRCL = theIndic; + +} + +Standard_Boolean McCadMcRead_Cell::IsTRCL() const +{ + return myHaveTRCL; +} + +void McCadMcRead_Cell::SetTRCLNumber(const Standard_Integer theCount) +{ + myTRCLNumber = theCount; +} + +Standard_Integer McCadMcRead_Cell::GetTRCLNumber() const +{ + + return myTRCLNumber; + +} + +void McCadMcRead_Cell::SetHaveLat(const Standard_Boolean theIndic) +{ + + myHaveLat = theIndic; + +} +void McCadMcRead_Cell::SetLat(const Standard_Integer theNum) +{ + + myLat = theNum; + +} +Standard_Integer McCadMcRead_Cell::GetLatNum() const +{ + return myLat; +} + +Standard_Boolean McCadMcRead_Cell::IsLat() const +{ + return myHaveLat; +} + +void McCadMcRead_Cell::SetHaveLike(const Standard_Boolean theIndic) +{ + myHaveLike = theIndic; +} + +Standard_Integer McCadMcRead_Cell::GetLikeNum() const +{ + return myLikeNum; +} + +McCadMcRead_CellPtr McCadMcRead_Cell::GetLikePtr() const +{ + return myLikePtr; +} + +void McCadMcRead_Cell::SetLikeNum(const Standard_Integer theIndex) +{ + + myLikeNum = theIndex; + +} + +void McCadMcRead_Cell::SetLikePtr(const McCadMcRead_CellPtr& thePtr) +{ + myLikePtr = thePtr; +} + +Standard_Boolean McCadMcRead_Cell::IsLike() const +{ + + return myHaveLike; + +} + +void McCadMcRead_Cell::SetHaveU(const Standard_Boolean theIn) +{ + myHaveU = theIn; + +} + +void McCadMcRead_Cell::SetUNum(const Standard_Integer theIndex) +{ + + myU = theIndex; +} +Standard_Integer McCadMcRead_Cell::GetUNum() const +{ + + return myU; + +} + + + +void McCadMcRead_Cell::SetPseudoNum(const Standard_Integer theIndex) +{ + myPseudoNum = theIndex; +} + +Standard_Integer McCadMcRead_Cell::GetPseudoNum() const +{ + return myPseudoNum; +} + +Standard_Boolean McCadMcRead_Cell::IsU() const +{ + return myHaveU; +} + +void McCadMcRead_Cell::SetHaveFill(const Standard_Boolean theIn) +{ + myHaveFill = theIn; +} + +void McCadMcRead_Cell::SetFill(const Handle(McCadMcRead_Fill)& theFiller) +{ + + myFill = theFiller; + +} + +Standard_Boolean McCadMcRead_Cell::IsFill() const +{ + + return myHaveFill; + +} + +void McCadMcRead_Cell::SetHaveMacro(const Standard_Boolean theIn) +{ + + myHaveMacro = theIn; + +} + +Standard_Boolean McCadMcRead_Cell::HaveMacro() const +{ + + return myHaveMacro; + +} + +void McCadMcRead_Cell::SetMacroIndex(const Handle(TColStd_HSequenceOfInteger)& theInSeq) +{ + + myCompsNum->Append(theInSeq); + +} + +void McCadMcRead_Cell::SetMacroPtrs(const Handle(McCadMcRead_HSequenceOfCellPtr)& theInPtrSeq) +{ + + myCompPtrs->Append(theInPtrSeq); + +} + +Handle(TColStd_HSequenceOfInteger) McCadMcRead_Cell::GetMacroIndex() const +{ + + return myCompsNum; + +} + +Handle(McCadMcRead_HSequenceOfCellPtr) McCadMcRead_Cell::GetMacroPtrs() const +{ + + return myCompPtrs; + +} + +void McCadMcRead_Cell::SetInFixCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG) +{ + + myInFixCSG->Append(theCSG); + +} + +Handle(TColStd_HSequenceOfAsciiString) McCadMcRead_Cell::GetInFixCSG() const +{ + + return myInFixCSG; + +} + +void McCadMcRead_Cell::SetPostFixCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG) +{ + myPostFixCSG->Clear(); + myPostFixCSG->Append(theCSG); +} + +Handle(TColStd_HSequenceOfAsciiString) McCadMcRead_Cell::GetPostFixCSG() +{ + if(myCSGHasChanged) // recompute postfix csg + { + TCollection_AsciiString tmpStr; + for(int i=1; i<= myCSG->Length(); i++) + { + tmpStr.InsertAfter(tmpStr.Length(), myCSG->Value(i)); + tmpStr.InsertAfter(tmpStr.Length()," "); + } + + McCadBoolExp_PostFixer thePostFixer; + thePostFixer.Init(tmpStr); + + myPostFixCSG = thePostFixer.GetPostFix(); + + myCSGHasChanged = false; + } + + return myPostFixCSG; +} + +Handle(McCadMcRead_Fill) McCadMcRead_Cell::GetFill() const +{ + return myFill; + +} + +Handle(McCadMcRead_HSequenceOfFill) McCadMcRead_Cell::GetFillSeq() const +{ + return myFillSeq; +} + +void McCadMcRead_Cell::SetFillSeq(const Handle(McCadMcRead_HSequenceOfFill)& theFillerSeq) +{ + myFillSeq->Append(theFillerSeq); +} + +Handle(TColgp_HSequenceOfPnt) McCadMcRead_Cell::GetFillPlaceSeq() const +{ + return myFillPlaceSeq; +} + +void McCadMcRead_Cell::SetFillPlaceSeq(const Handle(TColgp_HSequenceOfPnt)& thePlaceSeq) +{ + + myFillPlaceSeq->Append(thePlaceSeq); + +} + +void McCadMcRead_Cell::SetTrsf(const Handle(McCadCSGGeom_Transformation)& theTrsf) +{ + myTrsf = theTrsf; + +} + +Handle(McCadCSGGeom_Transformation) McCadMcRead_Cell::GetTrsf() const +{ + return myTrsf; +} + + +void McCadMcRead_Cell::SetInfiniteLattice() +{ + myIsInfiniteLattice = Standard_True; +} + +Standard_Boolean McCadMcRead_Cell::IsInfiniteLattice() +{ + return myIsInfiniteLattice; +} + + +void McCadMcRead_Cell::SetOuterCSG(Handle_TColStd_HSequenceOfAsciiString& csg) +{ + myOuterCSG = csg; +} + +Handle_TColStd_HSequenceOfAsciiString McCadMcRead_Cell::GetOuterCSG() +{ + return myOuterCSG; +} + +void McCadMcRead_Cell::SetLatFillBoundary(Handle_TColStd_HSequenceOfAsciiString& csg) +{ + myLatFillBoundary = csg; +} + +Handle_TColStd_HSequenceOfAsciiString McCadMcRead_Cell::GetLatFillBoundary() +{ + return myLatFillBoundary; +} + + +void McCadMcRead_Cell::SetCSG(const Handle(TColStd_HSequenceOfAsciiString)& theCSG, bool updatePostFixCSG) +{ + myCSGHasChanged = updatePostFixCSG; + myCSG = theCSG; +} diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_CellBuilder.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_CellBuilder.cxx new file mode 100644 index 0000000..04adfa3 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_CellBuilder.cxx @@ -0,0 +1,1074 @@ +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +McCadMcRead_CellBuilder::McCadMcRead_CellBuilder() +{ + + myCell = new McCadMcRead_Cell; + NotDone(); + +} + + +Standard_Boolean McCadMcRead_CellBuilder::IsDone() const +{ + return myIsDone; +} + + +void McCadMcRead_CellBuilder::Done() +{ + myIsDone = Standard_True; +} + + +void McCadMcRead_CellBuilder::NotDone() +{ + myIsDone = Standard_False; +} + + +void McCadMcRead_CellBuilder::BuildCell(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + if (!Parse(sDesc)) + { + msgr->Message("_#_McCadMcRead_CellBuilder.cxx :: Can not build Cell for this Card : ", + McCadMessenger_ErrorMsg); + msgr->Message(sDesc.ToCString(), McCadMessenger_ErrorMsg); + NotDone(); + return; + } + + + + Done(); +} + + +Standard_Boolean McCadMcRead_CellBuilder::Parse(const TCollection_AsciiString& sDesc) +{ + // cout << "1\n"; + if (!ExtractNo(sDesc)) //Extract Cell No; + return false; + + // cout << "2\n"; + if (!ExtractLIKE(sDesc)) //Extract like but card; + return false; + + // cout << "3\n"; + if (!myCell->IsLike()) + if (!ExtractMat(sDesc)) + return false; + + // cout << "4\n"; + if (!ExtractTRCL(sDesc)) + return false; + + // cout << "5\n"; + if (!ExtractUCard(sDesc)) + return false; + + cout << "6\n"; + if (!ExtractFill(sDesc)) // pure fill cards are extracted !! + return false; + + cout << "7\n"; + if (!ExtractLatFill(sDesc)) // lat with fill cards are extracted !! + return false; + + cout << "8\n"; + if (!myCell->IsLike()) + if (!ExtractBOOLEXPR(sDesc)) + return false; + // cout << "...done\n"; + + return true; +} + + +Standard_Boolean McCadMcRead_CellBuilder::ExtractNo(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search(" ")); + + Standard_Integer num = tmpStr.IntegerValue(); + if (num <= 0) + { + TCollection_AsciiString errormsg("_#_McCadMcRead_CellBuilder.cxx :: The cell number for this Card is less than 0! : "); + errormsg += sDesc; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else + myCell->SetCellNumber(num); + + + + return true; +} + +Standard_Boolean McCadMcRead_CellBuilder::ExtractMat(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search(" ")); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + TCollection_AsciiString sEnd2 = sEnd.Split(sEnd.Search(" ")); + + + // sEnd is now the mat number + int iMat = sEnd.IntegerValue(); + if (iMat < 0) + { + TCollection_AsciiString errormsg("_#_McCadMcRead_CellBuilder.cxx :: The material number for this Card is less than 0! : "); + errormsg += sDesc; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else if (iMat > 0 ) // we have density + { + myCell->SetMaterialNumber(iMat); + // we go for the density + sEnd.Clear(); + sEnd2.LeftAdjust(); + sEnd2.RightAdjust(); + sEnd = sEnd2.Split(sEnd2.Search(" ")); + // sEnd2 is now the density number + if (!sEnd2.IsRealValue()) + { +// msgr << "Missing density for material cell ... setting density to 1e-9 for cell : "; +// msgr << myCell->GetCellNumber(); + myCell->SetDensity(0.000000001); + } + else + { + if (sEnd2.RealValue() == 0 ) + { + TCollection_AsciiString warningmsg("Warning: The material density is 0 for cell : "); + warningmsg += myCell->GetCellNumber(); + msgr->Message(warningmsg.ToCString(), McCadMessenger_WarningMsg); + } + myCell->SetDensity(sEnd2.RealValue()); + } + } + else // iMat = 0 void case + myCell->SetMaterialNumber(iMat); + + + + return true; +} + + +Standard_Boolean McCadMcRead_CellBuilder::ExtractTRCL(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + int iTRCL = tmpStr.Search("TRCL"); + + if (iTRCL > 0) + { + myCell->SetHaveTRCL(true); + // we get either num or matrix + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("TRCL")+4); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + + TCollection_AsciiString sEnd3; + // sEnd3 is a number or ( + if (sEnd.Search("(") < 0) + { + // we have a number here + if(sEnd.Search(" ") > 0) + sEnd3 = sEnd.SubString(1, sEnd.Search(" ")); + else + sEnd3 = sEnd; + + sEnd3.LeftAdjust(); + sEnd3.RightAdjust(); + + if (sEnd3.IntegerValue() <= 0) + { + TCollection_AsciiString warningmsg("TRCL number for this Card is less than 0 for cell : "); + warningmsg += myCell->GetCellNumber(); + msgr->Message(warningmsg.ToCString(), McCadMessenger_WarningMsg); + + return false; + } + else + { + myCell->SetTRCLNumber(sEnd3.IntegerValue()); + + return true; + } + } + else // we have a matrix + { + sEnd3 = sEnd.SubString(sEnd.Search("(")+1,sEnd.Search(")")-1); + // sEnd3 contains the vector + if(sDesc.Search("*TRCL") > 0 ) + sEnd3.InsertBefore(1, TCollection_AsciiString("*TR1000 ")); + else + sEnd3.InsertBefore(1, TCollection_AsciiString("TR1000 ")); + + // bulid the matrix + McCadMcRead_TrsfBuilder TrBuilder; + TrBuilder.BuildTrsf(sEnd3); + myCell->SetTRCLNumber(1000); // 1000 is a nonnumber of TR cards + myCell->SetTrsf(TrBuilder.GetTrsf()); + + return true; + } + } + else myCell->SetHaveTRCL(false); + + + + return true; +} + +Standard_Boolean McCadMcRead_CellBuilder::ExtractBOOLEXPR(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + // extract macros first! + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + TCollection_AsciiString sEnd=(" "); + + if (tmpStr.Search("$") > 0) + sEnd = tmpStr.Split(tmpStr.Search("$")-1); + if (tmpStr.Search("IMP") > 0) + sEnd = tmpStr.Split(tmpStr.Search("IMP")-1); + if (tmpStr.Search("VOL") > 0) + sEnd = tmpStr.Split(tmpStr.Search("VOL")-1); + if (tmpStr.Search("PWT") > 0) + sEnd = tmpStr.Split(tmpStr.Search("PWT")-1); + if (tmpStr.Search("EXT") > 0) + sEnd = tmpStr.Split(tmpStr.Search("EXT")-1); + if (tmpStr.Search("FCL") > 0) + sEnd = tmpStr.Split(tmpStr.Search("FCL")-1); + if (tmpStr.Search("WWN") > 0) + sEnd = tmpStr.Split(tmpStr.Search("WWN")-1); + if (tmpStr.Search("DXC") > 0) + sEnd = tmpStr.Split(tmpStr.Search("DXC")-1); + if (tmpStr.Search("NONU") > 0) + sEnd = tmpStr.Split(tmpStr.Search("NONU")-1); + if (tmpStr.Search("PD") > 0) + sEnd = tmpStr.Split(tmpStr.Search("PD")-1); + if (tmpStr.Search("TMP") > 0) + sEnd = tmpStr.Split(tmpStr.Search("TMP")-1); + if (tmpStr.Search("U") > 0) + sEnd = tmpStr.Split(tmpStr.Search("U")-1); + if (tmpStr.Search("TRCL") > 0) + sEnd = tmpStr.Split(tmpStr.Search("TRCL")-1); + if (tmpStr.Search("LAT") > 0) + sEnd = tmpStr.Split(tmpStr.Search("LAT")-1); + if (tmpStr.Search("FILL") > 0) + sEnd = tmpStr.Split(tmpStr.Search("FILL")-1); + + sEnd.Clear(); + sEnd = tmpStr.Split(tmpStr.Search(" ")); //tmpStr is cellnum + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + TCollection_AsciiString sEnd2 = sEnd.Split(sEnd.Search(" ")); // sEnd is matNum + sEnd2.LeftAdjust(); + sEnd2.RightAdjust(); + tmpStr.Clear(); + tmpStr = sEnd2; + if (sEnd.IntegerValue() > 0) // we have density + { + // we go for the density + tmpStr.Clear(); + tmpStr = sEnd2.Split(sEnd2.Search(" ")); + // sEnd2 is density number + } + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + // at this point we should have only geometry discription on the card tmpStr. + // we check this + int i =1; + while (i <= tmpStr.Length()) + { + Standard_Character aC = tmpStr.Value(i); + if (isdigit(aC) || isspace(aC) || (aC == '-') || (aC == '+') || (aC == ':') || (aC == '#') || (aC == '(') || (aC == ')') || aC == '*') + { + i++; + continue; + } + else + { + TCollection_AsciiString errormsg("Wrong cell geometry description !! : "); + errormsg += tmpStr; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + } + //////////////////////////////////////////////////////////////////////////////////////// + // macro cell extraction + // #num is a macro + sEnd.Clear(); + sEnd2.Clear(); + sEnd = tmpStr; + + if(sEnd.Search("#") > 0 ) + { + Handle(TColStd_HSequenceOfInteger) CompsNum = new TColStd_HSequenceOfInteger; + while (sEnd.Search("#") > 0 ) + { + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + sEnd2 = sEnd.Split(sEnd.Search("#")); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + sEnd2.LeftAdjust(); + sEnd2.RightAdjust(); + if(sEnd2.Search(" ") < 0 && sEnd2.IsIntegerValue() ) //single word + { + // cout << "TEEEEEEE" << endl; + // cout << sEnd2.ToCString() << endl; + CompsNum->Append(sEnd2.IntegerValue()); + sEnd.Remove(sEnd.Search("#"),1); + tmpStr.Clear(); + tmpStr = sEnd; + } + else + { + sEnd = sEnd2.Split(sEnd2.Search(" ")); + if (sEnd2.IsIntegerValue()) // we have a number + { + CompsNum->Append(sEnd2.IntegerValue()); + sEnd2.Clear(); + sEnd.Clear(); + sEnd = tmpStr; + sEnd2 = sEnd.Split(sEnd.Search("#")); + sEnd.Remove(sEnd.Search("#"),1); + sEnd2.LeftAdjust(); + sEnd2.RightAdjust(); + TCollection_AsciiString sEnd3 = sEnd2.Split(sEnd2.Search(" ")); + tmpStr.Clear(); + tmpStr = sEnd + " " + sEnd3; + sEnd = tmpStr; + } + else // we have a bracket we mark the comp. sign + { + int id1 = tmpStr.Search("#"); + tmpStr.Remove(id1,1); + tmpStr.Insert(id1,"!"); + sEnd = tmpStr; + } + } + sEnd2.Clear(); + } + //replace the exclamation mark + ///////////////////////////////////////////////////////////////////// + while (tmpStr.Search("!") > 0 ) + { + int id1 = tmpStr.Search("!"); + tmpStr.Remove(id1,1); + tmpStr.Insert(id1,"#"); + } + if(CompsNum->Length() > 0 ) + { + myCell->SetMacroIndex(CompsNum); + myCell->SetHaveMacro(true); + } + else + { + myCell->SetHaveMacro(false); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // post fix boolean forms + if(tmpStr.Length()<1) + return Standard_True; + + McCadBoolExp_PostFixer thePostFixer; + thePostFixer.Init(tmpStr); + if(!thePostFixer.IsDone()) + { + TCollection_AsciiString errormsg("_#_McCadMcRead_CellBuilder.cxx :: Generating postfix CSG expression failed for the following input: "); + errormsg += tmpStr; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + Handle(TColStd_HSequenceOfAsciiString) theInPutCSG = thePostFixer.GetInput(); + myCell->SetCSG(theInPutCSG); // this is the raw mcnp csg!! + + //cout << "THE INPUT CSG : "; for(int i=1; i<=theInPutCSG->Length(); i++) cout << theInPutCSG->Value(i) << " "; cout << endl; + Handle(TColStd_HSequenceOfAsciiString) theInFixCSG = thePostFixer.GetInFix(); + myCell->SetInFixCSG(theInFixCSG); // this is the raw csg in infix with intersection added!! + Handle(TColStd_HSequenceOfAsciiString) thePostFixCSG = thePostFixer.GetPostFix(); + myCell->SetPostFixCSG(thePostFixCSG); + + + + return true; +} + + +Standard_Boolean McCadMcRead_CellBuilder::ExtractLIKE(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + int iLike = tmpStr.Search("LIKE"); + + if (iLike > 0) // we have like but + { + myCell->SetHaveLike(true); + TCollection_AsciiString sEnd = tmpStr.SubString( + tmpStr.Search("LIKE")+4, tmpStr.Search("BUT")-1); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + int num = sEnd.IntegerValue(); + if (num <= 0) + { + TCollection_AsciiString errormsg("The LIKE cell number is less than 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else myCell->SetLikeNum(num); + // set also MATnum and RHO here if available !! + sEnd.Clear(); + + TCollection_AsciiString tmptmpStr = tmpStr; + + if (tmpStr.Search("MAT") > 0 ) // mnemonics is MAT = num and RHO = num + { + sEnd = tmpStr.Split(tmpStr.Search("MAT")+3); + sEnd.LeftAdjust(); sEnd.RightAdjust(); + // now the first element should be = sign. + + if(tmpStr.Search("=") < 0 ) + { + TCollection_AsciiString errormsg("MAT number of the LIKE_BUT Card not available for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else + { + TCollection_AsciiString sStr; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + sStr = sEnd; + + if(sEnd.Search(" ") > 0) + sStr = sStr.SubString(1, sEnd.Search(" ")); + + if (sStr.IntegerValue() <=0) + { + TCollection_AsciiString errormsg("MAT number of the LIKE_BUT Card is less than 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else + myCell->SetMaterialNumber(sStr.IntegerValue()); + } + } + else + myCell->SetMaterialNumber(-1); + + // RHO + sEnd.Clear(); + tmpStr = tmptmpStr; + + if (tmpStr.Search("RHO") > 0) // mnemonics is MAT = num and RHO = num + { + sEnd = tmpStr.Split(tmpStr.Search("RHO")+3); + sEnd.LeftAdjust(); sEnd.RightAdjust(); + // now the first element should be = sign. + if(tmpStr.Search("=") < 0 ) + { + TCollection_AsciiString errormsg("RHO number of the LIKE_BUT Card is not available for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(),McCadMessenger_ErrorMsg); + + return false; + } + else + { + TCollection_AsciiString sStr=sEnd; + if(sEnd.Search(" ") > 0) + sStr = sStr.SubString(1, sEnd.Search(" ")); + + if (sStr.RealValue() == 0) + { + TCollection_AsciiString errormsg("MAT number of the LIKE_BUT Card is equal to 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else + myCell->SetDensity(sStr.RealValue()); + } + } + else + myCell->SetDensity(0.0); + } + else + { + + myCell->SetHaveLike(false); + return true; + } + + + + + return true; +} + + +Standard_Boolean McCadMcRead_CellBuilder::ExtractFill(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + + TCollection_AsciiString tmpStr = sDesc; + + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + int iFill = tmpStr.Search("FILL"); + int iLat = tmpStr.Search("LAT"); + if (iFill > 0 && iLat > 0) + return true; // we have lat fill will be processed otherwise. + + if (iFill <= 0) // we don't have a Fill card at all. + { + myCell->SetHaveFill(false); + return true; + } + // process simple fill card + myCell->SetHaveFill(true); + // create a fill card + TCollection_AsciiString fCard; + if (tmpStr.Search("*FILL") > 0) + fCard = TCollection_AsciiString("*FILL"); + else + fCard = TCollection_AsciiString("FILL"); + + TCollection_AsciiString theRest = tmpStr.Split(tmpStr.Search("FILL")+3); + + theRest.LeftAdjust(); + theRest.RightAdjust(); + // the first string should be = sign + if (theRest.Search("=") != 1) + { + TCollection_AsciiString errormsg("Syntax error for cell : "); + errormsg += myCell->GetCellNumber(); + errormsg += " !! Fill keyword should be followed by a '=' "; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + else + { + fCard += TCollection_AsciiString("="); + theRest.Remove(1,1); + // know we expect a ( or a number! + theRest.LeftAdjust(); + theRest.RightAdjust(); + if (theRest.Search("(") > 0 ) + { // we have trsfnum or matrix + TCollection_AsciiString sMid = theRest.SubString(theRest.Search("("),theRest.Search(")")); + fCard += sMid; + + // get the fill number + sMid.Clear(); + sMid = theRest.Split(theRest.Search("(")+1); + TCollection_AsciiString sMid2 = theRest.Split(sMid.Search(" ")); + + if (theRest.IntegerValue() <= 0 ) + { + TCollection_AsciiString errormsg("Fill Number <= 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + else fCard += theRest; + } + else + { + if (theRest.IntegerValue() <= 0 ) + { + TCollection_AsciiString errormsg("Fill Number <= 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + else fCard += theRest; + } + } + + + + McCadMcRead_FillBuilder BuildFill; + if(BuildFill.Build(fCard)) + { + Handle(McCadMcRead_Fill) theFill = BuildFill.GetFiller(); + myCell->SetFill(theFill); + return true; + } + else + return false; +} + + +Standard_Boolean McCadMcRead_CellBuilder::ExtractLatFill(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString tmpStr = sDesc; + + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + int iFill = tmpStr.Search("FILL"); + int iLat = tmpStr.Search("LAT"); + if (iLat <= 0 || iFill <= 0) + { + myCell->SetHaveLat(false); + return Standard_True; // simple cell + } + +// cout << sDesc << endl; + + // now we know that we have lat keywords; + TCollection_AsciiString theRest = tmpStr.Split(tmpStr.Search("LAT")+2); + theRest.LeftAdjust(); + theRest.RightAdjust(); + +// cout << "THE REST: " << theRest.ToCString() << " TMP STR: " << tmpStr.ToCString() << endl; + + // the first string should be = sign + if (theRest.Search("=") != 1 ) + { + TCollection_AsciiString errormsg("Syntax error for cell : "); + errormsg += myCell->GetCellNumber(); + errormsg += " !! Lat keyword should be followed by a '='!"; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + theRest.Remove(1,1); // this removes the equal sign. + theRest.LeftAdjust(); + theRest.RightAdjust(); + TCollection_AsciiString theRest2 = theRest.Split(theRest.Search(" ")); + + //cout << "THE REST2: " << theRest2.ToCString() << " THE REST: " << theRest.ToCString() << endl; + + if (theRest.IntegerValue() <= 0 ) + { + TCollection_AsciiString errormsg("Lat Number <= 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + myCell->SetHaveLat(Standard_True); + myCell->SetLat(theRest.IntegerValue()); + + /////////////////////////////////////////////////////// + //we go here for the fill card which is multi + tmpStr.Clear(); + theRest.Clear(); + theRest2.Clear(); + tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + // process simple fill card + //cout << "----------\n"; + myCell->SetHaveFill(true); + // create a fill card + TCollection_AsciiString fCard(" "); + if (tmpStr.Search("*FILL") > 0 ) + fCard.Insert(fCard.Length(),"*FILL"); + else + fCard.Insert(fCard.Length(),"FILL"); +// cout << "1\n"; + theRest = tmpStr.Split(tmpStr.Search("FILL")+3); + theRest.LeftAdjust(); + theRest.RightAdjust(); + // the first string should be = sign + if (theRest.Search("=") != 1 ) + { + TCollection_AsciiString errormsg("Syntax error for cell : "); + errormsg += myCell->GetCellNumber(); + errormsg += " !! Fill keyword should be followed by a '='!"; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } +// cout << "2\n"; + fCard.Insert(fCard.Length(),"="); + theRest.Remove(1,1); + + // know we expect a ( or a number! + theRest.LeftAdjust(); + theRest.RightAdjust(); + if (theRest.Search("(") == 1 ) + { // with trsfnum or matrix + TCollection_AsciiString sTrsf = theRest.SubString(theRest.Search("("),theRest.Search(")")); + fCard.Insert(fCard.Length(),sTrsf); + } + //the fCard is now "*Fill=(num) and theRest is the rest. + // we get dimension or compute it. + theRest.LeftAdjust(); + theRest.RightAdjust(); + ////////////////////////////////////////////////// + // we check if we have the three index pairs!! + // xindex + + Standard_Boolean infTest(Standard_False); + + if(theRest.Search(":") < 0)// infinite lattice or error + infTest = Standard_True; + else + { + TCollection_AsciiString tstStr = theRest; + TCollection_AsciiString trash = tstStr.Split(tstStr.Search(":") - 1); + + tstStr.LeftAdjust(); + tstStr.RightAdjust(); + + if(tstStr.Search(" ") > 0) // more than one integer between '=' and ':' + infTest = Standard_True; + else if(!tstStr.IsIntegerValue()) + { + TCollection_AsciiString errormsg("Expecting integer value after 'Fill=' in cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return Standard_False; + } + } + + if(infTest) // Infinite Lattice + { + cout << "INFINITE LATTICE FOUND\n\n"; + TCollection_AsciiString trash; + if(theRest.Search(" ") > 0) + trash = theRest.Split(theRest.Search(" ")); + else + trash = theRest; + + theRest.LeftAdjust(); + theRest.RightAdjust(); + + if(!theRest.IsIntegerValue()) + { + TCollection_AsciiString errormsg("Integer value after Fill statement expected!! Error in cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return Standard_False; + } + + Standard_Integer fillNum = theRest.IntegerValue(); + Handle(McCadMcRead_Fill) fill = new McCadMcRead_Fill(fillNum); + + myCell->SetFill(fill); + myCell->SetInfiniteLattice(); + + return Standard_True; + } + + TCollection_AsciiString sEnd = theRest.Split(theRest.Search(":")-1); // this is : 1 3:4 etc. and sTmp is an index; + + int xLindex = theRest.IntegerValue(); + + sEnd.LeftAdjust(); + Standard_Character aC = sEnd.Value(1); + if (aC != ':') + { + TCollection_AsciiString errormsg("Fill card x index entry is wrong for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + sEnd.Remove(1,1); // this removes ":" + sEnd.LeftAdjust(); + int xUindex = (sEnd.SubString(1,sEnd.Search(" "))).IntegerValue(); + + sEnd.Remove(1,sEnd.Search(" ")-1); + sEnd.LeftAdjust(); + theRest.Clear(); + theRest = sEnd; + sEnd.Clear(); + //y index + sEnd = theRest.Split(theRest.Search(":")-1); // this is : 1 3:4 etc. and sTmp is an index; + int yLindex = theRest.IntegerValue(); + sEnd.LeftAdjust(); + aC = sEnd.Value(1); + if (aC != ':') + { + TCollection_AsciiString errormsg("Fill card y index entry is wrong for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + sEnd.Remove(1,1); // this removes ":" + sEnd.LeftAdjust(); + int yUindex = (sEnd.SubString(1,sEnd.Search(" "))).IntegerValue(); + sEnd.Remove(1,sEnd.Search(" ")-1); + sEnd.LeftAdjust(); + theRest.Clear(); + theRest = sEnd; + sEnd.Clear(); + //z index + sEnd = theRest.Split(theRest.Search(":")-1); // this is : 1 3:4 etc. and sTmp is an index; + int zLindex = theRest.IntegerValue(); + sEnd.LeftAdjust(); + aC = sEnd.Value(1); + if (aC != ':') + { + TCollection_AsciiString errormsg("Fill card z index entry is wrong for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + sEnd.Remove(1,1); // this removes ":" + sEnd.LeftAdjust(); + int zUindex = (sEnd.SubString(1,sEnd.Search(" "))).IntegerValue(); + sEnd.Remove(1,sEnd.Search(" ")-1); + sEnd.LeftAdjust(); + theRest.Clear(); + theRest = sEnd; + sEnd.Clear(); + // we have now the dimension indices. + Handle(TColgp_HSequenceOfPnt) theFillPlaceSeq = new TColgp_HSequenceOfPnt; + + Standard_Integer zCnt((zUindex - zLindex)+1), yCnt((yUindex - yLindex)+1), xCnt((xUindex - xLindex)+1); + Standard_Integer dim = xCnt*yCnt*zCnt; + // gp_Pnt place; + + Standard_Integer plcCnt(0); + + for(Standard_Integer k=1; k <= zCnt; k++) + { + for (Standard_Integer j=1;j <= yCnt; j++) + { + for (Standard_Integer i=1 ;i <= xCnt; i++) + { + plcCnt++; + gp_Pnt place(xLindex+i,yLindex+j,zLindex+k); + theFillPlaceSeq->Append(place); + } + } + } +/*cout << "number of places : " << plcCnt << endl; +cout << "##### > " << theFillPlaceSeq->Length() << endl;*/ + + myCell->SetFillPlaceSeq(theFillPlaceSeq); + + ////////////////////////////////////////////////////////////////////////////////////// + // we create the fill card for each entry and append it to fCard and make a fill object for each; + // theRest contain the vector and fCard is *Fill = ( trsf ) + // if we find a trsf we replace trsf after fill + Handle(McCadMcRead_HSequenceOfFill) theFillSeq = new McCadMcRead_HSequenceOfFill; + theRest.LeftAdjust(); + theRest.RightAdjust(); + theRest += " "; + + // resolve repeat operator R + theRest.UpperCase(); + + if(theRest.Search("R") > 0) + { + TCollection_AsciiString newRest, previousFillNumber(-1); + while(true) + { + TCollection_AsciiString tail; + + if(theRest.Search(" ") > 0) + { + tail = theRest.Split(theRest.Search(" ")); + tail.LeftAdjust(); + + if(theRest.Search("R") < 0) + { + previousFillNumber = theRest; + newRest += previousFillNumber; + } + else + { + TCollection_AsciiString theR = theRest.Split(theRest.Search("R")); + if(!theRest.IsIntegerValue()) + { + cout << "ERROR : integer value expected before repeate operator nR in cell " << myCell->GetCellNumber() << endl; + return false; + } + + Standard_Integer numberOfRepeats = theRest.IntegerValue(); + + for(int i=1; i<=numberOfRepeats; i++) + { + newRest += previousFillNumber; + } + } + } + else + { + if(theRest.Search("R") > 0) + { + TCollection_AsciiString theR = theRest.Split(theRest.Search("R")); + if(!theRest.IsIntegerValue()) + { + cout << "ERROR : integer value expected before repeate operator nR in cell " << myCell->GetCellNumber() << endl; + return false; + } + + Standard_Integer numberOfRepeats = theRest.IntegerValue(); + + for(int i=1; i<=numberOfRepeats; i++) + { + newRest += previousFillNumber; + } + } + else + newRest.Cat(theRest); + break; + } + + theRest = tail; + } + + theRest = newRest + TCollection_AsciiString(" "); + } + + //cout << "Dimension : " << dim << endl; + for (int l = 1; l <= dim; l++) + { + TCollection_AsciiString fCard2 = fCard; + TCollection_AsciiString sTrsf(" "); + TCollection_AsciiString stmp, sMid; + sMid = theRest; + + theRest = sMid.Split(sMid.Search(" ")); + theRest.LeftAdjust(); + + // sMid can be num or num( or num(trsf or num(trsf) + if(sMid.Search("(") > 0 ) + { + sTrsf += theRest.SubString(theRest.Search("("),theRest.Search(")")); + sMid = theRest.SubString(1,theRest.Search("(")-1); + stmp = theRest.Split(sMid.Search(" ")); + theRest.Clear(); + theRest = stmp; + } + + if (sMid.IntegerValue() <= 0 ) + { + TCollection_AsciiString errormsg("_#_McCadMcRead_CellBuilder.cxx :: Fill Number <= 0 for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + + fCard2.Insert(fCard2.Length(),sTrsf); + fCard2.Insert(fCard2.Length(),sMid); + + + McCadMcRead_FillBuilder BuildFill; + if(BuildFill.Build(fCard2)) + { + Handle(McCadMcRead_Fill) theFill = BuildFill.GetFiller(); + theFillSeq->Append(theFill); + } + else + { + TCollection_AsciiString errormsg("Fill Card building failed for cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + } + + + + myCell->SetFillSeq(theFillSeq); + return true; +} + + +Standard_Boolean McCadMcRead_CellBuilder::ExtractUCard(const TCollection_AsciiString& sDesc) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + Standard_Integer iU = tmpStr.Search(" U"); + if (iU > 0) // we are looking for U = num mnemonics + { + myCell->SetHaveU(true); + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("U")); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + + TCollection_AsciiString sEnd2; + + if(sEnd.Search(" ")>0) + sEnd2 = sEnd.SubString(sEnd.Search("=")+1, sEnd.Search(" ")); + else + sEnd2 = sEnd.SubString(sEnd.Search("=")+1, sEnd.Length()); + + if (sEnd2.IntegerValue() <= 0) + { + TCollection_AsciiString errormsg("Universe Card with non positive entry in cell : "); + errormsg += myCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + else + { + myCell->SetUNum(sEnd2.IntegerValue()); + return true; + } + } + else + myCell->SetHaveU(false); + + return true; +} + + +Handle(McCadMcRead_Cell) McCadMcRead_CellBuilder::GetCell() const +{ + return myCell; +} + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_0.cxx new file mode 100644 index 0000000..9c9b820 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerCell +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_0.cxx new file mode 100644 index 0000000..0a9831a --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapOfIntegerFill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Fill +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerFill +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_0.cxx new file mode 100644 index 0000000..0dc421b --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile +#include +#endif +//McCadMcRead_DataMapNodeOfDataMapOfIntegerCell::~McCadMcRead_DataMapNodeOfDataMapOfIntegerCell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_DataMapNodeOfDataMapOfIntegerCell", + sizeof(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell) Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell))) { + _anOtherObject = Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)((Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_DataMapNodeOfDataMapOfIntegerCell::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell) ; +} +//Standard_Boolean McCadMcRead_DataMapNodeOfDataMapOfIntegerCell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerCell) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell::~Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerCell +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_0.cxx new file mode 100644 index 0000000..d73bc49 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapOfIntegerFill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_HeaderFile +#include +#endif +//McCadMcRead_DataMapNodeOfDataMapOfIntegerFill::~McCadMcRead_DataMapNodeOfDataMapOfIntegerFill() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_DataMapNodeOfDataMapOfIntegerFill", + sizeof(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill) Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill))) { + _anOtherObject = Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)((Handle(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_DataMapNodeOfDataMapOfIntegerFill::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill) ; +} +//Standard_Boolean McCadMcRead_DataMapNodeOfDataMapOfIntegerFill::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_DataMapNodeOfDataMapOfIntegerFill) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill::~Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Fill +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerFill +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_DataMapOfIntegerCell_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapOfIntegerCell_0.cxx new file mode 100644 index 0000000..8b41bf9 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapOfIntegerCell_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Cell +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerCell +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerCell_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerCell +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_DataMapOfIntegerFill_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapOfIntegerFill_0.cxx new file mode 100644 index 0000000..c5f547d --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_DataMapOfIntegerFill_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadMcRead_Fill +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadMcRead_DataMapIteratorOfDataMapOfIntegerFill +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadMcRead_DataMapNodeOfDataMapOfIntegerFill +#define TCollection_DataMapNode_Type_() McCadMcRead_DataMapNodeOfDataMapOfIntegerFill_Type_() +#define TCollection_DataMap McCadMcRead_DataMapOfIntegerFill +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_Fill.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_Fill.cxx new file mode 100644 index 0000000..4c4e106 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_Fill.cxx @@ -0,0 +1,62 @@ +#include + +McCadMcRead_Fill::McCadMcRead_Fill() +{ + myFillNum= 0; + myTrsfMatNum = 0; + + myTrsfMatType = 0; +} + +McCadMcRead_Fill::McCadMcRead_Fill(const Standard_Integer theNum) +{ + myFillNum = theNum; + myTrsfMatNum = 0; + myTrsfMatType = 0; +} + +void McCadMcRead_Fill::SetFillNum(const Standard_Integer theNum) +{ + myFillNum = theNum; +} + +Standard_Integer McCadMcRead_Fill::GetFillNum() const +{ + return myFillNum; +} + +void McCadMcRead_Fill::SetTrsfMatNum(const Standard_Integer theNum) +{ + + myTrsfMatNum = theNum; + +} + +Standard_Integer McCadMcRead_Fill::GetTrsfMatNum() const +{ + + return myTrsfMatNum; + +} + +void McCadMcRead_Fill::SetTrsfMatTyp(const Standard_Integer theNum) +{ + myTrsfMatType = theNum; + +} + +Standard_Integer McCadMcRead_Fill::GetTrsfMatTyp() const +{ + return myTrsfMatType; +} + +void McCadMcRead_Fill::SetTrsfMat(const Handle(McCadCSGGeom_Transformation)& theTrsf) +{ + myTrsf = theTrsf; +} + +Handle(McCadCSGGeom_Transformation) McCadMcRead_Fill::GetTrsfMat() const +{ + return myTrsf; +} + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_FillBuilder.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_FillBuilder.cxx new file mode 100644 index 0000000..5e244b5 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_FillBuilder.cxx @@ -0,0 +1,131 @@ +#include +#include + +McCadMcRead_FillBuilder::McCadMcRead_FillBuilder() +{ + myFill = new McCadMcRead_Fill; + NotDone(); +} +Standard_Boolean McCadMcRead_FillBuilder::IsDone() const +{ + return myIsDone; +} + +void McCadMcRead_FillBuilder::Done() +{ + myIsDone = Standard_True; +} + +void McCadMcRead_FillBuilder::NotDone() +{ + myIsDone = Standard_False; +} + +Standard_Boolean McCadMcRead_FillBuilder::Build(const TCollection_AsciiString& sDesc) +{ + if(!ExtractPrefix(sDesc)) + { + NotDone(); + return false; + + } + + if(!ExtractEntry(sDesc)) + { + NotDone(); + return false; + } + Done(); + return true; +} + +Standard_Boolean McCadMcRead_FillBuilder::ExtractPrefix(const TCollection_AsciiString& sDesc) +{ + int index; + index = sDesc.Search("*FILL"); + if (sDesc.Search("*FILL") > 0 ) + { + myFill->SetTrsfMatTyp(1); + return true; + } + else if (sDesc.Search("FILL") > 0 ) + { + myFill->SetTrsfMatTyp(0); + return true; + } + else return false; +} + +Standard_Boolean McCadMcRead_FillBuilder::ExtractEntry(const TCollection_AsciiString& sDesc) +{ + // theRest is card - " *Fill = " + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + TCollection_AsciiString theRest = tmpStr.Split(tmpStr.Search("=")); + theRest.LeftAdjust(); + theRest.RightAdjust(); + + if (theRest.Search("(") > 0 && theRest.Search(")") > 0 ) // we have a TRSF Matrix or Num + { + TCollection_AsciiString sMiddle = theRest.SubString(theRest.Search("(")+1,theRest.Search(")")-1); + sMiddle.LeftAdjust(); sMiddle.RightAdjust(); + + if (sMiddle.Search(" ") > 0) // we have a TRSF Matrix + { + // prepend Number + if (myFill->GetTrsfMatTyp() == 0) + sMiddle.InsertBefore(1, TCollection_AsciiString("TR1000 ")); + else + sMiddle.InsertBefore(1, TCollection_AsciiString("*TR1000 ")); + // bulid a trsf matrix and give it a Number; + McCadMcRead_TrsfBuilder TrBuilder; + TrBuilder.BuildTrsf(sMiddle); + myFill->SetTrsfMatNum(1000); + myFill->SetTrsfMat(TrBuilder.GetTrsf()); + myFill->SetTrsfMatTyp(0); // the TrsfBuilder generates only this type which is cosine of angle. + } + else // we have a TRSF Matrix Number; + { + myFill->SetTrsfMatNum(sMiddle.IntegerValue()); + } + } + else // we don't have a TRSF at all + { + myFill->SetTrsfMatNum(0); + } + // we get here the fill number + + if (myFill->GetTrsfMatNum() == 0) + { + Standard_Integer aNum(0); + if(theRest.Search(" ") > 0) + theRest = theRest.SubString(1,theRest.Search(" ")); + + if(theRest.IsIntegerValue()) + aNum = theRest.IntegerValue(); + else + cout << "Fill Number not an Integer Value!!!\n"; + + myFill->SetFillNum(aNum); + } + else + { + TCollection_AsciiString sTmp = theRest.SubString(theRest.Search(")")+1,theRest.Length()); + sTmp.LeftAdjust(); + sTmp.RightAdjust(); + int aNum = sTmp.IntegerValue();//(sTmp.SubString(1,sTmp.Search(" "))).IntegerValue(); + myFill->SetFillNum(aNum); + } + + return Standard_True; +} + +Handle(McCadMcRead_Fill) McCadMcRead_FillBuilder::GetFiller() const +{ + + return myFill; + +} + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfCellPtr_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfCellPtr_0.cxx new file mode 100644 index 0000000..c0224b2 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfCellPtr_0.cxx @@ -0,0 +1,92 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceOfCellPtr_HeaderFile +#include +#endif +//McCadMcRead_HSequenceOfCellPtr::~McCadMcRead_HSequenceOfCellPtr() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_HSequenceOfCellPtr_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_HSequenceOfCellPtr", + sizeof(McCadMcRead_HSequenceOfCellPtr), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_HSequenceOfCellPtr) Handle(McCadMcRead_HSequenceOfCellPtr)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_HSequenceOfCellPtr) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_HSequenceOfCellPtr))) { + _anOtherObject = Handle(McCadMcRead_HSequenceOfCellPtr)((Handle(McCadMcRead_HSequenceOfCellPtr)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_HSequenceOfCellPtr::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_HSequenceOfCellPtr) ; +} +//Standard_Boolean McCadMcRead_HSequenceOfCellPtr::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_HSequenceOfCellPtr) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadMcRead_HSequenceOfCellPtr::~Handle_McCadMcRead_HSequenceOfCellPtr() {} +#define Item McCadMcRead_CellPtr +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfCellPtr +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfCellPtr +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfCellPtr +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfCellPtr_Type_() +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfCell_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfCell_0.cxx new file mode 100644 index 0000000..fd8f035 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfCell_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceOfCell_HeaderFile +#include +#endif +//McCadMcRead_HSequenceOfCell::~McCadMcRead_HSequenceOfCell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_HSequenceOfCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_HSequenceOfCell", + sizeof(McCadMcRead_HSequenceOfCell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_HSequenceOfCell) Handle(McCadMcRead_HSequenceOfCell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_HSequenceOfCell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_HSequenceOfCell))) { + _anOtherObject = Handle(McCadMcRead_HSequenceOfCell)((Handle(McCadMcRead_HSequenceOfCell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_HSequenceOfCell::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_HSequenceOfCell) ; +} +//Standard_Boolean McCadMcRead_HSequenceOfCell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_HSequenceOfCell) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadMcRead_HSequenceOfCell::~Handle_McCadMcRead_HSequenceOfCell() {} +#define Item Handle_McCadMcRead_Cell +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfCell_Type_() +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfFill_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfFill_0.cxx new file mode 100644 index 0000000..9258b14 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_HSequenceOfFill_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceOfFill_HeaderFile +#include +#endif +//McCadMcRead_HSequenceOfFill::~McCadMcRead_HSequenceOfFill() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_HSequenceOfFill_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_HSequenceOfFill", + sizeof(McCadMcRead_HSequenceOfFill), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_HSequenceOfFill) Handle(McCadMcRead_HSequenceOfFill)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_HSequenceOfFill) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_HSequenceOfFill))) { + _anOtherObject = Handle(McCadMcRead_HSequenceOfFill)((Handle(McCadMcRead_HSequenceOfFill)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_HSequenceOfFill::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_HSequenceOfFill) ; +} +//Standard_Boolean McCadMcRead_HSequenceOfFill::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_HSequenceOfFill) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadMcRead_HSequenceOfFill::~Handle_McCadMcRead_HSequenceOfFill() {} +#define Item Handle_McCadMcRead_Fill +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfFill +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfFill +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfFill +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfFill_Type_() +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_Reader.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_Reader.cxx new file mode 100644 index 0000000..81412df --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_Reader.cxx @@ -0,0 +1,1870 @@ +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include + + +int NbyteRead; +Standard_Integer maxCNum, maxSNum, maxTNum; + +McCadMcRead_Reader::McCadMcRead_Reader() +{ + myTitleSkipped = Standard_False; + myUnsorted = Standard_True; + myMacroBodySurfNumCnt = 1000000; +} + +Standard_Boolean McCadMcRead_Reader::Parse(OSD_File& theStream) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + //-----processing Infomation.... +//:: cout<<"Parsing message card......"<GetCellNumber(); + + Handle(TColStd_HSequenceOfAsciiString) curCSG = aCell->GetCSG(); + //cout << " CSG for Cell : " << aCell->GetCellNumber() << "\t _ " << aCell->GetMaterialNumber() << " _\t " << "\t -- \t"; + /*for(int r=1; r<=curCSG->Length(); r++) + cout << curCSG->Value(r) << " " ; + cout << endl;*/ + + if (maxCNum > oldCNum) + oldCNum = maxCNum; + + if(aCell->IsTRCL()) + { + if(aCell->GetTRCLNumber()==1000) // now all transformations should be bound to myTrsfMap + { + Handle(McCadCSGGeom_Transformation) newTrafo = aCell->GetTrsf(); + newTrafo->SetIdNum(++maxTNum); + myTrsfMap.Bind(maxTNum, newTrafo); + aCell->SetTRCLNumber(maxTNum); + + /*Handle(McCadCSGGeom_Transformation) testTrsf = aCell->GetTrsf(); + gp_Trsf atrsf = testTrsf->GetTrsf();*/ + } + } + } + maxCNum = oldCNum; + + //cout << "===============================================================\n"; + + //-----processing Infomation.... +/* cout<<"Expanding Repeated structures ......"<IsPseudo()) + /* { + Handle(TColStd_HSequenceOfAsciiString) curCSG = aCell->GetCSG(); + cout << " CSG for Cell : " << aCell->GetCellNumber() << "\t _ " << aCell->GetMaterialNumber() << " _\t " << "\t -- \t"; + for(int r=1; r<=curCSG->Length(); r++) + cout << curCSG->Value(r) << " " ; + if(aCell->GetPseudoNum()!=0) + cout << " ... has Pseudo Number " << aCell->GetPseudoNum(); + + cout << endl; + }*/ + + //append transformation to the cells: + if(aCell->IsTRCL()) + { + // cout << "ASSIGNING Trsf " << aCell->GetTRCLNumber() << " to Cell " << aCell->GetCellNumber()<SetTrsf(myTrsfMap(aCell->GetTRCLNumber())); + } + + if(aCell->HaveMacro()) + { + // cout << "Resolving macro cell for cell number: "; + // cout << aCell->GetCellNumber() << endl; + // cout << "========================================" << endl; + Handle(TColStd_HSequenceOfAsciiString) ownCSG = aCell->GetCSG(); + Handle(TColStd_HSequenceOfAsciiString) aCSG = new TColStd_HSequenceOfAsciiString; + aCSG->Append(ownCSG); + Handle(TColStd_HSequenceOfInteger) compCells = aCell->GetMacroIndex(); + for(int i=1; i<= compCells->Length(); i++) + { + Standard_Integer cellNum = compCells->Value(i); + if(!myCellMap.IsBound(cellNum)) + { + TCollection_AsciiString errormsg("McCadError: Missing macro cell for cell number: "); + errormsg += aCell->GetCellNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + else + { + Handle(McCadMcRead_Cell) coCell = myCellMap(cellNum); + Handle(TColStd_HSequenceOfAsciiString) coCSG = coCell->GetCSG(); + + if(coCell->IsTRCL()) // transformed cell -> copy surfaces and apply transformation to surfcopy + { + Handle(TColStd_HSequenceOfAsciiString) tmpCSG = new TColStd_HSequenceOfAsciiString; + if(coCSG->Length()<1) + break; + + for(int l=1; l<=coCSG->Length(); l++) + { + if(coCSG->Value(l).IsIntegerValue()) + { + //create new surface + Standard_Integer surfNum = coCSG->Value(l).IntegerValue(); + Standard_Integer sign = 1; + if(surfNum<0) + { + surfNum *= -1; + sign = -1; + } + + Handle(McCadCSGGeom_Surface) oldSurf = mySurfMap(surfNum); + //Handle(McCadCSGGeom_Surface) newSurf = ; + McCadMcRead_SurfaceFactory copySurf(oldSurf); + Handle(McCadCSGGeom_Surface) newSurf = copySurf.GetSurface(); + newSurf->SetNumber(++maxSNum); + gp_Trsf theTrsf = newSurf->GetTrsf(); + theTrsf = myTrsfMap(coCell->GetTRCLNumber())->GetTrsf() * theTrsf; + newSurf->SetTrsf(theTrsf); + newSurf->SetTrsfNumber(++maxTNum); + + Handle(McCadCSGGeom_Transformation) newTrsf = new McCadCSGGeom_Transformation; + newTrsf->SetTrsf(theTrsf); + newTrsf->SetIdNum(maxTNum); + myTrsfMap.Bind(maxTNum, newTrsf); + mySurfMap.Bind(maxSNum, newSurf); + + //newSurf->SetNumber(++maxSNum); + tmpCSG->Append(TCollection_AsciiString(sign * maxSNum)); + + } + else + tmpCSG->Append(coCSG->Value(l)); + } + coCSG = tmpCSG; + } + + aCSG->Append("#"); + aCSG->Append("("); + aCSG->Append(coCSG); + aCSG->Append(")"); + } + } + // aCell->SetCSG(aCSG); + + TCollection_AsciiString tmpStr; + for(int i=1; i<= aCSG->Length(); i++) + { + tmpStr.InsertAfter(tmpStr.Length(),aCSG->Value(i)); + tmpStr.InsertAfter(tmpStr.Length()," "); + } + ///////////////////////////////////////////////////////////////////////////////// + // update boolean forms + McCadBoolExp_PostFixer thePostFixer; + thePostFixer.Init(tmpStr); + + if(!thePostFixer.IsDone()) + { + TCollection_AsciiString errormsg("Error :: Generating postfix CSG expression failed for the following input:\n"); + errormsg += tmpStr; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + return false; + } + Handle(TColStd_HSequenceOfAsciiString) theInPutCSG = thePostFixer.GetInput(); + aCell->SetCSG(theInPutCSG); // this is the raw mcnp csg!! + Handle(TColStd_HSequenceOfAsciiString) theInFixCSG = thePostFixer.GetInFix(); + aCell->SetInFixCSG(theInFixCSG); // this is the raw csg in infix with intersection added!! + Handle(TColStd_HSequenceOfAsciiString) thePostFixCSG = thePostFixer.GetPostFix(); + aCell->SetPostFixCSG(thePostFixCSG); + aCell->SetHaveMacro(false); + ////////////////////////////////////////////////////////////// + // cout << endl; + // cout << "Macro cell resolved for cell number: "; + // cout << aCell->GetCellNumber() << endl; + // cout << tmpStr.ToCString() << endl; + // cout << "========================================" << endl; + } + } + + //------ if a cell is TRCL we need to add transformed surfaces for that cell +/* cIter.Initialize(myCellMap); + + for(; cIter.More(); cIter.Next()) + { + Handle(McCadMcRead_Cell) curCell = cIter.Value(); + + if(curCell->IsPseudo()) + continue; + + if(curCell->IsTRCL()) + { + cout << "NEED TO APPEND TRANSFORMED SURFACES FOR CELL " << curCell->GetCellNumber() << endl; + } + } +*/ + + //////////////////////////////////////////////// + //----- Transforming Surfaces + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface sIter; + sIter.Initialize(mySurfMap); + int trsfCount = 0; + for (; sIter.More();sIter.Next()) + { + Handle(McCadCSGGeom_Surface) aSurf = sIter.Value(); + Standard_Integer trsfNum = aSurf->GetTrsfNumber(); + // Standard_Integer surfNum = aSurf->GetNumber(); + + if( trsfNum == 0 ) // no trsf matrix + continue; + else + trsfCount++; + + if(!myTrsfMap.IsBound(trsfNum)) + { + TCollection_AsciiString errormsg("McCadError: a missing transformation card for surface number: "); + errormsg += aSurf->GetNumber(); + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + continue; + } + + Handle(McCadCSGGeom_Transformation) aTrsf = myTrsfMap(trsfNum); + gp_Trsf aCTrsf = aTrsf->GetTrsf(); + Handle(Geom_Surface) theSurface = aSurf->CasSurf(); + + //////////////////////////////////////////////////////////////////////////////////////////// + switch (aSurf->GetType()) + { + case McCadCSGGeom_Planar: + { + //cout << surfNum << " <> " << trsfNum << ":McCadCSGGeom_Planar: "; + Handle(Geom_Plane) aCSurf = Handle(Geom_Plane)::DownCast(theSurface); + gp_Ax3 aaAxis = aCSurf->Position(); + // if (aaAxis.Direct()); + // else cout << "Before: IndirectSurface found !!!" << endl; + aCSurf->Transform(aCTrsf); + aaAxis = aCSurf->Position(); + // if (aaAxis.Direct()); + // else cout << "After: IndirectSurface found !!!" << endl; + GeomAdaptor_Surface theAdapSurface(aCSurf); + aSurf->SetCasSurf(theAdapSurface); + break; + } + case McCadCSGGeom_Conical: + { + // cout << surfNum << " <> " << trsfNum<< "McCadCSGGeom_Conical: "; + Handle(Geom_ConicalSurface) aCSurf = Handle(Geom_ConicalSurface)::DownCast(theSurface); + gp_Ax3 aaAxis = aCSurf->Position(); + // if (aaAxis.Direct()); + // else cout << "Before: IndirectSurface found !!!" << endl; + aCSurf->Transform(aCTrsf); + aaAxis = aCSurf->Position(); + // if (aaAxis.Direct()); + // else cout << "After: IndirectSurface found !!!" << endl; + GeomAdaptor_Surface theAdapSurface(aCSurf); + aSurf->SetCasSurf(theAdapSurface); + break; + } + case McCadCSGGeom_Cylindrical: + { + //cout << surfNum << " <> " << trsfNum<< " McCadCSGGeom_Cylindrical: \n"; + Handle(Geom_CylindricalSurface) aCSurf = Handle(Geom_CylindricalSurface)::DownCast(theSurface); + gp_Ax3 aaAxis = aCSurf->Position(); + // if (aaAxis.Direct()); + // else cout << "Before: IndirectSurface found !!!" << endl; + aCSurf->Transform(aCTrsf); + aaAxis = aCSurf->Position(); + // if (aaAxis.Direct()); + // else cout << "After: IndirectSurface found !!!" << endl; + GeomAdaptor_Surface theAdapSurface(aCSurf); + aSurf->SetCasSurf(theAdapSurface); + break; + } + case McCadCSGGeom_Spherical: + { + //cout<< "McCadMcRead_Reader.cxx :: " << surfNum << " <> " << trsfNum << "McCadCSGGeom_Spherical: "; + Handle(Geom_SphericalSurface) aCSurf = Handle(Geom_SphericalSurface)::DownCast(theSurface); + aCSurf->Transform(aCTrsf); + GeomAdaptor_Surface theAdapSurface(aCSurf); + aSurf->SetCasSurf(theAdapSurface); + break; + } + case McCadCSGGeom_Toroidal: + { + //cout << surfNum << " <> " << trsfNum<< "McCadCSGGeom_Toroidal: "; + Handle(Geom_ToroidalSurface) aCSurf = Handle(Geom_ToroidalSurface)::DownCast(theSurface); + aCSurf->Transform(aCTrsf); + GeomAdaptor_Surface theAdapSurface(aCSurf); + aSurf->SetCasSurf(theAdapSurface); + break; + } + case McCadCSGGeom_Quadric: + { + //cout << "McCadError: McCadCSGGeom_Qaudric surface type for surface number: "; + //cout << aSurf->GetNumber() << endl; + break; + } + case McCadCSGGeom_OtherSurface: + { + //cout << "McCadError: unimplemented surface type for surface number: "; + // cout << aSurf->GetNumber() << endl; + break; + } + default : + msgr->Message("!!! unknown type of surface !!!\n", McCadMessenger_ErrorMsg); + } + //cout << endl; + } + + + ////////////////////////////////////////////// + //----- append surfacemaps to cells + cIter.Initialize(myCellMap); + for (; cIter.More();cIter.Next()) + { + Handle(McCadMcRead_Cell) aCell = cIter.Value(); + Handle(TColStd_HSequenceOfAsciiString) aCSGSeq = aCell->GetCSG(); + Handle(TColStd_HSequenceOfAsciiString) mcrbdyCSGSubstSeq = new TColStd_HSequenceOfAsciiString; + + McCadCSGGeom_DataMapOfIntegerSurface surfMap; + Standard_Boolean isMade = Standard_True; + Standard_Boolean hasMB = Standard_False; + + for ( int it = 1; it <= aCSGSeq->Length(); it++ ) + { + TCollection_AsciiString aVal = aCSGSeq->Value(it); + + Standard_Integer sNum(0); + Standard_Integer signum(1); + if(aVal.IsIntegerValue()) + { + sNum = aVal.IntegerValue(); + + if (sNum < 0 ) + { + sNum = sNum*-1; + signum = -1; + } + + if(!mySurfMap.IsBound(sNum)) + { + TCollection_AsciiString errormsg("McCadError: a missing surface card for the inputcard: "); + errormsg += aVal; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + isMade = Standard_False; + break; + } + else + { + if(mySurfMap(sNum)->IsMacroBody()) + { + cout << "IS MACROBODY\n"; + hasMB = Standard_True; + Handle(TColStd_HSequenceOfInteger) surfSeq = mySurfMap(sNum)->GetMacroBodySurfaces(); + + for(Standard_Integer i = 1; i<=surfSeq->Length(); i++) + { + Standard_Integer j = surfSeq->Value(i); + + if(!mySurfMap.IsBound(j)) + { + msgr->Message("_#_McCadMcRead_Reader.cxx :: Macrobody surface not bound!!!", + McCadMessenger_ErrorMsg); + isMade = Standard_False; + break; + } + + surfMap.Bind(j, mySurfMap(j)); + mcrbdyCSGSubstSeq->Append(signum*j); + } + } + else + { + surfMap.Bind(sNum,mySurfMap(sNum)); + mcrbdyCSGSubstSeq->Append(signum*sNum); + } + } + } + } + + if(isMade) + { + aCell->SetSurface(surfMap); + + if(hasMB) + { + + TCollection_AsciiString tmpStr; + cout << "Before fix :"; + for(int i=1; i<= mcrbdyCSGSubstSeq->Length(); i++) + { + cout << mcrbdyCSGSubstSeq->Value(i).ToCString() << " "; + tmpStr.InsertAfter(tmpStr.Length(), mcrbdyCSGSubstSeq->Value(i)); + tmpStr.InsertAfter(tmpStr.Length()," "); + } + cout << endl; + + McCadBoolExp_PostFixer thePostFixer; + + thePostFixer.Init(tmpStr); + + if(!thePostFixer.IsDone()) + { + TCollection_AsciiString errormsg("Error :: Generating postfix CSG expression failed for the following input: "); + errormsg += tmpStr; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + continue; + } + + Handle(TColStd_HSequenceOfAsciiString) theInPutCSG = thePostFixer.GetInput(); + aCell->SetCSG(theInPutCSG); // this is the raw mcnp csg!! + Handle(TColStd_HSequenceOfAsciiString) theInFixCSG = thePostFixer.GetInFix(); + aCell->SetInFixCSG(theInFixCSG); // this is the raw csg in infix with intersection added!! + Handle(TColStd_HSequenceOfAsciiString) thePostFixCSG = thePostFixer.GetPostFix(); + aCell->SetPostFixCSG(thePostFixCSG); + } + // cout << "Number of surfaces of the cell = " << surfMap.Extent() << endl; + } + else + { + msgr->Message("McCadError: surface map construction failed due to missing surface card!\n", + McCadMessenger_ErrorMsg); + } + + Handle(TColStd_HSequenceOfAsciiString) pfCSG = aCell->GetPostFixCSG(); + /*cout << "POSTFIX: "; + for(int kl=1; kl<=pfCSG->Length(); kl++) + { + cout << pfCSG->Value(kl).ToCString() << " "; + } + cout << endl;*/ + } + + + + return true; +} + +Standard_Boolean McCadMcRead_Reader::ParseMessage(OSD_File& theStream) +{ + char theBuff[256]; + + TCollection_AsciiString sBuff(theBuff); + sBuff.Clear(); + + theStream.ReadLine(sBuff, Standard_Integer(256), NbyteRead); //Read first line of the file; + TCollection_AsciiString sline(sBuff); + sline.UpperCase(); + int nIndex = sline.Search("MESSAGE:"); + + if (nIndex<0 || nIndex>5 || IsComment(sline)) //NO message block + { + if(!IsComment(sline))//then it must be the title + myTitleSkipped = Standard_True; + + return true; //could be the title + } + /********Skip message block********************/ + while (!theStream.IsAtEnd()) + { + char theBuff[256]; + TCollection_AsciiString sBuff(theBuff); + TCollection_AsciiString sline; + theStream.ReadLine(sBuff, 256, NbyteRead); + sline += sBuff; + + if (IsBlankDeliminter(sline)) // end of message block + break; + } + //Now, in is at the begin of the next block; + return true; +} + +Standard_Boolean McCadMcRead_Reader::ParseTitle(OSD_File& theStream) +{ + // OSD_File in = theStream; + + if (theStream.IsAtEnd()) //"Title card" is necessary; + { + return false; + } + + if(myTitleSkipped)//title has been found in ParseMessage + { + cout << "Title skipped\n"; + return true; + } + + while (!theStream.IsAtEnd()) + { + char theBuff[256]; + TCollection_AsciiString sBuff(theBuff); + TCollection_AsciiString sline; + + //Read one line title card; + theStream.ReadLine(sBuff, 256, NbyteRead); + sline = sBuff; + + // ::cout<Message("McCadMcRead_Reader.cxx :: Error: neither MCard nor TransfromationCard", + McCadMessenger_WarningMsg); + } + break; //Exit the loop + } + sBuffer.Clear(); + theStream.ReadLine(sBuffer,256,NbyteRead); //Read in a line; + sline = sBuffer; + sline.UpperCase(); + + if(IsBlankDeliminter(sline)) //Blank deliminter, the end of the cell card is found; + { + if(sTRBuff.Length() != 0) + { + if(isTRC) + { + if(!CreatTRInst(sTRBuff)) + { + cout<<"False 2"<Message("Material Card Failed", McCadMessenger_ErrorMsg); + return false; + } + } + } + break; //Exit the loop + } + + if(IsComment(sline)) //Ignore the comment line; + continue; + + //Last Char; + sTRBuff.RightAdjust(); + + if(sTRBuff.Search("&") == sTRBuff.Length()) + { + if(sTRBuff.Length() == 0)//It is the first line, it should be the begin of the new cell card; + { + cout<<"False 3"<Message("MCard failed",McCadMessenger_ErrorMsg); + return false; + } + sTRBuff=""; + } + } + + int nIndex = sline.Search("TR"); // TRANSFORMATION CARD + int mIndex = sline.Search("M"); //Possible MCard + if(nIndex>=1 && nIndex<=5) + { + isTRC = Standard_True; + isMCard = Standard_False; + if(nIndex>1) + { + if(sline.Value(nIndex-1) == '*' || sline.Value(nIndex-1) == ' ') + { + RemoveComment(sline); + sTRBuff = sline; //Begin to read the new cell; + } + } + else + { + RemoveComment(sline); //Reomve subtring after '$', and '$' itself; + sTRBuff = sline; //Begin to read the new Trsf; + } + } + else if(mIndex>=1 && mIndex<=5) + { + TCollection_AsciiString mCardCheck = sline; + mCardCheck.LeftAdjust(); + mCardCheck.Remove(1,1); //leading M is deleted + mCardCheck.Split(1); + if(mCardCheck.IsIntegerValue()) //MCard + { + //cout << "MCard : " << sline.ToCString(); + isTRC = Standard_False; + isMCard = Standard_True; + sTRBuff = sline; + } + } + } + } + cout << "=======================\n"; + cout << "End Of Data Card\n\n"; + + + + return true; +} + +void McCadMcRead_Reader::RemoveComment(TCollection_AsciiString& sline) +{ + if (sline.Length() > 0 && sline.Search("$") > 0) + TCollection_AsciiString sEnd = sline.Split(sline.Search("$")-1); + +} + +Standard_Boolean McCadMcRead_Reader::IsBlankDeliminter( + const TCollection_AsciiString& sline) +{ + TCollection_AsciiString tmpStr = sline; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + if (tmpStr.Length() == 0) //A empty line; + return true; + else + return false; +} + +Standard_Boolean McCadMcRead_Reader::IsContinuation( + const TCollection_AsciiString& sline) +{ + TCollection_AsciiString tmpStr = sline; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + if (tmpStr.Length() == 0) //An empty line; + return false; + tmpStr.Clear(); + tmpStr = sline; + + if (tmpStr.Search(" ")==1) + return true; + else + return false; +} + +Standard_Boolean McCadMcRead_Reader::IsComment(const TCollection_AsciiString& sline) +{ + TCollection_AsciiString tmpStr = sline; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + tmpStr.UpperCase(); + if (tmpStr.Length() == 0) //A empty line; + { + return false; + } + if (tmpStr.Value(1) == 'C') + return true; + else + return false; +} + +Standard_Boolean McCadMcRead_Reader::CreatCellInst( const TCollection_AsciiString& sline) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + //cout<< endl; + //cout<< " Cell Building started " << endl; + cout << "Building : " << sline.ToCString() << endl; + + McCadMcRead_CellBuilder aBuilder; + Handle(McCadMcRead_Cell) aCell; + aBuilder.BuildCell(sline); + + if(aBuilder.IsDone()) + { + aCell = aBuilder.GetCell(); + cout << " Cell Building finished for Cell number : " << aCell->GetCellNumber() << endl; + cout << " cell is : "; + if(aCell->IsFill()) + cout << "Fill "; + if(aCell->IsLat()) + cout << "Lat "; + if(aCell->IsU()) + cout << "U "; + cout << endl; + } + else + { + TCollection_AsciiString errormsg("Cell Building failed for Card: "); + errormsg += sline; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + myCellMap.Bind(aCell->GetCellNumber(),aCell); + + TCollection_AsciiString asciiName(aCell->GetCellNumber()); + myMDReader.SetMaterial(asciiName, aCell->GetMaterialNumber()); + myMDReader.SetDensity(asciiName, aCell->GetDensity()); + //cout<< " End of Cell Building " << endl; + //cout<< "=========================================" << endl; + //cout<< endl; + + return true; +} + + +Standard_Boolean McCadMcRead_Reader::CreatSurfInst( const TCollection_AsciiString& sline) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + McCadMcRead_SurfaceFactory theFactory; + + Handle(McCadCSGGeom_Surface) aSurf; + //cout<< endl; + //cout<< "=========================================" << endl; + //cout<< " Surface Building started " << endl; + + if(theFactory.MakeSurface(sline) && theFactory.IsDone()) + { + aSurf = theFactory.GetSurface(); + if(aSurf->IsMacroBody()) + { + cout << "MACROBODY!!!\n"; + Handle(McCadCSGGeom_HSequenceOfSurface) mcrBdySrfs = theFactory.GetMacroBodySurfaces(); + Handle(TColStd_HSequenceOfInteger) surfNumSeq = new TColStd_HSequenceOfInteger; + + for(Standard_Integer i=1; i<=mcrBdySrfs->Length(); i++) + { + Handle(McCadCSGGeom_Surface) curSrf = mcrBdySrfs->Value(i); + curSrf->SetNumber(++myMacroBodySurfNumCnt); + surfNumSeq->Append(myMacroBodySurfNumCnt); + mySurfMap.Bind(myMacroBodySurfNumCnt, curSrf); + } + + aSurf->SetMacroBodySurfaceNumbers(surfNumSeq); + } + //cout<<"Building Surface number : "<< aSurf->GetNumber() << " is finished." << endl; + } + else + { + TCollection_AsciiString errormsg("Surface Building failed for Card: "); + errormsg += sline; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + } + + Standard_Integer curNum = aSurf->GetNumber(); + + if(maxSNum < curNum) + maxSNum = curNum; + + mySurfMap.Bind(curNum,aSurf); + //cout<< " End of Surface Building " << endl; + //cout<< "=========================================" << endl; + //cout<< endl; + + return true; +} + + +Standard_Boolean McCadMcRead_Reader::CreatTRInst(const TCollection_AsciiString& sline) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + //cout<< endl; + //cout<< "=========================================" << endl; + //cout<< " Building Transformation card started " << endl; + + //cout<< sline.ToCString() << endl; + + McCadMcRead_TrsfBuilder aBuilder; + Handle(McCadCSGGeom_Transformation) aTrsf = new McCadCSGGeom_Transformation; + aBuilder.BuildTrsf(sline); + if(aBuilder.IsDone()) + { + aTrsf = aBuilder.GetTrsf(); + //cout<<" Building Trsf number : "<< aTrsf->GetIdNum() << " finished." << endl; + } + else + { + TCollection_AsciiString errormsg("Trsf Building failed for Card: "); + errormsg += sline; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + + return false; + + } + myTrsfMap.Bind(aTrsf->GetIdNum(),aTrsf); + + /*cout << "Binding " << aTrsf->GetIdNum() << " to " << endl; + for(int i=1; i<=3; i++) + { + cout << "\t\t"; + for(int j=1;j<=4; j++) + cout << aTrsf->GetTrsf().Value(i,j) << " "; + cout << endl; + }*/ + + //cout<< " End of Transformation card building " << endl; + //cout<< "=========================================" << endl; + //cout<< endl; + + // cout << myTrsfMap.Extent() << endl; + + + return true; +} + + +Standard_Boolean McCadMcRead_Reader::CreatMCardInst(const TCollection_AsciiString& sline) +{ + TCollection_AsciiString tmpMC = sline; + TCollection_AsciiString aNum = sline; + Standard_Integer mNum(0); + + aNum.LeftAdjust(); + aNum.Remove(1,1); + aNum.Split(aNum.Search(" ")-1); + + if(!aNum.IsIntegerValue()) + return Standard_False; + + mNum = aNum.IntegerValue(); + tmpMC.ChangeAll('&','\n'); + + myMDReader.SetMCard(mNum, tmpMC); + + return Standard_True; +} + +void McCadMcRead_Reader::ResolveLattices() +{ + //this call follows always the ResolveFiller(); + + /*Standard_Integer maxTR(0); + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerTransformation trsfIter; + for(trsfIter.Initialize(mySurfMap); trsfIter.More(); trsfIter.Next()) + { + if(trsfIter.Value()->GetIdNum() > maxTR) + maxTR = trsfIter.Value()->GetIdNum(); + } + maxTR++;*/ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + +// cout << "New Transformations begin with : " << maxTNum << endl; + + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter; + cIter.Initialize(myCellMap); + + Handle(McCadMcRead_HSequenceOfCell) cellSeq = new McCadMcRead_HSequenceOfCell; + + for (; cIter.More() ; cIter.Next()) + { + /*cout << "Cell " << cIter.Value()->GetCellNumber() << " is ... "; + if(cIter.Value()->IsU()) + cout << "U "; + if(cIter.Value()->IsFill()) + cout << "Fill "; + if(cIter.Value()->IsInfiniteLattice()) + cout << "Inf_Lattice"; + cout << endl;*/ + cellSeq->Append(cIter.Value()); + } + + for(Standard_Integer c1=1; c1<=cellSeq->Length(); c1++) + { + Handle(McCadMcRead_Cell) aCell = cellSeq->Value(c1); + + if (aCell->IsFill() && aCell->IsLat()) + { + // make fill cell pseudo + Standard_Integer latType = aCell->GetLatNum(); + if(latType != 2 && latType != 1) + { + TCollection_AsciiString warningmsg("_#_McCadMcRead_Reader::ResolveLattices :: unknow lattice type : "); + warningmsg += latType; + msgr->Message(warningmsg.ToCString(), McCadMessenger_WarningMsg); + + return; + } + + // cout << "LAT TYPE : " << latType << endl; + + if(aCell->IsPseudo()) + continue; + + aCell->SetPseudo(true); + + // compute for each fill card trsf using the placement vector and + // mirroring. We have to read the surface and work with them. + // The algoritm is as follows. + // get +x,-x, +y,-y, +z,-z surfaces, this ordering is given on the cell card. + // get the placement vector. + // mirror along non zero component of the vector, say nx, all surfaces n-times along (x). + // example. pv=(-1,-1,0) ==> mirror all surfaces along -x once, then mirror all along -y once. + // ****get the trsf by calculating trsf from (orgaxis,currentaxis); this is a translation. + // the mirrored surfaces are set in the csg description.!! no trsf. + // that is we create new surfaces, give them number and change the csg accordinly. + Handle(McCadMcRead_Fill) aFill = aCell->GetFill(); + Handle(McCadMcRead_HSequenceOfFill) aFillSeq = aCell->GetFillSeq(); + Handle(TColgp_HSequenceOfPnt) placeSeq = aCell->GetFillPlaceSeq(); + //cout << "\t fill length: " << aFillSeq->Length() << " place length: " << placeSeq->Length() << endl; + + if (aFillSeq->Length() != placeSeq->Length()) + { + TCollection_AsciiString errormsg("McCad_Error: Dimension mismatch on the fill card ! \nCell Number "); + errormsg += aCell->GetUNum(); + errormsg += " will not be constructed. "; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + continue; + } + Handle(TColStd_HSequenceOfAsciiString) cellCSG = new TColStd_HSequenceOfAsciiString; + cellCSG->Append(aCell->GetCSG()); + // we extract the lattice surfaces: these can be upto 8 surfaces, + // depending on lattice type and fill index dimension. + // use a routine to find them + // cout << placeSeq->Length() << endl; + if(placeSeq->Length() < 1) + { + if(aCell->IsInfiniteLattice()) + cout << "INIFINITE!!!\n"; + + cout << aCell->GetCellNumber() << endl; + + // construct finite boundary for infinit lattice from the + + continue; + } + + + // estimate dimension using extrem vectors. + gp_Pnt P1 = placeSeq->Value(1); + gp_Pnt P2 = placeSeq->Value(placeSeq->Length()); + int xdim = int (P2.X() - P1.X()); + int ydim = int (P2.Y() - P1.Y()); + int zdim = int (P2.Z() - P1.Z()); + // minimum number of orienting surfaces: os =min(1,xdim-1)*2 + min(1,ydim-1)*2 + min(1,zdim-1)*2 + // total number of surfaces is determined by reading from the seq upto parenthesis. + // get a the of surfaces + // + cellCSG->Reverse(); // now the lattice surface numbers are at the from till the parenthesis. + Handle(TColStd_HSequenceOfInteger) surfNums = new TColStd_HSequenceOfInteger; + for (int i = 1; i<= cellCSG->Length(); i++) + { + TCollection_AsciiString cStr = cellCSG->Value(i); + + if(!cStr.IsIntegerValue()) + { + cellCSG->Remove(1, i-1); + cellCSG->Reverse(); + break; // it breaks at "(" + } + surfNums->Append(cStr.IntegerValue()); + } + + // make the mirroring directions. + Standard_Integer dim=0; + if (xdim > 0 && ydim > 0 && zdim > 0) + { + //the first two surface are x-mirroring directions. + dim=3; + } + else if ((xdim > 0 && ydim > 0 && zdim == 0) || + (xdim > 0 && zdim > 0 && ydim == 0) || + (ydim > 0 && zdim > 0 && xdim == 0)) + { + dim=2; + } + else + { + TCollection_AsciiString errormsg("_#_McCadMcRead_Reader.cxx :: Dimension Error on the fill card !"); + errormsg += "Cell Number "; + errormsg += aCell->GetUNum(); + errormsg += " will not be constructed. "; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + continue; + } + + for(int i=1; i<=placeSeq->Length(); i++) + { + //continue here the for loop is not yet closed!!!! + //the problem is to modify the csg of the cell now...... + gp_Pnt place = placeSeq->Value(i); + + // cout << "\t place = (" << place.X() << ", " << place.Y() << ", " << place.Z() << ")\n"; + MakeLatticeCellTransformation(dim, surfNums, place, latType); + + Handle(McCadMcRead_Fill) aFill = aFillSeq->Value(i); + Standard_Integer uNum = aFill->GetFillNum(); + + for (Standard_Integer c2=1; c2<=cellSeq->Length(); c2++) + { + Handle(McCadMcRead_Cell) uCell = cellSeq->Value(c2); + if(uCell->IsU() && uCell->GetUNum() == uNum) + { + // make u cell pseudo ............... + uCell->SetPseudo(true); + + Handle(McCadMcRead_Cell) newCell = new McCadMcRead_Cell; + // we merge the fill and u card to a new cell and set both pseudo. + maxCNum++; // free index in the map will serv as new cell number. + newCell->SetCellNumber(maxCNum); + newCell->SetMaterialNumber(uCell->GetMaterialNumber()); + newCell->SetDensity(uCell->GetDensity()); + // set MCNP csg + Handle(TColStd_HSequenceOfAsciiString) aCSG = new TColStd_HSequenceOfAsciiString; + // for the favor of latter calculation we parenthesize the fill cell description. + aCSG->Append(aCell->GetCSG()); + aCSG->Append(uCell->GetCSG()); + + TCollection_AsciiString tmpStr; + for(int i=1; i<= aCSG->Length(); i++) + { + tmpStr.InsertAfter(tmpStr.Length(), aCSG->Value(i)); + tmpStr.InsertAfter(tmpStr.Length()," "); + } + + McCadBoolExp_PostFixer thePostFixer; + + thePostFixer.Init(tmpStr); + + if(!thePostFixer.IsDone()) + { + TCollection_AsciiString errormsg("Error :: Generating postfix CSG expression failed for the following input:"); + errormsg += tmpStr; + msgr->Message(errormsg.ToCString(), McCadMessenger_ErrorMsg); + continue; + } + + Handle(TColStd_HSequenceOfAsciiString) theInPutCSG = thePostFixer.GetInput(); + newCell->SetCSG(theInPutCSG); // this is the raw mcnp csg!! + Handle(TColStd_HSequenceOfAsciiString) theInFixCSG = thePostFixer.GetInFix(); + newCell->SetInFixCSG(theInFixCSG); // this is the raw csg in infix with intersection added!! + Handle(TColStd_HSequenceOfAsciiString) thePostFixCSG = thePostFixer.GetPostFix(); + newCell->SetPostFixCSG(thePostFixCSG); + + // set fill card; + if(uCell->IsFill()) + { + newCell->SetHaveFill(true); + newCell->SetFill(uCell->GetFill()); + } + // copy macro cells + if(uCell->HaveMacro()) + + { + newCell->SetHaveMacro(true); + newCell->SetMacroIndex(uCell->GetMacroIndex()); + } + //trsf card must be computed; + if (aCell->IsTRCL()) + { + int fillTNum = aCell->GetTRCLNumber(); + if (uCell->IsTRCL()) + { + int uTNum = uCell->GetTRCLNumber(); + //both have trsf so we have to compute new + Handle(McCadCSGGeom_Transformation) newTrsf = new McCadCSGGeom_Transformation; + Handle(McCadCSGGeom_Transformation) fillMcCadTrsf = myTrsfMap(fillTNum); + Handle(McCadCSGGeom_Transformation) uMcCadTrsf = myTrsfMap(uTNum); + gp_Trsf fillTrsf = fillMcCadTrsf->GetTrsf(); + gp_Trsf uTrsf = uMcCadTrsf->GetTrsf(); + newTrsf->SetIdNum(++maxTNum); + newTrsf->SetTrsf(fillTrsf*uTrsf); + // bind this in the trsfmap + myTrsfMap.Bind(newTrsf->GetIdNum(),newTrsf); + newCell->SetTRCLNumber(maxTNum); + } + else + { + // only the fill has a trsf. set this number to new cell. + newCell->SetTRCLNumber(fillTNum); + } + } + else + { + newCell->SetTRCLNumber(maxTNum); + newCell->SetHaveTRCL(maxTNum); + } + // bind the new cell into the map; + myCellMap.Bind(newCell->GetCellNumber(),newCell); + } + } + } + } + } + +} + +void McCadMcRead_Reader::ResolveFiller() +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + //we resolve first the Like cards by copy. + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter; + + cIter.Initialize(myCellMap); + + //cout << "\nResolve Filler\n------------------------------------\n"; + for (; cIter.More() ; cIter.Next()) + { + Handle(McCadMcRead_Cell) aCell = cIter.Value(); + + if (aCell->IsLike()) + { + // cout << "Cell '" << aCell->GetCellNumber() << "' is like Cell '" << aCell->GetLikeNum() << "'\n"; + + //switch like now + aCell->SetHaveLike(false); + if (!myCellMap.IsBound(aCell->GetLikeNum())) + { + msgr->Message("McCadError: a companion like cell missing!", + McCadMessenger_ErrorMsg); + + return; + } + Handle(McCadMcRead_Cell) aLikeCell = myCellMap(aCell->GetLikeNum()); + + // we copy aLikeCell to aCell; + if(aCell->GetMaterialNumber() < 0) // else MAT has been declared in cell + aCell->SetMaterialNumber(aLikeCell->GetMaterialNumber()); + if(aCell->GetDensity() == 0.0) + aCell->SetDensity(aLikeCell->GetDensity()); + + // set MCNP csg + aCell->SetCSG(aLikeCell->GetCSG()); + + // set fill card; + if(aLikeCell->IsFill() && !aLikeCell->IsLat()) + { + // simple fill cell + aCell->SetHaveFill(true); + aCell->SetFill(aLikeCell->GetFill()); + } + else if (aLikeCell->IsFill() && aLikeCell->IsLat()) + { + // a lat-fill cell + aCell->SetHaveFill(true); + aCell->SetHaveLat(true); + aCell->SetLat(aLikeCell->GetLatNum()); + // we put a multi fill card + aCell->SetFillPlaceSeq(aLikeCell->GetFillPlaceSeq()); + aCell->SetFillSeq(aLikeCell->GetFillSeq()); + } + else + { + // dor error check here! + } + + if(aLikeCell->IsU()) + { + aCell->SetHaveU(true); + aCell->SetUNum(aLikeCell->GetUNum()); + } + + if(aLikeCell->HaveMacro()) + { + aCell->SetHaveMacro(true); + aCell->SetMacroIndex(aLikeCell->GetMacroIndex()); + } + + //trsf is retained; + if(aCell->IsTRCL()) // like ... but TRCL=(dadada); + { + gp_Trsf newTrsf = myTrsfMap(aCell->GetTRCLNumber())->GetTrsf(); + Handle(McCadCSGGeom_Transformation) mcTrsf = new McCadCSGGeom_Transformation; + mcTrsf->SetTrsf(newTrsf); + mcTrsf->SetIdNum(++maxTNum); + myTrsfMap.Bind(mcTrsf->GetIdNum(),mcTrsf); + aCell->SetTRCLNumber(mcTrsf->GetIdNum()); + } + + Handle(TColStd_HSequenceOfAsciiString) aCSG = new TColStd_HSequenceOfAsciiString; + aCSG->Append(aCell->GetCSG()); + TCollection_AsciiString theCSG; + + for(int k=1; k<=aCSG->Length(); k++) + theCSG += aCSG->Value(k) + TCollection_AsciiString(" "); + + McCadBoolExp_PostFixer csgPostFixer(theCSG); + aCell->SetPostFixCSG(csgPostFixer.GetPostFix()); + + //update the cell in the map + myCellMap.UnBind(aCell->GetCellNumber()); + myCellMap.Bind(aCell->GetCellNumber(),aCell); + } + } + + //we resolve here only simple fill cards + cIter.Initialize(myCellMap); + Handle(TColStd_HSequenceOfInteger) cellSeq = new TColStd_HSequenceOfInteger; + for (; cIter.More();cIter.Next()) + cellSeq->Append(cIter.Value()->GetCellNumber()); + + for(int j=1; j<=cellSeq->Length(); j++) + { + Handle(McCadMcRead_Cell) fCell = myCellMap(cellSeq->Value(j)); //cIter.Value(); + + if(fCell->IsFill() && !fCell->IsLat()) + { + cout << "Cell '" << fCell->GetCellNumber() << "' is filled with universe : " << fCell->GetFill()->GetFillNum() << endl; + // make fill cell pseudo + fCell->SetPseudo(true); + + Handle(McCadMcRead_Fill) aFill = fCell->GetFill(); + Standard_Integer uNum = aFill->GetFillNum(); + + McCadMcRead_DataMapIteratorOfDataMapOfIntegerCell cIter2; + + //cout << "FCell : " << fCell->GetCellNumber() << endl; + //cout << " Universe : " << uNum << " CITER Extent : " << myCellMap.Extent() << endl; + + cIter2.Initialize(myCellMap); + + // we can't use the cIter2 directly in the for loop, because we change the + // content of the map! + Handle(McCadMcRead_HSequenceOfCell) curCells = new McCadMcRead_HSequenceOfCell; + for(; cIter2.More(); cIter2.Next()) + curCells->Append(cIter2.Value()); + + for(Standard_Integer k=1; k<=curCells->Length(); k++) + { + Handle(McCadMcRead_Cell) uCell = curCells->Value(k); + if(uCell->IsU() && uCell->GetUNum() == uNum) + { + uCell->SetPseudo(Standard_True); + //cout << "CREATE NEW CELL " << maxCNum+1 << " FOR UNIVERSE CELL " << uCell->GetCellNumber() << endl; + Handle(McCadMcRead_Cell) newCell = new McCadMcRead_Cell; + // we merge the fill and u card to a new cell and set both pseudo. + maxCNum++; // free index in the map will serv as new cell number. + newCell->SetCellNumber(maxCNum); + newCell->SetMaterialNumber(uCell->GetMaterialNumber()); + newCell->SetDensity(uCell->GetDensity()); + newCell->SetPseudoNum(uCell->GetCellNumber()); // this will be the cells name + // set MCNP csg + Handle(TColStd_HSequenceOfAsciiString) aCSG = new TColStd_HSequenceOfAsciiString; + // for the favor of latter calculation we parenthesize the fill cell description. + + aCSG->Append(TCollection_AsciiString("(")); + aCSG->Append(fCell->GetCSG()); + aCSG->Append(TCollection_AsciiString(")")); + aCSG->Append(uCell->GetCSG()); + + newCell->SetCSG(aCSG); + // set fill card; + if(uCell->IsFill()) + { + newCell->SetHaveFill(true); + newCell->SetFill(uCell->GetFill()); + for(int l=1; l<=cellSeq->Length(); l++) + { + if(cellSeq->Value(l) == uCell->GetCellNumber()) + { + cellSeq->Remove(l); + break; + } + } + } + + if(uCell->IsLat()) + { + // a lat-fill cell + newCell->SetHaveFill(true); + newCell->SetLat(uCell->GetLatNum()); + newCell->SetHaveLat(Standard_True); + newCell->SetFill(uCell->GetFill()); + newCell->SetFillPlaceSeq(uCell->GetFillPlaceSeq()); + newCell->SetFillSeq(uCell->GetFillSeq()); + + if(uCell->IsInfiniteLattice()) + newCell->SetInfiniteLattice(); + } + + if(fCell->IsU()) + { + newCell->SetPseudo(Standard_True); + } + + // copy macro cells + if(uCell->HaveMacro()) + { + newCell->SetHaveMacro(true); + newCell->SetMacroIndex(uCell->GetMacroIndex()); + } + if(uCell->IsTRCL()) + { + newCell->SetTRCLNumber(uCell->GetTRCLNumber()); + newCell->SetTrsf(uCell->GetTrsf()); + newCell->SetHaveTRCL(Standard_True); + } + + //trsf card must be computed; + if (fCell->IsTRCL()) + { + int fillTNum = fCell->GetTRCLNumber(); + + if (uCell->IsTRCL()) + { + int uTNum = uCell->GetTRCLNumber(); + //both have trsf so we have to compute new + Handle(McCadCSGGeom_Transformation) newTrsf = new McCadCSGGeom_Transformation; + Handle(McCadCSGGeom_Transformation) fillMcCadTrsf = myTrsfMap(fillTNum); + Handle(McCadCSGGeom_Transformation) uMcCadTrsf = myTrsfMap(uTNum); + + gp_Trsf fillTrsf = fillMcCadTrsf->GetTrsf(); + gp_Trsf uTrsf = uMcCadTrsf->GetTrsf(); + + newTrsf->SetIdNum(++maxTNum); + newTrsf->SetTrsf(fillTrsf*uTrsf); + // bind this in the trsfmap + + myTrsfMap.Bind(newTrsf->GetIdNum(),newTrsf); + newCell->SetTRCLNumber(newTrsf->GetIdNum()); + newCell->SetHaveTRCL(Standard_True); + } + else + { + // only the fill has a trsf. set this number to new cell. + newCell->SetTRCLNumber(fillTNum); + newCell->SetTrsf(fCell->GetTrsf()); + newCell->SetHaveTRCL(Standard_True); + } + } + + // set CSG for new cell + TCollection_AsciiString theCSG; + + for(int k=1; k<=aCSG->Length(); k++) + theCSG += aCSG->Value(k) + TCollection_AsciiString(" "); + + McCadBoolExp_PostFixer csgPostFixer(theCSG); + newCell->SetPostFixCSG(csgPostFixer.GetPostFix()); + // bind the new cell into the map; + myCellMap.Bind(newCell->GetCellNumber(),newCell); + cellSeq->Append(maxCNum); + } + } + } + } + +// cout << "-----------------------------------------------\n#Resolve Filler\n\n"; + +} + +void McCadMcRead_Reader::GetCells(McCadMcRead_DataMapOfIntegerCell& theMap) +{ + theMap = myCellMap; +} + +void McCadMcRead_Reader::GetSurfaces(McCadCSGGeom_DataMapOfIntegerSurface& theMap) +{ + theMap = mySurfMap; +} + +void McCadMcRead_Reader::GetTrsfs(McCadCSGGeom_DataMapOfIntegerTransformation& theMap) +{ + theMap = myTrsfMap; +} + +void McCadMcRead_Reader::GetMDReader(McCadMDReader_Reader& theMDReader) +{ + theMDReader = myMDReader; +} + + +void McCadMcRead_Reader::MakeLatticeCellTransformation(const Standard_Integer& dim, const Handle_TColStd_HSequenceOfInteger& surfNum, + const gp_Pnt& thePlace, const Standard_Integer& latType) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + Handle(McCadCSGGeom_Transformation) newTrsf = new McCadCSGGeom_Transformation; + + Standard_Real deltX, deltY, deltZ; + Handle(McCadCSGGeom_Surface) x0Surf, x1Surf, y0Surf, y1Surf, z0Surf, z1Surf, y0PSurf, y1PSurf; + + if(surfNum->Length() < 4) + { + msgr->Message("_#_McCadMcRead_Reader.cxx :: not enough surfaces for lattice construction!!!", + McCadMessenger_ErrorMsg); + + return; + } + + // Get planes + x0Surf = mySurfMap(Abs(surfNum->Value(1))); + x1Surf = mySurfMap(Abs(surfNum->Value(2))); + y0Surf = mySurfMap(Abs(surfNum->Value(3))); + y1Surf = mySurfMap(Abs(surfNum->Value(4))); + + if(dim > 2 || latType == 2) // hexagonal or threedimensional lattice + { + if(dim > 2) // three dimensional + { + if(latType == 1) // hexahedral lattice + { + z0Surf = mySurfMap(Abs(surfNum->Value(5))); + z1Surf = mySurfMap(Abs(surfNum->Value(6))); + } + else // hexagonal lattice + { + y0PSurf = mySurfMap(Abs(surfNum->Value(5))); + y1PSurf = mySurfMap(Abs(surfNum->Value(6))); + z0Surf = mySurfMap(Abs(surfNum->Value(7))); + z1Surf = mySurfMap(Abs(surfNum->Value(8))); + } + } + else // two dimensional hexagonal lattice + { + y0PSurf = mySurfMap(Abs(surfNum->Value(5))); + y1PSurf = mySurfMap(Abs(surfNum->Value(6))); + } + } + + // get oriented location of planes + gp_Ax3 x0Ax, x1Ax, y0Ax, y1Ax, z0Ax, z1Ax; //, y0PAx, y1PAx; + x0Ax = x0Surf->GetAxis(); + x1Ax = x1Surf->GetAxis(); + y0Ax = y0Surf->GetAxis(); + y1Ax = y1Surf->GetAxis(); + + if(dim>2) // three dimensional lattice + { + z0Ax = z0Surf->GetAxis(); + z1Ax = z1Surf->GetAxis(); + } +/* if(latType == 2) // hexagonal lattice + { + y0PAx = y0PSurf->GetAxis(); + y1PAx = y1PSurf->GetAxis(); + }*/ + + // compute step width along the lattice vectors + deltX = Sqrt( (x1Ax.Location().X()-x0Ax.Location().X()) * (x1Ax.Location().X()-x0Ax.Location().X()) + + (x1Ax.Location().Y()-x0Ax.Location().Y()) * (x1Ax.Location().Y()-x0Ax.Location().Y()) + + (x1Ax.Location().Z()-x0Ax.Location().Z()) * (x1Ax.Location().Z()-x0Ax.Location().Z()) ); + deltY = Sqrt( (y1Ax.Location().X()-y0Ax.Location().X()) * (y1Ax.Location().X()-y0Ax.Location().X()) + + (y1Ax.Location().Y()-y0Ax.Location().Y()) * (y1Ax.Location().Y()-y0Ax.Location().Y()) + + (y1Ax.Location().Z()-y0Ax.Location().Z()) * (y1Ax.Location().Z()-y0Ax.Location().Z()) ); + deltZ = Sqrt( (z1Ax.Location().X()-z0Ax.Location().X()) * (z1Ax.Location().X()-z0Ax.Location().X()) + + (z1Ax.Location().Y()-z0Ax.Location().Y()) * (z1Ax.Location().Y()-z0Ax.Location().Y()) + + (z1Ax.Location().Z()-z0Ax.Location().Z()) * (z1Ax.Location().Z()-z0Ax.Location().Z()) ); + /*deltYP = Sqrt((y1PAx.Location().X()-y0PAx.Location().X()) * (y1PAx.Location().X()-y0PAx.Location().X()) + + (y1PAx.Location().Y()-y0PAx.Location().Y()) * (y1PAx.Location().Y()-y0PAx.Location().Y()) + + (y1PAx.Location().Z()-y0PAx.Location().Z()) * (y1PAx.Location().Z()-y0PAx.Location().Z()) );*/ + + // compute new oriented locations + Standard_Real x(0),y(0),z(0); + gp_Pnt newPnt; + gp_Trsf finalTrsf; + + //if(latType == 1) + //{ + //set newX0 + x = x0Ax.Location().X() + deltX * thePlace.X() * x0Ax.Direction().X(); + y = x0Ax.Location().Y() + deltX * thePlace.X() * x0Ax.Direction().Y(); + z = x0Ax.Location().Z() + deltX * thePlace.X() * x0Ax.Direction().Z(); + + newPnt = gp_Pnt(x,y,z); + gp_Trsf xTrsf; + xTrsf.SetTranslation(x0Ax.Location(), newPnt); + + //set newY0 + x = y0Ax.Location().X() + deltY * thePlace.Y() * y0Ax.Direction().X(); + y = y0Ax.Location().Y() + deltY * thePlace.Y() * y0Ax.Direction().Y(); + z = y0Ax.Location().Z() + deltY * thePlace.Y() * y0Ax.Direction().Z(); + + newPnt = gp_Pnt(x,y,z); + gp_Trsf yTrsf; + yTrsf.SetTranslation(y0Ax.Location(), newPnt); + + finalTrsf = xTrsf*yTrsf; + /*} + else // calculate new position for hexagonal lattice + { + //set newX0 + x = x0Ax.Location().X() + deltX * thePlace.X() * x0Ax.Direction().X(); + y = x0Ax.Location().Y() + deltX * thePlace.X() * x0Ax.Direction().Y(); + z = x0Ax.Location().Z() + deltX * thePlace.X() * x0Ax.Direction().Z(); + + newPnt = gp_Pnt(x,y,z); + gp_Trsf xTrsf; + xTrsf.SetTranslation(x0Ax.Location(), newPnt); + + //set newY0 + x = y0Ax.Location().X() + deltY * thePlace.Y() * y0Ax.Direction().X(); + y = y0Ax.Location().Y() + deltY * thePlace.Y() * y0Ax.Direction().Y(); + z = y0Ax.Location().Z() + deltY * thePlace.Y() * y0Ax.Direction().Z(); + + newPnt = gp_Pnt(x,y,z); + gp_Trsf yTrsf; + yTrsf.SetTranslation(y0Ax.Location(), newPnt); + + finalTrsf = xTrsf*yTrsf; + }*/ + + if(dim > 2) // three dimensions + { + //set newZ0 + x = z0Ax.Location().X() + deltZ * thePlace.Z() * z0Ax.Direction().X(); + y = z0Ax.Location().Y() + deltZ * thePlace.Z() * z0Ax.Direction().Y(); + z = z0Ax.Location().Z() + deltZ * thePlace.Z() * z0Ax.Direction().Z(); + newPnt = gp_Pnt(x,y,z); + gp_Trsf zTrsf; + zTrsf.SetTranslation(z0Ax.Location(), newPnt); + + finalTrsf *= zTrsf; + } + + newTrsf->SetTrsf(finalTrsf); + newTrsf->SetIdNum(maxTNum++); + + myTrsfMap.Bind(maxTNum, newTrsf); + +} diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCellPtr_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCellPtr_0.cxx new file mode 100644 index 0000000..bd89f8a --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCellPtr_0.cxx @@ -0,0 +1,87 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_SequenceOfCellPtr_HeaderFile +#include +#endif +//McCadMcRead_SequenceNodeOfSequenceOfCellPtr::~McCadMcRead_SequenceNodeOfSequenceOfCellPtr() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_SequenceNodeOfSequenceOfCellPtr_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_SequenceNodeOfSequenceOfCellPtr", + sizeof(McCadMcRead_SequenceNodeOfSequenceOfCellPtr), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr) Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCellPtr))) { + _anOtherObject = Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)((Handle(McCadMcRead_SequenceNodeOfSequenceOfCellPtr)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_SequenceNodeOfSequenceOfCellPtr::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCellPtr) ; +} +//Standard_Boolean McCadMcRead_SequenceNodeOfSequenceOfCellPtr::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCellPtr) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr::~Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr() {} +#define SeqItem McCadMcRead_CellPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCellPtr_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCellPtr +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCell_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCell_0.cxx new file mode 100644 index 0000000..a31ce36 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfCell_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceOfCell_HeaderFile +#include +#endif +//McCadMcRead_SequenceNodeOfSequenceOfCell::~McCadMcRead_SequenceNodeOfSequenceOfCell() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_SequenceNodeOfSequenceOfCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_SequenceNodeOfSequenceOfCell", + sizeof(McCadMcRead_SequenceNodeOfSequenceOfCell), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_SequenceNodeOfSequenceOfCell) Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_SequenceNodeOfSequenceOfCell) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCell))) { + _anOtherObject = Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)((Handle(McCadMcRead_SequenceNodeOfSequenceOfCell)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_SequenceNodeOfSequenceOfCell::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCell) ; +} +//Standard_Boolean McCadMcRead_SequenceNodeOfSequenceOfCell::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfCell) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadMcRead_SequenceNodeOfSequenceOfCell::~Handle_McCadMcRead_SequenceNodeOfSequenceOfCell() {} +#define SeqItem Handle_McCadMcRead_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCell +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfFill_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfFill_0.cxx new file mode 100644 index 0000000..3299b76 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceNodeOfSequenceOfFill_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceOfFill_HeaderFile +#include +#endif +//McCadMcRead_SequenceNodeOfSequenceOfFill::~McCadMcRead_SequenceNodeOfSequenceOfFill() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadMcRead_SequenceNodeOfSequenceOfFill_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadMcRead_SequenceNodeOfSequenceOfFill", + sizeof(McCadMcRead_SequenceNodeOfSequenceOfFill), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadMcRead_SequenceNodeOfSequenceOfFill) Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadMcRead_SequenceNodeOfSequenceOfFill) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfFill))) { + _anOtherObject = Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)((Handle(McCadMcRead_SequenceNodeOfSequenceOfFill)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadMcRead_SequenceNodeOfSequenceOfFill::DynamicType() const +{ + return STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfFill) ; +} +//Standard_Boolean McCadMcRead_SequenceNodeOfSequenceOfFill::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadMcRead_SequenceNodeOfSequenceOfFill) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadMcRead_SequenceNodeOfSequenceOfFill::~Handle_McCadMcRead_SequenceNodeOfSequenceOfFill() {} +#define SeqItem Handle_McCadMcRead_Fill +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfFill_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfFill +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfCellPtr_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfCellPtr_0.cxx new file mode 100644 index 0000000..64edf5a --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfCellPtr_0.cxx @@ -0,0 +1,44 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceNodeOfSequenceOfCellPtr_HeaderFile +#include +#endif + + +#define SeqItem McCadMcRead_CellPtr +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCellPtr +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCellPtr_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCellPtr +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfCell_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfCell_0.cxx new file mode 100644 index 0000000..78e1310 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfCell_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Cell_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceNodeOfSequenceOfCell_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadMcRead_Cell +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfCell +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfCell_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfCell +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfFill_0.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfFill_0.cxx new file mode 100644 index 0000000..9d364f7 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SequenceOfFill_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadMcRead_Fill_HeaderFile +#include +#endif +#ifndef _McCadMcRead_SequenceNodeOfSequenceOfFill_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadMcRead_Fill +#define SeqItem_hxx +#define TCollection_SequenceNode McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadMcRead_SequenceNodeOfSequenceOfFill +#define TCollection_SequenceNode_Type_() McCadMcRead_SequenceNodeOfSequenceOfFill_Type_() +#define TCollection_Sequence McCadMcRead_SequenceOfFill +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadMcRead/McCadMcRead_SurfaceFactory.cxx b/src/MCCAD/McCadMcRead/McCadMcRead_SurfaceFactory.cxx new file mode 100644 index 0000000..dea3cb8 --- /dev/null +++ b/src/MCCAD/McCadMcRead/McCadMcRead_SurfaceFactory.cxx @@ -0,0 +1,2084 @@ +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PI 3.1415926535897932384626433832795 + +McCadMcRead_SurfaceFactory::McCadMcRead_SurfaceFactory() +{ + myMacroBodySurfaces = NULL; + myIsMacroBody = Standard_False; + NotDone(); +} + +// copy existing McCadCSGGeom_Surface +McCadMcRead_SurfaceFactory::McCadMcRead_SurfaceFactory(const Handle_McCadCSGGeom_Surface& oldSurf) +{ + switch(oldSurf->GetType()) + { + case McCadCSGGeom_Planar: + { + Standard_Real a,b,c,d; + Handle(McCadCSGGeom_Plane) thePlane = Handle(McCadCSGGeom_Plane)::DownCast(oldSurf); + thePlane->Coefficients(a,b,c,d); + mySurface = new McCadCSGGeom_Plane(a,b,c,d); + mySurface->SetNumber(thePlane->GetNumber()); + + if(thePlane->HaveTransformation()) + { + mySurface->SetTrsf(thePlane->GetTrsf()); + mySurface->SetTrsfNumber(thePlane->GetTrsfNumber()); + } + + break; + } + case McCadCSGGeom_Cylindrical: + { + Standard_Real r; + Handle(McCadCSGGeom_Cylinder) theCylinder = Handle(McCadCSGGeom_Cylinder)::DownCast(oldSurf); + r = theCylinder->GetRadius(); + gp_Ax3 axis = theCylinder->GetAxis(); + + mySurface = new McCadCSGGeom_Cylinder(axis, r); + mySurface->SetNumber(theCylinder->GetNumber()); + + if(theCylinder->HaveTransformation()) + { + mySurface->SetTrsf(theCylinder->GetTrsf()); + mySurface->SetTrsfNumber(theCylinder->GetTrsfNumber()); + } + + break; + } + case McCadCSGGeom_Conical: + { + Standard_Real r, phi; + Handle(McCadCSGGeom_Cone) theCone = Handle(McCadCSGGeom_Cone)::DownCast(oldSurf); + r = theCone->GetRadius(); + phi = theCone->GetSemiAngle(); + gp_Ax3 axis = theCone->GetAxis(); + + mySurface = new McCadCSGGeom_Cone(axis, phi, r); + mySurface->SetNumber(theCone->GetNumber()); + + if(theCone->HaveTransformation()) + { + mySurface->SetTrsf(theCone->GetTrsf()); + mySurface->SetTrsfNumber(theCone->GetTrsfNumber()); + } + + break; + } + case McCadCSGGeom_Spherical: + { + Standard_Real r; + Handle(McCadCSGGeom_Sphere) theSphere = Handle(McCadCSGGeom_Sphere)::DownCast(oldSurf); + r = theSphere->GetRadius(); + gp_Ax3 axis = theSphere->GetAxis(); + + mySurface = new McCadCSGGeom_Sphere(axis, r); + mySurface->SetNumber(theSphere->GetNumber()); + + if(theSphere->HaveTransformation()) + { + mySurface->SetTrsf(theSphere->GetTrsf()); + mySurface->SetTrsfNumber(theSphere->GetTrsfNumber()); + } + + break; + } + case McCadCSGGeom_Toroidal: + { + Standard_Real rMin, rMaj; + Handle(McCadCSGGeom_Torus) theTorus = Handle(McCadCSGGeom_Torus)::DownCast(oldSurf); + rMin = theTorus->GetMinorRadius(); + rMaj = theTorus->GetMajorRadius(); + gp_Ax3 axis = theTorus->GetAxis(); + + mySurface = new McCadCSGGeom_Torus(axis, rMin, rMaj); + mySurface->SetNumber(theTorus->GetNumber()); + + if(theTorus->HaveTransformation()) + { + mySurface->SetTrsf(theTorus->GetTrsf()); + mySurface->SetTrsfNumber(theTorus->GetTrsfNumber()); + } + + break; + } + case McCadCSGGeom_Quadric: + { + + Standard_Real c1, c2, c3, c4, c5, c6, c7, c8, c9, c10; + Handle(McCadCSGGeom_GQ) theGQ = Handle(McCadCSGGeom_GQ)::DownCast(oldSurf); + theGQ->Coefficients(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10); + mySurface = new McCadCSGGeom_GQ(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10); + mySurface->SetNumber(theGQ->GetNumber()); + + if(theGQ->HaveTransformation()) + { + mySurface->SetTrsf(theGQ->GetTrsf()); + mySurface->SetTrsfNumber(theGQ->GetTrsfNumber()); + } + + break; + } + case McCadCSGGeom_OtherSurface: + { + cout << "_#_McCadMcRead_SurfaceFactory :: unknown surface could not be initialized\n"; + break; + } + default: + cout << "_#_McCadMcRead_SurfaceFactory :: unknown surface type\n"; + } + + Done(); +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::IsDone() const +{ + return myIsDone; +} + + +void McCadMcRead_SurfaceFactory::Done() +{ + myIsDone = Standard_True; +} + + +void McCadMcRead_SurfaceFactory::NotDone() +{ + myIsDone = Standard_False; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeSurface(const TCollection_AsciiString& sDesc) +{ + if (sDesc.Search(" P") > 0) + { + if (MakePlane(sDesc)) + Done(); + else + { + ::cout << "Making a Plane surface failed!!" << endl; + NotDone(); + } + } + else if (sDesc.Search(" S") > 0 && sDesc.Search(" SQ") < 0) // + { + if(MakeSphere(sDesc)) + Done(); + else + { + ::cout << "Making a Sphere surface failed!!" << endl; + NotDone(); + } + } + else if (sDesc.Search(" C") > 0 ) + { + if(MakeCylinder(sDesc)) + Done(); + else + { + ::cout << "Making a Cylinder surface failed!!" << endl; + NotDone(); + } + } + else if (sDesc.Search(" K") > 0 ) + { + if(MakeCone(sDesc)) + Done(); + else + { + ::cout << "Making a Cone surface failed!!" << endl; + NotDone(); + } + } + else if (sDesc.Search(" T") > 0 ) + { + if(MakeTorus(sDesc)) + Done(); + else + { + ::cout << "Making a Torus surface failed!!" << endl; + NotDone(); + } + } + else if (sDesc.Search(" GQ") > 0 ) + { + if(MakeGQ(sDesc)) + Done(); + else + { + ::cout << "Making a GQ surface failed!!" << endl; + NotDone(); + } + } + else if (sDesc.Search(" SQ") > 0 ) + { + cout << "SQ not yet implemented \n"; + } + else if (sDesc.Search(" X") > 0 || sDesc.Search(" Y") > 0 || sDesc.Search(" Z") > 0) // axissymmetric surfaces defined by points + { + if(MakeAxissymmetricSurfaceByPoints(sDesc)) + Done(); + else + { + ::cout << "Making an Axissymmetric Surface defined by Points failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" BOX ") > 0) + { + InitMacroBodySurfaces(); + + if(MakeBOX(sDesc)) + Done(); + else + { + cout << "Making a BOX failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" RPP ") > 0) + { + InitMacroBodySurfaces(); + cout << "RPP -- MACRO BODY!!!\n"; + if(MakeRPP(sDesc)) + Done(); + else + { + cout << "Making a RPP failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" RCC ") > 0) + { + InitMacroBodySurfaces(); + cout << "RCC -- MACRO BODY!!!\n"; + if(MakeRCC(sDesc)) + Done(); + else + { + cout << "Making a RCC failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" RHP ") > 0 || sDesc.Search(" HEX ") > 0 ) + { + InitMacroBodySurfaces(); + cout << "HEX/RHP -- MACRO BODY!!!\n"; + + if(MakeHEX(sDesc)) + Done(); + else + { + cout << "Making a RHP/HEX failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" REC ") > 0) + { + InitMacroBodySurfaces(); + cout << "REC -- MACRO BODY!!!\n"; + if(MakeREC(sDesc)) + Done(); + else + { + cout << "Making a REC failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" TRC ") > 0) + { + InitMacroBodySurfaces(); + cout << "TRC -- MACRO BODY!!!\n"; + if(MakeTRC(sDesc)) + Done(); + else + { + cout << "Making a TRC failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" ELL ") > 0) + { + InitMacroBodySurfaces(); + cout << "ELL -- MACRO BODY!!!\n"; + if(MakeELL(sDesc)) + Done(); + else + { + cout << "Making a ELL failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" WED ") > 0) + { + InitMacroBodySurfaces(); + cout << "WED -- MACRO BODY!!!\n"; + if(MakeWED(sDesc)) + Done(); + else + { + cout << "Making a WED failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else if(sDesc.Search(" ARB ") > 0) + { + InitMacroBodySurfaces(); + cout << "ARB -- MACRO BODY!!!\n"; + if(MakeARB(sDesc)) + Done(); + else + { + cout << "Making a ARB failed for : " << sDesc.ToCString() << endl; + NotDone(); + } + } + else + { + NotDone(); + ::cout << "Making a surface failed!!" << endl; + ::cout << "Unknown surface type!!" << endl; + } + + + if (IsDone()) + { + // set surface number + // set TrsfNumber + // set trsf; + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + TCollection_AsciiString sEnd; + if( tmpStr.Search("*") > 0 ) + { + //cout << "Reflecting Surface found. This information is not retained. " << endl; + sEnd = tmpStr.Split(tmpStr.Search("*")); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + tmpStr.Clear(); + tmpStr = sEnd; + } + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + sEnd = tmpStr.Split(tmpStr.Search(" ")); + // tmpStr is SurfNum + if(tmpStr.IsIntegerValue()) + { + if(tmpStr.IntegerValue() > 0 && tmpStr.IntegerValue() < 99999) + mySurface->SetNumber(tmpStr.IntegerValue()); + /*else + { + cout << "Surface Number out of range: " << tmpStr.IntegerValue() << endl; + }*/ + } + else + { + cout << "Surface Number missing on the surface card!!" << tmpStr.IntegerValue() << endl; + } + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + tmpStr.Clear(); + tmpStr = sEnd; + sEnd = tmpStr.Split(tmpStr.Search(" ")); + + ////////////////////////////////////// + // tmpStr is TrsfNum or period + if(tmpStr.IsIntegerValue()) + { + if(tmpStr.IntegerValue() > 0) + { + mySurface->SetTrsfNumber(tmpStr.IntegerValue()); + + if(mySurface->IsMacroBody()) + { + Standard_Integer sInt = tmpStr.IntegerValue(); + + for(Standard_Integer i=1; i<=myMacroBodySurfaces->Length(); i++) + myMacroBodySurfaces->Value(i)->SetTrsfNumber(sInt); + } + } + else + { + cout << "Periodic Surface found. This information is not retained. " << endl; + } + } + } + + return IsDone(); + +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakePlane( const TCollection_AsciiString& sDesc) +{ + //cout << "Making a planar Surface !!" << endl; + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + Standard_Real a=0, b=0, c=0, d=0; + + if (tmpStr.Search(" PX") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("PX")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + a = 1; + d = sEnd.RealValue(); + d=d*-1; + } + else if (tmpStr.Search(" PY") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("PY")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + b = 1; + d = sEnd.RealValue(); + d=d*-1; + } + else if (tmpStr.Search(" PZ") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("PZ")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + c = 1; + d = sEnd.RealValue(); + d=d*-1; + } + else if (tmpStr.Search(" P ") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("P")+1); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while (true) + { + TCollection_AsciiString sEnd2; + if (sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if (sEnd.IsRealValue()) + realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if (realSeq->Length() == 4) + { + a = realSeq->Value(1); + b = realSeq->Value(2); + c = realSeq->Value(3); + d = realSeq->Value(4); + d=d*-1; + } + else if (realSeq->Length() == 9) + { + gp_Pnt P1(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)); + gp_Pnt P2(realSeq->Value(4), realSeq->Value(5), realSeq->Value(6)); + gp_Pnt P3(realSeq->Value(7), realSeq->Value(8), realSeq->Value(9)); + gp_Vec v1(P1, P2), v2(P1, P3); + if (v1.IsParallel(v2, 0.0001)) + { +:: cout << "Colinear points: can not make a Plane !" << endl; + return false; + } + gp_Vec v3 = v1 ^ v2; + v3.Normalize(); + gp_Dir D1(v3); + gp_Pln aPln(P1,D1); + // orient the plane + Standard_Real a1=0, b1=0, c1=0, d1=0; + aPln.Coefficients(a1,b1,c1,d1); + + //cout << "GENERAL PLANE DEFINED BY POINTS --> Coefficients : " << a1 << " " << b1 << " " << c1 << " " << d1 << endl; + + d1*=-1; // what follows is a test for the planes orientation + // for this reason we have to multiply d1 by -1 since the + // plane equation is Ax+By+Cz -D =0 + + if(d1<0) + { + a = -a1; + b = -b1; + c = -c1; + d = d1; + } + else if ( d1 > 0 ) + { + a = a1; + b = b1; + c = c1; + d = -d1; + } + else + { + if(c1 == 0) + { + if(b1 == 0) //D=0 C=0 B=0; + + { + if(a1 < 0 ) + { + a= -a1; b = -b1; c = -c1; + d = -d1; + } + } + else + { + if(b1<0) //D= 0; C =0; + + { + a= -a1; b = -b1; c = -c1; + d = -d1; + } + } + } + else + { + if(c1 < 0) //D =0; + + { + a= -a1; b = -b1; c = -c1; + d = -d1; + } + } + + } + } + } + else + { + ::cout << "Can not make a Plane: insufficient number of points !" << endl; + return false; + } + mySurface = new McCadCSGGeom_Plane(a,b,c,d); + return true; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeCylinder( + const TCollection_AsciiString& sDesc) +{ + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + Standard_Real r=0; + gp_Ax3 a3X; + if (tmpStr.Search(" C/X") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("C/X")+3); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while (true) + { + TCollection_AsciiString sEnd2; + if (sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if (sEnd.IsRealValue()) + realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if (realSeq->Length() == 3 && realSeq->Value(3) > 0) + { + gp_Dir aDir = gp::DX(); + gp_Pnt aPnt(0, realSeq->Value(1), realSeq->Value(2)); + gp_Ax3 t3X(aPnt, aDir); + a3X = t3X; + r = realSeq->Value(3); + } + else + { +:: cout << "Error in Cylinder Surface Card Parameter!" << endl; return false; + } + } + else if ( tmpStr.Search(" C/Y") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("C/Y")+3); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if(realSeq->Length() == 3 && realSeq->Value(3) > 0 ) + { + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),0,realSeq->Value(2)), gp::DY()); + a3X = t3X; + r = realSeq->Value(3); + } + else + { + ::cout << "Error in Cylinder Surface Card Parameter!" << endl; return false; + } + } + else if ( tmpStr.Search(" C/Z") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("C/Z")+3); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if(realSeq->Length() == 3 && realSeq->Value(3) > 0 ) + { + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),realSeq->Value(2),0), gp::DZ()); + a3X = t3X; + r = realSeq->Value(3); + } + else + { + ::cout << "Error in Cylinder Surface Card Parameter!" << endl; return false; + } + } + else if ( tmpStr.Search(" CX") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("CX")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + if(sEnd.RealValue() > 0 ) + { + gp_Ax3 t3X(gp_Pnt(0,0,0), gp::DX()); + a3X = t3X; + r = sEnd.RealValue(); + } + else + { + ::cout << "Error in Cylinder Surface Card Parameter!" << endl; return false; + } + } + else if ( tmpStr.Search(" CY") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("CY")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + if(sEnd.RealValue() > 0 ) + { + gp_Ax3 t3X(gp_Pnt(0,0,0), gp::DY()); + a3X = t3X; + r = sEnd.RealValue(); + } + else + { + ::cout << "Error in Cylinder Surface Card Parameter!" << endl; + return false; + + } + } + else if ( tmpStr.Search(" CZ") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("CZ")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + if(sEnd.RealValue() > 0 ) + { + gp_Ax3 t3X(gp_Pnt(0,0,0), gp::DZ()); + a3X = t3X; + r = sEnd.RealValue(); + } + else + { + ::cout << "Error in Cylinder Surface Card Parameter!" << endl; + return false; + + } + } + else + { + ::cout << "Error in Cylinder Surface Card Parameter!" << endl; + return false; + } + + mySurface = new McCadCSGGeom_Cylinder (a3X,r); + return true; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeCone(const TCollection_AsciiString& sDesc) +{ + int theSheet(0); + + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + Standard_Real ang=0, rad=0; + gp_Ax3 a3X; + if (tmpStr.Search(" K/X") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("K/X")+3); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while (true) + { + TCollection_AsciiString sEnd2; + if (sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if (sEnd.IsRealValue()) + realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if ((realSeq->Length() == 4 || realSeq->Length() == 5) && realSeq->Value(4) > 0 ) + { + if(realSeq->Length() == 5) + theSheet = int(realSeq->Value(5)); + + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1), realSeq->Value(2), + realSeq->Value(3)), gp::DX()); + a3X = t3X; + Standard_Real tanAng = sqrt(realSeq->Value(4)); + ang = atan(tanAng); + if (realSeq->Length() == 5) + { + ang = -1 * ang*realSeq->Value(5); + } + //a half angle Ang should be between -Pi/2. and Pi/2. + if (ang > PI/2 || ang < -PI/2.) + { +:: cout << "The semi-angle of the cone is not between -Pi/2. and Pi/2.!!" << endl; + return false; + } + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" K/Y") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("K/Y")+3); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if((realSeq->Length() == 4 ||realSeq->Length() == 5) && realSeq->Value(4) > 0 ) + { + if(realSeq->Length() == 5) + theSheet = int(realSeq->Value(5)); + + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),realSeq->Value(2),realSeq->Value(3)), gp::DY()); + a3X = t3X; + Standard_Real tanAng = sqrt(realSeq->Value(4)); + ang = atan(tanAng); + if(realSeq->Length() == 5) + { + ang = -1 * ang*realSeq->Value(5); + } + //a half angle Ang should be between -Pi/2. and Pi/2. + if(ang > PI/2 || ang < -PI/2.) + { + ::cout << "The semi-angle of the cone is not between -Pi/2. and Pi/2.!!" << endl; + return false; + } + + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" K/Z") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("K/Z")+3); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1 ) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if((realSeq->Length() == 4 ||realSeq->Length() == 5) && realSeq->Value(4) > 0 ) + { + if(realSeq->Length() == 5) + theSheet = int(realSeq->Value(5)); + + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),realSeq->Value(2),realSeq->Value(3)), gp::DZ()); + a3X = t3X; + Standard_Real tanAng = sqrt(realSeq->Value(4)); + ang = atan(tanAng); + if(realSeq->Length() == 5) + { + ang = -1 * ang*realSeq->Value(5); + } + //a half angle Ang should be between -Pi/2. and Pi/2. + if(ang > PI/2 || ang < -PI/2.) + { + ::cout << "The semi-angle of the cone is not between -Pi/2. and Pi/2.!!" << endl; + return false; + } + + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" KX") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("KX")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if(realSeq->Length() == 2 || realSeq->Length() == 3) + { + if(realSeq->Length() == 3) + theSheet = int(realSeq->Value(3)); + + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),0,0), gp::DX()); + a3X = t3X; + Standard_Real tanAng = sqrt(realSeq->Value(2)); + ang = atan(tanAng); + //a half angle Ang should be between -Pi/2. and Pi/2. + if(realSeq->Length() == 3) + { + ang = -1 * ang*realSeq->Value(3); + } + if(ang > PI/2 || ang < -PI/2.) + { + ::cout << "The semi-angle of the cone is not between -Pi/2. and Pi/2.!!" << endl; + return false; + } + + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" KY") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("KY")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if(realSeq->Length() == 2 || realSeq->Length() == 3) + { + if(realSeq->Length() == 3) + theSheet = int(realSeq->Value(3)); + + gp_Ax3 t3X(gp_Pnt(0,realSeq->Value(1),0), gp::DY()); + a3X = t3X; + Standard_Real tanAng = sqrt(realSeq->Value(2)); + // cout << "TANGENT ALPHA : " << tanAng << endl; + ang = atan(tanAng); + if(realSeq->Length() == 3) + { + ang = -1 * ang*realSeq->Value(3); + } + //a half angle Ang should be between -Pi/2. and Pi/2. + if(ang > PI/2 || ang < -PI/2.) + { + ::cout << "The semi-angle of the cone is not between -Pi/2. and Pi/2.!!" << endl; + return false; + } + + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" KZ") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("KZ")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1 ) + { + sEnd2 = sEnd.Split(sEnd.Search(" ")); + } + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + + if(sEnd.IsRealValue()) + realSeq->Append(sEnd.RealValue()); + + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + + if(realSeq->Length() == 2 || realSeq->Length() == 3) + { + if(realSeq->Length() == 3) + theSheet = int(realSeq->Value(3)); + + gp_Ax3 t3X(gp_Pnt(0,0,realSeq->Value(1)), gp::DZ()); + a3X = t3X; + Standard_Real tanAng = sqrt(realSeq->Value(2)); + ang = atan(tanAng); + + if(realSeq->Length() == 3) + { + ang = -1 * ang * realSeq->Value(3); + } + + //a half angle Ang should be between -Pi/2. and Pi/2. + if(ang > PI/2 || ang < -PI/2.) + { + ::cout << "The semi-angle of the cone is not between -Pi/2. and Pi/2.!!" << endl; + return false; + } + + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + } + else + { + ::cout << "Error in Cone Surface Card Parameter!" << endl; + return false; + } + + mySurface = new McCadCSGGeom_Cone(a3X,ang,rad, theSheet); + return true; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeSphere(const TCollection_AsciiString& sDesc) +{ + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + Standard_Real rad=0.0; + gp_Ax3 a3X; + gp_Pnt origin(0,0,0); + + if (tmpStr.Search(" S ") > 0 || tmpStr.Search(" SPH ") > 0) // latter is macrobody but has the same definition + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("S")+1); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while (true) + { + TCollection_AsciiString sEnd2; + if (sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if (sEnd.IsRealValue()) + realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if (realSeq->Length() == 4 && realSeq->Value(4) > 0) + { + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)), gp::DZ()); + a3X = t3X; + rad = realSeq->Value(4); + + if (rad <=0) + { + cout << "The radius of a shpere should be grater than zero!!" << endl; + return false; + } + } + else + { + cout << "Error in Sphere Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" SX") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("SX")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + Standard_Real x = sEnd.RealValue(); + rad = sEnd2.RealValue(); + gp_Ax3 t3X(gp_Pnt(x,0,0), gp::DZ()); + a3X = t3X; + if(rad <=0 ) + { + ::cout << "The radius of a shpere should be grater than zero!!" << endl; + return false; + } + } + else if ( tmpStr.Search(" SY") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("SY")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ")) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + Standard_Real y = sEnd.RealValue(); + rad = sEnd2.RealValue(); + gp_Ax3 t3X(gp_Pnt(0,y,0), gp::DZ()); + a3X = t3X; + if(rad <=0 ) + { + ::cout << "The radius of a shpere should be grater than zero!!" << endl; + return false; + } + } + else if ( tmpStr.Search(" SZ") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("SZ")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + Standard_Real z = sEnd.RealValue(); + rad = sEnd2.RealValue(); + gp_Ax3 t3X(gp_Pnt(0,0,z), gp::DZ()); + a3X = t3X; + if(rad <=0 ) + { + ::cout << "The radius of a shpere should be grater than zero!!" << endl; + return false; + } + } + else if ( tmpStr.Search(" SO") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("SO")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + + rad = sEnd.RealValue(); + gp_Ax3 t3X(gp_Pnt(0,0,0), gp::DZ()); + a3X = t3X; + if(rad <= 0 ) + { + ::cout << "The radius of a shpere should be grater than zero!!" << endl; + return false; + } + } + else + { + ::cout << "Error in Sphere Surface Card Parameter!" << endl; + return false; + } + + mySurface = new McCadCSGGeom_Sphere(a3X,rad); + return true; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeTorus(const TCollection_AsciiString& sDesc) +{ + TCollection_AsciiString tmpStr = sDesc; + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + Standard_Real majrad=0, minrad=0; + gp_Ax3 a3X; + if (tmpStr.Search(" TX") > 0) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("TX")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while (true) + { + TCollection_AsciiString sEnd2; + if (sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if (sEnd.IsRealValue()) + realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if (realSeq->Length() == 6 && realSeq->Value(4) > 0 && realSeq->Value(5) > 0 && realSeq->Value(6) > 0) + { + if (realSeq->Value(5) != realSeq->Value(6)) + { + //Make Surface Of Reveolution + //Create Ax2 + // cout << "ELLIPTICAL TORUS - X\n"; + + gp_Pnt ellOri(realSeq->Value(1),realSeq->Value(2)+realSeq->Value(4),realSeq->Value(3)); + gp_Pnt revOri(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)); + gp_Dir ellipseNormal(0,0,1); + gp_Dir ellipseMajAxisDir; + + gp_Ax2 ax2; + Standard_Real rMaj, rMin; + if(realSeq->Value(5) >= realSeq->Value(6)) // orient ax2 of ellipse according to input + { + ellipseMajAxisDir = gp_Dir(1,0,0); + rMin = realSeq->Value(6); + rMaj = realSeq->Value(5); + } + else + { + ellipseMajAxisDir = gp_Dir(0,1,0); + rMin = realSeq->Value(5); + rMaj = realSeq->Value(6); + } + + ax2 = gp_Ax2(ellOri, ellipseNormal, ellipseMajAxisDir); + + Handle(Geom_Ellipse) anEllipse = new Geom_Ellipse(ax2, rMaj, rMin); + //make surface of revolution + gp_Dir rotAxis(1,0,0); + gp_Ax1 revAx(revOri, rotAxis); + Handle(Geom_Curve) basisCurve = Handle(Geom_Curve)::DownCast(anEllipse); + + mySurface = new McCadCSGGeom_SurfaceOfRevolution(revAx, basisCurve, realSeq); + + return true; + } + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),realSeq->Value(2),realSeq->Value(3)), gp::DX()); + a3X = t3X; + majrad = realSeq->Value(4); + minrad = realSeq->Value(5); + } + else + { + ::cout << "Error in Sphere Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" TY") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("TY")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if(realSeq->Length() == 6 && realSeq->Value(4) > 0 && realSeq->Value(5) > 0 && realSeq->Value(6) > 0) + { + if (realSeq->Value(5) != realSeq->Value(6)) + { + //cout << "ELLIPTICAL TORUS - Y\n"; + + gp_Pnt ellOri(realSeq->Value(1),realSeq->Value(2),realSeq->Value(3)+realSeq->Value(4)); + gp_Pnt revOri(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)); + gp_Dir ellipseNormal(1,0,0); + gp_Dir ellipseMajAxisDir; + + gp_Ax2 ax2; + Standard_Real rMaj, rMin; + if(realSeq->Value(5) >= realSeq->Value(6)) // orient ax2 of ellipse according to input + { + ellipseMajAxisDir = gp_Dir(0,1,0); + rMin = realSeq->Value(6); + rMaj = realSeq->Value(5); + } + else + { + ellipseMajAxisDir = gp_Dir(0,0,1); + rMin = realSeq->Value(5); + rMaj = realSeq->Value(6); + } + + ax2 = gp_Ax2(ellOri, ellipseNormal, ellipseMajAxisDir); + + Handle(Geom_Ellipse) anEllipse = new Geom_Ellipse(ax2, rMaj, rMin); + //make surface of revolution + gp_Dir rotAxis(0,1,0); + gp_Ax1 revAx(revOri, rotAxis); + Handle(Geom_Curve) basisCurve = Handle(Geom_Curve)::DownCast(anEllipse); + + mySurface = new McCadCSGGeom_SurfaceOfRevolution(revAx, basisCurve, realSeq); + + return true; + } + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),realSeq->Value(2),realSeq->Value(3)), gp::DY()); + a3X = t3X; + majrad = realSeq->Value(4); + minrad = realSeq->Value(5); + } + else + { + ::cout << "Error in Torus Surface Card Parameter!" << endl; + return false; + } + } + else if ( tmpStr.Search(" TZ") > 0 ) + { + TCollection_AsciiString sEnd = tmpStr.Split(tmpStr.Search("TZ")+2); + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + while(true) + { + TCollection_AsciiString sEnd2; + if(sEnd.Search(" ") > 1) + sEnd2 = sEnd.Split(sEnd.Search(" ")); + else + { + realSeq->Append(sEnd.RealValue()); + break; + } + if(sEnd.IsRealValue()) realSeq->Append(sEnd.RealValue()); + sEnd.Clear(); + sEnd = sEnd2; + sEnd.LeftAdjust(); + sEnd.RightAdjust(); + } + if(realSeq->Length() == 6 && realSeq->Value(4) > 0 && realSeq->Value(5) > 0 && realSeq->Value(6) > 0) + { + if (realSeq->Value(5) != realSeq->Value(6)) + { + // cout << "ELLIPTICAL TORUS - Z\n"; + + gp_Pnt ellOri(realSeq->Value(1),realSeq->Value(2)+realSeq->Value(4),realSeq->Value(3)); + gp_Pnt revOri(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)); + gp_Dir ellipseNormal(1,0,0); + gp_Dir ellipseMajAxisDir; + + gp_Ax2 ax2; + Standard_Real rMaj, rMin; + if(realSeq->Value(5) >= realSeq->Value(6)) // orient ax2 of ellipse according to input + { + ellipseMajAxisDir = gp_Dir(0,0,1); + rMin = realSeq->Value(6); + rMaj = realSeq->Value(5); + } + else + { + ellipseMajAxisDir = gp_Dir(0,1,0); + rMin = realSeq->Value(5); + rMaj = realSeq->Value(6); + } + + ax2 = gp_Ax2(ellOri, ellipseNormal, ellipseMajAxisDir); + + Handle(Geom_Ellipse) anEllipse = new Geom_Ellipse(ax2, rMaj, rMin); + //make surface of revolution + gp_Dir rotAxis(0,0,1); + gp_Ax1 revAx(revOri, rotAxis); + Handle(Geom_Curve) basisCurve = Handle(Geom_Curve)::DownCast(anEllipse); + + mySurface = new McCadCSGGeom_SurfaceOfRevolution(revAx, basisCurve, realSeq); + + return true; + + } + gp_Ax3 t3X(gp_Pnt(realSeq->Value(1),realSeq->Value(2),realSeq->Value(3)), gp::DZ()); + a3X = t3X; + majrad = realSeq->Value(4); + minrad = realSeq->Value(5); + } + else + { + ::cout << "Error in Torus Surface Card Parameter!" << endl; + return false; + } + } + else + { + ::cout << "Error in Sphere Surface Card Parameter!" << endl; + return false; + } + + mySurface = new McCadCSGGeom_Torus(a3X,majrad, minrad); + + return true; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeGQ(const TCollection_AsciiString& sDesc) +{ + // cylinder + //cout << sDesc.ToCString() << endl; + //cout << "Can not make a GQ yet!!" << endl; + + //extract values + TCollection_AsciiString coeff = sDesc; + coeff.LeftAdjust(); + coeff.Remove(1, coeff.Search("GQ")+2); + coeff.LeftAdjust(); + TColStd_ListOfReal coeffList; + + while(true) + { + if(coeff.Search(" ")>0) + { + TCollection_AsciiString aVal = coeff; + coeff = aVal.Split(aVal.Search(" ")); + + if(!aVal.IsRealValue()) // skip all spaces + continue; + + coeffList.Append(aVal.RealValue()); + } + else + { + coeffList.Append(coeff.RealValue()); + break; + } + } + + if(coeffList.Extent()!=10) + { + cout << "GQ :: has not 10 coefficients!!!\n"; + return Standard_False; + } + + Standard_Real a,b,c,d,e,f,g,h,j,k; + a = coeffList.First(); coeffList.RemoveFirst(); + b = coeffList.First(); coeffList.RemoveFirst(); + c = coeffList.First(); coeffList.RemoveFirst(); + d = coeffList.First(); coeffList.RemoveFirst(); + e = coeffList.First(); coeffList.RemoveFirst(); + f = coeffList.First(); coeffList.RemoveFirst(); + g = coeffList.First(); coeffList.RemoveFirst(); + h = coeffList.First(); coeffList.RemoveFirst(); + j = coeffList.First(); coeffList.RemoveFirst(); + k = coeffList.First(); coeffList.RemoveFirst(); + + + + // cout << "\n_#_McCadMcRead_SurfaceFactory.cxx :: WARNING !!! Generic Quadrics not yet implemented !!! \n\n"; + + mySurface = new McCadCSGGeom_GQ(a,b,c,d,e,f,g,h,j,k); + + return Standard_True; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeAxissymmetricSurfaceByPoints(const TCollection_AsciiString& sDesc) +{ + TCollection_AsciiString tmpStr = sDesc; + + +// cout << "Axissymmetric by points...\n\n"; + + gp_Dir axeOfSym; + gp_Dir X=gp::DX(), Y=gp::DY(), Z=gp::DZ(); + + if(sDesc.Search(" X") > 0) + { + axeOfSym = gp::DX(); + tmpStr.Remove(1,sDesc.Search(" X")+1); + } + else if(sDesc.Search(" Y") > 0) + { + axeOfSym = gp::DY(); + tmpStr.Remove(1,sDesc.Search(" Y")+1); + } + else if(sDesc.Search(" Z") > 0) + { + axeOfSym = gp::DZ(); + tmpStr.Remove(1,sDesc.Search(" Z")+1); + } + else + { + cout << "_#_McCadMcRead_SurfaceFactory.cxx :: Not an axissymmetric surface defined by points!!!" << endl; + return Standard_False; + } + + // retrieve Points + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + Handle(TColStd_HSequenceOfReal) pntSeq = new TColStd_HSequenceOfReal; + + while(true) + { + if(tmpStr.Search(" ") < 0) // final point + { + if(tmpStr.IsRealValue()) + pntSeq->Append(tmpStr.RealValue()); + else + cout << "_#_ McCadMcRead_SurfaceFactory.cxx :: Point is not a real value!\n"; + + break; + } + + TCollection_AsciiString pntStr = tmpStr.Split(tmpStr.Search(" ")-1); + + if(tmpStr.IsRealValue()) + pntSeq->Append(tmpStr.RealValue()); + else + cout << "_#_ McCadMcRead_SurfaceFactory.cxx :: Point is not a real value!\n"; + + tmpStr = pntStr; + tmpStr.LeftAdjust(); + } + + Standard_Integer numPnts = pntSeq->Length(); + + //Create Surfaces + switch(numPnts) + { + case 2: + { // a Plane + return PointPlane(axeOfSym, pntSeq); + } + break; + case 4: // a Plane, Cylinder or Cone + { + // cout << "FOUR PARAMETERS\n"; + if(pntSeq->Value(1) == pntSeq->Value(3))//we assume a plane + { + return PointPlane(axeOfSym, pntSeq); + } + else if(pntSeq->Value(2) == pntSeq->Value(4)) //cylinder + { + return PointCylinder(axeOfSym, pntSeq); + } + else //Cone + { + return PointCone(axeOfSym, pntSeq); + } + } + break; + case 6: // a Plane, Cylinder, Cone, Sphere or Special Quadric + { + if(pntSeq->Value(1) == pntSeq->Value(3) && pntSeq->Value(1) == pntSeq->Value(5))//we assume a plane + { + return PointPlane(axeOfSym, pntSeq); + } + else if(pntSeq->Value(2) == pntSeq->Value(4) && pntSeq->Value(2) == pntSeq->Value(6)) //cylinder + { + return PointCylinder(axeOfSym, pntSeq); + } + else //Cone + { + cout << "!!!!!!!! WARNING : Axissymmetric Surface with six pairs of points defined. SQ and spheres are not yet implemented.\n"; + cout << " assuming a cone\n"; + + //TODO: implement Sx, with x in {Q,X,Y,Z,O,\X,\Y,\Z} + + return PointCone(axeOfSym, pntSeq); + } + } + break; + default: + cout << "Number of point pairs not valid!!!\n"; + return Standard_False; + } + + + return Standard_False; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeBOX(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + + // resolve box planes + + TCollection_AsciiString tmpStr = sDesc; + + if(tmpStr.Search(" BOX") < 0) + return Standard_False; + + tmpStr.Remove(1, tmpStr.Search(" BOX")+4); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + + while(true) + { + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + if(tmpStr.Search(" ") > 0) + { + TCollection_AsciiString beg = tmpStr; + tmpStr = beg.Split(beg.Search(" ")); + beg.LeftAdjust(); + beg.RightAdjust(); + if(beg.IsRealValue()) + realSeq->Append(beg.RealValue()); + else + { + cout << "Real Value expected!\n"; + return Standard_False; + } + } + else + { + if(tmpStr.IsRealValue()) + realSeq->Append(tmpStr.RealValue()); + else + { + cout << "Real Value expected!\n"; + return Standard_False; + } + + break; + } + } + + if(realSeq->Length() != 12) + { + cout << "Wrong number of entries in box definition : " << realSeq->Length() << endl; + cout << sDesc.ToCString() << endl; + return Standard_False; + } + + gp_Pnt ori(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)); + gp_Vec a1(realSeq->Value(4), realSeq->Value(5), realSeq->Value(6)); + gp_Vec a2(realSeq->Value(7), realSeq->Value(8), realSeq->Value(9)); + gp_Vec a3(realSeq->Value(10), realSeq->Value(11), realSeq->Value(12)); + + ////////////////////////////////////// + // Build new Surfaces + + gp_Pln pl1(ori, a1.Reversed()); + gp_Pln pl2(ori, a2.Reversed()); + gp_Pln pl3(ori, a3.Reversed()); + gp_Pnt pnt4(ori.X()+a3.X(), ori.Y()+a3.Y(), ori.Z()+a3.Z()); + gp_Pln pl4(pnt4, a3); + gp_Pnt pnt5(ori.X()+a2.X(), ori.Y()+a2.Y(), ori.Z()+a2.Z()); + gp_Pln pl5(pnt5, a2); + gp_Pnt pnt6(ori.X()+a1.X(), ori.Y()+a1.Y(), ori.Z()+a1.Z()); + gp_Pln pl6(pnt6, a1); + + Standard_Real a,b,c,d; + pl1.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf1 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf1); + pl2.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf2 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf2); + pl3.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf3 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf3); + pl4.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf4 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf4); + pl5.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf5 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf5); + pl6.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf6 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf6); + + return Standard_True; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeRPP(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + return Standard_False; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeRCC(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + + gp_Pnt basePnt(0.0,0.0,0.0); + gp_Dir theDir(0,0,1); + gp_Ax1 theAxis; + Standard_Real radius(0.0); + + TCollection_AsciiString tmpStr = sDesc; + TCollection_AsciiString rest = tmpStr.Split(sDesc.Search("RCC") + 3); + rest.LeftAdjust(); + + //extract basis + Handle(TColStd_HSequenceOfReal) realValues = new TColStd_HSequenceOfReal; + while(true){ + if(rest.Search(" ") < 0) { + rest.RightAdjust(); + if(!rest.IsRealValue()) { + cout << "RCC : Real value expected\n"; + return Standard_False; + } + + realValues->Append(rest.RealValue()); + break; + } + + tmpStr = rest.Split(rest.Search(" ")); + rest.RightAdjust(); + + if(!rest.IsRealValue()){ + cout << "RCC : Real Value expected!\n"; + return Standard_False; + } + + realValues->Append(rest.RealValue()); + rest = tmpStr; + rest.LeftAdjust(); + rest.RightAdjust(); + } + + if(realValues->Length() < 7){ + cout << "RCC : 7 real values expected; found : " << realValues->Length() << endl; + return Standard_False; + } + + basePnt.SetCoord(realValues->Value(1), realValues->Value(2), realValues->Value(3)); + + + radius = realValues->Value(7); + + // make surfaces + gp_Pln basePlane; + basePlane.SetLocation(basePnt); + basePlane.SetAxis(theAxis); + +/* Standard_Real a,b,c,d; + pl1.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf1 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf1);*/ + +// TODO !!! + + return Standard_False; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeHEX(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + + // resolve hex planes + + TCollection_AsciiString tmpStr = sDesc; + if(tmpStr.Search(" RHP") > 0) + { + TCollection_AsciiString grbg = tmpStr.Split(tmpStr.Search(" RHP") + 4); + tmpStr = " HEX "; + tmpStr += grbg; + } + + if(tmpStr.Search(" HEX") < 0) + return Standard_False; + + tmpStr.Remove(1, tmpStr.Search(" HEX")+4); + Handle(TColStd_HSequenceOfReal) realSeq = new TColStd_HSequenceOfReal; + + while(true) + { + tmpStr.LeftAdjust(); + tmpStr.RightAdjust(); + + if(tmpStr.Search(" ") > 0) + { + TCollection_AsciiString beg = tmpStr; + tmpStr = beg.Split(beg.Search(" ")); + beg.LeftAdjust(); + beg.RightAdjust(); + if(beg.IsRealValue()) + realSeq->Append(beg.RealValue()); + else + { + cout << "Real Value expected!\n"; + return Standard_False; + } + } + else + { + if(tmpStr.IsRealValue()) + realSeq->Append(tmpStr.RealValue()); + else + { + cout << "Real Value expected!\n"; + return Standard_False; + } + + break; + } + } + + if(realSeq->Length() < 9) + { + cout << "Expected at least 9 Parameters!!\n\n"; + return(Standard_False); + } + + // base + gp_Pnt ori(realSeq->Value(1), realSeq->Value(2), realSeq->Value(3)); // bottom center + gp_Vec dir(realSeq->Value(4), realSeq->Value(5), realSeq->Value(6)); + gp_Pln basePln(ori, dir.Reversed()); + Standard_Real a,b,c,d; + basePln.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf1 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf1); + + // top + gp_Pnt topCenter(ori.X()+dir.X(), ori.Y()+dir.Y(), ori.Z()+dir.Z()); + gp_Pln topPln(topCenter, dir); + topPln.Coefficients(a,b,c,d); + Handle(McCadCSGGeom_Surface) appSurf2 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf2); + + // first facet + gp_Pnt firstFacetCenter(ori.X()+realSeq->Value(7), ori.Y()+realSeq->Value(8), ori.Z()+realSeq->Value(9)); + gp_Vec firstFacetDir(realSeq->Value(7), realSeq->Value(8), realSeq->Value(9)); + gp_Pln firstFacetPln(firstFacetCenter, firstFacetDir); + firstFacetPln.Coefficients(a, b, c, d); + Handle(McCadCSGGeom_Surface) appSurf3 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf3); + + // first facet opponent + gp_Pnt ffOCntr(ori.X()-realSeq->Value(7), ori.Y()-realSeq->Value(8), ori.Z()-realSeq->Value(9)); + gp_Pln ffOPln(ffOCntr, firstFacetDir.Reversed()); + ffOPln.Coefficients(a, b, c, d); + Handle(McCadCSGGeom_Surface) appSurf4 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf4); + + // second facet + gp_Vec sfDir; + if(realSeq->Length() < 12) // calculate other facets + { + gp_Ax1 rotAxis(ori, dir); + gp_Pnt fcMid = firstFacetCenter.Rotated(rotAxis, PI/3.0); + sfDir = gp_Vec(ori, fcMid); + } + else // read dir + { + sfDir = gp_Vec(realSeq->Value(10), realSeq->Value(11), realSeq->Value(12)); + } + gp_Pnt sfCntr(ori.X()+sfDir.X(), ori.Y()+sfDir.Y(), ori.Z()+sfDir.Z()); + gp_Pln sfPln(sfCntr, sfDir); + sfPln.Coefficients(a, b, c, d); + Handle(McCadCSGGeom_Surface) appSurf5 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf5); + + // second facet opponent + gp_Pnt sfOCntr(ori.X()-sfDir.X(), ori.Y()-sfDir.Y(), ori.Z()-sfDir.Z()); + gp_Pln sfOPln(sfOCntr, sfDir.Reversed()); + sfOPln.Coefficients(a, b, c, d); + Handle(McCadCSGGeom_Surface) appSurf6 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf6); + + // third facet + gp_Vec tfDir; + if(realSeq->Length() < 15) // calculate other facets + { + gp_Ax1 rotAxis(ori, dir); + gp_Pnt fcMid = firstFacetCenter.Rotated(rotAxis, -1*PI/3.0); + tfDir = gp_Vec(ori, fcMid); + } + else // read dir + { + tfDir = gp_Vec(realSeq->Value(13), realSeq->Value(14), realSeq->Value(15)); + } + gp_Pnt tfCntr(ori.X()+tfDir.X(), ori.Y()+tfDir.Y(), ori.Z()+tfDir.Z()); + gp_Pln tfPln(tfCntr, tfDir); + tfPln.Coefficients(a, b, c, d); + Handle(McCadCSGGeom_Surface) appSurf7 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf7); + + // third facet opponent + gp_Pnt tfOCntr(ori.X()-tfDir.X(), ori.Y()-tfDir.Y(), ori.Z()-tfDir.Z()); + gp_Pln tfOPln(tfOCntr, tfDir.Reversed()); + tfOPln.Coefficients(a, b, c, d); + Handle(McCadCSGGeom_Surface) appSurf8 = new McCadCSGGeom_Plane(a,b,c,d); + myMacroBodySurfaces->Append(appSurf8); + + return Standard_True; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeREC(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + return Standard_False; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeTRC(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + return Standard_False; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeELL(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + return Standard_False; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeWED(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + return Standard_False; +} + +Standard_Boolean McCadMcRead_SurfaceFactory::MakeARB(const TCollection_AsciiString& sDesc) +{ + mySurface = new McCadCSGGeom_Plane(0,0,1,0); // fake surface + mySurface->SetIsMacroBody(); + return Standard_False; +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::PointPlane(const gp_Dir& dir, Handle_TColStd_HSequenceOfReal& thePntSeq) +{ + gp_Dir X=gp::DX(), Y=gp::DY(), Z=gp::DZ(); + TCollection_AsciiString planeStr; + + if(dir.IsEqual(X, 1e-7)) + planeStr = TCollection_AsciiString("0 PX "); + if(dir.IsEqual(Y, 1e-7)) + planeStr = TCollection_AsciiString("0 PY "); + if(dir.IsEqual(Z, 1e-7)) + planeStr = TCollection_AsciiString("0 PZ "); + + planeStr += TCollection_AsciiString(thePntSeq->Value(1)); + + return MakePlane(planeStr); +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::PointCylinder(const gp_Dir& dir, Handle_TColStd_HSequenceOfReal& thePntSeq) +{ + gp_Dir X=gp::DX(), Y=gp::DY(), Z=gp::DZ(); + TCollection_AsciiString cStr; + + if(dir.IsEqual(X, 1e-7)) + cStr = TCollection_AsciiString("0 CX "); + if(dir.IsEqual(Y, 1e-7)) + cStr = TCollection_AsciiString("0 CY "); + if(dir.IsEqual(Z, 1e-7)) + cStr = TCollection_AsciiString("0 CZ "); + + cStr += TCollection_AsciiString(thePntSeq->Value(2)); // append the radius + + return MakeCylinder(cStr); +} + + +Standard_Boolean McCadMcRead_SurfaceFactory::PointCone(const gp_Dir& dir, Handle_TColStd_HSequenceOfReal& thePntSeq) +{ + //cout << "POINT CONE\n"; + gp_Dir X=gp::DX(), Y=gp::DY(), Z=gp::DZ(); + TCollection_AsciiString cStr; + + if(dir.IsEqual(X, 1e-7)) + cStr = TCollection_AsciiString("0 KX "); + if(dir.IsEqual(Y, 1e-7)) + cStr = TCollection_AsciiString("0 KY "); + if(dir.IsEqual(Z, 1e-7)) + cStr = TCollection_AsciiString("0 KZ "); + + + //Standard_Integer sheet(-1); + Standard_Real r2 = thePntSeq->Value(2); + Standard_Real r1,x1,x2; + if(r2 < thePntSeq->Value(4)) + { + x2 = thePntSeq->Value(3); + r2 = thePntSeq->Value(4); + x1 = thePntSeq->Value(1); + r1 = thePntSeq->Value(2); + } + else + { + x2 = thePntSeq->Value(1); + x1 = thePntSeq->Value(3); + r1 = thePntSeq->Value(4); + } + + /*if(x2 + + +bool isAngle=false; + +McCadMcRead_TrsfBuilder::McCadMcRead_TrsfBuilder() +{ + + myTrsf = new McCadCSGGeom_Transformation; + NotDone(); + +} +Standard_Boolean McCadMcRead_TrsfBuilder::IsDone() const +{ + return myIsDone; +} + +void McCadMcRead_TrsfBuilder::Done() +{ + myIsDone = Standard_True; +} + +void McCadMcRead_TrsfBuilder::NotDone() +{ + myIsDone = Standard_False; +} + +void McCadMcRead_TrsfBuilder::BuildTrsf(const TCollection_AsciiString& sDesc) +{ + if(!Parse(sDesc)) + { + ::cout << "Can not build Trsf matrix for this Card " << endl; + ::cout << sDesc.ToCString() << endl; + NotDone(); + } + Done(); +} + +Standard_Boolean McCadMcRead_TrsfBuilder::Parse(const TCollection_AsciiString& sDesc) +{ + bool sig = false; + TCollection_AsciiString sTmp = sDesc; + //Read prefix; + if(!ParsePrefix(sTmp)) + { + return false; + } + // TCollection_AsciiString sTmp = sDesc; + sTmp.LeftAdjust(); + sTmp.RightAdjust(); + // sEnd is now the vector + TCollection_AsciiString sEnd = sTmp.Split(sDesc.Search(" ")); + // sTmp is *TRn + int num = (sTmp.SubString(sTmp.Search("R")+1,sTmp.Search(" ")-1)).IntegerValue(); + + if (num <= 0 ) + { + ::cout << "Trsf matrix for this Card is less than 0!" << endl; + return false; + } + else myTrsf->SetIdNum(num); + + sTmp.Clear(); + sTmp = sEnd; + + sEnd.Clear(); + Handle(TColStd_HSequenceOfReal) vecSeq = new TColStd_HSequenceOfReal; + + + // get transformation values + while(sTmp.Length()>0) + { + sTmp.LeftAdjust(); + + if(sTmp.Search(" ") > 1 ) + { + sEnd = sTmp.Split(sTmp.Search(" ")); + sEnd.UpperCase(); + + if(sEnd.Search("J") > 0) // skip operator used + { + TCollection_AsciiString theJ = sEnd.Split(sEnd.Search("J")); + Standard_Integer numberOfSkips(1); + if(sEnd.IsIntegerValue()) + numberOfSkips = sEnd.IntegerValue(); + else + cout << "WARNING!!! Number of skips is not an integer value in transformation card : " << num << endl; + + Standard_Real cero(0.0), one(1.0); + + for(int i=1; i<=numberOfSkips; i++) + { + if(i==4 || i==8 || i==12 ) + vecSeq->Append(one); + else + vecSeq->Append(cero); + } + } + else if(sEnd.Search("R") > 0) // repeate operator used + { + TCollection_AsciiString theR = sEnd.Split(sEnd.Search("R")); + Standard_Integer numberOfRepeats(1); + if(sEnd.IsIntegerValue()) + numberOfRepeats = sEnd.IntegerValue(); + else + cout << "WARNING!!! Number of repeats is not an integer value in transformation card : " << num << endl; + + Standard_Real repeatValue = vecSeq->Value(vecSeq->Length()); + + for(int i=1; i<=numberOfRepeats; i++) + vecSeq->Append(repeatValue); + } + else + vecSeq->Append(sTmp.RealValue()); + } + else // the last one + { + vecSeq->Append(sTmp.RealValue()); + } + sTmp.Clear(); + sTmp = sEnd; + sEnd.Clear(); + } + // compute cosines of angels + if(vecSeq->Length() >3 ) + { + if(isAngle) + { + for(int i = 4; i<=vecSeq->Length(); i++) + { + vecSeq->SetValue(i,cos(vecSeq->Value(i)*M_PI/180.0)); + } + } + } + + switch(vecSeq->Length()) + { + case 3: + myTrsf->SetVValues(vecSeq->Value(1),vecSeq->Value(2),vecSeq->Value(3)); + sig = true; + break; + case 5: + cout << "Only full matrix entry is allowed" << endl; + sig = false; + break; + case 6: + cout << "Only full matrix entry is allowed" << endl; + sig = false; + break; + case 12: + myTrsf->SetValues(vecSeq->Value(1),vecSeq->Value(2),vecSeq->Value(3), + vecSeq->Value(4),vecSeq->Value(5),vecSeq->Value(6), + vecSeq->Value(7),vecSeq->Value(8),vecSeq->Value(9), + vecSeq->Value(10),vecSeq->Value(11),vecSeq->Value(12)); + sig = true; + break; + case 13: + cout << "Only full matrix entry is allowed" << endl; + sig = false; + break; + default: + sig = false; + break; + } + if (sig == false) + { + cout << "Only full matrix entry is allowed" << endl; + cout << "------------------------------------------------------------------------" << endl; + } + return sig; +} + + +Standard_Boolean McCadMcRead_TrsfBuilder::ParsePrefix(const TCollection_AsciiString& sDesc) +{ + if(sDesc.IsEmpty()) //It is a blank line; + { + return false; + } + if(sDesc.Search("*") > 0 ) + { + isAngle = true; + } + else + { + isAngle = false; + } + return true; +} + +Handle(McCadCSGGeom_Transformation) McCadMcRead_TrsfBuilder::GetTrsf() const +{ + return myTrsf; +} + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/IGeomFace.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/IGeomFace.cxx new file mode 100644 index 0000000..0719924 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/IGeomFace.cxx @@ -0,0 +1 @@ +#include "IGeomFace.hxx" diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/IGeomFace.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/IGeomFace.hxx new file mode 100644 index 0000000..7fdec89 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/IGeomFace.hxx @@ -0,0 +1,81 @@ +#ifndef IGEOMFACE_HXX +#define IGEOMFACE_HXX + +#include +#include +#include +#include +#include + +#ifndef _Standard_TypeDef_HeaderFile +#include +#endif + +using namespace std; + +enum SurfType { surfPlane = 0, + surfCylinder = 1, + surfSphere = 2, + surfCone = 3, + surfTorus = 4, + surfRev = 5}; + +class IGeomFace +{ +public: + IGeomFace(){} + virtual ~IGeomFace(){} + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + virtual TCollection_AsciiString GetExpression() = 0; /**< Get the expression of surface */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace) = 0; /**< Judge the two surface is same or not */ + virtual void CleanObj() const = 0; /**< Clean the object */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) = 0; /**< Clean the object */ + virtual TCollection_AsciiString GetTransfNum() const = 0; + +public: + SurfType GetFaceType() const{ return m_SurfType; } /**< Get the surface type */ + void SetSurfNum(int iNum){ m_iNum = iNum; } /**< Set the number of surface */ + Standard_Integer GetSurfNum(){ return m_iNum; } /**< Get the number of surface */ + // xiugai lei*/ + Standard_Real GetUnit(){return 0.1;} /**< Get the unit used */ + void SetUnit(Standard_Real theRatio){m_ScaleRatio = theRatio;} /**< Set the unit */ + + TCollection_AsciiString GetSurfSymb() const{ return m_SurfSymb; } /**< Get the surface type */ + + //Standard_Real GetFstPrmt() const{ return m_FstPrmt; } /**< Get the first parameter */ +//qiu vector GetPrmtList(){return m_PrmtList;} + vector GetPrmtList() const {return m_PrmtList;} + Standard_Boolean IsReversed(){return m_bReverse;} + +protected: + + Standard_Integer m_iNum; /**< The surface number in list */ + SurfType m_SurfType; /**< Face Type */ + gp_Pnt m_PntOnFace; /**< A point on the suface */ + TCollection_AsciiString m_SurfExpn; /**< Face Expression of Solid */ + Standard_Integer m_iCodeNum; /**< MaCadExtFace can find the geomtry surface using the number */ + Standard_Real m_ScaleRatio; /**< The scale ratio according to the unit CAD model used */ + + //Standard_Integer m_SurfSeqNum; + //Standard_Real m_FstPrmt; + + TCollection_AsciiString m_SurfSymb; + vector m_PrmtList; + + Standard_Boolean m_bReverse; /**< whether the surface has been reversed or not */ +}; + +#endif // IGEOMFACE_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/IMcCadWriter.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/IMcCadWriter.cxx new file mode 100644 index 0000000..cf93dc4 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/IMcCadWriter.cxx @@ -0,0 +1,73 @@ +#include "IMcCadWriter.hxx" + +#include "../McCadTool/McCadConvertConfig.hxx" + +IMcCadWriter::IMcCadWriter() +{ + m_iInitCellNum = McCadConvertConfig::GetInitCellNum(); + m_iInitFaceNum = McCadConvertConfig::GetInitSurfNum(); +} + +IMcCadWriter::~IMcCadWriter() +{ +} + + +/** ******************************************************************** +* @brief Set the name of output file. +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetFileName(TCollection_AsciiString theFileName) +{ + m_OutputFileName = theFileName; +} + + +/** ******************************************************************** +* @brief Set the manager pointer. +* @param McCadVoidCellManager * pManager +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetManager(McCadVoidCellManager *pManager) +{ + m_pManager = pManager; +} + + +/** ******************************************************************** +* @brief Set the material switch to control the output of material card +* @param Standard_Boolean bMat +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetMaterial(Standard_Boolean bMat) +{ + m_bHaveMaterial = bMat; +} + + +/** ******************************************************************** +* @brief Set the void switch to control the output of void card +* @param Standard_Boolean bVoid +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetVoid(Standard_Boolean bVoid) +{ + m_bGenerateVoid = bVoid; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/IMcCadWriter.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/IMcCadWriter.hxx new file mode 100644 index 0000000..7955593 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/IMcCadWriter.hxx @@ -0,0 +1,55 @@ +#ifndef IMCCADWRITER_HXX +#define IMCCADWRITER_HXX + +#include "McCadVoidCellManager.hxx" + +class IMcCadWriter +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + IMcCadWriter(); + virtual ~IMcCadWriter(); + +protected: + McCadVoidCellManager * m_pManager; /**< Corresponding manager */ + Standard_Boolean m_bHaveMaterial; /**< If the material file is existed, set true, else set false */ + Standard_Boolean m_bGenerateVoid; /**< The switch of void generation */ + TCollection_AsciiString m_OutputFileName; /**< The name of output file */ + + Standard_Integer m_iInitCellNum; /**< The initial number of cell */ + Standard_Integer m_iInitFaceNum; /**< The initial number of face */ + +public: + /** Print the output file, include head information, cell, void, surface, transform card */ + virtual void PrintFile(){}; /**< Print the file */ + + virtual void PrintHeadDesc(Standard_OStream& theStream){}; /**< Print the head */ + virtual void PrintCellDesc(Standard_OStream& theStream){}; /**< Print the cell card */ + virtual void PrintVoidDesc(Standard_OStream& theStream){}; /**< Print the void card */ + virtual void PrintSurfDesc(Standard_OStream& theStream){}; /**< Print the surfaces list */ + virtual void PrintTrsfDesc(Standard_OStream& theStream){}; /**< Print the transform card */ + virtual void PrintMatCard(Standard_OStream& theStream){}; /**< Print the material card */ + + /** Print the group information, including material name, group name, material id and density */ + virtual void PrintGroupInfo(const int iSolid, Standard_OStream& theStream){}; + + virtual void SetFileName(TCollection_AsciiString theFileName); /**< Set the output file name */ + virtual void SetManager(McCadVoidCellManager *pManager); /**< Connect to the manager */ + virtual void SetMaterial(Standard_Boolean bMat); /**< Set the switch of outputing of material*/ + virtual void SetVoid(Standard_Boolean bVoid); /**< Set the switch of outputing of void card*/ +}; + +#endif // MCCADWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid-bak.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid-bak.cxx new file mode 100644 index 0000000..473038e --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid-bak.cxx @@ -0,0 +1,626 @@ +#include "McCadConvexSolid.hxx" +#include "McCadExtFace.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadGeomTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadFuseSurface.hxx" + +/** ******************************************************************** +* @brief Construct function of McCadConvexSolid +* +* @param const TopoDS_Solid & theSolid +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadConvexSolid::McCadConvexSolid(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + //m_FaceList = new TopTools_HSequenceOfShape; // New a sequence to store the faces + m_DiscPntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + m_EdgePntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + + GenFacesList(theSolid); // Trace the boundary faces of solid, store in the list of faces. + GenEdgePoints(); // Generate the discrete points of each edges. + AddAuxSurfaces(); // Add assisted surfaces for concave curved surfaces. +} + + +McCadConvexSolid::~McCadConvexSolid() +{ + //m_FaceList->Clear(); + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); +} + + + +/** ******************************************************************** +* @brief Generate the face list +* +* @param const TopoDS_Solid & theSolid +* @return void +* +* @date 31/8/2012 +* @modify 4/2/2014 fuse the same boundary surfaces +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenFacesList(const TopoDS_Solid & theSolid) +{ +// TopExp_Explorer exp; // Traverse the faces of input solid +// for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TopoDS_Face theFace = TopoDS::Face(exp.Current()); +// McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces +// m_STLFaceList.push_back(pExtFace); +// m_iNumOfFaces++; +// } + + + TopExp_Explorer exp; // Traverse the faces of input solid + + vector face_list; + // vector fused_face_list; + vector fused_face_list; + + for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + face_list.push_back(theFace); + } + + McCadFuseSurface Fuser; // Fuse the surfaces with same geomtries and common edge + /// Traverse the surfaces, find the same surfaces + for(int i = 0; i < face_list.size(); i++ ) + { + for(int j = i+1; j < face_list.size(); j++ ) + { + Fuser.SetSurfaces(face_list.at(i),face_list.at(j)); + if(Fuser.Fuse()) + { + McCadExtFace *pExtFace = new McCadExtFace(Fuser.GetNewSurf()); + pExtFace->MergeDscPnt(face_list.at(i)); + pExtFace->MergeDscPnt(face_list.at(j)); + + face_list.erase(face_list.begin()+j); + face_list.erase(face_list.begin()+i); + fused_face_list.push_back(pExtFace); + + j -= 1; + i -= 1; + break; + } + } + } + + /// Based on the new boundary surfaces, generate the McCadExtFace and add into surface list. + for(int i = 0; i < face_list.size(); i++ ) + { + TopoDS_Face theFace = face_list.at(i); + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + for(int i = 0; i < fused_face_list.size(); i++ ) + { + McCadExtFace *pExtFace = fused_face_list.at(i); + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + face_list.clear(); + fused_face_list.clear(); +} + + + +/** ******************************************************************** +* @brief Add Auxiliary Surface to each concave curved surface +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::AddAuxSurfaces() +{ + for (int i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList.at(i); + /* Judge whether need to add auxiliary faces when there are curved surfaces */ + if( pExtFace->IsConcaveCurvedFace() ) // Judge the face is concave curve surface or not + { + /* Get the auxiliary faces list */ + vector theAuxFaceList = pExtFace->GetAuxFaces(); + /* Judge the auxiliary face whether can be add into auxiliary face list.*/ + JudgeAuxFaces(theAuxFaceList,pExtFace); + } + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TopoDS_Shape McCadConvexSolid::GetBntBoxShape() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBoxShape; + } + else + { + GetBntBox(); + return m_bBoxShape; + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadConvexSolid::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + gp_Pnt MaxPnt(fXmax, fYmax, fZmax); // The max point of the boundary box + gp_Pnt MinPnt(fXmin, fYmin, fZmin); // The min point of the boundary box + + m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenDescPoints(Standard_Boolean bGenVoid) +{ + /* Generate sample points of the each face */ + if (m_DiscPntList->IsEmpty()) + { + if (bGenVoid) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + pExtFace->GetDiscPntList(); // Discrete each face of convex solid. + } + } + } + + cout<<"-----1"<IsEmpty()) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Add the discrete point list of face into the one of solid + } + } +} + + + +/** ******************************************************************** +* @brief Judge the auxiliary face can be add into auxiliary face list +of this face +* +* @param vector & theAuxFaceList +* @param McCadExtFace *& theFace +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadConvexSolid::JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace) +{ + /* If the auxiliary face is sign-constant,it can be added into auxiliary face list */ + for (Standard_Integer i = 0; i < theAuxFaceList.size(); i++) + { + TopoDS_Face theAuxFace = *(theAuxFaceList[i]); + + BRepAdaptor_Surface BS(theAuxFace, Standard_True); + GeomAdaptor_Surface theAdpSurface = BS.Surface(); + + Standard_Integer iPosPnt = 0; + Standard_Integer iNegPnt = 0; + + //Standard_Real aVal = 1.0 + for (Standard_Integer j = 1; j <= m_EdgePntList->Length(); j++) + { + /* Distinguish which side does the point located.*/ + Standard_Real aVal = McCadGTOOL::Evaluate(theAdpSurface, m_EdgePntList->Value(j)); + + if (aVal > 1.0e-5) // Point located on the positive side of face + { + iPosPnt ++; + } + else if (aVal < -1.0e-5) // Point located on the negative side of face + { + iNegPnt ++; + } + + if (iPosPnt > 0 && iNegPnt > 0) // i.e sign changing + { + (theAuxFaceList[i])->AddAttri(1); + break; + } + } + } + return; +} + + +/** ******************************************************************** +* @brief Get the face list of solid +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadConvexSolid::GetSTLFaceList() +{ + return m_STLFaceList; +} + + + +/** ******************************************************************** +* @brief Discrete the faces and get the list of discreted points. +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadConvexSolid::GetDiscPntList() +{ + return m_DiscPntList; +} + + +void McCadConvexSolid::DeleteRepeatFace(Standard_Boolean bMergeDiscPnt) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if(pLeftFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + if (bMergeDiscPnt) + { + //pLeftFace->AddPntList(pRightFace->GetDiscPntList()); + //pLeftFace->UpdateBndBox(pRightFace->GetBndBox()); + //pLeftFace->AddAuxFaces(pRightFace->GetAuxFaces()); + //pLeftFace->AddMergedFaces(pRightFace); + pLeftFace->AddSameFaces(pRightFace); // Add the same face into samefacelist for collision detection + + } + + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + continue; + } + +// if(pLeftFace->HaveAuxSurf() && pRightFace->HaveAuxSurf()) +// { +// for (Standard_Integer iAux = 0; iAux < pLeftFace->GetAuxFaces().size(); iAux++) +// { +// McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(iAux); +// for (Standard_Integer jAux = 0; jAux < pRightFace->GetAuxFaces().size(); jAux++) +// { +// McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(jAux); +// if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) +// { +// pRightFace->GetAuxFaces().erase(pRightFace->GetAuxFaces().begin()+jAux); +// delete pRightAuxFace; +// pRightAuxFace = NULL; +// jAux--; +// } +// } +// } +// } + /* else if (!pLeftFace->HaveAuxSurf() && pRightFace->HaveAuxSurf()) + { + for (Standard_Integer iAux = 0; iAux < pRightFace->GetAuxFaces().size(); iAux++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(iAux); + if(pRightAuxFace->GetFaceNum() == pLeftFace->GetFaceNum()) + { + m_STLFaceList.erase(m_STLFaceList.begin()+i); + delete pLeftFace; + pLeftFace = NULL; + j--; + i--; + break; + } + } + if (pLeftFace == NULL) + { + break; + } + } + else if(pLeftFace->HaveAuxSurf() && !pRightFace->HaveAuxSurf()) + { + for (Standard_Integer iAux = 0; iAux < pLeftFace->GetAuxFaces().size(); iAux++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(iAux); + if(pLeftAuxFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + break; + } + } + }*/ + } + } +//to remove duplicate surface + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + for (Standard_Integer k = 0; k < pRightFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pRightFace->GetAuxFaces().at(k); + if(pLeftFace->GetFaceNum() == pAuxFace->GetFaceNum()) + { + cout<GetFaceNum()<<" "<GetFaceNum()<RemoveAuxFace(k); + k--; + continue; + } + } + } + } +} + +void McCadConvexSolid::DeleteRepeatAuxFace(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace, + unsigned int &iErase, unsigned int &jErase) +{ + for (Standard_Integer i = 0; i < pLeftFace->GetAuxFaces().size(); i++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(i); + for (Standard_Integer j = 0; j < pRightFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(j); + if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) + { + pRightFace->GetAuxFaces().erase(pRightFace->GetAuxFaces().begin()+j); + delete pRightAuxFace; + pRightAuxFace = NULL; + j--; + } + /*else if(pLeftAuxFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + pLeftFace->GetAuxFaces().erase(pLeftFace->GetAuxFaces().begin()+i); + delete pLeftAuxFace; + pLeftAuxFace = NULL; + i--; + }*/ + } + } + +} + + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadConvexSolid::GetExpression() +{ + if (!m_szExpression.IsEmpty()) + { + return m_szExpression; + } + + TCollection_AsciiString szAuxFaceUni = ""; + TCollection_AsciiString szAuxFaceSub = ""; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + + McCadExtFace * pExtFace = m_STLFaceList[i]; + /* if the orientation of face is minus,add "-" before the face number */ + //if(pExtFace->GetFaceOrientation() == MINUS) + //{ + //m_szExpression += "-"; + //} + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + if (szAuxFaceUni.Search(" ") != -1 ) + { + m_szExpression += " ("; + m_szExpression += szAuxFaceSub; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceSub; + m_szExpression += " "; + } + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + if (szAuxFaceUni.Search(":") != -1 ) + { + m_szExpression += "("; + m_szExpression += szAuxFaceUni; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceUni; + } + } + + return m_szExpression; +} + + +Standard_Real McCadConvexSolid::GetVolume() +{ + return McCadGeomTool::GetVolume(*this); +} + + +void McCadConvexSolid::ChangeFaceNum(McCadGeomData * pData) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace * pExtFace = m_STLFaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pExtFace->SetFaceNum(iFaceNumNew); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + iFaceNumOld = pAuxFace->GetFaceNum(); + iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pAuxFace->SetFaceNum(iFaceNumNew); + + /* Test Code */ + //cout<<"old:"< McCadConvexSolid::GetFaces() +{ + return m_STLFaceList; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid-bak.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid-bak.hxx new file mode 100644 index 0000000..cfad3fa --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid-bak.hxx @@ -0,0 +1,100 @@ +/** @file + * @brief + * + * @author + * @date + */ + +#ifndef MCCADCONVEXSOLID_HXX +#define MCCADCONVEXSOLID_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "McCadExtFace.hxx" +#include "McCadTripoliCell.hxx" + + +using namespace std; + +//class McCadVoidCellManager; +class McCadGeomData; +class McCadConvexSolid : public TopoDS_Solid{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadConvexSolid(); + McCadConvexSolid(const TopoDS_Solid & theSolid); + ~McCadConvexSolid(); + +private: + + int m_iNum; /**< Number of Cell */ + int m_iMatNo; /**< Number of Material */ + + double m_dDensity; /**< Material Density */ + int m_iNeutronIMP; /**< Importance of Neutron */ + int m_iPhotonIMP; /**< Importance of Photon */ + + TCollection_AsciiString m_szExpression; /**< MCNP Expression of Solid */ + int m_iNumOfFaces; /**< Number of Boundary Surface */ + + TopoDS_Shape m_bBoxShape; /**< The shape of boundary box */ + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + //vector m_faceList; + //Handle_TopTools_HSequenceOfShape m_FaceList; /**< Facelist store the boundary face */ + vector m_STLFaceList; /**< Face list of convex solid */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points list */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges */ + + void GenFacesList(const TopoDS_Solid & theSolid); /**< Get the data of faces of solid */ + void AddAuxSurfaces(); /**< Add Auxiliary Surface to each concave curved surface*/ + + /** If the auxiliary face is sign-constant, add it into auxiliary face list */ + void JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace); + +public: + + /** Set the number material number and some information of cell */ + void SetCellInfo(int iNum, int iMat, double fDensity, int iNeutronIMP, int iPhotonIMP); + + TopoDS_Shape GetBntBoxShape(); /**< Get boundary box shape */ + Bnd_Box GetBntBox(); /**< Get boundary box */ + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get the discrete point list */ + + vector GetSTLFaceList(); /**< Get the face list */ + TCollection_AsciiString GetExpression(); /**< Generate solid expression */ + void GenDescPoints(Standard_Boolean bGenVoid); /**< Descrete the faces and store the points into list */ + void GenEdgePoints(); + + void ChangeFaceNum(McCadGeomData * pData); + void DeleteRepeatFace(Standard_Boolean bMergeDiscPnt); + void DeleteRepeatAuxFace(McCadExtFace *&pLeftFace, McCadExtFace *&pRightFace, unsigned int &iErase, unsigned int &jErase); + Standard_Real GetVolume(); + + vector GetFaces(); +}; + +#endif // MCCADCONVEXSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid.cxx new file mode 100644 index 0000000..1eb7b17 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid.cxx @@ -0,0 +1,580 @@ +#include "McCadConvexSolid.hxx" +#include "McCadExtFace.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadGeomTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadFuseSurface.hxx" + +/** ******************************************************************** +* @brief Construct function of McCadConvexSolid +* +* @param const TopoDS_Solid & theSolid +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadConvexSolid::McCadConvexSolid(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + //m_FaceList = new TopTools_HSequenceOfShape; // New a sequence to store the faces + m_DiscPntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + m_EdgePntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + + GenFacesList(theSolid); // Trace the boundary faces of solid, store in the list of faces. + GenEdgePoints(); // Generate the discrete points of each edges. + AddAuxSurfaces(); // Add assisted surfaces for concave curved surfaces. +} + + +McCadConvexSolid::~McCadConvexSolid() +{ + //m_FaceList->Clear(); + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); +} + + + +/** ******************************************************************** +* @brief Generate the face list +* +* @param const TopoDS_Solid & theSolid +* @return void +* +* @date 31/8/2012 +* @modify 4/2/2014 fuse the same boundary surfaces +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenFacesList(const TopoDS_Solid & theSolid) +{ +// TopExp_Explorer exp; // Traverse the faces of input solid +// for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TopoDS_Face theFace = TopoDS::Face(exp.Current()); +// McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces +// m_STLFaceList.push_back(pExtFace); +// m_iNumOfFaces++; +// } + + + TopExp_Explorer exp; // Traverse the faces of input solid + + vector face_list; + // vector fused_face_list; + vector fused_face_list; + + for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + face_list.push_back(theFace); + } + + McCadFuseSurface Fuser; // Fuse the surfaces with same geomtries and common edge + /// Traverse the surfaces, find the same surfaces + for(int i = 0; i < face_list.size(); i++ ) + { + for(int j = i+1; j < face_list.size(); j++ ) + { + Fuser.SetSurfaces(face_list.at(i),face_list.at(j)); + if(Fuser.Fuse()) + { + McCadExtFace *pExtFace = new McCadExtFace(Fuser.GetNewSurf()); + pExtFace->MergeDscPnt(face_list.at(i)); + pExtFace->MergeDscPnt(face_list.at(j)); + + face_list.erase(face_list.begin()+j); + face_list.erase(face_list.begin()+i); + fused_face_list.push_back(pExtFace); + + j -= 1; + i -= 1; + break; + } + } + } + + /// Based on the new boundary surfaces, generate the McCadExtFace and add into surface list. + for(int i = 0; i < face_list.size(); i++ ) + { + TopoDS_Face theFace = face_list.at(i); + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + for(int i = 0; i < fused_face_list.size(); i++ ) + { + McCadExtFace *pExtFace = fused_face_list.at(i); + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + face_list.clear(); + fused_face_list.clear(); +} + + + +/** ******************************************************************** +* @brief Add Auxiliary Surface to each concave curved surface +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::AddAuxSurfaces() +{ + for (int i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList.at(i); + /* Judge whether need to add auxiliary faces when there are curved surfaces */ + if( pExtFace->IsConcaveCurvedFace() ) // Judge the face is concave curve surface or not + { + /* Get the auxiliary faces list */ + vector theAuxFaceList = pExtFace->GetAuxFaces(); + /* Judge the auxiliary face whether can be add into auxiliary face list.*/ + JudgeAuxFaces(theAuxFaceList,pExtFace); + } + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TopoDS_Shape McCadConvexSolid::GetBntBoxShape() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBoxShape; + } + else + { + GetBntBox(); + return m_bBoxShape; + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadConvexSolid::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + gp_Pnt MaxPnt(fXmax, fYmax, fZmax); // The max point of the boundary box + gp_Pnt MinPnt(fXmin, fYmin, fZmin); // The min point of the boundary box + + m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenDescPoints(Standard_Boolean bGenVoid) +{ + /* Generate sample points of the each face */ + if (m_DiscPntList->IsEmpty()) + { + if (bGenVoid) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + pExtFace->GetDiscPntList(); // Discrete each face of convex solid. + } + } + } + + cout<<"-----1"<IsEmpty()) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Add the discrete point list of face into the one of solid + } + } +} + + + +/** ******************************************************************** +* @brief Judge the auxiliary face can be add into auxiliary face list +of this face +* +* @param vector & theAuxFaceList +* @param McCadExtFace *& theFace +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadConvexSolid::JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace) +{ + /* If the auxiliary face is sign-constant,it can be added into auxiliary face list */ + for (Standard_Integer i = 0; i < theAuxFaceList.size(); i++) + { + TopoDS_Face theAuxFace = *(theAuxFaceList[i]); + + BRepAdaptor_Surface BS(theAuxFace, Standard_True); + GeomAdaptor_Surface theAdpSurface = BS.Surface(); + + Standard_Integer iPosPnt = 0; + Standard_Integer iNegPnt = 0; + + //Standard_Real aVal = 1.0 + for (Standard_Integer j = 1; j <= m_EdgePntList->Length(); j++) + { + /* Distinguish which side does the point located.*/ + Standard_Real aVal = McCadGTOOL::Evaluate(theAdpSurface, m_EdgePntList->Value(j)); + + if (aVal > 1.0e-5) // Point located on the positive side of face + { + iPosPnt ++; + } + else if (aVal < -1.0e-5) // Point located on the negative side of face + { + iNegPnt ++; + } + + if (iPosPnt > 0 && iNegPnt > 0) // i.e sign changing + { + (theAuxFaceList[i])->AddAttri(1); + break; + } + } + } + return; +} + + +/** ******************************************************************** +* @brief Get the face list of solid +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadConvexSolid::GetSTLFaceList() +{ + return m_STLFaceList; +} + + + +/** ******************************************************************** +* @brief Discrete the faces and get the list of discreted points. +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadConvexSolid::GetDiscPntList() +{ + return m_DiscPntList; +} + + +void McCadConvexSolid::DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt) +{ + MergeBndFaces(bMergeDiscPnt); + MergeBndAuxFaces(); + + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if (pLeftFace->HaveAuxSurf() && pRightFace->HaveAuxSurf()) + { + MergeAuxFaces(pLeftFace,pRightFace); + } + } + } +} + + +void McCadConvexSolid::MergeBndFaces(Standard_Boolean bMergeDiscPnt) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if(pLeftFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + if (bMergeDiscPnt) + { + pLeftFace->AddSameFaces(pRightFace); // Add the same face into samefacelist for collision detection + } + + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + continue; + } + } + } +} + + +void McCadConvexSolid::MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace) +{ + for (Standard_Integer i = 0; i < pLeftFace->GetAuxFaces().size(); i++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(i); + for (Standard_Integer j = 0; j < pRightFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(j); + if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) + { + pRightFace->RemoveAuxFace(j); + j--; + } + } + } +} + +void McCadConvexSolid::MergeBndAuxFaces() +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + if (i == j) + { + continue; + } + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + McCadExtFace *pRightFace = m_STLFaceList.at(j); + for (Standard_Integer k = 0; k < pRightFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pRightFace->GetAuxFaces().at(k); + if(pLeftFace->GetFaceNum() == pAuxFace->GetFaceNum()) + { + pRightFace->RemoveAuxFace(k); + k--; + continue; + } + } + } + } +} + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadConvexSolid::GetExpression() +{ + if (!m_szExpression.IsEmpty()) + { + return m_szExpression; + } + + TCollection_AsciiString szAuxFaceUni = ""; + TCollection_AsciiString szAuxFaceSub = ""; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + + McCadExtFace * pExtFace = m_STLFaceList[i]; + /* if the orientation of face is minus,add "-" before the face number */ + //if(pExtFace->GetFaceOrientation() == MINUS) + //{ + //m_szExpression += "-"; + //} + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + if (szAuxFaceUni.Search(" ") != -1 ) + { + m_szExpression += " ("; + m_szExpression += szAuxFaceSub; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceSub; + m_szExpression += " "; + } + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + if (szAuxFaceUni.Search(":") != -1 ) + { + m_szExpression += "("; + m_szExpression += szAuxFaceUni; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceUni; + } + } + + return m_szExpression; +} + + +Standard_Real McCadConvexSolid::GetVolume() +{ + return McCadGeomTool::GetVolume(*this); +} + + +void McCadConvexSolid::ChangeFaceNum(McCadGeomData * pData) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace * pExtFace = m_STLFaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pExtFace->SetFaceNum(iFaceNumNew); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + iFaceNumOld = pAuxFace->GetFaceNum(); + iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pAuxFace->SetFaceNum(iFaceNumNew); + + /* Test Code */ + //cout<<"old:"< McCadConvexSolid::GetFaces() +{ + return m_STLFaceList; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid.hxx new file mode 100644 index 0000000..f8f8809 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid.hxx @@ -0,0 +1,102 @@ +/** @file + * @brief + * + * @author + * @date + */ + +#ifndef MCCADCONVEXSOLID_HXX +#define MCCADCONVEXSOLID_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "McCadExtFace.hxx" +#include "McCadTripoliCell.hxx" + + +using namespace std; + +//class McCadVoidCellManager; +class McCadGeomData; +class McCadConvexSolid : public TopoDS_Solid{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadConvexSolid(); + McCadConvexSolid(const TopoDS_Solid & theSolid); + ~McCadConvexSolid(); + +private: + + int m_iNum; /**< Number of Cell */ + int m_iMatNo; /**< Number of Material */ + + double m_dDensity; /**< Material Density */ + int m_iNeutronIMP; /**< Importance of Neutron */ + int m_iPhotonIMP; /**< Importance of Photon */ + + TCollection_AsciiString m_szExpression; /**< MCNP Expression of Solid */ + int m_iNumOfFaces; /**< Number of Boundary Surface */ + + TopoDS_Shape m_bBoxShape; /**< The shape of boundary box */ + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + //vector m_faceList; + //Handle_TopTools_HSequenceOfShape m_FaceList; /**< Facelist store the boundary face */ + vector m_STLFaceList; /**< Face list of convex solid */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points list */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges */ + + void GenFacesList(const TopoDS_Solid & theSolid); /**< Get the data of faces of solid */ + void AddAuxSurfaces(); /**< Add Auxiliary Surface to each concave curved surface*/ + + /** If the auxiliary face is sign-constant, add it into auxiliary face list */ + void JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace); + +public: + + /** Set the number material number and some information of cell */ + void SetCellInfo(int iNum, int iMat, double fDensity, int iNeutronIMP, int iPhotonIMP); + + TopoDS_Shape GetBntBoxShape(); /**< Get boundary box shape */ + Bnd_Box GetBntBox(); /**< Get boundary box */ + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get the discrete point list */ + + vector GetSTLFaceList(); /**< Get the face list */ + TCollection_AsciiString GetExpression(); /**< Generate solid expression */ + void GenDescPoints(Standard_Boolean bGenVoid); /**< Descrete the faces and store the points into list */ + void GenEdgePoints(); + + void ChangeFaceNum(McCadGeomData * pData); + void DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt); /**< Delete the repeat faces */ + void MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace); /**< Merge auxilary surfaces*/ + void MergeBndAuxFaces(); /**< Merge boundary surfaces and auxiliary surfaces */ + void MergeBndFaces(Standard_Boolean bMergeDiscPnt); /**< Merge boundary surfaces */ + Standard_Real GetVolume(); + + vector GetFaces(); +}; + +#endif // MCCADCONVEXSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid_GeomErr.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid_GeomErr.cxx new file mode 100644 index 0000000..74ece59 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid_GeomErr.cxx @@ -0,0 +1,575 @@ +#include "McCadConvexSolid.hxx" +#include "McCadExtFace.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadGeomTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadFuseSurface.hxx" + +/** ******************************************************************** +* @brief Construct function of McCadConvexSolid +* +* @param const TopoDS_Solid & theSolid +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadConvexSolid::McCadConvexSolid(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + //m_FaceList = new TopTools_HSequenceOfShape; // New a sequence to store the faces + m_DiscPntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + m_EdgePntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + + GenFacesList(theSolid); // Trace the boundary faces of solid, store in the list of faces. + GenEdgePoints(); // Generate the discrete points of each edges. + AddAuxSurfaces(); // Add assisted surfaces for concave curved surfaces. +} + + +McCadConvexSolid::~McCadConvexSolid() +{ + //m_FaceList->Clear(); + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); +} + + + +/** ******************************************************************** +* @brief Generate the face list +* +* @param const TopoDS_Solid & theSolid +* @return void +* +* @date 31/8/2012 +* @modify 4/2/2014 fuse the same boundary surfaces +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenFacesList(const TopoDS_Solid & theSolid) +{ +// TopExp_Explorer exp; // Traverse the faces of input solid +// for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TopoDS_Face theFace = TopoDS::Face(exp.Current()); +// McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces +// m_STLFaceList.push_back(pExtFace); +// m_iNumOfFaces++; +// } + + + TopExp_Explorer exp; // Traverse the faces of input solid + + vector face_list; + // vector fused_face_list; + vector fused_face_list; + + for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + face_list.push_back(theFace); + } + + McCadFuseSurface Fuser; // Fuse the surfaces with same geomtries and common edge + /// Traverse the surfaces, find the same surfaces + for(int i = 0; i < face_list.size(); i++ ) + { + for(int j = i+1; j < face_list.size(); j++ ) + { + Fuser.SetSurfaces(face_list.at(i),face_list.at(j)); + if(Fuser.Fuse()) + { + McCadExtFace *pExtFace = new McCadExtFace(Fuser.GetNewSurf()); + pExtFace->MergeDscPnt(face_list.at(i)); + pExtFace->MergeDscPnt(face_list.at(j)); + + face_list.erase(face_list.begin()+j); + face_list.erase(face_list.begin()+i); + fused_face_list.push_back(pExtFace); + + j -= 1; + i -= 1; + break; + } + } + } + + /// Based on the new boundary surfaces, generate the McCadExtFace and add into surface list. + for(int i = 0; i < face_list.size(); i++ ) + { + TopoDS_Face theFace = face_list.at(i); + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + for(int i = 0; i < fused_face_list.size(); i++ ) + { + McCadExtFace *pExtFace = fused_face_list.at(i); + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + face_list.clear(); + fused_face_list.clear(); +} + + + +/** ******************************************************************** +* @brief Add Auxiliary Surface to each concave curved surface +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::AddAuxSurfaces() +{ + for (int i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList.at(i); + /* Judge whether need to add auxiliary faces when there are curved surfaces */ + if( pExtFace->IsConcaveCurvedFace() ) // Judge the face is concave curve surface or not + { + /* Get the auxiliary faces list */ + vector theAuxFaceList = pExtFace->GetAuxFaces(); + /* Judge the auxiliary face whether can be add into auxiliary face list.*/ + JudgeAuxFaces(theAuxFaceList,pExtFace); + } + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TopoDS_Shape McCadConvexSolid::GetBntBoxShape() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBoxShape; + } + else + { + GetBntBox(); + return m_bBoxShape; + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadConvexSolid::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + gp_Pnt MaxPnt(fXmax, fYmax, fZmax); // The max point of the boundary box + gp_Pnt MinPnt(fXmin, fYmin, fZmin); // The min point of the boundary box + + m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenDescPoints(Standard_Boolean bGenVoid) +{ + /* Generate sample points of the each face */ + if (m_DiscPntList->IsEmpty()) + { + if (bGenVoid) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + pExtFace->GetDiscPntList(); // Discrete each face of convex solid. + } + } + } + + cout<<"-----1"<IsEmpty()) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Add the discrete point list of face into the one of solid + } + } +} + + + +/** ******************************************************************** +* @brief Judge the auxiliary face can be add into auxiliary face list +of this face +* +* @param vector & theAuxFaceList +* @param McCadExtFace *& theFace +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadConvexSolid::JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace) +{ + /* If the auxiliary face is sign-constant,it can be added into auxiliary face list */ + for (Standard_Integer i = 0; i < theAuxFaceList.size(); i++) + { + TopoDS_Face theAuxFace = *(theAuxFaceList[i]); + + BRepAdaptor_Surface BS(theAuxFace, Standard_True); + GeomAdaptor_Surface theAdpSurface = BS.Surface(); + + Standard_Integer iPosPnt = 0; + Standard_Integer iNegPnt = 0; + + //Standard_Real aVal = 1.0 + for (Standard_Integer j = 1; j <= m_EdgePntList->Length(); j++) + { + /* Distinguish which side does the point located.*/ + Standard_Real aVal = McCadGTOOL::Evaluate(theAdpSurface, m_EdgePntList->Value(j)); + + if (aVal > 1.0e-5) // Point located on the positive side of face + { + iPosPnt ++; + } + else if (aVal < -1.0e-5) // Point located on the negative side of face + { + iNegPnt ++; + } + + if (iPosPnt > 0 && iNegPnt > 0) // i.e sign changing + { + (theAuxFaceList[i])->AddAttri(1); + break; + } + } + } + return; +} + + +/** ******************************************************************** +* @brief Get the face list of solid +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadConvexSolid::GetSTLFaceList() +{ + return m_STLFaceList; +} + + + +/** ******************************************************************** +* @brief Discrete the faces and get the list of discreted points. +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadConvexSolid::GetDiscPntList() +{ + return m_DiscPntList; +} + + +void McCadConvexSolid::DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt) +{ + MergeBndFaces(bMergeDiscPnt); + MergeBndAuxFaces(); + + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + MergeAuxFaces(pLeftFace,pRightFace); + } + } +} + + +void McCadConvexSolid::MergeBndFaces(Standard_Boolean bMergeDiscPnt) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if(pLeftFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + if (bMergeDiscPnt) + { + pLeftFace->AddSameFaces(pRightFace); // Add the same face into samefacelist for collision detection + } + + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + continue; + } + } + } +} + + +void McCadConvexSolid::MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace) +{ + for (Standard_Integer i = 0; i < pLeftFace->GetAuxFaces().size(); i++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(i); + for (Standard_Integer j = 0; j < pRightFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(j); + if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) + { + pRightFace->RemoveAuxFace(j); + j--; + } + } + } + +} + +void McCadConvexSolid::MergeBndAuxFaces() +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + for (Standard_Integer k = 0; k < pRightFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pRightFace->GetAuxFaces().at(k); + if(pLeftFace->GetFaceNum() == pAuxFace->GetFaceNum()) + { + cout<GetFaceNum()<<" "<GetFaceNum()<RemoveAuxFace(k); + k--; + continue; + } + } + } + } +} + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadConvexSolid::GetExpression() +{ + if (!m_szExpression.IsEmpty()) + { + return m_szExpression; + } + + TCollection_AsciiString szAuxFaceUni = ""; + TCollection_AsciiString szAuxFaceSub = ""; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + + McCadExtFace * pExtFace = m_STLFaceList[i]; + /* if the orientation of face is minus,add "-" before the face number */ + //if(pExtFace->GetFaceOrientation() == MINUS) + //{ + //m_szExpression += "-"; + //} + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + if (szAuxFaceUni.Search(" ") != -1 ) + { + m_szExpression += " ("; + m_szExpression += szAuxFaceSub; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceSub; + m_szExpression += " "; + } + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + if (szAuxFaceUni.Search(":") != -1 ) + { + m_szExpression += "("; + m_szExpression += szAuxFaceUni; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceUni; + } + } + + return m_szExpression; +} + + +Standard_Real McCadConvexSolid::GetVolume() +{ + return McCadGeomTool::GetVolume(*this); +} + + +void McCadConvexSolid::ChangeFaceNum(McCadGeomData * pData) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace * pExtFace = m_STLFaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pExtFace->SetFaceNum(iFaceNumNew); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + iFaceNumOld = pAuxFace->GetFaceNum(); + iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pAuxFace->SetFaceNum(iFaceNumNew); + + /* Test Code */ + //cout<<"old:"< McCadConvexSolid::GetFaces() +{ + return m_STLFaceList; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid_GeomErr.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid_GeomErr.hxx new file mode 100644 index 0000000..f8f8809 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadConvexSolid_GeomErr.hxx @@ -0,0 +1,102 @@ +/** @file + * @brief + * + * @author + * @date + */ + +#ifndef MCCADCONVEXSOLID_HXX +#define MCCADCONVEXSOLID_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "McCadExtFace.hxx" +#include "McCadTripoliCell.hxx" + + +using namespace std; + +//class McCadVoidCellManager; +class McCadGeomData; +class McCadConvexSolid : public TopoDS_Solid{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadConvexSolid(); + McCadConvexSolid(const TopoDS_Solid & theSolid); + ~McCadConvexSolid(); + +private: + + int m_iNum; /**< Number of Cell */ + int m_iMatNo; /**< Number of Material */ + + double m_dDensity; /**< Material Density */ + int m_iNeutronIMP; /**< Importance of Neutron */ + int m_iPhotonIMP; /**< Importance of Photon */ + + TCollection_AsciiString m_szExpression; /**< MCNP Expression of Solid */ + int m_iNumOfFaces; /**< Number of Boundary Surface */ + + TopoDS_Shape m_bBoxShape; /**< The shape of boundary box */ + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + //vector m_faceList; + //Handle_TopTools_HSequenceOfShape m_FaceList; /**< Facelist store the boundary face */ + vector m_STLFaceList; /**< Face list of convex solid */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points list */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges */ + + void GenFacesList(const TopoDS_Solid & theSolid); /**< Get the data of faces of solid */ + void AddAuxSurfaces(); /**< Add Auxiliary Surface to each concave curved surface*/ + + /** If the auxiliary face is sign-constant, add it into auxiliary face list */ + void JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace); + +public: + + /** Set the number material number and some information of cell */ + void SetCellInfo(int iNum, int iMat, double fDensity, int iNeutronIMP, int iPhotonIMP); + + TopoDS_Shape GetBntBoxShape(); /**< Get boundary box shape */ + Bnd_Box GetBntBox(); /**< Get boundary box */ + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get the discrete point list */ + + vector GetSTLFaceList(); /**< Get the face list */ + TCollection_AsciiString GetExpression(); /**< Generate solid expression */ + void GenDescPoints(Standard_Boolean bGenVoid); /**< Descrete the faces and store the points into list */ + void GenEdgePoints(); + + void ChangeFaceNum(McCadGeomData * pData); + void DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt); /**< Delete the repeat faces */ + void MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace); /**< Merge auxilary surfaces*/ + void MergeBndAuxFaces(); /**< Merge boundary surfaces and auxiliary surfaces */ + void MergeBndFaces(Standard_Boolean bMergeDiscPnt); /**< Merge boundary surfaces */ + Standard_Real GetVolume(); + + vector GetFaces(); +}; + +#endif // MCCADCONVEXSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtAuxFace.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtAuxFace.cxx new file mode 100644 index 0000000..9e89c41 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtAuxFace.cxx @@ -0,0 +1,54 @@ +#include "McCadExtAuxFace.hxx" + +McCadExtAuxFace::McCadExtAuxFace() +{ +} + +Standard_Integer McCadExtAuxFace::GetConvexity() +{ + return m_iConvexity; +} +/** ******************************************************************** +* @brief Construct function +* +* @param const TopoDS_Face &theFace +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtAuxFace::McCadExtAuxFace(const TopoDS_Face &theFace):McCadExtFace(theFace) +{ + +} + + + +/** ******************************************************************** +* @brief Copy construct function +* +* @param const McCadExtFace &theExtFace +* @return +* +* @date 14/3/2013 +* @author Lei Lu +************************************************************************/ +McCadExtAuxFace::McCadExtAuxFace(const McCadExtAuxFace &theExtFace) +{ + +} + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtAuxFace::~McCadExtAuxFace() +{ + +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtAuxFace.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtAuxFace.hxx new file mode 100644 index 0000000..4822654 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtAuxFace.hxx @@ -0,0 +1,39 @@ +#ifndef MCCADEXTAUXFACE_HXX +#define MCCADEXTAUXFACE_HXX + +#include "McCadExtFace.hxx" + +class McCadExtAuxFace : public McCadExtFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadExtAuxFace(); + McCadExtAuxFace(const TopoDS_Face &theFace); + McCadExtAuxFace(const McCadExtAuxFace &theExtFace); + ~McCadExtAuxFace(); + +private: + + Standard_Integer m_iConvexity; /**< Judge if the auxiliary face can cut the solid into two parts */ + +public: + + void SetConvexity(Standard_Integer m_iConvexity); /**< Add convexity to the auxiliary face */ + Standard_Integer GetConvexity(); /**< Get convexity of the auxiliary face */ + +}; + +#endif // MCCADEXTAUXFACE_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtBndFace.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtBndFace.cxx new file mode 100644 index 0000000..4a11a09 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtBndFace.cxx @@ -0,0 +1,330 @@ +#include "McCadExtBndFace.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +//#include "../McCadTool/McCadConvertConfig.hxx" + +McCadExtBndFace::McCadExtBndFace() +{ +} + +/** ******************************************************************** +* @brief Construct function +* +* @param const TopoDS_Face &theFace +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtBndFace::McCadExtBndFace(const TopoDS_Face &theFace):McCadExtFace(theFace) +{ + m_bHaveAuxFace = Standard_False; + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = new TColgp_HSequenceOfPnt; +} + + + +/** ******************************************************************** +* @brief Copy construct function +* +* @param const McCadExtFace &theExtFace +* @return +* +* @date 14/3/2013 +* @author Lei Lu +************************************************************************/ +McCadExtBndFace::McCadExtBndFace(const McCadExtBndFace &theExtFace) +{ + *this = theExtFace; +} + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtBndFace::~McCadExtBndFace() +{ + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); + for (unsigned int i = 0; i < m_AuxFaceList.size(); i++) + { + McCadExtFace *pFace = m_AuxFaceList.at(i); + delete pFace; + pFace = NULL; + } +} + + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtBndFace::RemoveAuxFace(Standard_Integer index) +{ + m_AuxFaceList.clear(); +} + + +/** ******************************************************************** +* @brief Judge the face has auxiliary face or not. +* +* @param +* @return +* +* @date +* @author +************************************************************************/ +Standard_Boolean McCadExtBndFace::HaveAuxSurf() +{ + return m_bHaveAuxFace; +} + + +/** ******************************************************************** +* @brief Judge the face is concave curved face or not +* +* @param +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadExtBndFace::IsConcaveCurvedFace() +{ + /* Judge the face is plane or not, plane needn't to add auxiliary face */ + TopLoc_Location loc; + Handle_Geom_Surface theGeomSurface = BRep_Tool::Surface(*this,loc); + GeomAdaptor_Surface theAdaptedSurface(theGeomSurface); + if(theAdaptedSurface.GetType() == GeomAbs_Plane) + { + return Standard_False; + } + + /* If the curved surface is forward, no need to add auxiliary face */ + if(this->Orientation() == TopAbs_FORWARD) + { + return Standard_False; + } + else if(this->Orientation() == TopAbs_REVERSED) + { + /* If the max and min UV parameter of the face is same, the face is unaviliable. */ + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(*this, UMin,UMax, VMin, VMax); + + /* gp::Resolution is tolerance to judge the points is same or not, + So judge the curved face is close or not. */ + if ( fabs(UMax - UMin)<= gp::Resolution() || fabs(VMax - VMin)<= gp::Resolution()) + { + return Standard_False; + } + return Standard_True; + } + return Standard_False; +} + + +/** ******************************************************************** +* @brief Get the discreted sample points of face +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadExtBndFace::GetDiscPntList() +{ + if (m_DiscPntList->Length() == 0) + { + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_DiscPntList = McCadGeomTool::GetFaceSamplePnt(*this); + cout<<"Sample points of face ----------------------------- "<Length()<Length() == 0) + { + m_EdgePntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = McCadGeomTool::GetEdgeSamplePnt(*this); + cout<<"Sample points of edge ----------------------------- "<Length()< +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector McCadExtBndFace::GetAuxFaces() +{ + if (m_bHaveAuxFace == Standard_False) + { + Handle_TopTools_HSequenceOfShape tmpFaceList = new TopTools_HSequenceOfShape(); + tmpFaceList = McCadCSGTool::Partials(*this); // Calculate the auxiliary faces + if(tmpFaceList->Length() == 0) + { + return m_AuxFaceList; + } + for (int i = 1; i <= tmpFaceList->Length(); i++) + { + TopoDS_Face tmpFace = TopoDS::Face(tmpFaceList->Value(i)); + McCadExtFace * pExtFace = new McCadExtFace(tmpFace); +//qiu m_AuxFaceList.push_back(pExtFace); + m_AuxFaceList.push_back(static_cast (pExtFace)); + } + tmpFaceList->Clear(); + m_bHaveAuxFace = Standard_True; // The face has auxiliary faces + return m_AuxFaceList; + } + else + { + return m_AuxFaceList; + } +} + + +/** ******************************************************************** +* @brief Add the auxiliary faces +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtBndFace::AddAuxFaces(vector< McCadExtAuxFace* > faces) +{ + //GetAuxFaces(); + for(Standard_Integer i = 0; i < faces.size(); i++) + { + for (Standard_Integer j = 0; j < m_AuxFaceList.size(); j++) + { + Standard_Integer iAuxFaceNum = m_AuxFaceList.at(j)->GetFaceNum(); + // if the two auxilary faces are same surfaces with different oritation, + // remove them, because (-1 : 1) means whole space. + if(faces.at(i)->GetFaceNum() == -iAuxFaceNum) + { + McCadExtAuxFace *pAuxFace = m_AuxFaceList.at(j); + m_AuxFaceList.erase(m_AuxFaceList.begin()+j); + delete pAuxFace; + pAuxFace = NULL; + j--; + continue; + } + // if the auxilary faces are same, do not add + else if (faces.at(i)->GetFaceNum() == iAuxFaceNum) + { + continue; + } + // if the auxilary faces are different faces, create a new one + // and add to the auxilary face lis of one face. + else + { + McCadExtAuxFace *pExtFace = new McCadExtAuxFace(*faces.at(i)); + m_AuxFaceList.push_back(pExtFace); + } + } + + } +} + + +/** ******************************************************************** +* @brief Get the same face list +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector< McCadExtBndFace* > McCadExtBndFace::GetSameFaces() +{ + return m_SameFaceList; +} + + +/** ******************************************************************** +* @brief If a solid has two same surfaces, add one of them into the + samefacelist of another's. and update the mesh points list + and boundary box for collision detection. +* +* @param int iNum +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtBndFace::AddSameFaces( McCadExtBndFace* faces) +{ + m_EdgePntList->Append(faces->GetEdgePntList()); // Merge the discrete edge points of the two same faces + m_DiscPntList->Append(faces->GetDiscPntList()); // Merge the discrete face points of the two same faces + + GetBndBox(); // Merge the boundary box + m_bBox.Add(faces->GetBndBox()); + + AddAuxFaces(faces->GetAuxFaces()); // Merge the auxiliary face + McCadExtBndFace *pExtFace = new McCadExtBndFace(*faces); // Put one face into sameface list of another face + m_SameFaceList.push_back(pExtFace); +} + + +void McCadExtBndFace::AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list) +{ + m_DiscPntList->Append(pnt_list); +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtBndFace.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtBndFace.hxx new file mode 100644 index 0000000..48eeb1a --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtBndFace.hxx @@ -0,0 +1,65 @@ +#ifndef MCCADEXTBNDFACE_HXX +#define MCCADEXTBNDFACE_HXX + +#include "McCadExtFace.hxx" +#include "McCadExtAuxFace.hxx" + +class McCadExtBndFace : public McCadExtFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadExtBndFace(); + McCadExtBndFace(const TopoDS_Face &theFace); + McCadExtBndFace(const McCadExtBndFace &theExtFace); + ~McCadExtBndFace(); + +private: + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points of faces */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges of this face */ + + Standard_Boolean m_bHaveAuxFace; /**< Whether have auxiliary face */ + vector< McCadExtAuxFace* > m_AuxFaceList; /**< Auxiliary face list */ + + ORIENTATION m_symbol; /**< The direction of plane is positive or negative */ + + Bnd_Box m_bBox; + GeomAbs_SurfaceType m_FaceType; + + vector< McCadExtBndFace* > m_SameFaceList; /**< Merge the same surface of one solid */ + +public: + + Standard_Boolean IsConcaveCurvedFace(); /**< Concave curved face need to add auxiliary face */ + + void RemoveAuxFace(Standard_Integer index); /**< Remove the face with the face number*/ + vector GetAuxFaces(); /**< Get the auxiliary faces list */ + void AddAuxFaces(vector faces); /**< Add a list of faces as auxiliary faces*/ + Standard_Boolean HaveAuxSurf(); /**< If this face has auxiliary face*/ + + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get discrete point list of face */ + void AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list); /** Add point list*/ + Handle_TColgp_HSequenceOfPnt GetEdgePntList(); /**< Get the discrete point list of edges*/ + + //Bnd_Box GetBndBox(); /**< Get the boundary box of face*/ + void UpdateBndBox(Bnd_Box theBBox); /**< Update the boundary box of face*/ + + void AddSameFaces(McCadExtBndFace *faces); /**< Add the face with same geometry into same face list*/ + vector< McCadExtBndFace* > GetSameFaces(); /**< Get the face in same face list*/ + +}; + +#endif // MCCADEXTBNDFACE_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtFace.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtFace.cxx new file mode 100644 index 0000000..2d630c3 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtFace.cxx @@ -0,0 +1,735 @@ +#include "McCadExtFace.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +McCadExtFace::McCadExtFace() +{ +} + +/** ******************************************************************** +* @brief Construct function +* +* @param const TopoDS_Face &theFace +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtFace::McCadExtFace(const TopoDS_Face &theFace):TopoDS_Face(theFace) +{ + m_bHaveAuxFace = Standard_False; + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = new TColgp_HSequenceOfPnt; + m_iAttri = 0; + m_bFusedFace = Standard_False; +} + + + +/** ******************************************************************** +* @brief Copy construct function +* +* @param const McCadExtFace &theExtFace +* @return +* +* @date 14/3/2013 +* @author Lei Lu +************************************************************************/ +McCadExtFace::McCadExtFace(const McCadExtFace &theExtFace):TopoDS_Face(theExtFace) +{ + //m_bHaveAuxFace = Standard_False; + //m_DiscPntList = new TColgp_HSequenceOfPnt; + m_iFaceNum = theExtFace.m_iFaceNum; + //*this = theExtFace; + m_iAttri = theExtFace.GetAttri(); + +} + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtFace::~McCadExtFace() +{ + m_DiscPntList->Clear(); + for (unsigned int i = 0; i < m_AuxFaceList.size(); i++) + { + McCadExtFace *pFace = m_AuxFaceList.at(i); + delete pFace; + pFace = NULL; + } +} + + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @modify 04/09/2014 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::RemoveAuxFace(Standard_Integer index) +{ + McCadExtFace * pFace = m_AuxFaceList.at(index); + m_AuxFaceList.erase(m_AuxFaceList.begin()+index); + delete pFace; + pFace = NULL; +} + + + +/** ******************************************************************** +* @brief Add attribute to the auxiliary face +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::AddAttri(Standard_Integer iAttri) +{ + m_iAttri = iAttri; +} + + + + +/** ******************************************************************** +* @brief Judge the face is concave curved face or not +* +* @param +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadExtFace::IsConcaveCurvedFace() +{ + /* Judge the face is plane or not, plane needn't to add auxiliary face */ + TopLoc_Location loc; + Handle_Geom_Surface theGeomSurface = BRep_Tool::Surface(*this,loc); + GeomAdaptor_Surface theAdaptedSurface(theGeomSurface); + + SetFaceType(theAdaptedSurface.GetType()); + + if(theAdaptedSurface.GetType() == GeomAbs_Plane) + { + return Standard_False; + } + + /* If the curved surface is forward, no need to add auxiliary face */ + if(this->Orientation() == TopAbs_FORWARD) + { + return Standard_False; + } + else if(this->Orientation() == TopAbs_REVERSED) + { + /* If the max and min UV parameter of the face is same, the face is unaviliable. */ + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(*this, UMin,UMax, VMin, VMax); + + /* gp::Resolution is tolerance to judge the points is same or not, + So judge the curved face is close or not. */ + if ( fabs(UMax - UMin)<= gp::Resolution() || fabs(VMax - VMin)<= gp::Resolution()) + { + return Standard_False; + } + return Standard_True; + } + return Standard_False; +} + + +/** ******************************************************************** +* @brief Get the discreted sample points of face +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadExtFace::GetDiscPntList() +{ + if (m_DiscPntList->Length() == 0) + { + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_DiscPntList = McCadGeomTool::GetFaceSamplePnt(*this); + cout<<">>> Sample points of face ....................... "<Length()<Length() == 0) + { + m_EdgePntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = McCadGeomTool::GetEdgeSamplePnt(*this); + cout<<">>> Sample points of edge ....................... "<Length()<Length(); i++) + // { + // pos = m_EdgePntList->Value(i); + // cout<<"y"< +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector McCadExtFace::GetAuxFaces() +{ + if (m_bHaveAuxFace == Standard_False) + { + Handle_TopTools_HSequenceOfShape AuxFaceList = new TopTools_HSequenceOfShape(); + if ( (!McCadCSGTool::AddAuxSurf(*this,AuxFaceList)) + || (AuxFaceList->Length() == 0)) // Calculate the auxiliary faces + { + return m_AuxFaceList; + } + + for (int i = 1; i <= AuxFaceList->Length(); i++) + { + TopoDS_Face tmpFace = TopoDS::Face(AuxFaceList->Value(i)); + McCadExtFace * pExtFace = new McCadExtFace(tmpFace); + m_AuxFaceList.push_back(pExtFace); + } + + AuxFaceList->Clear(); + m_bHaveAuxFace = Standard_True; // The face has auxiliary faces + return m_AuxFaceList; + } + else + { + return m_AuxFaceList; + } +} + + + +/** ******************************************************************** +* @brief Add the auxiliary faces +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::AddAuxFaces(vector< McCadExtFace* > faces) +{ + // Whether the two faces have same auxilary surfaces + Standard_Boolean bRepeat = Standard_False; + for(Standard_Integer i = 0; i < faces.size(); i++) + { + for (Standard_Integer j = 0; j < m_AuxFaceList.size(); j++) + { + Standard_Integer iAuxFaceNum = m_AuxFaceList.at(j)->GetFaceNum(); + // if the two auxilary faces are same surfaces with different oritation, + // remove them, because (-1 : 1) means whole space. + if(faces.at(i)->GetFaceNum() == -iAuxFaceNum) + { + McCadExtFace *pAuxFace = m_AuxFaceList.at(j); + m_AuxFaceList.erase(m_AuxFaceList.begin()+j); + delete pAuxFace; + pAuxFace = NULL; + j--; + bRepeat = Standard_True; + break; + } + // if the auxilary faces are same, do not add + else if (faces.at(i)->GetFaceNum() == iAuxFaceNum) + { + bRepeat = Standard_True; + break; + } + + // if the auxilary faces are different faces, create a new one + // and add to the auxilary face lis of one face. + if (!bRepeat) + { + McCadExtFace *pExtFace = new McCadExtFace(*faces.at(i)); + m_AuxFaceList.push_back(pExtFace); + } + } + } +} + + +/** ******************************************************************** +* @brief Get the same face list +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector< McCadExtFace* > McCadExtFace::GetSameFaces() +{ + return m_SameFaceList; +} + + + +/** ******************************************************************** +* @brief If a solid has two same surfaces, add one of them into the + samefacelist of another's. and update the mesh points list + and boundary box for collision detection. +* +* @param int iNum +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::AddSameFaces( McCadExtFace* faces) +{ + m_EdgePntList->Append(faces->GetEdgePntList()); // Merge the discrete edge points of the two same faces + if (McCadConvertConfig::GenerateVoid()) + { + m_DiscPntList->Append(faces->GetDiscPntList()); // Merge the discrete face points of the two same faces + } + + GetBndBox(); // Merge the boundary box + m_bBox.Add(faces->GetBndBox()); + + if(faces->HaveAuxSurf()) + { + AddAuxFaces(faces->GetAuxFaces()); // Merge the auxiliary face + } + + McCadExtFace *pExtFace = new McCadExtFace(*faces); // Put one face into sameface list of another face + m_SameFaceList.push_back(pExtFace); +} + + + +/** ******************************************************************** +* @brief +* +* +* +* @param int iNum +* @return void +* +* @date 7/2/2014 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::MergeDscPnt(TopoDS_Face &theFace) +{ + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create a McCadExtFace based on original face + + // m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Merge the discrete edge points of the two same faces + + //if (McCadConvertConfig::GenerateVoid()) + // { + // m_DiscPntList->Append(pExtFace->GetDiscPntList()); // Merge the discrete face points of the two same faces + // } + + //m_bBox.Add(pExtFace->GetBndBox()); // Merge the boundary box + AddSameFaces(pExtFace); + m_bFusedFace = Standard_True; + + //delete pExtFace; + //pExtFace = NULL; +} + + + + +Standard_Boolean McCadExtFace::HaveAuxSurf() +{ + return m_bHaveAuxFace; +} + + + + +/** ******************************************************************** +* @brief Set the number of face according the storing position of face list +* +* @param int iNum +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::SetFaceNum(int iNum) +{ + if(this->GetFaceOrientation() == MINUS ) + { + m_iFaceNum = -1 * iNum ;//* m_Reverse; + } + else + { + m_iFaceNum = iNum ;//* m_Reverse; + } +} + + + +/** ******************************************************************** +* @brief Get face number which can be used to find the geometry information +* +* @param +* @return Standard_Integer +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Integer McCadExtFace::GetFaceNum() +{ + return m_iFaceNum; +} + + + +/** ******************************************************************** +* @brief Get the orientation of face, is forward or reversed +* +* @param +* @return ENUM ORIENTATION (PLUS or MINUS) +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +ORIENTATION McCadExtFace::GetFaceOrientation() +{ + TopAbs_Orientation orient = this->Orientation(); + if (orient == TopAbs_FORWARD) + { + return MINUS; // Add minus symbol + } + else if(orient == TopAbs_REVERSED) + { + return PLUS; // Add plus symbol + } +} + + +Bnd_Box McCadExtFace::GetBndBox() +{ + if(!m_bBox.IsVoid()) + { + return m_bBox; + } + + Bnd_Box tmpBBox; + BRepBndLib::Add(*this, tmpBBox); + + tmpBBox.SetGap(0.0); + Standard_Real xMin, yMin, zMin, xMax, yMax, zMax; + tmpBBox.Get(xMin, yMin, zMin, xMax, yMax, zMax); + gp_Pnt lower(xMin, yMin, zMin), upper(xMax, yMax, zMax); + + McCadGeomTool::SimplifyPoint(lower); + McCadGeomTool::SimplifyPoint(upper); + + m_bBox.Add(lower); + m_bBox.Add(upper); + + return m_bBox; +} + + +void McCadExtFace::UpdateBndBox(Bnd_Box theBBox) +{ + if(m_bBox.IsVoid()) + { + GetBndBox(); + } + m_bBox.Add(theBBox); +} + + +GeomAbs_SurfaceType McCadExtFace::GetFaceType() +{ + return m_FaceType; +} + + +void McCadExtFace::SetFaceType(GeomAbs_SurfaceType theFaceType) +{ + m_FaceType = theFaceType; +} + + +void McCadExtFace::AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list) +{ + m_DiscPntList->Append(pnt_list); +} + + + +/*Handle_TColgp_HSequenceOfPnt McCadExtFace::Init() +{ + BRepClass_FaceClassifier bsc3d; + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + + BRepAdaptor_Curve2d c; + TopoDS_Face theFace = *this; + + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + /*Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; +// + +// Standard_Integer nbBrimPoints(0); + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50 ; + myYlen = 50; + myRlen = 0.0314; + myTolerance = 1e-07; + + for (TopExp_Explorer ex(theFace, TopAbs_EDGE); ex.More(); ex.Next()) + { + c.Initialize(TopoDS::Edge(ex.Current()), theFace); + Standard_Real f = (!(Precision::IsNegativeInfinite(c.FirstParameter()))) ? c.FirstParameter() : -1.0; + Standard_Real l = (!(Precision::IsPositiveInfinite(c.LastParameter()))) ? c.LastParameter() : 1.0; + + gp_Pnt2d pf = c.Value(f); + gp_Pnt2d pl = c.Value(l); + gp_Pnt p3f; + theASurface.D0(pf.X(), pf.Y(), p3f); + gp_Pnt p3l; + theASurface.D0(pl.X(), pl.Y(), p3l); + Standard_Real Len = p3f.Distance(p3l); + Standard_Integer NUMPNT; + if (int(Len/myXlen) < myMinNbPnt) + NUMPNT = myMinNbPnt; + else if (int(Len/myXlen) > myMaxNbPnt) + NUMPNT = myMaxNbPnt; + else + NUMPNT = int(Len/myXlen); + + for (int t=0; t<=NUMPNT; t++) + { + Standard_Real a = Standard_Real(t)/Standard_Real(NUMPNT); + Standard_Real par = (1-a)*f + a*l; + gp_Pnt2d p2 = c.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bsc3d.Perform(theFace, p2, myTolerance); + + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON) + thePntSeq->Append(p1); + } + + + + } + + + + + cout << "Length------------------------" << thePntSeq->Length() <Length(); + + //////////////////////////////////////////////////////////////////////////////////////////////////// + Standard_Real U1, U2, V1, V2; + BRepTools::UVBounds(theFace, U1, U2, V1, V2); + + if (theASurface.GetType() == GeomAbs_Cone ||theASurface.GetType() == GeomAbs_Cylinder) + { + myXlen = myRlen; + } + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + myXlen = myRlen; + myYlen = myRlen; + } + + // cout << "U1 = " << U1 << " U2 = " << U2 << " V1 = " << V1 << " V2 = " << V2 << endl; + Standard_Real du=1, dv=1; + + Standard_Real XLen=U2-U1; + Standard_Real YLen=V2-V1; + Standard_Integer XNUMPNT; + if (int(XLen/myXlen) < myMinNbPnt) + XNUMPNT = myMinNbPnt; + else if (int(XLen/myXlen) > myMaxNbPnt) + XNUMPNT = myMaxNbPnt; + else + XNUMPNT = int(XLen/myXlen); + // cout << "XNUMPNT = " << XNUMPNT << endl; + Standard_Integer YNUMPNT; + if (int(YLen/myYlen) < myMinNbPnt) + YNUMPNT = myMinNbPnt; + else if (int(YLen/myYlen) > myMaxNbPnt) + YNUMPNT = myMaxNbPnt; + else + YNUMPNT = int(YLen/myYlen); + // cout << "YNUMPNT = " << YNUMPNT << endl; + + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = new TColgp_HSequenceOfPnt(); + + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + cout << "XLen = " << XLen << endl; + cout << "YLen = " << YLen << endl; + cout << "XNUMPNT = " << XNUMPNT << endl; + cout << "YNUMPNT = " << YNUMPNT << endl; + cout << "myMinNbPnt = " << myMinNbPnt << endl; + + } + + Standard_Integer repeat = 0; + do + { + if (repeat > 3) + break; + + du = XLen/Standard_Real(XNUMPNT); + dv = YLen/Standard_Real(YNUMPNT); + + tmpPntSeq->Clear(); + + for (int j=0; j<=YNUMPNT; j++) + { + Standard_Real V = V1+dv*j; + + for (int i=0; i<=XNUMPNT; i++) + { + gp_Pnt p1; + Standard_Real U = U1+du*i; + theASurface.D0(U, V, p1); + gp_Pnt2d p2(U, V); + + bsc3d.Perform(theFace, p2, myTolerance); + if (bsc3d.State() == TopAbs_IN /*|| bsc3d.State() == TopAbs_ON) //MYTEST comment + tmpPntSeq->Append(p1); + } + } + + XNUMPNT=XNUMPNT*2; + YNUMPNT=YNUMPNT*2; + repeat++; + + } while (tmpPntSeq->Length() < myMinNbPnt*myMinNbPnt); + + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + cout << "XNUMPNT = " << XNUMPNT << endl; + cout << "YNUMPNT = " << YNUMPNT << endl; + cout << "myMinNbPnt = " << myMinNbPnt << endl; + + } + + + + thePntSeq->Append(tmpPntSeq); + + + + // we add vetices here + for (TopExp_Explorer exv(theFace, TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + thePntSeq->Prepend(aPnt); + } + + /////////////////////////////////////////////////////////////////////////////////////////////// + // remove sample points which have been added multiple times + for (int j=2; j<= thePntSeq->Length(); j++) + { + gp_XYZ p1 = (thePntSeq->Value(j)).XYZ(); + for (int jk=j-1; jk >= 1; jk--) + { + gp_XYZ p2 = (thePntSeq->Value(jk)).XYZ(); + + //cout << p1.X()*p1.X() + p1.Y()*p1.Y() + p1.Z()*p1.Z() + p2.X()*p2.X() + p2.Y()*p2.Y() + p2.Z()*p2.Z() << endl; + + if (p1.IsEqual(p2, 1.e-05)) + { + thePntSeq->Remove(jk); + j=jk; + } + } + } + + + // cout << "Total Number of face sample points computed = " << thePntSeq->Length() << endl; + Bnd_Box aBB; // make a tight box!!!! + + + BRepBndLib::Add(theFace, aBB); + aBB.SetGap(0); + + + if (aBB.IsWhole() || aBB.IsVoid() || aBB.IsThin(1e-7)) + cout << "_#_McCadDiscretization_Face.cxx :: Face Bounding box computation failed !!" << endl; + + return thePntSeq; + +}*/ diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtFace.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtFace.hxx new file mode 100644 index 0000000..77e9348 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadExtFace.hxx @@ -0,0 +1,113 @@ +#ifndef MCCADEXTFACE_HXX +#define MCCADEXTFACE_HXX + +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +enum ORIENTATION{PLUS = 0, MINUS = 1}; + +class McCadExtFace : public TopoDS_Face +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadExtFace(); + McCadExtFace(const TopoDS_Face &theFace); + McCadExtFace(const McCadExtFace &theExtFace); + ~McCadExtFace(); + +private: + Standard_Integer m_iFaceNo; /**< The number of face in the facelist */ + Standard_Integer m_iNumPnt; /**< The number of discrete points */ + + Standard_Boolean m_bHaveAuxFace; /**< Whether have auxiliary face */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points of faces */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges of this face */ + vector< McCadExtFace* > m_AuxFaceList; /**< Auxiliary face list */ + + Standard_Integer m_iFaceNum; /**< Face number of the geomtetry face list */ + ORIENTATION m_symbol; /**< The direction of plane is positive or negative */ + + //TopoDS_Face m_Face; + Bnd_Box m_bBox; + GeomAbs_SurfaceType m_FaceType; + + vector< McCadExtFace* > m_SameFaceList; /**< Merge the same surface of one solid */ + Standard_Integer m_iAttri; + + Standard_Boolean m_bFusedFace; /**< The fused face is no need to do the collision detection with void box*/ + + /* Standard_Integer myMaxNbPnt; + Standard_Integer myMinNbPnt; + Standard_Real myXlen; + Standard_Real myYlen; + Standard_Real myRlen; + Standard_Real myTolerance;*/ + + +public: + + + Standard_Boolean IsConcaveCurvedFace(); /**< Concave curved face need to add auxiliary face */ + void RemoveAuxFace(Standard_Integer index); /**< Remove the face with the face number*/ + + vector< McCadExtFace* > GetAuxFaces(); + void AddAuxFaces(vector faces); /**< Add a list of faces for auxiliary faces*/ + + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get discrete point list of face */ + void AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list); /** Add point list*/ + Handle_TColgp_HSequenceOfPnt GetEdgePntList(); /**< Get the discrete point list of edge frame*/ + + void SetFaceNum(int iCodeNum); /**< Set face number */ + Standard_Integer GetFaceNum(); /**< Get face number */ + + void SetSurfSymbol(); /**< Set the symbol based on direction of surface */ + Standard_Boolean GetSurfSymbol(); /**< Get the symbol */ + void ChangeSymbol(Standard_Boolean bSymbol); /**< Change the symbol */ + ORIENTATION GetFaceOrientation(); /**< Get the orientation of face, is plus or minus */ + + Bnd_Box GetBndBox(); + void UpdateBndBox(Bnd_Box theBBox); + GeomAbs_SurfaceType GetFaceType(); + void SetFaceType(GeomAbs_SurfaceType theFaceType); + Standard_Boolean HaveAuxSurf(); + + void AddSameFaces( McCadExtFace* faces); + vector< McCadExtFace* > GetSameFaces(); + + /**< Merge discrete points of the two connect surfaces with same geometries */ + void MergeDscPnt(TopoDS_Face &theFace); + + void AddAttri(Standard_Integer iAttri); +//qiu Standard_Integer GetAttri(){return m_iAttri;}; + Standard_Integer GetAttri() const {return m_iAttri;}; + Standard_Integer IsFusedFace(){return m_bFusedFace;}; + //McCadExtFace *m_mergedFace; + + + //Standard_Boolean IsSame(McCadExtFace *& theFace); + //Handle_TColgp_HSequenceOfPnt Init();test + +}; + +#endif // MCCADEXTFACE_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGDMLWriter.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGDMLWriter.cxx new file mode 100644 index 0000000..dc8c76f --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGDMLWriter.cxx @@ -0,0 +1,1140 @@ +#include "McCadGDMLWriter.hxx" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +#include "assert.h" + +McCadGDMLWriter::McCadGDMLWriter() +{ +} +McCadGDMLWriter::~McCadGDMLWriter() +{ +} + +void McCadGDMLWriter::CheckNames(vector aNameList) +{ + QString aBackup; //back up the name + QString aNewName; //new name if repeat + int n=1; + + for (unsigned int i=0; iGetGeomData(); + assert(pData); + //check the solid names + vector aNameList; + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) { + TCollection_AsciiString atmpName = pData->m_SolidList.at(i)->GetName(); + aNameList.push_back(QString(atmpName.ToCString())); + cout <<"Solid name : " <m_SolidList.size(); i++) { + QString atmpName = aNameList.at(i); + cout <<"After rename name : " <m_SolidList.at(i)->SetName(TCollection_AsciiString(atmpName.toStdString().c_str())); + } +} +void McCadGDMLWriter::CheckMaterialNames() +{ + //get the data + MaterialManager * pMatManager = m_pManager->GetMatManager(); + assert(pMatManager); //qiu comment out because error: mat manager is create late! +// if (!pMatManager) return; + + vector aMaterialList = pMatManager->GetMatList(); + vector aNameList; + + for(unsigned int i = 0; i < aMaterialList.size(); i++) + aNameList.push_back(aMaterialList.at(i)->GetMatName()); + CheckNames(aNameList); + for (unsigned int i = 0; i < aMaterialList.size(); i++) { + aMaterialList.at(i)->SetMatName(aNameList.at(i)); + } +} + + +void McCadGDMLWriter::PrintFile() +{ + //check the solid and material name + CheckSolidNames(); + CheckMaterialNames(); + + //open the document + QFile *file = new QFile(QString(m_OutputFileName.ToCString())); + if(!file->open(QFile::WriteOnly|QFile::Truncate)) + return; + //the heading instruction + QDomProcessingInstruction instruction; + instruction = m_Doc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\""); + m_Doc.appendChild(instruction); + + QDomElement root=m_Doc.createElement(("gdml")); //create the gdml Element + root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + root.setAttribute("xsi:noNamespaceSchemaLocation","gdml.xsd" ); //default schema location: current directory + m_Doc.appendChild(root); + + //let's print it + PrintDefine(root); + PrintMaterial(root); + PrintSolids(root); + PrintStructure(root); + PrintSetup(root); + + + QTextStream out(file); + m_Doc.save(out,4); + file->close(); +} + +void McCadGDMLWriter::PrintDefine(QDomElement & ParentElement) +{ + //print the define element + QDomElement theElement = m_Doc.createElement(("define")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aName (pSolid->GetName().ToCString()) ; //get the solid name + + //print the polyhedron for the whole pSolid + PrintPolyhedron(theElement, pSolid, aName); + + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + if (ConvexSolidCnt == 1) continue; //only one convex solid: print only once + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName /*; + if (ConvexSolidCnt == 1) bName = aName; + else bName*/ = aName + QString("_%1").arg(j); + PrintPolyhedron(theElement, pConvexSolid, bName); + } + } + + //print the world box polyhedron + //!! COMMENT OUT because the worldBox is failed in genearted surface in McCad + //!! Using a hug box instead! +// McCadVoidCell * pVoid = getWholeBntBox(); +// PrintPolyhedron(theElement,pVoid, "WorldBox"); + +} + + + +void McCadGDMLWriter::MeshShape(const TopoDS_Shape theShape, double & theDeflection) +{ + + Standard_Real aDeflection = theDeflection <= 0 ? 0.0001 : theDeflection; + + //If deflection <= 0, than return default deflection + if(theDeflection <= 0) + theDeflection = aDeflection; + + // Is shape triangulated? + Standard_Boolean alreadymeshed = Standard_True; + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + alreadymeshed = Standard_False; + break; + } + } + + if(!alreadymeshed) { + Bnd_Box B; + BRepBndLib::Add(theShape, B); + if ( B.IsVoid() ) + return; // NPAL15983 (Bug when displaying empty groups) + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + // This magic line comes from Prs3d_ShadedShape.gxx in OCCT + aDeflection = max(aXmax-aXmin, max( aYmax-aYmin, aZmax-aZmin)) * aDeflection * 4; + + //Clean triangulation before compute incremental mesh + BRepTools::Clean(theShape); + + //Compute triangulation + BRepMesh_IncrementalMesh MESH(theShape,aDeflection); + } +} + +void McCadGDMLWriter::PrintPolyhedron(QDomElement & ParentElement, const TopoDS_Shape * aShape, const QString & aName) +{ + //write the name attribute + QDomElement theElement = m_Doc.createElement(("Polyhedron")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", QString("Poly_")+ aName); //add "Poly_" to avoid repeated name in GDML + + //mesh the solid + TopoDS_Shape theShape = *aShape; + double theDeflection = 0.001; + MeshShape(theShape, theDeflection); + + //get the node list and facet list + //we create the nodes and facets element for the gdml directly here + + + QDomElement NodesElement = m_Doc.createElement(("Nodes")); + NodesElement.setAttribute("lunit", "cm"); + QDomElement FacetsElement = m_Doc.createElement(("Facets")); + int NodeTotal=0; //each time a face is mesh, the total node will be updated + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + //get the nodes and facets + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //make a node element + QDomElement aNodeElement = m_Doc.createElement(("Node")); + aNodeElement.setAttribute("x",P.X()/10); //unit cm + aNodeElement.setAttribute("y",P.Y()/10); + aNodeElement.setAttribute("z",P.Z()/10); + NodesElement.appendChild(aNodeElement); + } + + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++){ // i start with 1 ?? + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); + N1 += NodeTotal ; //node id should start from 1 + N2 += NodeTotal ; + N3 += NodeTotal ; + + QDomElement aFacetElement = m_Doc.createElement(("Facet")); + //IMPORTANT!! this must do otherwise the visualization will be wrong! + if (aFace.Orientation() == TopAbs_REVERSED) + { + aFacetElement.setAttribute("n1",N3); // reverse the order if face is reversed!! + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N1); + } + else + { + aFacetElement.setAttribute("n1",N1); + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N3); + } + + FacetsElement.appendChild(aFacetElement); + } + NodeTotal += nbNodesInFace; //MUST DO!! + } + + theElement.appendChild(NodesElement); + theElement.appendChild(FacetsElement); + +} + +void McCadGDMLWriter::PrintPolyhedron(QDomElement & ParentElement, McCadSolid * pSolid, const QString & aName) +{ + //write the name attribute + QDomElement theElement = m_Doc.createElement(("Polyhedron")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", QString("Poly_")+ aName); //add "Poly_" to avoid repeated name in GDML + + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + int NodeTotal=0; //each time a face is mesh, the total node will be updated + QDomElement NodesElement = m_Doc.createElement(("Nodes")); + NodesElement.setAttribute("lunit", "cm"); + QDomElement FacetsElement = m_Doc.createElement(("Facets")); + double theDeflection = 0.001; + + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + + //mesh the solid + TopoDS_Shape theShape = *pConvexSolid; + MeshShape(theShape, theDeflection); + + //get the node list and facet list + //we create the nodes and facets element for the gdml directly here + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + //get the nodes and facets + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //make a node element + QDomElement aNodeElement = m_Doc.createElement(("Node")); + aNodeElement.setAttribute("x",P.X()/10); //unit cm + aNodeElement.setAttribute("y",P.Y()/10); + aNodeElement.setAttribute("z",P.Z()/10); + NodesElement.appendChild(aNodeElement); + } + + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++){ // i start with 1 ?? + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); + N1 += NodeTotal ; //node id should start from 1 + N2 += NodeTotal ; + N3 += NodeTotal ; + + QDomElement aFacetElement = m_Doc.createElement(("Facet")); + if (aFace.Orientation() == TopAbs_REVERSED) + { + aFacetElement.setAttribute("n1",N3); // reverse the order if face is reversed!! + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N1); + } + else + { + aFacetElement.setAttribute("n1",N1); + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N3); + } + FacetsElement.appendChild(aFacetElement); + } + NodeTotal += nbNodesInFace; //MUST DO!! + } + } + + theElement.appendChild(NodesElement); + theElement.appendChild(FacetsElement); + + +} + + +void McCadGDMLWriter::PrintMaterial(QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("materials")); + ParentElement.appendChild(theElement); + + //get the data + MaterialManager * pMatManager = m_pManager->GetMatManager(); + assert(pMatManager); + + vector aMaterialList = pMatManager->GetMatList(); + + for(unsigned int i = 0; i < aMaterialList.size(); i++) + { + //create a Material element + QDomElement MaterialElement = m_Doc.createElement(("material")); + Material * aMaterial = aMaterialList.at(i); + MaterialElement.setAttribute("name", QString("Mat_") + aMaterial->GetMatName()); //add "Mat_" to avoid repeated name in GDML + //create the density element + QDomElement DensityElement = m_Doc.createElement(("D")); + DensityElement.setAttribute("value", aMaterial->GetMatDensity()); + DensityElement.setAttribute("unit", "g/cm3"); //We use g/cm3 as defaut unit, in future should be selectable. + MaterialElement.appendChild(DensityElement); +// QDomText txtMatcard = m_Doc.createTextNode(aMaterial->GetMatCard()); +// MaterialElement.appendChild(txtMatcard); + theElement.appendChild(MaterialElement); + } + +} + + +void McCadGDMLWriter::PrintSolids (QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("solids")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + //print convex solid + QString aName (pSolid->GetName().ToCString()) ; //get the solid name + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName; + if (ConvexSolidCnt == 1) bName = aName; + else bName = aName + QString("_%1").arg(j); + PrintHalfSpaceSolid(theElement, pConvexSolid, bName); + } + + //make boolean operation to Union + if ( pSolid->GetConvexSolidList().size() == 1) + continue; //no need for the union + else { + PrintHalfSpaceBoolean(theElement, aName, ConvexSolidCnt); + } + } + + //print the world solid + //first we make this box +//no need TopoDS_Solid aBndBox = *(pData->m_pOutVoid); //McCadVoidCell is inherit from TopoDS_Solid +//no need McCadConvexSolid * pWorldBox = new McCadConvexSolid(aBndBox); + //!! COMMENT OUT because the worldBox is failed in genearted surface in McCad + //!! Using a hug box instead! +// McCadVoidCell * pVoid = getWholeBntBox(); +// PrintHalfSpaceSolid(theElement, pVoid, "WorldBox"); +// delete pVoid; + PrintWorldBox(theElement); + +} + + void McCadGDMLWriter::PrintWorldBox (QDomElement & ParentElement) +{ + //build a element + QDomElement theElement = m_Doc.createElement(("box")); + theElement.setAttribute("name", "WorldBox"); + theElement.setAttribute("x", "100000"); + theElement.setAttribute("y", "100000"); + theElement.setAttribute("z", "100000"); + ParentElement.appendChild(theElement); +} + + +void McCadGDMLWriter::PrintHalfSpaceSolid(QDomElement & ParentElement, + McCadConvexSolid *pConvexSolid, const QString & aName) +{ + //build a element + QDomElement theElement = m_Doc.createElement(("HalfSpaceSolid")); + ParentElement.appendChild(theElement); + + theElement.setAttribute("name", aName); + theElement.setAttribute("lunit", "cm"); + + //print the surface //unit cm + PrintSurfaces(theElement, pConvexSolid); + + //print the bounadry box //unit cm + PrintBoundaryBox(theElement, pConvexSolid); + + //print other values (volume size, surface area, polyhedron) //unit cm + PrintVolumeArea(theElement, pConvexSolid, aName); + PrintPolyhedronRef(theElement, aName); + +} + +void McCadGDMLWriter::PrintHalfSpaceSolid(QDomElement & ParentElement, + McCadVoidCell *pVoid, const QString & aName) +{ + //build a element + QDomElement theElement = m_Doc.createElement(("HalfSpaceSolid")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", aName); + theElement.setAttribute("lunit", "cm"); + + //print the surface + PrintSurfaces(theElement, pVoid); + + //print the bounadry box + PrintBoundaryBox(theElement, pVoid); + + //print other values (volume size, surface area, polyhedron) + PrintVolumeArea(theElement, pVoid, aName); + PrintPolyhedronRef(theElement, aName); + +} + + +void McCadGDMLWriter::PrintSurfaces(QDomElement & ParentElement, McCadConvexSolid *pConvexSolid) +{ + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + //print the surface element + QDomElement theElement = m_Doc.createElement(("Surfaces")); + ParentElement.appendChild(theElement); + + for (unsigned int i = 0; i < (pConvexSolid->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pConvexSolid->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); //get the surface number + int theSense = iFaceNum > 0 ? 1 : -1; //if face number > 0: positive; else negative + //using the face number to get the face from list + +// cout <<"iFaceNum " <HaveAuxSurf()) + { + for(unsigned int j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + if (pAuxFace->GetAttri() == 1) //union aux surface + { + QDomComment aComment= m_Doc.createComment("FatalError: McCadGDMLWriter::PrintSurfaces does not support Union Auxiliary surface!!"); + ParentElement.appendChild(aComment); +// cout<<"FatalError: McCadGDMLWriter::PrintSurfaces does not support Union Auxiliary surface!! "; + return; + } + else //intersect aux surface + { + int iAuxFaceNum = pAuxFace->GetFaceNum(); + theSense = iAuxFaceNum >0 ? 1 : -1 ; + //qiu A BUG HERE!! +// IGeomFace * qFace = findSurface(abs(iFaceNum) -1); //?? correct? + IGeomFace * qFace = findSurface(abs(iAuxFaceNum) -1); //?? correct? + if (qFace == NULL) { + QDomComment aComment= m_Doc.createComment("FatalError: McCadGDMLWriter::Cannot get the surface of number!"); + ParentElement.appendChild(aComment); +// cout<<"FatalError: McCadGDMLWriter::Cannot get the surface of number "<GetGeomData(); + assert(pData); + + //print the surface element + QDomElement theElement = m_Doc.createElement(("Surfaces")); + ParentElement.appendChild(theElement); + + for (unsigned int i = 0; i < (pVoid->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pVoid->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); //get the surface number + int theSense = iFaceNum > 0 ? 1 : -1; //if face number > 0: positive; else negative + //using the face number to get the face from list + +// cout <<"iFaceNum " <HaveAuxSurf()) + { + for(unsigned int j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + if (pAuxFace->GetAttri() == 1) //union aux surface + { + cout<<"FatalError: McCadGDMLWriter::PrintSurfaces does not support Union Auxiliary surface!! "; + return; + } + else //intersect aux surface + { + int iAuxFaceNum = pAuxFace->GetFaceNum(); + theSense = iAuxFaceNum >0 ? 1 : -1 ; + IGeomFace * qFace = findSurface(abs(iFaceNum) -1); //?? correct? + if (qFace == NULL) { + cout<<"FatalError: McCadGDMLWriter::Cannot get the surface of number "<GetGeomData(); + assert(pData); +// for (unsigned int i=0; im_GeomSurfList.size(); i++) +// { +// IGeomFace * aSurf = pData->m_GeomSurfList.at(i); +// if (aSurf->GetSurfNum() == aIdx) +// return aSurf; +// } +// return NULL; + return pData->m_GeomSurfList.at(aIdx); +} + + +void McCadGDMLWriter::PrintASurface(QDomElement & ParentElement, IGeomFace * pFace, const int & theSense) +{ + QString aSymb = pFace->GetSurfSymb().ToCString(); + + if (aSymb == "P") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("A",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("B",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("C",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "PX") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "PY") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "PZ") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SO") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SX") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SY") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Z",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SZ") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "S") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "CX") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("Center1",0.); + theElement.setAttribute("Center2",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "CY") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("Center1",0.); + theElement.setAttribute("Center2",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "CZ") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("Center1",0.); + theElement.setAttribute("Center2",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "C/X") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("Center1",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Center2",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(2))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "C/Y") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("Center1",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Center2",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(2))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "C/Z") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("Center1",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Center2",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(2))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "KX") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",0.); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "KY") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "KZ") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Z",0.); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "K/X") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "K/Y") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "K/Z") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "GQ") { + QDomElement theElement = m_Doc.createElement(("Quadric")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("A",RoundDouble(pFace->GetPrmtList().at(0))); + //ATTENTION, some parameters should /2, difference between Geant4 half-space solid + //and MCNP please check the development documents and MCNP manual! + theElement.setAttribute("B",RoundDouble(pFace->GetPrmtList().at(3)/2.0)); + theElement.setAttribute("C",RoundDouble(pFace->GetPrmtList().at(5)/2.0)); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(6)/2.0)); + theElement.setAttribute("E",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("F",RoundDouble(pFace->GetPrmtList().at(4)/2.0)); + theElement.setAttribute("G",RoundDouble(pFace->GetPrmtList().at(7)/2.0)); + theElement.setAttribute("H",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("I",RoundDouble(pFace->GetPrmtList().at(8)/2.0)); + theElement.setAttribute("J",RoundDouble(pFace->GetPrmtList().at(9))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "TX") { + QDomElement theElement = m_Doc.createElement(("Torus")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("CenterX",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("CenterY",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("CenterZ",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("AxisX",1.); + theElement.setAttribute("AxisY",0.); + theElement.setAttribute("AxisZ",0.); + theElement.setAttribute("MaxRadius",RoundDouble(pFace->GetPrmtList().at(3))); + //ATTENTION!! the A,B,C in MCNP torus parameters means r, b, a in Geant4 + //Half-space solid, therefore the order should be switched! +// theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(4))); +// theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(4))); + ParentElement.appendChild(theElement); + + } + else if (aSymb == "TY") { + QDomElement theElement = m_Doc.createElement(("Torus")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("CenterX",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("CenterY",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("CenterZ",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("AxisX",0.); + theElement.setAttribute("AxisY",1.); + theElement.setAttribute("AxisZ",0.); + theElement.setAttribute("MaxRadius",RoundDouble(pFace->GetPrmtList().at(3))); + //ATTENTION!! the A,B,C in MCNP torus parameters means r, b, a in Geant4 + //Half-space solid, therefore the order should be switched! +// theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(4))); +// theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(5)); + theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(4))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "TZ") { + QDomElement theElement = m_Doc.createElement(("Torus")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("CenterX",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("CenterY",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("CenterZ",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("AxisX",0.); + theElement.setAttribute("AxisY",0.); + theElement.setAttribute("AxisZ",1.); + theElement.setAttribute("MaxRadius",RoundDouble(pFace->GetPrmtList().at(3))); + //ATTENTION!! the A,B,C in MCNP torus parameters means r, b, a in Geant4 + //Half-space solid, therefore the order should be switched! +// theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(4))); +// theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(4))); + ParentElement.appendChild(theElement); + } +} + +void McCadGDMLWriter::PrintBoundaryBox(QDomElement & ParentElement, TopoDS_Solid *pConvexSolid) +{ + //create the elemenet + QDomElement theElement = m_Doc.createElement(("BoundaryBox")); + + //calculate the boundary box + Bnd_Box theBB; + BRepBndLib::Add(*pConvexSolid, theBB); +// theBB.SetGap(0.0); //better to set a small gap + theBB.SetGap(0.001); + Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + theBB.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); + + QDomElement LowerPoint = m_Doc.createElement(("LowerPoint")); + QDomElement UpperPoint = m_Doc.createElement(("UpperPoint")); + LowerPoint.setAttribute("x", Xmin/10); //unit cm + LowerPoint.setAttribute("y", Ymin/10); + LowerPoint.setAttribute("z", Zmin/10); + UpperPoint.setAttribute("x", Xmax/10); + UpperPoint.setAttribute("y", Ymax/10); + UpperPoint.setAttribute("z", Zmax/10); + + theElement.appendChild(LowerPoint); + theElement.appendChild(UpperPoint); + ParentElement.appendChild(theElement); +} + +void McCadGDMLWriter::PrintVolumeArea (QDomElement & ParentElement, TopoDS_Solid *pConvexSolid, const QString & aName) +{ + //create the elements + QDomElement VolumeElement = m_Doc.createElement(("VolumeSize")); + QDomElement SurfaceAreaElement = m_Doc.createElement(("SurfaceArea")); + ParentElement.appendChild(VolumeElement); + ParentElement.appendChild(SurfaceAreaElement); + + //calculate + //from http://www.opencascade.org/org/forum/thread_17898/?forum=3 + TopoDS_Shape aShape = *pConvexSolid; + double Volume =0., Area =0.; + GProp_GProps System; + BRepGProp::SurfaceProperties(aShape, System); + Area = System.Mass()/100; //correct?? //unit cm2 + BRepGProp::VolumeProperties(aShape, System); + Volume = System.Mass()/1000;//correct?? //unit cm3 + + VolumeElement.setAttribute("value", Volume); + SurfaceAreaElement.setAttribute("value",Area); + + + +} +void McCadGDMLWriter::PrintPolyhedronRef (QDomElement & ParentElement, const QString & aName) +{ + //create the elements + + QDomElement PolyhedronElement = m_Doc.createElement(("VisualPolyhedron")); + PolyhedronElement.setAttribute("ref", QString("Poly_") + aName); //add "Poly_" to avoid repeated name in GDML, see also PrintPolyhedron() + ParentElement.appendChild(PolyhedronElement); + +} + +McCadVoidCell * McCadGDMLWriter::getWholeBntBox() +{ + Bnd_Box bnd_box; + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_ConvexSolidList.size(); i++) + { + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[i]; + assert(pSolid); + BRepBndLib::Add((TopoDS_Shape)(*pSolid),bnd_box); // Add each convex solid into bundary box + } + + bnd_box.SetGap(1.0); // Set the gap between the boundary box and material solids + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + bnd_box.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + // Interger the dimension parameters of boundary box. +//no need McCadMathTool::Integer(dXmin); +//no need McCadMathTool::Integer(dYmin); +//no need McCadMathTool::Integer(dZmin); +//no need McCadMathTool::Integer(dXmax); +//no need McCadMathTool::Integer(dYmax); +//no need McCadMathTool::Integer(dZmax); + + gp_Pnt bnd_max_pnt(dXmax,dYmax,dZmax); + gp_Pnt bnd_min_pnt(dXmin,dYmin,dZmin); + + // Create the boundary box. + McCadVoidCell *pVoid = new McCadVoidCell(BRepPrimAPI_MakeBox(bnd_min_pnt,bnd_max_pnt).Solid()); + pVoid->SetBntBox(dXmin,dYmin,dZmin,dXmax,dYmax,dZmax); + return pVoid; +} + + +void McCadGDMLWriter::PrintHalfSpaceBoolean(QDomElement & ParentElement, + const QString SolidName, const int &SubSolidCnt, const bool isPrintPoly) +{ + if (SubSolidCnt == 1) return ;//no need to make a boolean on a convex solid + + //create the element + QDomElement theElement = m_Doc.createElement(("HalfSpaceBoolean")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", SolidName); + QDomElement theUnionElement = m_Doc.createElement(("Union")); + + QString aName = SolidName ; //get the solid name + for(int j = 0; j < SubSolidCnt; j++) + { + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName = aName + QString("_%1").arg(j); + QDomElement solidElement = m_Doc.createElement(("Solid")); + solidElement.setAttribute("ref", bName); + theUnionElement.appendChild(solidElement); + } + theElement.appendChild(theUnionElement); + + //Print polyhedron reference + if (isPrintPoly) + PrintPolyhedronRef(theElement, aName); + +} + +void McCadGDMLWriter:: PrintStructure(QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("structure")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + MaterialManager * pMatManager = m_pManager->GetMatManager(); + assert(pMatManager); + + + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aSolidName (pSolid->GetName().ToCString()) ; //get the solid name + + //get the material name + QString aMatName = pMatManager->GetMaterial(pSolid->GetID())->GetMatName(); //use Material id to get material + //create the volume element + PrintVolume(theElement, aMatName, aSolidName); + } + + //create the world volume + QDomElement WorldVolElement = m_Doc.createElement(("volume")); + WorldVolElement.setAttribute("name", QString("World")); + QDomElement MaterialRefElement = m_Doc.createElement(("materialref")); + MaterialRefElement.setAttribute("ref", "Air"); + QDomElement SolidRefElement = m_Doc.createElement("solidref"); + SolidRefElement.setAttribute("ref","WorldBox"); //ref to the solid named "WorldBox" + WorldVolElement.appendChild(MaterialRefElement); + WorldVolElement.appendChild(SolidRefElement); + + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aSolidName (pSolid->GetName().ToCString()) ; //get the solid name + + //create the physcial volume element + PrintPhysicalVolume(WorldVolElement, aSolidName); + } + + theElement.appendChild(WorldVolElement); +} + +void McCadGDMLWriter::PrintVolume(QDomElement & ParentElement, const QString MaterialName, const QString SolidName) +{ + QDomElement theElement = m_Doc.createElement(("volume")); + ParentElement.appendChild(theElement); + //we add a "LV_" here because we want to make it differ from solidname + theElement.setAttribute("name", QString("LV_") + SolidName); + + QDomElement MaterialRefElement = m_Doc.createElement(("materialref")); + MaterialRefElement.setAttribute("ref", QString("Mat_") + MaterialName); // add "Mat_" to avoid repeat name in GDML + + QDomElement SolidRefElement = m_Doc.createElement("solidref"); + SolidRefElement.setAttribute("ref",SolidName); + + theElement.appendChild(MaterialRefElement); + theElement.appendChild(SolidRefElement); +} + +void McCadGDMLWriter:: PrintPhysicalVolume(QDomElement & ParentElement, const QString SolidName) +{ + QDomElement theElement = m_Doc.createElement(("physvol")); + ParentElement.appendChild(theElement); + QDomElement VolumeRefElement = m_Doc.createElement("volumeref"); + //see PrintVolume() for the volume name + VolumeRefElement.setAttribute("ref",QString("LV_") + SolidName); + + theElement.appendChild(VolumeRefElement); +} + +void McCadGDMLWriter:: PrintSetup (QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("setup")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", "Default"); //what so ever + theElement.setAttribute("version", "1.0"); //just copy the example + + QDomElement WorldElement = m_Doc.createElement(("world")); + WorldElement.setAttribute("ref", "World"); + + theElement.appendChild(WorldElement); + +} + +/*! + * \brief McCadGDMLWriter::RoundDouble + * round a double, truncate the digit + * \param aDouble + * \return the qstring of the digit + */ +QString McCadGDMLWriter::RoundDouble(const double & aDouble) +{ + //round the digit to 7 + return QString::number(aDouble, 'f', 7); +} + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGDMLWriter.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGDMLWriter.hxx new file mode 100644 index 0000000..7db8db9 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGDMLWriter.hxx @@ -0,0 +1,110 @@ +#ifndef MCCADGDMLWRITER_HXX +#define MCCADGDMLWRITER_HXX + +#include "IMcCadWriter.hxx" + +#include "TopoDS_Shape.hxx" + +#include +#include +#include +#include + +#include + +//using namespace std; +class McCadGDMLWriter : public IMcCadWriter +{ +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +public: + McCadGDMLWriter(); + ~McCadGDMLWriter(); + + //main function to print the gdml file + virtual void PrintFile() ; + + //##### Print the Element + //Print element, means print the polyhedron for visualization purpose + virtual void PrintDefine(QDomElement & ParentElement); + //print one polyhedron: a close shell form by facets + virtual void PrintPolyhedron(QDomElement & ParentElement, const TopoDS_Shape * aShape, const QString & aName); + //method to print the polyhedron for a McCadSolid. McCadSolid is not inherit from TopoDS_Shape, + //we should therefore implemenet independently + virtual void PrintPolyhedron(QDomElement & ParentElement, McCadSolid * pSolid, const QString & aName); + //meshing the shape with + void MeshShape(const TopoDS_Shape theShape, double &theDeflection); + + + //##### Print the Element + + virtual void PrintMaterial(QDomElement & ParentElement); + + //##### Print the Element + //print the element, where the solid is built by HalfSpaceSolid and HalfSpaceBoolean + virtual void PrintSolids (QDomElement & ParentElement); + //Print the whole world box + virtual void PrintWorldBox (QDomElement & ParentElement); + //print a HalfSpaceSolid + virtual void PrintHalfSpaceSolid(QDomElement & ParentElement, McCadConvexSolid * pConvexSolid, const QString & aName); + virtual void PrintHalfSpaceSolid(QDomElement & ParentElement, McCadVoidCell * pVoid, const QString & aName); + //print the surface list + virtual void PrintSurfaces(QDomElement & ParentElement, McCadConvexSolid * pConvexSolid); + virtual void PrintSurfaces(QDomElement & ParentElement, McCadVoidCell * pVoid); + //find the surface according to the surface ID + IGeomFace * findSurface(const int & aIdx); + //print a surface + virtual void PrintASurface(QDomElement & ParentElement, IGeomFace * pFace, const int & theSense); + //print the boundary box + virtual void PrintBoundaryBox(QDomElement & ParentElement, TopoDS_Solid * pConvexSolid); + //print other values (volume size, surface area, polyhedron) + virtual void PrintVolumeArea (QDomElement & ParentElement, TopoDS_Solid * pConvexSolid, const QString & aName); + virtual void PrintPolyhedronRef (QDomElement & ParentElement, const QString & aName); + //we create the boundary box but not using the one from McCadGeomData because we might goes without void generation. + virtual McCadVoidCell * getWholeBntBox(); + + //Print the HalfSpaceBoolean + //if isPrintPoly == true, then print the polyhedron + virtual void PrintHalfSpaceBoolean(QDomElement & ParentElement, const QString SolidName, + const int & SubSolidCnt, const bool isPrintPoly = true); + + + //#####print the element + virtual void PrintStructure(QDomElement & ParentElement); + //print a volume, noted that the name of the volume is set to "LV_" + SolidName + virtual void PrintVolume(QDomElement & ParentElement, const QString MaterialName, const QString SolidName); + + //print a physical volume, noted that the name of the volume is set to "LV_" + SolidName + virtual void PrintPhysicalVolume(QDomElement & ParentElement, const QString SolidName); + + //#####print the element + virtual void PrintSetup (QDomElement & ParentElement); + + //to check repetition of the name, if repeated then rename it with a number + //Because the GDML use the name as references, therefore each name should be + //unique + virtual void CheckSolidNames(); + virtual void CheckMaterialNames(); +protected: + virtual void CheckNames(vector aNameList); + QString RoundDouble(const double & aDouble); + +protected: + QDomDocument m_Doc; + + +}; + +#endif // MCCADGDMLWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone-beforeTR.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone-beforeTR.cxx new file mode 100644 index 0000000..191ffb6 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone-beforeTR.cxx @@ -0,0 +1,418 @@ +#include "McCadGeomCone.hxx" + +#include +#include +#include + +#include "McCadTransfCard.hxx" +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + + +McCadGeomCone::McCadGeomCone() +{ +} + +McCadGeomCone::~McCadGeomCone(){} + + +/** ******************************************************************** +* @brief Construct a cone based on the geometry surface +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomCone::McCadGeomCone(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfCone ; // The surface is a cone + gp_Cone cone = theSurface.Cone(); // Get the geometry of cone + cone.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = cone.Position(); // Get the coordinate system Ax3 + m_SemiAngle = cone.SemiAngle(); // Get the semi angle of cone + m_Dir = m_Axis.Direction(); // Get the direction of axis + m_Apex = cone.Apex(); // Get the peak point of cone + + if( McCadMathTool::IsEqualZero(m_Apex.X())) + m_Apex.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Y())) + m_Apex.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Z())) + m_Apex.SetZ(0.0); + + + + + cone.Coefficients( m_dPrmtA1,m_dPrmtA2,m_dPrmtA3, // Get the parameters + m_dPrmtB1,m_dPrmtB2,m_dPrmtB3, + m_dPrmtC1,m_dPrmtC2,m_dPrmtC3, + m_dPrmtD); + + m_bReverse = Standard_False; + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA1 < 0.0) + { + m_dPrmtA1 *= -1; + m_dPrmtA2 *= -1; + m_dPrmtA3 *= -1; + m_dPrmtB1 *= -1; + m_dPrmtB2 *= -1; + m_dPrmtB3 *= -1; + m_dPrmtC1 *= -1; + m_dPrmtC2 *= -1; + m_dPrmtC3 *= -1; + m_dPrmtD *= -1; + + m_bReverse = Standard_True; + } + + /* test code + cout<<"cone"<= dis_tol + && fabs(m_Apex.Y()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KX%8s%15.7f%5s%15.7f\n","",m_Apex.X(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KX"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/X%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/X"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DX(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else if( m_Axis.IsCoplanar(Ax3_Y, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Y()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KY%8s%15.7f%5s%15.7f\n","",m_Apex.Y(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KY"; + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Y%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Y"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DY(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + + } + else if( m_Axis.IsCoplanar(Ax3_Z, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Z()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Y()) <= dis_tol) + { + //sprintf(chExpn, "KZ%8s%15.7f%5s%15.7f\n","",m_Apex.Z(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KZ"; + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Z%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Z"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DZ(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else + { + /*sprintf(chExpn, "GQ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f\n", + "",m_dPrmtA1,"",m_dPrmtA2,"",m_dPrmtA3, + "",2*m_dPrmtB1,"",2*m_dPrmtB2,"",2*m_dPrmtB3, + "",2*m_dPrmtC1,"",2*m_dPrmtC2,"",2*m_dPrmtC3,"",m_dPrmtD);*/ + + m_SurfSymb = "KZ"; + m_PrmtList.push_back(0); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + m_PrmtList.push_back(1); + + m_bTransfCrad = Standard_True; + +// m_SurfSymb = "GQ"; +// m_PrmtList.push_back(m_dPrmtA1); +// m_PrmtList.push_back(m_dPrmtA2); +// m_PrmtList.push_back(m_dPrmtA3); +// m_PrmtList.push_back(2*m_dPrmtB1); +// m_PrmtList.push_back(2*m_dPrmtB3); +// m_PrmtList.push_back(2*m_dPrmtB2); +// m_PrmtList.push_back(2*m_dPrmtC1); +// m_PrmtList.push_back(2*m_dPrmtC2); +// m_PrmtList.push_back(2*m_dPrmtC3); +// m_PrmtList.push_back(m_dPrmtD); + + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + +void McCadGeomCone::AddTransfCard(McCadGeomData * pData) +{ + m_iTrNum = pData->AddTransfCard(m_Axis,m_Apex); +} + + +TCollection_AsciiString McCadGeomCone::GetTransfNum()const +{ + if(m_iTrNum != 0) + { + TCollection_AsciiString strNum(m_iTrNum); + return strNum; + } + else + { + return ""; + } + +} + +Standard_Boolean McCadGeomCone::HaveTransfCard() +{ + return m_bTransfCrad; +} + +/** ******************************************************************** +* @brief Judge the geometry of two cones are same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomCone *pCone = (McCadGeomCone*)(theSurf); + assert(pCone); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the Axis is same or opposite, the radius is same and the point on axis is same + // the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pCone->GetAxisDir(), angle_tol )) + //|| m_Dir.IsOpposite( pCone->GetAxisDir(), 1.0e-03 )) + { + if ( fabs(m_SemiAngle - pCone->GetSemiAngle()) < dis_tol + && m_Apex.IsEqual(pCone->GetApex(),dis_tol)) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the peak point of the cone +* +* @param +* @return gp_Pnt m_Apex +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomCone::GetApex() const +{ + return m_Apex; +} + +/** ******************************************************************** +* @brief Get the semi angle of the cone +* +* @param +* @return Standard_Real m_SemiAngle +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomCone::GetSemiAngle() const +{ + return m_SemiAngle; +} + + +/** ******************************************************************** +* @brief Get the direction of axis of the cone +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomCone::GetAxisDir() const +{ + return m_Dir; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomCone::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::Compare(const IGeomFace *& theGeoFace) +{ + + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone-beforeTR.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone-beforeTR.hxx new file mode 100644 index 0000000..24e385c --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone-beforeTR.hxx @@ -0,0 +1,74 @@ +#ifndef MCCADGEOMCONE_H +#define MCCADGEOMCONE_H + +#include "IGeomFace.hxx" +#include "McCadGeomData.hxx" + +#include +#include +#include +#include + +class McCadVoidCellManager; +class McCadGeomCone : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomCone(); + McCadGeomCone(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomCone(); + +public: + virtual void CleanObj() const; /**< Clean the generated objects */ + + virtual TCollection_AsciiString GetExpression(); /**< Get the mcnp expression of cone */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< Judge two cones is same or not */ + + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + + + gp_Pnt GetApex() const; /**< Get the peak point of cone */ + Standard_Real GetSemiAngle() const; /**< Get the semi angle of cone */ + gp_Dir GetAxisDir() const; /**< Get the dir of cone's axis */ + + void AddTransfCard(McCadGeomData *pData); + virtual TCollection_AsciiString GetTransfNum()const; + Standard_Boolean HaveTransfCard(); + +private: + + gp_Dir m_Dir; /**< Direction of axis */ + gp_Ax3 m_Axis; /**< Coordinate of cone */ + + Standard_Real m_SemiAngle; /**< SemiAngle of cone */ + gp_Pnt m_Apex; /**< Top point of cone */ + + Standard_Real m_dPrmtA1; /**< Parameter A1 of plane equation */ + Standard_Real m_dPrmtA2; /**< Parameter A2 of plane equation */ + Standard_Real m_dPrmtA3; /**< Parameter A3 of plane equation */ + Standard_Real m_dPrmtB1; /**< Parameter B1 of plane equation */ + Standard_Real m_dPrmtB2; /**< Parameter B2 of plane equation */ + Standard_Real m_dPrmtB3; /**< Parameter B3 of plane equation */ + Standard_Real m_dPrmtC1; /**< Parameter C1 of plane equation */ + Standard_Real m_dPrmtC2; /**< Parameter C2 of plane equation */ + Standard_Real m_dPrmtC3; /**< Parameter C3 of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ + + Standard_Integer m_iTrNum; + Standard_Boolean m_bTransfCrad; +}; + +#endif // MCCADGEOMCONE_H diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone.cxx new file mode 100644 index 0000000..893925d --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone.cxx @@ -0,0 +1,419 @@ +#include "McCadGeomCone.hxx" + +#include +#include +#include + +#include "McCadTransfCard.hxx" +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + + +McCadGeomCone::McCadGeomCone() +{ +} + +McCadGeomCone::~McCadGeomCone(){} + + +/** ******************************************************************** +* @brief Construct a cone based on the geometry surface +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomCone::McCadGeomCone(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfCone ; // The surface is a cone + gp_Cone cone = theSurface.Cone(); // Get the geometry of cone + cone.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = cone.Position(); // Get the coordinate system Ax3 + m_SemiAngle = cone.SemiAngle(); // Get the semi angle of cone + m_Dir = m_Axis.Direction(); // Get the direction of axis + m_Apex = cone.Apex(); // Get the peak point of cone + + if( McCadMathTool::IsEqualZero(m_Apex.X())) + m_Apex.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Y())) + m_Apex.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Z())) + m_Apex.SetZ(0.0); + + + + + cone.Coefficients( m_dPrmtA1,m_dPrmtA2,m_dPrmtA3, // Get the parameters + m_dPrmtB1,m_dPrmtB2,m_dPrmtB3, + m_dPrmtC1,m_dPrmtC2,m_dPrmtC3, + m_dPrmtD); + + m_bReverse = Standard_False; + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA1 < 0.0) + { + m_dPrmtA1 *= -1; + m_dPrmtA2 *= -1; + m_dPrmtA3 *= -1; + m_dPrmtB1 *= -1; + m_dPrmtB2 *= -1; + m_dPrmtB3 *= -1; + m_dPrmtC1 *= -1; + m_dPrmtC2 *= -1; + m_dPrmtC3 *= -1; + m_dPrmtD *= -1; + + m_bReverse = Standard_True; + } + + /* test code + cout<<"cone"<= dis_tol + && fabs(m_Apex.Y()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KX%8s%15.7f%5s%15.7f\n","",m_Apex.X(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KX"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/X%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/X"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DX(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else if( m_Axis.IsCoplanar(Ax3_Y, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Y()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KY%8s%15.7f%5s%15.7f\n","",m_Apex.Y(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KY"; + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Y%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Y"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DY(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + + } + else if( m_Axis.IsCoplanar(Ax3_Z, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Z()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Y()) <= dis_tol) + { + //sprintf(chExpn, "KZ%8s%15.7f%5s%15.7f\n","",m_Apex.Z(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KZ"; + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Z%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Z"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DZ(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else + { + /*sprintf(chExpn, "GQ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f\n", + "",m_dPrmtA1,"",m_dPrmtA2,"",m_dPrmtA3, + "",2*m_dPrmtB1,"",2*m_dPrmtB2,"",2*m_dPrmtB3, + "",2*m_dPrmtC1,"",2*m_dPrmtC2,"",2*m_dPrmtC3,"",m_dPrmtD);*/ + + // m_SurfSymb = "KZ"; + // m_PrmtList.push_back(0); + // m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + //m_PrmtList.push_back(1); + + // m_bTransfCrad = Standard_True; + + m_SurfSymb = "GQ"; + m_PrmtList.push_back(m_dPrmtA1); + m_PrmtList.push_back(m_dPrmtA2); + m_PrmtList.push_back(m_dPrmtA3); + m_PrmtList.push_back(2*m_dPrmtB1); + m_PrmtList.push_back(2*m_dPrmtB3); + m_PrmtList.push_back(2*m_dPrmtB2); + m_PrmtList.push_back(2*m_dPrmtC1); + m_PrmtList.push_back(2*m_dPrmtC2); + m_PrmtList.push_back(2*m_dPrmtC3); + m_PrmtList.push_back(m_dPrmtD); + + + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + +void McCadGeomCone::AddTransfCard(McCadGeomData * pData) +{ + m_iTrNum = pData->AddTransfCard(m_Axis,m_Apex); +} + + +TCollection_AsciiString McCadGeomCone::GetTransfNum()const +{ + if(m_iTrNum != 0) + { + TCollection_AsciiString strNum(m_iTrNum); + return strNum; + } + else + { + return ""; + } + +} + +Standard_Boolean McCadGeomCone::HaveTransfCard() +{ + return m_bTransfCrad; +} + +/** ******************************************************************** +* @brief Judge the geometry of two cones are same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomCone *pCone = (McCadGeomCone*)(theSurf); + assert(pCone); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the Axis is same or opposite, the radius is same and the point on axis is same + // the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pCone->GetAxisDir(), angle_tol )) + //|| m_Dir.IsOpposite( pCone->GetAxisDir(), 1.0e-03 )) + { + if ( fabs(m_SemiAngle - pCone->GetSemiAngle()) < dis_tol + && m_Apex.IsEqual(pCone->GetApex(),dis_tol)) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the peak point of the cone +* +* @param +* @return gp_Pnt m_Apex +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomCone::GetApex() const +{ + return m_Apex; +} + +/** ******************************************************************** +* @brief Get the semi angle of the cone +* +* @param +* @return Standard_Real m_SemiAngle +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomCone::GetSemiAngle() const +{ + return m_SemiAngle; +} + + +/** ******************************************************************** +* @brief Get the direction of axis of the cone +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomCone::GetAxisDir() const +{ + return m_Dir; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomCone::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::Compare(const IGeomFace *& theGeoFace) +{ + + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone.hxx new file mode 100644 index 0000000..24e385c --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCone.hxx @@ -0,0 +1,74 @@ +#ifndef MCCADGEOMCONE_H +#define MCCADGEOMCONE_H + +#include "IGeomFace.hxx" +#include "McCadGeomData.hxx" + +#include +#include +#include +#include + +class McCadVoidCellManager; +class McCadGeomCone : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomCone(); + McCadGeomCone(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomCone(); + +public: + virtual void CleanObj() const; /**< Clean the generated objects */ + + virtual TCollection_AsciiString GetExpression(); /**< Get the mcnp expression of cone */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< Judge two cones is same or not */ + + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + + + gp_Pnt GetApex() const; /**< Get the peak point of cone */ + Standard_Real GetSemiAngle() const; /**< Get the semi angle of cone */ + gp_Dir GetAxisDir() const; /**< Get the dir of cone's axis */ + + void AddTransfCard(McCadGeomData *pData); + virtual TCollection_AsciiString GetTransfNum()const; + Standard_Boolean HaveTransfCard(); + +private: + + gp_Dir m_Dir; /**< Direction of axis */ + gp_Ax3 m_Axis; /**< Coordinate of cone */ + + Standard_Real m_SemiAngle; /**< SemiAngle of cone */ + gp_Pnt m_Apex; /**< Top point of cone */ + + Standard_Real m_dPrmtA1; /**< Parameter A1 of plane equation */ + Standard_Real m_dPrmtA2; /**< Parameter A2 of plane equation */ + Standard_Real m_dPrmtA3; /**< Parameter A3 of plane equation */ + Standard_Real m_dPrmtB1; /**< Parameter B1 of plane equation */ + Standard_Real m_dPrmtB2; /**< Parameter B2 of plane equation */ + Standard_Real m_dPrmtB3; /**< Parameter B3 of plane equation */ + Standard_Real m_dPrmtC1; /**< Parameter C1 of plane equation */ + Standard_Real m_dPrmtC2; /**< Parameter C2 of plane equation */ + Standard_Real m_dPrmtC3; /**< Parameter C3 of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ + + Standard_Integer m_iTrNum; + Standard_Boolean m_bTransfCrad; +}; + +#endif // MCCADGEOMCONE_H diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCylinder.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCylinder.cxx new file mode 100644 index 0000000..9d42727 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCylinder.cxx @@ -0,0 +1,394 @@ +#include "McCadGeomCylinder.hxx" + +#include + +#include +#include +#include +#include +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +using namespace std; + +McCadGeomCylinder::McCadGeomCylinder() +{ + +} + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomCylinder::McCadGeomCylinder(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfCylinder ; // The surface is a cylinder + gp_Cylinder cyln = theSurface.Cylinder(); // Get the geometry of cylinder + cyln.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = cyln.Position(); // Get the coordinate system Ax3 + m_Radius = cyln.Radius(); // Get the radius + m_Point = m_Axis.Location(); // Assign a point on the axis + m_Dir = m_Axis.Direction(); // Get the direction of axis + m_vec.SetXYZ(m_Dir.XYZ()); + m_vec.Normalize(); + + if( McCadMathTool::IsEqualZero(m_Point.X())) + m_Point.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Point.Y())) + m_Point.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Point.Z())) + m_Point.SetZ(0.0); + + cyln.Coefficients( m_dPrmtA1,m_dPrmtA2,m_dPrmtA3, // Get the parameters + m_dPrmtB1,m_dPrmtB2,m_dPrmtB3, + m_dPrmtC1,m_dPrmtC2,m_dPrmtC3, + m_dPrmtD); + + m_bReverse = Standard_False; + + /*SimplifyPrmt(m_dPrmtA1); + SimplifyPrmt(m_dPrmtA2); + SimplifyPrmt(m_dPrmtA3); + SimplifyPrmt(m_dPrmtB1); + SimplifyPrmt(m_dPrmtB2); + SimplifyPrmt(m_dPrmtB3); + SimplifyPrmt(m_dPrmtC1); + SimplifyPrmt(m_dPrmtC2); + SimplifyPrmt(m_dPrmtC3); + SimplifyPrmt(m_dPrmtD);*/ + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA1 < 0.0) + { + m_dPrmtA1 *= -1; + m_dPrmtA2 *= -1; + m_dPrmtA3 *= -1; + m_dPrmtB1 *= -1; + m_dPrmtB2 *= -1; + m_dPrmtB3 *= -1; + m_dPrmtC1 *= -1; + m_dPrmtC2 *= -1; + m_dPrmtC3 *= -1; + m_dPrmtD *= -1; + + m_bReverse = Standard_True; + } + + //m_PrmtList = new TColStd_HSequenceOfAsciiString(); + GetExpression(); +} + + +McCadGeomCylinder::~McCadGeomCylinder() +{ + m_PrmtList.clear(); +} + + +void McCadGeomCylinder::SimplifyPrmt(Standard_Real &thePrmt) +{ + if(McCadMathTool::IsEqualZero(thePrmt)) + { + thePrmt = 0.0; + } +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomCylinder::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + + Standard_Character chExpn[255]; + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + //if(Abs(m_Radius) < dis_tol) + //m_Radius = 0.0; + + // Create the standard X, Y, Z axis + gp_Ax3 Ax3_X(m_Point, gp::DX()); + gp_Ax3 Ax3_Y(m_Point, gp::DY()); + gp_Ax3 Ax3_Z(m_Point, gp::DZ()); + + if (m_Axis.IsCoplanar(Ax3_X, angle_tol, angle_tol)) + { + if (fabs(m_Point.Y()) <= dis_tol && fabs(m_Point.Z()) <= dis_tol) + { + //sprintf(chExpn, "CX%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "CX"; + m_PrmtList.push_back(m_Radius); + } + else + { + /*sprintf(chExpn, "C/X%8s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Point.Y(), + "", m_Point.Z(), + "", m_Radius);*/ + + m_SurfSymb = "C/X"; + m_PrmtList.push_back(m_Point.Y()); + m_PrmtList.push_back(m_Point.Z()); + m_PrmtList.push_back(m_Radius); + } + } + else if (m_Axis.IsCoplanar(Ax3_Y, angle_tol, angle_tol)) + { + if (fabs(m_Point.X()) <= dis_tol && fabs(m_Point.Z()) <= dis_tol) + { + //sprintf(chExpn, "CY%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "CY"; + m_PrmtList.push_back(m_Radius); + } + else + { + /*sprintf(chExpn, "C/Y%8s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Point.X(), + "", m_Point.Z(), + "", m_Radius);*/ + + m_SurfSymb = "C/Y"; + m_PrmtList.push_back(m_Point.X()); + m_PrmtList.push_back(m_Point.Z()); + m_PrmtList.push_back(m_Radius); + } + } + else if (m_Axis.IsCoplanar(Ax3_Z, angle_tol, angle_tol)) + { + if (fabs(m_Point.X()) <= dis_tol && fabs(m_Point.Y()) <= dis_tol) + { + //sprintf(chExpn, "CZ%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "CZ"; + m_PrmtList.push_back(m_Radius); + } + else + { + /*sprintf(chExpn, "C/Z%8s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Point.X(), + "", m_Point.Y(), + "", m_Radius);*/ + + m_SurfSymb = "C/Z"; + m_PrmtList.push_back(m_Point.X()); + m_PrmtList.push_back(m_Point.Y()); + m_PrmtList.push_back(m_Radius); + } + } + else + { + sprintf(chExpn, "GQ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f\n", + "",m_dPrmtA1,"",m_dPrmtA2,"",m_dPrmtA3, + "",2*m_dPrmtB1,"",2*m_dPrmtB2,"",2*m_dPrmtB3, + "",2*m_dPrmtC1,"",2*m_dPrmtC2,"",2*m_dPrmtC3,"",m_dPrmtD); + + m_SurfSymb = "GQ"; + m_PrmtList.push_back(m_dPrmtA1); + m_PrmtList.push_back(m_dPrmtA2); + m_PrmtList.push_back(m_dPrmtA3); + m_PrmtList.push_back(2*m_dPrmtB1); + m_PrmtList.push_back(2*m_dPrmtB3); + m_PrmtList.push_back(2*m_dPrmtB2); + m_PrmtList.push_back(2*m_dPrmtC1); + m_PrmtList.push_back(2*m_dPrmtC2); + m_PrmtList.push_back(2*m_dPrmtC3); + m_PrmtList.push_back(m_dPrmtD); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + +/** ******************************************************************** +* @brief Judge the geometry of two cylinders are same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCylinder::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomCylinder *pCyln = (McCadGeomCylinder*)(theSurf); + assert(pCyln); + + //Standard_Real dis_tol = 1.0e-5; + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the Axis is same or opposite, the radius is same and the point on axis is same + // the two cylinder can be treated as same cylinder + if( m_vec.IsParallel(pCyln->GetAxisDir(), angle_tol ) + || m_vec.IsOpposite( pCyln->GetAxisDir(), angle_tol )) + { + if ( fabs(m_Radius - pCyln->GetRadius()) < dis_tol + /*&& m_Point.IsEqual(pCyln->GetPoint(),dis_tol)*/) + { + + if(!m_Point.IsEqual(pCyln->GetPoint(),dis_tol)) + { + gp_Dir line_dir(m_Point.XYZ()- pCyln->GetPoint().XYZ()); + if(line_dir.IsParallel(m_Dir, angle_tol) || line_dir.IsOpposite(m_Dir, angle_tol)) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_True; + } + } + } + return Standard_False; +} + + + + + + +/** ******************************************************************** +* @brief Get the direction of axis of cylinder +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomCylinder::GetAxisDir() const +{ + return m_Dir; +} + + + + +/** ******************************************************************** +* @brief Get the center of bottom section +* +* @param +* @return gp_Pnt m_Point +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomCylinder::GetPoint() const +{ + return m_Point; +} + + + + +/** ******************************************************************** +* @brief Get the radius of section +* +* @param +* @return Standard_Real m_Radius +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomCylinder::GetRadius() const +{ + return m_Radius; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomCylinder::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCylinder::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + +TCollection_AsciiString McCadGeomCylinder::GetTransfNum()const +{ + return ""; +} + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCylinder.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCylinder.hxx new file mode 100644 index 0000000..06d9731 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomCylinder.hxx @@ -0,0 +1,67 @@ +#ifndef MCCADGEOMCYLINDER_HXX +#define MCCADGEOMCYLINDER_HXX + +#include "IGeomFace.hxx" +#include +#include +#include + +class McCadGeomCylinder : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomCylinder(); + McCadGeomCylinder(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomCylinder(); + +public: + virtual TCollection_AsciiString GetExpression(); /**< Calculate the equation and direction of plane */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace); /**< Judge the two cylinder are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + + virtual TCollection_AsciiString GetTransfNum() const; + + Standard_Real GetRadius() const; /**< Get radius */ + gp_Pnt GetPoint() const; /**< Get point on axis */ + gp_Dir GetAxisDir() const; /**< Get direction of axis */ + void SimplifyPrmt(Standard_Real &thePrmt); + +private: + + gp_Dir m_Dir; /**< Direction of a axis */ + gp_Ax3 m_Axis; /**< Axis of cylinder */ + gp_Pnt m_Point; /**< A point on axis */ + Standard_Real m_Radius; /**< Radius of section */ + gp_Vec m_vec; + + Standard_Real m_dPrmtA1; /**< Parameter A1 of plane equation */ + Standard_Real m_dPrmtA2; /**< Parameter A2 of plane equation */ + Standard_Real m_dPrmtA3; /**< Parameter A3 of plane equation */ + Standard_Real m_dPrmtB1; /**< Parameter B1 of plane equation */ + Standard_Real m_dPrmtB2; /**< Parameter B2 of plane equation */ + Standard_Real m_dPrmtB3; /**< Parameter B3 of plane equation */ + Standard_Real m_dPrmtC1; /**< Parameter C1 of plane equation */ + Standard_Real m_dPrmtC2; /**< Parameter C2 of plane equation */ + Standard_Real m_dPrmtC3; /**< Parameter C3 of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ +}; + +#endif // MCCADGEOMCYLINDER_HXX + + + + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomData.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomData.cxx new file mode 100644 index 0000000..f7f7fb2 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomData.cxx @@ -0,0 +1,532 @@ +#include "McCadGeomData.hxx" + +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "McCadConvexSolid.hxx" +#include "McCadGeomPlane.hxx" +#include "McCadGeomCylinder.hxx" +#include "McCadGeomCone.hxx" +#include "McCadGeomSphere.hxx" +#include "McCadGeomTorus.hxx" +#include "McCadGeomRevolution.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" + +McCadGeomData::McCadGeomData() +{ + m_iNumSolid = 0; // Initial the number of convex solid. +} + +McCadGeomData::McCadGeomData(Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bVoid) +{ + InputData(solid_list,bVoid); +} + +McCadGeomData::~McCadGeomData() +{ + if(m_pOutVoid != NULL) + { + delete m_pOutVoid; + m_pOutVoid = NULL; + } + + vector::iterator iterSld; + for (iterSld = m_SolidList.begin(); iterSld != m_SolidList.end(); ++iterSld) + { + if(*iterSld != NULL) + { + delete *iterSld; + *iterSld = NULL; + } + } + m_SolidList.clear(); + + vector::iterator iterConvexSld; + for (iterConvexSld = m_ConvexSolidList.begin(); iterConvexSld != m_ConvexSolidList.end(); ++iterConvexSld) + { + if(*iterConvexSld != NULL) + { + delete *iterConvexSld; + *iterConvexSld = NULL; + } + } + m_ConvexSolidList.clear(); + + vector::iterator iterVoidCell; + for (iterVoidCell = m_VoidCellList.begin(); iterVoidCell != m_VoidCellList.end(); ++iterVoidCell) + { + if(*iterVoidCell != NULL) + { + delete *iterVoidCell; + *iterVoidCell = NULL; + } + } + m_VoidCellList.clear(); + + vector::iterator iterFace; + for (iterFace = m_GeomSurfList.begin(); iterFace != m_GeomSurfList.end(); ++iterFace) + { + if(*iterFace != NULL) + { + delete *iterFace; + *iterFace = NULL; + } + } + m_GeomSurfList.clear(); + + vector::iterator iterTrfCard; + for (iterTrfCard = m_TransfCardList.begin(); iterTrfCard != m_TransfCardList.end(); ++iterTrfCard) + { + if(*iterTrfCard != NULL) + { + delete *iterTrfCard; + *iterTrfCard = NULL; + } + } + m_TransfCardList.clear(); +} + + +/** ******************************************************************** +* @brief Get the material solids from the input file read, and generate +* the surfaces list. +* +* @param[in] Handle_TopTools_HSequenceOfShape solid_list +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::InputData( Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bGenVoid ) +{ + m_listConvexSolid = new TopTools_HSequenceOfShape; // create a shape list to store the convex material solids + m_listVoidCell = new TopTools_HSequenceOfShape; // create a shape list to store the void solids + + Standard_Integer iNumMatSolid = solid_list->Length(); + cout<< iNumMatSolid << " Solids are read" << endl; + + for(int i = 1; i <= iNumMatSolid; i++) + { + cout<Value(i).GetSolid(); + TopoDS_Shape theShape = solid_list->Value(i); + TopExp_Explorer exp; + + /// If the solid is compound solid, explode each its lumps into solids firstly + if( theShape.ShapeType() == TopAbs_COMPSOLID || theShape.ShapeType() == TopAbs_COMPOUND ) + { + cout<<"yes. it is compoundsolid;"<GetVolume() >= -0.01) // Set the minimum volume tolerance + { + pConvexSolid = new McCadConvexSolid(tmpSolid); + } + else + { + cout<<"Detected a solid with small volume: "<GetVolume()<GetSTLFaceList()); // Travelse the boundary faces, add in face list + AddGeomAuxSurfList(pConvexSolid->GetSTLFaceList()); // Judge whether need add auxiliary faces + pSolidList->AddConvexSolid(pConvexSolid); // Add the convex solid into a complicate solid + + pConvexSolid->DeleteRepeatFaces(bGenVoid); // Delete the repeated faces of solid + + m_ConvexSolidList.push_back(pConvexSolid); // Add the convex solid in the solid list + m_iNumSolid++; + } + m_SolidList.push_back(pSolidList); + } + // If the solid is single solid, add to convex solid list directly + else if( theShape.ShapeType() == TopAbs_SOLID) + { + TopoDS_Solid tmpSolid = TopoDS::Solid(solid_list->Value(i)); + McCadConvexSolid *pConvexSolid = NULL; + McCadSolid * pSolidList = new McCadSolid(); + + if(pConvexSolid->GetVolume() >= -0.01) // Set the minimum volume tolerance + { + pConvexSolid = new McCadConvexSolid(tmpSolid); + } + else + { + cout<<"Detected a solid with small volume: "<GetVolume()<GetSTLFaceList()); // Travelse the boundary faces, add in face list + AddGeomAuxSurfList(pConvexSolid->GetSTLFaceList()); // Judge whether need add auxiliary faces + pSolidList->AddConvexSolid(pConvexSolid); // Add the convex solid into a complicate solid + + pConvexSolid->DeleteRepeatFaces(bGenVoid); // Delete the repeated faces of solid + m_ConvexSolidList.push_back(pConvexSolid); // Add the convex solid in the solid list + m_iNumSolid++; + m_SolidList.push_back(pSolidList); + } + + } + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::AddGeomSurfList(const vector & theExtFaceList) +{ + /* travelse the extend faces list */ + for (unsigned int i = 0; i < theExtFaceList.size(); i++) + { + McCadExtFace *pExtFace = theExtFaceList[i]; + + TopLoc_Location loc; + Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(*pExtFace, loc); + GeomAdaptor_Surface surf_adoptor(geom_surface); + + /* Generate the geometry surface interface based on the type of sufaces */ + IGeomFace * pGeomFace = NULL; + switch (surf_adoptor.GetType()) + { + case GeomAbs_Plane: + { + pGeomFace = new McCadGeomPlane(surf_adoptor); + break; + } + case GeomAbs_Cylinder: + { + pGeomFace = new McCadGeomCylinder(surf_adoptor); + break; + } + case GeomAbs_Cone: + { + pGeomFace = new McCadGeomCone(surf_adoptor); + if(((McCadGeomCone *)pGeomFace)->HaveTransfCard() ) + { + ((McCadGeomCone *)pGeomFace)->AddTransfCard(this);// lei lu 131209 + } + break; + } + case GeomAbs_Sphere: + { + pGeomFace = new McCadGeomSphere(surf_adoptor); + break; + } + case GeomAbs_Torus: + { + pGeomFace = new McCadGeomTorus(surf_adoptor); + break; + } + case GeomAbs_SurfaceOfRevolution: + { + pGeomFace = new McCadGeomRevolution(surf_adoptor); + break; + } + case GeomAbs_BezierSurface: + { + cout << "Surface is not analytic (BezierSurface) " << endl; + break; + } + case GeomAbs_BSplineSurface: + { + cout << "Surface is not analytic (BSplineSurface) " << endl; + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "Surface is not analytic (SurfaceOfRevolution) " << endl; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "Surface is not analytic (OffsetSurface) " << endl; + break; + } + case GeomAbs_OtherSurface: + { + cout << "Surface is not analytic " << endl; + break; + } + default:break; + } + + if (!pGeomFace) // If geometry face didn't generated, the face should be spline surface. + { + return; + } + + Standard_Boolean bExist = Standard_False; // Assume that the geometry surface didn't existed in the face list + + /* Travelse the geometry face list, add the new surface generated into the list. + if the face with same geometry is existed already,no need to add more */ + vector::iterator iterPos; + for (iterPos = m_GeomSurfList.begin(); iterPos != m_GeomSurfList.end(); ++iterPos) + { + IGeomFace * pIterFace = *iterPos; + if(pGeomFace->IsEqual( pIterFace )) + { + bExist = Standard_True; // The geometry suface has already existed in list. + if (pGeomFace->IsReversed()) // If the face orientation is different, reverse the new added surface. + { + pExtFace->Reverse(); + } + + pExtFace->SetFaceNum(pIterFace->GetSurfNum()); // Set the surface number to be same. + delete pGeomFace; // Delete the point of geometry face and keep the extend surface. + pGeomFace = NULL; + break; + } + } + + /* If there are no repeated surface, add the surface into the list.*/ + if (Standard_False == bExist) + { + // use the serial number in geometry surface list as Face-Surface relationship number. + int iNum = m_GeomSurfList.size(); + + // Set the code number of McCadExtFace and GeomSurface, it will help to match them. + // If the geometry surface orientation is reversed, make it to be forword. + if (pGeomFace->IsReversed()) + { + //cout<<"fanzhuan"<GetExpression()<Reverse(); + } + pExtFace->SetFaceNum(iNum + 1); // Set the face number + pGeomFace->SetSurfNum(iNum + 1); // Set the surface number, it is same to face number + + m_GeomSurfList.push_back(pGeomFace); // Add the geometry surface into geometry face list. + } + } +} + + + +/** ******************************************************************** +* @brief Travelse the boundary surfaces of solid, calculate whether it +* need add auxiliary faces,if need add them into geometery +* surface list. +* +* @param const vector & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::AddGeomAuxSurfList(const vector & theExtFaceList) +{ + for (unsigned int i = 0; i < theExtFaceList.size(); i++) + { + McCadExtFace * pExtFace = theExtFaceList[i]; + assert(pExtFace); + vector AuxFaceList = pExtFace->GetAuxFaces(); // Calculate the face's auxiliary faces + + if(AuxFaceList.size() == 0) // if there are no auxiliary surface + { + continue; + } + else // Add the auxiliary faces into geometry face list + { + AddGeomSurfList(AuxFaceList); + } + } +} + + + +/** ******************************************************************** +* @brief Set the manager pointer of data object +* +* @param McCadVoidCellManager * pManager +* @return void +* +* @date 11/12/2013 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::SetManager(const McCadVoidCellManager * pManager) +{ +//qiu m_pManager = pManager; + m_pManager = const_cast (pManager); +} + + + + +/** ******************************************************************** +* @brief Calculate the weight of each surface according to the surface +* type and parameters. +* +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Standard_Boolean compare(const IGeomFace * surfA, const IGeomFace * surfB) +{ +//qiu return surfA->Compare(surfB); + return const_cast (surfA)->Compare(surfB); +} + +/** ******************************************************************** +* @brief Sort the surfaces, the weight of surfaces is calculated by +* function-compare +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadGeomData::SortSurface() +{ + sort(m_GeomSurfList.begin(),m_GeomSurfList.end(),compare); // Sort the geometry surface list. + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadGeomData::UpdateFaceNum() +{ + Standard_Integer iSurfNumNew; + Standard_Integer iSurfNumOld; + + for(unsigned int i = 0; i < m_GeomSurfList.size(); i++) + { + IGeomFace * pFace = m_GeomSurfList.at(i); + iSurfNumNew = i+1; + iSurfNumOld = pFace->GetSurfNum(); + GenMapSurfNum(iSurfNumOld,iSurfNumNew); + } + + try + { + /** Update the face number of solids, voids and outer spaces. */ + for (unsigned int i = 0; i < m_SolidList.size(); i++) + { + McCadSolid * pSolid = m_SolidList.at(i); + assert(pSolid); + + for(int j = 0; j < pSolid->GetConvexSolidList().size(); j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + pConvexSolid->ChangeFaceNum(this); + } + } + + for (unsigned int i = 0; i < m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = m_VoidCellList.at(i); + assert(pVoid); + + pVoid->ChangeFaceNum(this); // Update the surface number after sorting the surface list. + } + + if (m_pManager->GenVoid()) + { + assert(m_pOutVoid); + m_pOutVoid->ChangeFaceNum(this); // Update the face number. + } + } + catch(...) + { + cout << "#McCadGeomData :: Update surfaces number FAILED\n"; + } +} + + +vector McCadGeomData::GetConvexSolid() +{ + return m_ConvexSolidList; +} + + +vector McCadGeomData::GetTransfCard() +{ + return m_TransfCardList; +} + + +int McCadGeomData::AddTransfCard(gp_Ax3 theAxis, gp_Pnt theApex) +{ + int iTrNum; + McCadTransfCard *pTrCard = new McCadTransfCard(theAxis,theApex); + iTrNum = m_TransfCardList.size() + 1; + pTrCard->SetTrNum(iTrNum); + m_TransfCardList.push_back(pTrCard); + + return iTrNum; +} + + +Standard_Boolean McCadGeomData::GenMapSurfNum(Standard_Integer iSurfNumOld,Standard_Integer iSurfNumNew) +{ + pair(iSurfNumOld,iSurfNumNew); + pair::iterator,bool> result; + result = m_mapSurfNum.insert(pair(iSurfNumOld,iSurfNumNew)); + + if(result.second) + { + return Standard_True; + } + else + { + return Standard_False; + } +} + + +Standard_Integer McCadGeomData::GetNewFaceNum(Standard_Integer iOldNum) +{ + map::iterator iter; + iter = m_mapSurfNum.find(iOldNum); + if (iter != m_mapSurfNum.end()) + { + return iter->second; + } +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomData.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomData.hxx new file mode 100644 index 0000000..30d98bf --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomData.hxx @@ -0,0 +1,95 @@ +#ifndef MCCADGEOMDATA_HXX +#define MCCADGEOMDATA_HXX + +#include "McCadConvexSolid.hxx" +#include "McCadVoidCell.hxx" +#include "McCadTransfCard.hxx" +#include "IGeomFace.hxx" +#include "McCadGeomCone.hxx" +#include "McCadSolid.hxx" + + +#include +#include + +class McCadGeomData +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomData(); + McCadGeomData(Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bGenVoid); + ~McCadGeomData(); + + //private: //qiu +protected: + McCadVoidCellManager * m_pManager; /**< The manager object which data belong to */ + +//private: //qiu +protected: + Standard_Integer m_iNumSolid; /**< The number of convex solids */ + + Handle(TopTools_HSequenceOfShape) m_listConvexSolid; /**< The input convex solid after decomposition */ + Handle(TopTools_HSequenceOfShape) m_listVoidCell; /**< The input convex solid after decomposition */ + + vector m_SolidList; /**< Solid list */ + vector m_ConvexSolidList; /**< Convex solid list */ + vector m_VoidCellList; /**< void cell list */ + McCadVoidCell * m_pOutVoid; /**< The out box of the whole model */ + + vector m_GeomSurfList; /**< Geometry surface list */ + vector m_TransfCardList; /**< Surface transf card List */ + + map m_mapSurfNum; /**< When sort the surface list, reset the surface number */ + +public: + /** Input the geometry solid and assign the parameters. */ + void InputData(Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bGenVoid); + /** Traverse the face list and construct geometry surface list.*/ + void AddGeomSurfList(const vector & theExtFaceList); + /** Traverse the face list, if the face need to add auxiliary surface, + generate the auxiliary faces and add them into geometry face list. */ + void AddGeomAuxSurfList(const vector & theExtFaceList); + /** Sort the surface list based on surface type and parameters */ + void SortSurface(); + /** Update the face number of cell expression after sorting the surface */ + void UpdateFaceNum(); + /** Connect the manager to data */ + void SetManager(const McCadVoidCellManager * pManager); + + int AddTransfCard(gp_Ax3 theAxis, gp_Pnt theApex); + + Standard_Boolean GenMapSurfNum(Standard_Integer,Standard_Integer); + Standard_Integer GetNewFaceNum(Standard_Integer iOldNum); + + vector GetConvexSolid(); + vector GetTransfCard(); + + /** Friend function which can be used to compare the weight of each surface and sort them */ + friend Standard_Boolean compare(const IGeomFace * surfA, const IGeomFace * surfB); + +public: + + friend class McCadVoidGenerator; + friend class McCadVoidCellManager; + friend class McCadMcnpWriter; + friend class McCadTripoliWriter; + friend class S_McCadMcnpWriter; + friend class S_McCadTripoliWriter; + friend class McCadGDMLWriter; + friend class S_McCadGDMLWriter; +}; + +#endif // MCCADGEOMDATA_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomPlane.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomPlane.cxx new file mode 100644 index 0000000..bc181d6 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomPlane.cxx @@ -0,0 +1,305 @@ +#include "McCadGeomPlane.hxx" + +#include +#include + +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +using namespace std; + +McCadGeomPlane::McCadGeomPlane() +{ + +} +McCadGeomPlane::~McCadGeomPlane() +{ + m_PrmtList.clear(); +} + +/** ******************************************************************** +* @brief Construct the plane class based on the geometry surface +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomPlane::McCadGeomPlane(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfPlane ; // The surface is a plane + + gp_Pln plane = theSurface.Plane(); // Get the geometry plane + plane.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + m_Axis = plane.Position(); // Get the coordinate system Ax3 + + plane.Coefficients(m_dPrmtA,m_dPrmtB,m_dPrmtC,m_dPrmtD); // Get the parameters of plane + + m_bReverse = Standard_False; + + /*if(Abs(m_dPrmtA) < 1.0e-5) + m_dPrmtA = 0.0; + if(Abs(m_dPrmtB) < 1.0e-5) + m_dPrmtB = 0.0; + if(Abs(m_dPrmtC) < 1.0e-5) + m_dPrmtC = 0.0; + if(Abs(m_dPrmtD) < 1.0e-5) + m_dPrmtD = 0.0;*/ + + // If the parameter is less than 1.0e-07, it can be take as zero + if(McCadMathTool::IsEqualZero(m_dPrmtA)) + m_dPrmtA = 0.0; + if(McCadMathTool::IsEqualZero(m_dPrmtB)) + m_dPrmtB = 0.0; + if(McCadMathTool::IsEqualZero(m_dPrmtC)) + m_dPrmtC = 0.0; + if(McCadMathTool::IsEqualZero(m_dPrmtD)) + m_dPrmtD = 0.0; + + m_Dir.SetCoord(m_dPrmtA,m_dPrmtB,m_dPrmtC); // Assign the direction of face + m_PntOnFace = m_Axis.Location(); // Assign a point on the face + + //m_PrmtList = new vector(); + GetExpression(); +} + + + +/** ******************************************************************** +* @brief Get mcnp expression of plane +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomPlane::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + + Standard_Character chExpn[255]; + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + + if (m_dPrmtD != 0.0) + { + m_dPrmtD *= -1; + } + + if ( fabs(m_dPrmtA) > dis_tol && fabs(m_dPrmtB) < dis_tol && fabs(m_dPrmtC) < dis_tol ) + { + sprintf(chExpn, "PX%8s%15.7f\n", "", m_dPrmtD); + + m_SurfSymb = "PX"; + m_PrmtList.push_back(m_dPrmtD/m_dPrmtA); + if(m_dPrmtA < 0.0) + { + m_dPrmtA *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + } + else if ( fabs(m_dPrmtB) > dis_tol && fabs(m_dPrmtA) < dis_tol && fabs(m_dPrmtC) < dis_tol) + { + sprintf(chExpn, "PY%8s%15.7f\n", "",m_dPrmtD); + + m_SurfSymb = "PY"; + m_PrmtList.push_back(m_dPrmtD/m_dPrmtB); + if(m_dPrmtB < 0.0) + { + m_dPrmtB *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + } + else if ( fabs(m_dPrmtC) > dis_tol && fabs(m_dPrmtA) < dis_tol && fabs(m_dPrmtB) < dis_tol) + { + sprintf(chExpn, "PZ%8s%15.7f\n", "", m_dPrmtD); + + m_SurfSymb = "PZ"; + m_PrmtList.push_back(m_dPrmtD/m_dPrmtC); + if(m_dPrmtC < 0.0) + { + m_dPrmtC *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + } + else + { + sprintf(chExpn, "P %8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "",m_dPrmtA,"",m_dPrmtB,"",m_dPrmtC,"",m_dPrmtD); + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA < 0.0) + { + m_dPrmtA *= -1; + m_dPrmtB *= -1; + m_dPrmtC *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + + m_SurfSymb = "P"; + m_PrmtList.push_back(m_dPrmtA); + m_PrmtList.push_back(m_dPrmtB); + m_PrmtList.push_back(m_dPrmtC); + m_PrmtList.push_back(m_dPrmtD); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + + + +/** ******************************************************************** +* @brief Judge the two planes is same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomPlane::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + Standard_Real dis_tol = 1.0e-5 /*McCadConvertConfig::GetTolerence()*/; + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + /* If the direction and parameter d is same, the two faces are treated as same */ + if( m_Dir.IsEqual( ((McCadGeomPlane*)(theSurf))->GetDir(), angle_tol ) + && ( fabs(m_dPrmtD - ((McCadGeomPlane*)(theSurf))->GetPrmtD()) < dis_tol)) + { + return Standard_True; + } + /* If the direction and parameter d is opposite, the two faces are also same */ + else if (m_Dir.IsOpposite( ((McCadGeomPlane*)(theSurf))->GetDir(), angle_tol ) + && (fabs(m_dPrmtD + ((McCadGeomPlane*)(theSurf))->GetPrmtD()) < dis_tol)) + { + if (!m_bReverse) + { + m_bReverse = Standard_True; + } + else + { + m_bReverse = Standard_False; + } + return Standard_True; + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the direction of plane +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomPlane::GetDir() const +{ + return m_Dir; +} + + + +/** ******************************************************************** +* @brief Get the value of parameter D +* +* @param +* @return Standard_Real m_dPrmtD +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomPlane::GetPrmtD() const +{ + return m_dPrmtD; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomPlane::CleanObj() const +{ + +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomPlane::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + + +TCollection_AsciiString McCadGeomPlane::GetTransfNum() const +{ + return ""; +} + + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomPlane.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomPlane.hxx new file mode 100644 index 0000000..cd64f93 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomPlane.hxx @@ -0,0 +1,54 @@ +#ifndef MCCADGEOMPLANE_HXX +#define MCCADGEOMPLANE_HXX + +#include "IGeomFace.hxx" +#include +#include + +class McCadGeomPlane : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomPlane(); + McCadGeomPlane(const GeomAdaptor_Surface & theSurface); + + virtual ~McCadGeomPlane(); + virtual TCollection_AsciiString GetTransfNum() const; + + virtual TCollection_AsciiString GetExpression(); /**< Calculate the equation and direction of plane */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace); /**< Judge the two planes are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace); /**< Clean the object */ + + Standard_Real GetPrmtD() const; /**< Get parameter D */ + gp_Dir GetDir() const; /**< Get the parameter of surface */ + +private: + + gp_Ax3 m_Axis; /**< Coordinate system of plane */ + gp_Dir m_Dir; /**< Direction of a plane */ + + // the equation of plane is ax + by + cz + d = 0 + Standard_Real m_dPrmtA; /**< Parameter A of plane equation */ + Standard_Real m_dPrmtB; /**< Parameter B of plane equation */ + Standard_Real m_dPrmtC; /**< Parameter C of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ + + + +}; + +#endif // MCCADGEOMPLANE_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomRevolution.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomRevolution.cxx new file mode 100644 index 0000000..460026d --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomRevolution.cxx @@ -0,0 +1,501 @@ +#include "McCadGeomRevolution.hxx" + +#include +#include +#include +#include + +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadGeomRevolution::McCadGeomRevolution() +{ +} + +/** ******************************************************************** +* @brief Constructor +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomRevolution::McCadGeomRevolution(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfRev ; // Set the surface type + ExtrFaceInfo(theSurface); // Get the geometry data + + //m_PrmtList = new TColStd_HSequenceOfAsciiString(); +} + + +void McCadGeomRevolution::ExtrFaceInfo(const GeomAdaptor_Surface & theSurface) +{ + Handle(Geom_Surface) surf = theSurface.Surface(); + + Handle(Geom_SurfaceOfRevolution) rev = Handle(Geom_SurfaceOfRevolution)::DownCast(surf); + Handle(Geom_Curve) BasisCurve = rev->BasisCurve(); // Get the section curve + GeomAdaptor_Curve SectionCurve(BasisCurve); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + + /* The revolution surface might be an elliptical torus or torus */ + if(SectionCurve.GetType() == GeomAbs_Ellipse || SectionCurve.GetType() == GeomAbs_Circle ) + { + /* Get the geomtry info of revolution axis */ + gp_Ax1 revAx = rev->Axis(); + gp_Dir revDir = revAx.Direction(); + gp_Vec revVec(revDir.X(), revDir.Y(), revDir.Z()); // The direction of axis + + m_Center = revAx.Location(); // The center of revolution axis + m_Axis.SetAxis(revAx); // Revolution axis + m_Dir = m_Axis.Direction(); // The direction of revolution axis + + /* Test if axis of revolution is perpendicular to two of the axis of the ellipse/circle */ + if(SectionCurve.GetType() == GeomAbs_Ellipse) + { + Handle(Geom_Ellipse) section = Handle(Geom_Ellipse)::DownCast(BasisCurve); + + gp_Ax1 normAx = section->Axis(); + gp_Dir normDir = normAx.Direction(); + gp_Vec normVec(normDir.X(), normDir.Y(), normDir.Z()); + + if(Abs( revVec * normVec ) > dis_tol) // Judge if the section vector is perpendicular to axis vector. + { + cout << "Ellipse not perpendicular to rotation Axis !\n" << endl; + } + + gp_Pnt pCntrSection = section->Location(); // The center of section + m_Radius = m_Center.Distance(pCntrSection); // The major radius of ellipital torus + m_MajorRadius = section->MajorRadius(); // The major radius of ellipse section + m_MinorRadius = section->MinorRadius(); // The minor radius of ellipse section + + cout<Axis(); + gp_Dir normDir = normAx.Direction(); + gp_Vec normVec(normDir.X(), normDir.Y(), normDir.Z()); + + if(Abs( revVec * normVec ) > dis_tol) // Judge if the section vector is perpendicular to axis vector. + { + cout << "Ellipse not perpendicular to rotation Axis !\n" << endl; + } + + gp_Pnt pCntrSection = section->Location(); // The center of section + m_Radius = m_Center.Distance(pCntrSection); // The major radius of torus + m_MajorRadius = section->Radius(); // The radius of circle section + m_MinorRadius = section->Radius(); // The radius of circle section + + cout<GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomRevolution *pTorus = (McCadGeomRevolution*)(theSurf); + assert(pTorus); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the center and radius is same, the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pTorus->GetAxisDir(), angle_tol) + || m_Dir.IsOpposite(pTorus->GetAxisDir(), angle_tol)) + { + if( m_Center.IsEqual(pTorus->GetCenter(), angle_tol ) + && fabs(m_MajorRadius - pTorus->GetMajorRadius()) < dis_tol + && fabs(m_MinorRadius - pTorus->GetMinorRadius()) < dis_tol ) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the center of torus +* +* @param +* @return gp_Pnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomRevolution::GetCenter() const +{ + return m_Center; +} + +/** ******************************************************************** +* @brief Get major radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomRevolution::GetMajorRadius() const +{ + return m_MajorRadius; +} + +/** ******************************************************************** +* @brief Get minor radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomRevolution::GetMinorRadius() const +{ + return m_MinorRadius; +} + +/** ******************************************************************** +* @brief Get axis direction of torus +* +* @param +* @return gp_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomRevolution::GetAxisDir() const +{ + return m_Dir; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomRevolution::CleanObj() const +{ + +} + + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomRevolution::ScalePrmt() +{ + gp_Pnt ori(0,0,0); + m_Axis.Scale(ori,GetUnit()); + m_Center.Scale(ori,GetUnit()); + m_Radius *= GetUnit(); + m_MajorRadius *= GetUnit(); + m_MinorRadius *= GetUnit(); +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomRevolution::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } + +} + + +void McCadGeomRevolution::FitCurve(Handle(Geom_Curve) BasisCurve, + Handle(Geom_SurfaceOfRevolution) rev) +{ + gp_Ax1 revAx = rev->Axis(); + m_Center = revAx.Location(); // The center of revolution axis + m_Axis.SetAxis(revAx); + m_Dir = m_Axis.Direction(); // The direction of revolution axis + + gp_Pnt p1 = BasisCurve->Value(BasisCurve->FirstParameter()); + gp_Pnt p2 = BasisCurve->Value(BasisCurve->LastParameter()); + gp_Pnt p3 = BasisCurve->Value((BasisCurve->FirstParameter()+BasisCurve->LastParameter())/2); + + double a, b, c, d, e, f; + + double pA1,pA2,pA3,pB1,pB2,pB3; + double xA,xB,xC; + + int i; + + if (p1.X()==p2.X() && p2.X()==p3.X()) + { + pA1 = p1.Y(); + pB1 = p1.Z(); + pA2 = p2.Y(); + pB2 = p2.Z(); + pA3 = p3.Y(); + pB3 = p3.Z(); + + i=0; + } + else if (p1.Y()==p2.Y() && p2.Y()==p3.Y()) + { + pA1 = p1.X(); + pB1 = p1.Z(); + pA2 = p2.X(); + pB2 = p2.Z(); + pA3 = p3.X(); + pB3 = p3.Z(); + + i=1; + } + else if (p1.Z()==p2.Z() && p2.Z()==p3.Z()) + { + pA1 = p1.X(); + pB1 = p1.Y(); + pA2 = p2.X(); + pB2 = p2.Y(); + pA3 = p3.X(); + pB3 = p3.Y(); + + i=2; + } + + a = 2*(pA2-pA1); + b = 2*(pB2-pB1); + c = pA2*pA2 + pB2*pB2 - pA1*pA1 - pB1*pB1; + + d = 2*(pA3-pA1); + e = 2*(pB3-pB1); + + f = pA3*pA3 + pB3*pB3 - pA1*pA1 - pB1*pB1; + + xA = (b*f - e*c)/(b*d - e*a); + xB = (d*c - a*f)/(b*d - e*a); + + if (Abs(xA)<1.0e-5) + xA = 0.0; + if (Abs(xB)<1.0e-5) + xB = 0.0; + + double center_x, center_y, center_z; + + if (i == 0) + { + center_y = xA; + center_z = xB; + center_x = p1.X(); + } + else if (i == 1) + { + center_x = xA; + center_z = xB; + center_y = p1.Y(); + } + else if (i == 1) + { + center_x = xA; + center_y = xB; + center_z = p1.Z(); + } + + + double maj_radius = Sqrt((xA-pA1)*(xA-pA1)+(xB-pB1)*(xB-pB1)); + double radius = Sqrt(pow(center_x-m_Center.X(),2) + +pow(center_y-m_Center.Y(),2) + +pow(center_z-m_Center.Z(),2)); + + m_Radius = radius; + cout< +#include +#include +#include + + +class McCadGeomRevolution : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomRevolution(); + McCadGeomRevolution(const GeomAdaptor_Surface & theSurface); + + virtual ~McCadGeomRevolution(); + + virtual TCollection_AsciiString GetExpression(); /**< Calculate the equation and direction */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace); /**< Judge the two surface are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace); /**< */ + virtual TCollection_AsciiString GetTransfNum()const; + + gp_Pnt GetCenter() const; /**< Get the center of ellipse torus */ + gp_Dir GetAxisDir() const; /**< Get the direction of axis */ + Standard_Real GetMajorRadius() const; /**< Get the major radius */ + Standard_Real GetMinorRadius() const; /**< Get the minor radius */ + void ExtrFaceInfo(const GeomAdaptor_Surface & theSurface); /**< Extract the geometry data from revolution face */ + void ScalePrmt(); /**< Scale the parameters */ + + void FitCurve(Handle(Geom_Curve) BasisCurve, + Handle(Geom_SurfaceOfRevolution) rev); + +private: + + gp_Ax3 m_Axis; /**< The rotate axis of ellipse torus/torus */ + gp_Dir m_Dir; /**< The direction of axis */ + Standard_Real m_Radius; /**< The major radius of torus or ellipsal torus/torus */ + Standard_Real m_MajorRadius; /**< Major radius of section */ + Standard_Real m_MinorRadius; /**< Minor radius of section */ + gp_Pnt m_Center; /**< Center of ellipse torus/torus */ +}; + +#endif // MCCADGEOMREVOLUTION_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomSphere.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomSphere.cxx new file mode 100644 index 0000000..719a621 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomSphere.cxx @@ -0,0 +1,248 @@ +#include "McCadGeomSphere.hxx" +#include +#include +#include + +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadGeomSphere::McCadGeomSphere() +{ +} + +/** ******************************************************************** +* @brief Constructor, construct a sphere class based on geometry surface. +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomSphere::McCadGeomSphere(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfSphere ; // The surface is a sphere + + gp_Sphere sphere = theSurface.Sphere(); // Get the geometry of sphere + sphere.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Radius = sphere.Radius(); // Get the radius + m_Center = sphere.Location(); // Get the center of sphere + + if( McCadMathTool::IsEqualZero(m_Center.X())) + m_Center.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Y())) + m_Center.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Z())) + m_Center.SetZ(0.0); + + m_bReverse = Standard_False; + + GetExpression(); +} + +McCadGeomSphere::~McCadGeomSphere() +{ +} + + + +/** ******************************************************************** +* @brief Generate the mcnp expression of a sphere +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomSphere::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + Standard_Character chExpn[255]; + + if (m_Center.X() == 0.0 && m_Center.Y() == 0.0 && m_Center.Z() == 0.0) + { + sprintf(chExpn, "SO%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "SO"; + m_PrmtList.push_back(m_Radius); + } + else if(m_Center.X() != 0.0 && m_Center.Y() == 0.0 && m_Center.Z() == 0.0) + { + sprintf(chExpn, "SX%8s%15.7f%5s%15.7f\n", "",m_Center.X(),"", m_Radius); + + m_SurfSymb = "SX"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Radius); + } + else if(m_Center.X() == 0.0 && m_Center.Y() != 0.0 && m_Center.Z() == 0.0) + { + sprintf(chExpn, "SY%8s%15.7f%5s%15.7f\n", "",m_Center.Y(),"", m_Radius); + + m_SurfSymb = "SY"; + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Radius); + } + else if(m_Center.X() == 0.0 && m_Center.Y() == 0.0 && m_Center.Z() != 0.0) + { + sprintf(chExpn, "SZ%8s%15.7f%5s%15.7f\n", "",m_Center.Z(),"", m_Radius); + + m_SurfSymb = "SZ"; + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_Radius); + } + else + { + sprintf(chExpn, "S %8s%15.7f\%5s%15.7f%5s%15.7f%5s%15.7f\n", + "",m_Center.X(), + "",m_Center.Y(), + "",m_Center.Z(), + "",m_Radius); + + m_SurfSymb = "S "; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_Radius); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + + +/** ******************************************************************** +* @brief Judge the two sphere is same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomSphere::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomSphere *pSphere = (McCadGeomSphere*)(theSurf); + assert(pSphere); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the center and radius is same, the two cylinder can be treated as same cylinder + if( m_Center.IsEqual(pSphere->GetCenter(), angle_tol ) + && fabs(m_Radius - pSphere->GetRadius()) < dis_tol ) + { + return Standard_True; + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the center of a sphere +* +* @param +* @return gp_Pnt m_Center +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomSphere::GetCenter() const +{ + return m_Center; +} + + + +/** ******************************************************************** +* @brief Get the radius of a sphere +* +* @param +* @return Standard_Real m_Radius +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomSphere::GetRadius() const +{ + return m_Radius; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomSphere::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomSphere::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + + +TCollection_AsciiString McCadGeomSphere::GetTransfNum()const +{ + return ""; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomSphere.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomSphere.hxx new file mode 100644 index 0000000..8f74531 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomSphere.hxx @@ -0,0 +1,44 @@ +#ifndef MCCADGEOMSPHERE_HXX +#define MCCADGEOMSPHERE_HXX + +#include "IGeomFace.hxx" + +#include + +class McCadGeomSphere : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomSphere(); + McCadGeomSphere(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomSphere(); + + virtual TCollection_AsciiString GetExpression(); /**< Get the expression of surface */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< The two surfcce are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< Clean the object */ + virtual TCollection_AsciiString GetTransfNum() const; + + gp_Pnt GetCenter() const; /**< Get the center of sphere */ + Standard_Real GetRadius() const; /**< Get the radius of sphere */ + +private: + Standard_Real m_Radius; + gp_Pnt m_Center; + +}; + +#endif // MCCADGEOMSPHERE_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomTorus.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomTorus.cxx new file mode 100644 index 0000000..e78023f --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomTorus.cxx @@ -0,0 +1,299 @@ +#include "McCadGeomTorus.hxx" + +#include +#include +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadGeomTorus::McCadGeomTorus() +{ +} + +/** ******************************************************************** +* @brief Constructor +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomTorus::McCadGeomTorus(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfTorus ; // The surface is a torus + + gp_Torus torus = theSurface.Torus(); // Get the geometry of torus + torus.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = torus.Position(); // The coordinator of torus + m_Dir = m_Axis.Direction(); // The direction of torus axis + m_Center = m_Axis.Location(); // The center of torus + + if( McCadMathTool::IsEqualZero(m_Center.X())) + m_Center.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Y())) + m_Center.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Z())) + m_Center.SetZ(0.0); + + m_MajorRadius = torus.MajorRadius(); // The major radius of torus + m_MinorRadius = torus.MinorRadius(); // The minor radius of torus + + m_bReverse = Standard_False; + //m_PrmtList = new TColStd_HSequenceOfAsciiString(); + GetExpression(); + +} + +McCadGeomTorus::~McCadGeomTorus() +{ +} + + + +/** ******************************************************************** +* @brief Get the mcnp expression of torus +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomTorus::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + Standard_Character chExpn[255]; + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + gp_Ax3 Ax3_X(m_Center, gp::DX()); + gp_Ax3 Ax3_Y(m_Center, gp::DY()); + gp_Ax3 Ax3_Z(m_Center, gp::DZ()); + + if (m_Axis.IsCoplanar(Ax3_X, angle_tol, angle_tol)) + { + sprintf(chExpn, "TX%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Center.X(), + "", m_Center.Y(), + "", m_Center.Z(), + "", m_MajorRadius, + "", m_MinorRadius, + "", m_MinorRadius); + + m_SurfSymb = "TX"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_MajorRadius); + m_PrmtList.push_back(m_MinorRadius); + m_PrmtList.push_back(m_MinorRadius); + } + else if (m_Axis.IsCoplanar(Ax3_Y, angle_tol, angle_tol)) + { + sprintf(chExpn, "TY%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Center.X(), + "", m_Center.Y(), + "", m_Center.Z(), + "", m_MajorRadius, + "", m_MinorRadius, + "", m_MinorRadius); + + m_SurfSymb = "TY"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_MajorRadius); + m_PrmtList.push_back(m_MinorRadius); + m_PrmtList.push_back(m_MinorRadius); + } + else if (m_Axis.IsCoplanar(Ax3_Z, angle_tol, angle_tol)) + { + sprintf(chExpn, "TZ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Center.X(), + "", m_Center.Y(), + "", m_Center.Z(), + "", m_MajorRadius, + "", m_MinorRadius, + "", m_MinorRadius); + + m_SurfSymb = "TZ"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_MajorRadius); + m_PrmtList.push_back(m_MinorRadius); + m_PrmtList.push_back(m_MinorRadius); + } + else + { + sprintf(chExpn, "c McCad Error: A generic Torus transformation.\n"); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + +/** ******************************************************************** +* @brief Judge the two torus is same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomTorus::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomTorus *pTorus = (McCadGeomTorus*)(theSurf); + assert(pTorus); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the center and radius is same, the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pTorus->GetAxisDir(), angle_tol) + || m_Dir.IsOpposite(pTorus->GetAxisDir(), angle_tol)) + { + if( m_Center.IsEqual(pTorus->GetCenter(), angle_tol ) + && fabs(m_MajorRadius - pTorus->GetMajorRadius()) < dis_tol + && fabs(m_MinorRadius - pTorus->GetMinorRadius()) < dis_tol ) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the center of torus +* +* @param +* @return gp_Pnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomTorus::GetCenter() const +{ + return m_Center; +} + +/** ******************************************************************** +* @brief Get major radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomTorus::GetMajorRadius() const +{ + return m_MajorRadius; +} + +/** ******************************************************************** +* @brief Get minor radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomTorus::GetMinorRadius() const +{ + return m_MinorRadius; +} + +/** ******************************************************************** +* @brief Get axis direction of torus +* +* @param +* @return gp_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomTorus::GetAxisDir() const +{ + return m_Dir; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomTorus::CleanObj() const +{ + +} + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomTorus::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + +TCollection_AsciiString McCadGeomTorus::GetTransfNum()const +{ + return ""; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomTorus.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomTorus.hxx new file mode 100644 index 0000000..3d067d8 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadGeomTorus.hxx @@ -0,0 +1,50 @@ +#ifndef MCCADGEOMTORUS_HXX +#define MCCADGEOMTORUS_HXX + +#include "IGeomFace.hxx" + +#include +#include + +class McCadGeomTorus : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomTorus(); + McCadGeomTorus(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomTorus(); + + virtual TCollection_AsciiString GetExpression(); /**< Get the expression of torus */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< Judge the two torus is same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + virtual TCollection_AsciiString GetTransfNum() const; + + gp_Pnt GetCenter() const; /**< Get the center of torus */ + gp_Dir GetAxisDir() const; /**< Get the direction of axis */ + Standard_Real GetMajorRadius() const; /**< Get the major radius */ + Standard_Real GetMinorRadius() const; /**< Get the minor radius */ + +private: + + gp_Ax3 m_Axis; /**< The rotate axis of torus */ + gp_Dir m_Dir; /**< The direction of axis */ + Standard_Real m_MajorRadius; /**< Major radius */ + Standard_Real m_MinorRadius; /**< Minor radius */ + gp_Pnt m_Center; /**< Center of torus */ +}; + +#endif // MCCADGEOMTORUS_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid.cxx new file mode 100644 index 0000000..0af94f7 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid.cxx @@ -0,0 +1,1044 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +using namespace std; + +Standard_Real McCadMcVoid::VolumeOfShape(const TopoDS_Shape& theShape) +{ + GProp_GProps GP; + BRepGProp::VolumeProperties(theShape, GP); + return GP.Mass(); +} + + +Standard_Real McCadMcVoid::AreaOfShape(const TopoDS_Shape& theShape) +{ + GProp_GProps GP; + BRepGProp::SurfaceProperties(theShape, GP); + return GP.Mass(); +} + + +gp_Pnt McCadMcVoid::ApproxBaryCenter(const TopoDS_Shape& theShape) +{ + Standard_Integer i; + TopExp_Explorer ex; + gp_XYZ xyz(0, 0, 0); + for (ex.Init(theShape, TopAbs_VERTEX), i = 1; ex.More(); ex.Next(), i++) + xyz += BRep_Tool::Pnt(TopoDS::Vertex(ex.Current())).XYZ(); + xyz /= i; + return gp_Pnt(xyz); +} + + +TopoDS_Shape McCadMcVoid::RelScale(const TopoDS_Shape& theShape, const gp_Pnt& thePnt, const Standard_Real theFact) +{ + gp_Trsf T; + // gp_Pnt thePnt = ApproxBaryCenter(S); + T.SetScale(thePnt, theFact); // we scale up or down relative to barycenter depending on theFact; + Handle(BRepTools_TrsfModification) TrsfMod = new BRepTools_TrsfModification(T); + BRepTools_Modifier Md; + Md.Init(theShape); + Md.Perform(TrsfMod); + if (Md.IsDone()) + { + return Md.ModifiedShape(theShape); + } + cout << "Can not scale/modify shape !! " << endl; + return theShape; +} + + +TopoDS_Shape McCadMcVoid::Scale(const TopoDS_Shape& theShape, const Standard_Real theFact) +{ + gp_Trsf T; + gp_Pnt thePnt(0, 0, 0); + T.SetScale(thePnt, theFact); // we scale up or down relative to barycenter depending on theFact; + Handle(BRepTools_TrsfModification) TrsfMod = new BRepTools_TrsfModification(T); + BRepTools_Modifier Md; + Md.Init(theShape); + Md.Perform(TrsfMod); + if (Md.IsDone()) + { + return Md.ModifiedShape(theShape); + } + cout << "Can not scale/modify shape !! " << endl; + return theShape; +} + + +Handle(McCadCSGGeom_Surface) McCadMcVoid::MakeMcCadSurf(GeomAdaptor_Surface& theAdapSurface) +{ + Handle(McCadCSGGeom_Surface) aCSGSurf; + + switch (theAdapSurface.GetType()) + { + case GeomAbs_Plane: + aCSGSurf = new McCadCSGGeom_Plane; + break; + case GeomAbs_Cylinder: + aCSGSurf = new McCadCSGGeom_Cylinder; + break; + case GeomAbs_Cone: + aCSGSurf = new McCadCSGGeom_Cone; + break; + case GeomAbs_Sphere: + aCSGSurf = new McCadCSGGeom_Sphere; + break; + case GeomAbs_Torus: + aCSGSurf = new McCadCSGGeom_Torus; + break; + case GeomAbs_BezierSurface: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (BezierSurface) " << endl; + break; + } + case GeomAbs_BSplineSurface: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (BSplineSurface) " << endl; + aCSGSurf = new McCadCSGGeom_GQ; + break; + } + case GeomAbs_SurfaceOfRevolution: + { + aCSGSurf = new McCadCSGGeom_SurfaceOfRevolution; + //cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (SurfaceOfRevolution) " << endl; + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (SurfaceOfExtrusion) " << endl; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (OffsetSurface) " << endl; + break; + } + case GeomAbs_OtherSurface: + { + cout << "Surface is not analytic " << endl; + break; + } + } + + aCSGSurf->SetCasSurf(theAdapSurface); + + return aCSGSurf; +} + + +Standard_Boolean McCadMcVoid::ApproxGeomEqual(Handle(McCadCSGGeom_Surface)& S1,Handle(McCadCSGGeom_Surface)& S2) +{ + // only planar surface are treated + + Handle(Geom_Plane) Gpln1 = Handle_Geom_Plane::DownCast(S1->CasSurf()); + gp_Pln aPln = Gpln1->Pln(); + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + gp_Pnt loc = pos.Location (); + Standard_Real sA,sB,sC,sD; + aPln.Coefficients(sA,sB,sC,sD); + Standard_Real D1 = dir.X()*loc.X() + dir.Y()*loc.Y() + dir.Z()*loc.Z(); + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(S2->CasSurf()); + gp_Pln other = Gpln->Pln(); + + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + gp_Pnt otherLoc = otherPos.Location(); + Standard_Real D2 = otherDir.X()*otherLoc.X() + otherDir.Y()*otherLoc.Y() + otherDir.Z()*otherLoc.Z(); + if (dir.IsParallel(otherDir,0.1)) + { + if (fabs(D1 - D2) <= 1.0) // this gives the resolution of the cut planes: 25cm + { + return Standard_True; + } + } + // if(dir.Angle(otherDir) < 0.034906585) // about 2 deg. + // return Standard_True; + return Standard_False; +} + + +Standard_Boolean McCadMcVoid::ApproxGeomEqualFaces(TopoDS_Face& F1, TopoDS_Face& F2, Standard_Real theCFRes) +{ + // only planar face are treated + + TopLoc_Location l; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,l); + GeomAdaptor_Surface adSurf1(gS1); + if(adSurf1.GetType() != GeomAbs_Plane) + return Standard_False; + + Handle(Geom_Plane) Gpln1 = Handle_Geom_Plane::DownCast(gS1); + gp_Pln aPln = Gpln1->Pln(); + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + //gp_Pnt loc = pos.Location (); + // Standard_Real D1 = dir.X()*10.e10 + dir.Y()*10.e10 + dir.Z()*loc.Z(); + + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,l); + GeomAdaptor_Surface adSurf2(gS2); + if(adSurf2.GetType() != GeomAbs_Plane) + return Standard_False; + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(gS2); + gp_Pln other = Gpln->Pln(); + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + //gp_Pnt otherLoc = otherPos.Location(); + // Standard_Real D2 = otherDir.X()*otherLoc.X() + otherDir.Y()*otherLoc.Y() + otherDir.Z()*otherLoc.Z() ; + //gp_Pnt pinf(10.e6,10.e6,10.e6); + gp_Pnt pinf(0,0,0); + if (dir.IsParallel(otherDir,0.0001)) + { + //cout << " Distance = " << fabs(aPln.Distance(pinf) - other.Distance(pinf)) << endl; + /* Standard_Real A,B,C,D; + aPln.Coefficients(A,B,C,D); + cout << "me. A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl; + other.Coefficients(A,B,C,D); + cout << "ot. A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl;*/ +//not reliable for infinit point!!! +// infp leads to major differences in output between GUI and non-GUI version. + // cout << " Dist : " << fabs(aPln.Distance(pinf) - other.Distance(pinf)) << " - "; + + if (fabs(aPln.Distance(pinf) - other.Distance(pinf)) <= theCFRes) + { + // cout << "REJECTED because of small distance : " << fabs(aPln.Distance(pinf) - other.Distance(pinf)); + return Standard_True; + } + } + + return Standard_False; +} + + +Handle(McCadDiscDs_HSequenceOfDiscFace) McCadMcVoid::DeleteApproxRedundant(Handle(McCadDiscDs_HSequenceOfDiscFace)& theVCutFaceSeq, Standard_Real theCFRes) +{ + /**/ + /**/ + + ///////////////////////////////////////////////////////////////////////////////////////////////// + if (theVCutFaceSeq->Length() < 1) + return theVCutFaceSeq; + + + // Sort by Area + for(Standard_Integer i=1 ; iLength(); i++) + { + for(Standard_Integer j=i+1; j<=theVCutFaceSeq->Length(); j++) + { + TopoDS_Face F1,F2; + F1 = TopoDS::Face(theVCutFaceSeq->Value(j).GetFace()); + F2 = TopoDS::Face(theVCutFaceSeq->Value(i).GetFace()); + if(AreaOfShape(F1) > AreaOfShape(F2)) + theVCutFaceSeq->Exchange(i,j); + } + } + + + // only planar faces are treated + /*cout << "=================================================================" << endl; + cout << " Cut Face Canditdates " <Length(); i++) // print all coefficients of plane-equations to screen + { + TopoDS_Face F1 = TopoDS::Face(theVCutFaceSeq->Value(i).GetFace()); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + gp_Pln aPln = As1.Plane(); + Standard_Real A,B,C,D; + aPln.Coefficients(A,B,C,D); + cout << i << ". A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl; + }*/ + ///////////////////////////////////////////////////////////////////////////////////////////////// + + + vector theVCutFace, tmpVCutFace; + vector::iterator fit; + for (int i=1; i<= theVCutFaceSeq->Length(); i++)//put all vcutfaces in above vectors + { + tmpVCutFace.push_back(theVCutFaceSeq->Value(i)); + theVCutFace.push_back(theVCutFaceSeq->Value(i)); + } + + int io = 0; + for (fit = tmpVCutFace.begin(); fit!= tmpVCutFace.end(); fit++)//For all temp voxel faces delete 'double faces' + { + io++; + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + if(F1.IsNull()) + continue; + + vector::iterator fit2; + int ii = io; + for (fit2 = fit+1; fit2!= tmpVCutFace.end(); fit2++) + { + ii++; + // cout << "\n(" << io << "," << ii << ") : "; + + TopoDS_Face F2 = TopoDS::Face((*fit2).GetFace()); + + if(F2.IsNull()) + { + continue; + } + if (ApproxGeomEqualFaces(F1, F2, 1.e-3)) + { + McCadDiscDs_DiscFace vnull; // create empts DiscFace + //if(AreaOfShape(F2) 1) + { + for (fit = theVCutFace.begin() + 1; fit!= theVCutFace.end(); fit++) //arrange faces by size (decreasing) + { + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + Standard_Real areaF1 = AreaOfShape(F1); + vector::iterator fit2; + for (fit2 = fit - 1; fit2 >= theVCutFace.begin(); fit2--) + { + TopoDS_Face F2 = TopoDS::Face((*fit2).GetFace()); + Standard_Real areaF2 = AreaOfShape(F2); + if (areaF1 > areaF2) + { + iter_swap(fit2 + 1,fit2); + } + else + break; + } + } + } + + /////////////////////////////////////////////////////////////////////////////////////////////////// + ii = 0; + for (fit = theVCutFace.begin(); fit!= theVCutFace.end(); fit++) + { + ii++; + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + Standard_Real area = AreaOfShape(F1); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + gp_Pln aPln = As1.Plane(); + Standard_Real A,B,C,D; + aPln.Coefficients(A,B,C,D); + if(fabs(A)<1.e-7) A = 0.0;//MYMOD 230108 all 4 + if(fabs(B)<1.e-7) B = 0.0; + if(fabs(C)<1.e-7) C = 0.0; + if(fabs(D)<1.e-7) D = 0.0; + //cout << ii << ". A = " << A << " B = " << B << " C = " << C <<" D = " << D << " Area = " << area << endl; + }*/ + //cout << "================================================================= " << endl; + + theVCutFaceSeq->Clear(); + + for (fit = theVCutFace.begin(); fit!= theVCutFace.end(); fit++) + { + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + if(!F1.IsNull()) theVCutFaceSeq->Append(*fit); + } + + return theVCutFaceSeq; +} + + +Handle(TopTools_HSequenceOfShape) McCadMcVoid::DeleteOne(Handle(TopTools_HSequenceOfShape)& theFaceSeq) +{ + + if (theFaceSeq->Length() < 2 ) + return theFaceSeq; + + TopoDS_Face F1 = TopoDS::Face(theFaceSeq->Value(1)); + TopAbs_Orientation orient1 = F1.Orientation(); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + TopoDS_Face F2 = TopoDS::Face(theFaceSeq->Value(2)); + TopAbs_Orientation orient2 = F2.Orientation(); + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,loc); + GeomAdaptor_Surface As2(gS2); + + if (As1.GetType() != As2.GetType() ) + return theFaceSeq; + + Handle(McCadCSGGeom_Surface) S1 = MakeMcCadSurf(As1); + S1->SetCasSurf(As1); + + Handle(McCadCSGGeom_Surface) S2 = MakeMcCadSurf(As2); + S2->SetCasSurf(As2); + + //////////////////////////////////////////////////////////////////////////////////// + // a plane must be correctly orriented to be compared .... + if(As1.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = As1.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction(); + Standard_Real A,B,C,D; + if (locAxis.Direct()) + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + if ((D > 0 && (locDir.X() < 0 || locDir.Y() < 0 || locDir.Z() < 0 )) || (locDir.X() <= 0 && locDir.Y() <= 0 && locDir.Z() <= 0 )) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + Handle(Geom_Plane) tmpPl = new Geom_Plane(glAxis); + GeomAdaptor_Surface Ast(tmpPl); + S1->SetCasSurf(Ast); + if(orient1 == TopAbs_FORWARD) + F1.Orientation(TopAbs_REVERSED); + else if (orient1 == TopAbs_REVERSED) + F1.Orientation(TopAbs_FORWARD); + //else; + } + } + + ///////////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////////// + if(As2.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = As2.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction(); + Standard_Real A,B,C,D; + if (locAxis.Direct()) + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + if ((D > 0 && (locDir.X() < 0 || locDir.Y() < 0 || locDir.Z() < 0 )) || (locDir.X() <= 0 && locDir.Y() <= 0 && locDir.Z() <= 0 )) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + Handle(Geom_Plane) tmpPl = new Geom_Plane(glAxis); + GeomAdaptor_Surface Ast(tmpPl); + S2->SetCasSurf(Ast); + if(orient2 == TopAbs_FORWARD) + F2.Orientation(TopAbs_REVERSED); + else if (orient2 == TopAbs_REVERSED) + F2.Orientation(TopAbs_FORWARD); + //else; + } + } + ///////////////////////////////////////////////////////////////////////////////////// + + + if (S1->IsEqual(S2)) + { + if (F1.Orientation()!= F2.Orientation()) + { + theFaceSeq->Remove(2); + } + } + + return theFaceSeq; +} + + +Handle(TopTools_HSequenceOfShape) McCadMcVoid::ShellOrder(Handle(TopTools_HSequenceOfShape)& theFaceSeq,Handle(TopTools_HSequenceOfShape)& theSolidSeq) +{ + + if (theFaceSeq->Length() < 2) return theFaceSeq; + Handle(TColStd_HSequenceOfInteger) signChanges = new TColStd_HSequenceOfInteger(); + for (Standard_Integer i = 1; i<= theFaceSeq->Length(); i++) + { + Standard_Integer signChgs = 0; + TopoDS_Face F1 = TopoDS::Face(theFaceSeq->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) S1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface AS1(S1); + for (Standard_Integer j = 1; j<= theSolidSeq->Length(); j++) + { + Standard_Integer NbNegPnt=0, NbPosPnt=0; + TopoDS_Solid S1 = TopoDS::Solid(theSolidSeq->Value(j)); + for (TopExp_Explorer exV(S1,TopAbs_VERTEX); exV.More(); exV.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exV.Current())); + Standard_Real aVal = McCadGTOOL::Evaluate(AS1,aPnt); + if(aVal > 1.e-03 && aVal < 1.e+100) NbPosPnt++; + if (aVal < -1.e-03 && aVal > -1.e+100 ) NbNegPnt++; + } + if (NbPosPnt > 0 && NbNegPnt > 0 ) // changes sign on the solid + signChgs++; + } + signChanges->Append(signChgs); + } + // now we do the shell ordering according to sign changes!! + + for (Standard_Integer j = 2; j<= signChanges->Length(); j++) + { + Standard_Integer k; + Standard_Integer sign = signChanges->Value(j); + for (k = j-1; k>=1; k--) + { + if (sign < signChanges->Value(k)) + { + signChanges->SetValue(k+1,signChanges->Value(k)); + theFaceSeq->Exchange(k+1,k); + } + else + break; + } + signChanges->SetValue(k+1,sign); + } + cout << "========================================================= " << endl; + cout << "These are the sorted sign changing sequences " << endl; + for (Standard_Integer j = 1; j<= signChanges->Length(); j++) + cout << j << " " << signChanges->Value(j) << endl; + cout << "========================================================= " << endl; + return theFaceSeq; +} + + +Standard_Boolean McCadMcVoid::SignChanging(TopoDS_Solid& baseSolid, const McCadDiscDs_DiscFace& theVFace) +{ + TopoDS_Face F1 = TopoDS::Face(theVFace.GetFace()); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + Handle(McCadCSGGeom_Surface) S1 = MakeMcCadSurf(As1); + S1->SetCasSurf(As1); + + for (TopExp_Explorer exF(baseSolid,TopAbs_FACE); exF.More(); exF.Next()) // if theVFace is equal to solid's bounding face, return false + { + TopoDS_Face F2 = TopoDS::Face(exF.Current()); + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,loc); + GeomAdaptor_Surface As2(gS2); + if (As1.GetType() == As2.GetType()) + { + Handle(McCadCSGGeom_Surface) S2 = MakeMcCadSurf(As2); + S2->SetCasSurf(As2); + if (S1->IsEqual(S2)) //BB-Interface + return Standard_False; + } + } + + Standard_Boolean inFound = Standard_False; + + Standard_Real MaxTol = 1.e-7; + BRepClass3d_SolidClassifier bsc3d (baseSolid); + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = theVFace.GetPoints(); + + //cout << "Number of Sample Points : " << tmpPntSeq->Length() << endl; + + for (int j=1; j<= tmpPntSeq->Length(); j++) + { + gp_Pnt aPnt = tmpPntSeq->Value(j); + bsc3d.Perform(aPnt,MaxTol); + if (bsc3d.State() == TopAbs_IN) + { + inFound = Standard_True; + break; + } + } + + //cout << "SIGN CHANGING ????????????? > " << inFound << endl; + + if(inFound) + return Standard_True; + else + return Standard_False; +} + + +TopoDS_Shape McCadMcVoid::MakeHalfSpace(TopoDS_Shape& aSolid) +{ + gp_Pnt lPnt(-1.e5, -1.e5, -1.e5); + gp_Pnt uPnt(1.e5, 1.e5, 1.e5); + + return MakeHalfSpace(aSolid, lPnt, uPnt); +} + + +TopoDS_Shape McCadMcVoid::MakeHalfSpace(TopoDS_Shape& aSolid, gp_Pnt& theLPnt, gp_Pnt& theUPnt) +{ + TopoDS_Face aFace = TopoDS::Face(aSolid); + TopoDS_Shape HSol; + bool foundIN = false; + TopLoc_Location loc; + //TopAbs_Orientation orient = aFace.Orientation(); + + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(aFace,loc); + GeomAdaptor_Surface AS(theFaceSurface); + + /*STEPControl_Writer wrt; + wrt.Transfer(aSolid, STEPControl_AsIs); + wrt.Write("makeHalfSpace.stp");*/ + + //////////////////////////////////////////////////////////////////////////////////////////////////////// + gp_Pnt thePnt = theFaceSurface->Value(1,1); + gp_Pnt tempPnt; +//MYMOD 170108 + for (Standard_Integer j=1; j<= 3 ; j++) // Find a point that lies on the solid-side of the face + { + for (Standard_Integer k=-1; k<=1; k+=2) + { + tempPnt = thePnt; + tempPnt.SetCoord(j, tempPnt.Coord(j)+k); + if(PointState(aSolid, tempPnt)==TopAbs_IN) + { + foundIN = true; + break; + } + } + if (foundIN == true) + break; + } + + if(!foundIN) + cout << "_#_McCadMcVoid.cxx :: Could not determine inside point for half space construction!" << endl; + + + ///////////////////////////////////////////////////////////////////////////////////// + // find the eight projection points on the surface find the two points that are + // the farest away from the box + Handle(TColStd_HSequenceOfReal) uVals = new TColStd_HSequenceOfReal; + Handle(TColStd_HSequenceOfReal) vVals = new TColStd_HSequenceOfReal; + + if(theLPnt.IsEqual(theUPnt, 1.0)) + { + cout << "same point\n"; + gp_Pnt lPnt(-1.e5, -1.e5, -1.e5); + gp_Pnt uPnt(1.e5, 1.e5, 1.e5); + theLPnt = lPnt; + theUPnt = uPnt; + } + + TopoDS_Shape theBox = BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape(); + TopExp_Explorer ex; + + gp_Pnt2d the2dPnt; + Standard_Real uMin, uMax, vMin, vMax; + ShapeAnalysis_Surface sAs(theFaceSurface); + + for(ex.Init(theBox, TopAbs_VERTEX); ex.More(); ex.Next()) + { + //get point + TopoDS_Vertex theVertex = TopoDS::Vertex(ex.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(theVertex); + + //project on surface + GeomAPI_ProjectPointOnSurf pntProj(thePnt, theFaceSurface); + for(int j=1; j<=pntProj.NbPoints(); j++) + { + the2dPnt = sAs.ValueOfUV(pntProj.Point(j), 1e-3); + uVals->Append(the2dPnt.X()); + vVals->Append(the2dPnt.Y()); + } + } + + // minimize and maximize + uMin = uVals->Value(1); + uMax = uVals->Value(1); + for(int i=2; i<=uVals->Length(); i++) + { + Standard_Real theVal = uVals->Value(i); + + if(uMin > theVal) + uMin = theVal; + if(uMax < theVal) + uMax = theVal; + } + + vMin = vVals->Value(1); + vMax = vVals->Value(1); + for(int i=2; i<=vVals->Length(); i++) + { + Standard_Real theVal = vVals->Value(i); + if(vMin > theVal) + vMin = theVal; + if(vMax < theVal) + vMax = theVal; + } + + if(AS.GetType() == GeomAbs_Cylinder) + { + uMin = 0; + uMax = 2.*M_PI; + } + /////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef OCC650 + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax); +#else + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax, 1.e-7); +#endif + // if cylinder, don't make half space but build solid!!! + if(AS.GetType() == GeomAbs_Cylinder) + { + BRepBuilderAPI_Sewing tailor; + tailor.Add(F1); + + TopExp_Explorer ex; + for(ex.Init(F1, TopAbs_EDGE); ex.More(); ex.Next()) + { + TopoDS_Edge anEdge = TopoDS::Edge(ex.Current()); + BRepBuilderAPI_MakeWire wireMaker(anEdge); + TopoDS_Wire aWire = wireMaker.Wire(); + + if(!aWire.Closed()) + continue; + + BRepBuilderAPI_MakeFace faceMaker(aWire, Standard_True); + + if(faceMaker.IsDone()) + { + TopoDS_Face face = faceMaker.Face(); + tailor.Add(face); + } + } + + TopoDS_Shape sewedShape; + try + { + tailor.Perform(); + sewedShape = tailor.SewedShape(); + } + catch(...) + { + cout << "sewing failed\n"; + return aSolid; + } + + TopoDS_Shell theShell = TopoDS::Shell(sewedShape); + BRepBuilderAPI_MakeSolid solMaker(theShell); + + TopoDS_Solid retSol; + + if(solMaker.IsDone()) + { + retSol = solMaker.Solid(); + return retSol; + } + else + return aSolid; + } + + if (F1.IsNull()) + cout << "_#_McCadMcVoid.cxx :: Infinite face for half space construction could not be constructed!" << endl; + + try + { + BRepPrimAPI_MakeHalfSpace tmpHlfSpc(F1,tempPnt);//Standard_Construction_Error occures !!!!! + + if(tmpHlfSpc.IsDone()) + { + + /*STEPControl_Writer wrt; + wrt.Transfer(F1, STEPControl_AsIs); + wrt.Transfer(theBox, STEPControl_AsIs); + wrt.Transfer(BRepBuilderAPI_MakeVertex(tempPnt).Vertex(), STEPControl_AsIs); + wrt.Write("face_and_box.stp");*/ + + HSol = tmpHlfSpc.Solid(); + /*TopoDS_Shape common = BRepAlgoAPI_Common(HSol, theBox).Shape(); + return common;*/ + } + else + { + cout << "Half Space construction failed\n"; + return aSolid; + } + } + catch(...) + { + cout << "_#_McCadMcVoid.cxx :: Half space could not be constructed!!!" << endl; + } + +//MYMOD # + return HSol; +} + + +TopoDS_Shape McCadMcVoid::MakeTrimmHalf(TopoDS_Shape& aSolid, TopoDS_Shape& aFace) +{ + // we make a trimmed halfspace in the size of aSolid. + Bnd_Box theBB; + BRepBndLib::Add(aSolid, theBB); + theBB.SetGap(0.0); + Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + theBB.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); + gp_Pnt P1(Xmin, Ymin, Zmin); + gp_Pnt P2(Xmax, Ymax, Zmax); + + TopoDS_Shape Box = BRepPrimAPI_MakeBox(P1,P2).Shape(); + TopoDS_Shape fShape = MakeHalfSpace(aFace); + TopoDS_Shape aShape; + try + { + BRepAlgoAPI_Cut aCommonOp(fShape,Box); + + if(aCommonOp.IsDone()) + { + aShape = aCommonOp.Shape(); + } + else + { + cout << "_#_McCadMcVoid.cxx :: Boolean Operation on a trimmed halfspace failed !!!" << endl; + } + + } + catch(...) + { + cout << "_#_McCadMcVoid.cxx :: Boolean Operation on a trimmed halfspace failed !!!" << endl; + } + + return aShape; +} + + +TopAbs_State McCadMcVoid::PointState(const TopoDS_Shape& aShape,const gp_Pnt& aPnt) +{ + // This algorithm checks the state of a point relative to a basic semi-algebraic set. + // The point should lie within the bounding box of the basic semi-algebraic set. + // If this is not the case the method may fail due to evaluation in a connected component + // of the set. Check first if the point is not outside of the b-Box. + // for non basic sets use the classifier of cascade. + + TopExp_Explorer ex; +// TopoDS_Solid aSol = TopoDS::Solid(aShape); + bool onState=false; + for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face theFace = TopoDS::Face(ex.Current()); + TopLoc_Location loc; + Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface As1(S1); + //////////////////////////////////////////////////////////////////////////////////// + // a plane must be correctly orriented + if(As1.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = As1.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + /*gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction();*/ + Standard_Real A,B,C,D; + if (locAxis.Direct()) + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + if ((D > 0 && (locDir.X() < 0 || locDir.Y() < 0 || locDir.Z() < 0 )) || + (locDir.X() <= 0 && locDir.Y() <= 0 && locDir.Z() <= 0 )) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + Handle(Geom_Plane) tmpPl = new Geom_Plane(glAxis); + As1.Load(tmpPl); + + if(theFace.Orientation() == TopAbs_FORWARD) + theFace.Orientation(TopAbs_REVERSED); + else if ( theFace.Orientation() == TopAbs_REVERSED) + theFace.Orientation(TopAbs_FORWARD); + else; + } + } + + Standard_Real aVal = McCadGTOOL::Evaluate(As1,aPnt); + // cout << aVal << endl; + + if (aVal >= -1.e-03 && aVal <= 1.e-3 ) + onState= true; + else if(aVal > 1.e-03 && aVal < 1.e+100) + aVal=1; + else if (aVal < -1.e-03 && aVal > -1.e+100 ) + aVal=-1; + else + return TopAbs_OUT; // NULL + + if ((theFace.Orientation() == TopAbs_FORWARD) && aVal==1) + { + return TopAbs_OUT; + } + if ((theFace.Orientation() == TopAbs_REVERSED) && aVal==-1) + { + return TopAbs_OUT; + } + + /*if(Abs(aVal)==1 && !onState) // double check!!! + { + BRepClass3d_SolidClassifier asc3d (aShape); + asc3d.Perform(aPnt, 1.0e-7); + if(asc3d.State() == TopAbs_OUT) + return TopAbs_OUT; + }*/ + } + + if (onState) + return TopAbs_ON; + else + { + return TopAbs_IN; + } +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid_ForwardCollision.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid_ForwardCollision.cxx new file mode 100644 index 0000000..0fa1e19 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid_ForwardCollision.cxx @@ -0,0 +1,251 @@ +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +#include +#include +#include + + +McCadMcVoid_ForwardCollision::McCadMcVoid_ForwardCollision() +{ + myTolerance = 1e-7; + myIsDone = false; + myVSolids = NULL; +} + +McCadMcVoid_ForwardCollision::McCadMcVoid_ForwardCollision(Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) +{ + myTolerance = 1e-7; + myIsDone = false; + myVSolids = theDShape; +} + + +void McCadMcVoid_ForwardCollision::Init() +{ + ///////////////////////////////////////////////////////////////////////////////////////// + // forward collision test among solids + // SeqCSG is master complement set + cout << "\nPerforming forward collision test among solids!!"<< endl; + cout << "Number of solids = "<< myVSolids->Length() << endl; + cout << "=================================================================== " << endl; + + Standard_Integer shProgress(0), shNum(myVSolids->Length()), shOldCnt(-1); + Standard_Integer useCores(1); // number of cores to use + + //////////////////////////////////////////////////////////////////////////////////////// + //settings for parallelization +#ifndef MCCAD_USECORES + useCores = 1; //(omp_get_num_procs()-1); + + if (useCores < 1) + useCores = 1; +#endif //MCCAD_USECORES + + // get environmental variable to set number of cores to use + TCollection_AsciiString useProc; + if(getenv("MCCAD_USECORES")) + useProc = TCollection_AsciiString(getenv("MCCAD_USECORES")); + else + useProc = 1; + useProc.LeftAdjust(); + useProc.RightAdjust(); + if(useProc.Length()>0) + { + if(useProc.IsIntegerValue()) + { + Standard_Integer tmpInt = useProc.IntegerValue(); + if(tmpInt>0) + useCores = tmpInt; + } + } + + if(useCores > 1) + { + cout << "\tNumber of available processors : " << omp_get_num_procs() << endl; + cout << "\tNumber of used processors : " << useCores << endl; + } + + omp_set_num_threads(useCores); + + ////////////////////////////////////////////////////////////////////////////////////////// + // Perform forward collision test +#pragma omp parallel for + for (int iter = 1; iter <= shNum; iter++)//For all Solids check for collision with other solid + { + // show progress in shell + shProgress = Standard_Integer(100.0*Standard_Real(iter)/Standard_Real(shNum)); + if(shOldCnt < shProgress) + { + cout << "." << flush; + shOldCnt = shProgress; + } + + TopoDS_Solid aSol = TopoDS::Solid((myVSolids->Value(iter)).GetSolid()); + BRepClass3d_SolidClassifier bsc3d(aSol); + McCadDiscDs_DiscSolid aDiscSolid = myVSolids->Value(iter); + Bnd_Box aBB = aDiscSolid.GetBBox(); + //bsc3d.PerformInfinitePoint(myTolerance); + + //if (!bsc3d.State()==TopAbs_OUT) + // cout << "_#_McCadMcVoid_ForwardCollision.cxx :: Warning: There is a hole in the Shape!"<< endl; + + Handle(TopTools_HSequenceOfShape) aFaceSeq = new TopTools_HSequenceOfShape(); + for (int iter2 = iter+1; iter2 <= myVSolids->Length(); iter2++)//For all solids other then current solid test for overlaps + { + //bbox check + TopoDS_Solid sSol = TopoDS::Solid((myVSolids->Value(iter2)).GetSolid()); + BRepClass3d_SolidClassifier asc3d (sSol); + + McCadDiscDs_DiscSolid aDiscSolid = myVSolids->Value(iter2); + Bnd_Box sBB = aDiscSolid.GetBBox(); + + if(aBB.IsOut(sBB)) + { + continue; + } + //////////////////////////////////////////////////////////////////// + // the same face with different orientation + Standard_Boolean found = Standard_False; + for (TopExp_Explorer exF(aSol,TopAbs_FACE); exF.More(); exF.Next()) //For all faces of first current solid delete 'distorted' twins + { + TopoDS_Face aF = TopoDS::Face(exF.Current()); + aFaceSeq->Clear(); + for (TopExp_Explorer exFF(sSol,TopAbs_FACE); exFF.More(); exFF.Next())//For all faces of second current solid + { + TopoDS_Face sF = TopoDS::Face(exFF.Current()); + aFaceSeq->Append(aF); + aFaceSeq->Append(sF); + aFaceSeq = McCadMcVoid::DeleteOne(aFaceSeq); //if twin faces occure that differ in their orientation delete one. + if (aFaceSeq->Length() < 2) + { + found = Standard_True; + break; + } + aFaceSeq->Clear(); + } + if(found) break; + } + if(found) //same face different orientation --> two non colliding neighbouring solids + continue; + + /////////////////////////////////////////////////////////////////////// + Standard_Boolean inState = Standard_False; + // Standard_Boolean oneInState = Standard_False; + /////////////////////////////////////////////////////////////////////// + Handle(McCadDiscDs_HSequenceOfDiscFace) vFaces = (myVSolids->Value(iter2)).GetOwnVFaces(); + for(int ip = 1; ip <= vFaces->Length(); ip++)//For all faces check if their sample points lie inside the current solid + { + Bnd_Box fBB = (vFaces->Value(ip)).GetBBox(); + if(aBB.IsOut(fBB))//check if face is out of BB + { + // cout<< ssct << "." << ip << " BB based exclusion of a Face!!" << endl; + continue; + } + // this is forward check + + Handle(TColgp_HSequenceOfPnt) aPntSeq = (vFaces->Value(ip)).GetPoints(); + for (int k=1; k<=aPntSeq->Length();k++) + { + gp_Pnt aP = aPntSeq->Value(k); + + if(aBB.IsOut(aP)) + continue; + + // if(McCadMcVoid::PointState(aSol,aP) == TopAbs_IN ) //Check if point is inside the first current solid + bsc3d.Perform(aP,1.0e-05); // we check with higher tolerance to avoid backward check! + if ( bsc3d.State() == TopAbs_IN && McCadMcVoid::PointState(aSol,aP) == TopAbs_IN) + { + inState = Standard_True; //Collision Found!!! + /*STEPControl_Writer colWrt; + colWrt.Transfer(BRepBuilderAPI_MakeVertex(aP).Shape(), STEPControl_AsIs); + colWrt.Transfer(aSol, STEPControl_AsIs); + colWrt.Write("aCollision.stp");*/ + //exit(-1); + + break; + } + } + if (inState) + break; + } + + if (inState) //vanilla + { + (myVSolids->ChangeValue(iter)).AppendOtherVSolid(iter2); + continue; + } + /////////////////////////////////////////////////////////////////////////////////////////////////// + // otherwise simple backward check due to small voids may be available !! + // this is necessary!! + Handle(TColgp_HSequenceOfPnt) aPntSeq = (myVSolids->Value(iter)).GetVoxel(); + for (int k=1; k<=aPntSeq->Length();k++) + { + gp_Pnt aP = aPntSeq->Value(k); + + if(sBB.IsOut(aP)) + continue; + + // asc3d.Perform(aP,1.0e-07); + // if (asc3d.State() == TopAbs_IN) + if(McCadMcVoid::PointState(sSol,aP) == TopAbs_IN && asc3d.State() == TopAbs_IN) + { + inState = Standard_True; + break; + } + } + if (inState) //vanilla + { + (myVSolids->ChangeValue(iter)).AppendOtherVSolid(iter2); + continue; + } + } + } + + cout << "#" << endl; + myIsDone = true; + + //cout << "=================================================================== " << endl; + //cout << "Collision check finished \n"<< endl; + /////////////////////////////////////////////////////////////////////////////////////////// +} + +void McCadMcVoid_ForwardCollision::SetDsSolid(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) +{ + myVSolids = theDShape; +} + +Standard_Boolean McCadMcVoid_ForwardCollision::IsDone() const +{ + return myIsDone; +} + +void McCadMcVoid_ForwardCollision::SetTolerance(const Standard_Real theTol) +{ + myTolerance = theTol; +} + +Standard_Real McCadMcVoid_ForwardCollision::GetTolerance() const +{ + return myTolerance; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid_Generator.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid_Generator.cxx new file mode 100644 index 0000000..0939521 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcVoid_Generator.cxx @@ -0,0 +1,2979 @@ +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +//qiu #include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + + +Standard_Boolean decompose(Standard_False); +Standard_Real originalBoxSize(0.0); +int glblCnt(0); + +McCadMcVoid_Generator::McCadMcVoid_Generator() +{ + myMinVolume = 1.25e2; + myMaxComplementedShapes = 10; + myMaxNbOfPreDecomposition = 500; + myMinDecompositionFaceArea = 500; + myMinRedecompositionFaceArea = 50; + myTolerance = 1.e-7; + myIsDone = false; + myVSolids = NULL; + myVVoids = new McCadDiscDs_HSequenceOfDiscSolid; + + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myCFRes = 5; +} + +McCadMcVoid_Generator::McCadMcVoid_Generator(Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) +{ + myMinVolume = 1.25e2; + myMaxComplementedShapes = 10; + myMaxNbOfPreDecomposition = 500; + myMinDecompositionFaceArea = 500; + myMinRedecompositionFaceArea = 50; + myTolerance = 1.e-7; + myIsDone = false; + myVSolids = theDShape; + myVVoids = new McCadDiscDs_HSequenceOfDiscSolid; + + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myCFRes = 5; +} + +void McCadMcVoid_Generator::SetDiscSolids(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theSolids) +{ + myVSolids = theSolids; +} + +#ifndef MCCAD_NONGUI +void McCadMcVoid_Generator::SetProgressIndicator(Handle_Message_ProgressIndicator& thePI) +{ + myPI = thePI; +} +#endif + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadMcVoid_Generator::GetDiscSolids() const +{ + return myVSolids; +} + + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadMcVoid_Generator::GetDiscVoids() const +{ + if(myIsDone) return myVVoids; + else + { + cout << "_#_McCadMcVoid_Generator.cxx :: Void generation has not yet been performed or failed!" << endl; + return myVVoids; + } +} + + +void McCadMcVoid_Generator::SetBSolid(const Handle(TopTools_HSequenceOfShape)& theBSolid) +{ + myBSolid = theBSolid; +} + + +Handle(TopTools_HSequenceOfShape)McCadMcVoid_Generator::GetBSolid() const +{ + return myBSolid; +} + + +TopoDS_Shape McCadMcVoid_Generator::MkOuterSpace() +{ + /////////////////////////////////////////////////////////////////////////////////////////// + // here we make the outer sphere + Bnd_Box aBBBox; + + for(Standard_Integer i=1; i<=myBSolid->Length(); i++) + { + for (TopExp_Explorer exv(myBSolid->Value(i), TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + aBBBox.Add(aPnt); + } + } + + aBBBox.SetGap(0.0); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + aBBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + + gp_Pnt theCenterOfMass; + GProp_GProps Props; + Standard_Real theRadius; + + TopoDS_Shape BigB = BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape(); + BRepGProp::VolumeProperties(BigB, Props); + theCenterOfMass = Props.CentreOfMass(); + + theRadius = theCenterOfMass.Distance(theLPnt); + + if(theCenterOfMass.Distance(theUPnt) > theRadius) + theRadius = theCenterOfMass.Distance(theUPnt); + + mySphere = BRepPrimAPI_MakeSphere(gp_Pnt((theLPnt.X() + theUPnt.X())/2, (theLPnt.Y()+ theUPnt.Y())/2, (theLPnt.Z()+ theUPnt.Z())/2), theRadius + 100.0).Shape(); + + //////////////////////////////////////////////////////////////////////////////////////// + return mySphere; +} + + +void McCadMcVoid_Generator::SetMinVolume(const Standard_Real theVol) +{ + myMinVolume = theVol; +} + + +void McCadMcVoid_Generator::SetMaxComplementedShapes(const Standard_Integer theNumb) +{ + myMaxComplementedShapes = theNumb; +} + + +void McCadMcVoid_Generator::SetMaxNbOfPreDecomposition( const Standard_Integer theNumb) +{ + myMaxNbOfPreDecomposition = theNumb; +} + + +void McCadMcVoid_Generator::SetMinDecompositionFaceArea(const Standard_Real theArea) +{ + myMinDecompositionFaceArea = theArea; +} + + +void McCadMcVoid_Generator::SetMinRedecompositionFaceArea(const Standard_Real theArea) +{ + myMinRedecompositionFaceArea = theArea; +} + + +void McCadMcVoid_Generator::SetTolerance(const Standard_Real theTol) +{ + myTolerance = theTol; +} + + +Standard_Boolean McCadMcVoid_Generator::IsDone() const +{ + return myIsDone; +} + + +void McCadMcVoid_Generator::SetDiscParameter(const Standard_Integer theMaxNbPnt, const Standard_Integer theMinNbPnt, + const Standard_Real theXRes, const Standard_Real theYRes, const Standard_Real theTol) +{ + myMaxNbPnt = theMaxNbPnt; + myMinNbPnt = theMinNbPnt; + myXlen = theXRes; + myYlen = theYRes; +} + + +void McCadMcVoid_Generator::SetCutFaceResolution(const Standard_Real theCFRes) +{ + myCFRes = theCFRes; +} + + + +////////////////////////////////////////////////////////////////// +/*++++++++++++++++++++++++++++ INIT ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// +void McCadMcVoid_Generator::Init() +{ + PreDecompose(); + VoidGenerate(); + myIsDone = true; +} + +////////////////////////////////////////////////////////////////// +/*++++++++++++++++++++ PREDECOMPOSE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// + +void McCadMcVoid_Generator::PreDecompose() +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + Handle(TopTools_HSequenceOfShape) BoxSeq = new TopTools_HSequenceOfShape(); + + // For Debugging -- skip decomposition part and jump directly to + // voxelization and voidgenerate !!! + decompose = Standard_True; + Standard_Boolean havePredecomposed = Standard_False; + + if(getenv("MCCAD_PREDECOMPOSED") != NULL) + { + havePredecomposed = Standard_True; + TCollection_AsciiString PreDecomposedFile(getenv("MCCAD_PREDECOMPOSED")); + if(PreDecomposedFile.Length() > 0) + { + decompose = Standard_False; + + if(getenv("MCCAD_DECOMPOSE") != NULL) + decompose = Standard_True; + + cout << "\n==================================================\n" << + "!!! WARNING : Predecomposed Voids used from file : " << + PreDecomposedFile.ToCString() << endl << + "==================================================\n\n"; + STEPControl_Reader rdr; + rdr.ReadFile(PreDecomposedFile.ToCString()); + Standard_Integer nbRoots = rdr.NbRootsForTransfer(); + + cout << "\n-----------------------------------------\nNumber of roots : " << nbRoots << "\n\n"; + + for(Standard_Integer i=1; i<=nbRoots; i++) + { + if(!rdr.TransferRoot(i)) + { + cout << "!!! Warning : skipping root nb : " << i << endl; + continue; + } + + TopoDS_Shape aShape = rdr.Shape(i); + BoxSeq->Append(aShape); + } + } + } + + if(decompose) + { + ///////////////////////////////////////////////////////////////////// + // generate cut faces and do predecomposition using only planar faces + // compose cutfaces + + Handle(McCadDiscDs_HSequenceOfDiscFace) theVCutFace = new McCadDiscDs_HSequenceOfDiscFace(); + Handle(McCadDiscDs_HSequenceOfDiscFace) theResultants = new McCadDiscDs_HSequenceOfDiscFace(); + //NONPLANAR + Handle(McCadDiscDs_HSequenceOfDiscFace) theNPFace = new McCadDiscDs_HSequenceOfDiscFace(); + //#NONPLANAR + myPI->SetStep(5./myVSolids->Length()); + + + /* + * Use planar faces to cut bounding box + */ + for(int i = 1; i <= myVSolids->Length(); i++)//For all voxel solids append planar faces to theVCutFace and discretize these faces + { + TopoDS_Solid tmpSol = TopoDS::Solid(myVSolids->Value(i).GetSolid()); + Handle(McCadDiscDs_HSequenceOfDiscFace) ownVFaces = myVSolids->Value(i).GetOwnVFaces(); + + // cout << "\nSOLID No.: " << i << "....................." << endl; + + //Standard_Integer plnCnt(0); + for(int j = 1; j <= ownVFaces->Length(); j++)//For all faces check if planar, if true and if area is bigger MinDecomposition: append + { + TopoDS_Face aF = TopoDS::Face(ownVFaces->Value(j).GetFace()); + BRepAdaptor_Surface Bs1(aF,Standard_True); + GeomAdaptor_Surface AS = Bs1.Surface(); + + Standard_Real area = McCadMcVoid::AreaOfShape(aF); + + if(AS.GetType() == GeomAbs_Plane) + { + // cout << "Plane No: " << ++plnCnt << " area = " << area << endl; + if(area > myMinDecompositionFaceArea) + theVCutFace->Append(ownVFaces->Value(j)); + else + { + + } + } + else if(AS.GetType() == GeomAbs_Cylinder)// CYLINDRICAL ONLY -- so far + { + if(area > myMinDecompositionFaceArea) + theNPFace->Append(ownVFaces->Value(j)); + } + //#NONPLANAR + } + + /////////////////////////////////////////////////////////////////////////////// + McCadCSGTool_Extender Mext(tmpSol); + if(Mext.IsDone())// Append resultants for nonlinear surfaces. + { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + //TopoDS_Solid stSolid = mcSol->GetSolid(); + Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape(); + + if(mcSol->HaveExt()) + aSeq->Append(mcSol->GetFaces()); + + if (aSeq->Length()> 0) + { + for (Standard_Integer j = 1; j<= aSeq->Length(); j++) + { + TopoDS_Face aFace = TopoDS::Face(aSeq->Value(j)); + Standard_Real area = McCadMcVoid::AreaOfShape(aFace); + // cout << "\t\tarea:" << area << endl; + if(aFace.IsNull() || area < myMinDecompositionFaceArea) + continue; + + McCadDiscDs_DiscFace theDFace; + theDFace.SetFace(aFace); + McCadDiscretization_Face theDiscer(theDFace); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()) + theResultants->Append(theDiscer.GetFace()); + //theVCutFace->Append(theDiscer.GetFace()); + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!", + McCadMessenger_ErrorMsg); + } + } + } + else + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Extending solid failed!!", + McCadMessenger_ErrorMsg); + break; + } + + if(myPI->UserBreak()) + return; + myPI->Increment(); + } + ///////////////////////////////////////////////////////////////////////////////////////// + // we delete quasi redundant faces + // cout << "==================================================================" << endl; + // cout << " Total Number of Solid = " << myVSolids->Length() << endl; + // cout << " Total Number of redundant Cut Faces = " << theVCutFace->Length() << endl; + + //////////////////////////////////////////////////////////////////////////////////////// + // Rank by surface area DECREASING + cout << "Sorting cut faces : " << endl; + + for (int i=1; i<=theVCutFace->Length(); i++) + { + Standard_Real iArea, jArea; + TopoDS_Face iFace = TopoDS::Face(theVCutFace->Value(i).GetFace()); + + iArea = McCadMcVoid::AreaOfShape(iFace); + + for (int j=i+1; j<=theVCutFace->Length(); j++) + { + TopoDS_Face jFace = TopoDS::Face(theVCutFace->Value(j).GetFace()); + + jArea = McCadMcVoid::AreaOfShape(jFace); + + if(jArea > iArea) // swap faces + { + theVCutFace->Exchange(i,j); + iArea = jArea; + } + } + + cout << "." << flush; + } + cout << "Done\n"; + + + for(int i=1; i<=theResultants->Length(); i++) + { + Standard_Real iArea, jArea; + TopoDS_Face iFace = TopoDS::Face(theResultants->Value(i).GetFace()); + iArea = McCadMcVoid::AreaOfShape(iFace); + for(int j=i+1; j<=theResultants->Length(); j++) + { + TopoDS_Face jFace = TopoDS::Face(theResultants->Value(j).GetFace()); + jArea = McCadMcVoid::AreaOfShape(jFace); + + if(jArea > iArea) // swap faces + { + theResultants->Exchange(i,j); + iArea = jArea; + } + } + } + + //remove non-planar faces + for(int i=1; i<=theResultants->Length(); i++) + { + TopoDS_Face iFace = TopoDS::Face(theResultants->Value(i).GetFace()); + BRepAdaptor_Surface iBS(iFace,Standard_True); + GeomAdaptor_Surface iAS = iBS.Surface(); + if(iAS.GetType() != GeomAbs_Plane) + theResultants->Remove(i--); + } + + + // now the faces in theVCutFaces are sorted by their decreasing area + // theVCutFace = McCadMcVoid::DeleteApproxRedundant(theVCutFace, myCFRes); + + if(myBSolid->Length() < 1)//If bounding box does not exist, create overall BB for all voxelized Solids + { + cout << "\nCreating Bounding Box\n" << endl; + Bnd_Box bigBB; + for (Standard_Integer i = 1; i<= myVSolids->Length(); i++) + { + TopoDS_Solid bSol = TopoDS::Solid(myVSolids->Value(i).GetSolid()); + BRepBndLib::Add(bSol,bigBB); + bigBB.SetGap(0.0); + } + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + bigBB.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + myBSolid->Append(BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin),gp_Pnt(aXmax, aYmax, aZmax)).Shape()); + } + + // start predecomposition using the Bsolid + if(!havePredecomposed) + BoxSeq->Append(myBSolid); + + TopoDS_Shape theBox = myBSolid->Value(1); + GProp_GProps GP1; + BRepGProp::VolumeProperties(theBox,GP1); + originalBoxSize = GP1.Mass(); + +/*STEPControl_Writer wrt; +for(int p=1; p<=theVCutFace->Length(); p++) + wrt.Transfer(theVCutFace->Value(p).GetFace(), STEPControl_AsIs); +for(int p=1; p<=theResultants->Length(); p++) + wrt.Transfer(theResultants->Value(p).GetFace(), STEPControl_AsIs); +wrt.Write("THECUTFACES.stp");*/ + + + cout << "\n\n##### LINEAR HALF SPACES #####" << endl; + BoxSeq = GoDecompose(BoxSeq, theVCutFace, myMaxNbOfPreDecomposition); //!!! run pre-decomposition + cout << "##### LINEAR HALF SPACES FROM RESULTANTS #####" << endl; + BoxSeq = GoDecompose(BoxSeq, theResultants, myMaxNbOfPreDecomposition); + + + /////////////////////////////////// + // perform cylindrical cuts, if environmental variable MCCAD_CYLINDRICALCUT is defined and set to 1 + if(getenv("MCCAD_CYLINDRICALCUT") != NULL) + { + TCollection_AsciiString val(getenv("MCCAD_CYLINDRICALCUT")); + if(val.IsIntegerValue()) + { + if(val.IntegerValue() == 1) + { + //NONPLANAR + /* + * Use non-planar faces to cut predecomposed bounding box solids + */ + + cout << "\n\nNumber of planar cutted BOXES : " << BoxSeq->Length() << endl; + cout << "Performing second order cuts!!!\n\n"; + + Standard_Real nbFaces(theNPFace->Length()); + myPI->SetStep(15./nbFaces); + + for(Standard_Integer npCnt=1; npCnt<=nbFaces; npCnt++) // for every non linear surface... + { + cout << "\t Face No.: " << npCnt << " of " << nbFaces << endl; + TopoDS_Shape faceShape = theNPFace->Value(npCnt).GetFace(); + + Handle(TColgp_HSequenceOfPnt) curPnts = theNPFace->Value(npCnt).GetPoints(); // get sample points on surf... + for(Standard_Integer bxCnt=1; bxCnt<=BoxSeq->Length(); bxCnt++) // for every box solid ... + { + Standard_Boolean hasInPoints(Standard_False); + TopoDS_Solid curSol = TopoDS::Solid(BoxSeq->Value(bxCnt)); + BRepClass3d_SolidClassifier solidClassifier(curSol); + Standard_Integer inCnt(0); + + for(Standard_Integer pntCnt = 1; pntCnt <= curPnts->Length(); pntCnt++)// for every sample point of current face, test if inside vsolid + { + solidClassifier.Perform(curPnts->Value(pntCnt),1e-7); + + if(solidClassifier.State() == TopAbs_IN && solidClassifier.State() != TopAbs_OUT && solidClassifier.State() != TopAbs_ON) + { + hasInPoints = Standard_True; + inCnt++; + } + } + + if(hasInPoints && Standard_Real(inCnt)/Standard_Real(curPnts->Length()) > 0.1) + { + /*STEPControl_Writer w; + w.Transfer(faceShape, STEPControl_AsIs); + w.Transfer(curSol, STEPControl_AsIs); + + + TopoDS_Compound newComp; + BRep_Builder compBuilder; + compBuilder.MakeCompound(newComp); + + for(Standard_Integer j=1; j < curPnts->Length(); j++) + compBuilder.Add(newComp, BRepBuilderAPI_MakeVertex(curPnts->Value(j)).Vertex()); + + + w.Transfer(newComp, STEPControl_AsIs); + + TCollection_AsciiString name("fc_"); + name += npCnt; + name += ".stp"; + w.Write(name.ToCString());*/ + + /* cout << "IN Points : " << inCnt << " of " << curPnts->Length() << " = " << Standard_Real(inCnt)/Standard_Real(curPnts->Length()) << endl; + + // 03092009 + // * + * this is a pre-"boolean-cut" test! if this test fails, it is most likely that the boolean operation fails or + * that it even causes the program to freeze. + * Put test in McCadMcVoid::HalfSpace and perform for non-planar surfaces only!!! + * */ + TopoDS_Face theFace = TopoDS::Face(faceShape); + + // make box + Bnd_Box tmpBox; + BRepBndLib::Add(curSol, tmpBox); + tmpBox.SetGap(10); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + tmpBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + Handle(TColStd_HSequenceOfReal) uVals = new TColStd_HSequenceOfReal; + Handle(TColStd_HSequenceOfReal) vVals = new TColStd_HSequenceOfReal; + TopoDS_Shape theBox = BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape(); + + // find extremal points for Face Creation + // we maximize the face, so it cuts the whole (void-)solid + TopLoc_Location loc; + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface AS(theFaceSurface); + TopExp_Explorer ex; + gp_Pnt2d the2dPnt; + Standard_Real uMin, uMax, vMin, vMax; + ShapeAnalysis_Surface sAs(theFaceSurface); + + for(ex.Init(theBox, TopAbs_VERTEX); ex.More(); ex.Next()) + { + //get point + TopoDS_Vertex theVertex = TopoDS::Vertex(ex.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(theVertex); + + //project on surface + GeomAPI_ProjectPointOnSurf pntProj(thePnt, theFaceSurface); + for(int j=1; j<=pntProj.NbPoints(); j++) + { + the2dPnt = sAs.ValueOfUV(pntProj.Point(j), 1e-3); + uVals->Append(the2dPnt.X()); + vVals->Append(the2dPnt.Y()); + } + } + + // minimize and maximize + uMin = uVals->Value(1); + uMax = uVals->Value(1); + for(int i=2; i<=uVals->Length(); i++) + { + Standard_Real theVal = uVals->Value(i); + + if(uMin > theVal) + uMin = theVal; + if(uMax < theVal) + uMax = theVal; + } + + vMin = vVals->Value(1); + vMax = vVals->Value(1); + for(int i=2; i<=vVals->Length(); i++) + { + Standard_Real theVal = vVals->Value(i); + if(vMin > theVal) + vMin = theVal; + if(vMax < theVal) + vMax = theVal; + } + + if(AS.GetType() == GeomAbs_Cylinder) + { + uMin = 0; + uMax = 2.*M_PI; + } + /////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef OCC650 + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax); +#else + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax, 1.e-7); +#endif + F1.Orientation(TopAbs_FORWARD); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // Build new solids + + Standard_Boolean preTestFailed(Standard_False); + // if pretest failes bop will most likely fail, in some cases it will freez the whole prog., that's why we do this + // pretest. + + for(TopExp_Explorer fExp(curSol, TopAbs_FACE); fExp.More(); fExp.Next()) + { + TopoDS_Face curF = TopoDS::Face(fExp.Current()); + + IntTools_FaceFace ffInt; + ffInt.SetParameters(Standard_True, Standard_False, Standard_True, 1e-3); + ffInt.Perform(curF, F1); + + if(!ffInt.IsDone()) + { + preTestFailed=Standard_True; + break; + } + + IntTools_SequenceOfCurves curves; + curves = ffInt.Lines(); + + Standard_Integer nbLines(0); + for(int i=1; i<=curves.Length(); i++) + nbLines++; + + if(nbLines < 1) + continue; + + if(nbLines > 2) + { + cout << "NB LINES : " << nbLines << endl; + + preTestFailed = Standard_True; + break; + } + + for(int i=1; i<=curves.Length(); i++) + { + IntTools_Curve intCurve = curves.Value(i); + if(!intCurve.HasBounds()) + { + preTestFailed = Standard_True; + break; + } + } + } + + if(preTestFailed) + { + cout << "Pre-Boolean_Operation-Test failed\nSkipping this solid\n"; + continue; + } + + Handle(TopTools_HSequenceOfShape) tmpShp = new TopTools_HSequenceOfShape; + tmpShp->Append(curSol); + + tmpShp = Decompose(tmpShp, faceShape); + + // # + // cout << "\t\t\tNumber Of Result Boxes : " << tmpShp->Length() << endl; + if(tmpShp->Length()>1) // decomposition successfull + { + // cout << "CUT SUCCESSFUL : " << tmpShp->Length() << endl; + Standard_Integer failCnt(0); + Standard_Boolean isFailed(Standard_False); + + for(int k=1; k<=tmpShp->Length(); k++) //check again if cutted model is valid, append valid boxes to BoxSeq + { + TopoDS_Shape aSol = tmpShp->Value(k); + + for (TopExp_Explorer exs(aSol,TopAbs_SHELL);exs.More();exs.Next()) + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + ////////////////////////////////////////////////////////////////////////// + BRepCheck_Shell shellCheck(sh); + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) + { + BRepBuilderAPI_MakeSolid Bu(sh); + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + + if(aSolid.IsNull()) + { + isFailed = Standard_True; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Null Solid Resulted", + McCadMessenger_ErrorMsg); + } + else + { + BoxSeq->Append(aSolid); + failCnt++; + } + } + else + cout << "# # # Could not build Solid!!!\n"; + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Model may be invalid!!", + McCadMessenger_WarningMsg); + } + } + + if(isFailed) // if resulting solids are invalid - remove already appended solids and keep original one + { + for(int l=1; l<=failCnt; l++) + BoxSeq->Remove(BoxSeq->Length()); + } + else + BoxSeq->Remove(bxCnt); + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Cut Failed !!!", + McCadMessenger_WarningMsg); + } + } + myPI->Increment(); + } + + cout << "Total number of BOXES after second order cut : " << BoxSeq->Length() << endl; + } + } + }//#NONPLANAR + } + + + if(getenv("MCCAD_WRITE_DECOMPOSED") != NULL) + { + STEPControl_Writer wrt; + for(int i=1; i<=BoxSeq->Length(); i++) + wrt.Transfer(BoxSeq->Value(i), STEPControl_AsIs); + wrt.Write("theVVoids.stp"); + } + + + ///////////////////////////////////////////////////////////////////////// + cout << "\nVoxelization of predecomposed voids" << endl; + cout << "====================================" << endl; + + for (Standard_Integer i = 1; i<= BoxSeq->Length(); i++)//Discretize cutted solids + { + cout << "." << flush; + TopoDS_Solid tmpSol = TopoDS::Solid(BoxSeq->Value(i)); + McCadDiscDs_DiscSolid aVSol; + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(i); + + // voxelize + McCadDiscretization_Solid theDiscer(aVSol); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()) + { + myVVoids->Append(theDiscer.GetSolid()); //myVVoids contains now discretized cutted solids with planar faces + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Voxelization of a predecomposed void failed", + McCadMessenger_ErrorMsg); + } + cout << "\n====================================" << endl; + cout << "End voxelization of predecomposition Voids \n" << endl; + + BoxSeq->Clear(); +} + + +Standard_Boolean McCadMcVoid_Generator::IsPolyhedral(TopoDS_Shape& shp) +{ + for(TopExp_Explorer ex(shp, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face face = TopoDS::Face(ex.Current()); + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(face,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + if(adaptorSurf.GetType() != GeomAbs_Plane) + return Standard_False; + } + + return Standard_True; +} + + +Standard_Boolean McCadMcVoid_Generator::PolyhedralOverlap(TopoDS_Shape& shp1, TopoDS_Shape& shp2) +{ + /* + * After sign-constant decomposition each polyhedral solid is convex. + * For 2 convex polyhedra that do not overlap there is at least one + * bounding surface of the two solids for which all vertices of the one solid + * lie on one side and all vertices of the other solid lie on the other side. + * If no such separating, bounding surface can be found the two solids must overlap. + * + * This method is supposed to be faster and more accurate than the "voxelized solids"-method! + */ + + Handle_TopTools_HSequenceOfShape vertex1Sequence = new TopTools_HSequenceOfShape; + Handle_TopTools_HSequenceOfShape vertex2Sequence = new TopTools_HSequenceOfShape; + Handle_TopTools_HSequenceOfShape faces1Sequence = new TopTools_HSequenceOfShape; + Handle_TopTools_HSequenceOfShape faces2Sequence = new TopTools_HSequenceOfShape; + + // 1 + /////////////////////////////////////////////// + for(TopExp_Explorer ex(shp1, TopAbs_VERTEX); ex.More(); ex.Next()) + { + TopoDS_Vertex aVertex = TopoDS::Vertex(ex.Current()); + vertex1Sequence->Append(aVertex); + } + + for(int i=1; i<=vertex1Sequence->Length(); i++) + { + for(int j=vertex1Sequence->Length(); j>i; j--) + { + if(vertex1Sequence->Value(i).IsSame(vertex1Sequence->Value(j))) + { + vertex1Sequence->Remove(j); + i--; + break; + } + } + } + + + for(TopExp_Explorer ex(shp1, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + faces1Sequence->Append(aFace); + } + + for(int i=1; i<=faces1Sequence->Length(); i++) + { + for(int j=faces1Sequence->Length(); j>i; j--) + { + if(faces1Sequence->Value(i).IsSame(faces1Sequence->Value(j))) + { + faces1Sequence->Remove(j); + i--; + break; + } + } + } + + + // 2 + ////////////////////////////////////////////////// + for(TopExp_Explorer ex(shp2, TopAbs_VERTEX); ex.More(); ex.Next()) + { + TopoDS_Vertex aVertex = TopoDS::Vertex(ex.Current()); + vertex2Sequence->Append(aVertex); + } + + /* for(int i=1; i<=vertex2Sequence->Length(); i++) + { + for(int j=vertex2Sequence->Length(); j>i; j--) + { + if(vertex2Sequence->Value(i).IsSame(vertex2Sequence->Value(j))) + { + vertex2Sequence->Remove(j); + i--; + break; + } + } + }*/ + + + for(TopExp_Explorer ex(shp2, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + faces2Sequence->Append(aFace); + } + + for(int i=1; i<=faces2Sequence->Length(); i++) + { + for(int j=faces2Sequence->Length(); j>i; j--) + { + if(faces2Sequence->Value(i).IsSame(faces2Sequence->Value(j))) + { + faces2Sequence->Remove(j); + i--; + break; + } + } + } + + + /*cout << "STATS : \n======================\n\n"; + cout << vertex1Sequence->Length() << endl; + cout << faces1Sequence->Length() << endl; + cout << vertex2Sequence->Length() << endl; + cout << faces2Sequence->Length() << endl << endl; + + STEPControl_Writer wrt; + for(int i=1; i<=vertex2Sequence->Length(); i++) + wrt.Transfer(vertex2Sequence->Value(i), STEPControl_AsIs); + wrt.Transfer(shp1, STEPControl_AsIs); + wrt.Write("model.stp");*/ + + // exit(0); + + // 1 vs 2 + /////////////////////////////////////// + for(int i=1; i<=faces1Sequence->Length(); i++) + { + TopoDS_Face curFace = TopoDS::Face(faces1Sequence->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(curFace,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + int curSig(0); + + // determine in solid signum + for(int j=1; j<=vertex1Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex1Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + curSig = int(val/fabs(val)); + break; + } + } + + int breakCnt(0); + bool isFace(false); + + if(curSig == 0) + isFace = true; + + // test if solid has vertices with same signum + for(int j=1; j<=vertex2Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex2Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + int sign = int(val/fabs(val)); + + if(isFace) + { + if(curSig == 0) + { + curSig = sign; + continue; + } + else if(sign != curSig) + { + breakCnt++; + break; + } + } + else + { + if(sign == curSig) + { + breakCnt++; + break; + } + } + } + } + + if(breakCnt == 0) + { + //cout << "No Collision 1\n"; + return false; + } + } + + // 2 vs 1 + ////////////////////////////////////// + for(int i=1; i<=faces2Sequence->Length(); i++) + { + TopoDS_Face curFace = TopoDS::Face(faces2Sequence->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(curFace,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + int curSig(0); + + // determine in solid signum + for(int j=1; j<=vertex2Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex2Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + curSig = int(val/fabs(val)); + break; + } + } + + int breakCnt(0); + bool isFace(false); + + if(curSig == 0) + isFace = true; + + // test if solid has vertices with same signum + for(int j=1; j<=vertex1Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex1Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + int sign = int(val/fabs(val)); + + if(isFace) + { + if(curSig == 0) + { + curSig = sign; + continue; + } + else if(sign != curSig) + { + breakCnt++; + break; + } + } + else + { + if(sign == curSig) + { + breakCnt++; + break; + } + } + } + } + + if(breakCnt == 0) + { + //cout << "No Collision 2\n"; + return false; + } + } + + + return true; + + // check all vertices of solid 2 with all faces of solid 1 +/* for(TopExp_Explorer exF(shp2, TopAbs_FACE); exF.More(); exF.Next()) + { + Standard_Integer sign(0); + TopoDS_Face face2 = TopoDS::Face(exF.Current()); + + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(face2,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + + Standard_Integer breakCount(0); + + for(TopExp_Explorer exV(shp1, TopAbs_VERTEX); exV.More(); exV.Next()) + { + TopoDS_Vertex vertex1 = TopoDS::Vertex(exV.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(vertex1); + + Standard_Real val = McCadGTOOL::Evaluate(adaptorSurf, thePnt); + val = val/Abs(val); + sign = Standard_Integer(val); + + // forward oriented face => all vertices of own solid are on negative side, + // for reverse oriented face => the other way around + if(face2.Orientation() == TopAbs_REVERSED) + { + if(sign < -1.0e-6) + continue; + } + else if(sign > 1.0e-6) + continue; + + breakCount++; + break; + } + + // no break-call => no collision + if(breakCount == 0) + return Standard_False; + } + + + // check all faces of solid 1 with all vertices of solid 2 + for(TopExp_Explorer exF(shp1, TopAbs_FACE); exF.More(); exF.Next()) + { + Standard_Integer sign(0); + TopoDS_Face face1 = TopoDS::Face(exF.Current()); + + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(face1,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + + Standard_Integer breakCount(0); + + for(TopExp_Explorer exV(shp2, TopAbs_VERTEX); exV.More(); exV.Next()) + { + TopoDS_Vertex vertex2 = TopoDS::Vertex(exV.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(vertex2); + + Standard_Real val = McCadGTOOL::Evaluate(adaptorSurf, thePnt); + val = val/Abs(val); + sign = Standard_Integer(val); + + if(face1.Orientation() == TopAbs_REVERSED) + { + if(sign < -1.0e-6) + continue; + } + else if(sign > 1.0e-6) + continue; + + breakCount++; + break; + } + + // no break-call => no collision + if(breakCount == 0) + return Standard_False; + } + + // no sign-constant surface found? => collision + return Standard_True;*/ +} + + +////////////////////////////////////////////////////////////////// +/*++++++++++++++++++++ VOIDGENERATE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// +// perform collision test between linearly cut void cells and decomposed input solids +void McCadMcVoid_Generator::VoidGenerate() +{ + ///////////////////////////////////////////////////////////////////////////////////////// + // append empty exp. after cell and outer seq. so that the output is smooth. + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + myPI->SetStep(5./myVVoids->Length()); + + Handle(TopTools_HSequenceOfShape) theFaceSeq = new TopTools_HSequenceOfShape(); + + cout << "\nFinalize void generation " << endl; + cout << "Checking voids against solids " << myVVoids->Length() << " " << myVSolids->Length() << endl; + cout << "====================================================== " << endl; + + Handle(TopTools_HSequenceOfShape) F1Seq = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) F2Seq = new TopTools_HSequenceOfShape(); + + for (int itv = 1; itv <= myVVoids->Length(); itv++)//For all voids + { + Standard_Boolean isErased = Standard_False; + +// cout << "Void : " << itv << " of " << myVVoids->Length() << endl; + cout << "." << flush; + + myPI->Increment(); + if(myPI->UserBreak()) + return; + + TopoDS_Solid aVoidSolid = TopoDS::Solid(myVVoids->Value(itv).GetSolid()); //Void-solids + Standard_Real aVol = McCadMcVoid::VolumeOfShape(aVoidSolid); + + //cout << "\n" << aVol << "\n\n"; + BRepClass3d_SolidClassifier voidClassifier (aVoidSolid); + + McCadDiscDs_DiscSolid aDiscSolid = myVVoids->Value(itv); + Bnd_Box aBB = aDiscSolid.GetBBox(); + if(aBB.IsWhole()) cout << "Is whole" << endl; + if(aBB.IsVoid()) cout << "Is Void" << endl; + if(aBB.IsXThin(1e-7)) cout << "Is xthin" << endl; + if(aBB.IsYThin(1e-7)) cout << "Is ythin" << endl; + if(aBB.IsZThin(1e-7)) cout << "Is zthin" << endl; + if(aBB.IsThin(1e-7)) cout << "Is thin" << endl; + + Standard_Real bXmin, bYmin, bZmin, bXmax, bYmax, bZmax; + aBB.Get(bXmin, bYmin, bZmin, bXmax, bYmax, bZmax); + //cout << bXmin << " " << bYmin<< " " << bZmin<< " " << bXmax<< " " << bYmax<< " " << bZmax << endl; + gp_Pnt bPnt1(bXmin, bYmin, bZmin), bPnt2(bXmax, bYmax, bZmax); + + for (int its = 1; its <= myVSolids->Length(); its++) + { + // cout<< "Checking Void number " << itv << " (" << myVVoids->Length() << ")" << " against solid number " << its << " of " << myVSolids->Length() << endl; + + /////////////////////////////////////////////////////////////////////////////////////////////////// + Standard_Boolean inState = Standard_False; + TopoDS_Solid sSol = TopoDS::Solid(myVSolids->Value(its).GetSolid()); //material solid + Standard_Real sVol = McCadMcVoid::VolumeOfShape(sSol); + BRepClass3d_SolidClassifier solidClassifier (sSol); + + ////////////////////////////////////////////////////////////// + //bounding box based exclusion + Bnd_Box sBB; // = myVSolids->Value(its).GetBBox(); + BRepBndLib::Add(myVSolids->Value(its).GetSolid(), sBB); + sBB.SetGap(0); + + Standard_Real sXmin, sYmin, sZmin, sXmax, sYmax, sZmax; + sBB.Get(sXmin, sYmin, sZmin, sXmax, sYmax, sZmax); + gp_Pnt sPnt1(sXmin, sYmin, sZmin), sPnt2(sXmax, sYmax, sZmax); + + if(aBB.IsOut(sBB) && sBB.IsOut(aBB) && + aBB.IsOut(sPnt1) && aBB.IsOut(sPnt2) && + sBB.IsOut(bPnt1) && sBB.IsOut(bPnt2) ) + continue; + + //////////////////////////////////////////////////////////////////// + // identical faces but different orientation + Standard_Boolean found(Standard_False); + Standard_Boolean haveNonLinFace(Standard_False); + F1Seq->Clear(); + F2Seq->Clear(); + + for (TopExp_Explorer exFF(sSol,TopAbs_FACE); exFF.More(); exFF.Next()) + { + TopoDS_Face sF = TopoDS::Face(exFF.Current()); + F2Seq->Append(sF); + } + + for (TopExp_Explorer exF(aVoidSolid,TopAbs_FACE); exF.More(); exF.Next()) + { + TopoDS_Face aF = TopoDS::Face(exF.Current()); + F1Seq->Append(aF); + + for(Standard_Integer i=1; i<=F2Seq->Length(); i++) + { + TopoDS_Face sF = TopoDS::Face(F2Seq->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(sF,loc); + GeomAdaptor_Surface As2(gS2); + + if (As2.GetType() != GeomAbs_Plane) + { + haveNonLinFace = Standard_True; + continue; + } + + theFaceSeq->Clear(); + theFaceSeq->Append(aF); + theFaceSeq->Append(sF); + theFaceSeq = McCadMcVoid::DeleteOne(theFaceSeq); + if (theFaceSeq->Length() < 2) + { + //cout << "Opposing faces\n"; + found = Standard_True; + break; + } + } + + if(found) // voids are supposed to be all planar -- in further development this might change !!! + break; + } + + if(found) + continue; + /////////////////////////////////////////////////////////////////////// + // all surfaces are identical + // Handle(TopTools_HSequenceOfShape) nonIdenticalFaces = new TopTools_HSequenceOfShape(); + Standard_Integer if2(0); + TopLoc_Location loc; + + //cout << "\n\nSURFACE CHECK!!! : \n"; + + if(F1Seq->Length() == F2Seq->Length()) + { + for(int ic = 1; ic <= F1Seq->Length(); ic++) //For all void-faces compare with solid faces + { + TopoDS_Face F1 = TopoDS::Face(F1Seq->Value(ic)); + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + Handle(McCadCSGGeom_Surface) S1 = McCadMcVoid::MakeMcCadSurf(As1); + S1->SetCasSurf(As1); + + for(int ic2 = 1; ic2 <= F2Seq->Length(); ic2++) + { + //cout << " faces : " << ic << " - " << ic2 << endl; + TopoDS_Face F2 = TopoDS::Face(F2Seq->Value(ic2)); + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,loc); + GeomAdaptor_Surface As2(gS2); + + if (As1.GetType() == As2.GetType()) + { + Handle(McCadCSGGeom_Surface) S2 = McCadMcVoid::MakeMcCadSurf(As2); + S2->SetCasSurf(As2); + + if (S1->IsGeomEqual(S2)) + { + if2++; + } + } + } + + if (F2Seq->Length() == if2) //if all faces of void and solid are the same, the void-solid must be deleted + { + //cout << "Void erased because of \"identical faces\"\n"; + myVVoids->Remove(itv); + itv--; + isErased = Standard_True; + break; + } + } + + if(isErased) + break; //the void is deleted!!! + } + + ////////////////////////////////////////////////////////////////////// + // vertex based check void against solid/// + Standard_Boolean outState = Standard_False; + + //For all void vertices check if any lies outside the current solid + for (TopExp_Explorer exV(aVoidSolid,TopAbs_VERTEX); exV.More(); exV.Next()) + { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(exV.Current())); + solidClassifier.Perform(aP, 1.e-9); // 1.e-3 before 26082009 + + if (solidClassifier.State() == TopAbs_OUT ) + { + outState = Standard_True; + break; + } + } + + if(aVol - sVol <= 1.0e-5 && !outState) + { + Standard_Boolean deleteIt = Standard_True; + /////////////////////////////////////////////////////////////////////////// + if (haveNonLinFace) + deleteIt = Standard_False; + + if(deleteIt) + { + //cout << "Void erased because of \"inclusion in solid\"\n"; + myVVoids->Remove(itv); + itv--; + isErased = Standard_True; + break; + } + } + + if(isErased) + break; //the void is deleted!!! + + + // check if void center of mass lies inside solid + GProp_GProps Props; + BRepGProp::VolumeProperties(aVoidSolid, Props); + gp_Pnt vCenterOfMass = Props.CentreOfMass(); + solidClassifier.Perform(vCenterOfMass, 1e-9); + + if(solidClassifier.State() == TopAbs_IN) + { + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); + continue; + } + + + /////////////////////////////////////////////////////////////////// + // simplified overlap test for polyhedral solids -- the voids ARE polyhedral + if(!haveNonLinFace) + { + if(PolyhedralOverlap(aVoidSolid, sSol)) // OVERLAP + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); + continue; + } + + + // Voxel collision test + /////////////////////////////////////////////////////////////////////// + // forward check + Handle(McCadDiscDs_HSequenceOfDiscFace) vFaces = myVSolids->Value(its).GetOwnVFaces(); + inState = Standard_False; + Standard_Boolean allBBout(Standard_True); + + for(int ip = 1; ip <= vFaces->Length(); ip++)//For all Voxel Faces check for intersection + { + Bnd_Box fBB = vFaces->Value(ip).GetBBox(); + + if(aBB.IsOut(fBB)) + continue; + + allBBout = Standard_False; + + // this is forward check + Handle(TColgp_HSequenceOfPnt) aPntSeq = vFaces->Value(ip).GetPoints(); + for (int k=1; k<=aPntSeq->Length();k++) //For all voxel points of current face + { + gp_Pnt aP = aPntSeq->Value(k); + + if(aBB.IsOut(aP)) + continue; + + voidClassifier.Perform(aP, 1.0e-9); + + TopAbs_State theForwardState = voidClassifier.State(); + // before _MYTEST_ perform tolerance was 1e-7 and we only tested for in, not on. + if(theForwardState == TopAbs_IN && theForwardState != TopAbs_ON) // MYTEST!!! Wed Jan 19 09:54:20 CET 2011 + { + inState = Standard_True; + break; + } + } + if (inState) + break; + } + + // if no face bounding box collides with the void bounding box, continue + if(allBBout) + continue; + + if (inState) //vanilla voxel based method: inclusion should be checked here!!! + { + //cout << "myVVoids collides with : " << its << " and "; + //for(int d=1; d<=myVVoids->Value(itv).GetOtherVSolids()->Length(); d++) + // cout << myVVoids->Value(itv).GetOtherVSolids()->Value(d) << endl; + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); //otherVSolids are excluded later during cell building + continue; + } + + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // otherwise simple backward check due to small voids may be available !! + // this is necessery!! + + vFaces = myVVoids->Value(itv).GetOwnVFaces(); + for(int ip = 1; ip <= vFaces->Length(); ip++)//For all Voxel Faces check for intersection + { + Bnd_Box fBB = vFaces->Value(ip).GetBBox(); + + if(sBB.IsOut(fBB)) + continue; + + // this is backward check + Handle(TColgp_HSequenceOfPnt) aPntSeq = vFaces->Value(ip).GetPoints(); + for (int k=1; k<=aPntSeq->Length();k++) //For all voxel points of current face + { + gp_Pnt aP = aPntSeq->Value(k); + + if(sBB.IsOut(aP)) + continue; + + solidClassifier.Perform(aP, 1.0e-9); + + TopAbs_State theBackState = solidClassifier.State(); + if(theBackState == TopAbs_IN && theBackState != TopAbs_ON) // + { + inState = Standard_True; + break; + } + } + if (inState) + break; + } + if (inState) //vanilla voxel based method: inclusion should be checked here!!! + { + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); + continue; + } + /////////////////////////////////////////////////////////////////////////////////////////////// + } + + if(isErased) + continue; + + ////////////////////////////////////////////////////////////////////// + //MYTEST Test for monster voids and split further if monster is found + //new implementation Wed Feb 15 16:38:43 CET 2004 + // We check for monster voids and decompose them further!!! + Handle(TColStd_HSequenceOfInteger) compList = myVVoids->Value(itv).GetOtherVSolids(); + + if (compList->Length() > myMaxComplementedShapes) + { + //cout << " \nbegin... Processing Monster Void : " << endl; + cout << " Monster Void : number of complement solids = " << compList->Length() << endl; + Handle(TopTools_HSequenceOfShape) locSeq = new TopTools_HSequenceOfShape(); + + locSeq->Append(aVoidSolid); // append the void to it + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpVSol = new McCadDiscDs_HSequenceOfDiscSolid; + Handle(McCadDiscDs_HSequenceOfDiscFace) tmpVCutFace = new McCadDiscDs_HSequenceOfDiscFace; + + for(int i = 1; i <= compList->Length(); i++) + { + int index = compList->Value(i); + tmpVSol->Append(myVSolids->Value(index)); + } + + for (int i = 1; i <= tmpVSol->Length(); i++) + { + TopoDS_Solid tmpSol = TopoDS::Solid(tmpVSol->Value(i).GetSolid()); + + Handle(McCadDiscDs_HSequenceOfDiscFace) lvFaces = tmpVSol->Value(i).GetOwnVFaces(); + + for (int j = 1; j <= lvFaces->Length(); j++) + { + TopoDS_Face aF = lvFaces->Value(j).GetFace(); + BRepAdaptor_Surface Bs1(aF,Standard_True); + GeomAdaptor_Surface AS = Bs1.Surface(); + if(AS.GetType() == GeomAbs_Plane) + { + Standard_Real area = McCadMcVoid::AreaOfShape(aF); + + if( area > myMinRedecompositionFaceArea) + tmpVCutFace->Append(lvFaces->Value(j)); + } + } + /////////////////////////////////////////////////////////////////////////////// + McCadCSGTool_Extender Mext(tmpSol); + if(Mext.IsDone()) + { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + TopoDS_Solid stSolid = mcSol->GetSolid(); + Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape(); + if(mcSol->HaveExt()) aSeq->Append(mcSol->GetFaces()); + if (aSeq->Length()> 0) + { + for (Standard_Integer i = 1; i<= aSeq->Length(); i++) + { + TopoDS_Face aFace = TopoDS::Face(aSeq->Value(i)); + + Standard_Real area = McCadMcVoid::AreaOfShape(aFace); + + if(aFace.IsNull() || area < myMinRedecompositionFaceArea ) + continue; + + McCadDiscDs_DiscFace theDFace; + theDFace.SetFace(aFace); + + McCadDiscretization_Face theDiscer(theDFace); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + if(theDiscer.IsDone()) + { + tmpVCutFace->Append(theDiscer.GetFace()); + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!", + McCadMessenger_ErrorMsg); + } + } + } + else + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Extending solid failed!!", + McCadMessenger_ErrorMsg); + break; + } + } + ///////////////////////////////////////////////////////////////////////////////////////// + // we delet quasi redundant faces and the extend + tmpVCutFace = McCadMcVoid::DeleteApproxRedundant(tmpVCutFace, myCFRes); + //////////////////////////////////////////////////////////////////////////////////////// + + if(tmpVCutFace->Length() > 0) + { + int maxNbDec=5; + locSeq = GoDecompose(locSeq,tmpVCutFace,maxNbDec); + } + else + { + cout << " Number Cut Faces is zero = " << tmpVCutFace->Length() << endl; + cout << " Monster Void remains unprocessed.. " << endl; + } + + if(locSeq->Length() > 1) + { + cout << " Monster Void expanded to Voids: " << locSeq->Length() << endl; + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpVVoid = new McCadDiscDs_HSequenceOfDiscSolid; + for (Standard_Integer i = 1; i<= locSeq->Length(); i++) + { + + TopoDS_Solid tmpSol = TopoDS::Solid(locSeq->Value(i)); + + //check size of decomposed monster void + GProp_GProps volProp; + BRepGProp::VolumeProperties(tmpSol,volProp); + if(volProp.Mass() < myMinVolume) + { + tmpVVoid->Clear(); + break; + } + + McCadDiscDs_DiscSolid aVSol; + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(i); + // voxelize + McCadDiscretization_Solid theDiscer(aVSol); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + if(theDiscer.IsDone()) + { + tmpVVoid->Append(theDiscer.GetSolid()); + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Voxelization of a predecomposition Void failed.", + McCadMessenger_ErrorMsg); + + } + + if(tmpVVoid->Length() > 1) + { + myVVoids->Remove(itv); + itv--; // delete the current monster void + myVVoids->Append(tmpVVoid); + } + } + else if(aVol > myMinVolume) // make sure voids don't get too many and too small + { + // The idea was to cut monster voids along bisectioning planes of the bounding box + // the results are not good :( !!! + + /*STEPControl_Writer wrt; + wrt.Transfer(aVoidSolid, STEPControl_AsIs); + for(int i=1; i<=tmpVSol->Length(); i++) + wrt.Transfer(tmpVSol->Value(i).GetSolid(), STEPControl_AsIs); + wrt.Write("Monster.stp"); + exit(-1);*/ + +/* cout << "Performing bisectioning...\n"; + + STEPControl_Writer wrt; + for(int i=1; i<=tmpVSol->Length(); i++) + wrt.Transfer(tmpVSol->Value(i).GetSolid(), STEPControl_AsIs); + wrt.Write("bisectioning.stp"); + + + tmpVCutFace->Clear(); + + for(Standard_Integer i=1; i<=locSeq->Length(); i++) // max 1 + { + BRepBndLib boxExpander; + Bnd_Box tmpBox; + boxExpander.Add(locSeq->Value(i), tmpBox); + + Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax; + tmpBox.SetGap(0.0); + tmpBox.Get(aXMin, aYMin, aZMin, aXMax, aYMax, aZMax); + + // define points + gp_Pnt p1, p2, p3, p4; + + // make planes + // z half + p1 = gp_Pnt(aXMax, aYMin, (aZMin+aZMax)/2.0 ); + p2 = gp_Pnt(aXMax, aYMax, (aZMin+aZMax)/2.0 ); + p3 = gp_Pnt(aXMin, aYMax, (aZMin+aZMax)/2.0 ); + p4 = gp_Pnt(aXMin, aYMin, (aZMin+aZMax)/2.0 ); + TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(p1, p2).Edge(); + TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(p2, p3).Edge(); + TopoDS_Edge e3 = BRepBuilderAPI_MakeEdge(p3, p4).Edge(); + TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(p4, p1).Edge(); + TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(e1, e2, e3, e4).Wire(); + TopoDS_Face aFace = BRepBuilderAPI_MakeFace(aWire, Standard_True).Face(); + + McCadDiscDs_DiscFace theDFace; + theDFace.SetFace(aFace); + + McCadDiscretization_Face theDiscer(theDFace); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()) + tmpVCutFace->Append(theDiscer.GetFace()); + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!"); + + + // y half + p1 = gp_Pnt(aXMax, (aYMin+aYMax)/2.0, aZMin ); + p2 = gp_Pnt(aXMin, (aYMin+aYMax)/2.0, aZMin ); + p3 = gp_Pnt(aXMin, (aYMin+aYMax)/2.0, aZMax ); + p4 = gp_Pnt(aXMax, (aYMin+aYMax)/2.0, aZMax ); + e1 = BRepBuilderAPI_MakeEdge(p1, p2).Edge(); + e2 = BRepBuilderAPI_MakeEdge(p2, p3).Edge(); + e3 = BRepBuilderAPI_MakeEdge(p3, p4).Edge(); + e4 = BRepBuilderAPI_MakeEdge(p4, p1).Edge(); + aWire = BRepBuilderAPI_MakeWire(e1, e2, e3, e4).Wire(); + aFace = BRepBuilderAPI_MakeFace(aWire, Standard_True).Face(); + + theDFace.SetFace(aFace); + theDiscer.SetFace(theDFace); + theDiscer.Init(); + + if(theDiscer.IsDone()) + tmpVCutFace->Append(theDiscer.GetFace()); + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!"); + + + // x half + p1 = gp_Pnt((aXMin+aXMax)/2.0, aYMin, aZMin ); + p2 = gp_Pnt((aXMin+aXMax)/2.0, aYMax, aZMin ); + p3 = gp_Pnt((aXMin+aXMax)/2.0, aYMax, aZMax ); + p4 = gp_Pnt((aXMin+aXMax)/2.0, aYMin, aZMax ); + e1 = BRepBuilderAPI_MakeEdge(p1, p2).Edge(); + e2 = BRepBuilderAPI_MakeEdge(p2, p3).Edge(); + e3 = BRepBuilderAPI_MakeEdge(p3, p4).Edge(); + e4 = BRepBuilderAPI_MakeEdge(p4, p1).Edge(); + aWire = BRepBuilderAPI_MakeWire(e1, e2, e3, e4).Wire(); + aFace = BRepBuilderAPI_MakeFace(aWire, Standard_True).Face(); + + theDFace.SetFace(aFace); + theDiscer.SetFace(theDFace); + theDiscer.Init(); + + if(theDiscer.IsDone()) + tmpVCutFace->Append(theDiscer.GetFace()); + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!"); + } + + int maxNbDec=3; + locSeq = GoDecompose(locSeq,tmpVCutFace,maxNbDec); + + if(locSeq->Length() > 1) + { + cout << " Monster Void expanded to Voids: " << locSeq->Length() << endl; + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpVVoid = new McCadDiscDs_HSequenceOfDiscSolid; + for (Standard_Integer i = 1; i<= locSeq->Length(); i++) + { + + TopoDS_Solid tmpSol = TopoDS::Solid(locSeq->Value(i)); + + //check size of decomposed monster void + GProp_GProps volProp; + BRepGProp::VolumeProperties(tmpSol,volProp); + if(volProp.Mass() < myMinVolume) + { + tmpVVoid->Clear(); + break; + } + + McCadDiscDs_DiscSolid aVSol; + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(i); + // voxelize + McCadDiscretization_Solid theDiscer(aVSol); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + if(theDiscer.IsDone()) + { + tmpVVoid->Append(theDiscer.GetSolid()); + } + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Voxelization of a predecomposition Void failed."); + + } + + if(tmpVVoid->Length() > 1) + { + myVVoids->Remove(itv); + itv--; // delete the current monster void + myVVoids->Append(tmpVVoid); + } + } + else + msgr.Warning("_#_McCadMcVoid_Generator.cxx :: Can't expand Monster Void!"); +*/ + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Can't expand Monster Void!", + McCadMessenger_WarningMsg); + } + cout << endl << locSeq->Length() << endl; + cout << " end... Processing Monster Void ...end " << endl; + } + + } + + if(getenv("MCCAD_WRITE_VOIDS") != NULL) + { + + STEPControl_Writer stpWrtr; + for(int p=1; p<=myVVoids->Length(); p++) + stpWrtr.Transfer(myVVoids->Value(p).GetSolid(), STEPControl_AsIs); + + stpWrtr.Write("mc_Void_Cells.stp"); + } + + cout<< "\n====================================================== " << endl; + cout<< "End checking voids against solids \n" << endl; + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// +} + + +void McCadMcVoid_Generator::VoidVoxelization(Handle(TopTools_HSequenceOfShape)& voidSolids) +{ + +} + +//Standard_Boolean McCadMcVoid_Generator::FacesIntersect(TopoDS_Shape shp1, TopoDS_Shape shp2) +Standard_Boolean McCadMcVoid_Generator::FacesIntersect(TopoDS_Shape& shp1, TopoDS_Shape& shp2) +{ + Standard_Boolean collides(Standard_False); + TopOpeBRep_ShapeIntersector shapeIntersector; + IntTools_FaceFace ffIntersector; + + for(TopExp_Explorer faceExp1(shp1, TopAbs_FACE); faceExp1.More(); faceExp1.Next()) + { + TopoDS_Face face1 = TopoDS::Face(faceExp1.Current()); + + for(TopExp_Explorer faceExp2(shp2, TopAbs_FACE); faceExp2.More(); faceExp2.Next()) + { + TopoDS_Face face2 = TopoDS::Face(faceExp2.Current()); + + shapeIntersector.InitIntersection(face1, face2); + + if(shapeIntersector.MoreIntersection()) + { + //cout << "\n\n----------------------------------\nCollision Detected\n----------------------------------\n\n"; + if(shapeIntersector.ChangeFacesIntersector().IsEmpty()) + { + // test if faces overlapp + // voxelize faces + TopoDS_Face theFace(TopoDS::Face(face1)); + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + BRepClass_FaceClassifier bsc3d; + + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; + + BRepAdaptor_Curve2d curveAdaptor; + for(TopExp_Explorer edgeExp(theFace, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) + { + curveAdaptor.Initialize(TopoDS::Edge(edgeExp.Current()), theFace); + Standard_Real frstParam, lstParam; + frstParam = (!(Precision::IsNegativeInfinite(curveAdaptor.FirstParameter()))) ? curveAdaptor.FirstParameter() : -1.0; + lstParam = (!(Precision::IsPositiveInfinite(curveAdaptor.LastParameter()))) ? curveAdaptor.LastParameter() : 1.0; + + // ignore edges + frstParam += 1.0e-5; + lstParam -= 1.0e-5; + + for (int i=1; i<=100; i++) + { + Standard_Real a = Standard_Real(i)/100.; + Standard_Real par = (1.0-a)*frstParam + a*lstParam; + gp_Pnt2d p2 = curveAdaptor.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + // exclude edges + if(U < uMean) + U += 1.e-5; + else if(U > uMean) + U -= 1.e-5; + if(V < vMean) + V += 1.e-5; + else if(V > vMean) + V -= 1.e-5; + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bsc3d.Perform(theFace, p2, myTolerance); + + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON) + thePntSeq->Append(p1); + } + + theFace = TopoDS::Face(face2); + + int cnt(0); + for(int i=1; i<=thePntSeq->Length(); i++) + { + bsc3d.Perform(theFace, thePntSeq->Value(i), 1.0e-7); + if( bsc3d.State() == TopAbs_IN ) + { + cnt++; + if(cnt >= 3) + break; + } + } + + if(cnt >= 3) // overlapp !!! + { + collides = true; + break; + } + } + } + else + { + ffIntersector.Perform(face1, face2); + + if(!ffIntersector.IsDone()) + return Standard_True; + + if(ffIntersector.Lines().Length() < 1) + return Standard_False; + + /* IntTools_SequenceOfCurves intCurves; + intCurves = ffIntersector.Lines(); + + cout << "Number of Intersection Lines : " << intCurves.Length() << endl; + + Standard_Boolean notAnEdge(Standard_False); + + for(Standard_Integer i=1; i<=intCurves.Length(); i++) + { + Standard_Boolean hitEdge(Standard_False); + IntTools_Curve curIntCurve = intCurves.Value(i); + Standard_Real first, last; + gp_Pnt pnt_f, pnt_l; + curIntCurve.Bounds(first, last, pnt_f, pnt_l); + Handle(Geom_Curve) aCurve = curIntCurve.Curve(); + + TopoDS_Edge intEdge = BRepBuilderAPI_MakeEdge(aCurve, pnt_f, pnt_l).Edge(); + + for(TopExp_Explorer edgeExp1(face1, TopAbs_EDGE); edgeExp1.More(); edgeExp1.Next()) + { + if(TopoDS::Edge(edgeExp1.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(hitEdge) + { + cout << "HIT EDGE\n"; + continue; + } + + for(TopExp_Explorer edgeExp2(face2, TopAbs_EDGE); edgeExp2.More(); edgeExp2.Next()) + { + if(TopoDS::Edge(edgeExp2.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(hitEdge) + { + cout << "HIT EDGE\n"; + return Standard_False; + } + } + + + cout << "TRUE THE HARD WAY\n\n";*/ + + collides = true; + break; + } + } + } + + if(collides) + break; + } + + + + + /* + Handle(TColgp_HSequenceOfPnt) solidVoxelPoints = solidDS.GetVoxel(); + Handle(TColgp_HSequenceOfPnt) voidVoxelPoints = voidDS.GetVoxel(); + + // without forward check goes here!!!! Wed Nov 16 17:20:27 CET 2005 + /////////////////////////////////////////////////////////////////////// + // forward check + BRepClass3d_SolidClassifier solidClassifier (solidDS.GetSolid()); + BRepClass3d_SolidClassifier voidClassifier (voidDS.GetSolid()); + + for(Standard_Integer i=1; i<=solidVoxelPoints->Length(); i++) + { + voidClassifier.Perform(solidVoxelPoints->Value(i), 1.0e-7); + if(voidClassifier.State() == TopAbs_IN) + return Standard_True; + } + + for(Standard_Integer i=1; i<=voidVoxelPoints->Length(); i++) + { + solidClassifier.Perform(voidVoxelPoints->Value(i), 1.0e-7); + if(solidClassifier.State() == TopAbs_IN) + return Standard_True; + } + + return Standard_False;*/ + + /////////////////////////////////////////////////////////////////////////////////////////////// + + + +/* Handle(TColgp_HSequenceOfPnt) seamPointsOfSolid1 = new TColgp_HSequenceOfPnt(); + Handle(TColgp_HSequenceOfPnt) seamPointsOfSolid2 = new TColgp_HSequenceOfPnt(); + + BRepClass_FaceClassifier bfc3d; + + BRepAdaptor_Curve2d curveAdaptor; + + for(TopExp_Explorer faceExp1(shp1, TopAbs_FACE); faceExp1.More(); faceExp1.Next()) + { + TopoDS_Face face1 = TopoDS::Face(faceExp1.Current()); + BRepAdaptor_Surface BS(face1, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; + + for(TopExp_Explorer edgeExp(face1, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) + { + curveAdaptor.Initialize(TopoDS::Edge(edgeExp.Current()), face1); + Standard_Real frstParam, lstParam; + frstParam = (!(Precision::IsNegativeInfinite(curveAdaptor.FirstParameter()))) ? curveAdaptor.FirstParameter() : -1.0; + lstParam = (!(Precision::IsPositiveInfinite(curveAdaptor.LastParameter()))) ? curveAdaptor.LastParameter() : 1.0; + + // ignore edges + // frstParam += 1.0e-5; + // lstParam -= 1.0e-5; + + for (int i=1; i<=100; i++) + { + Standard_Real a = Standard_Real(i)/100.; + Standard_Real par = (1.0-a)*frstParam + a*lstParam; + gp_Pnt2d p2 = curveAdaptor.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + // exclude edges + if(U < uMean) + U += 1.e-5; + else if(U > uMean) + U -= 1.e-5; + if(V < vMean) + V += 1.e-5; + else if(V > vMean) + V -= 1.e-5; + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bfc3d.Perform(face1, p2, myTolerance); + + if (bfc3d.State() == TopAbs_IN || bfc3d.State() == TopAbs_ON) + seamPointsOfSolid1->Append(p1); + } + } + + for(TopExp_Explorer faceExp2(shp2, TopAbs_FACE); faceExp2.More(); faceExp2.Next()) + { + TopoDS_Face face2 = TopoDS::Face(faceExp2.Current()); + BRepAdaptor_Surface BS(face2, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + Handle(TColgp_HSequenceOfPnt) seamVoxelPntsOfFace2 = new TColgp_HSequenceOfPnt(); + + for(TopExp_Explorer edgeExp(face1, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) + { + curveAdaptor.Initialize(TopoDS::Edge(edgeExp.Current()), face2); + Standard_Real frstParam, lstParam; + frstParam = (!(Precision::IsNegativeInfinite(curveAdaptor.FirstParameter()))) ? curveAdaptor.FirstParameter() : -1.0; + lstParam = (!(Precision::IsPositiveInfinite(curveAdaptor.LastParameter()))) ? curveAdaptor.LastParameter() : 1.0; + + // ignore edges + // frstParam += 1.0e-5; + // lstParam -= 1.0e-5; + + for (int i=1; i<=100; i++) + { + Standard_Real a = Standard_Real(i)/100.; + Standard_Real par = (1.0-a)*frstParam + a*lstParam; + gp_Pnt2d p2 = curveAdaptor.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + // exclude edges + if(U < uMean) + U += 1.e-5; + else if(U > uMean) + U -= 1.e-5; + if(V < vMean) + V += 1.e-5; + else if(V > vMean) + V -= 1.e-5; + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bfc3d.Perform(face2, p2, myTolerance); + + if (bfc3d.State() == TopAbs_IN || bfc3d.State() == TopAbs_ON) + seamPointsOfSolid2->Append(p1); + } + } + } + } + + + // classify seam points + BRepClass3d_SolidClassifier solidClassifier; + solidClassifier.Load(shp2); + + for(Standard_Integer i=1; i<=seamPointsOfSolid1->Length(); i++) + { + solidClassifier.Perform(seamPointsOfSolid1->Value(i), 1.e-6); + + if(solidClassifier.State() == TopAbs_IN) + return Standard_True; + } + + solidClassifier.Load(shp1); + + for(Standard_Integer i=1; i<=seamPointsOfSolid2->Length(); i++) + { + if(solidClassifier.State() == TopAbs_IN) + return Standard_True; + } +*/ + + +/* ffIntersector.Perform(face1, face2); + + if(!ffIntersector.IsDone()) // something went wrong + return Standard_True; + + + if(ffIntersector.Lines().Length() > 0) + { + + IntTools_SequenceOfCurves intCurves; + intCurves = ffIntersector.Lines(); + + cout << "Number of Intersection Lines : " << intCurves.Length() << endl; + + Standard_Boolean notAnEdge(Standard_False); + + for(Standard_Integer i=1; i<=intCurves.Length(); i++) + { + Standard_Boolean hitEdge(Standard_False); + IntTools_Curve curIntCurve = intCurves.Value(i); + Standard_Real first, last; + gp_Pnt pnt_f, pnt_l; + curIntCurve.Bounds(first, last, pnt_f, pnt_l); + Handle(Geom_Curve) aCurve = curIntCurve.Curve(); + + TopoDS_Edge intEdge = BRepBuilderAPI_MakeEdge(aCurve, pnt_f, pnt_l).Edge(); + + STEPControl_Writer wrt; + wrt.Transfer(intEdge, STEPControl_AsIs); + wrt.Transfer(face1, STEPControl_AsIs); + wrt.Transfer(face2, STEPControl_AsIs); + wrt.Transfer(shp1, STEPControl_AsIs); + wrt.Transfer(shp2, STEPControl_AsIs); + wrt.Write("collision.stp"); + exit(-1); + + for(TopExp_Explorer edgeExp1(face1, TopAbs_EDGE); edgeExp1.More(); edgeExp1.Next()) + { + if(TopoDS::Edge(edgeExp1.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(hitEdge) + { + cout << "HIT EDGE\n"; + continue; + } + + for(TopExp_Explorer edgeExp2(face2, TopAbs_EDGE); edgeExp2.More(); edgeExp2.Next()) + { + if(TopoDS::Edge(edgeExp2.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(!hitEdge) + { + return Standard_True; + } + else + cout << "Hit Edge\n"; + } + } + else + return Standard_False; // no lines, no intersections, right? ... +*/ + + + return collides; +} + + + +////////////////////////////////////////////////////////////////// +/*+++++++++++++++++++++ GODECOMPOSE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// +Handle(TopTools_HSequenceOfShape) McCadMcVoid_Generator::GoDecompose(Handle(TopTools_HSequenceOfShape)& BoxSeq, + const Handle(McCadDiscDs_HSequenceOfDiscFace)& theVCutFace, + const Standard_Integer MaxNbVoids ) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + + cout << "\nPerforming Decomposition\n=========================" << endl; + myPI->SetStep(30./theVCutFace->Length()); + + Standard_Real numOfCutFaces = theVCutFace->Length(); + + +// PERFORM CUTTING FOR ALL CUT FACES +////////////////////////////////////// + for (int fit = 1; fit <= numOfCutFaces; fit++) + { + if (BoxSeq->Length() >= MaxNbVoids ) + { + // this happens if saturation is achived ahead of end of the cutseq! legitimate situation + cout << " Cut processing is finished due to reaching maximum Number of Decomposition at : " << fit << endl; + cout << " maximum Number of Decompositions: " << MaxNbVoids << endl; + break; + } + + if (BoxSeq->Length() == 0) + { + // this happens if saturation is achived ahead of end of the cutseq! legitimate situation + cout << "************************************************************************************* " << endl; + cout << " Cut Processing is finished due to saturation at cut sequence number " << fit << endl; + cout << "************************************************************************************* " << endl; + } + + cout << "." << flush; +// cout << " Start Processing Face " << fit << " of " << numOfCutFaces << endl; + + TopoDS_Shape CutFaceSolid = theVCutFace->Value(fit).GetFace(); + Bnd_Box theBB = theVCutFace->Value(fit).GetBBox(); + + Handle(TopTools_HSequenceOfShape) tmpBoxSeq = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) locBoxSeq = new TopTools_HSequenceOfShape(); + + // search for sign changing cut faces + //////////////////////////////////////// + for (Standard_Integer j=1; j<= BoxSeq->Length(); j++)//For all Shapes in BoxSeq + { + TopoDS_Solid aSol = TopoDS::Solid(BoxSeq->Value(j)); + + Bnd_Box aBB; + BRepBndLib::Add(aSol,aBB); + aBB.SetGap(0.0); + if(aBB.IsOut(theBB) && theBB.IsOut(aBB)) + { + locBoxSeq->Append(aSol); + continue; + } + + //////////////////////////////////////////////////////////////////////////////// + // if identical surface as bounding surface of void -> skip cutting + /* bool isSame(false); + for(TopExp_Explorer ex(aSol, TopAbs_FACE); ex.More(); ex.Next()) + { + Handle(TopTools_HSequenceOfShape) shapes; + TopoDS_Face curFace = TopoDS::Face(ex.Current()); + + shapes->Append(curFace); + shapes->Append(CutFaceSolid); + shapes = McCadMcVoid::DeleteOne(shapes); + + if(shapes->Length() != 2) + { + locBoxSeq->Append(aSol); + isSame = true; + break; + } + } + if(isSame) + continue;*/ + +// cout << j << "<<<<<<<" << endl; +//TODO more specific testing if plane interferes with solid volume +/* BRepClass3d_SolidClassifier solidClassifier (aSol); + Standard_Integer inPnts(0), outPnts(0); + + for(TopExp_Explorer vExp(CutFaceSolid); vExp.More(); vExp.Next()) + { + TopoDS_Vertex curV = TopoDS::Vertex(vExp.Current()); + gp_Pnt curPnt = BRep_Tool::Pnt(curV); + // check for all vertices!!! + + solidClassifier.Perform(curPnt, 1.0e-7); + if(solidClassifier.State() == TopAbs_IN && solidClassifier.State() != TopAbs_ON && solidClassifier.State() != TopAbs_OUT) + inPnts++; + else + outPnts++; + } + + if(inPnts == 0) + { + locBoxSeq->Append(aSol); + cout << "CONTINUE\n"; + continue; + }*/ +//#TODO + ///////////////////////////////////////////////////////////////////// + + + // if (McCadMcVoid::SignChanging(aSol, theVCutFace->Value(fit))) + if (PolyhedralOverlap(CutFaceSolid, aSol)) + tmpBoxSeq->Append(aSol); + else + locBoxSeq->Append(aSol); + } + + BoxSeq->Clear(); + BoxSeq->Append(locBoxSeq); + //////////////////////////////////////////////////////////////////////////////////////////// + + + if(tmpBoxSeq->Length() == 0) + { +// cout << " End Processing face " << fit << "\n" << endl; + continue; + } + + + // CALL DECOMPOSE + ////////////////////////////////////////// + Handle(TopTools_HSequenceOfShape) uniBoxSeq = Decompose(tmpBoxSeq,CutFaceSolid); //cut tmpBoxSeq, along CutFaceSolid and return resulting solid + + //check again if cutted model is valid, append valid boxes to BoxSeq + /////////////////////////////////////////////////////////////////////////////////////////////// + for(int k=1; k<=uniBoxSeq->Length(); k++) + { + TopoDS_Shape aSol = uniBoxSeq->Value(k); + for (TopExp_Explorer exs(aSol,TopAbs_SHELL);exs.More();exs.Next()) + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + ////////////////////////////////////////////////////////////////////////// + BRepCheck_Shell shellCheck(sh); + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) + { + BRepBuilderAPI_MakeSolid Bu(sh); + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + if(!aSolid.IsNull()) + BoxSeq->Append(aSolid); + } + } + else + msgr->Message("Model may be invalid!! ", + McCadMessenger_WarningMsg); + } + } + +// cout << " End Processing face " << fit << "\n" << endl; + + if(myPI->UserBreak()) + return NULL; + myPI->Increment(); + } + cout << "\n=========================\nDecomposition finished\n" << endl; + + return BoxSeq; +} + + +////////////////////////////////////////////////////////////////// +/*+++++++++++++++++++++++ DECOMPOSE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// + +Handle(TopTools_HSequenceOfShape) McCadMcVoid_Generator::Decompose(Handle(TopTools_HSequenceOfShape)& tmpBoxSeq, TopoDS_Shape& aFaceSolid) +{ + // the heart of void the generation algorithm!! + // keep it simple and robust; it should work thousandfold !! + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + + Handle(TopTools_HSequenceOfShape) uniBoxSeq = new TopTools_HSequenceOfShape(); + + // redefine MakeHalfSpace, to make pseudo Half-Space with suitable size. Define bounding values by boxes to cut... + // this increases the chance of validity of boolean operations and reduces computation time during + // boolean operations, which are known to work slowly. + Bnd_Box tmpBox; + for(int cnt=1; cnt<=tmpBoxSeq->Length(); cnt++) + BRepBndLib::Add(tmpBoxSeq->Value(cnt), tmpBox); + + tmpBox.SetGap(10.); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + tmpBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + TopoDS_Shape tmpS1; + TopoDS_Shape polSol1; + + TopoDS_Shape oldSol1 = McCadMcVoid::MakeHalfSpace(aFaceSolid, theLPnt, theUPnt); //half space created by theVFace-member (aFaceSolid) + +//////////////////////////////////////////////////////////////// +// process all solids in the void box sequence + for (int kt=1; kt<=tmpBoxSeq->Length(); kt++) + { + polSol1 = tmpBoxSeq->Value(kt); //polSol1 + + Standard_Boolean bOp = Standard_False; + Standard_Boolean small = Standard_False; + + /////////////////////////////////////////////////////////////// + // discard small volumes from cutting + GProp_GProps GP1; + BRepGProp::VolumeProperties(polSol1,GP1); + + if (GP1.Mass() < myMinVolume) + { + // cout << "Small Box Cutting discarded .... " << kt << endl; + uniBoxSeq->Append(polSol1); + continue; + } + + +/////////////////////////////////////////////////////////////// +// Compute Common part + + TopoDS_Shape bopShp1 = polSol1; + TopoDS_Shape bopShp2 = oldSol1; + + // This will speed up the boolean operations!!! + /*qiu BOPTools_DSFiller aDF; + aDF.SetShapes (bopShp1, bopShp2); + if(!aDF.IsDone()) + { + cout << "_#_McCadMcVoid_Generator.cxx :: ERROR!!! Could not init DSFiller!!!\n"; + uniBoxSeq->Append(polSol1); + continue; + } + + try + { + aDF.Perform(); + } + catch(...) + { + uniBoxSeq->Append(polSol1); + continue; + } +*/ + ////// + // perform boolean common operation + try + { + //qiu BRepAlgoAPI_Common aCommonOp(bopShp1, bopShp2, aDF); + BRepAlgoAPI_Common aCommonOp(bopShp1, bopShp2); + if(aCommonOp.BuilderCanWork() && aCommonOp.ErrorStatus() == 0 ) + { + if(aCommonOp.IsDone()) + { + bOp = Standard_True; + tmpS1 = aCommonOp.Shape(); //tmpS1 now is the common shape of half space oldSol and tmpBoxSeq(kt) + } + else + { + bOp = Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Boolean Operation on a halfspace has failed !!!", + McCadMessenger_WarningMsg); + } + } + else + bOp = Standard_False; + + } + catch(...) + { + bOp = Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Boolean Operation on a halfspace has failed (OCC Input?) !!!", + McCadMessenger_WarningMsg); + } + + + if(!bOp) + { + uniBoxSeq->Append(polSol1); + continue; + } + + /////////////////////////////////////////////////////////////////////////////////// + // Test for validity of Common Operation + if (tmpS1.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Null solid computed !!! ", + McCadMessenger_WarningMsg); + bOp = Standard_False; + + cout << "Cutting discarded .... " << kt << endl; + uniBoxSeq->Append(polSol1); + continue; + } + + if(!bOp) + { + uniBoxSeq->Append(polSol1); + continue; + } + + // Test for valid solids in computed shape + TopoDS_Shape& aShape = tmpS1; + BRepCheck_Analyzer BA(aShape,Standard_False); + + BA.Init(aShape,Standard_False); + if(!BA.IsValid()) + { + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for solid failed !!", + McCadMessenger_WarningMsg); + uniBoxSeq->Append(polSol1); + continue; + } + } + + int sCount=0; + + for (TopExp_Explorer ex(aShape,TopAbs_SOLID);ex.More();ex.Next()) //For all Solids in Common Shape check for validity + { + sCount++; + const TopoDS_Solid& solid = TopoDS::Solid(ex.Current()); + + if(solid.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BOP for solid failed: NULL SOLID computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + + for (TopExp_Explorer exs(solid,TopAbs_SHELL);exs.More();exs.Next()) //For all Shells in current Solid check if orientable + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + BA.Init(sh,Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + // BRepCheck::Print(iter.Value(),cout); + if( iter.Value() == BRepCheck_UnorientableShape) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for shell failed: unorientable shape!!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + + if(!BA.IsValid()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for shell failed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + } + + if(sCount!=1) // we take only one solid + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Compound containing no solid computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + + + if(!bOp) + { + uniBoxSeq->Append(polSol1); + continue; + } + + //////////////////////////////////////////////// + // See if Shell is closed + Standard_Real theVol(0.0); + if (bOp) + { + for (TopExp_Explorer exs(aShape,TopAbs_SHELL);exs.More();exs.Next()) //For all Shells of aShape ... + { + TopoDS_Shell tmpShell = TopoDS::Shell(exs.Current()); + ////////////////////////////////////////////////////////////////////////// + BRepCheck_Shell shellCheck(tmpShell); + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) // check if Shell is closed + { + BRepBuilderAPI_MakeSolid Bu(tmpShell); //Build a Solid + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + + if(!aSolid.IsNull()) + { + //reject to thin solids + Bnd_Box theBB; + BRepBndLib::Add(aSolid, theBB); + if(theBB.IsXThin(0.5) || theBB.IsYThin(0.5) || theBB.IsZThin(0.5)) + { + small = Standard_True; + + cout << "IS THIN\n"; + break; + } + + GProp_GProps GP2; + // BRepGProp::VolumeProperties(polSol1,GP1); + BRepGProp::VolumeProperties(aSolid,GP2); + + // cout << "MYMINVOLUME : " << myMinVolume << " -- GP1.Mass() : " << GP1.Mass() << " -- GP2.Mass() : " << GP2.Mass() << endl; + + if (GP2.Mass() >= myMinVolume) // > resolution ^3 + uniBoxSeq->Append(aSolid); // big volume case + else + { + theVol = GP2.Mass(); + cout << "Cutting discarded .... small volume " << kt << endl; + cout << "Volume-Fraction : " << GP2.Mass()/GP1.Mass() << endl; + small = Standard_True; + break; + } + } + } + } + else + { + //try to repair open shell + if (shellCheck.Closed(Standard_False) == BRepCheck_NotClosed) + { + ShapeUpgrade_ShellSewing tailor; + TopoDS_Shape resultShp = tailor.ApplySewing(tmpShell, 1e-7); + + for (TopExp_Explorer shellExpl(resultShp, TopAbs_SHELL); shellExpl.More(); shellExpl.Next()) //For all Shells of aShape ... + { + TopoDS_Shell tmpShll = TopoDS::Shell(shellExpl.Current()); + BRepCheck_Shell shellCheck1(tmpShll); + if (shellCheck1.Closed(Standard_False) == BRepCheck_NoError) // check if Shell is closed + { + BRepBuilderAPI_MakeSolid sldMkr(tmpShll); + if(sldMkr.IsDone()) + uniBoxSeq->Append(sldMkr.Solid()); + else + { + cout << "* Warning: SubModel may be invalid!* " << endl; + uniBoxSeq->Append(polSol1); + continue; + } + } + else + { + cout << "* Warning: SubModel may be invalid!* " << endl; + uniBoxSeq->Append(polSol1); + continue; + } + } + } + else + { + cout << "************************************ " << endl; + cout << "* Warning: SubModel may be invalid!* " << endl; + cout << "************************************ " << endl; + + uniBoxSeq->Append(polSol1); + continue; + } //tst + } + } + } + else + { + cout << "Cutting discarded .... " << kt << endl; + uniBoxSeq->Append(polSol1); + continue; + } + + + if(small || uniBoxSeq->Length() < 1) + { + uniBoxSeq->Append(polSol1); + cout << "Putting back .... small volume " << kt << " ### Volume : " << theVol << endl; + continue; + } + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +// compute the cut part + bOp = Standard_False; + + // CUTMASTER: + try //Perform Cutting + { +//qiu BRepAlgoAPI_Cut aCutOp(bopShp1,bopShp2, aDF); + BRepAlgoAPI_Cut aCutOp(bopShp1,bopShp2); + + if(aCutOp.BuilderCanWork() && aCutOp.ErrorStatus() == 0 ) + { + Standard_Boolean done = Standard_False; + + try + { + done = aCutOp.IsDone(); + } + catch(...) + { + continue; + } + + if(done) + { + bOp= Standard_True; + tmpS1 = aCutOp.Shape(); + } + else + { + bOp= Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Boolean Cut Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + } + } + else + bOp = Standard_False; + } + catch(...) + { + bOp = Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Cut Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + } + + if (tmpS1.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Null solid computed !!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + + TopoDS_Shape& acShape = tmpS1; + + BRepCheck_Analyzer BAc(acShape,Standard_False); + + sCount=0; + + for (TopExp_Explorer ex(acShape,TopAbs_SOLID);ex.More();ex.Next()) //For all Shapes of cutted Solid... + { + sCount++; + const TopoDS_Solid& aSolo = TopoDS::Solid(ex.Current()); + if(aSolo.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BOP for solid failed: NULL SOLID computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + + for (TopExp_Explorer exs(aSolo,TopAbs_SHELL);exs.More();exs.Next()) // check Validity + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + BAc.Init(sh,Standard_False); + Handle(BRepCheck_Result) RES = BAc.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + // BRepCheck::Print(iter.Value(),cout); + if( iter.Value() == BRepCheck_UnorientableShape) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer : Unorientable Shape!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + BAc.Init(sh,Standard_False); + break; + } + } + + if(BAc.IsValid()); + else + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for shell failed !!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + } + + BAc.Init(acShape,Standard_False); + if(!BAc.IsValid()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for solid failed !!!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + if(sCount==0) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Compound contains no solids!!", + McCadMessenger_WarningMsg); + /* STEPControl_Writer wrt; + wrt.Transfer(polSol1, STEPControl_AsIs); + wrt.Transfer(aFaceSolid, STEPControl_AsIs); + wrt.Write("failed.stp"); + exit(0);*/ + bOp = Standard_False; + } + //////////////////////////////////////////////// + // No Tolerance correction + if(bOp) + { + GProp_GProps GP2; + BRepGProp::VolumeProperties(acShape,GP2); + + if (GP2.Mass() >= myMinVolume) // > resolution ^3 + uniBoxSeq->Append(acShape); // big volume case + else + { + uniBoxSeq->Remove(uniBoxSeq->Length()); + uniBoxSeq->Append(polSol1); + TCollection_AsciiString msg("_#_McCadMcVoid_Generator.cxx :: Cut Processing void box number .... "); + msg += TCollection_AsciiString(kt); + msg += " .... failed."; + msgr->Message( msg.ToCString(), McCadMessenger_WarningMsg ); + } + } + else + { + // delet the common part and append the original box. + uniBoxSeq->Remove(uniBoxSeq->Length()); + uniBoxSeq->Append(polSol1); + TCollection_AsciiString msg("_#_McCadMcVoid_Generator.cxx :: Cut Processing void box number .... "); + msg += TCollection_AsciiString(kt); + msg += " .... failed."; + msgr->Message( msg.ToCString(), McCadMessenger_WarningMsg ); + } + //////////////////////////////////////////////////////////////////////////////////////////////////////////// + } + + + + return uniBoxSeq; +} + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcnpWriter.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcnpWriter.cxx new file mode 100644 index 0000000..435405e --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcnpWriter.cxx @@ -0,0 +1,707 @@ +#include "McCadMcnpWriter.hxx" + +#include + +#include +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" + +McCadMcnpWriter::McCadMcnpWriter() +{ +} + +McCadMcnpWriter::~McCadMcnpWriter() +{ +} + +/** ******************************************************************** +* @brief Print the head description of Mcnp input file. +* +* @param Standard_OStream & theStream (modify) +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadMcnpWriter::PrintHeadDesc(Standard_OStream& theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream.setf(ios::left); + theStream<<"McCad 0.4.0 generated Input "<m_SolidList.size()<m_VoidCellList.size()<m_GeomSurfList.size()<GetGeomData(); + assert(pData); + + theStream<<"c "<<"=============================== Cells Card =================================="<m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + + if (m_bHaveMaterial) + { + PrintGroupInfo(i+1,theStream); + } + + theStream.setf(ios::left); + theStream<GetID(); // Output the material number. + if(!m_bHaveMaterial) + { + theStream<GetDensity(); // Output the density. + } + + TCollection_AsciiString strCellDesc; + for(int j = 0; j < pSolid->GetConvexSolidList().size(); j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //pConvexSolid->ChangeFaceNum(*m_pManager); // Update the face number after sorting + + if ( j == 0 ) + { + strCellDesc += "("; + } + else + { + strCellDesc += ":("; + } + + strCellDesc += GetCellExpn(pConvexSolid); + strCellDesc += ")&"; + + strCellDesc.LeftAdjust(); // Trim the left and right space characters of string + strCellDesc.RightAdjust(); + } + + // Split the expression of void cell into several part according to the brackets + // and output them into different lines. + TCollection_AsciiString str_left; + TCollection_AsciiString str_right= strCellDesc; + + // If the length of expression beyond 80, then split it and print respectively. + int k = 0; + do + { + k++; + str_left = str_right; + str_right = str_left.Split(str_left.Search("&"));// & is the seperating symbol used. + str_left.Remove(str_left.Length()); + if (k == 1) + { + theStream<GetMatManager(); + assert(pMatManager); + + MaterialGroup * pGroup = pMatManager->GetGroupData(iSolid); + + if(pGroup != NULL) + { + QString groupName = pGroup->GetGroupName(); + int iMatID = pGroup->GetMaterialID(); + double fDensity = pGroup->GetDensity(); + QString materialName = pGroup->GetMaterialName(); + + int iStartNum = pGroup->GetStartNum() ; + int iEndNum = pGroup->GetEndNum(); + int iCellNum = pGroup->GetCellNum(); + + iStartNum += (m_iInitCellNum-1); + iEndNum += (m_iInitCellNum-1); + + TCollection_AsciiString group_info; + group_info = "From "; + group_info += TCollection_AsciiString(iStartNum); + group_info += " to "; + group_info += TCollection_AsciiString(iEndNum); + group_info += " , "; + group_info += TCollection_AsciiString(iCellNum); + group_info += " cells"; + int iLength = group_info.Length()%49; + + theStream<<"c "<GetGeomData(); + assert(pData); + + // Print the title of void cells geometry description. + TCollection_AsciiString void_info; + void_info = TCollection_AsciiString(int(pData->m_VoidCellList.size() + 1)) + " Cells"; + int iLength = void_info.Length()%50; + + theStream<<"c "<m_SolidList.size() + m_iInitCellNum; + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = pData->m_VoidCellList.at(i); + assert(pVoid); + + //pVoid->ChangeFaceNum(*m_pManager); // Update the surface number after sorting the surface list. + + theStream.setf(ios::left); + theStream<m_pOutVoid); + //pData->m_pOutVoid->ChangeFaceNum(*m_pManager); // Update the face number. + + theStream.setf(ios::left); + theStream<m_pOutVoid->GetOutVoidExpression()<GetGeomData(); + assert(pData); + + theStream<::iterator iterPos; + for (iterPos = pData->m_GeomSurfList.begin(); iterPos != pData->m_GeomSurfList.end(); ++iterPos) + { + IGeomFace * pFace = * iterPos; + assert(pFace); + theStream.setf(ios::left); + theStream<GetTransfNum(); // Transform card number + theStream<GetSurfSymb(); // The symbol of surface type + + // Output the each parameter of surface + theStream.setf(ios::fixed); + theStream<GetPrmtList()).size(); i++ ) + { + if ( i%4 == 0 && i != 0 ) + { + theStream<GetPrmtList().at(i)<<" "; + } + theStream<GetGeomData(); + assert(pData); + + vector::iterator iter; + for (iter = pData->m_TransfCardList.begin(); iter != pData->m_TransfCardList.end(); ++iter) + { + McCadTransfCard * pTrCard = * iter; + assert(pTrCard); + + theStream<<"TR"<GetTrNum(); + + theStream.unsetf(ios::fixed); + for (Standard_Integer i = 0; i < (pTrCard->GetPrmtList()).size(); i++ ) + { + if ( i%4 == 0 && i != 0 ) + { + theStream<GetPrmtList()).at(i); + } + theStream<GetMatManager(); + assert(pMatManager); + + Material * pMat = NULL; + vector material_list = pMatManager->GetMatList(); + + for(int i = 0; i < material_list.size(); i++) + { + pMat = material_list.at(i); + + theStream<<"c "<GetMatID()<<"|"<GetMatName().toStdString()<<"|"<GetMatDensity()<<"|"<GetMatCard(); + QStringList list; + list = strMatCard.split("\n"); + + bool bPrintMatID = false; // The material id has been printed or not + + for (int j = 0; j < list.size(); j++) + { + QString str = list.at(j).trimmed(); + if (str.startsWith("c ")||(str == "c") + ||str.startsWith("C ")||(str == "C")) + { + theStream<GetMatID()<GetFaces()).size(); i++) + { + + McCadExtFace * pExtFace = (pSolid->GetFaces()).at(i); + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + iStrLength += TCollection_AsciiString(iFaceNum).Length(); + + /***************** the length of cell expression can not be larger than 80 *******/ + /***************** & is used for splitting the expression ************************/ + if (iStrLength >= 80) + { + szExpression += "&"; + iStrLength = 20 + TCollection_AsciiString(iFaceNum).Length(); + } + else + { + szExpression += " "; + iStrLength ++; + } + /**********************************************************************************/ + + szExpression += TCollection_AsciiString(iFaceNum); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + } + + szExpression += " "; + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + + // Avoid the length of expression beyond 80 + iStrLength += szAuxFaceSub.Length(); + if (iStrLength >= 80) + { + szExpression += "&"; + iStrLength = 20; + } + + szExpression += szAuxFaceSub; + szExpression += " "; + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + + // Avoid the length of expression beyond 80 + iStrLength += szAuxFaceUni.Length(); + if (iStrLength >= 80) + { + szExpression += "&"; + iStrLength = 20; + } + + if (szAuxFaceUni.Search(":") != -1 ) + { + szExpression += "("; + szExpression += szAuxFaceUni; + szExpression += ") "; + } + else + { + szExpression += szAuxFaceUni; + } + } + + szExpression.LeftAdjust(); + szExpression.RightAdjust(); + + return szExpression; +} + + + + + + +/** ******************************************************************** +* @brief Get the void spaces description +* +* @param +* @return TCollection_AsciiString +* +* @date 16/12/2013 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadMcnpWriter::GetVoidExpn(McCadVoidCell *& pVoidCell) +{ + TCollection_AsciiString szExpn; + szExpn += "("; + int iInitSurfNum = m_iInitFaceNum - 1; + for (Standard_Integer i = 0; i < (pVoidCell->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pVoidCell->GetFaces()).at(i); + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + szExpn += TCollection_AsciiString(iFaceNum); + szExpn += " "; + } + szExpn.Remove(szExpn.Length()); // Remove the last character " " + szExpn += ")"; + szExpn += "&"; + + int iStrLength; //initial string for describing the cell no and material + + for (Standard_Integer i = 0; i < (pVoidCell->GetCollision()).size(); i++) + { + COLLISION collision = (pVoidCell->GetCollision()).at(i); + iStrLength = 12; //initial string for describing the cell no and material + szExpn += "("; + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + int iCollidFaceNum = collision.FaceList.at(j); + iCollidFaceNum > 0 ? iCollidFaceNum += iInitSurfNum : iCollidFaceNum -= iInitSurfNum; + + int iNum = -1*(iCollidFaceNum); + + /**************** Avoid the length of expression beyond 80 column ***********/ + iStrLength += TCollection_AsciiString(iNum).Length(); // Add the length of number + iStrLength += 1; // Add the length of ":" + if (iStrLength >= 79) + { + szExpn += "&"; + iStrLength = 11 + TCollection_AsciiString(iNum).Length(); + } + /****************************************************************************/ + + szExpn += TCollection_AsciiString(iNum); + szExpn += ":"; + } + + for (Standard_Integer k = 0; k < (collision.AuxFaceList).size(); k++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(k); + if ( auxiliary_face_list.size() > 1) + { + szExpn += "("; + } + + for (Standard_Integer iAux = 0; iAux < auxiliary_face_list.size(); iAux++) + { + int iAuxFaceNum = auxiliary_face_list.at(iAux); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + int iNum = -1*(iAuxFaceNum); + + /**************** Avoid the length of expression beyond 80 column ***********/ + iStrLength += TCollection_AsciiString(iNum).Length(); + iStrLength += 1; + if (iStrLength >= 79) + { + szExpn += "&"; + iStrLength = 11 + TCollection_AsciiString(iNum).Length(); + } + /****************************************************************************/ + + szExpn += TCollection_AsciiString(iNum); + szExpn += " "; + } + + szExpn.Remove(szExpn.Length()); // Remove the last character + if (auxiliary_face_list.size() > 1) + { + szExpn += ")"; + } + szExpn += ":"; + } + + szExpn.Remove(szExpn.Length()); // Remove the last character ":" + szExpn += ")"; + szExpn += "&"; + } + return szExpn; +} + + + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcnpWriter.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcnpWriter.hxx new file mode 100644 index 0000000..6f8c0eb --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadMcnpWriter.hxx @@ -0,0 +1,46 @@ +#ifndef MCCADMCNPWRITER_HXX +#define MCCADMCNPWRITER_HXX + +#include "IMcCadWriter.hxx" + +class McCadMcnpWriter : public IMcCadWriter +{ + +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + + McCadMcnpWriter(); + McCadMcnpWriter(Standard_Boolean bMat, Standard_Boolean bVoid); + ~McCadMcnpWriter(); + +public: + /** Print the output file, include head information, cell, void, surface, transform card */ + void PrintFile(); /**< Print the file */ + + void PrintHeadDesc(Standard_OStream& theStream); /**< Print the head */ + void PrintCellDesc(Standard_OStream& theStream); /**< Print the cell card */ + void PrintVoidDesc(Standard_OStream& theStream); /**< Print the void card */ + void PrintSurfDesc(Standard_OStream& theStream); /**< Print the surfaces list */ + void PrintTrsfDesc(Standard_OStream& theStream); /**< Print the transform card */ + void PrintMatCard(Standard_OStream& theStream); /**< Print the material card */ + + /** Print the group information, including material name, group name, material id and density */ + virtual void PrintGroupInfo(const int iSolid, Standard_OStream& theStream); + + TCollection_AsciiString GetCellExpn(McCadConvexSolid *& pSolid); + TCollection_AsciiString GetVoidExpn(McCadVoidCell *& pVoidCell); +}; + +#endif // MCCADMCNPWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadSolid.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadSolid.cxx new file mode 100644 index 0000000..cca7f65 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadSolid.cxx @@ -0,0 +1,77 @@ +#include "McCadSolid.hxx" +#include + +McCadSolid::McCadSolid() +{ + m_id = 0; + m_density = 0; +} + +McCadSolid::~McCadSolid() +{ +} + + +/** ******************************************************************** +* @brief Add convex solids into convex solid list. A solid is consist of +* many convex solids commonly. +* +* @param McCadConvexSolid *pConvexSolid +* @return void +* +* @date 2/4/2013 +* @author Lei Lu +***********************************************************************/ +void McCadSolid::AddConvexSolid(McCadConvexSolid *& pConvexSolid) +{ + m_ConvexSolidList.push_back(pConvexSolid); +} + + + +/** ******************************************************************** +* @brief Get a convex solid list of a solid +* +* @param +* @return vector +* +* @date 2/4/2013 +* @author Lei Lu +***********************************************************************/ +vector McCadSolid::GetConvexSolidList() +{ + return m_ConvexSolidList; +} + + + +/** ******************************************************************** +* @brief Set Material Id and Density +* +* @param double fDensity +* @return void +* +* @date 05/11/2013 +* @author Lei Lu +***********************************************************************/ +void McCadSolid::SetMaterial(int theID, double theDensity) +{ + m_id = theID; + m_density = theDensity; +} + + + +/** ******************************************************************** +* @brief Set Material Name +* +* @param TCollection_AsciiString theMatName +* @return void +* +* @date 05/11/2013 +* @author Lei Lu +***********************************************************************/ +void McCadSolid::SetName(TCollection_AsciiString theMatName) +{ + m_name = theMatName; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadSolid.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadSolid.hxx new file mode 100644 index 0000000..891d3d2 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadSolid.hxx @@ -0,0 +1,49 @@ +#ifndef MCCADSOLID_HXX +#define MCCADSOLID_HXX + +#include +#include "McCadConvexSolid.hxx" + +class McCadSolid +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadSolid(); + ~McCadSolid(); + +private: + + vector m_ConvexSolidList; /**< Convex solid list */ + Standard_Integer m_id; + Standard_Real m_density; + TCollection_AsciiString m_name; + +public: + + void AddConvexSolid(McCadConvexSolid *& pConvexSolid); /**< Set convex solid list */ + vector GetConvexSolidList(); /**< Get convex solid list */ + + void SetMaterial(int theID, double theDensity); + Standard_Integer GetID(){return m_id;}; + Standard_Real GetDensity(){return m_density;}; + void SetName(TCollection_AsciiString theName); + TCollection_AsciiString GetName(){return m_name;}; + + vector GetTripoliCellList(); + +}; + +#endif // MCCADSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadTransfCard.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTransfCard.cxx new file mode 100644 index 0000000..6365d2b --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTransfCard.cxx @@ -0,0 +1,69 @@ +#include "McCadTransfCard.hxx" + +McCadTransfCard::McCadTransfCard() +{ +} + + +McCadTransfCard::McCadTransfCard(gp_Ax3 theAxis,gp_Pnt theApex) +{ + gp_Trsf theTrsf; + gp_Ax3 stdAxis; + theTrsf.SetTransformation(theAxis, stdAxis); + gp_XYZ vector = theTrsf.TranslationPart(); + + if(Abs(theApex.X()) < 1.0e-7) + { + vector.SetX(0.0); + } + if(Abs(theApex.Y()) < 1.0e-7) + { + vector.SetY(0.0); + } + if(Abs(theApex.Z()) < 1.0e-7) + { + vector.SetZ(0.0); + } + m_PrmtList.push_back(theApex.X()); + m_PrmtList.push_back(theApex.Y()); + m_PrmtList.push_back(theApex.Z()); + + gp_Mat matrix = theTrsf.HVectorialPart(); + + for (int i = 1; i <= 3; i++) + { + gp_XYZ vec = matrix.Column(i); + if(Abs(vec.X()) < 1.e-10) + { + vec.SetX(0.0); + } + if(Abs(vec.Y()) < 1.e-10) + { + vec.SetY(0.0); + } + if(Abs(vec.Z()) < 1.e-10) + { + vec.SetZ(0.0); + } + + m_PrmtList.push_back(vec.X()); + m_PrmtList.push_back(vec.Y()); + m_PrmtList.push_back(vec.Z()); + } + +} + +void McCadTransfCard::SetTrNum(Standard_Integer iNum) +{ + m_iTrNum = iNum; +} + +Standard_Integer McCadTransfCard::GetTrNum() +{ + return m_iTrNum; +} + +vector McCadTransfCard::GetPrmtList() +{ + return m_PrmtList; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadTransfCard.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTransfCard.hxx new file mode 100644 index 0000000..7076b60 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTransfCard.hxx @@ -0,0 +1,43 @@ +#ifndef MCCADTRANSFCARD_HXX +#define MCCADTRANSFCARD_HXX + +#include +#include +#include + +using namespace::std; + +class McCadTransfCard +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadTransfCard(); + McCadTransfCard(gp_Ax3 theAxis, gp_Pnt theApex); + + vector GetPrmtList(); + TCollection_AsciiString GetSymb(); + + void SetTrNum(Standard_Integer iNum); + Standard_Integer GetTrNum(); + +private: + + Standard_Integer m_iTrNum; + vector m_PrmtList; + +}; + +#endif // MCCADTRANSFCARD_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliCell.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliCell.cxx new file mode 100644 index 0000000..2123e04 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliCell.cxx @@ -0,0 +1,125 @@ +#include "McCadTripoliCell.hxx" + +McCadTripoliCell::McCadTripoliCell() +{ + + + + + +} + + +TCollection_AsciiString McCadTripoliCell::GetEqua() +{ + if (!m_Equation.IsEmpty()) + { + return m_Equation; + } + + TCollection_AsciiString strDesc = "EQUA "; + + int iNumPlusFace = plus_list.size(); + int iNumMinusFace = minus_list.size(); + + for(int i = 0; i < iNumPlusFace; i++) + { + if (i == 0) + { + strDesc += "PLUS "; + strDesc += TCollection_AsciiString(iNumPlusFace); + strDesc += " "; + } + strDesc += TCollection_AsciiString(plus_list.at(i)); + strDesc += " "; + } + + for(int i = 0; i < iNumMinusFace; i++) + { + if (i == 0) + { + strDesc += "MINUS "; + strDesc += TCollection_AsciiString(iNumMinusFace); + strDesc += " "; + } + strDesc += TCollection_AsciiString(abs(minus_list.at(i))); + strDesc += " "; + } + + strDesc.LeftAdjust(); // Trim the left and right space characters of string + strDesc.RightAdjust(); + return strDesc; +} + + + +void McCadTripoliCell::SetVirtual(bool isVirtual) +{ + +} + +void McCadTripoliCell::SetBoolOp(int theBoolOp) +{ + m_boolOp = theBoolOp; +} + + +void McCadTripoliCell::SetCellNum(int theCellNum) +{ + m_CellNum = theCellNum; +} + +void McCadTripoliCell::AddSurface(int theSurfNum) +{ + if(theSurfNum > 0) + { + plus_list.push_back(theSurfNum); + } + else if(theSurfNum < 0) + { + minus_list.push_back(theSurfNum); + } +} + +void McCadTripoliCell::AddCldCell(McCadTripoliCell* pCell) +{ + m_childCellList.push_back(pCell); +} + +bool McCadTripoliCell::hasVirtualCell() +{ + if(!m_childCellList.empty()) + { + return true; + } + else + { + return false; + } +} + +McCadTripoliCell * McCadTripoliCell::GetVirtualCell(int index) +{ + if(m_childCellList.empty()) + { + return NULL; + } + else + { + return m_childCellList.at(index); + } +} + +int McCadTripoliCell::GetNumVirCell() +{ + if(m_childCellList.empty()) + { + return 0; + } + else + { + return m_childCellList.size(); + } +} + + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliCell.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliCell.hxx new file mode 100644 index 0000000..7acef23 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliCell.hxx @@ -0,0 +1,40 @@ +#ifndef MCCADTRIPOLICELL_HXX +#define MCCADTRIPOLICELL_HXX + +#include +#include + +using namespace std; + +class McCadTripoliCell +{ +public: + McCadTripoliCell(); + +private: + + bool m_IsVirtual; // is virtual cell + int m_boolOp; // boolean operations + int m_CellNum; // cell number + vector m_childCellList; // the child cells included + + vector plus_list; // the plus surfaces list + vector minus_list; // the minus surfaces list + + TCollection_AsciiString m_Equation; // the generated TRIPOLI equation + +public: + TCollection_AsciiString GetEqua(); + void SetVirtual(bool isVirtual); + void SetBoolOp(int theBoolOp); + void SetCellNum(int theCellNum); + void AddSurface(int theSurfNum); + + void AddCldCell(McCadTripoliCell* pCell); + bool hasVirtualCell(); + + McCadTripoliCell * GetVirtualCell(int index); + int GetNumVirCell(); +}; + +#endif // MCCADTRIPOLICELL_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliWriter.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliWriter.cxx new file mode 100644 index 0000000..d82dcca --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliWriter.cxx @@ -0,0 +1,949 @@ +#include "McCadTripoliWriter.hxx" + +#include + +#include +#include +#include +#include + +#include "McCadGeomCylinder.hxx" +#include "McCadGeomSphere.hxx" +#include "McCadGeomCone.hxx" +#include //qiu + +#include "../McCadTool/McCadMathTool.hxx" + +McCadTripoliWriter::McCadTripoliWriter() +{ + m_mapSymb.clear(); + m_mapSymb.insert(pair("PX","PLANEX")); + m_mapSymb.insert(pair("PY","PLANEY")); + m_mapSymb.insert(pair("PZ","PLANEZ")); + m_mapSymb.insert(pair("P","PLANE")); + + m_mapSymb.insert(pair("CX","CYLX")); + m_mapSymb.insert(pair("CY","CYLY")); + m_mapSymb.insert(pair("CZ","CYLZ")); + m_mapSymb.insert(pair("C/X","CYLX")); + m_mapSymb.insert(pair("C/Y","CYLY")); + m_mapSymb.insert(pair("C/Z","CYLZ")); + + m_mapSymb.insert(pair("KX","CONEX")); + m_mapSymb.insert(pair("KY","CONEY")); + m_mapSymb.insert(pair("KZ","CONEZ")); + m_mapSymb.insert(pair("K/X","CONEX")); + m_mapSymb.insert(pair("K/Y","CONEY")); + m_mapSymb.insert(pair("K/Z","CONEZ")); + + m_mapSymb.insert(pair("S","SPHERE")); + m_mapSymb.insert(pair("SX","SPHERE")); + m_mapSymb.insert(pair("SY","SPHERE")); + m_mapSymb.insert(pair("SZ","SPHERE")); + m_mapSymb.insert(pair("SO","SPHERE")); + + m_mapSymb.insert(pair("TX","TORUSX")); + m_mapSymb.insert(pair("TY","TORUSY")); + m_mapSymb.insert(pair("TZ","TORUSZ")); + + m_mapSymb.insert(pair("GQ","QUAD")); +} + +McCadTripoliWriter::~McCadTripoliWriter() +{ +} + + +/** ******************************************************************** +* @brief Set the initial virtual cell number +* +* @param Standard_OStream & theStream (modify) +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadTripoliWriter::SetVirtCellNum(Standard_Integer theNum) +{ + m_virtualCellNum = theNum; +} + + +/** ******************************************************************** +* @brief Print the head description of TRIPOLI input file. +* +* @param Standard_OStream & theStream (modify) +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadTripoliWriter::PrintHeadDesc(Standard_OStream& theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream.setf(ios::left); + theStream<<"GEOMETRY"<m_SolidList.size()<m_VoidCellList.size()<m_GeomSurfList.size()<GetGeomData(); + assert(pData); + Standard_Integer iCellNum = m_iInitCellNum; + + theStream.setf(ios::left); + theStream<<"/* ============================= Volume Data Definitions ========================= */"<m_SolidList).size(); i++) + { + if (m_bHaveMaterial) + { + PrintGroupInfo(i+1,theStream); + } + + McCadSolid * pSolid = (pData->m_SolidList).at(i); + vector cell_list = GenTripoliCellList(pSolid); + + vector union_list; + int iNumEpn = cell_list.size(); // The number of virtual solids + + for(int j = 0; j < iNumEpn; j++) + { + McCadTripoliCell *pCell = cell_list.at(j); + //if (pCell->hasVirtualCell()) + vector sub_list; + int iNumVirCell = pCell->GetNumVirCell(); + for (int iVirCell = 0; iVirCell < iNumVirCell; iVirCell++) + { + McCadTripoliCell *pVirCell = pCell->GetVirtualCell(iVirCell); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream< 1) + { + theStream<GetMatManager(); + assert(pMatManager); + + MaterialGroup * pGroup = pMatManager->GetGroupData(iSolid); + if(pGroup != NULL) + { + QString groupName = pGroup->GetGroupName(); + int iMatID = pGroup->GetMaterialID(); + double fDensity = pGroup->GetDensity(); + QString materialName = pGroup->GetMaterialName(); + + int iStartNum = pGroup->GetStartNum() ; + int iEndNum = pGroup->GetEndNum(); + int iCellNum = pGroup->GetCellNum(); + + iStartNum += (m_iInitCellNum-1); + iEndNum += (m_iInitCellNum-1); + + TCollection_AsciiString group_info; + group_info = "From "; + group_info += TCollection_AsciiString(iStartNum); + group_info += " to "; + group_info += TCollection_AsciiString(iEndNum); + group_info += " , "; + group_info += TCollection_AsciiString(iCellNum); + group_info += " cells"; + int iLength = group_info.Length()%49; + + theStream<<"/*"<GetGeomData(); + assert(pData); + + /** Print the head information of the void card */ + TCollection_AsciiString void_info; + void_info = TCollection_AsciiString(int((pData->m_VoidCellList).size())) + " Cells"; + int iLength = void_info.Length()%50; + + theStream<<"/*"<m_ConvexSolidList).size() + m_iInitCellNum; + for (unsigned int i = 0; i < (pData->m_VoidCellList).size(); i++) + { + McCadVoidCell * pVoid = (pData->m_VoidCellList).at(i); + assert(pVoid); + + vector complement_list; + vector cell_list = GenTripoliVoidCellList(pVoid); + + int iNumEpn = cell_list.size(); // The number of virtual solids + for(int j = 0; j < iNumEpn-1; j++) + { + McCadTripoliCell *pCell = cell_list.at(j); + if (pCell->hasVirtualCell()) + { + vector sub_list; + int iNumVirCell = pCell->GetNumVirCell(); + for (int iVirCell = 0; iVirCell < iNumVirCell; iVirCell++) + { + McCadTripoliCell *pVirCell = pCell->GetVirtualCell(iVirCell); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream< 1) + { + theStream<GetGeomData(); + assert(pData); + + McCadVoidCell * pOutVoid = pData->m_pOutVoid; + vector outer_list; + + vector cell_list; + cell_list = GenOuterSpaceList(pOutVoid); + + int iNumEpn = cell_list.size(); // The number of virtual solids + for(int iOutCell = 0; iOutCell < iNumEpn; iOutCell++) + { + McCadTripoliCell *pCell = cell_list.at(iOutCell); + theStream<GetEqua(); + theStream<GetMatManager(); + assert(pMatManager); + + Material * pMat = NULL; + vector material_list = pMatManager->GetMatList(); + + /** Print all the material included */ + theStream<<"COMPOSITION "<GetMatName(); + theStream<GetGeomData(); + assert(pData); + + map > group_list; + /** Print the material name and the solids belong to this material group */ + for (unsigned int i = 0; i < (pData->m_SolidList).size(); i++) + { + McCadSolid * pSolid = (pData->m_SolidList).at(i); + assert(pSolid); + + TCollection_AsciiString material_name = pSolid->GetName(); + + if(material_name.IsEmpty()) + { + continue; + } + + map >::iterator iter; + iter = group_list.find(material_name); + if (iter != group_list.end()) + { + iter->second.push_back(iCellNum + i); + } + else + { + vector cell_list; + cell_list.push_back(iCellNum + i); + group_list.insert(pair >(material_name,cell_list)); + } + } + + /** ****************** print the materials of void cells ************************/ + Standard_Integer iMatSolid = (pData->m_SolidList).size(); + for (unsigned int k = 0; k < (pData->m_VoidCellList).size(); k++) + { + TCollection_AsciiString material_name = "Mat_Air"; + + map >::iterator iter; + iter = group_list.find(material_name); + if (iter != group_list.end()) + { + iter->second.push_back(iCellNum + k + iMatSolid); + } + else + { + vector cell_list; + cell_list.push_back(iCellNum + k + iMatSolid); + group_list.insert(pair >(material_name,cell_list)); + } + } + + theStream<<"GEOMCOMP"< >::iterator iter; + iter = group_list.begin(); + while (iter != group_list.end()) + { + int iNum = (iter->second).size(); + TCollection_AsciiString material_name = iter->first; + theStream<second).at(i)<<" "; + } + theStream< McCadTripoliWriter::GenTripoliCellList(McCadSolid *& pSolid) +{ + vector cell_list; + int iInitSurfNum = m_iInitFaceNum - 1; + + int iConvexSolid = (pSolid->GetConvexSolidList()).size(); + for(int j = 0; j < iConvexSolid; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + + McCadTripoliCell *pTriCell = new McCadTripoliCell(); + + for (Standard_Integer i = 0; i < (pConvexSolid->GetFaces()).size(); i++) + { + vector auxface_list; // Store some auxilury surfaces which attribute is 1 + McCadExtFace * pExtFace = (pConvexSolid->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + pTriCell->AddSurface(iFaceNum); + + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + if (pAuxFace->GetAttri() == 1) + { + auxface_list.push_back(-iAuxFaceNum); + } + else + { + pTriCell->AddSurface(iAuxFaceNum); + } + } + } + + if (auxface_list.size() != 0) + { + McCadTripoliCell *pCldCell = new McCadTripoliCell(); + for (Standard_Integer k = 0; k < auxface_list.size(); k++) + { + int iFaceNum = auxface_list.at(k); + pCldCell->AddSurface(iFaceNum); + } + pTriCell->AddCldCell(pCldCell); // Add the virtual cell consisted of auxiliary surfaces into parent cell + pTriCell->SetBoolOp(2); // Substract the virtual cell + } + auxface_list.clear(); + } + + cell_list.push_back(pTriCell); + } + + return cell_list; +} + + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date +* @author Lei Lu +***********************************************************************/ +vector McCadTripoliWriter::GenTripoliVoidCellList(McCadVoidCell *& pVoidCell) +{ + vector cell_list; + int iInitSurfNum = m_iInitFaceNum - 1; + + for (Standard_Integer i = 0; i < (pVoidCell->GetCollision()).size(); i++) + { + McCadTripoliCell *pTriCell = new McCadTripoliCell(); + COLLISION collision = (pVoidCell->GetCollision()).at(i); + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + int iCollidFaceNum = collision.FaceList.at(j); + iCollidFaceNum > 0 ? iCollidFaceNum += iInitSurfNum : iCollidFaceNum -= iInitSurfNum; + pTriCell->AddSurface(iCollidFaceNum); + } + + for (Standard_Integer j = 0; j < (collision.AuxFaceList).size(); j++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(j); + McCadTripoliCell *pCldCell = new McCadTripoliCell(); + for (Standard_Integer k = 0; k < auxiliary_face_list.size(); k++) + { + int iAuxFaceNum = auxiliary_face_list.at(k); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + pCldCell->AddSurface(-iAuxFaceNum); + } + pTriCell->AddCldCell(pCldCell); // Add the virtual cell consisted of auxiliary surfaces into parent cell + pTriCell->SetBoolOp(2); // Substract the virtual cell + } + cell_list.push_back(pTriCell); + } + + McCadTripoliCell *pBox = new McCadTripoliCell(); + for (Standard_Integer i = 0; i < (pVoidCell->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pVoidCell->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + pBox->AddSurface(iFaceNum); + } + cell_list.push_back(pBox); + + return cell_list; +} + + +vector McCadTripoliWriter::GenOuterSpaceList(McCadVoidCell *& pVoidCell) +{ + vector outer_list; + int iInitSurfNum = m_iInitFaceNum - 1; + + for (Standard_Integer i = 0; i < (pVoidCell->GetFaces()).size(); i++) + { + McCadTripoliCell *pTriCell = new McCadTripoliCell(); + McCadExtFace * pExtFace = (pVoidCell->GetFaces()).at(i); + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + iFaceNum *= -1; + + pTriCell->AddSurface(iFaceNum); + outer_list.push_back(pTriCell); + } + return outer_list; +} + + + +/** ******************************************************************** +* @brief Print the surface list +* +* @param Standard_OStream & theStream +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadTripoliWriter::PrintSurfDesc(Standard_OStream & theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream<<"/* ============================ Surface Data Definitions ========================= */"<::iterator iterPos; + for (iterPos = (pData->m_GeomSurfList).begin(); iterPos != (pData->m_GeomSurfList).end(); ++iterPos) + { + IGeomFace * pFace = *iterPos; + assert(pFace); + theStream.setf(ios::left); + theStream<<"SURF "< surf_list = GetSurfPrmt(pFace); + for (Standard_Integer i = 0; i < surf_list.size(); i++ ) + { + if ( i%4 == 0 && i != 0 ) + { + theStream<GetSurfSymb(); + TCollection_AsciiString tri_symb; + + map::iterator iter; + iter = m_mapSymb.find(mcnp_symb); + if(iter != m_mapSymb.end()) + { + tri_symb = iter->second; + } + else + { + tri_symb = mcnp_symb; + } + return tri_symb; +} + + + +/** ******************************************************************** +* @brief Get the parameters of surface according to the format of TRIPOLI +* surface describtion +* +* @param IGeom * pFace +* @return vector parameters list +* +* @date 09/10/2013 +* @modify 10/09/2014 +* @author Lei Lu +***********************************************************************/ +vector McCadTripoliWriter::GetSurfPrmt(IGeomFace *& pFace) +{ + vector prmt_list; + TCollection_AsciiString McnpSymb = pFace->GetSurfSymb(); + if (McnpSymb == "P ") + { + int iNum = (pFace->GetPrmtList()).size(); + for (Standard_Integer i = 0; i < iNum-1; i++ ) + { + prmt_list.push_back(pFace->GetPrmtList().at(i)); + } + prmt_list.push_back(-1*pFace->GetPrmtList().at(iNum-1)); + return prmt_list; + } + + //qiu + if ( McnpSymb == "CX" ) + { + McCadGeomCylinder * pCyl = (McCadGeomCylinder*)(pFace); + prmt_list.push_back(pCyl->GetPoint().Y()); + prmt_list.push_back(pCyl->GetPoint().Z()); + prmt_list.push_back(pCyl->GetRadius()); + return prmt_list; + } + + if ( McnpSymb == "CY" ) + { + McCadGeomCylinder * pCyl = (McCadGeomCylinder*)(pFace); + prmt_list.push_back(pCyl->GetPoint().X()); + prmt_list.push_back(pCyl->GetPoint().Z()); + prmt_list.push_back(pCyl->GetRadius()); + return prmt_list; + } + + if ( McnpSymb == "CZ" ) + { + McCadGeomCylinder * pCyl = (McCadGeomCylinder*)(pFace); + prmt_list.push_back(pCyl->GetPoint().X()); + prmt_list.push_back(pCyl->GetPoint().Y()); + prmt_list.push_back(pCyl->GetRadius()); + return prmt_list; + } + + if (McnpSymb == "SO" || McnpSymb == "SY" || McnpSymb == "SZ" + ||McnpSymb == "SX" || McnpSymb == "S" ) + { + McCadGeomSphere * pSph = (McCadGeomSphere*)(pFace); + prmt_list.push_back(pSph->GetCenter().X()); + prmt_list.push_back(pSph->GetCenter().Y()); + prmt_list.push_back(pSph->GetCenter().Z()); + prmt_list.push_back(pSph->GetRadius()); + return prmt_list; + } + + if (McnpSymb == "K/X" || McnpSymb == "K/Y" || McnpSymb == "K/Z" + || McnpSymb == "KX" || McnpSymb == "KY" || McnpSymb == "KZ") + { + McCadGeomCone * pCon = (McCadGeomCone*)(pFace); + prmt_list.push_back(pCon->GetApex().X()); + prmt_list.push_back(pCon->GetApex().Y()); + prmt_list.push_back(pCon->GetApex().Z()); + prmt_list.push_back((pCon->GetSemiAngle()/M_PI )* 180. ); + return prmt_list; + } + + int iNum = (pFace->GetPrmtList()).size(); + for (Standard_Integer i = 0; i < iNum; i++ ) + { + prmt_list.push_back(pFace->GetPrmtList().at(i)); + } + return prmt_list; +} + + + diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliWriter.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliWriter.hxx new file mode 100644 index 0000000..065ce6f --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadTripoliWriter.hxx @@ -0,0 +1,62 @@ +#ifndef MCCADTRIPOLIWRITER_HXX +#define MCCADTRIPOLIWRITER_HXX + +#include "IMcCadWriter.hxx" + +class McCadTripoliWriter : public IMcCadWriter +{ + +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadTripoliWriter(); + McCadTripoliWriter(Standard_Boolean bMat, Standard_Boolean bVoid); + ~McCadTripoliWriter(); + +//private: //qiu +protected: + + Standard_Integer m_virtualCellNum; /**< The initial number of virtual cell */ + map m_mapSymb; + +public: + void SetVirtCellNum(Standard_Integer theNum); /**< Set the initial virtual cell number */ + void PrintFile(); /**< Print the file */ + void PrintHeadDesc(Standard_OStream& theStream); /**< Print the head */ + void PrintCellDesc(Standard_OStream& theStream); /**< Print the cell card */ + void PrintVoidDesc(Standard_OStream& theStream); /**< Print the void card */ + void PrintSurfDesc(Standard_OStream& theStream); /**< Print the surfaces list */ + void PrintTrsfDesc(Standard_OStream& theStream); /**< Print the transform card */ + void PrintMatCard(Standard_OStream& theStream); /**< Print the material card */ + +//private: //qiu +protected: + + /**< Print the outer spaces beside void cells and material cells */ + void PrintOutSpace(Standard_OStream& theStream); + /** Print the group information, including material name, group name, material id and density */ + void PrintGroupInfo(const int iSolid, Standard_OStream& theStream); + /** Generate the TRIPOLI cell object from a convex solid */ + vector GenTripoliCellList(McCadSolid *& pSolid); + /** Generate the TRIPOLI cell object from a filling void solid */ + vector GenTripoliVoidCellList(McCadVoidCell *& pVoidCell); + /** Generate the outer space tripoli cell list */ + vector GenOuterSpaceList(McCadVoidCell *& pVoidCell); + + vector GetSurfPrmt(IGeomFace *& pFace); /**< Get the parameter list of a surface */ + TCollection_AsciiString GetSurfSymb(IGeomFace *& pFace);/**< Get the type of surface */ + +}; + +#endif // MCCADTRIPOLIWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCell.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCell.cxx new file mode 100644 index 0000000..209cf59 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCell.cxx @@ -0,0 +1,1086 @@ +#include "McCadVoidCell.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "McCadGeomPlane.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +#include +#include "../McCadTool/McCadMathTool.hxx" + +McCadVoidCell::McCadVoidCell() +{ +} + +McCadVoidCell::McCadVoidCell(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + m_SplitAxis = XAxis; + GetBntBox(); + GetGeomFaceList(); + m_VertexList = new TColgp_HSequenceOfPnt; +} + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadVoidCell::AddColliedSolidNum(Standard_Integer iNum) +{ + m_CollidedSolidNumList.push_back(iNum); +} + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector McCadVoidCell::GetColliedSolidList() +{ + return m_CollidedSolidNumList; +} + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadVoidCell::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + m_MaxPnt.SetCoord(fXmax, fYmax, fZmax); // The max point of the boundary box + m_MinPnt.SetCoord(fXmin, fYmin, fZmin); // The min point of the boundary box + + //m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + +/** ******************************************************************** +* @brief Set the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadVoidCell::SetBntBox(Standard_Real fXmin, Standard_Real fYmin, Standard_Real fZmin, + Standard_Real fXmax, Standard_Real fYmax, Standard_Real fZmax) +{ + m_bBox.Update(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + m_bHaveBndBox = Standard_True; // Already have boundary box + + m_MaxPnt.SetCoord(fXmax, fYmax, fZmax); // The max point of the boundary box + m_MinPnt.SetCoord(fXmin, fYmin, fZmin); // The min point of the boundary box + + return m_bBox; +} + + +/** ******************************************************************** +* @brief Set the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadVoidCell::CalColliedFaces(McCadGeomData * pData) +{ + int b = 0; + + for (unsigned int i = 0; i < m_CollidedSolidNumList.size(); i++) + { + int index = m_CollidedSolidNumList.at(i); + McCadConvexSolid * pSolid = (pData->GetConvexSolid()).at(index); + assert(pSolid); + + Bnd_Box bbox_solid = pSolid->GetBntBox(); + Bnd_Box bbox_void = this->GetBntBox(); + + if(!CalColliedBox(bbox_solid)) + { + m_CollidedSolidNumList.erase(m_CollidedSolidNumList.begin()+i); + i--; + continue; + } + + //if(bbox_void.IsOut(bbox_solid)) + //{ + // m_CollidedSolidNumList.erase(m_CollidedSolidNumList.begin()+i); + // i--; + // continue; + //} + + COLLISION tmpCollision; + tmpCollision.SolidNum = index+1; + vector tmpAuxFaceList; + + for (unsigned int j = 0; j < pSolid->GetSTLFaceList().size(); j++) + { + McCadExtFace *pFace = pSolid->GetSTLFaceList()[j]; + Bnd_Box bbox_face = pFace->GetBndBox(); + + Standard_Boolean bCollied = Standard_False; + if( !CalColliedBox(bbox_face)) + { + continue; + } + + if (CalColliedPoints(pFace->GetEdgePntList())) + { + bCollied = Standard_True; + } + else if (CalColliedPoints(pFace->GetDiscPntList())) + { + bCollied = Standard_True; + } + else if (CalColliedFace(pFace)) + { + bCollied = Standard_True; + } + + if (!bCollied) + { + continue; + } + + tmpCollision.FaceList.push_back(pFace->GetFaceNum()); + if(pFace->HaveAuxSurf()) + { + vector auxface_list_solid; + for (Standard_Integer k = 0; k < pFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pFace->GetAuxFaces().at(k); + if(pAuxFace->GetAttri() == 1) + { + auxface_list_solid.push_back(pAuxFace->GetFaceNum()); + } + else + { + tmpCollision.FaceList.push_back(pAuxFace->GetFaceNum()); + } + } + + if (auxface_list_solid.size() == 1) + { + tmpAuxFaceList.push_back(auxface_list_solid.at(0)); + } + else if (auxface_list_solid.size() > 1) + { + tmpCollision.AuxFaceList.push_back(auxface_list_solid); + } + } + } + + if ( tmpAuxFaceList.size() != 0) + { + tmpCollision.AuxFaceList.push_back(tmpAuxFaceList); + } + + if(tmpCollision.FaceList.size() != 0) + { + m_Collision.push_back(tmpCollision); + continue; + } + + // Advanced collision detect.Judge the vertex of void cell is in the solid or not. + if(IsVertexInSolid(pSolid)) + { + vector tmpAuxFaceList; + for (unsigned int j = 0; j < pSolid->GetSTLFaceList().size(); j++) + { + McCadExtFace *pFace = pSolid->GetSTLFaceList().at(j); + tmpCollision.FaceList.push_back(pFace->GetFaceNum()); + if(pFace->HaveAuxSurf()) + { + vector auxface_list_solid; + for (Standard_Integer k = 0; k < pFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pFace->GetAuxFaces().at(k); + if(pAuxFace->GetAttri() == 1) + { + auxface_list_solid.push_back(pAuxFace->GetFaceNum()); + } + else + { + tmpCollision.FaceList.push_back(pAuxFace->GetFaceNum()); + } + } + + if (auxface_list_solid.size() == 1) + { + tmpAuxFaceList.push_back(auxface_list_solid.at(0)); + } + else if (auxface_list_solid.size() > 1) + { + tmpCollision.AuxFaceList.push_back(auxface_list_solid); + } + } + } + + if ( tmpAuxFaceList.size() != 0) + { + tmpCollision.AuxFaceList.push_back(tmpAuxFaceList); + } + + if(tmpCollision.FaceList.size() != 0) + { + m_Collision.push_back(tmpCollision); + } + } + } + + /* Print the collision information */ + /* if (m_Collision.size() == 0) + { + cout<<" null collision"<GetDiscPntList(); + Standard_Boolean bInVoid = Standard_False; + + for (unsigned int i = 1; i <= point_list->Length(); i++) + { + gp_Pnt pnt = point_list->Value(i); + //if(m_bBox.IsOut(pnt)) + if (!IsPointInBBox(pnt)) + { + continue; + } + else + { + bInVoid = Standard_True; + break; + } + } + return bInVoid; +} + + + +/** ******************************************************************** +* @brief Calculate the two boxes are connected and next to each other +* +* @param +* @return Standard_Boolean +* +* @date 15/3/2014 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadVoidCell::CalColliedBox(Bnd_Box & box) +{ + Standard_Boolean bConnected = Standard_False; + + box.SetGap(0.0); + Standard_Real xMin1, yMin1, zMin1, xMax1, yMax1, zMax1; + box.Get(xMin1, yMin1, zMin1, xMax1, yMax1, zMax1); + +// gp_Pnt v1(xMin, yMin, zMin); +// gp_Pnt v2(xMin, yMin, zMax); +// gp_Pnt v3(xMin, yMax, zMax); +// gp_Pnt v4(xMax, yMax, zMax); +// gp_Pnt v5(xMax, yMin, zMax); +// gp_Pnt v6(xMax, yMax, zMin); +// gp_Pnt v7(xMax, yMin, zMin); +// gp_Pnt v8(xMin, yMax, zMin); + + m_bBox.SetGap(0.0); + Standard_Real xMin2, yMin2, zMin2, xMax2, yMax2, zMax2; + m_bBox.Get(xMin2, yMin2, zMin2, xMax2, yMax2, zMax2); + + + if ( Abs(xMin1-xMax2)<1.0e-7 || Abs(xMax1-xMin2)<1.0e-7) + { + bConnected = Standard_True; + } + + if ( Abs(yMin1-yMax2)<1.0e-2 || Abs(yMax1 - yMin2)<1.0e-2) + { + //cout< xMin)) + { + if ((py < yMax) && (py > yMin)) + { + if ((pz < zMax) && (pz > zMin)) + { + return Standard_True; + } + } + } + + return Standard_False; +} + + + +/*Standard_Boolean McCadVoidCell::CalColliedVertex(McCadExtFace *& theFace) +{ + GetVertexList(); // Get the vertex of void cell + Standard_Boolean bInSolid = Standard_False; + int iSide = 1; + for (unsigned int i = 1; i <= m_VertexList->Length(); i++) + { + gp_Pnt pnt = m_VertexList->Value(i); + if (i == 1) + { + iSide = SideofFace(pnt,theFace); + continue; + } + + if(iSide != SideofFace(pnt,theFace)) + { + bInSolid = Standard_True; + break; + } + } + return bInSolid; +}*/ + + + +/** ******************************************************************** +* @brief Further collision detection, use the boolean operation between +* face and void box, if they have common section, then they are +* collied. +* Because same faces have been merged, so the merged same surfaces +* also have to be used for detecting the collision. +* +* @param +* @return TopoDS_Shape +* +* @date 20/3/2013 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadVoidCell::CalColliedFace(McCadExtFace *& theFace) +{ + Standard_Boolean PerformNow = Standard_False; + int nCount = 0; + + if(!theFace->IsFusedFace()) + { + BRepAlgoAPI_Section section(*this,*theFace,PerformNow); + section.ComputePCurveOn1(Standard_True); + section.Approximation(Standard_True); + section.Build(); + TopoDS_Shape section_shape = section.Shape(); + + for (TopExp_Explorer ex(section_shape, TopAbs_VERTEX); ex.More(); ex.Next()) + { + nCount++; + } + if (nCount > 2) + { + //cout<<" "<IsFusedFace()) + { + Standard_Boolean bCollision = Standard_False; + for (Standard_Integer i = 0 ; i < theFace->GetSameFaces().size(); i++) + { + McCadExtFace *pFace; + pFace = theFace->GetSameFaces().at(i); + bCollision = CalColliedFace(pFace); + if (!bCollision) + { + continue; + } + else + { + return bCollision; + } + } + } + + return Standard_False; +} + + +Standard_Boolean McCadVoidCell::IsVertexInSolid(McCadConvexSolid *& pSolid) +{ + SetVertexList(); // Set the vertex of void cell + BRepClass3d_SolidClassifier bsc3d(*pSolid); + for (unsigned int i = 1; i <= m_VertexList->Length(); i++) + { + gp_Pnt pnt = m_VertexList->Value(i); + bsc3d.Perform(pnt,1.0e-05); + if ( bsc3d.State() == TopAbs_IN) + { + return Standard_True; + } + } + return Standard_False; +} + + +void McCadVoidCell::SetVertexList() +{ + if(m_VertexList->Length()!=0) + { + return; + } + + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + m_bBox.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + gp_Pnt Pnt1(dXmax,dYmax,dZmax); + gp_Pnt Pnt2(dXmax,dYmax,dZmin); + gp_Pnt Pnt3(dXmax,dYmin,dZmax); + gp_Pnt Pnt4(dXmax,dYmin,dZmin); + + gp_Pnt Pnt5(dXmin,dYmin,dZmin); + gp_Pnt Pnt6(dXmin,dYmax,dZmin); + gp_Pnt Pnt7(dXmin,dYmin,dZmax); + gp_Pnt Pnt8(dXmin,dYmax,dZmax); + + m_VertexList->Append(Pnt1); + m_VertexList->Append(Pnt2); + m_VertexList->Append(Pnt3); + m_VertexList->Append(Pnt4); + m_VertexList->Append(Pnt5); + m_VertexList->Append(Pnt6); + m_VertexList->Append(Pnt7); + m_VertexList->Append(Pnt8); +} + + + + +Standard_Integer McCadVoidCell::SideofFace(gp_Pnt pnt, McCadExtFace *& theFace) +{ + TopLoc_Location loc; + Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(*theFace, loc); + GeomAdaptor_Surface surf_adoptor(geom_surface); + Standard_Real aVal = McCadGTOOL::Evaluate(surf_adoptor,pnt); + + if(aVal > 0.0 ) + { + return 1; + } + else if (aVal < 0.0) + { + return -1; + } + else if (fabs(aVal - 0.0) < 1.0e-7) + { + return 0; + } +} + + + +Standard_Boolean McCadVoidCell::IsPointInBBox(gp_Pnt pnt) +{ + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + m_bBox.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + McCadGeomTool::SimplifyPoint(pnt); + + if (( pnt.X()>dXmin && pnt.X()dYmin && pnt.Y()dZmin && pnt.Z()GetFaceOrientation() == MINUS) + { + //m_szExpression += "-"; + }*/ + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + } + m_szExpression.Remove(m_szExpression.Length()); // Remove the last character " " + m_szExpression += ")"; + m_szExpression += "&"; + + for (Standard_Integer i = 0; i < m_Collision.size(); i++) + { + COLLISION collision = m_Collision[i]; + m_szExpression += "("; + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + int iCollidFaceNum = collision.FaceList.at(j); + iCollidFaceNum > 0 ? iCollidFaceNum += iInitSurfNum : iCollidFaceNum -= iInitSurfNum; + + int iNum = -1*(iCollidFaceNum); + m_szExpression += TCollection_AsciiString(iNum); + m_szExpression += ":"; + } + + for (Standard_Integer k = 0; k < (collision.AuxFaceList).size(); k++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(k); + if ( auxiliary_face_list.size() > 1) + { + m_szExpression += "("; + } + + for (Standard_Integer k = 0; k < auxiliary_face_list.size(); k++) + { + int iAuxFaceNum = auxiliary_face_list.at(k); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + int iNum = -1*(iAuxFaceNum); + m_szExpression += TCollection_AsciiString(iNum); + m_szExpression += " "; + } + + m_szExpression.Remove(m_szExpression.Length()); // Remove the last character + if (auxiliary_face_list.size() > 1) + { + m_szExpression += ")"; + } + m_szExpression += ":"; + } + + m_szExpression.Remove(m_szExpression.Length()); // Remove the last character ":" + m_szExpression += ")"; + m_szExpression += "&"; + } + return m_szExpression; +} + + + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadVoidCell::GetOutVoidExpression() +{ + m_szExpression.Clear(); + m_szExpression += "("; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + for (Standard_Integer i = 0; i < m_FaceList.size(); i++) + { + McCadExtFace * pExtFace = m_FaceList[i]; + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + iFaceNum *= -1; + + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += ":"; + } + m_szExpression.Remove(m_szExpression.Length()); + m_szExpression += ")"; + + return m_szExpression; +} + + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadVoidCell::GetGeomFaceList() +{ + if(!m_FaceList.empty()) + { + return m_FaceList; + } + + TopExp_Explorer exp; + + TopoDS_Solid void_solid = BRepPrimAPI_MakeBox(m_MinPnt,m_MaxPnt).Solid(); + for (exp.Init(void_solid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + McCadExtFace *pExtFace = new McCadExtFace(theFace); + pExtFace->SetFaceNum(-1); + m_FaceList.push_back(pExtFace); + } + return m_FaceList; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Standard_Boolean McCadVoidCell::SplitVoidCell(vector & void_list, + McCadGeomData *pData) +{ + //cout<<"+++"<<"VoidDecomposeDepth:"<GetExpression().Length() > McCadConvertConfig::GetMaxDiscLength()) + { + //cout<<"GetExpression():"<GetExpression().Length()<= yLength && xLength >= zLength) + { + m_SplitAxis = XAxis; + } + else if (yLength >= zLength) + { + m_SplitAxis = YAxis; + } + else + { + m_SplitAxis = ZAxis; + } + + if(this->m_SplitAxis == XAxis) + { + Standard_Integer xMid = (m_MaxPnt.X()+ m_MinPnt.X())/2; + + max_pntA.SetCoord(xMid,m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntA.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),m_MinPnt.Z()); + + max_pntB.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntB.SetCoord(xMid,m_MinPnt.Y(),m_MinPnt.Z()); + + //split_axis = YAxis; + + } + else if(this->m_SplitAxis == YAxis) + { + Standard_Integer yMid = (m_MaxPnt.Y()+ m_MinPnt.Y())/2; + + max_pntA.SetCoord(m_MaxPnt.X(),yMid,m_MaxPnt.Z()); + min_pntA.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),m_MinPnt.Z()); + + max_pntB.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntB.SetCoord(m_MinPnt.X(),yMid,m_MinPnt.Z()); + + //split_axis = ZAxis; + + } + else if(this->m_SplitAxis == ZAxis) + { + Standard_Integer zMid = (m_MaxPnt.Z()+ m_MinPnt.Z())/2; + + max_pntA.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),zMid); + min_pntA.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),m_MinPnt.Z()); + + max_pntB.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntB.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),zMid); + + //split_axis = XAxis; + } + + /* cout<SetCollidedSolidNumList(m_CollidedSolidNumList); + pVoidB->SetCollidedSolidNumList(m_CollidedSolidNumList); + + pVoidA->CalColliedFaces(pData); + pVoidB->CalColliedFaces(pData); + + //pVoidA->SetSplitAxis(split_axis); + //pVoidB->SetSplitAxis(split_axis); + pVoidA->SetSplitDepth(m_iSplitDepth+1); + pVoidB->SetSplitDepth(m_iSplitDepth+1); + + if(!pVoidA->SplitVoidCell(void_list,pData)) + { + void_list.push_back(pVoidA); + //cout<<"level"<SplitVoidCell(void_list,pData)) + { + void_list.push_back(pVoidB); + //cout<<"level"< theCollidedSolidNumList ) +{ + m_CollidedSolidNumList = theCollidedSolidNumList; +} + + +void McCadVoidCell::ChangeFaceNum(McCadGeomData *pData) +{ + for (Standard_Integer i = 0; i < m_FaceList.size(); i++) + { + McCadExtFace * pExtFace = m_FaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + pExtFace->SetFaceNum(iFaceNumNew); + } + + for (Standard_Integer i = 0; i < m_Collision.size(); i++) + { + COLLISION collision = m_Collision[i]; + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + Standard_Integer iFaceNumOld = collision.FaceList.at(j); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + if(iFaceNumOld < 0) + { + iFaceNumNew *= -1; + } + m_Collision[i].FaceList.at(j) = iFaceNumNew; + } + + for (Standard_Integer k = 0; k < (collision.AuxFaceList).size(); k++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(k); + for (Standard_Integer l = 0; l < auxiliary_face_list.size(); l++) + { + Standard_Integer iFaceNumOld = auxiliary_face_list.at(l); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + if(iFaceNumOld < 0) + { + iFaceNumNew *= -1; + } + m_Collision[i].AuxFaceList.at(k).at(l) = iFaceNumNew; + } + } + } +} + + + +/** ******************************************************************** +* @brief Get the expression of the cubic box represented the void space +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @modify 16/12/2013 +* @author Lei Lu +***********************************************************************/ +vector McCadVoidCell::GetFaces() +{ + return m_FaceList; +} + + + + +/** ******************************************************************** +* @brief Get the collision information of void box +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @modify 16/12/2013 +* @author Lei Lu +***********************************************************************/ +vector McCadVoidCell::GetCollision() +{ + return m_Collision; +} + + + +//for (int iVoidFace = 0; iVoidFace < m_FaceList.size(); iVoidFace++) +//{ +// if (b==1) +// { +// break; +// } + +// McCadExtFace *pVoidFace = m_FaceList.at(iVoidFace); +// McCadExtFace *pMatFace = NULL; +// for (int iMatFace = 0; iMatFace < pSolid->GetSTLFaceList().size();iMatFace++) +// { +// pMatFace = pSolid->GetSTLFaceList().at(iMatFace); + +// TopLoc_Location loc; +// Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(*pMatFace, loc); +// GeomAdaptor_Surface surf_adoptor(geom_surface); + +// Handle(Geom_Surface) geom_surface2 = BRep_Tool::Surface(*pVoidFace, loc); +// GeomAdaptor_Surface surf_adoptor2(geom_surface2); + +// if (surf_adoptor.GetType() == GeomAbs_Plane +// && surf_adoptor2.GetType() == GeomAbs_Plane) +// { +// gp_Pln plane1 = surf_adoptor.Plane(); // Get the geometry plane + +// Standard_Real PrmtA1; +// Standard_Real PrmtB1; +// Standard_Real PrmtC1; +// Standard_Real PrmtD1; + + + +// plane1.Coefficients(PrmtA1,PrmtB1,PrmtC1,PrmtD1); +// // If the parameter is less than 1.0e-07, it can be take as zero +// if(McCadMathTool::IsEqualZero(PrmtA1)) +// PrmtA1 = 0.0; +// if(McCadMathTool::IsEqualZero(PrmtB1)) +// PrmtB1 = 0.0; +// if(McCadMathTool::IsEqualZero(PrmtC1)) +// PrmtC1 = 0.0; +// if(McCadMathTool::IsEqualZero(PrmtD1)) +// PrmtD1 = 0.0; + + +// gp_Dir Dir1; +// Dir1.SetCoord(PrmtA1,PrmtB1,PrmtC1); +// // cout<GetFaceOrientation() == MINUS) +// { +// cout<<"----"<GetFaceOrientation() != pMatFace->GetFaceOrientation()) +// ) +// { +// cout< + +#include +#include + +#include +#include +#include +#include +#include "McCadConvexSolid.hxx" +#include + +using namespace std; + +typedef struct{ + int SolidNum; + vector FaceList; + vector< vector > AuxFaceList; +}COLLISION; + +enum SplitAxis{ XAxis = 1, + YAxis = 2, + ZAxis = 3}; + +class McCadVoidCellManager; +class McCadGeomData; + +class McCadVoidCell : public TopoDS_Solid +{ +public: + McCadVoidCell(); + McCadVoidCell(const TopoDS_Solid & theSolid); + +private: + enum cutplane{x=0,y=1,z=2}; // Cut the void cell when it is collied with too many solids + + + vector m_CollidedSolidNumList; // Record the solid no who is collided with void cell + // Which boundary faces of the solid is collied with the void cell. + // the first parameter(int) is the solid no, the second is the list + // of the collided boundary faces. + map mapCollidedFaceNo; + + gp_Pnt m_MaxPnt; // The max point of the boundary box + gp_Pnt m_MinPnt; // The min point of the boundary box + + TCollection_AsciiString m_szExpression; // MCNP expression of solid + int iLengthOfExpression; // Length of MCNP expression + + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + vector m_Collision; + vector m_FaceList; /**< Face list of void solid */ + + SplitAxis m_SplitAxis; + Standard_Integer m_iSplitDepth; + + Handle_TColgp_HSequenceOfPnt m_VertexList; + //Handle_TopTools_HSequenceOfShape m_NFaceList; + +public: + + Standard_Boolean IsCollided(const TopoDS_Shape & Solid); // Whether is collided with solid + void DetectCollision(const Handle(TopTools_HSequenceOfShape) & SolidList); // Detect the collision with solids list + + void GenerateMCNPExpression(); // Generate the MCNP expression + Bnd_Box GetBntBox(); + void SetVertexList(); + void AddColliedSolidNum(Standard_Integer iNum); + + vector GetColliedSolidList(); + //void CalColliedFaces(vector & solid_list); + Standard_Boolean CalColliedPoints(Handle_TColgp_HSequenceOfPnt point_list); + + Bnd_Box SetBntBox(Standard_Real fXmin, Standard_Real fYmin, Standard_Real fZmin, + Standard_Real fXmax, Standard_Real fYmax, Standard_Real fZmax); + TCollection_AsciiString GetExpression(); + TCollection_AsciiString GetOutVoidExpression(); + vector GetGeomFaceList(); + + Standard_Boolean SplitVoidCell(vector & void_list, + McCadGeomData * pData); + + void SetSplitAxis(SplitAxis split_axis); + void SetCollidedSolidNumList(vector theCollidedSolidNumList ); + void SetSplitDepth(Standard_Integer iSplitDepth); + + void ChangeFaceNum(McCadGeomData * pData); + void CalColliedFaces(McCadGeomData *pData); + + Standard_Boolean IsPointInBBox(gp_Pnt pnt); + + Standard_Integer SideofFace(gp_Pnt pnt, McCadExtFace *& theFace); + Standard_Boolean CalColliedVertex(McCadExtFace *& theFace); + Standard_Boolean IsVertexInSolid(McCadConvexSolid *& pSolid); + Standard_Boolean CalColliedFace(McCadExtFace *& theFace); + Standard_Boolean CalColliedBox(Bnd_Box & box); + Standard_Boolean PntInBox(gp_Pnt &pnt, Bnd_Box & box); + + vector GetFaces(); + vector GetCollision(); + + +}; + +#endif // MCCADVOIDCELL_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCellManager.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCellManager.cxx new file mode 100644 index 0000000..a2e1a0a --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCellManager.cxx @@ -0,0 +1,253 @@ +#include "McCadVoidCellManager.hxx" +#include "McCadMcnpWriter.hxx" +#include "McCadTripoliWriter.hxx" +#include "McCadGDMLWriter.hxx" + +#include +#include +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadGeneTool.hxx" + +McCadVoidCellManager::McCadVoidCellManager() +{ + m_bGenerateVoid = McCadConvertConfig::GenerateVoid(); // Turn on/off the void generating switch + if (m_bGenerateVoid == 0) + { + McCadConvertConfig::SetMinMaxSmplPntNum(10,20); + } + m_Convertor = "MCNP"; // The default convetor is MCNP +} + +McCadVoidCellManager::~McCadVoidCellManager() +{ +} + + +/** ******************************************************************** +* @brief Set the output file name according to the input file name +* +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 07/01/2014 +* @author Lei Lu +***********************************************************************/ +void McCadVoidCellManager::SetOutFileName(TCollection_AsciiString theFileName) +{ + m_OutFileName = theFileName; +} + + + +/** ******************************************************************** +* @brief The main process control function +* 1. call the void generation and collision detect function +* 2. Load the material information +* 3. Output the input file +* +* @param null +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidCellManager::Process() +{ + // Add by Lei 12/11/2013 Load the material XML file. + TCollection_AsciiString material_file = "material.xml"; + ReadMatData(material_file); + // + + McCadVoidGenerator *pVoidGen = new McCadVoidGenerator(this); + pVoidGen->Process(); + + m_pGeomData->SortSurface(); + m_pGeomData->UpdateFaceNum(); + + IMcCadWriter * pWriter = NULL; + if (m_Convertor == "TRIPOLI") + { + pWriter = new McCadTripoliWriter(); + ((McCadTripoliWriter *)pWriter)->SetVirtCellNum(10000); + } + else if (m_Convertor == "MCNP") + { + pWriter = new McCadMcnpWriter(); + } + + //qiu add GDML option + else if (m_Convertor == "GDML") + { + pWriter = new McCadGDMLWriter(); + } + + if (pWriter != NULL) + { + pWriter->SetMaterial(m_bHaveMaterial); + pWriter->SetVoid(m_bGenerateVoid); + pWriter->SetManager(this); + pWriter->SetFileName(m_OutFileName); + pWriter->PrintFile(); + } + + cout<SetManager(this); +} + + +/** ******************************************************************** +* @brief Read the material data +* @param TCollection_AsciiString & theMatFile: Material XML file +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidCellManager::ReadMatData(TCollection_AsciiString &theMatFile) +{ + if(theMatFile.IsEmpty()) + { + cout<<"================ Step.2 Load material data =============="< didn't find material xml file ..."<LoadXMLfile(QString(theMatFile.ToCString()),true); + if (bSetMaterial) + { + cout< material.xml has been loaded..."<m_SolidList.size(); i++) + { + pSolid = m_pGeomData->m_SolidList.at(i); + + QString groupName = m_pMat->GetGroupName(i+1); // Get group name according to solid id + int iMatID = m_pMat->GetMatNum(groupName); // Get material id according to group name + double fDensity = m_pMat->GetMatDensity(iMatID); // Get material density according to material id + QString material_name = m_pMat->GetMatName(iMatID); // Get material name according to material id + + pSolid->SetMaterial(iMatID,fDensity); + pSolid->SetName(McCadGeneTool::ToAsciiString(material_name)); + } +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCellManager.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCellManager.hxx new file mode 100644 index 0000000..9d0e3ed --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidCellManager.hxx @@ -0,0 +1,77 @@ +/** @file McCadVoidCellManager.hxx + * + * @brief The class manage the void generation and translate the CAD solids into MCNP file. + * There are two main functions: + * 1. Store the data including the CAD solid the void cells generated and the surfaces. + * 2. Control the main working flow including model reading, void filling and mcnp file printing. + * + * @author Lei Lu + * @date 1st.Aug.2012 + */ + +#ifndef MCCADVOIDCELLMANAGER_HXX +#define MCCADVOIDCELLMANAGER_HXX + +#include "McCadGeomData.hxx" +#include "McCadVoidGenerator.hxx" + +#include +#include +#include + +#include "../McCadTool/MaterialManager.hxx" + +using namespace std; + +class McCadVoidCellManager +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadVoidCellManager(); + ~McCadVoidCellManager(); + +//private: //qiu +protected: + + Standard_Boolean m_bHaveMaterial; /**< If the material file is existed, set true, else set false */ + Standard_Boolean m_bGenerateVoid; /**< The switch of void generation */ + + auto_ptr m_pGeomData; /**< Smart pointer of geometry data*/ + auto_ptr m_pMat; /**< Smart pointer of materailManager */ + + TCollection_AsciiString m_Convertor; /**< The type of output file, e.g. Tripoli or Mcnp */ + TCollection_AsciiString m_OutFileName; /**< The name of output file */ + +public: + /** Read the model, create the McCadGeomData object to store the geometry data. */ + void ReadGeomData(Handle_TopTools_HSequenceOfShape & solid_list); + /** Read the material xml file and store the material information */ + void ReadMatData(TCollection_AsciiString &theMatFile); + + void SetOutFileName(TCollection_AsciiString theFileName);/**< Set the output file name */ + McCadGeomData * GetGeomData(); /**< Get the pointer of geometry data */ + MaterialManager * GetMatManager(); /**< Get the material manager pointer */ + void AddMatOnSolid(); /**< Add the material information on each solid */ + void SetConvetor(TCollection_AsciiString theConvertor); /**< Set the convetor to tripoli or mcnp, or other codes */ + Standard_Boolean GenVoid(); /**< Generate void or not */ + + void Process(); /**< The main procesure */ + + +}; + + +#endif // MCCADVOIDCELLMANAGER_HXX diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidGenerator.cxx b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidGenerator.cxx new file mode 100644 index 0000000..9f6d6d5 --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/McCadVoidGenerator.cxx @@ -0,0 +1,308 @@ +#include "McCadVoidGenerator.hxx" + +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" + +McCadVoidGenerator::McCadVoidGenerator() +{ +} + +McCadVoidGenerator::~McCadVoidGenerator() +{ +} + +McCadVoidGenerator::McCadVoidGenerator(const McCadVoidCellManager * pManager) +{ +//qiu m_pManager = pManager; + m_pManager = const_cast (pManager); +} + + + +/** ********************************************************************** +* @brief Generate the void boxes based on the dimension of material solids +* +* @param const vector & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +**************************************************************************/ +void McCadVoidGenerator::GenVoidCells() +{ + Bnd_Box bnd_box; + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_ConvexSolidList.size(); i++) + { + cout<<"."; + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[i]; + assert(pSolid); + BRepBndLib::Add((TopoDS_Shape)(*pSolid),bnd_box); // Add each convex solid into bundary box + } + cout<SetBntBox(dXmin,dYmin,dZmin,dXmax,dYmax,dZmax); + pData->m_pOutVoid = pVoid; + + /* Split the boundar box into several parts */ + int iSplit = 2; + for (int iX = 0 ; iX < iSplit ; iX++) + { + Standard_Real xMin = dXmin+(dXmax-dXmin)*iX/iSplit; + Standard_Real xMax = dXmin+(dXmax-dXmin)*(iX+1)/iSplit; + for (int iY = 0; iY < iSplit; iY++ ) + { + Standard_Real yMin = dYmin+(dYmax-dYmin)*iY/iSplit; + Standard_Real yMax = dYmin+(dYmax-dYmin)*(iY+1)/iSplit; + for (int iZ = 0; iZ < iSplit; iZ++ ) + { + Standard_Real zMin = dZmin +(dZmax-dZmin)*iZ/iSplit; + Standard_Real zMax = dZmin +(dZmax-dZmin)*(iZ+1)/iSplit; + + McCadMathTool::Integer(xMin); + McCadMathTool::Integer(yMin); + McCadMathTool::Integer(zMin); + McCadMathTool::Integer(xMax); + McCadMathTool::Integer(yMax); + McCadMathTool::Integer(zMax); + + gp_Pnt max_pnt(xMax,yMax,zMax); + gp_Pnt min_pnt(xMin,yMin,zMin); + + pData->m_listVoidCell->Append(BRepPrimAPI_MakeBox(min_pnt,max_pnt).Shape()); + + McCadVoidCell * pVoid = new McCadVoidCell(BRepPrimAPI_MakeBox(min_pnt,max_pnt).Solid()); + pVoid->SetBntBox(xMin,yMin,zMin,xMax,yMax,zMax); + pData->m_VoidCellList.push_back(pVoid); + + cout<<"."; + } + } + } + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::VoidSolidCollision() +{ + McCadGeomData * pData = m_pManager->GetGeomData(); + + try + { + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell *pVoid = pData->m_VoidCellList[i]; + assert(pVoid); + + cout<<"Process No."<m_ConvexSolidList.size(); j++) + { + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[j]; + assert(pSolid); + + Bnd_Box bbox_solid = pSolid->GetBntBox(); + Bnd_Box bbox_void = pVoid->GetBntBox(); + + if(bbox_void.IsOut(bbox_solid)) // Detect the boundary boxes are collied or not + { + continue; + } + else + { + // Add the collided material solid's number into the void cell's list. + pVoid->AddColliedSolidNum(j); + } + } + cout<GetColliedSolidList().size(); j++) + { + cout<GetColliedSolidList()[j]<<" "; + } + cout <<"cells"<< endl; + }*/ + + } + catch(...) + { + cout << "#McCadVoidCellManage_Void & Face Collision Error" << endl; + } +} + + + + +/** ******************************************************************** +* @brief Calculate the collision between faces of solid and void cell +* +* @param const vector & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::VoidFaceCollision() +{ + McCadGeomData * pData = m_pManager->GetGeomData(); + + try + { + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell *pVoid = pData->m_VoidCellList[i]; + assert(pVoid); + cout<<"Void cell " << i+1 << " is collided with:"; + pVoid->CalColliedFaces(m_pManager->GetGeomData()); // Calculate the collision between the void cell and boundary surface. + } + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::SplitVoidCell() +{ + try + { + McCadGeomData * pData = m_pManager->GetGeomData(); + vector void_list; // Create a temporary void cell list to store the void cells after splitting. + for (int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = pData->m_VoidCellList.at(i); + assert(pVoid); + pVoid->SetSplitDepth(1); // Set the initial split depth. + + cout<<"Processing the "<SplitVoidCell(void_list, m_pManager->GetGeomData())) + { + pData->m_VoidCellList.erase(pData->m_VoidCellList.begin()+i); // Delete the original void cell + i--; // Move the point to the former position + } + cout<m_VoidCellList.push_back(void_list.at(j)); // Add the new void cell generated into void cell list. + } + void_list.clear(); + } + catch(...) + { + cout << "#McCadVoidCellManage_Void & Splitting Void Cell Error" << endl; + } + +} + + +/** ******************************************************************** +* @brief Generate the surface list of void cells. +* +* @param +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::GenVoidSurfList() +{ + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = pData->m_VoidCellList.at(i); + assert(pVoid); + vector surf_list = pVoid->GetGeomFaceList(); + pData->AddGeomSurfList(surf_list); // Merge the sufaces with the surface list of material solids + } + + vector out_surf_list = pData->m_pOutVoid->GetGeomFaceList(); + pData->AddGeomSurfList(out_surf_list); // Add the surfaces of outer space into the surface list. +} + + +/** ******************************************************************** +* @brief The main process control function +* @param null +* @return void +* +* @date 31/10/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::Process() +{ + if(m_pManager->GenVoid() == Standard_True)// If the switch of void generation is on + { + cout<<"=============== Step.3 Generate the void cells ==============="< +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif + +#define Item Handle_McCadConvexSolid +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfCell_Type_() +#include + +Standard_EXPORT Handle_Standard_Type& McCad_HSequenceOfCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("TopTools_HsequenceOfConvexSolid", + sizeof(TopTools_HsequenceOfConvexSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(TopTools_HsequenceOfConvexSolid) Handle(TopTools_HsequenceOfConvexSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(TopTools_HsequenceOfConvexSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(TopTools_HsequenceOfConvexSolid))) { + _anOtherObject = Handle(TopTools_HsequenceOfConvexSolid)((Handle(TopTools_HsequenceOfConvexSolid)&)AnObject); + } + } + + return _anOtherObject ; +} + +const Handle(Standard_Type)& TopTools_HsequenceOfConvexSolid::DynamicType() const +{ + return STANDARD_TYPE(TopTools_HsequenceOfConvexSolid) ; +} diff --git a/src/MCCAD/McCadMcVoid-beforeGithub/TopTools_HsequenceOfConvexSolid.hxx b/src/MCCAD/McCadMcVoid-beforeGithub/TopTools_HsequenceOfConvexSolid.hxx new file mode 100644 index 0000000..71f446b --- /dev/null +++ b/src/MCCAD/McCadMcVoid-beforeGithub/TopTools_HsequenceOfConvexSolid.hxx @@ -0,0 +1,151 @@ +#ifndef TOPTOOLS_HSEQUENCEOFCONVEXSOLID_H +#define TOPTOOLS_HSEQUENCEOFCONVEXSOLID_H + +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_HSequenceOfConvexSolid_HeaderFile +//#include +#endif + +#ifndef _MMgt_TShared_HeaderFile +#include +#endif + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif + +#include "McCadConvexSolid.hxx" + +class Standard_NoSuchObject; +class Standard_OutOfRange; + +class TopTools_HSequenceOfConvexSolid : public MMgt_TShared { + +public: +// Methods PUBLIC +// + +TopTools_HSequenceOfConvexSolid(); + + Standard_Boolean IsEmpty() const; + Standard_Integer Length() const; + + Standard_EXPORT void Clear() ; + Standard_EXPORT void Append(const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void Append(const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void Prepend(const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void Prepend(const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void Reverse() ; + + Standard_EXPORT void InsertBefore(const Standard_Integer anIndex, + const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void InsertBefore(const Standard_Integer anIndex, + const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void InsertAfter(const Standard_Integer anIndex, + const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void InsertAfter(const Standard_Integer anIndex, + const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void Exchange(const Standard_Integer anIndex, + const Standard_Integer anOtherIndex) ; + Standard_EXPORT TopTools_HSequenceOfConvexSolid Split(const Standard_Integer anIndex) ; + Standard_EXPORT void SetValue(const Standard_Integer anIndex, + const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT const Handle_McCadConvexSolid& Value(const Standard_Integer anIndex) const; + + Standard_EXPORT Handle_McCadConvexSolid& ChangeValue(const Standard_Integer anIndex) ; + Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const TopTools_HSequenceOfConvexSolid& Sequence() const; + + TopTools_HSequenceOfConvexSolid& ChangeSequence() ; + + Standard_EXPORT Handle_TopTools_HSequenceOfConvexSolid ShallowCopy() const; + //Standard_EXPORT ~McCadCSGGeom_HSequenceOfCell(); + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + + protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + TopTools_HSequenceOfConvexSolid mySequence; + + +}; + +#define Item Handle_McCadCSGGeom_Cell +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfCell_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_TopTools_HSequenceOfConvexSolid ShallowCopy(const Handle_TopTools_HSequenceOfConvexSolid& me) { + return me->ShallowCopy(); +} + + +#endif // TOPTOOLS_HSEQUENCEOFCONVEXSOLID_H +//#endif diff --git a/src/MCCAD/McCadMcVoid/IGeomFace.cxx b/src/MCCAD/McCadMcVoid/IGeomFace.cxx new file mode 100644 index 0000000..0719924 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/IGeomFace.cxx @@ -0,0 +1 @@ +#include "IGeomFace.hxx" diff --git a/src/MCCAD/McCadMcVoid/IGeomFace.hxx b/src/MCCAD/McCadMcVoid/IGeomFace.hxx new file mode 100644 index 0000000..7fdec89 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/IGeomFace.hxx @@ -0,0 +1,81 @@ +#ifndef IGEOMFACE_HXX +#define IGEOMFACE_HXX + +#include +#include +#include +#include +#include + +#ifndef _Standard_TypeDef_HeaderFile +#include +#endif + +using namespace std; + +enum SurfType { surfPlane = 0, + surfCylinder = 1, + surfSphere = 2, + surfCone = 3, + surfTorus = 4, + surfRev = 5}; + +class IGeomFace +{ +public: + IGeomFace(){} + virtual ~IGeomFace(){} + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + virtual TCollection_AsciiString GetExpression() = 0; /**< Get the expression of surface */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace) = 0; /**< Judge the two surface is same or not */ + virtual void CleanObj() const = 0; /**< Clean the object */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) = 0; /**< Clean the object */ + virtual TCollection_AsciiString GetTransfNum() const = 0; + +public: + SurfType GetFaceType() const{ return m_SurfType; } /**< Get the surface type */ + void SetSurfNum(int iNum){ m_iNum = iNum; } /**< Set the number of surface */ + Standard_Integer GetSurfNum(){ return m_iNum; } /**< Get the number of surface */ + // xiugai lei*/ + Standard_Real GetUnit(){return 0.1;} /**< Get the unit used */ + void SetUnit(Standard_Real theRatio){m_ScaleRatio = theRatio;} /**< Set the unit */ + + TCollection_AsciiString GetSurfSymb() const{ return m_SurfSymb; } /**< Get the surface type */ + + //Standard_Real GetFstPrmt() const{ return m_FstPrmt; } /**< Get the first parameter */ +//qiu vector GetPrmtList(){return m_PrmtList;} + vector GetPrmtList() const {return m_PrmtList;} + Standard_Boolean IsReversed(){return m_bReverse;} + +protected: + + Standard_Integer m_iNum; /**< The surface number in list */ + SurfType m_SurfType; /**< Face Type */ + gp_Pnt m_PntOnFace; /**< A point on the suface */ + TCollection_AsciiString m_SurfExpn; /**< Face Expression of Solid */ + Standard_Integer m_iCodeNum; /**< MaCadExtFace can find the geomtry surface using the number */ + Standard_Real m_ScaleRatio; /**< The scale ratio according to the unit CAD model used */ + + //Standard_Integer m_SurfSeqNum; + //Standard_Real m_FstPrmt; + + TCollection_AsciiString m_SurfSymb; + vector m_PrmtList; + + Standard_Boolean m_bReverse; /**< whether the surface has been reversed or not */ +}; + +#endif // IGEOMFACE_HXX diff --git a/src/MCCAD/McCadMcVoid/IMcCadWriter.cxx b/src/MCCAD/McCadMcVoid/IMcCadWriter.cxx new file mode 100644 index 0000000..cf93dc4 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/IMcCadWriter.cxx @@ -0,0 +1,73 @@ +#include "IMcCadWriter.hxx" + +#include "../McCadTool/McCadConvertConfig.hxx" + +IMcCadWriter::IMcCadWriter() +{ + m_iInitCellNum = McCadConvertConfig::GetInitCellNum(); + m_iInitFaceNum = McCadConvertConfig::GetInitSurfNum(); +} + +IMcCadWriter::~IMcCadWriter() +{ +} + + +/** ******************************************************************** +* @brief Set the name of output file. +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetFileName(TCollection_AsciiString theFileName) +{ + m_OutputFileName = theFileName; +} + + +/** ******************************************************************** +* @brief Set the manager pointer. +* @param McCadVoidCellManager * pManager +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetManager(McCadVoidCellManager *pManager) +{ + m_pManager = pManager; +} + + +/** ******************************************************************** +* @brief Set the material switch to control the output of material card +* @param Standard_Boolean bMat +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetMaterial(Standard_Boolean bMat) +{ + m_bHaveMaterial = bMat; +} + + +/** ******************************************************************** +* @brief Set the void switch to control the output of void card +* @param Standard_Boolean bVoid +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void IMcCadWriter::SetVoid(Standard_Boolean bVoid) +{ + m_bGenerateVoid = bVoid; +} diff --git a/src/MCCAD/McCadMcVoid/IMcCadWriter.hxx b/src/MCCAD/McCadMcVoid/IMcCadWriter.hxx new file mode 100644 index 0000000..dae1ceb --- /dev/null +++ b/src/MCCAD/McCadMcVoid/IMcCadWriter.hxx @@ -0,0 +1,56 @@ +#ifndef IMCCADWRITER_HXX +#define IMCCADWRITER_HXX + +#include "McCadVoidCellManager.hxx" + +class IMcCadWriter +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +Standard_EXPORT IMcCadWriter(); +Standard_EXPORT virtual ~IMcCadWriter(); + +protected: + McCadVoidCellManager * m_pManager; /**< Corresponding manager */ + Standard_Boolean m_bHaveMaterial; /**< If the material file is existed, set true, else set false */ + Standard_Boolean m_bGenerateVoid; /**< The switch of void generation */ + TCollection_AsciiString m_OutputFileName; /**< The name of output file */ + + Standard_Integer m_iInitCellNum; /**< The initial number of cell */ + Standard_Integer m_iInitFaceNum; /**< The initial number of face */ + +public: + /** Print the output file, include head information, cell, void, surface, transform card */ +Standard_EXPORT virtual void PrintFile(){}; /**< Print the file */ + +Standard_EXPORT virtual void PrintHeadDesc(Standard_OStream& theStream){}; /**< Print the head */ +Standard_EXPORT virtual void PrintCellDesc(Standard_OStream& theStream){}; /**< Print the cell card */ +Standard_EXPORT virtual void PrintVoidDesc(Standard_OStream& theStream){}; /**< Print the void card */ +Standard_EXPORT virtual void PrintSurfDesc(Standard_OStream& theStream){}; /**< Print the surfaces list */ +Standard_EXPORT virtual void PrintTrsfDesc(Standard_OStream& theStream){}; /**< Print the transform card */ +Standard_EXPORT virtual void PrintMatCard(Standard_OStream& theStream){}; /**< Print the material card */ +//qiu not implement virtual void PrintVolumeCard(Standard_OStream& theStream){}; /**< Print the volume card */ + + /** Print the group information, including material name, group name, material id and density */ +Standard_EXPORT virtual void PrintGroupInfo(const int iSolid, Standard_OStream& theStream){}; + +Standard_EXPORT virtual void SetFileName(TCollection_AsciiString theFileName); /**< Set the output file name */ +Standard_EXPORT virtual void SetManager(McCadVoidCellManager *pManager); /**< Connect to the manager */ +Standard_EXPORT virtual void SetMaterial(Standard_Boolean bMat); /**< Set the switch of outputing of material*/ +Standard_EXPORT virtual void SetVoid(Standard_Boolean bVoid); /**< Set the switch of outputing of void card*/ +}; + +#endif // MCCADWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadConvexSolid-bak.cxx b/src/MCCAD/McCadMcVoid/McCadConvexSolid-bak.cxx new file mode 100644 index 0000000..473038e --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadConvexSolid-bak.cxx @@ -0,0 +1,626 @@ +#include "McCadConvexSolid.hxx" +#include "McCadExtFace.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadGeomTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadFuseSurface.hxx" + +/** ******************************************************************** +* @brief Construct function of McCadConvexSolid +* +* @param const TopoDS_Solid & theSolid +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadConvexSolid::McCadConvexSolid(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + //m_FaceList = new TopTools_HSequenceOfShape; // New a sequence to store the faces + m_DiscPntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + m_EdgePntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + + GenFacesList(theSolid); // Trace the boundary faces of solid, store in the list of faces. + GenEdgePoints(); // Generate the discrete points of each edges. + AddAuxSurfaces(); // Add assisted surfaces for concave curved surfaces. +} + + +McCadConvexSolid::~McCadConvexSolid() +{ + //m_FaceList->Clear(); + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); +} + + + +/** ******************************************************************** +* @brief Generate the face list +* +* @param const TopoDS_Solid & theSolid +* @return void +* +* @date 31/8/2012 +* @modify 4/2/2014 fuse the same boundary surfaces +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenFacesList(const TopoDS_Solid & theSolid) +{ +// TopExp_Explorer exp; // Traverse the faces of input solid +// for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TopoDS_Face theFace = TopoDS::Face(exp.Current()); +// McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces +// m_STLFaceList.push_back(pExtFace); +// m_iNumOfFaces++; +// } + + + TopExp_Explorer exp; // Traverse the faces of input solid + + vector face_list; + // vector fused_face_list; + vector fused_face_list; + + for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + face_list.push_back(theFace); + } + + McCadFuseSurface Fuser; // Fuse the surfaces with same geomtries and common edge + /// Traverse the surfaces, find the same surfaces + for(int i = 0; i < face_list.size(); i++ ) + { + for(int j = i+1; j < face_list.size(); j++ ) + { + Fuser.SetSurfaces(face_list.at(i),face_list.at(j)); + if(Fuser.Fuse()) + { + McCadExtFace *pExtFace = new McCadExtFace(Fuser.GetNewSurf()); + pExtFace->MergeDscPnt(face_list.at(i)); + pExtFace->MergeDscPnt(face_list.at(j)); + + face_list.erase(face_list.begin()+j); + face_list.erase(face_list.begin()+i); + fused_face_list.push_back(pExtFace); + + j -= 1; + i -= 1; + break; + } + } + } + + /// Based on the new boundary surfaces, generate the McCadExtFace and add into surface list. + for(int i = 0; i < face_list.size(); i++ ) + { + TopoDS_Face theFace = face_list.at(i); + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + for(int i = 0; i < fused_face_list.size(); i++ ) + { + McCadExtFace *pExtFace = fused_face_list.at(i); + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + face_list.clear(); + fused_face_list.clear(); +} + + + +/** ******************************************************************** +* @brief Add Auxiliary Surface to each concave curved surface +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::AddAuxSurfaces() +{ + for (int i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList.at(i); + /* Judge whether need to add auxiliary faces when there are curved surfaces */ + if( pExtFace->IsConcaveCurvedFace() ) // Judge the face is concave curve surface or not + { + /* Get the auxiliary faces list */ + vector theAuxFaceList = pExtFace->GetAuxFaces(); + /* Judge the auxiliary face whether can be add into auxiliary face list.*/ + JudgeAuxFaces(theAuxFaceList,pExtFace); + } + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TopoDS_Shape McCadConvexSolid::GetBntBoxShape() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBoxShape; + } + else + { + GetBntBox(); + return m_bBoxShape; + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadConvexSolid::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + gp_Pnt MaxPnt(fXmax, fYmax, fZmax); // The max point of the boundary box + gp_Pnt MinPnt(fXmin, fYmin, fZmin); // The min point of the boundary box + + m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenDescPoints(Standard_Boolean bGenVoid) +{ + /* Generate sample points of the each face */ + if (m_DiscPntList->IsEmpty()) + { + if (bGenVoid) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + pExtFace->GetDiscPntList(); // Discrete each face of convex solid. + } + } + } + + cout<<"-----1"<IsEmpty()) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Add the discrete point list of face into the one of solid + } + } +} + + + +/** ******************************************************************** +* @brief Judge the auxiliary face can be add into auxiliary face list +of this face +* +* @param vector & theAuxFaceList +* @param McCadExtFace *& theFace +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadConvexSolid::JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace) +{ + /* If the auxiliary face is sign-constant,it can be added into auxiliary face list */ + for (Standard_Integer i = 0; i < theAuxFaceList.size(); i++) + { + TopoDS_Face theAuxFace = *(theAuxFaceList[i]); + + BRepAdaptor_Surface BS(theAuxFace, Standard_True); + GeomAdaptor_Surface theAdpSurface = BS.Surface(); + + Standard_Integer iPosPnt = 0; + Standard_Integer iNegPnt = 0; + + //Standard_Real aVal = 1.0 + for (Standard_Integer j = 1; j <= m_EdgePntList->Length(); j++) + { + /* Distinguish which side does the point located.*/ + Standard_Real aVal = McCadGTOOL::Evaluate(theAdpSurface, m_EdgePntList->Value(j)); + + if (aVal > 1.0e-5) // Point located on the positive side of face + { + iPosPnt ++; + } + else if (aVal < -1.0e-5) // Point located on the negative side of face + { + iNegPnt ++; + } + + if (iPosPnt > 0 && iNegPnt > 0) // i.e sign changing + { + (theAuxFaceList[i])->AddAttri(1); + break; + } + } + } + return; +} + + +/** ******************************************************************** +* @brief Get the face list of solid +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadConvexSolid::GetSTLFaceList() +{ + return m_STLFaceList; +} + + + +/** ******************************************************************** +* @brief Discrete the faces and get the list of discreted points. +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadConvexSolid::GetDiscPntList() +{ + return m_DiscPntList; +} + + +void McCadConvexSolid::DeleteRepeatFace(Standard_Boolean bMergeDiscPnt) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if(pLeftFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + if (bMergeDiscPnt) + { + //pLeftFace->AddPntList(pRightFace->GetDiscPntList()); + //pLeftFace->UpdateBndBox(pRightFace->GetBndBox()); + //pLeftFace->AddAuxFaces(pRightFace->GetAuxFaces()); + //pLeftFace->AddMergedFaces(pRightFace); + pLeftFace->AddSameFaces(pRightFace); // Add the same face into samefacelist for collision detection + + } + + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + continue; + } + +// if(pLeftFace->HaveAuxSurf() && pRightFace->HaveAuxSurf()) +// { +// for (Standard_Integer iAux = 0; iAux < pLeftFace->GetAuxFaces().size(); iAux++) +// { +// McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(iAux); +// for (Standard_Integer jAux = 0; jAux < pRightFace->GetAuxFaces().size(); jAux++) +// { +// McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(jAux); +// if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) +// { +// pRightFace->GetAuxFaces().erase(pRightFace->GetAuxFaces().begin()+jAux); +// delete pRightAuxFace; +// pRightAuxFace = NULL; +// jAux--; +// } +// } +// } +// } + /* else if (!pLeftFace->HaveAuxSurf() && pRightFace->HaveAuxSurf()) + { + for (Standard_Integer iAux = 0; iAux < pRightFace->GetAuxFaces().size(); iAux++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(iAux); + if(pRightAuxFace->GetFaceNum() == pLeftFace->GetFaceNum()) + { + m_STLFaceList.erase(m_STLFaceList.begin()+i); + delete pLeftFace; + pLeftFace = NULL; + j--; + i--; + break; + } + } + if (pLeftFace == NULL) + { + break; + } + } + else if(pLeftFace->HaveAuxSurf() && !pRightFace->HaveAuxSurf()) + { + for (Standard_Integer iAux = 0; iAux < pLeftFace->GetAuxFaces().size(); iAux++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(iAux); + if(pLeftAuxFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + break; + } + } + }*/ + } + } +//to remove duplicate surface + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + for (Standard_Integer k = 0; k < pRightFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pRightFace->GetAuxFaces().at(k); + if(pLeftFace->GetFaceNum() == pAuxFace->GetFaceNum()) + { + cout<GetFaceNum()<<" "<GetFaceNum()<RemoveAuxFace(k); + k--; + continue; + } + } + } + } +} + +void McCadConvexSolid::DeleteRepeatAuxFace(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace, + unsigned int &iErase, unsigned int &jErase) +{ + for (Standard_Integer i = 0; i < pLeftFace->GetAuxFaces().size(); i++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(i); + for (Standard_Integer j = 0; j < pRightFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(j); + if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) + { + pRightFace->GetAuxFaces().erase(pRightFace->GetAuxFaces().begin()+j); + delete pRightAuxFace; + pRightAuxFace = NULL; + j--; + } + /*else if(pLeftAuxFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + pLeftFace->GetAuxFaces().erase(pLeftFace->GetAuxFaces().begin()+i); + delete pLeftAuxFace; + pLeftAuxFace = NULL; + i--; + }*/ + } + } + +} + + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadConvexSolid::GetExpression() +{ + if (!m_szExpression.IsEmpty()) + { + return m_szExpression; + } + + TCollection_AsciiString szAuxFaceUni = ""; + TCollection_AsciiString szAuxFaceSub = ""; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + + McCadExtFace * pExtFace = m_STLFaceList[i]; + /* if the orientation of face is minus,add "-" before the face number */ + //if(pExtFace->GetFaceOrientation() == MINUS) + //{ + //m_szExpression += "-"; + //} + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + if (szAuxFaceUni.Search(" ") != -1 ) + { + m_szExpression += " ("; + m_szExpression += szAuxFaceSub; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceSub; + m_szExpression += " "; + } + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + if (szAuxFaceUni.Search(":") != -1 ) + { + m_szExpression += "("; + m_szExpression += szAuxFaceUni; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceUni; + } + } + + return m_szExpression; +} + + +Standard_Real McCadConvexSolid::GetVolume() +{ + return McCadGeomTool::GetVolume(*this); +} + + +void McCadConvexSolid::ChangeFaceNum(McCadGeomData * pData) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace * pExtFace = m_STLFaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pExtFace->SetFaceNum(iFaceNumNew); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + iFaceNumOld = pAuxFace->GetFaceNum(); + iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pAuxFace->SetFaceNum(iFaceNumNew); + + /* Test Code */ + //cout<<"old:"< McCadConvexSolid::GetFaces() +{ + return m_STLFaceList; +} diff --git a/src/MCCAD/McCadMcVoid/McCadConvexSolid-bak.hxx b/src/MCCAD/McCadMcVoid/McCadConvexSolid-bak.hxx new file mode 100644 index 0000000..cfad3fa --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadConvexSolid-bak.hxx @@ -0,0 +1,100 @@ +/** @file + * @brief + * + * @author + * @date + */ + +#ifndef MCCADCONVEXSOLID_HXX +#define MCCADCONVEXSOLID_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "McCadExtFace.hxx" +#include "McCadTripoliCell.hxx" + + +using namespace std; + +//class McCadVoidCellManager; +class McCadGeomData; +class McCadConvexSolid : public TopoDS_Solid{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadConvexSolid(); + McCadConvexSolid(const TopoDS_Solid & theSolid); + ~McCadConvexSolid(); + +private: + + int m_iNum; /**< Number of Cell */ + int m_iMatNo; /**< Number of Material */ + + double m_dDensity; /**< Material Density */ + int m_iNeutronIMP; /**< Importance of Neutron */ + int m_iPhotonIMP; /**< Importance of Photon */ + + TCollection_AsciiString m_szExpression; /**< MCNP Expression of Solid */ + int m_iNumOfFaces; /**< Number of Boundary Surface */ + + TopoDS_Shape m_bBoxShape; /**< The shape of boundary box */ + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + //vector m_faceList; + //Handle_TopTools_HSequenceOfShape m_FaceList; /**< Facelist store the boundary face */ + vector m_STLFaceList; /**< Face list of convex solid */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points list */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges */ + + void GenFacesList(const TopoDS_Solid & theSolid); /**< Get the data of faces of solid */ + void AddAuxSurfaces(); /**< Add Auxiliary Surface to each concave curved surface*/ + + /** If the auxiliary face is sign-constant, add it into auxiliary face list */ + void JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace); + +public: + + /** Set the number material number and some information of cell */ + void SetCellInfo(int iNum, int iMat, double fDensity, int iNeutronIMP, int iPhotonIMP); + + TopoDS_Shape GetBntBoxShape(); /**< Get boundary box shape */ + Bnd_Box GetBntBox(); /**< Get boundary box */ + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get the discrete point list */ + + vector GetSTLFaceList(); /**< Get the face list */ + TCollection_AsciiString GetExpression(); /**< Generate solid expression */ + void GenDescPoints(Standard_Boolean bGenVoid); /**< Descrete the faces and store the points into list */ + void GenEdgePoints(); + + void ChangeFaceNum(McCadGeomData * pData); + void DeleteRepeatFace(Standard_Boolean bMergeDiscPnt); + void DeleteRepeatAuxFace(McCadExtFace *&pLeftFace, McCadExtFace *&pRightFace, unsigned int &iErase, unsigned int &jErase); + Standard_Real GetVolume(); + + vector GetFaces(); +}; + +#endif // MCCADCONVEXSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadConvexSolid.cxx b/src/MCCAD/McCadMcVoid/McCadConvexSolid.cxx new file mode 100644 index 0000000..f111f7f --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadConvexSolid.cxx @@ -0,0 +1,586 @@ +#include "McCadConvexSolid.hxx" +#include "McCadExtFace.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadGeomTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadFuseSurface.hxx" + + + +/** ******************************************************************** +* @brief Construct function of McCadConvexSolid +* +* @param const TopoDS_Solid & theSolid +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadConvexSolid::McCadConvexSolid(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + //m_FaceList = new TopTools_HSequenceOfShape; // New a sequence to store the faces + m_DiscPntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + m_EdgePntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + + GenFacesList(theSolid); // Trace the boundary faces of solid, store in the list of faces. + GenEdgePoints(); // Generate the discrete points of each edges. + AddAuxSurfaces(); // Add assisted surfaces for concave curved surfaces. +} + + +McCadConvexSolid::~McCadConvexSolid() +{ + //m_FaceList->Clear(); + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); +} + + + +/** ******************************************************************** +* @brief Generate the face list +* +* @param const TopoDS_Solid & theSolid +* @return void +* +* @date 31/8/2012 +* @modify 4/2/2014 fuse the same boundary surfaces +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenFacesList(const TopoDS_Solid & theSolid) +{ +// TopExp_Explorer exp; // Traverse the faces of input solid +// for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TopoDS_Face theFace = TopoDS::Face(exp.Current()); +// McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces +// m_STLFaceList.push_back(pExtFace); +// m_iNumOfFaces++; +// } + + + TopExp_Explorer exp; // Traverse the faces of input solid + + vector face_list; + // vector fused_face_list; + vector fused_face_list; + + for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + face_list.push_back(theFace); + } + + McCadFuseSurface Fuser; // Fuse the surfaces with same geomtries and common edge + /// Traverse the surfaces, find the same surfaces + for(int i = 0; i < face_list.size(); i++ ) + { + for(int j = i+1; j < face_list.size(); j++ ) + { + Fuser.SetSurfaces(face_list.at(i),face_list.at(j)); + if(Fuser.Fuse()) + { + McCadExtFace *pExtFace = new McCadExtFace(Fuser.GetNewSurf()); + pExtFace->MergeDscPnt(face_list.at(i)); + pExtFace->MergeDscPnt(face_list.at(j)); + + face_list.erase(face_list.begin()+j); + face_list.erase(face_list.begin()+i); + fused_face_list.push_back(pExtFace); + + j -= 1; + i -= 1; + break; + } + } + } + + /// Based on the new boundary surfaces, generate the McCadExtFace and add into surface list. + for(int i = 0; i < face_list.size(); i++ ) + { + TopoDS_Face theFace = face_list.at(i); + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + for(int i = 0; i < fused_face_list.size(); i++ ) + { + McCadExtFace *pExtFace = fused_face_list.at(i); + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + face_list.clear(); + fused_face_list.clear(); +} + + + +/** ******************************************************************** +* @brief Add Auxiliary Surface to each concave curved surface +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::AddAuxSurfaces() +{ + for (int i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList.at(i); + /* Judge whether need to add auxiliary faces when there are curved surfaces */ + if( pExtFace->IsConcaveCurvedFace() ) // Judge the face is concave curve surface or not + { + /* Get the auxiliary faces list */ + vector theAuxFaceList = pExtFace->GetAuxFaces(); + /* Judge the auxiliary face whether can be add into auxiliary face list.*/ + JudgeAuxFaces(theAuxFaceList,pExtFace); + } + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TopoDS_Shape McCadConvexSolid::GetBntBoxShape() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBoxShape; + } + else + { + GetBntBox(); + return m_bBoxShape; + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadConvexSolid::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + gp_Pnt MaxPnt(fXmax, fYmax, fZmax); // The max point of the boundary box + gp_Pnt MinPnt(fXmin, fYmin, fZmin); // The min point of the boundary box + + m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenDescPoints(Standard_Boolean bGenVoid) +{ + /* Generate sample points of the each face */ + if (m_DiscPntList->IsEmpty()) + { + if (bGenVoid) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + pExtFace->GetDiscPntList(); // Discrete each face of convex solid. + } + } + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenEdgePoints() +{ + if (m_EdgePntList->IsEmpty()) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Add the discrete point list of face into the one of solid + } + } +} + + + +/** ******************************************************************** +* @brief Judge the auxiliary face can be add into auxiliary face list +of this face +* +* @param vector & theAuxFaceList +* @param McCadExtFace *& theFace +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadConvexSolid::JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace) +{ + /* If the auxiliary face is sign-constant,it can be added into auxiliary face list */ + for (Standard_Integer i = 0; i < theAuxFaceList.size(); i++) + { + TopoDS_Face theAuxFace = *(theAuxFaceList[i]); + + BRepAdaptor_Surface BS(theAuxFace, Standard_True); + GeomAdaptor_Surface theAdpSurface = BS.Surface(); + + Standard_Integer iPosPnt = 0; + Standard_Integer iNegPnt = 0; + + //Standard_Real aVal = 1.0 + for (Standard_Integer j = 1; j <= m_EdgePntList->Length(); j++) + { + /* Distinguish which side does the point located.*/ + Standard_Real aVal = McCadGTOOL::Evaluate(theAdpSurface, m_EdgePntList->Value(j)); + + if (aVal > 1.0e-5) // Point located on the positive side of face + { + iPosPnt ++; + } + else if (aVal < -1.0e-5) // Point located on the negative side of face + { + iNegPnt ++; + } + + if (iPosPnt > 0 && iNegPnt > 0) // i.e sign changing + { + (theAuxFaceList[i])->AddAttri(1); + break; + } + } + } + return; +} + + +/** ******************************************************************** +* @brief Get the face list of solid +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadConvexSolid::GetSTLFaceList() +{ + return m_STLFaceList; +} + + + +/** ******************************************************************** +* @brief Discrete the faces and get the list of discreted points. +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadConvexSolid::GetDiscPntList() +{ + return m_DiscPntList; +} + + +void McCadConvexSolid::DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt) +{ + MergeBndFaces(bMergeDiscPnt); + MergeBndAuxFaces(); + + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if (pLeftFace->HaveAuxSurf() && pRightFace->HaveAuxSurf()) + { + MergeAuxFaces(pLeftFace,pRightFace); + } + } + } +} + + +void McCadConvexSolid::MergeBndFaces(Standard_Boolean bMergeDiscPnt) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if(pLeftFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + if (bMergeDiscPnt) + { + pLeftFace->AddSameFaces(pRightFace); // Add the same face into samefacelist for collision detection + } + + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + continue; + } + } + } +} + + +void McCadConvexSolid::MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace) +{ + for (Standard_Integer i = 0; i < pLeftFace->GetAuxFaces().size(); i++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(i); + for (Standard_Integer j = 0; j < pRightFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(j); + if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) + { + pRightFace->RemoveAuxFace(j); + j--; + } + } + } +} + +void McCadConvexSolid::MergeBndAuxFaces() +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + if (i == j) + { + continue; + } + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + McCadExtFace *pRightFace = m_STLFaceList.at(j); + for (Standard_Integer k = 0; k < pRightFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pRightFace->GetAuxFaces().at(k); + if(pLeftFace->GetFaceNum() == pAuxFace->GetFaceNum()) + { + pRightFace->RemoveAuxFace(k); + k--; + continue; + } + } + } + } +} + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadConvexSolid::GetExpression() +{ + if (!m_szExpression.IsEmpty()) + { + return m_szExpression; + } + + TCollection_AsciiString szAuxFaceUni = ""; + TCollection_AsciiString szAuxFaceSub = ""; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + + McCadExtFace * pExtFace = m_STLFaceList[i]; + /* if the orientation of face is minus,add "-" before the face number */ + //if(pExtFace->GetFaceOrientation() == MINUS) + //{ + //m_szExpression += "-"; + //} + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + if (szAuxFaceUni.Search(" ") != -1 ) + { + m_szExpression += " ("; + m_szExpression += szAuxFaceSub; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceSub; + m_szExpression += " "; + } + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + if (szAuxFaceUni.Search(":") != -1 ) + { + m_szExpression += "("; + m_szExpression += szAuxFaceUni; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceUni; + } + } + + return m_szExpression; +} + + +Standard_Real McCadConvexSolid::GetVolume() +{ + return m_fVolume; +} + + +void McCadConvexSolid::SetVolume(Standard_Real fVolume) +{ + m_fVolume = fVolume; +} + + +void McCadConvexSolid::ChangeFaceNum(McCadGeomData * pData) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace * pExtFace = m_STLFaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pExtFace->SetFaceNum(iFaceNumNew); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + iFaceNumOld = pAuxFace->GetFaceNum(); + iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pAuxFace->SetFaceNum(iFaceNumNew); + + /* Test Code */ + //cout<<"old:"< McCadConvexSolid::GetFaces() +{ + return m_STLFaceList; +} diff --git a/src/MCCAD/McCadMcVoid/McCadConvexSolid.hxx b/src/MCCAD/McCadMcVoid/McCadConvexSolid.hxx new file mode 100644 index 0000000..11df783 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadConvexSolid.hxx @@ -0,0 +1,105 @@ +/** @file + * @brief + * + * @author + * @date + */ + +#ifndef MCCADCONVEXSOLID_HXX +#define MCCADCONVEXSOLID_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "McCadExtFace.hxx" +#include "McCadTripoliCell.hxx" + + +using namespace std; + +//class McCadVoidCellManager; +class McCadGeomData; +class McCadConvexSolid : public TopoDS_Solid{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +Standard_EXPORT McCadConvexSolid(); +Standard_EXPORT McCadConvexSolid(const TopoDS_Solid & theSolid); +Standard_EXPORT ~McCadConvexSolid(); + +private: + + int m_iNum; /**< Number of Cell */ + int m_iMatNo; /**< Number of Material */ + + double m_dDensity; /**< Material Density */ + int m_iNeutronIMP; /**< Importance of Neutron */ + int m_iPhotonIMP; /**< Importance of Photon */ + + Standard_Real m_fVolume; /**< Volume of the solid*/ + + TCollection_AsciiString m_szExpression; /**< MCNP Expression of Solid */ + int m_iNumOfFaces; /**< Number of Boundary Surface */ + + TopoDS_Shape m_bBoxShape; /**< The shape of boundary box */ + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + //vector m_faceList; + //Handle_TopTools_HSequenceOfShape m_FaceList; /**< Facelist store the boundary face */ + vector m_STLFaceList; /**< Face list of convex solid */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points list */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges */ + + void GenFacesList(const TopoDS_Solid & theSolid); /**< Get the data of faces of solid */ + void AddAuxSurfaces(); /**< Add Auxiliary Surface to each concave curved surface*/ + + /** If the auxiliary face is sign-constant, add it into auxiliary face list */ + void JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace); + +public: + + /** Set the number material number and some information of cell */ +Standard_EXPORT void SetCellInfo(int iNum, int iMat, double fDensity, int iNeutronIMP, int iPhotonIMP); + +Standard_EXPORT TopoDS_Shape GetBntBoxShape(); /**< Get boundary box shape */ +Standard_EXPORT Bnd_Box GetBntBox(); /**< Get boundary box */ +Standard_EXPORT Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get the discrete point list */ + +Standard_EXPORT vector GetSTLFaceList(); /**< Get the face list */ +Standard_EXPORT TCollection_AsciiString GetExpression(); /**< Generate solid expression */ +Standard_EXPORT void GenDescPoints(Standard_Boolean bGenVoid); /**< Descrete the faces and store the points into list */ +Standard_EXPORT void GenEdgePoints(); + +Standard_EXPORT void ChangeFaceNum(McCadGeomData * pData); +Standard_EXPORT void DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt); /**< Delete the repeat faces */ +Standard_EXPORT void MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace); /**< Merge auxilary surfaces*/ +Standard_EXPORT void MergeBndAuxFaces(); /**< Merge boundary surfaces and auxiliary surfaces */ +Standard_EXPORT void MergeBndFaces(Standard_Boolean bMergeDiscPnt); /**< Merge boundary surfaces */ +Standard_EXPORT void SetVolume(Standard_Real fVolume); /**< Set the volume */ +Standard_EXPORT Standard_Real GetVolume(); /**< Get the volume */ + +Standard_EXPORT vector GetFaces(); +}; + +#endif // MCCADCONVEXSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadConvexSolid_GeomErr.cxx b/src/MCCAD/McCadMcVoid/McCadConvexSolid_GeomErr.cxx new file mode 100644 index 0000000..74ece59 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadConvexSolid_GeomErr.cxx @@ -0,0 +1,575 @@ +#include "McCadConvexSolid.hxx" +#include "McCadExtFace.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadGeomTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadFuseSurface.hxx" + +/** ******************************************************************** +* @brief Construct function of McCadConvexSolid +* +* @param const TopoDS_Solid & theSolid +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadConvexSolid::McCadConvexSolid(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + //m_FaceList = new TopTools_HSequenceOfShape; // New a sequence to store the faces + m_DiscPntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + m_EdgePntList = new TColgp_HSequenceOfPnt; // New a sequence to store the descrete points + + GenFacesList(theSolid); // Trace the boundary faces of solid, store in the list of faces. + GenEdgePoints(); // Generate the discrete points of each edges. + AddAuxSurfaces(); // Add assisted surfaces for concave curved surfaces. +} + + +McCadConvexSolid::~McCadConvexSolid() +{ + //m_FaceList->Clear(); + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); +} + + + +/** ******************************************************************** +* @brief Generate the face list +* +* @param const TopoDS_Solid & theSolid +* @return void +* +* @date 31/8/2012 +* @modify 4/2/2014 fuse the same boundary surfaces +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenFacesList(const TopoDS_Solid & theSolid) +{ +// TopExp_Explorer exp; // Traverse the faces of input solid +// for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) +// { +// TopoDS_Face theFace = TopoDS::Face(exp.Current()); +// McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces +// m_STLFaceList.push_back(pExtFace); +// m_iNumOfFaces++; +// } + + + TopExp_Explorer exp; // Traverse the faces of input solid + + vector face_list; + // vector fused_face_list; + vector fused_face_list; + + for(exp.Init(theSolid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + face_list.push_back(theFace); + } + + McCadFuseSurface Fuser; // Fuse the surfaces with same geomtries and common edge + /// Traverse the surfaces, find the same surfaces + for(int i = 0; i < face_list.size(); i++ ) + { + for(int j = i+1; j < face_list.size(); j++ ) + { + Fuser.SetSurfaces(face_list.at(i),face_list.at(j)); + if(Fuser.Fuse()) + { + McCadExtFace *pExtFace = new McCadExtFace(Fuser.GetNewSurf()); + pExtFace->MergeDscPnt(face_list.at(i)); + pExtFace->MergeDscPnt(face_list.at(j)); + + face_list.erase(face_list.begin()+j); + face_list.erase(face_list.begin()+i); + fused_face_list.push_back(pExtFace); + + j -= 1; + i -= 1; + break; + } + } + } + + /// Based on the new boundary surfaces, generate the McCadExtFace and add into surface list. + for(int i = 0; i < face_list.size(); i++ ) + { + TopoDS_Face theFace = face_list.at(i); + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create the extended faces + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + for(int i = 0; i < fused_face_list.size(); i++ ) + { + McCadExtFace *pExtFace = fused_face_list.at(i); + m_STLFaceList.push_back(pExtFace); + m_iNumOfFaces++; + } + + face_list.clear(); + fused_face_list.clear(); +} + + + +/** ******************************************************************** +* @brief Add Auxiliary Surface to each concave curved surface +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::AddAuxSurfaces() +{ + for (int i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList.at(i); + /* Judge whether need to add auxiliary faces when there are curved surfaces */ + if( pExtFace->IsConcaveCurvedFace() ) // Judge the face is concave curve surface or not + { + /* Get the auxiliary faces list */ + vector theAuxFaceList = pExtFace->GetAuxFaces(); + /* Judge the auxiliary face whether can be add into auxiliary face list.*/ + JudgeAuxFaces(theAuxFaceList,pExtFace); + } + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TopoDS_Shape McCadConvexSolid::GetBntBoxShape() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBoxShape; + } + else + { + GetBntBox(); + return m_bBoxShape; + } +} + + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadConvexSolid::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + gp_Pnt MaxPnt(fXmax, fYmax, fZmax); // The max point of the boundary box + gp_Pnt MinPnt(fXmin, fYmin, fZmin); // The min point of the boundary box + + m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + + + +/** ******************************************************************** +* @brief Traverse the faces of solid and get the discreted poins list +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadConvexSolid::GenDescPoints(Standard_Boolean bGenVoid) +{ + /* Generate sample points of the each face */ + if (m_DiscPntList->IsEmpty()) + { + if (bGenVoid) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + pExtFace->GetDiscPntList(); // Discrete each face of convex solid. + } + } + } + + cout<<"-----1"<IsEmpty()) + { + for(Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace *pExtFace = m_STLFaceList[i]; + m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Add the discrete point list of face into the one of solid + } + } +} + + + +/** ******************************************************************** +* @brief Judge the auxiliary face can be add into auxiliary face list +of this face +* +* @param vector & theAuxFaceList +* @param McCadExtFace *& theFace +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadConvexSolid::JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace) +{ + /* If the auxiliary face is sign-constant,it can be added into auxiliary face list */ + for (Standard_Integer i = 0; i < theAuxFaceList.size(); i++) + { + TopoDS_Face theAuxFace = *(theAuxFaceList[i]); + + BRepAdaptor_Surface BS(theAuxFace, Standard_True); + GeomAdaptor_Surface theAdpSurface = BS.Surface(); + + Standard_Integer iPosPnt = 0; + Standard_Integer iNegPnt = 0; + + //Standard_Real aVal = 1.0 + for (Standard_Integer j = 1; j <= m_EdgePntList->Length(); j++) + { + /* Distinguish which side does the point located.*/ + Standard_Real aVal = McCadGTOOL::Evaluate(theAdpSurface, m_EdgePntList->Value(j)); + + if (aVal > 1.0e-5) // Point located on the positive side of face + { + iPosPnt ++; + } + else if (aVal < -1.0e-5) // Point located on the negative side of face + { + iNegPnt ++; + } + + if (iPosPnt > 0 && iNegPnt > 0) // i.e sign changing + { + (theAuxFaceList[i])->AddAttri(1); + break; + } + } + } + return; +} + + +/** ******************************************************************** +* @brief Get the face list of solid +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadConvexSolid::GetSTLFaceList() +{ + return m_STLFaceList; +} + + + +/** ******************************************************************** +* @brief Discrete the faces and get the list of discreted points. +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadConvexSolid::GetDiscPntList() +{ + return m_DiscPntList; +} + + +void McCadConvexSolid::DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt) +{ + MergeBndFaces(bMergeDiscPnt); + MergeBndAuxFaces(); + + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + MergeAuxFaces(pLeftFace,pRightFace); + } + } +} + + +void McCadConvexSolid::MergeBndFaces(Standard_Boolean bMergeDiscPnt) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = i+1; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + if(pLeftFace->GetFaceNum() == pRightFace->GetFaceNum()) + { + if (bMergeDiscPnt) + { + pLeftFace->AddSameFaces(pRightFace); // Add the same face into samefacelist for collision detection + } + + m_STLFaceList.erase(m_STLFaceList.begin()+j); + delete pRightFace; + pRightFace = NULL; + j--; + continue; + } + } + } +} + + +void McCadConvexSolid::MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace) +{ + for (Standard_Integer i = 0; i < pLeftFace->GetAuxFaces().size(); i++) + { + McCadExtFace *pLeftAuxFace = pLeftFace->GetAuxFaces().at(i); + for (Standard_Integer j = 0; j < pRightFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pRightAuxFace = pRightFace->GetAuxFaces().at(j); + if(pLeftAuxFace->GetFaceNum() == pRightAuxFace->GetFaceNum()) + { + pRightFace->RemoveAuxFace(j); + j--; + } + } + } + +} + +void McCadConvexSolid::MergeBndAuxFaces() +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size()-1; i++) + { + McCadExtFace *pLeftFace = m_STLFaceList.at(i); + for (Standard_Integer j = 0; j < m_STLFaceList.size(); j++) + { + McCadExtFace *pRightFace = m_STLFaceList.at(j); + for (Standard_Integer k = 0; k < pRightFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pRightFace->GetAuxFaces().at(k); + if(pLeftFace->GetFaceNum() == pAuxFace->GetFaceNum()) + { + cout<GetFaceNum()<<" "<GetFaceNum()<RemoveAuxFace(k); + k--; + continue; + } + } + } + } +} + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadConvexSolid::GetExpression() +{ + if (!m_szExpression.IsEmpty()) + { + return m_szExpression; + } + + TCollection_AsciiString szAuxFaceUni = ""; + TCollection_AsciiString szAuxFaceSub = ""; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + + McCadExtFace * pExtFace = m_STLFaceList[i]; + /* if the orientation of face is minus,add "-" before the face number */ + //if(pExtFace->GetFaceOrientation() == MINUS) + //{ + //m_szExpression += "-"; + //} + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + if (szAuxFaceUni.Search(" ") != -1 ) + { + m_szExpression += " ("; + m_szExpression += szAuxFaceSub; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceSub; + m_szExpression += " "; + } + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + if (szAuxFaceUni.Search(":") != -1 ) + { + m_szExpression += "("; + m_szExpression += szAuxFaceUni; + m_szExpression += ") "; + } + else + { + m_szExpression += szAuxFaceUni; + } + } + + return m_szExpression; +} + + +Standard_Real McCadConvexSolid::GetVolume() +{ + return McCadGeomTool::GetVolume(*this); +} + + +void McCadConvexSolid::ChangeFaceNum(McCadGeomData * pData) +{ + for (Standard_Integer i = 0; i < m_STLFaceList.size(); i++) + { + McCadExtFace * pExtFace = m_STLFaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pExtFace->SetFaceNum(iFaceNumNew); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + iFaceNumOld = pAuxFace->GetFaceNum(); + iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + + pAuxFace->SetFaceNum(iFaceNumNew); + + /* Test Code */ + //cout<<"old:"< McCadConvexSolid::GetFaces() +{ + return m_STLFaceList; +} diff --git a/src/MCCAD/McCadMcVoid/McCadConvexSolid_GeomErr.hxx b/src/MCCAD/McCadMcVoid/McCadConvexSolid_GeomErr.hxx new file mode 100644 index 0000000..f8f8809 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadConvexSolid_GeomErr.hxx @@ -0,0 +1,102 @@ +/** @file + * @brief + * + * @author + * @date + */ + +#ifndef MCCADCONVEXSOLID_HXX +#define MCCADCONVEXSOLID_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include "McCadExtFace.hxx" +#include "McCadTripoliCell.hxx" + + +using namespace std; + +//class McCadVoidCellManager; +class McCadGeomData; +class McCadConvexSolid : public TopoDS_Solid{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadConvexSolid(); + McCadConvexSolid(const TopoDS_Solid & theSolid); + ~McCadConvexSolid(); + +private: + + int m_iNum; /**< Number of Cell */ + int m_iMatNo; /**< Number of Material */ + + double m_dDensity; /**< Material Density */ + int m_iNeutronIMP; /**< Importance of Neutron */ + int m_iPhotonIMP; /**< Importance of Photon */ + + TCollection_AsciiString m_szExpression; /**< MCNP Expression of Solid */ + int m_iNumOfFaces; /**< Number of Boundary Surface */ + + TopoDS_Shape m_bBoxShape; /**< The shape of boundary box */ + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + //vector m_faceList; + //Handle_TopTools_HSequenceOfShape m_FaceList; /**< Facelist store the boundary face */ + vector m_STLFaceList; /**< Face list of convex solid */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points list */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges */ + + void GenFacesList(const TopoDS_Solid & theSolid); /**< Get the data of faces of solid */ + void AddAuxSurfaces(); /**< Add Auxiliary Surface to each concave curved surface*/ + + /** If the auxiliary face is sign-constant, add it into auxiliary face list */ + void JudgeAuxFaces(vector & theAuxFaceList, McCadExtFace *& theFace); + +public: + + /** Set the number material number and some information of cell */ + void SetCellInfo(int iNum, int iMat, double fDensity, int iNeutronIMP, int iPhotonIMP); + + TopoDS_Shape GetBntBoxShape(); /**< Get boundary box shape */ + Bnd_Box GetBntBox(); /**< Get boundary box */ + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get the discrete point list */ + + vector GetSTLFaceList(); /**< Get the face list */ + TCollection_AsciiString GetExpression(); /**< Generate solid expression */ + void GenDescPoints(Standard_Boolean bGenVoid); /**< Descrete the faces and store the points into list */ + void GenEdgePoints(); + + void ChangeFaceNum(McCadGeomData * pData); + void DeleteRepeatFaces(Standard_Boolean bMergeDiscPnt); /**< Delete the repeat faces */ + void MergeAuxFaces(McCadExtFace *& pLeftFace, McCadExtFace *& pRightFace); /**< Merge auxilary surfaces*/ + void MergeBndAuxFaces(); /**< Merge boundary surfaces and auxiliary surfaces */ + void MergeBndFaces(Standard_Boolean bMergeDiscPnt); /**< Merge boundary surfaces */ + Standard_Real GetVolume(); + + vector GetFaces(); +}; + +#endif // MCCADCONVEXSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadExtAuxFace.cxx b/src/MCCAD/McCadMcVoid/McCadExtAuxFace.cxx new file mode 100644 index 0000000..9e89c41 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadExtAuxFace.cxx @@ -0,0 +1,54 @@ +#include "McCadExtAuxFace.hxx" + +McCadExtAuxFace::McCadExtAuxFace() +{ +} + +Standard_Integer McCadExtAuxFace::GetConvexity() +{ + return m_iConvexity; +} +/** ******************************************************************** +* @brief Construct function +* +* @param const TopoDS_Face &theFace +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtAuxFace::McCadExtAuxFace(const TopoDS_Face &theFace):McCadExtFace(theFace) +{ + +} + + + +/** ******************************************************************** +* @brief Copy construct function +* +* @param const McCadExtFace &theExtFace +* @return +* +* @date 14/3/2013 +* @author Lei Lu +************************************************************************/ +McCadExtAuxFace::McCadExtAuxFace(const McCadExtAuxFace &theExtFace) +{ + +} + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtAuxFace::~McCadExtAuxFace() +{ + +} diff --git a/src/MCCAD/McCadMcVoid/McCadExtAuxFace.hxx b/src/MCCAD/McCadMcVoid/McCadExtAuxFace.hxx new file mode 100644 index 0000000..4822654 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadExtAuxFace.hxx @@ -0,0 +1,39 @@ +#ifndef MCCADEXTAUXFACE_HXX +#define MCCADEXTAUXFACE_HXX + +#include "McCadExtFace.hxx" + +class McCadExtAuxFace : public McCadExtFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadExtAuxFace(); + McCadExtAuxFace(const TopoDS_Face &theFace); + McCadExtAuxFace(const McCadExtAuxFace &theExtFace); + ~McCadExtAuxFace(); + +private: + + Standard_Integer m_iConvexity; /**< Judge if the auxiliary face can cut the solid into two parts */ + +public: + + void SetConvexity(Standard_Integer m_iConvexity); /**< Add convexity to the auxiliary face */ + Standard_Integer GetConvexity(); /**< Get convexity of the auxiliary face */ + +}; + +#endif // MCCADEXTAUXFACE_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadExtBndFace.cxx b/src/MCCAD/McCadMcVoid/McCadExtBndFace.cxx new file mode 100644 index 0000000..4a11a09 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadExtBndFace.cxx @@ -0,0 +1,330 @@ +#include "McCadExtBndFace.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +//#include "../McCadTool/McCadConvertConfig.hxx" + +McCadExtBndFace::McCadExtBndFace() +{ +} + +/** ******************************************************************** +* @brief Construct function +* +* @param const TopoDS_Face &theFace +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtBndFace::McCadExtBndFace(const TopoDS_Face &theFace):McCadExtFace(theFace) +{ + m_bHaveAuxFace = Standard_False; + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = new TColgp_HSequenceOfPnt; +} + + + +/** ******************************************************************** +* @brief Copy construct function +* +* @param const McCadExtFace &theExtFace +* @return +* +* @date 14/3/2013 +* @author Lei Lu +************************************************************************/ +McCadExtBndFace::McCadExtBndFace(const McCadExtBndFace &theExtFace) +{ + *this = theExtFace; +} + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtBndFace::~McCadExtBndFace() +{ + m_DiscPntList->Clear(); + m_EdgePntList->Clear(); + for (unsigned int i = 0; i < m_AuxFaceList.size(); i++) + { + McCadExtFace *pFace = m_AuxFaceList.at(i); + delete pFace; + pFace = NULL; + } +} + + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtBndFace::RemoveAuxFace(Standard_Integer index) +{ + m_AuxFaceList.clear(); +} + + +/** ******************************************************************** +* @brief Judge the face has auxiliary face or not. +* +* @param +* @return +* +* @date +* @author +************************************************************************/ +Standard_Boolean McCadExtBndFace::HaveAuxSurf() +{ + return m_bHaveAuxFace; +} + + +/** ******************************************************************** +* @brief Judge the face is concave curved face or not +* +* @param +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadExtBndFace::IsConcaveCurvedFace() +{ + /* Judge the face is plane or not, plane needn't to add auxiliary face */ + TopLoc_Location loc; + Handle_Geom_Surface theGeomSurface = BRep_Tool::Surface(*this,loc); + GeomAdaptor_Surface theAdaptedSurface(theGeomSurface); + if(theAdaptedSurface.GetType() == GeomAbs_Plane) + { + return Standard_False; + } + + /* If the curved surface is forward, no need to add auxiliary face */ + if(this->Orientation() == TopAbs_FORWARD) + { + return Standard_False; + } + else if(this->Orientation() == TopAbs_REVERSED) + { + /* If the max and min UV parameter of the face is same, the face is unaviliable. */ + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(*this, UMin,UMax, VMin, VMax); + + /* gp::Resolution is tolerance to judge the points is same or not, + So judge the curved face is close or not. */ + if ( fabs(UMax - UMin)<= gp::Resolution() || fabs(VMax - VMin)<= gp::Resolution()) + { + return Standard_False; + } + return Standard_True; + } + return Standard_False; +} + + +/** ******************************************************************** +* @brief Get the discreted sample points of face +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadExtBndFace::GetDiscPntList() +{ + if (m_DiscPntList->Length() == 0) + { + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_DiscPntList = McCadGeomTool::GetFaceSamplePnt(*this); + cout<<"Sample points of face ----------------------------- "<Length()<Length() == 0) + { + m_EdgePntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = McCadGeomTool::GetEdgeSamplePnt(*this); + cout<<"Sample points of edge ----------------------------- "<Length()< +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector McCadExtBndFace::GetAuxFaces() +{ + if (m_bHaveAuxFace == Standard_False) + { + Handle_TopTools_HSequenceOfShape tmpFaceList = new TopTools_HSequenceOfShape(); + tmpFaceList = McCadCSGTool::Partials(*this); // Calculate the auxiliary faces + if(tmpFaceList->Length() == 0) + { + return m_AuxFaceList; + } + for (int i = 1; i <= tmpFaceList->Length(); i++) + { + TopoDS_Face tmpFace = TopoDS::Face(tmpFaceList->Value(i)); + McCadExtFace * pExtFace = new McCadExtFace(tmpFace); +//qiu m_AuxFaceList.push_back(pExtFace); + m_AuxFaceList.push_back(static_cast (pExtFace)); + } + tmpFaceList->Clear(); + m_bHaveAuxFace = Standard_True; // The face has auxiliary faces + return m_AuxFaceList; + } + else + { + return m_AuxFaceList; + } +} + + +/** ******************************************************************** +* @brief Add the auxiliary faces +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtBndFace::AddAuxFaces(vector< McCadExtAuxFace* > faces) +{ + //GetAuxFaces(); + for(Standard_Integer i = 0; i < faces.size(); i++) + { + for (Standard_Integer j = 0; j < m_AuxFaceList.size(); j++) + { + Standard_Integer iAuxFaceNum = m_AuxFaceList.at(j)->GetFaceNum(); + // if the two auxilary faces are same surfaces with different oritation, + // remove them, because (-1 : 1) means whole space. + if(faces.at(i)->GetFaceNum() == -iAuxFaceNum) + { + McCadExtAuxFace *pAuxFace = m_AuxFaceList.at(j); + m_AuxFaceList.erase(m_AuxFaceList.begin()+j); + delete pAuxFace; + pAuxFace = NULL; + j--; + continue; + } + // if the auxilary faces are same, do not add + else if (faces.at(i)->GetFaceNum() == iAuxFaceNum) + { + continue; + } + // if the auxilary faces are different faces, create a new one + // and add to the auxilary face lis of one face. + else + { + McCadExtAuxFace *pExtFace = new McCadExtAuxFace(*faces.at(i)); + m_AuxFaceList.push_back(pExtFace); + } + } + + } +} + + +/** ******************************************************************** +* @brief Get the same face list +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector< McCadExtBndFace* > McCadExtBndFace::GetSameFaces() +{ + return m_SameFaceList; +} + + +/** ******************************************************************** +* @brief If a solid has two same surfaces, add one of them into the + samefacelist of another's. and update the mesh points list + and boundary box for collision detection. +* +* @param int iNum +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtBndFace::AddSameFaces( McCadExtBndFace* faces) +{ + m_EdgePntList->Append(faces->GetEdgePntList()); // Merge the discrete edge points of the two same faces + m_DiscPntList->Append(faces->GetDiscPntList()); // Merge the discrete face points of the two same faces + + GetBndBox(); // Merge the boundary box + m_bBox.Add(faces->GetBndBox()); + + AddAuxFaces(faces->GetAuxFaces()); // Merge the auxiliary face + McCadExtBndFace *pExtFace = new McCadExtBndFace(*faces); // Put one face into sameface list of another face + m_SameFaceList.push_back(pExtFace); +} + + +void McCadExtBndFace::AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list) +{ + m_DiscPntList->Append(pnt_list); +} diff --git a/src/MCCAD/McCadMcVoid/McCadExtBndFace.hxx b/src/MCCAD/McCadMcVoid/McCadExtBndFace.hxx new file mode 100644 index 0000000..48eeb1a --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadExtBndFace.hxx @@ -0,0 +1,65 @@ +#ifndef MCCADEXTBNDFACE_HXX +#define MCCADEXTBNDFACE_HXX + +#include "McCadExtFace.hxx" +#include "McCadExtAuxFace.hxx" + +class McCadExtBndFace : public McCadExtFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadExtBndFace(); + McCadExtBndFace(const TopoDS_Face &theFace); + McCadExtBndFace(const McCadExtBndFace &theExtFace); + ~McCadExtBndFace(); + +private: + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points of faces */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges of this face */ + + Standard_Boolean m_bHaveAuxFace; /**< Whether have auxiliary face */ + vector< McCadExtAuxFace* > m_AuxFaceList; /**< Auxiliary face list */ + + ORIENTATION m_symbol; /**< The direction of plane is positive or negative */ + + Bnd_Box m_bBox; + GeomAbs_SurfaceType m_FaceType; + + vector< McCadExtBndFace* > m_SameFaceList; /**< Merge the same surface of one solid */ + +public: + + Standard_Boolean IsConcaveCurvedFace(); /**< Concave curved face need to add auxiliary face */ + + void RemoveAuxFace(Standard_Integer index); /**< Remove the face with the face number*/ + vector GetAuxFaces(); /**< Get the auxiliary faces list */ + void AddAuxFaces(vector faces); /**< Add a list of faces as auxiliary faces*/ + Standard_Boolean HaveAuxSurf(); /**< If this face has auxiliary face*/ + + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get discrete point list of face */ + void AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list); /** Add point list*/ + Handle_TColgp_HSequenceOfPnt GetEdgePntList(); /**< Get the discrete point list of edges*/ + + //Bnd_Box GetBndBox(); /**< Get the boundary box of face*/ + void UpdateBndBox(Bnd_Box theBBox); /**< Update the boundary box of face*/ + + void AddSameFaces(McCadExtBndFace *faces); /**< Add the face with same geometry into same face list*/ + vector< McCadExtBndFace* > GetSameFaces(); /**< Get the face in same face list*/ + +}; + +#endif // MCCADEXTBNDFACE_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadExtFace.cxx b/src/MCCAD/McCadMcVoid/McCadExtFace.cxx new file mode 100644 index 0000000..2d630c3 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadExtFace.cxx @@ -0,0 +1,735 @@ +#include "McCadExtFace.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +McCadExtFace::McCadExtFace() +{ +} + +/** ******************************************************************** +* @brief Construct function +* +* @param const TopoDS_Face &theFace +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtFace::McCadExtFace(const TopoDS_Face &theFace):TopoDS_Face(theFace) +{ + m_bHaveAuxFace = Standard_False; + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = new TColgp_HSequenceOfPnt; + m_iAttri = 0; + m_bFusedFace = Standard_False; +} + + + +/** ******************************************************************** +* @brief Copy construct function +* +* @param const McCadExtFace &theExtFace +* @return +* +* @date 14/3/2013 +* @author Lei Lu +************************************************************************/ +McCadExtFace::McCadExtFace(const McCadExtFace &theExtFace):TopoDS_Face(theExtFace) +{ + //m_bHaveAuxFace = Standard_False; + //m_DiscPntList = new TColgp_HSequenceOfPnt; + m_iFaceNum = theExtFace.m_iFaceNum; + //*this = theExtFace; + m_iAttri = theExtFace.GetAttri(); + +} + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadExtFace::~McCadExtFace() +{ + m_DiscPntList->Clear(); + for (unsigned int i = 0; i < m_AuxFaceList.size(); i++) + { + McCadExtFace *pFace = m_AuxFaceList.at(i); + delete pFace; + pFace = NULL; + } +} + + + +/** ******************************************************************** +* @brief Remove the auxiliary face +* +* @param Standard_Integer i +* @return +* +* @date 31/8/2012 +* @modify 04/09/2014 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::RemoveAuxFace(Standard_Integer index) +{ + McCadExtFace * pFace = m_AuxFaceList.at(index); + m_AuxFaceList.erase(m_AuxFaceList.begin()+index); + delete pFace; + pFace = NULL; +} + + + +/** ******************************************************************** +* @brief Add attribute to the auxiliary face +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::AddAttri(Standard_Integer iAttri) +{ + m_iAttri = iAttri; +} + + + + +/** ******************************************************************** +* @brief Judge the face is concave curved face or not +* +* @param +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadExtFace::IsConcaveCurvedFace() +{ + /* Judge the face is plane or not, plane needn't to add auxiliary face */ + TopLoc_Location loc; + Handle_Geom_Surface theGeomSurface = BRep_Tool::Surface(*this,loc); + GeomAdaptor_Surface theAdaptedSurface(theGeomSurface); + + SetFaceType(theAdaptedSurface.GetType()); + + if(theAdaptedSurface.GetType() == GeomAbs_Plane) + { + return Standard_False; + } + + /* If the curved surface is forward, no need to add auxiliary face */ + if(this->Orientation() == TopAbs_FORWARD) + { + return Standard_False; + } + else if(this->Orientation() == TopAbs_REVERSED) + { + /* If the max and min UV parameter of the face is same, the face is unaviliable. */ + Standard_Real UMin,UMax, VMin, VMax; + BRepTools::UVBounds(*this, UMin,UMax, VMin, VMax); + + /* gp::Resolution is tolerance to judge the points is same or not, + So judge the curved face is close or not. */ + if ( fabs(UMax - UMin)<= gp::Resolution() || fabs(VMax - VMin)<= gp::Resolution()) + { + return Standard_False; + } + return Standard_True; + } + return Standard_False; +} + + +/** ******************************************************************** +* @brief Get the discreted sample points of face +* +* @param +* @return Handle_TColgp_HSequenceOfPnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Handle_TColgp_HSequenceOfPnt McCadExtFace::GetDiscPntList() +{ + if (m_DiscPntList->Length() == 0) + { + m_DiscPntList = new TColgp_HSequenceOfPnt; + m_DiscPntList = McCadGeomTool::GetFaceSamplePnt(*this); + cout<<">>> Sample points of face ....................... "<Length()<Length() == 0) + { + m_EdgePntList = new TColgp_HSequenceOfPnt; + m_EdgePntList = McCadGeomTool::GetEdgeSamplePnt(*this); + cout<<">>> Sample points of edge ....................... "<Length()<Length(); i++) + // { + // pos = m_EdgePntList->Value(i); + // cout<<"y"< +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector McCadExtFace::GetAuxFaces() +{ + if (m_bHaveAuxFace == Standard_False) + { + Handle_TopTools_HSequenceOfShape AuxFaceList = new TopTools_HSequenceOfShape(); + if ( (!McCadCSGTool::AddAuxSurf(*this,AuxFaceList)) + || (AuxFaceList->Length() == 0)) // Calculate the auxiliary faces + { + return m_AuxFaceList; + } + + for (int i = 1; i <= AuxFaceList->Length(); i++) + { + TopoDS_Face tmpFace = TopoDS::Face(AuxFaceList->Value(i)); + McCadExtFace * pExtFace = new McCadExtFace(tmpFace); + m_AuxFaceList.push_back(pExtFace); + } + + AuxFaceList->Clear(); + m_bHaveAuxFace = Standard_True; // The face has auxiliary faces + return m_AuxFaceList; + } + else + { + return m_AuxFaceList; + } +} + + + +/** ******************************************************************** +* @brief Add the auxiliary faces +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::AddAuxFaces(vector< McCadExtFace* > faces) +{ + // Whether the two faces have same auxilary surfaces + Standard_Boolean bRepeat = Standard_False; + for(Standard_Integer i = 0; i < faces.size(); i++) + { + for (Standard_Integer j = 0; j < m_AuxFaceList.size(); j++) + { + Standard_Integer iAuxFaceNum = m_AuxFaceList.at(j)->GetFaceNum(); + // if the two auxilary faces are same surfaces with different oritation, + // remove them, because (-1 : 1) means whole space. + if(faces.at(i)->GetFaceNum() == -iAuxFaceNum) + { + McCadExtFace *pAuxFace = m_AuxFaceList.at(j); + m_AuxFaceList.erase(m_AuxFaceList.begin()+j); + delete pAuxFace; + pAuxFace = NULL; + j--; + bRepeat = Standard_True; + break; + } + // if the auxilary faces are same, do not add + else if (faces.at(i)->GetFaceNum() == iAuxFaceNum) + { + bRepeat = Standard_True; + break; + } + + // if the auxilary faces are different faces, create a new one + // and add to the auxilary face lis of one face. + if (!bRepeat) + { + McCadExtFace *pExtFace = new McCadExtFace(*faces.at(i)); + m_AuxFaceList.push_back(pExtFace); + } + } + } +} + + +/** ******************************************************************** +* @brief Get the same face list +* +* @param +* @return vector +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector< McCadExtFace* > McCadExtFace::GetSameFaces() +{ + return m_SameFaceList; +} + + + +/** ******************************************************************** +* @brief If a solid has two same surfaces, add one of them into the + samefacelist of another's. and update the mesh points list + and boundary box for collision detection. +* +* @param int iNum +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::AddSameFaces( McCadExtFace* faces) +{ + m_EdgePntList->Append(faces->GetEdgePntList()); // Merge the discrete edge points of the two same faces + if (McCadConvertConfig::GenerateVoid()) + { + m_DiscPntList->Append(faces->GetDiscPntList()); // Merge the discrete face points of the two same faces + } + + GetBndBox(); // Merge the boundary box + m_bBox.Add(faces->GetBndBox()); + + if(faces->HaveAuxSurf()) + { + AddAuxFaces(faces->GetAuxFaces()); // Merge the auxiliary face + } + + McCadExtFace *pExtFace = new McCadExtFace(*faces); // Put one face into sameface list of another face + m_SameFaceList.push_back(pExtFace); +} + + + +/** ******************************************************************** +* @brief +* +* +* +* @param int iNum +* @return void +* +* @date 7/2/2014 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::MergeDscPnt(TopoDS_Face &theFace) +{ + McCadExtFace *pExtFace = new McCadExtFace(theFace); // Create a McCadExtFace based on original face + + // m_EdgePntList->Append(pExtFace->GetEdgePntList()); // Merge the discrete edge points of the two same faces + + //if (McCadConvertConfig::GenerateVoid()) + // { + // m_DiscPntList->Append(pExtFace->GetDiscPntList()); // Merge the discrete face points of the two same faces + // } + + //m_bBox.Add(pExtFace->GetBndBox()); // Merge the boundary box + AddSameFaces(pExtFace); + m_bFusedFace = Standard_True; + + //delete pExtFace; + //pExtFace = NULL; +} + + + + +Standard_Boolean McCadExtFace::HaveAuxSurf() +{ + return m_bHaveAuxFace; +} + + + + +/** ******************************************************************** +* @brief Set the number of face according the storing position of face list +* +* @param int iNum +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadExtFace::SetFaceNum(int iNum) +{ + if(this->GetFaceOrientation() == MINUS ) + { + m_iFaceNum = -1 * iNum ;//* m_Reverse; + } + else + { + m_iFaceNum = iNum ;//* m_Reverse; + } +} + + + +/** ******************************************************************** +* @brief Get face number which can be used to find the geometry information +* +* @param +* @return Standard_Integer +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Integer McCadExtFace::GetFaceNum() +{ + return m_iFaceNum; +} + + + +/** ******************************************************************** +* @brief Get the orientation of face, is forward or reversed +* +* @param +* @return ENUM ORIENTATION (PLUS or MINUS) +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +ORIENTATION McCadExtFace::GetFaceOrientation() +{ + TopAbs_Orientation orient = this->Orientation(); + if (orient == TopAbs_FORWARD) + { + return MINUS; // Add minus symbol + } + else if(orient == TopAbs_REVERSED) + { + return PLUS; // Add plus symbol + } +} + + +Bnd_Box McCadExtFace::GetBndBox() +{ + if(!m_bBox.IsVoid()) + { + return m_bBox; + } + + Bnd_Box tmpBBox; + BRepBndLib::Add(*this, tmpBBox); + + tmpBBox.SetGap(0.0); + Standard_Real xMin, yMin, zMin, xMax, yMax, zMax; + tmpBBox.Get(xMin, yMin, zMin, xMax, yMax, zMax); + gp_Pnt lower(xMin, yMin, zMin), upper(xMax, yMax, zMax); + + McCadGeomTool::SimplifyPoint(lower); + McCadGeomTool::SimplifyPoint(upper); + + m_bBox.Add(lower); + m_bBox.Add(upper); + + return m_bBox; +} + + +void McCadExtFace::UpdateBndBox(Bnd_Box theBBox) +{ + if(m_bBox.IsVoid()) + { + GetBndBox(); + } + m_bBox.Add(theBBox); +} + + +GeomAbs_SurfaceType McCadExtFace::GetFaceType() +{ + return m_FaceType; +} + + +void McCadExtFace::SetFaceType(GeomAbs_SurfaceType theFaceType) +{ + m_FaceType = theFaceType; +} + + +void McCadExtFace::AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list) +{ + m_DiscPntList->Append(pnt_list); +} + + + +/*Handle_TColgp_HSequenceOfPnt McCadExtFace::Init() +{ + BRepClass_FaceClassifier bsc3d; + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + + BRepAdaptor_Curve2d c; + TopoDS_Face theFace = *this; + + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + /*Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; +// + +// Standard_Integer nbBrimPoints(0); + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50 ; + myYlen = 50; + myRlen = 0.0314; + myTolerance = 1e-07; + + for (TopExp_Explorer ex(theFace, TopAbs_EDGE); ex.More(); ex.Next()) + { + c.Initialize(TopoDS::Edge(ex.Current()), theFace); + Standard_Real f = (!(Precision::IsNegativeInfinite(c.FirstParameter()))) ? c.FirstParameter() : -1.0; + Standard_Real l = (!(Precision::IsPositiveInfinite(c.LastParameter()))) ? c.LastParameter() : 1.0; + + gp_Pnt2d pf = c.Value(f); + gp_Pnt2d pl = c.Value(l); + gp_Pnt p3f; + theASurface.D0(pf.X(), pf.Y(), p3f); + gp_Pnt p3l; + theASurface.D0(pl.X(), pl.Y(), p3l); + Standard_Real Len = p3f.Distance(p3l); + Standard_Integer NUMPNT; + if (int(Len/myXlen) < myMinNbPnt) + NUMPNT = myMinNbPnt; + else if (int(Len/myXlen) > myMaxNbPnt) + NUMPNT = myMaxNbPnt; + else + NUMPNT = int(Len/myXlen); + + for (int t=0; t<=NUMPNT; t++) + { + Standard_Real a = Standard_Real(t)/Standard_Real(NUMPNT); + Standard_Real par = (1-a)*f + a*l; + gp_Pnt2d p2 = c.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bsc3d.Perform(theFace, p2, myTolerance); + + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON) + thePntSeq->Append(p1); + } + + + + } + + + + + cout << "Length------------------------" << thePntSeq->Length() <Length(); + + //////////////////////////////////////////////////////////////////////////////////////////////////// + Standard_Real U1, U2, V1, V2; + BRepTools::UVBounds(theFace, U1, U2, V1, V2); + + if (theASurface.GetType() == GeomAbs_Cone ||theASurface.GetType() == GeomAbs_Cylinder) + { + myXlen = myRlen; + } + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + myXlen = myRlen; + myYlen = myRlen; + } + + // cout << "U1 = " << U1 << " U2 = " << U2 << " V1 = " << V1 << " V2 = " << V2 << endl; + Standard_Real du=1, dv=1; + + Standard_Real XLen=U2-U1; + Standard_Real YLen=V2-V1; + Standard_Integer XNUMPNT; + if (int(XLen/myXlen) < myMinNbPnt) + XNUMPNT = myMinNbPnt; + else if (int(XLen/myXlen) > myMaxNbPnt) + XNUMPNT = myMaxNbPnt; + else + XNUMPNT = int(XLen/myXlen); + // cout << "XNUMPNT = " << XNUMPNT << endl; + Standard_Integer YNUMPNT; + if (int(YLen/myYlen) < myMinNbPnt) + YNUMPNT = myMinNbPnt; + else if (int(YLen/myYlen) > myMaxNbPnt) + YNUMPNT = myMaxNbPnt; + else + YNUMPNT = int(YLen/myYlen); + // cout << "YNUMPNT = " << YNUMPNT << endl; + + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = new TColgp_HSequenceOfPnt(); + + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + cout << "XLen = " << XLen << endl; + cout << "YLen = " << YLen << endl; + cout << "XNUMPNT = " << XNUMPNT << endl; + cout << "YNUMPNT = " << YNUMPNT << endl; + cout << "myMinNbPnt = " << myMinNbPnt << endl; + + } + + Standard_Integer repeat = 0; + do + { + if (repeat > 3) + break; + + du = XLen/Standard_Real(XNUMPNT); + dv = YLen/Standard_Real(YNUMPNT); + + tmpPntSeq->Clear(); + + for (int j=0; j<=YNUMPNT; j++) + { + Standard_Real V = V1+dv*j; + + for (int i=0; i<=XNUMPNT; i++) + { + gp_Pnt p1; + Standard_Real U = U1+du*i; + theASurface.D0(U, V, p1); + gp_Pnt2d p2(U, V); + + bsc3d.Perform(theFace, p2, myTolerance); + if (bsc3d.State() == TopAbs_IN /*|| bsc3d.State() == TopAbs_ON) //MYTEST comment + tmpPntSeq->Append(p1); + } + } + + XNUMPNT=XNUMPNT*2; + YNUMPNT=YNUMPNT*2; + repeat++; + + } while (tmpPntSeq->Length() < myMinNbPnt*myMinNbPnt); + + if (theASurface.GetType() == GeomAbs_Sphere ||theASurface.GetType() == GeomAbs_Torus) + { + cout << "XNUMPNT = " << XNUMPNT << endl; + cout << "YNUMPNT = " << YNUMPNT << endl; + cout << "myMinNbPnt = " << myMinNbPnt << endl; + + } + + + + thePntSeq->Append(tmpPntSeq); + + + + // we add vetices here + for (TopExp_Explorer exv(theFace, TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + thePntSeq->Prepend(aPnt); + } + + /////////////////////////////////////////////////////////////////////////////////////////////// + // remove sample points which have been added multiple times + for (int j=2; j<= thePntSeq->Length(); j++) + { + gp_XYZ p1 = (thePntSeq->Value(j)).XYZ(); + for (int jk=j-1; jk >= 1; jk--) + { + gp_XYZ p2 = (thePntSeq->Value(jk)).XYZ(); + + //cout << p1.X()*p1.X() + p1.Y()*p1.Y() + p1.Z()*p1.Z() + p2.X()*p2.X() + p2.Y()*p2.Y() + p2.Z()*p2.Z() << endl; + + if (p1.IsEqual(p2, 1.e-05)) + { + thePntSeq->Remove(jk); + j=jk; + } + } + } + + + // cout << "Total Number of face sample points computed = " << thePntSeq->Length() << endl; + Bnd_Box aBB; // make a tight box!!!! + + + BRepBndLib::Add(theFace, aBB); + aBB.SetGap(0); + + + if (aBB.IsWhole() || aBB.IsVoid() || aBB.IsThin(1e-7)) + cout << "_#_McCadDiscretization_Face.cxx :: Face Bounding box computation failed !!" << endl; + + return thePntSeq; + +}*/ diff --git a/src/MCCAD/McCadMcVoid/McCadExtFace.hxx b/src/MCCAD/McCadMcVoid/McCadExtFace.hxx new file mode 100644 index 0000000..77e9348 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadExtFace.hxx @@ -0,0 +1,113 @@ +#ifndef MCCADEXTFACE_HXX +#define MCCADEXTFACE_HXX + +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +enum ORIENTATION{PLUS = 0, MINUS = 1}; + +class McCadExtFace : public TopoDS_Face +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadExtFace(); + McCadExtFace(const TopoDS_Face &theFace); + McCadExtFace(const McCadExtFace &theExtFace); + ~McCadExtFace(); + +private: + Standard_Integer m_iFaceNo; /**< The number of face in the facelist */ + Standard_Integer m_iNumPnt; /**< The number of discrete points */ + + Standard_Boolean m_bHaveAuxFace; /**< Whether have auxiliary face */ + + Handle_TColgp_HSequenceOfPnt m_DiscPntList; /**< Discrete points of faces */ + Handle_TColgp_HSequenceOfPnt m_EdgePntList; /**< Discrete points of edges of this face */ + vector< McCadExtFace* > m_AuxFaceList; /**< Auxiliary face list */ + + Standard_Integer m_iFaceNum; /**< Face number of the geomtetry face list */ + ORIENTATION m_symbol; /**< The direction of plane is positive or negative */ + + //TopoDS_Face m_Face; + Bnd_Box m_bBox; + GeomAbs_SurfaceType m_FaceType; + + vector< McCadExtFace* > m_SameFaceList; /**< Merge the same surface of one solid */ + Standard_Integer m_iAttri; + + Standard_Boolean m_bFusedFace; /**< The fused face is no need to do the collision detection with void box*/ + + /* Standard_Integer myMaxNbPnt; + Standard_Integer myMinNbPnt; + Standard_Real myXlen; + Standard_Real myYlen; + Standard_Real myRlen; + Standard_Real myTolerance;*/ + + +public: + + + Standard_Boolean IsConcaveCurvedFace(); /**< Concave curved face need to add auxiliary face */ + void RemoveAuxFace(Standard_Integer index); /**< Remove the face with the face number*/ + + vector< McCadExtFace* > GetAuxFaces(); + void AddAuxFaces(vector faces); /**< Add a list of faces for auxiliary faces*/ + + Handle_TColgp_HSequenceOfPnt GetDiscPntList(); /**< Get discrete point list of face */ + void AddPntList(Handle_TColgp_HSequenceOfPnt pnt_list); /** Add point list*/ + Handle_TColgp_HSequenceOfPnt GetEdgePntList(); /**< Get the discrete point list of edge frame*/ + + void SetFaceNum(int iCodeNum); /**< Set face number */ + Standard_Integer GetFaceNum(); /**< Get face number */ + + void SetSurfSymbol(); /**< Set the symbol based on direction of surface */ + Standard_Boolean GetSurfSymbol(); /**< Get the symbol */ + void ChangeSymbol(Standard_Boolean bSymbol); /**< Change the symbol */ + ORIENTATION GetFaceOrientation(); /**< Get the orientation of face, is plus or minus */ + + Bnd_Box GetBndBox(); + void UpdateBndBox(Bnd_Box theBBox); + GeomAbs_SurfaceType GetFaceType(); + void SetFaceType(GeomAbs_SurfaceType theFaceType); + Standard_Boolean HaveAuxSurf(); + + void AddSameFaces( McCadExtFace* faces); + vector< McCadExtFace* > GetSameFaces(); + + /**< Merge discrete points of the two connect surfaces with same geometries */ + void MergeDscPnt(TopoDS_Face &theFace); + + void AddAttri(Standard_Integer iAttri); +//qiu Standard_Integer GetAttri(){return m_iAttri;}; + Standard_Integer GetAttri() const {return m_iAttri;}; + Standard_Integer IsFusedFace(){return m_bFusedFace;}; + //McCadExtFace *m_mergedFace; + + + //Standard_Boolean IsSame(McCadExtFace *& theFace); + //Handle_TColgp_HSequenceOfPnt Init();test + +}; + +#endif // MCCADEXTFACE_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadGDMLWriter.cxx b/src/MCCAD/McCadMcVoid/McCadGDMLWriter.cxx new file mode 100644 index 0000000..dc8c76f --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGDMLWriter.cxx @@ -0,0 +1,1140 @@ +#include "McCadGDMLWriter.hxx" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +#include "assert.h" + +McCadGDMLWriter::McCadGDMLWriter() +{ +} +McCadGDMLWriter::~McCadGDMLWriter() +{ +} + +void McCadGDMLWriter::CheckNames(vector aNameList) +{ + QString aBackup; //back up the name + QString aNewName; //new name if repeat + int n=1; + + for (unsigned int i=0; iGetGeomData(); + assert(pData); + //check the solid names + vector aNameList; + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) { + TCollection_AsciiString atmpName = pData->m_SolidList.at(i)->GetName(); + aNameList.push_back(QString(atmpName.ToCString())); + cout <<"Solid name : " <m_SolidList.size(); i++) { + QString atmpName = aNameList.at(i); + cout <<"After rename name : " <m_SolidList.at(i)->SetName(TCollection_AsciiString(atmpName.toStdString().c_str())); + } +} +void McCadGDMLWriter::CheckMaterialNames() +{ + //get the data + MaterialManager * pMatManager = m_pManager->GetMatManager(); + assert(pMatManager); //qiu comment out because error: mat manager is create late! +// if (!pMatManager) return; + + vector aMaterialList = pMatManager->GetMatList(); + vector aNameList; + + for(unsigned int i = 0; i < aMaterialList.size(); i++) + aNameList.push_back(aMaterialList.at(i)->GetMatName()); + CheckNames(aNameList); + for (unsigned int i = 0; i < aMaterialList.size(); i++) { + aMaterialList.at(i)->SetMatName(aNameList.at(i)); + } +} + + +void McCadGDMLWriter::PrintFile() +{ + //check the solid and material name + CheckSolidNames(); + CheckMaterialNames(); + + //open the document + QFile *file = new QFile(QString(m_OutputFileName.ToCString())); + if(!file->open(QFile::WriteOnly|QFile::Truncate)) + return; + //the heading instruction + QDomProcessingInstruction instruction; + instruction = m_Doc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\""); + m_Doc.appendChild(instruction); + + QDomElement root=m_Doc.createElement(("gdml")); //create the gdml Element + root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + root.setAttribute("xsi:noNamespaceSchemaLocation","gdml.xsd" ); //default schema location: current directory + m_Doc.appendChild(root); + + //let's print it + PrintDefine(root); + PrintMaterial(root); + PrintSolids(root); + PrintStructure(root); + PrintSetup(root); + + + QTextStream out(file); + m_Doc.save(out,4); + file->close(); +} + +void McCadGDMLWriter::PrintDefine(QDomElement & ParentElement) +{ + //print the define element + QDomElement theElement = m_Doc.createElement(("define")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aName (pSolid->GetName().ToCString()) ; //get the solid name + + //print the polyhedron for the whole pSolid + PrintPolyhedron(theElement, pSolid, aName); + + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + if (ConvexSolidCnt == 1) continue; //only one convex solid: print only once + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName /*; + if (ConvexSolidCnt == 1) bName = aName; + else bName*/ = aName + QString("_%1").arg(j); + PrintPolyhedron(theElement, pConvexSolid, bName); + } + } + + //print the world box polyhedron + //!! COMMENT OUT because the worldBox is failed in genearted surface in McCad + //!! Using a hug box instead! +// McCadVoidCell * pVoid = getWholeBntBox(); +// PrintPolyhedron(theElement,pVoid, "WorldBox"); + +} + + + +void McCadGDMLWriter::MeshShape(const TopoDS_Shape theShape, double & theDeflection) +{ + + Standard_Real aDeflection = theDeflection <= 0 ? 0.0001 : theDeflection; + + //If deflection <= 0, than return default deflection + if(theDeflection <= 0) + theDeflection = aDeflection; + + // Is shape triangulated? + Standard_Boolean alreadymeshed = Standard_True; + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + alreadymeshed = Standard_False; + break; + } + } + + if(!alreadymeshed) { + Bnd_Box B; + BRepBndLib::Add(theShape, B); + if ( B.IsVoid() ) + return; // NPAL15983 (Bug when displaying empty groups) + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + // This magic line comes from Prs3d_ShadedShape.gxx in OCCT + aDeflection = max(aXmax-aXmin, max( aYmax-aYmin, aZmax-aZmin)) * aDeflection * 4; + + //Clean triangulation before compute incremental mesh + BRepTools::Clean(theShape); + + //Compute triangulation + BRepMesh_IncrementalMesh MESH(theShape,aDeflection); + } +} + +void McCadGDMLWriter::PrintPolyhedron(QDomElement & ParentElement, const TopoDS_Shape * aShape, const QString & aName) +{ + //write the name attribute + QDomElement theElement = m_Doc.createElement(("Polyhedron")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", QString("Poly_")+ aName); //add "Poly_" to avoid repeated name in GDML + + //mesh the solid + TopoDS_Shape theShape = *aShape; + double theDeflection = 0.001; + MeshShape(theShape, theDeflection); + + //get the node list and facet list + //we create the nodes and facets element for the gdml directly here + + + QDomElement NodesElement = m_Doc.createElement(("Nodes")); + NodesElement.setAttribute("lunit", "cm"); + QDomElement FacetsElement = m_Doc.createElement(("Facets")); + int NodeTotal=0; //each time a face is mesh, the total node will be updated + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + //get the nodes and facets + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //make a node element + QDomElement aNodeElement = m_Doc.createElement(("Node")); + aNodeElement.setAttribute("x",P.X()/10); //unit cm + aNodeElement.setAttribute("y",P.Y()/10); + aNodeElement.setAttribute("z",P.Z()/10); + NodesElement.appendChild(aNodeElement); + } + + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++){ // i start with 1 ?? + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); + N1 += NodeTotal ; //node id should start from 1 + N2 += NodeTotal ; + N3 += NodeTotal ; + + QDomElement aFacetElement = m_Doc.createElement(("Facet")); + //IMPORTANT!! this must do otherwise the visualization will be wrong! + if (aFace.Orientation() == TopAbs_REVERSED) + { + aFacetElement.setAttribute("n1",N3); // reverse the order if face is reversed!! + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N1); + } + else + { + aFacetElement.setAttribute("n1",N1); + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N3); + } + + FacetsElement.appendChild(aFacetElement); + } + NodeTotal += nbNodesInFace; //MUST DO!! + } + + theElement.appendChild(NodesElement); + theElement.appendChild(FacetsElement); + +} + +void McCadGDMLWriter::PrintPolyhedron(QDomElement & ParentElement, McCadSolid * pSolid, const QString & aName) +{ + //write the name attribute + QDomElement theElement = m_Doc.createElement(("Polyhedron")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", QString("Poly_")+ aName); //add "Poly_" to avoid repeated name in GDML + + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + int NodeTotal=0; //each time a face is mesh, the total node will be updated + QDomElement NodesElement = m_Doc.createElement(("Nodes")); + NodesElement.setAttribute("lunit", "cm"); + QDomElement FacetsElement = m_Doc.createElement(("Facets")); + double theDeflection = 0.001; + + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + + //mesh the solid + TopoDS_Shape theShape = *pConvexSolid; + MeshShape(theShape, theDeflection); + + //get the node list and facet list + //we create the nodes and facets element for the gdml directly here + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + //get the nodes and facets + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //make a node element + QDomElement aNodeElement = m_Doc.createElement(("Node")); + aNodeElement.setAttribute("x",P.X()/10); //unit cm + aNodeElement.setAttribute("y",P.Y()/10); + aNodeElement.setAttribute("z",P.Z()/10); + NodesElement.appendChild(aNodeElement); + } + + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++){ // i start with 1 ?? + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); + N1 += NodeTotal ; //node id should start from 1 + N2 += NodeTotal ; + N3 += NodeTotal ; + + QDomElement aFacetElement = m_Doc.createElement(("Facet")); + if (aFace.Orientation() == TopAbs_REVERSED) + { + aFacetElement.setAttribute("n1",N3); // reverse the order if face is reversed!! + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N1); + } + else + { + aFacetElement.setAttribute("n1",N1); + aFacetElement.setAttribute("n2",N2); + aFacetElement.setAttribute("n3",N3); + } + FacetsElement.appendChild(aFacetElement); + } + NodeTotal += nbNodesInFace; //MUST DO!! + } + } + + theElement.appendChild(NodesElement); + theElement.appendChild(FacetsElement); + + +} + + +void McCadGDMLWriter::PrintMaterial(QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("materials")); + ParentElement.appendChild(theElement); + + //get the data + MaterialManager * pMatManager = m_pManager->GetMatManager(); + assert(pMatManager); + + vector aMaterialList = pMatManager->GetMatList(); + + for(unsigned int i = 0; i < aMaterialList.size(); i++) + { + //create a Material element + QDomElement MaterialElement = m_Doc.createElement(("material")); + Material * aMaterial = aMaterialList.at(i); + MaterialElement.setAttribute("name", QString("Mat_") + aMaterial->GetMatName()); //add "Mat_" to avoid repeated name in GDML + //create the density element + QDomElement DensityElement = m_Doc.createElement(("D")); + DensityElement.setAttribute("value", aMaterial->GetMatDensity()); + DensityElement.setAttribute("unit", "g/cm3"); //We use g/cm3 as defaut unit, in future should be selectable. + MaterialElement.appendChild(DensityElement); +// QDomText txtMatcard = m_Doc.createTextNode(aMaterial->GetMatCard()); +// MaterialElement.appendChild(txtMatcard); + theElement.appendChild(MaterialElement); + } + +} + + +void McCadGDMLWriter::PrintSolids (QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("solids")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + //print convex solid + QString aName (pSolid->GetName().ToCString()) ; //get the solid name + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName; + if (ConvexSolidCnt == 1) bName = aName; + else bName = aName + QString("_%1").arg(j); + PrintHalfSpaceSolid(theElement, pConvexSolid, bName); + } + + //make boolean operation to Union + if ( pSolid->GetConvexSolidList().size() == 1) + continue; //no need for the union + else { + PrintHalfSpaceBoolean(theElement, aName, ConvexSolidCnt); + } + } + + //print the world solid + //first we make this box +//no need TopoDS_Solid aBndBox = *(pData->m_pOutVoid); //McCadVoidCell is inherit from TopoDS_Solid +//no need McCadConvexSolid * pWorldBox = new McCadConvexSolid(aBndBox); + //!! COMMENT OUT because the worldBox is failed in genearted surface in McCad + //!! Using a hug box instead! +// McCadVoidCell * pVoid = getWholeBntBox(); +// PrintHalfSpaceSolid(theElement, pVoid, "WorldBox"); +// delete pVoid; + PrintWorldBox(theElement); + +} + + void McCadGDMLWriter::PrintWorldBox (QDomElement & ParentElement) +{ + //build a element + QDomElement theElement = m_Doc.createElement(("box")); + theElement.setAttribute("name", "WorldBox"); + theElement.setAttribute("x", "100000"); + theElement.setAttribute("y", "100000"); + theElement.setAttribute("z", "100000"); + ParentElement.appendChild(theElement); +} + + +void McCadGDMLWriter::PrintHalfSpaceSolid(QDomElement & ParentElement, + McCadConvexSolid *pConvexSolid, const QString & aName) +{ + //build a element + QDomElement theElement = m_Doc.createElement(("HalfSpaceSolid")); + ParentElement.appendChild(theElement); + + theElement.setAttribute("name", aName); + theElement.setAttribute("lunit", "cm"); + + //print the surface //unit cm + PrintSurfaces(theElement, pConvexSolid); + + //print the bounadry box //unit cm + PrintBoundaryBox(theElement, pConvexSolid); + + //print other values (volume size, surface area, polyhedron) //unit cm + PrintVolumeArea(theElement, pConvexSolid, aName); + PrintPolyhedronRef(theElement, aName); + +} + +void McCadGDMLWriter::PrintHalfSpaceSolid(QDomElement & ParentElement, + McCadVoidCell *pVoid, const QString & aName) +{ + //build a element + QDomElement theElement = m_Doc.createElement(("HalfSpaceSolid")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", aName); + theElement.setAttribute("lunit", "cm"); + + //print the surface + PrintSurfaces(theElement, pVoid); + + //print the bounadry box + PrintBoundaryBox(theElement, pVoid); + + //print other values (volume size, surface area, polyhedron) + PrintVolumeArea(theElement, pVoid, aName); + PrintPolyhedronRef(theElement, aName); + +} + + +void McCadGDMLWriter::PrintSurfaces(QDomElement & ParentElement, McCadConvexSolid *pConvexSolid) +{ + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + //print the surface element + QDomElement theElement = m_Doc.createElement(("Surfaces")); + ParentElement.appendChild(theElement); + + for (unsigned int i = 0; i < (pConvexSolid->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pConvexSolid->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); //get the surface number + int theSense = iFaceNum > 0 ? 1 : -1; //if face number > 0: positive; else negative + //using the face number to get the face from list + +// cout <<"iFaceNum " <HaveAuxSurf()) + { + for(unsigned int j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + if (pAuxFace->GetAttri() == 1) //union aux surface + { + QDomComment aComment= m_Doc.createComment("FatalError: McCadGDMLWriter::PrintSurfaces does not support Union Auxiliary surface!!"); + ParentElement.appendChild(aComment); +// cout<<"FatalError: McCadGDMLWriter::PrintSurfaces does not support Union Auxiliary surface!! "; + return; + } + else //intersect aux surface + { + int iAuxFaceNum = pAuxFace->GetFaceNum(); + theSense = iAuxFaceNum >0 ? 1 : -1 ; + //qiu A BUG HERE!! +// IGeomFace * qFace = findSurface(abs(iFaceNum) -1); //?? correct? + IGeomFace * qFace = findSurface(abs(iAuxFaceNum) -1); //?? correct? + if (qFace == NULL) { + QDomComment aComment= m_Doc.createComment("FatalError: McCadGDMLWriter::Cannot get the surface of number!"); + ParentElement.appendChild(aComment); +// cout<<"FatalError: McCadGDMLWriter::Cannot get the surface of number "<GetGeomData(); + assert(pData); + + //print the surface element + QDomElement theElement = m_Doc.createElement(("Surfaces")); + ParentElement.appendChild(theElement); + + for (unsigned int i = 0; i < (pVoid->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pVoid->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); //get the surface number + int theSense = iFaceNum > 0 ? 1 : -1; //if face number > 0: positive; else negative + //using the face number to get the face from list + +// cout <<"iFaceNum " <HaveAuxSurf()) + { + for(unsigned int j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + if (pAuxFace->GetAttri() == 1) //union aux surface + { + cout<<"FatalError: McCadGDMLWriter::PrintSurfaces does not support Union Auxiliary surface!! "; + return; + } + else //intersect aux surface + { + int iAuxFaceNum = pAuxFace->GetFaceNum(); + theSense = iAuxFaceNum >0 ? 1 : -1 ; + IGeomFace * qFace = findSurface(abs(iFaceNum) -1); //?? correct? + if (qFace == NULL) { + cout<<"FatalError: McCadGDMLWriter::Cannot get the surface of number "<GetGeomData(); + assert(pData); +// for (unsigned int i=0; im_GeomSurfList.size(); i++) +// { +// IGeomFace * aSurf = pData->m_GeomSurfList.at(i); +// if (aSurf->GetSurfNum() == aIdx) +// return aSurf; +// } +// return NULL; + return pData->m_GeomSurfList.at(aIdx); +} + + +void McCadGDMLWriter::PrintASurface(QDomElement & ParentElement, IGeomFace * pFace, const int & theSense) +{ + QString aSymb = pFace->GetSurfSymb().ToCString(); + + if (aSymb == "P") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("A",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("B",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("C",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "PX") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "PY") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "PZ") { + QDomElement theElement = m_Doc.createElement(("Plane")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SO") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SX") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SY") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Z",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "SZ") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "S") { + QDomElement theElement = m_Doc.createElement(("Sphere")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "CX") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("Center1",0.); + theElement.setAttribute("Center2",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "CY") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("Center1",0.); + theElement.setAttribute("Center2",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "CZ") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("Center1",0.); + theElement.setAttribute("Center2",0.); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(0))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "C/X") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("Center1",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Center2",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(2))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "C/Y") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("Center1",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Center2",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(2))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "C/Z") { + QDomElement theElement = m_Doc.createElement(("Cylinder")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("Center1",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Center2",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Radius",RoundDouble(pFace->GetPrmtList().at(2))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "KX") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",0.); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "KY") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "KZ") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Z",0.); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "K/X") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","X"); + theElement.setAttribute("X",0.); + theElement.setAttribute("Y",0.); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(1))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "K/Y") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Y"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "K/Z") { + QDomElement theElement = m_Doc.createElement(("Cone")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("Axis","Z"); + theElement.setAttribute("X",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("Y",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("Z",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("T2",RoundDouble(pFace->GetPrmtList().at(3))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "GQ") { + QDomElement theElement = m_Doc.createElement(("Quadric")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("A",RoundDouble(pFace->GetPrmtList().at(0))); + //ATTENTION, some parameters should /2, difference between Geant4 half-space solid + //and MCNP please check the development documents and MCNP manual! + theElement.setAttribute("B",RoundDouble(pFace->GetPrmtList().at(3)/2.0)); + theElement.setAttribute("C",RoundDouble(pFace->GetPrmtList().at(5)/2.0)); + theElement.setAttribute("D",RoundDouble(pFace->GetPrmtList().at(6)/2.0)); + theElement.setAttribute("E",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("F",RoundDouble(pFace->GetPrmtList().at(4)/2.0)); + theElement.setAttribute("G",RoundDouble(pFace->GetPrmtList().at(7)/2.0)); + theElement.setAttribute("H",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("I",RoundDouble(pFace->GetPrmtList().at(8)/2.0)); + theElement.setAttribute("J",RoundDouble(pFace->GetPrmtList().at(9))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "TX") { + QDomElement theElement = m_Doc.createElement(("Torus")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("CenterX",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("CenterY",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("CenterZ",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("AxisX",1.); + theElement.setAttribute("AxisY",0.); + theElement.setAttribute("AxisZ",0.); + theElement.setAttribute("MaxRadius",RoundDouble(pFace->GetPrmtList().at(3))); + //ATTENTION!! the A,B,C in MCNP torus parameters means r, b, a in Geant4 + //Half-space solid, therefore the order should be switched! +// theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(4))); +// theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(4))); + ParentElement.appendChild(theElement); + + } + else if (aSymb == "TY") { + QDomElement theElement = m_Doc.createElement(("Torus")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("CenterX",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("CenterY",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("CenterZ",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("AxisX",0.); + theElement.setAttribute("AxisY",1.); + theElement.setAttribute("AxisZ",0.); + theElement.setAttribute("MaxRadius",RoundDouble(pFace->GetPrmtList().at(3))); + //ATTENTION!! the A,B,C in MCNP torus parameters means r, b, a in Geant4 + //Half-space solid, therefore the order should be switched! +// theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(4))); +// theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(5)); + theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(4))); + ParentElement.appendChild(theElement); + } + else if (aSymb == "TZ") { + QDomElement theElement = m_Doc.createElement(("Torus")); + theElement.setAttribute("Sense", theSense); + theElement.setAttribute("CenterX",RoundDouble(pFace->GetPrmtList().at(0))); + theElement.setAttribute("CenterY",RoundDouble(pFace->GetPrmtList().at(1))); + theElement.setAttribute("CenterZ",RoundDouble(pFace->GetPrmtList().at(2))); + theElement.setAttribute("AxisX",0.); + theElement.setAttribute("AxisY",0.); + theElement.setAttribute("AxisZ",1.); + theElement.setAttribute("MaxRadius",RoundDouble(pFace->GetPrmtList().at(3))); + //ATTENTION!! the A,B,C in MCNP torus parameters means r, b, a in Geant4 + //Half-space solid, therefore the order should be switched! +// theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(4))); +// theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius1",RoundDouble(pFace->GetPrmtList().at(5))); + theElement.setAttribute("MinRadius2",RoundDouble(pFace->GetPrmtList().at(4))); + ParentElement.appendChild(theElement); + } +} + +void McCadGDMLWriter::PrintBoundaryBox(QDomElement & ParentElement, TopoDS_Solid *pConvexSolid) +{ + //create the elemenet + QDomElement theElement = m_Doc.createElement(("BoundaryBox")); + + //calculate the boundary box + Bnd_Box theBB; + BRepBndLib::Add(*pConvexSolid, theBB); +// theBB.SetGap(0.0); //better to set a small gap + theBB.SetGap(0.001); + Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + theBB.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); + + QDomElement LowerPoint = m_Doc.createElement(("LowerPoint")); + QDomElement UpperPoint = m_Doc.createElement(("UpperPoint")); + LowerPoint.setAttribute("x", Xmin/10); //unit cm + LowerPoint.setAttribute("y", Ymin/10); + LowerPoint.setAttribute("z", Zmin/10); + UpperPoint.setAttribute("x", Xmax/10); + UpperPoint.setAttribute("y", Ymax/10); + UpperPoint.setAttribute("z", Zmax/10); + + theElement.appendChild(LowerPoint); + theElement.appendChild(UpperPoint); + ParentElement.appendChild(theElement); +} + +void McCadGDMLWriter::PrintVolumeArea (QDomElement & ParentElement, TopoDS_Solid *pConvexSolid, const QString & aName) +{ + //create the elements + QDomElement VolumeElement = m_Doc.createElement(("VolumeSize")); + QDomElement SurfaceAreaElement = m_Doc.createElement(("SurfaceArea")); + ParentElement.appendChild(VolumeElement); + ParentElement.appendChild(SurfaceAreaElement); + + //calculate + //from http://www.opencascade.org/org/forum/thread_17898/?forum=3 + TopoDS_Shape aShape = *pConvexSolid; + double Volume =0., Area =0.; + GProp_GProps System; + BRepGProp::SurfaceProperties(aShape, System); + Area = System.Mass()/100; //correct?? //unit cm2 + BRepGProp::VolumeProperties(aShape, System); + Volume = System.Mass()/1000;//correct?? //unit cm3 + + VolumeElement.setAttribute("value", Volume); + SurfaceAreaElement.setAttribute("value",Area); + + + +} +void McCadGDMLWriter::PrintPolyhedronRef (QDomElement & ParentElement, const QString & aName) +{ + //create the elements + + QDomElement PolyhedronElement = m_Doc.createElement(("VisualPolyhedron")); + PolyhedronElement.setAttribute("ref", QString("Poly_") + aName); //add "Poly_" to avoid repeated name in GDML, see also PrintPolyhedron() + ParentElement.appendChild(PolyhedronElement); + +} + +McCadVoidCell * McCadGDMLWriter::getWholeBntBox() +{ + Bnd_Box bnd_box; + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_ConvexSolidList.size(); i++) + { + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[i]; + assert(pSolid); + BRepBndLib::Add((TopoDS_Shape)(*pSolid),bnd_box); // Add each convex solid into bundary box + } + + bnd_box.SetGap(1.0); // Set the gap between the boundary box and material solids + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + bnd_box.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + // Interger the dimension parameters of boundary box. +//no need McCadMathTool::Integer(dXmin); +//no need McCadMathTool::Integer(dYmin); +//no need McCadMathTool::Integer(dZmin); +//no need McCadMathTool::Integer(dXmax); +//no need McCadMathTool::Integer(dYmax); +//no need McCadMathTool::Integer(dZmax); + + gp_Pnt bnd_max_pnt(dXmax,dYmax,dZmax); + gp_Pnt bnd_min_pnt(dXmin,dYmin,dZmin); + + // Create the boundary box. + McCadVoidCell *pVoid = new McCadVoidCell(BRepPrimAPI_MakeBox(bnd_min_pnt,bnd_max_pnt).Solid()); + pVoid->SetBntBox(dXmin,dYmin,dZmin,dXmax,dYmax,dZmax); + return pVoid; +} + + +void McCadGDMLWriter::PrintHalfSpaceBoolean(QDomElement & ParentElement, + const QString SolidName, const int &SubSolidCnt, const bool isPrintPoly) +{ + if (SubSolidCnt == 1) return ;//no need to make a boolean on a convex solid + + //create the element + QDomElement theElement = m_Doc.createElement(("HalfSpaceBoolean")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", SolidName); + QDomElement theUnionElement = m_Doc.createElement(("Union")); + + QString aName = SolidName ; //get the solid name + for(int j = 0; j < SubSolidCnt; j++) + { + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName = aName + QString("_%1").arg(j); + QDomElement solidElement = m_Doc.createElement(("Solid")); + solidElement.setAttribute("ref", bName); + theUnionElement.appendChild(solidElement); + } + theElement.appendChild(theUnionElement); + + //Print polyhedron reference + if (isPrintPoly) + PrintPolyhedronRef(theElement, aName); + +} + +void McCadGDMLWriter:: PrintStructure(QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("structure")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + MaterialManager * pMatManager = m_pManager->GetMatManager(); + assert(pMatManager); + + + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aSolidName (pSolid->GetName().ToCString()) ; //get the solid name + + //get the material name + QString aMatName = pMatManager->GetMaterial(pSolid->GetID())->GetMatName(); //use Material id to get material + //create the volume element + PrintVolume(theElement, aMatName, aSolidName); + } + + //create the world volume + QDomElement WorldVolElement = m_Doc.createElement(("volume")); + WorldVolElement.setAttribute("name", QString("World")); + QDomElement MaterialRefElement = m_Doc.createElement(("materialref")); + MaterialRefElement.setAttribute("ref", "Air"); + QDomElement SolidRefElement = m_Doc.createElement("solidref"); + SolidRefElement.setAttribute("ref","WorldBox"); //ref to the solid named "WorldBox" + WorldVolElement.appendChild(MaterialRefElement); + WorldVolElement.appendChild(SolidRefElement); + + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aSolidName (pSolid->GetName().ToCString()) ; //get the solid name + + //create the physcial volume element + PrintPhysicalVolume(WorldVolElement, aSolidName); + } + + theElement.appendChild(WorldVolElement); +} + +void McCadGDMLWriter::PrintVolume(QDomElement & ParentElement, const QString MaterialName, const QString SolidName) +{ + QDomElement theElement = m_Doc.createElement(("volume")); + ParentElement.appendChild(theElement); + //we add a "LV_" here because we want to make it differ from solidname + theElement.setAttribute("name", QString("LV_") + SolidName); + + QDomElement MaterialRefElement = m_Doc.createElement(("materialref")); + MaterialRefElement.setAttribute("ref", QString("Mat_") + MaterialName); // add "Mat_" to avoid repeat name in GDML + + QDomElement SolidRefElement = m_Doc.createElement("solidref"); + SolidRefElement.setAttribute("ref",SolidName); + + theElement.appendChild(MaterialRefElement); + theElement.appendChild(SolidRefElement); +} + +void McCadGDMLWriter:: PrintPhysicalVolume(QDomElement & ParentElement, const QString SolidName) +{ + QDomElement theElement = m_Doc.createElement(("physvol")); + ParentElement.appendChild(theElement); + QDomElement VolumeRefElement = m_Doc.createElement("volumeref"); + //see PrintVolume() for the volume name + VolumeRefElement.setAttribute("ref",QString("LV_") + SolidName); + + theElement.appendChild(VolumeRefElement); +} + +void McCadGDMLWriter:: PrintSetup (QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("setup")); + ParentElement.appendChild(theElement); + theElement.setAttribute("name", "Default"); //what so ever + theElement.setAttribute("version", "1.0"); //just copy the example + + QDomElement WorldElement = m_Doc.createElement(("world")); + WorldElement.setAttribute("ref", "World"); + + theElement.appendChild(WorldElement); + +} + +/*! + * \brief McCadGDMLWriter::RoundDouble + * round a double, truncate the digit + * \param aDouble + * \return the qstring of the digit + */ +QString McCadGDMLWriter::RoundDouble(const double & aDouble) +{ + //round the digit to 7 + return QString::number(aDouble, 'f', 7); +} + diff --git a/src/MCCAD/McCadMcVoid/McCadGDMLWriter.hxx b/src/MCCAD/McCadMcVoid/McCadGDMLWriter.hxx new file mode 100644 index 0000000..5c5b60f --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGDMLWriter.hxx @@ -0,0 +1,110 @@ +#ifndef MCCADGDMLWRITER_HXX +#define MCCADGDMLWRITER_HXX + +#include "IMcCadWriter.hxx" + +#include "TopoDS_Shape.hxx" + +#include +#include +#include +#include + +#include + +//using namespace std; +class McCadGDMLWriter : public IMcCadWriter +{ +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +public: +Standard_EXPORT McCadGDMLWriter(); +Standard_EXPORT ~McCadGDMLWriter(); + + //main function to print the gdml file +Standard_EXPORT virtual void PrintFile() ; + + //##### Print the Element + //Print element, means print the polyhedron for visualization purpose +Standard_EXPORT virtual void PrintDefine(QDomElement & ParentElement); + //print one polyhedron: a close shell form by facets +Standard_EXPORT virtual void PrintPolyhedron(QDomElement & ParentElement, const TopoDS_Shape * aShape, const QString & aName); + //method to print the polyhedron for a McCadSolid. McCadSolid is not inherit from TopoDS_Shape, + //we should therefore implemenet independently +Standard_EXPORT virtual void PrintPolyhedron(QDomElement & ParentElement, McCadSolid * pSolid, const QString & aName); + //meshing the shape with +Standard_EXPORT void MeshShape(const TopoDS_Shape theShape, double &theDeflection); + + + //##### Print the Element + +Standard_EXPORT virtual void PrintMaterial(QDomElement & ParentElement); + + //##### Print the Element + //print the element, where the solid is built by HalfSpaceSolid and HalfSpaceBoolean +Standard_EXPORT virtual void PrintSolids (QDomElement & ParentElement); + //Print the whole world box +Standard_EXPORT virtual void PrintWorldBox (QDomElement & ParentElement); + //print a HalfSpaceSolid +Standard_EXPORT virtual void PrintHalfSpaceSolid(QDomElement & ParentElement, McCadConvexSolid * pConvexSolid, const QString & aName); +Standard_EXPORT virtual void PrintHalfSpaceSolid(QDomElement & ParentElement, McCadVoidCell * pVoid, const QString & aName); + //print the surface list +Standard_EXPORT virtual void PrintSurfaces(QDomElement & ParentElement, McCadConvexSolid * pConvexSolid); +Standard_EXPORT virtual void PrintSurfaces(QDomElement & ParentElement, McCadVoidCell * pVoid); + //find the surface according to the surface ID +Standard_EXPORT IGeomFace * findSurface(const int & aIdx); + //print a surface +Standard_EXPORT virtual void PrintASurface(QDomElement & ParentElement, IGeomFace * pFace, const int & theSense); + //print the boundary box +Standard_EXPORT virtual void PrintBoundaryBox(QDomElement & ParentElement, TopoDS_Solid * pConvexSolid); + //print other values (volume size, surface area, polyhedron) +Standard_EXPORT virtual void PrintVolumeArea (QDomElement & ParentElement, TopoDS_Solid * pConvexSolid, const QString & aName); +Standard_EXPORT virtual void PrintPolyhedronRef (QDomElement & ParentElement, const QString & aName); + //we create the boundary box but not using the one from McCadGeomData because we might goes without void generation. +Standard_EXPORT virtual McCadVoidCell * getWholeBntBox(); + + //Print the HalfSpaceBoolean + //if isPrintPoly == true, then print the polyhedron +Standard_EXPORT virtual void PrintHalfSpaceBoolean(QDomElement & ParentElement, const QString SolidName, + const int & SubSolidCnt, const bool isPrintPoly = true); + + + //#####print the element +Standard_EXPORT virtual void PrintStructure(QDomElement & ParentElement); + //print a volume, noted that the name of the volume is set to "LV_" + SolidName +Standard_EXPORT virtual void PrintVolume(QDomElement & ParentElement, const QString MaterialName, const QString SolidName); + + //print a physical volume, noted that the name of the volume is set to "LV_" + SolidName +Standard_EXPORT virtual void PrintPhysicalVolume(QDomElement & ParentElement, const QString SolidName); + + //#####print the element +Standard_EXPORT virtual void PrintSetup (QDomElement & ParentElement); + + //to check repetition of the name, if repeated then rename it with a number + //Because the GDML use the name as references, therefore each name should be + //unique +Standard_EXPORT virtual void CheckSolidNames(); +Standard_EXPORT virtual void CheckMaterialNames(); +protected: +Standard_EXPORT virtual void CheckNames(vector aNameList); +Standard_EXPORT QString RoundDouble(const double & aDouble); + +protected: + QDomDocument m_Doc; + + +}; + +#endif // MCCADGDMLWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadGeomCone-beforeTR.cxx b/src/MCCAD/McCadMcVoid/McCadGeomCone-beforeTR.cxx new file mode 100644 index 0000000..191ffb6 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomCone-beforeTR.cxx @@ -0,0 +1,418 @@ +#include "McCadGeomCone.hxx" + +#include +#include +#include + +#include "McCadTransfCard.hxx" +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + + +McCadGeomCone::McCadGeomCone() +{ +} + +McCadGeomCone::~McCadGeomCone(){} + + +/** ******************************************************************** +* @brief Construct a cone based on the geometry surface +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomCone::McCadGeomCone(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfCone ; // The surface is a cone + gp_Cone cone = theSurface.Cone(); // Get the geometry of cone + cone.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = cone.Position(); // Get the coordinate system Ax3 + m_SemiAngle = cone.SemiAngle(); // Get the semi angle of cone + m_Dir = m_Axis.Direction(); // Get the direction of axis + m_Apex = cone.Apex(); // Get the peak point of cone + + if( McCadMathTool::IsEqualZero(m_Apex.X())) + m_Apex.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Y())) + m_Apex.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Z())) + m_Apex.SetZ(0.0); + + + + + cone.Coefficients( m_dPrmtA1,m_dPrmtA2,m_dPrmtA3, // Get the parameters + m_dPrmtB1,m_dPrmtB2,m_dPrmtB3, + m_dPrmtC1,m_dPrmtC2,m_dPrmtC3, + m_dPrmtD); + + m_bReverse = Standard_False; + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA1 < 0.0) + { + m_dPrmtA1 *= -1; + m_dPrmtA2 *= -1; + m_dPrmtA3 *= -1; + m_dPrmtB1 *= -1; + m_dPrmtB2 *= -1; + m_dPrmtB3 *= -1; + m_dPrmtC1 *= -1; + m_dPrmtC2 *= -1; + m_dPrmtC3 *= -1; + m_dPrmtD *= -1; + + m_bReverse = Standard_True; + } + + /* test code + cout<<"cone"<= dis_tol + && fabs(m_Apex.Y()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KX%8s%15.7f%5s%15.7f\n","",m_Apex.X(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KX"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/X%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/X"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DX(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else if( m_Axis.IsCoplanar(Ax3_Y, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Y()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KY%8s%15.7f%5s%15.7f\n","",m_Apex.Y(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KY"; + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Y%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Y"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DY(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + + } + else if( m_Axis.IsCoplanar(Ax3_Z, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Z()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Y()) <= dis_tol) + { + //sprintf(chExpn, "KZ%8s%15.7f%5s%15.7f\n","",m_Apex.Z(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KZ"; + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Z%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Z"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DZ(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else + { + /*sprintf(chExpn, "GQ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f\n", + "",m_dPrmtA1,"",m_dPrmtA2,"",m_dPrmtA3, + "",2*m_dPrmtB1,"",2*m_dPrmtB2,"",2*m_dPrmtB3, + "",2*m_dPrmtC1,"",2*m_dPrmtC2,"",2*m_dPrmtC3,"",m_dPrmtD);*/ + + m_SurfSymb = "KZ"; + m_PrmtList.push_back(0); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + m_PrmtList.push_back(1); + + m_bTransfCrad = Standard_True; + +// m_SurfSymb = "GQ"; +// m_PrmtList.push_back(m_dPrmtA1); +// m_PrmtList.push_back(m_dPrmtA2); +// m_PrmtList.push_back(m_dPrmtA3); +// m_PrmtList.push_back(2*m_dPrmtB1); +// m_PrmtList.push_back(2*m_dPrmtB3); +// m_PrmtList.push_back(2*m_dPrmtB2); +// m_PrmtList.push_back(2*m_dPrmtC1); +// m_PrmtList.push_back(2*m_dPrmtC2); +// m_PrmtList.push_back(2*m_dPrmtC3); +// m_PrmtList.push_back(m_dPrmtD); + + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + +void McCadGeomCone::AddTransfCard(McCadGeomData * pData) +{ + m_iTrNum = pData->AddTransfCard(m_Axis,m_Apex); +} + + +TCollection_AsciiString McCadGeomCone::GetTransfNum()const +{ + if(m_iTrNum != 0) + { + TCollection_AsciiString strNum(m_iTrNum); + return strNum; + } + else + { + return ""; + } + +} + +Standard_Boolean McCadGeomCone::HaveTransfCard() +{ + return m_bTransfCrad; +} + +/** ******************************************************************** +* @brief Judge the geometry of two cones are same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomCone *pCone = (McCadGeomCone*)(theSurf); + assert(pCone); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the Axis is same or opposite, the radius is same and the point on axis is same + // the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pCone->GetAxisDir(), angle_tol )) + //|| m_Dir.IsOpposite( pCone->GetAxisDir(), 1.0e-03 )) + { + if ( fabs(m_SemiAngle - pCone->GetSemiAngle()) < dis_tol + && m_Apex.IsEqual(pCone->GetApex(),dis_tol)) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the peak point of the cone +* +* @param +* @return gp_Pnt m_Apex +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomCone::GetApex() const +{ + return m_Apex; +} + +/** ******************************************************************** +* @brief Get the semi angle of the cone +* +* @param +* @return Standard_Real m_SemiAngle +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomCone::GetSemiAngle() const +{ + return m_SemiAngle; +} + + +/** ******************************************************************** +* @brief Get the direction of axis of the cone +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomCone::GetAxisDir() const +{ + return m_Dir; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomCone::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::Compare(const IGeomFace *& theGeoFace) +{ + + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} diff --git a/src/MCCAD/McCadMcVoid/McCadGeomCone-beforeTR.hxx b/src/MCCAD/McCadMcVoid/McCadGeomCone-beforeTR.hxx new file mode 100644 index 0000000..24e385c --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomCone-beforeTR.hxx @@ -0,0 +1,74 @@ +#ifndef MCCADGEOMCONE_H +#define MCCADGEOMCONE_H + +#include "IGeomFace.hxx" +#include "McCadGeomData.hxx" + +#include +#include +#include +#include + +class McCadVoidCellManager; +class McCadGeomCone : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomCone(); + McCadGeomCone(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomCone(); + +public: + virtual void CleanObj() const; /**< Clean the generated objects */ + + virtual TCollection_AsciiString GetExpression(); /**< Get the mcnp expression of cone */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< Judge two cones is same or not */ + + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + + + gp_Pnt GetApex() const; /**< Get the peak point of cone */ + Standard_Real GetSemiAngle() const; /**< Get the semi angle of cone */ + gp_Dir GetAxisDir() const; /**< Get the dir of cone's axis */ + + void AddTransfCard(McCadGeomData *pData); + virtual TCollection_AsciiString GetTransfNum()const; + Standard_Boolean HaveTransfCard(); + +private: + + gp_Dir m_Dir; /**< Direction of axis */ + gp_Ax3 m_Axis; /**< Coordinate of cone */ + + Standard_Real m_SemiAngle; /**< SemiAngle of cone */ + gp_Pnt m_Apex; /**< Top point of cone */ + + Standard_Real m_dPrmtA1; /**< Parameter A1 of plane equation */ + Standard_Real m_dPrmtA2; /**< Parameter A2 of plane equation */ + Standard_Real m_dPrmtA3; /**< Parameter A3 of plane equation */ + Standard_Real m_dPrmtB1; /**< Parameter B1 of plane equation */ + Standard_Real m_dPrmtB2; /**< Parameter B2 of plane equation */ + Standard_Real m_dPrmtB3; /**< Parameter B3 of plane equation */ + Standard_Real m_dPrmtC1; /**< Parameter C1 of plane equation */ + Standard_Real m_dPrmtC2; /**< Parameter C2 of plane equation */ + Standard_Real m_dPrmtC3; /**< Parameter C3 of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ + + Standard_Integer m_iTrNum; + Standard_Boolean m_bTransfCrad; +}; + +#endif // MCCADGEOMCONE_H diff --git a/src/MCCAD/McCadMcVoid/McCadGeomCone.cxx b/src/MCCAD/McCadMcVoid/McCadGeomCone.cxx new file mode 100644 index 0000000..893925d --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomCone.cxx @@ -0,0 +1,419 @@ +#include "McCadGeomCone.hxx" + +#include +#include +#include + +#include "McCadTransfCard.hxx" +#include "McCadVoidCellManager.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + + +McCadGeomCone::McCadGeomCone() +{ +} + +McCadGeomCone::~McCadGeomCone(){} + + +/** ******************************************************************** +* @brief Construct a cone based on the geometry surface +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomCone::McCadGeomCone(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfCone ; // The surface is a cone + gp_Cone cone = theSurface.Cone(); // Get the geometry of cone + cone.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = cone.Position(); // Get the coordinate system Ax3 + m_SemiAngle = cone.SemiAngle(); // Get the semi angle of cone + m_Dir = m_Axis.Direction(); // Get the direction of axis + m_Apex = cone.Apex(); // Get the peak point of cone + + if( McCadMathTool::IsEqualZero(m_Apex.X())) + m_Apex.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Y())) + m_Apex.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Apex.Z())) + m_Apex.SetZ(0.0); + + + + + cone.Coefficients( m_dPrmtA1,m_dPrmtA2,m_dPrmtA3, // Get the parameters + m_dPrmtB1,m_dPrmtB2,m_dPrmtB3, + m_dPrmtC1,m_dPrmtC2,m_dPrmtC3, + m_dPrmtD); + + m_bReverse = Standard_False; + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA1 < 0.0) + { + m_dPrmtA1 *= -1; + m_dPrmtA2 *= -1; + m_dPrmtA3 *= -1; + m_dPrmtB1 *= -1; + m_dPrmtB2 *= -1; + m_dPrmtB3 *= -1; + m_dPrmtC1 *= -1; + m_dPrmtC2 *= -1; + m_dPrmtC3 *= -1; + m_dPrmtD *= -1; + + m_bReverse = Standard_True; + } + + /* test code + cout<<"cone"<= dis_tol + && fabs(m_Apex.Y()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KX%8s%15.7f%5s%15.7f\n","",m_Apex.X(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KX"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/X%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/X"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DX(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else if( m_Axis.IsCoplanar(Ax3_Y, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Y()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Z()) <= dis_tol) + { + //sprintf(chExpn, "KY%8s%15.7f%5s%15.7f\n","",m_Apex.Y(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KY"; + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Y%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Y"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DY(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + + } + else if( m_Axis.IsCoplanar(Ax3_Z, angle_tol,angle_tol)) + { + if (fabs(m_Apex.Z()) >= dis_tol + && fabs(m_Apex.X()) <= dis_tol + && fabs(m_Apex.Y()) <= dis_tol) + { + //sprintf(chExpn, "KZ%8s%15.7f%5s%15.7f\n","",m_Apex.Z(),"",pow(tan(m_SemiAngle),2)); + + m_SurfSymb = "KZ"; + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + else + { + /*sprintf(chExpn, "K/Z%8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Apex.X(), + "", m_Apex.Y(), + "", m_Apex.Z(), + "", pow(tan(m_SemiAngle),2));*/ + + m_SurfSymb = "K/Z"; + m_PrmtList.push_back(m_Apex.X()); + m_PrmtList.push_back(m_Apex.Y()); + m_PrmtList.push_back(m_Apex.Z()); + m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + } + + if(m_Dir.IsOpposite(gp::DZ(),angle_tol)) + { + m_PrmtList.push_back(-1); + } + else + { + m_PrmtList.push_back(1); + } + } + else + { + /*sprintf(chExpn, "GQ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f\n", + "",m_dPrmtA1,"",m_dPrmtA2,"",m_dPrmtA3, + "",2*m_dPrmtB1,"",2*m_dPrmtB2,"",2*m_dPrmtB3, + "",2*m_dPrmtC1,"",2*m_dPrmtC2,"",2*m_dPrmtC3,"",m_dPrmtD);*/ + + // m_SurfSymb = "KZ"; + // m_PrmtList.push_back(0); + // m_PrmtList.push_back(pow(tan(m_SemiAngle),2)); + //m_PrmtList.push_back(1); + + // m_bTransfCrad = Standard_True; + + m_SurfSymb = "GQ"; + m_PrmtList.push_back(m_dPrmtA1); + m_PrmtList.push_back(m_dPrmtA2); + m_PrmtList.push_back(m_dPrmtA3); + m_PrmtList.push_back(2*m_dPrmtB1); + m_PrmtList.push_back(2*m_dPrmtB3); + m_PrmtList.push_back(2*m_dPrmtB2); + m_PrmtList.push_back(2*m_dPrmtC1); + m_PrmtList.push_back(2*m_dPrmtC2); + m_PrmtList.push_back(2*m_dPrmtC3); + m_PrmtList.push_back(m_dPrmtD); + + + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + +void McCadGeomCone::AddTransfCard(McCadGeomData * pData) +{ + m_iTrNum = pData->AddTransfCard(m_Axis,m_Apex); +} + + +TCollection_AsciiString McCadGeomCone::GetTransfNum()const +{ + if(m_iTrNum != 0) + { + TCollection_AsciiString strNum(m_iTrNum); + return strNum; + } + else + { + return ""; + } + +} + +Standard_Boolean McCadGeomCone::HaveTransfCard() +{ + return m_bTransfCrad; +} + +/** ******************************************************************** +* @brief Judge the geometry of two cones are same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomCone *pCone = (McCadGeomCone*)(theSurf); + assert(pCone); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the Axis is same or opposite, the radius is same and the point on axis is same + // the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pCone->GetAxisDir(), angle_tol )) + //|| m_Dir.IsOpposite( pCone->GetAxisDir(), 1.0e-03 )) + { + if ( fabs(m_SemiAngle - pCone->GetSemiAngle()) < dis_tol + && m_Apex.IsEqual(pCone->GetApex(),dis_tol)) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the peak point of the cone +* +* @param +* @return gp_Pnt m_Apex +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomCone::GetApex() const +{ + return m_Apex; +} + +/** ******************************************************************** +* @brief Get the semi angle of the cone +* +* @param +* @return Standard_Real m_SemiAngle +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomCone::GetSemiAngle() const +{ + return m_SemiAngle; +} + + +/** ******************************************************************** +* @brief Get the direction of axis of the cone +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomCone::GetAxisDir() const +{ + return m_Dir; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomCone::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCone::Compare(const IGeomFace *& theGeoFace) +{ + + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} diff --git a/src/MCCAD/McCadMcVoid/McCadGeomCone.hxx b/src/MCCAD/McCadMcVoid/McCadGeomCone.hxx new file mode 100644 index 0000000..24e385c --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomCone.hxx @@ -0,0 +1,74 @@ +#ifndef MCCADGEOMCONE_H +#define MCCADGEOMCONE_H + +#include "IGeomFace.hxx" +#include "McCadGeomData.hxx" + +#include +#include +#include +#include + +class McCadVoidCellManager; +class McCadGeomCone : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomCone(); + McCadGeomCone(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomCone(); + +public: + virtual void CleanObj() const; /**< Clean the generated objects */ + + virtual TCollection_AsciiString GetExpression(); /**< Get the mcnp expression of cone */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< Judge two cones is same or not */ + + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + + + gp_Pnt GetApex() const; /**< Get the peak point of cone */ + Standard_Real GetSemiAngle() const; /**< Get the semi angle of cone */ + gp_Dir GetAxisDir() const; /**< Get the dir of cone's axis */ + + void AddTransfCard(McCadGeomData *pData); + virtual TCollection_AsciiString GetTransfNum()const; + Standard_Boolean HaveTransfCard(); + +private: + + gp_Dir m_Dir; /**< Direction of axis */ + gp_Ax3 m_Axis; /**< Coordinate of cone */ + + Standard_Real m_SemiAngle; /**< SemiAngle of cone */ + gp_Pnt m_Apex; /**< Top point of cone */ + + Standard_Real m_dPrmtA1; /**< Parameter A1 of plane equation */ + Standard_Real m_dPrmtA2; /**< Parameter A2 of plane equation */ + Standard_Real m_dPrmtA3; /**< Parameter A3 of plane equation */ + Standard_Real m_dPrmtB1; /**< Parameter B1 of plane equation */ + Standard_Real m_dPrmtB2; /**< Parameter B2 of plane equation */ + Standard_Real m_dPrmtB3; /**< Parameter B3 of plane equation */ + Standard_Real m_dPrmtC1; /**< Parameter C1 of plane equation */ + Standard_Real m_dPrmtC2; /**< Parameter C2 of plane equation */ + Standard_Real m_dPrmtC3; /**< Parameter C3 of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ + + Standard_Integer m_iTrNum; + Standard_Boolean m_bTransfCrad; +}; + +#endif // MCCADGEOMCONE_H diff --git a/src/MCCAD/McCadMcVoid/McCadGeomCylinder.cxx b/src/MCCAD/McCadMcVoid/McCadGeomCylinder.cxx new file mode 100644 index 0000000..9d42727 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomCylinder.cxx @@ -0,0 +1,394 @@ +#include "McCadGeomCylinder.hxx" + +#include + +#include +#include +#include +#include +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +using namespace std; + +McCadGeomCylinder::McCadGeomCylinder() +{ + +} + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomCylinder::McCadGeomCylinder(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfCylinder ; // The surface is a cylinder + gp_Cylinder cyln = theSurface.Cylinder(); // Get the geometry of cylinder + cyln.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = cyln.Position(); // Get the coordinate system Ax3 + m_Radius = cyln.Radius(); // Get the radius + m_Point = m_Axis.Location(); // Assign a point on the axis + m_Dir = m_Axis.Direction(); // Get the direction of axis + m_vec.SetXYZ(m_Dir.XYZ()); + m_vec.Normalize(); + + if( McCadMathTool::IsEqualZero(m_Point.X())) + m_Point.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Point.Y())) + m_Point.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Point.Z())) + m_Point.SetZ(0.0); + + cyln.Coefficients( m_dPrmtA1,m_dPrmtA2,m_dPrmtA3, // Get the parameters + m_dPrmtB1,m_dPrmtB2,m_dPrmtB3, + m_dPrmtC1,m_dPrmtC2,m_dPrmtC3, + m_dPrmtD); + + m_bReverse = Standard_False; + + /*SimplifyPrmt(m_dPrmtA1); + SimplifyPrmt(m_dPrmtA2); + SimplifyPrmt(m_dPrmtA3); + SimplifyPrmt(m_dPrmtB1); + SimplifyPrmt(m_dPrmtB2); + SimplifyPrmt(m_dPrmtB3); + SimplifyPrmt(m_dPrmtC1); + SimplifyPrmt(m_dPrmtC2); + SimplifyPrmt(m_dPrmtC3); + SimplifyPrmt(m_dPrmtD);*/ + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA1 < 0.0) + { + m_dPrmtA1 *= -1; + m_dPrmtA2 *= -1; + m_dPrmtA3 *= -1; + m_dPrmtB1 *= -1; + m_dPrmtB2 *= -1; + m_dPrmtB3 *= -1; + m_dPrmtC1 *= -1; + m_dPrmtC2 *= -1; + m_dPrmtC3 *= -1; + m_dPrmtD *= -1; + + m_bReverse = Standard_True; + } + + //m_PrmtList = new TColStd_HSequenceOfAsciiString(); + GetExpression(); +} + + +McCadGeomCylinder::~McCadGeomCylinder() +{ + m_PrmtList.clear(); +} + + +void McCadGeomCylinder::SimplifyPrmt(Standard_Real &thePrmt) +{ + if(McCadMathTool::IsEqualZero(thePrmt)) + { + thePrmt = 0.0; + } +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomCylinder::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + + Standard_Character chExpn[255]; + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + //if(Abs(m_Radius) < dis_tol) + //m_Radius = 0.0; + + // Create the standard X, Y, Z axis + gp_Ax3 Ax3_X(m_Point, gp::DX()); + gp_Ax3 Ax3_Y(m_Point, gp::DY()); + gp_Ax3 Ax3_Z(m_Point, gp::DZ()); + + if (m_Axis.IsCoplanar(Ax3_X, angle_tol, angle_tol)) + { + if (fabs(m_Point.Y()) <= dis_tol && fabs(m_Point.Z()) <= dis_tol) + { + //sprintf(chExpn, "CX%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "CX"; + m_PrmtList.push_back(m_Radius); + } + else + { + /*sprintf(chExpn, "C/X%8s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Point.Y(), + "", m_Point.Z(), + "", m_Radius);*/ + + m_SurfSymb = "C/X"; + m_PrmtList.push_back(m_Point.Y()); + m_PrmtList.push_back(m_Point.Z()); + m_PrmtList.push_back(m_Radius); + } + } + else if (m_Axis.IsCoplanar(Ax3_Y, angle_tol, angle_tol)) + { + if (fabs(m_Point.X()) <= dis_tol && fabs(m_Point.Z()) <= dis_tol) + { + //sprintf(chExpn, "CY%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "CY"; + m_PrmtList.push_back(m_Radius); + } + else + { + /*sprintf(chExpn, "C/Y%8s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Point.X(), + "", m_Point.Z(), + "", m_Radius);*/ + + m_SurfSymb = "C/Y"; + m_PrmtList.push_back(m_Point.X()); + m_PrmtList.push_back(m_Point.Z()); + m_PrmtList.push_back(m_Radius); + } + } + else if (m_Axis.IsCoplanar(Ax3_Z, angle_tol, angle_tol)) + { + if (fabs(m_Point.X()) <= dis_tol && fabs(m_Point.Y()) <= dis_tol) + { + //sprintf(chExpn, "CZ%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "CZ"; + m_PrmtList.push_back(m_Radius); + } + else + { + /*sprintf(chExpn, "C/Z%8s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Point.X(), + "", m_Point.Y(), + "", m_Radius);*/ + + m_SurfSymb = "C/Z"; + m_PrmtList.push_back(m_Point.X()); + m_PrmtList.push_back(m_Point.Y()); + m_PrmtList.push_back(m_Radius); + } + } + else + { + sprintf(chExpn, "GQ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f\n", + "",m_dPrmtA1,"",m_dPrmtA2,"",m_dPrmtA3, + "",2*m_dPrmtB1,"",2*m_dPrmtB2,"",2*m_dPrmtB3, + "",2*m_dPrmtC1,"",2*m_dPrmtC2,"",2*m_dPrmtC3,"",m_dPrmtD); + + m_SurfSymb = "GQ"; + m_PrmtList.push_back(m_dPrmtA1); + m_PrmtList.push_back(m_dPrmtA2); + m_PrmtList.push_back(m_dPrmtA3); + m_PrmtList.push_back(2*m_dPrmtB1); + m_PrmtList.push_back(2*m_dPrmtB3); + m_PrmtList.push_back(2*m_dPrmtB2); + m_PrmtList.push_back(2*m_dPrmtC1); + m_PrmtList.push_back(2*m_dPrmtC2); + m_PrmtList.push_back(2*m_dPrmtC3); + m_PrmtList.push_back(m_dPrmtD); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + +/** ******************************************************************** +* @brief Judge the geometry of two cylinders are same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCylinder::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomCylinder *pCyln = (McCadGeomCylinder*)(theSurf); + assert(pCyln); + + //Standard_Real dis_tol = 1.0e-5; + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the Axis is same or opposite, the radius is same and the point on axis is same + // the two cylinder can be treated as same cylinder + if( m_vec.IsParallel(pCyln->GetAxisDir(), angle_tol ) + || m_vec.IsOpposite( pCyln->GetAxisDir(), angle_tol )) + { + if ( fabs(m_Radius - pCyln->GetRadius()) < dis_tol + /*&& m_Point.IsEqual(pCyln->GetPoint(),dis_tol)*/) + { + + if(!m_Point.IsEqual(pCyln->GetPoint(),dis_tol)) + { + gp_Dir line_dir(m_Point.XYZ()- pCyln->GetPoint().XYZ()); + if(line_dir.IsParallel(m_Dir, angle_tol) || line_dir.IsOpposite(m_Dir, angle_tol)) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_True; + } + } + } + return Standard_False; +} + + + + + + +/** ******************************************************************** +* @brief Get the direction of axis of cylinder +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomCylinder::GetAxisDir() const +{ + return m_Dir; +} + + + + +/** ******************************************************************** +* @brief Get the center of bottom section +* +* @param +* @return gp_Pnt m_Point +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomCylinder::GetPoint() const +{ + return m_Point; +} + + + + +/** ******************************************************************** +* @brief Get the radius of section +* +* @param +* @return Standard_Real m_Radius +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomCylinder::GetRadius() const +{ + return m_Radius; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomCylinder::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomCylinder::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + +TCollection_AsciiString McCadGeomCylinder::GetTransfNum()const +{ + return ""; +} + diff --git a/src/MCCAD/McCadMcVoid/McCadGeomCylinder.hxx b/src/MCCAD/McCadMcVoid/McCadGeomCylinder.hxx new file mode 100644 index 0000000..06d9731 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomCylinder.hxx @@ -0,0 +1,67 @@ +#ifndef MCCADGEOMCYLINDER_HXX +#define MCCADGEOMCYLINDER_HXX + +#include "IGeomFace.hxx" +#include +#include +#include + +class McCadGeomCylinder : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomCylinder(); + McCadGeomCylinder(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomCylinder(); + +public: + virtual TCollection_AsciiString GetExpression(); /**< Calculate the equation and direction of plane */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace); /**< Judge the two cylinder are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + + virtual TCollection_AsciiString GetTransfNum() const; + + Standard_Real GetRadius() const; /**< Get radius */ + gp_Pnt GetPoint() const; /**< Get point on axis */ + gp_Dir GetAxisDir() const; /**< Get direction of axis */ + void SimplifyPrmt(Standard_Real &thePrmt); + +private: + + gp_Dir m_Dir; /**< Direction of a axis */ + gp_Ax3 m_Axis; /**< Axis of cylinder */ + gp_Pnt m_Point; /**< A point on axis */ + Standard_Real m_Radius; /**< Radius of section */ + gp_Vec m_vec; + + Standard_Real m_dPrmtA1; /**< Parameter A1 of plane equation */ + Standard_Real m_dPrmtA2; /**< Parameter A2 of plane equation */ + Standard_Real m_dPrmtA3; /**< Parameter A3 of plane equation */ + Standard_Real m_dPrmtB1; /**< Parameter B1 of plane equation */ + Standard_Real m_dPrmtB2; /**< Parameter B2 of plane equation */ + Standard_Real m_dPrmtB3; /**< Parameter B3 of plane equation */ + Standard_Real m_dPrmtC1; /**< Parameter C1 of plane equation */ + Standard_Real m_dPrmtC2; /**< Parameter C2 of plane equation */ + Standard_Real m_dPrmtC3; /**< Parameter C3 of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ +}; + +#endif // MCCADGEOMCYLINDER_HXX + + + + diff --git a/src/MCCAD/McCadMcVoid/McCadGeomData.cxx b/src/MCCAD/McCadMcVoid/McCadGeomData.cxx new file mode 100644 index 0000000..d7dc290 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomData.cxx @@ -0,0 +1,543 @@ +#include "McCadGeomData.hxx" + +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "McCadConvexSolid.hxx" +#include "McCadGeomPlane.hxx" +#include "McCadGeomCylinder.hxx" +#include "McCadGeomCone.hxx" +#include "McCadGeomSphere.hxx" +#include "McCadGeomTorus.hxx" +#include "McCadGeomRevolution.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" + +#include "GProp_GProps.hxx" +#include "BRepGProp.hxx" + +McCadGeomData::McCadGeomData() +{ + m_iNumSolid = 0; // Initial the number of convex solid. +} + +McCadGeomData::McCadGeomData(Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bVoid) +{ + InputData(solid_list,bVoid); +} + +McCadGeomData::~McCadGeomData() +{ + if(m_pOutVoid != NULL) + { + delete m_pOutVoid; + m_pOutVoid = NULL; + } + + vector::iterator iterSld; + for (iterSld = m_SolidList.begin(); iterSld != m_SolidList.end(); ++iterSld) + { + if(*iterSld != NULL) + { + delete *iterSld; + *iterSld = NULL; + } + } + m_SolidList.clear(); + + vector::iterator iterConvexSld; + for (iterConvexSld = m_ConvexSolidList.begin(); iterConvexSld != m_ConvexSolidList.end(); ++iterConvexSld) + { + if(*iterConvexSld != NULL) + { + delete *iterConvexSld; + *iterConvexSld = NULL; + } + } + m_ConvexSolidList.clear(); + + vector::iterator iterVoidCell; + for (iterVoidCell = m_VoidCellList.begin(); iterVoidCell != m_VoidCellList.end(); ++iterVoidCell) + { + if(*iterVoidCell != NULL) + { + delete *iterVoidCell; + *iterVoidCell = NULL; + } + } + m_VoidCellList.clear(); + + vector::iterator iterFace; + for (iterFace = m_GeomSurfList.begin(); iterFace != m_GeomSurfList.end(); ++iterFace) + { + if(*iterFace != NULL) + { + delete *iterFace; + *iterFace = NULL; + } + } + m_GeomSurfList.clear(); + + vector::iterator iterTrfCard; + for (iterTrfCard = m_TransfCardList.begin(); iterTrfCard != m_TransfCardList.end(); ++iterTrfCard) + { + if(*iterTrfCard != NULL) + { + delete *iterTrfCard; + *iterTrfCard = NULL; + } + } + m_TransfCardList.clear(); +} + + +/** ******************************************************************** +* @brief Get the material solids from the input file read, and generate +* the surfaces list. +* +* @param[in] Handle_TopTools_HSequenceOfShape solid_list +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::InputData( Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bGenVoid ) +{ + m_listConvexSolid = new TopTools_HSequenceOfShape; // create a shape list to store the convex material solids + m_listVoidCell = new TopTools_HSequenceOfShape; // create a shape list to store the void solids + + Standard_Integer iNumMatSolid = solid_list->Length(); + cout<< iNumMatSolid << " Solids are read" << endl; + + for(int i = 1; i <= iNumMatSolid; i++) + { + cout<Value(i).GetSolid(); + TopoDS_Shape theShape = solid_list->Value(i); + TopExp_Explorer exp; + + /// If the solid is compound solid, explode each its lumps into solids firstly + if( theShape.ShapeType() == TopAbs_COMPSOLID || theShape.ShapeType() == TopAbs_COMPOUND ) + { + cout<<"yes. it is compoundsolid;"<= 0.01) // Set the minimum volume tolerance + { + pConvexSolid = new McCadConvexSolid(tmpSolid); + pConvexSolid->SetVolume(GP.Mass()); + } + else + { + cout<<"Detected a solid with small volume: "<GetVolume()<GetSTLFaceList()); // Travelse the boundary faces, add in face list + AddGeomAuxSurfList(pConvexSolid->GetSTLFaceList()); // Judge whether need add auxiliary faces + pSolidList->AddConvexSolid(pConvexSolid); // Add the convex solid into a complicate solid + + pConvexSolid->DeleteRepeatFaces(bGenVoid); // Delete the repeated faces of solid + + m_ConvexSolidList.push_back(pConvexSolid); // Add the convex solid in the solid list + m_iNumSolid++; + } + m_SolidList.push_back(pSolidList); + } + // If the solid is single solid, add to convex solid list directly + else if( theShape.ShapeType() == TopAbs_SOLID) + { + TopoDS_Solid tmpSolid = TopoDS::Solid(solid_list->Value(i)); + McCadConvexSolid *pConvexSolid = NULL; + McCadSolid * pSolidList = new McCadSolid(); + + GProp_GProps GP; + BRepGProp::VolumeProperties(tmpSolid, GP); + + if(GP.Mass() >= 0.01) // Set the minimum volume tolerance + { + pConvexSolid = new McCadConvexSolid(tmpSolid); + pConvexSolid->SetVolume(GP.Mass()); + } + else + { + cout<<"Detected a solid with small volume: "<GetVolume()<GetSTLFaceList()); // Travelse the boundary faces, add in face list + AddGeomAuxSurfList(pConvexSolid->GetSTLFaceList()); // Judge whether need add auxiliary faces + pSolidList->AddConvexSolid(pConvexSolid); // Add the convex solid into a complicate solid + + pConvexSolid->DeleteRepeatFaces(bGenVoid); // Delete the repeated faces of solid + m_ConvexSolidList.push_back(pConvexSolid); // Add the convex solid in the solid list + m_iNumSolid++; + m_SolidList.push_back(pSolidList); + } + + } + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::AddGeomSurfList(const vector & theExtFaceList) +{ + /* travelse the extend faces list */ + for (unsigned int i = 0; i < theExtFaceList.size(); i++) + { + McCadExtFace *pExtFace = theExtFaceList[i]; + + TopLoc_Location loc; + Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(*pExtFace, loc); + GeomAdaptor_Surface surf_adoptor(geom_surface); + + /* Generate the geometry surface interface based on the type of sufaces */ + IGeomFace * pGeomFace = NULL; + switch (surf_adoptor.GetType()) + { + case GeomAbs_Plane: + { + pGeomFace = new McCadGeomPlane(surf_adoptor); + break; + } + case GeomAbs_Cylinder: + { + pGeomFace = new McCadGeomCylinder(surf_adoptor); + break; + } + case GeomAbs_Cone: + { + pGeomFace = new McCadGeomCone(surf_adoptor); + if(((McCadGeomCone *)pGeomFace)->HaveTransfCard() ) + { + ((McCadGeomCone *)pGeomFace)->AddTransfCard(this);// lei lu 131209 + } + break; + } + case GeomAbs_Sphere: + { + pGeomFace = new McCadGeomSphere(surf_adoptor); + break; + } + case GeomAbs_Torus: + { + pGeomFace = new McCadGeomTorus(surf_adoptor); + break; + } + case GeomAbs_SurfaceOfRevolution: + { + pGeomFace = new McCadGeomRevolution(surf_adoptor); + break; + } + case GeomAbs_BezierSurface: + { + cout << "Surface is not analytic (BezierSurface) " << endl; + break; + } + case GeomAbs_BSplineSurface: + { + cout << "Surface is not analytic (BSplineSurface) " << endl; + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "Surface is not analytic (SurfaceOfRevolution) " << endl; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "Surface is not analytic (OffsetSurface) " << endl; + break; + } + case GeomAbs_OtherSurface: + { + cout << "Surface is not analytic " << endl; + break; + } + default:break; + } + + if (!pGeomFace) // If geometry face didn't generated, the face should be spline surface. + { + return; + } + + Standard_Boolean bExist = Standard_False; // Assume that the geometry surface didn't existed in the face list + + /* Travelse the geometry face list, add the new surface generated into the list. + if the face with same geometry is existed already,no need to add more */ + vector::iterator iterPos; + for (iterPos = m_GeomSurfList.begin(); iterPos != m_GeomSurfList.end(); ++iterPos) + { + IGeomFace * pIterFace = *iterPos; + if(pGeomFace->IsEqual( pIterFace )) + { + bExist = Standard_True; // The geometry suface has already existed in list. + if (pGeomFace->IsReversed()) // If the face orientation is different, reverse the new added surface. + { + pExtFace->Reverse(); + } + + pExtFace->SetFaceNum(pIterFace->GetSurfNum()); // Set the surface number to be same. + delete pGeomFace; // Delete the point of geometry face and keep the extend surface. + pGeomFace = NULL; + break; + } + } + + /* If there are no repeated surface, add the surface into the list.*/ + if (Standard_False == bExist) + { + // use the serial number in geometry surface list as Face-Surface relationship number. + int iNum = m_GeomSurfList.size(); + + // Set the code number of McCadExtFace and GeomSurface, it will help to match them. + // If the geometry surface orientation is reversed, make it to be forword. + if (pGeomFace->IsReversed()) + { + //cout<<"fanzhuan"<GetExpression()<Reverse(); + } + pExtFace->SetFaceNum(iNum + 1); // Set the face number + pGeomFace->SetSurfNum(iNum + 1); // Set the surface number, it is same to face number + + m_GeomSurfList.push_back(pGeomFace); // Add the geometry surface into geometry face list. + } + } +} + + + +/** ******************************************************************** +* @brief Travelse the boundary surfaces of solid, calculate whether it +* need add auxiliary faces,if need add them into geometery +* surface list. +* +* @param const vector & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::AddGeomAuxSurfList(const vector & theExtFaceList) +{ + for (unsigned int i = 0; i < theExtFaceList.size(); i++) + { + McCadExtFace * pExtFace = theExtFaceList[i]; + assert(pExtFace); + vector AuxFaceList = pExtFace->GetAuxFaces(); // Calculate the face's auxiliary faces + + if(AuxFaceList.size() == 0) // if there are no auxiliary surface + { + continue; + } + else // Add the auxiliary faces into geometry face list + { + AddGeomSurfList(AuxFaceList); + } + } +} + + + +/** ******************************************************************** +* @brief Set the manager pointer of data object +* +* @param McCadVoidCellManager * pManager +* @return void +* +* @date 11/12/2013 +* @author Lei Lu +*********************************************************************/ +void McCadGeomData::SetManager(const McCadVoidCellManager * pManager) +{ +//qiu m_pManager = pManager; + m_pManager = const_cast (pManager); +} + + + + +/** ******************************************************************** +* @brief Calculate the weight of each surface according to the surface +* type and parameters. +* +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Standard_Boolean compare(const IGeomFace * surfA, const IGeomFace * surfB) +{ +//qiu return surfA->Compare(surfB); + return const_cast (surfA)->Compare(surfB); +} + +/** ******************************************************************** +* @brief Sort the surfaces, the weight of surfaces is calculated by +* function-compare +* +* @param +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadGeomData::SortSurface() +{ + sort(m_GeomSurfList.begin(),m_GeomSurfList.end(),compare); // Sort the geometry surface list. + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadGeomData::UpdateFaceNum() +{ + Standard_Integer iSurfNumNew; + Standard_Integer iSurfNumOld; + + for(unsigned int i = 0; i < m_GeomSurfList.size(); i++) + { + IGeomFace * pFace = m_GeomSurfList.at(i); + iSurfNumNew = i+1; + iSurfNumOld = pFace->GetSurfNum(); + GenMapSurfNum(iSurfNumOld,iSurfNumNew); + } + + try + { + /** Update the face number of solids, voids and outer spaces. */ + for (unsigned int i = 0; i < m_SolidList.size(); i++) + { + McCadSolid * pSolid = m_SolidList.at(i); + assert(pSolid); + + for(int j = 0; j < pSolid->GetConvexSolidList().size(); j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + pConvexSolid->ChangeFaceNum(this); + } + } + + for (unsigned int i = 0; i < m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = m_VoidCellList.at(i); + assert(pVoid); + + pVoid->ChangeFaceNum(this); // Update the surface number after sorting the surface list. + } + + if (m_pManager->GenVoid()) + { + assert(m_pOutVoid); + m_pOutVoid->ChangeFaceNum(this); // Update the face number. + } + } + catch(...) + { + cout << "#McCadGeomData :: Update surfaces number FAILED\n"; + } +} + + +vector McCadGeomData::GetConvexSolid() +{ + return m_ConvexSolidList; +} + + +vector McCadGeomData::GetTransfCard() +{ + return m_TransfCardList; +} + + +int McCadGeomData::AddTransfCard(gp_Ax3 theAxis, gp_Pnt theApex) +{ + int iTrNum; + McCadTransfCard *pTrCard = new McCadTransfCard(theAxis,theApex); + iTrNum = m_TransfCardList.size() + 1; + pTrCard->SetTrNum(iTrNum); + m_TransfCardList.push_back(pTrCard); + + return iTrNum; +} + + +Standard_Boolean McCadGeomData::GenMapSurfNum(Standard_Integer iSurfNumOld,Standard_Integer iSurfNumNew) +{ + pair(iSurfNumOld,iSurfNumNew); + pair::iterator,bool> result; + result = m_mapSurfNum.insert(pair(iSurfNumOld,iSurfNumNew)); + + if(result.second) + { + return Standard_True; + } + else + { + return Standard_False; + } +} + + +Standard_Integer McCadGeomData::GetNewFaceNum(Standard_Integer iOldNum) +{ + map::iterator iter; + iter = m_mapSurfNum.find(iOldNum); + if (iter != m_mapSurfNum.end()) + { + return iter->second; + } +} diff --git a/src/MCCAD/McCadMcVoid/McCadGeomData.hxx b/src/MCCAD/McCadMcVoid/McCadGeomData.hxx new file mode 100644 index 0000000..6ec52e5 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomData.hxx @@ -0,0 +1,94 @@ +#ifndef MCCADGEOMDATA_HXX +#define MCCADGEOMDATA_HXX + +#include "McCadConvexSolid.hxx" +#include "McCadVoidCell.hxx" +#include "McCadTransfCard.hxx" +#include "IGeomFace.hxx" +#include "McCadGeomCone.hxx" +#include "McCadSolid.hxx" + +#include +#include + +class McCadGeomData +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +Standard_EXPORT McCadGeomData(); +Standard_EXPORT McCadGeomData(Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bGenVoid); +Standard_EXPORT ~McCadGeomData(); + + //private: //qiu +protected: + McCadVoidCellManager * m_pManager; /**< The manager object which data belong to */ + +//private: //qiu +protected: + Standard_Integer m_iNumSolid; /**< The number of convex solids */ + + Handle(TopTools_HSequenceOfShape) m_listConvexSolid; /**< The input convex solid after decomposition */ + Handle(TopTools_HSequenceOfShape) m_listVoidCell; /**< The input convex solid after decomposition */ + + vector m_SolidList; /**< Solid list */ + vector m_ConvexSolidList; /**< Convex solid list */ + vector m_VoidCellList; /**< void cell list */ + McCadVoidCell * m_pOutVoid; /**< The out box of the whole model */ + + vector m_GeomSurfList; /**< Geometry surface list */ + vector m_TransfCardList; /**< Surface transf card List */ + + map m_mapSurfNum; /**< When sort the surface list, reset the surface number */ + +public: + /** Input the geometry solid and assign the parameters. */ +Standard_EXPORT void InputData(Handle_TopTools_HSequenceOfShape & solid_list, Standard_Boolean bGenVoid); + /** Traverse the face list and construct geometry surface list.*/ +Standard_EXPORT void AddGeomSurfList(const vector & theExtFaceList); + /** Traverse the face list, if the face need to add auxiliary surface, + generate the auxiliary faces and add them into geometry face list. */ +Standard_EXPORT void AddGeomAuxSurfList(const vector & theExtFaceList); + /** Sort the surface list based on surface type and parameters */ +Standard_EXPORT void SortSurface(); + /** Update the face number of cell expression after sorting the surface */ +Standard_EXPORT void UpdateFaceNum(); + /** Connect the manager to data */ +Standard_EXPORT void SetManager(const McCadVoidCellManager * pManager); + +Standard_EXPORT int AddTransfCard(gp_Ax3 theAxis, gp_Pnt theApex); + +Standard_EXPORT Standard_Boolean GenMapSurfNum(Standard_Integer,Standard_Integer); +Standard_EXPORT Standard_Integer GetNewFaceNum(Standard_Integer iOldNum); + +Standard_EXPORT vector GetConvexSolid(); +Standard_EXPORT vector GetTransfCard(); + + /** Friend function which can be used to compare the weight of each surface and sort them */ +Standard_EXPORT friend Standard_Boolean compare(const IGeomFace * surfA, const IGeomFace * surfB); + +public: + + friend class McCadVoidGenerator; + friend class McCadVoidCellManager; + friend class McCadMcnpWriter; + friend class McCadTripoliWriter; + friend class S_McCadMcnpWriter; + friend class S_McCadTripoliWriter; + friend class McCadGDMLWriter; + friend class S_McCadGDMLWriter; +}; + +#endif // MCCADGEOMDATA_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadGeomPlane.cxx b/src/MCCAD/McCadMcVoid/McCadGeomPlane.cxx new file mode 100644 index 0000000..bc181d6 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomPlane.cxx @@ -0,0 +1,305 @@ +#include "McCadGeomPlane.hxx" + +#include +#include + +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +using namespace std; + +McCadGeomPlane::McCadGeomPlane() +{ + +} +McCadGeomPlane::~McCadGeomPlane() +{ + m_PrmtList.clear(); +} + +/** ******************************************************************** +* @brief Construct the plane class based on the geometry surface +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomPlane::McCadGeomPlane(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfPlane ; // The surface is a plane + + gp_Pln plane = theSurface.Plane(); // Get the geometry plane + plane.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + m_Axis = plane.Position(); // Get the coordinate system Ax3 + + plane.Coefficients(m_dPrmtA,m_dPrmtB,m_dPrmtC,m_dPrmtD); // Get the parameters of plane + + m_bReverse = Standard_False; + + /*if(Abs(m_dPrmtA) < 1.0e-5) + m_dPrmtA = 0.0; + if(Abs(m_dPrmtB) < 1.0e-5) + m_dPrmtB = 0.0; + if(Abs(m_dPrmtC) < 1.0e-5) + m_dPrmtC = 0.0; + if(Abs(m_dPrmtD) < 1.0e-5) + m_dPrmtD = 0.0;*/ + + // If the parameter is less than 1.0e-07, it can be take as zero + if(McCadMathTool::IsEqualZero(m_dPrmtA)) + m_dPrmtA = 0.0; + if(McCadMathTool::IsEqualZero(m_dPrmtB)) + m_dPrmtB = 0.0; + if(McCadMathTool::IsEqualZero(m_dPrmtC)) + m_dPrmtC = 0.0; + if(McCadMathTool::IsEqualZero(m_dPrmtD)) + m_dPrmtD = 0.0; + + m_Dir.SetCoord(m_dPrmtA,m_dPrmtB,m_dPrmtC); // Assign the direction of face + m_PntOnFace = m_Axis.Location(); // Assign a point on the face + + //m_PrmtList = new vector(); + GetExpression(); +} + + + +/** ******************************************************************** +* @brief Get mcnp expression of plane +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomPlane::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + + Standard_Character chExpn[255]; + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + + if (m_dPrmtD != 0.0) + { + m_dPrmtD *= -1; + } + + if ( fabs(m_dPrmtA) > dis_tol && fabs(m_dPrmtB) < dis_tol && fabs(m_dPrmtC) < dis_tol ) + { + sprintf(chExpn, "PX%8s%15.7f\n", "", m_dPrmtD); + + m_SurfSymb = "PX"; + m_PrmtList.push_back(m_dPrmtD/m_dPrmtA); + if(m_dPrmtA < 0.0) + { + m_dPrmtA *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + } + else if ( fabs(m_dPrmtB) > dis_tol && fabs(m_dPrmtA) < dis_tol && fabs(m_dPrmtC) < dis_tol) + { + sprintf(chExpn, "PY%8s%15.7f\n", "",m_dPrmtD); + + m_SurfSymb = "PY"; + m_PrmtList.push_back(m_dPrmtD/m_dPrmtB); + if(m_dPrmtB < 0.0) + { + m_dPrmtB *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + } + else if ( fabs(m_dPrmtC) > dis_tol && fabs(m_dPrmtA) < dis_tol && fabs(m_dPrmtB) < dis_tol) + { + sprintf(chExpn, "PZ%8s%15.7f\n", "", m_dPrmtD); + + m_SurfSymb = "PZ"; + m_PrmtList.push_back(m_dPrmtD/m_dPrmtC); + if(m_dPrmtC < 0.0) + { + m_dPrmtC *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + } + else + { + sprintf(chExpn, "P %8s%15.7f%5s%15.7f%5s%15.7f%5s%15.7f\n", + "",m_dPrmtA,"",m_dPrmtB,"",m_dPrmtC,"",m_dPrmtD); + + // Make sign of the m_dPrmtA to be positive + if (m_dPrmtA < 0.0) + { + m_dPrmtA *= -1; + m_dPrmtB *= -1; + m_dPrmtC *= -1; + m_dPrmtD *= -1; + m_bReverse = Standard_True; + m_Dir.Reverse(); + } + + m_SurfSymb = "P"; + m_PrmtList.push_back(m_dPrmtA); + m_PrmtList.push_back(m_dPrmtB); + m_PrmtList.push_back(m_dPrmtC); + m_PrmtList.push_back(m_dPrmtD); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + + + +/** ******************************************************************** +* @brief Judge the two planes is same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomPlane::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + Standard_Real dis_tol = 1.0e-5 /*McCadConvertConfig::GetTolerence()*/; + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + /* If the direction and parameter d is same, the two faces are treated as same */ + if( m_Dir.IsEqual( ((McCadGeomPlane*)(theSurf))->GetDir(), angle_tol ) + && ( fabs(m_dPrmtD - ((McCadGeomPlane*)(theSurf))->GetPrmtD()) < dis_tol)) + { + return Standard_True; + } + /* If the direction and parameter d is opposite, the two faces are also same */ + else if (m_Dir.IsOpposite( ((McCadGeomPlane*)(theSurf))->GetDir(), angle_tol ) + && (fabs(m_dPrmtD + ((McCadGeomPlane*)(theSurf))->GetPrmtD()) < dis_tol)) + { + if (!m_bReverse) + { + m_bReverse = Standard_True; + } + else + { + m_bReverse = Standard_False; + } + return Standard_True; + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the direction of plane +* +* @param +* @return gp_Dir m_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomPlane::GetDir() const +{ + return m_Dir; +} + + + +/** ******************************************************************** +* @brief Get the value of parameter D +* +* @param +* @return Standard_Real m_dPrmtD +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomPlane::GetPrmtD() const +{ + return m_dPrmtD; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomPlane::CleanObj() const +{ + +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomPlane::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + + +TCollection_AsciiString McCadGeomPlane::GetTransfNum() const +{ + return ""; +} + + diff --git a/src/MCCAD/McCadMcVoid/McCadGeomPlane.hxx b/src/MCCAD/McCadMcVoid/McCadGeomPlane.hxx new file mode 100644 index 0000000..cd64f93 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomPlane.hxx @@ -0,0 +1,54 @@ +#ifndef MCCADGEOMPLANE_HXX +#define MCCADGEOMPLANE_HXX + +#include "IGeomFace.hxx" +#include +#include + +class McCadGeomPlane : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomPlane(); + McCadGeomPlane(const GeomAdaptor_Surface & theSurface); + + virtual ~McCadGeomPlane(); + virtual TCollection_AsciiString GetTransfNum() const; + + virtual TCollection_AsciiString GetExpression(); /**< Calculate the equation and direction of plane */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace); /**< Judge the two planes are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace); /**< Clean the object */ + + Standard_Real GetPrmtD() const; /**< Get parameter D */ + gp_Dir GetDir() const; /**< Get the parameter of surface */ + +private: + + gp_Ax3 m_Axis; /**< Coordinate system of plane */ + gp_Dir m_Dir; /**< Direction of a plane */ + + // the equation of plane is ax + by + cz + d = 0 + Standard_Real m_dPrmtA; /**< Parameter A of plane equation */ + Standard_Real m_dPrmtB; /**< Parameter B of plane equation */ + Standard_Real m_dPrmtC; /**< Parameter C of plane equation */ + Standard_Real m_dPrmtD; /**< Parameter D of plane equation */ + + + +}; + +#endif // MCCADGEOMPLANE_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadGeomRevolution.cxx b/src/MCCAD/McCadMcVoid/McCadGeomRevolution.cxx new file mode 100644 index 0000000..2999992 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomRevolution.cxx @@ -0,0 +1,506 @@ +#include "McCadGeomRevolution.hxx" + +#include +#include +#include +#include + +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadGeomRevolution::McCadGeomRevolution() +{ +} + +/** ******************************************************************** +* @brief Constructor +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomRevolution::McCadGeomRevolution(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfRev ; // Set the surface type + ExtrFaceInfo(theSurface); // Get the geometry data + + //m_PrmtList = new TColStd_HSequenceOfAsciiString(); +} + + +void McCadGeomRevolution::ExtrFaceInfo(const GeomAdaptor_Surface & theSurface) +{ + Handle(Geom_Surface) surf = theSurface.Surface(); + + Handle(Geom_SurfaceOfRevolution) rev = Handle(Geom_SurfaceOfRevolution)::DownCast(surf); + Handle(Geom_Curve) BasisCurve = rev->BasisCurve(); // Get the section curve + GeomAdaptor_Curve SectionCurve(BasisCurve); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + + /* The revolution surface might be an elliptical torus or torus */ + if(SectionCurve.GetType() == GeomAbs_Ellipse || SectionCurve.GetType() == GeomAbs_Circle ) + { + /* Get the geomtry info of revolution axis */ + gp_Ax1 revAx = rev->Axis(); + gp_Dir revDir = revAx.Direction(); + gp_Vec revVec(revDir.X(), revDir.Y(), revDir.Z()); // The direction of axis + + m_Center = revAx.Location(); // The center of revolution axis + m_Axis.SetAxis(revAx); // Revolution axis + m_Dir = m_Axis.Direction(); // The direction of revolution axis + + /* Test if axis of revolution is perpendicular to two of the axis of the ellipse/circle */ + if(SectionCurve.GetType() == GeomAbs_Ellipse) + { + Handle(Geom_Ellipse) section = Handle(Geom_Ellipse)::DownCast(BasisCurve); + + gp_Ax1 normAx = section->Axis(); + gp_Dir normDir = normAx.Direction(); + gp_Vec normVec(normDir.X(), normDir.Y(), normDir.Z()); + + if(Abs( revVec * normVec ) > dis_tol) // Judge if the section vector is perpendicular to axis vector. + { + cout << "Ellipse not perpendicular to rotation Axis !\n" << endl; + } + + gp_Pnt pCntrSection = section->Location(); // The center of section + m_Radius = m_Center.Distance(pCntrSection); // The major radius of ellipital torus + m_MajorRadius = section->MajorRadius(); // The major radius of ellipse section + m_MinorRadius = section->MinorRadius(); // The minor radius of ellipse section + + cout<Axis(); + gp_Dir normDir = normAx.Direction(); + gp_Vec normVec(normDir.X(), normDir.Y(), normDir.Z()); + + if(Abs( revVec * normVec ) > dis_tol) // Judge if the section vector is perpendicular to axis vector. + { + cout << "Ellipse not perpendicular to rotation Axis !\n" << endl; + } + + gp_Pnt pCntrSection = section->Location(); // The center of section + m_Radius = m_Center.Distance(pCntrSection); // The major radius of torus + m_MajorRadius = section->Radius(); // The radius of circle section + m_MinorRadius = section->Radius(); // The radius of circle section + + cout<GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomRevolution *pTorus = (McCadGeomRevolution*)(theSurf); + assert(pTorus); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the center and radius is same, the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pTorus->GetAxisDir(), angle_tol) + || m_Dir.IsOpposite(pTorus->GetAxisDir(), angle_tol)) + { + if( m_Center.IsEqual(pTorus->GetCenter(), angle_tol ) + && fabs(m_MajorRadius - pTorus->GetMajorRadius()) < dis_tol + && fabs(m_MinorRadius - pTorus->GetMinorRadius()) < dis_tol ) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the center of torus +* +* @param +* @return gp_Pnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomRevolution::GetCenter() const +{ + return m_Center; +} + +/** ******************************************************************** +* @brief Get major radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomRevolution::GetMajorRadius() const +{ + return m_MajorRadius; +} + +/** ******************************************************************** +* @brief Get minor radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomRevolution::GetMinorRadius() const +{ + return m_MinorRadius; +} + +/** ******************************************************************** +* @brief Get axis direction of torus +* +* @param +* @return gp_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomRevolution::GetAxisDir() const +{ + return m_Dir; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomRevolution::CleanObj() const +{ + +} + + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomRevolution::ScalePrmt() +{ + gp_Pnt ori(0,0,0); + m_Axis.Scale(ori,GetUnit()); + m_Center.Scale(ori,GetUnit()); + m_Radius *= GetUnit(); + m_MajorRadius *= GetUnit(); + m_MinorRadius *= GetUnit(); +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomRevolution::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } + +} + + +void McCadGeomRevolution::FitCurve(Handle(Geom_Curve) BasisCurve, + Handle(Geom_SurfaceOfRevolution) rev) +{ + gp_Ax1 revAx = rev->Axis(); + m_Center = revAx.Location(); // The center of revolution axis + m_Axis.SetAxis(revAx); + m_Dir = m_Axis.Direction(); // The direction of revolution axis + + gp_Pnt p1 = BasisCurve->Value(BasisCurve->FirstParameter()); + gp_Pnt p2 = BasisCurve->Value(BasisCurve->LastParameter()); + gp_Pnt p3 = BasisCurve->Value((BasisCurve->FirstParameter()+BasisCurve->LastParameter())/2); + + double a, b, c, d, e, f; + + double pA1,pA2,pA3,pB1,pB2,pB3; + double xA,xB,xC; + + int i; + + if (p1.X()==p2.X() && p2.X()==p3.X()) + { + pA1 = p1.Y(); + pB1 = p1.Z(); + pA2 = p2.Y(); + pB2 = p2.Z(); + pA3 = p3.Y(); + pB3 = p3.Z(); + + i=0; + } + else if (p1.Y()==p2.Y() && p2.Y()==p3.Y()) + { + pA1 = p1.X(); + pB1 = p1.Z(); + pA2 = p2.X(); + pB2 = p2.Z(); + pA3 = p3.X(); + pB3 = p3.Z(); + + i=1; + } + else if (p1.Z()==p2.Z() && p2.Z()==p3.Z()) + { + pA1 = p1.X(); + pB1 = p1.Y(); + pA2 = p2.X(); + pB2 = p2.Y(); + pA3 = p3.X(); + pB3 = p3.Y(); + + i=2; + } + + a = 2*(pA2-pA1); + b = 2*(pB2-pB1); + c = pA2*pA2 + pB2*pB2 - pA1*pA1 - pB1*pB1; + + d = 2*(pA3-pA1); + e = 2*(pB3-pB1); + + f = pA3*pA3 + pB3*pB3 - pA1*pA1 - pB1*pB1; + + xA = (b*f - e*c)/(b*d - e*a); + xB = (d*c - a*f)/(b*d - e*a); + + if (Abs(xA)<1.0e-5) + xA = 0.0; + if (Abs(xB)<1.0e-5) + xB = 0.0; + + double center_x, center_y, center_z; + + if (i == 0) + { + center_y = xA; + center_z = xB; + center_x = p1.X(); + } + else if (i == 1) + { + center_x = xA; + center_z = xB; + center_y = p1.Y(); + } + else if (i == 2) + { + center_x = xA; + center_y = xB; + center_z = p1.Z(); + } + + + double maj_radius = Sqrt((xA-pA1)*(xA-pA1)+(xB-pB1)*(xB-pB1)); + double radius = Sqrt(pow(center_x-m_Center.X(),2) + +pow(center_y-m_Center.Y(),2) + +pow(center_z-m_Center.Z(),2)); + + m_Radius = radius; + cout< +#include +#include +#include + + +class McCadGeomRevolution : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomRevolution(); + McCadGeomRevolution(const GeomAdaptor_Surface & theSurface); + + virtual ~McCadGeomRevolution(); + + virtual TCollection_AsciiString GetExpression(); /**< Calculate the equation and direction */ + virtual Standard_Boolean IsEqual(IGeomFace *& theGeoFace); /**< Judge the two surface are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace); /**< */ + virtual TCollection_AsciiString GetTransfNum()const; + + gp_Pnt GetCenter() const; /**< Get the center of ellipse torus */ + gp_Dir GetAxisDir() const; /**< Get the direction of axis */ + Standard_Real GetMajorRadius() const; /**< Get the major radius */ + Standard_Real GetMinorRadius() const; /**< Get the minor radius */ + void ExtrFaceInfo(const GeomAdaptor_Surface & theSurface); /**< Extract the geometry data from revolution face */ + void ScalePrmt(); /**< Scale the parameters */ + + void FitCurve(Handle(Geom_Curve) BasisCurve, + Handle(Geom_SurfaceOfRevolution) rev); + +private: + + gp_Ax3 m_Axis; /**< The rotate axis of ellipse torus/torus */ + gp_Dir m_Dir; /**< The direction of axis */ + Standard_Real m_Radius; /**< The major radius of torus or ellipsal torus/torus */ + Standard_Real m_MajorRadius; /**< Major radius of section */ + Standard_Real m_MinorRadius; /**< Minor radius of section */ + gp_Pnt m_Center; /**< Center of ellipse torus/torus */ +}; + +#endif // MCCADGEOMREVOLUTION_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadGeomSphere.cxx b/src/MCCAD/McCadMcVoid/McCadGeomSphere.cxx new file mode 100644 index 0000000..719a621 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomSphere.cxx @@ -0,0 +1,248 @@ +#include "McCadGeomSphere.hxx" +#include +#include +#include + +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadGeomSphere::McCadGeomSphere() +{ +} + +/** ******************************************************************** +* @brief Constructor, construct a sphere class based on geometry surface. +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomSphere::McCadGeomSphere(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfSphere ; // The surface is a sphere + + gp_Sphere sphere = theSurface.Sphere(); // Get the geometry of sphere + sphere.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Radius = sphere.Radius(); // Get the radius + m_Center = sphere.Location(); // Get the center of sphere + + if( McCadMathTool::IsEqualZero(m_Center.X())) + m_Center.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Y())) + m_Center.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Z())) + m_Center.SetZ(0.0); + + m_bReverse = Standard_False; + + GetExpression(); +} + +McCadGeomSphere::~McCadGeomSphere() +{ +} + + + +/** ******************************************************************** +* @brief Generate the mcnp expression of a sphere +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomSphere::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + Standard_Character chExpn[255]; + + if (m_Center.X() == 0.0 && m_Center.Y() == 0.0 && m_Center.Z() == 0.0) + { + sprintf(chExpn, "SO%8s%15.7f\n", "", m_Radius); + + m_SurfSymb = "SO"; + m_PrmtList.push_back(m_Radius); + } + else if(m_Center.X() != 0.0 && m_Center.Y() == 0.0 && m_Center.Z() == 0.0) + { + sprintf(chExpn, "SX%8s%15.7f%5s%15.7f\n", "",m_Center.X(),"", m_Radius); + + m_SurfSymb = "SX"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Radius); + } + else if(m_Center.X() == 0.0 && m_Center.Y() != 0.0 && m_Center.Z() == 0.0) + { + sprintf(chExpn, "SY%8s%15.7f%5s%15.7f\n", "",m_Center.Y(),"", m_Radius); + + m_SurfSymb = "SY"; + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Radius); + } + else if(m_Center.X() == 0.0 && m_Center.Y() == 0.0 && m_Center.Z() != 0.0) + { + sprintf(chExpn, "SZ%8s%15.7f%5s%15.7f\n", "",m_Center.Z(),"", m_Radius); + + m_SurfSymb = "SZ"; + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_Radius); + } + else + { + sprintf(chExpn, "S %8s%15.7f\%5s%15.7f%5s%15.7f%5s%15.7f\n", + "",m_Center.X(), + "",m_Center.Y(), + "",m_Center.Z(), + "",m_Radius); + + m_SurfSymb = "S "; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_Radius); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + + +/** ******************************************************************** +* @brief Judge the two sphere is same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomSphere::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomSphere *pSphere = (McCadGeomSphere*)(theSurf); + assert(pSphere); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the center and radius is same, the two cylinder can be treated as same cylinder + if( m_Center.IsEqual(pSphere->GetCenter(), angle_tol ) + && fabs(m_Radius - pSphere->GetRadius()) < dis_tol ) + { + return Standard_True; + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the center of a sphere +* +* @param +* @return gp_Pnt m_Center +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomSphere::GetCenter() const +{ + return m_Center; +} + + + +/** ******************************************************************** +* @brief Get the radius of a sphere +* +* @param +* @return Standard_Real m_Radius +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomSphere::GetRadius() const +{ + return m_Radius; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomSphere::CleanObj() const +{ + +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomSphere::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + + +TCollection_AsciiString McCadGeomSphere::GetTransfNum()const +{ + return ""; +} diff --git a/src/MCCAD/McCadMcVoid/McCadGeomSphere.hxx b/src/MCCAD/McCadMcVoid/McCadGeomSphere.hxx new file mode 100644 index 0000000..8f74531 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomSphere.hxx @@ -0,0 +1,44 @@ +#ifndef MCCADGEOMSPHERE_HXX +#define MCCADGEOMSPHERE_HXX + +#include "IGeomFace.hxx" + +#include + +class McCadGeomSphere : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomSphere(); + McCadGeomSphere(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomSphere(); + + virtual TCollection_AsciiString GetExpression(); /**< Get the expression of surface */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< The two surfcce are same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< Clean the object */ + virtual TCollection_AsciiString GetTransfNum() const; + + gp_Pnt GetCenter() const; /**< Get the center of sphere */ + Standard_Real GetRadius() const; /**< Get the radius of sphere */ + +private: + Standard_Real m_Radius; + gp_Pnt m_Center; + +}; + +#endif // MCCADGEOMSPHERE_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadGeomTorus.cxx b/src/MCCAD/McCadMcVoid/McCadGeomTorus.cxx new file mode 100644 index 0000000..e78023f --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomTorus.cxx @@ -0,0 +1,299 @@ +#include "McCadGeomTorus.hxx" + +#include +#include +#include +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadGeomTorus::McCadGeomTorus() +{ +} + +/** ******************************************************************** +* @brief Constructor +* +* @param const GeomAdaptor_Surface & theSurface +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +McCadGeomTorus::McCadGeomTorus(const GeomAdaptor_Surface & theSurface) +{ + m_SurfType = surfTorus ; // The surface is a torus + + gp_Torus torus = theSurface.Torus(); // Get the geometry of torus + torus.Scale(gp_Pnt(0,0,0),GetUnit()); // Scale the face based on unit CAD model used + + m_Axis = torus.Position(); // The coordinator of torus + m_Dir = m_Axis.Direction(); // The direction of torus axis + m_Center = m_Axis.Location(); // The center of torus + + if( McCadMathTool::IsEqualZero(m_Center.X())) + m_Center.SetX(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Y())) + m_Center.SetY(0.0); + if( McCadMathTool::IsEqualZero(m_Center.Z())) + m_Center.SetZ(0.0); + + m_MajorRadius = torus.MajorRadius(); // The major radius of torus + m_MinorRadius = torus.MinorRadius(); // The minor radius of torus + + m_bReverse = Standard_False; + //m_PrmtList = new TColStd_HSequenceOfAsciiString(); + GetExpression(); + +} + +McCadGeomTorus::~McCadGeomTorus() +{ +} + + + +/** ******************************************************************** +* @brief Get the mcnp expression of torus +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +TCollection_AsciiString McCadGeomTorus::GetExpression() +{ + if (!m_SurfExpn.IsEmpty()) + { + return m_SurfExpn; + } + Standard_Character chExpn[255]; + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + gp_Ax3 Ax3_X(m_Center, gp::DX()); + gp_Ax3 Ax3_Y(m_Center, gp::DY()); + gp_Ax3 Ax3_Z(m_Center, gp::DZ()); + + if (m_Axis.IsCoplanar(Ax3_X, angle_tol, angle_tol)) + { + sprintf(chExpn, "TX%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Center.X(), + "", m_Center.Y(), + "", m_Center.Z(), + "", m_MajorRadius, + "", m_MinorRadius, + "", m_MinorRadius); + + m_SurfSymb = "TX"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_MajorRadius); + m_PrmtList.push_back(m_MinorRadius); + m_PrmtList.push_back(m_MinorRadius); + } + else if (m_Axis.IsCoplanar(Ax3_Y, angle_tol, angle_tol)) + { + sprintf(chExpn, "TY%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Center.X(), + "", m_Center.Y(), + "", m_Center.Z(), + "", m_MajorRadius, + "", m_MinorRadius, + "", m_MinorRadius); + + m_SurfSymb = "TY"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_MajorRadius); + m_PrmtList.push_back(m_MinorRadius); + m_PrmtList.push_back(m_MinorRadius); + } + else if (m_Axis.IsCoplanar(Ax3_Z, angle_tol, angle_tol)) + { + sprintf(chExpn, "TZ%8s%15.7f%5s%15.7f%5s%15.7f\n%10s%15.7f%5s%15.7f%5s%15.7f\n", + "", m_Center.X(), + "", m_Center.Y(), + "", m_Center.Z(), + "", m_MajorRadius, + "", m_MinorRadius, + "", m_MinorRadius); + + m_SurfSymb = "TZ"; + m_PrmtList.push_back(m_Center.X()); + m_PrmtList.push_back(m_Center.Y()); + m_PrmtList.push_back(m_Center.Z()); + m_PrmtList.push_back(m_MajorRadius); + m_PrmtList.push_back(m_MinorRadius); + m_PrmtList.push_back(m_MinorRadius); + } + else + { + sprintf(chExpn, "c McCad Error: A generic Torus transformation.\n"); + } + + TCollection_AsciiString szExpn( chExpn ); + szExpn.LeftAdjust(); + szExpn.RightAdjust(); + + m_SurfExpn.Copy(szExpn); + return m_SurfExpn; +} + + + +/** ******************************************************************** +* @brief Judge the two torus is same or not +* +* @param IGeomFace *& theSurf +* @return Standard_Boolean +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomTorus::IsEqual(IGeomFace *& theSurf) +{ + assert(theSurf); + if(theSurf->GetFaceType() != m_SurfType) + { + return Standard_False; + } + + McCadGeomTorus *pTorus = (McCadGeomTorus*)(theSurf); + assert(pTorus); + + Standard_Real dis_tol = McCadConvertConfig::GetTolerence(); + Standard_Real angle_tol = 1.0e-3; //McCadConvertConfig::GetTolerence(); + + // If the center and radius is same, the two cylinder can be treated as same cylinder + if( m_Dir.IsEqual(pTorus->GetAxisDir(), angle_tol) + || m_Dir.IsOpposite(pTorus->GetAxisDir(), angle_tol)) + { + if( m_Center.IsEqual(pTorus->GetCenter(), angle_tol ) + && fabs(m_MajorRadius - pTorus->GetMajorRadius()) < dis_tol + && fabs(m_MinorRadius - pTorus->GetMinorRadius()) < dis_tol ) + { + return Standard_True; + } + } + + return Standard_False; +} + + + +/** ******************************************************************** +* @brief Get the center of torus +* +* @param +* @return gp_Pnt +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Pnt McCadGeomTorus::GetCenter() const +{ + return m_Center; +} + +/** ******************************************************************** +* @brief Get major radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomTorus::GetMajorRadius() const +{ + return m_MajorRadius; +} + +/** ******************************************************************** +* @brief Get minor radius of torus +* +* @param +* @return Standard_Real +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Real McCadGeomTorus::GetMinorRadius() const +{ + return m_MinorRadius; +} + +/** ******************************************************************** +* @brief Get axis direction of torus +* +* @param +* @return gp_Dir +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +gp_Dir McCadGeomTorus::GetAxisDir() const +{ + return m_Dir; +} + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadGeomTorus::CleanObj() const +{ + +} + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadGeomTorus::Compare(const IGeomFace *& theGeoFace) +{ + if( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + < McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb()) ) + { + return Standard_True; + } + else if ( McCadConvertConfig::GetSurfSequNum(m_SurfSymb) + == McCadConvertConfig::GetSurfSequNum(theGeoFace->GetSurfSymb())) + { + if ( m_PrmtList[0] < theGeoFace->GetPrmtList()[0]) + { + return Standard_True; + } + else + { + return Standard_False; + } + } + else + { + return Standard_False; + } +} + + + +TCollection_AsciiString McCadGeomTorus::GetTransfNum()const +{ + return ""; +} diff --git a/src/MCCAD/McCadMcVoid/McCadGeomTorus.hxx b/src/MCCAD/McCadMcVoid/McCadGeomTorus.hxx new file mode 100644 index 0000000..3d067d8 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadGeomTorus.hxx @@ -0,0 +1,50 @@ +#ifndef MCCADGEOMTORUS_HXX +#define MCCADGEOMTORUS_HXX + +#include "IGeomFace.hxx" + +#include +#include + +class McCadGeomTorus : public IGeomFace +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadGeomTorus(); + McCadGeomTorus(const GeomAdaptor_Surface & theSurface); + virtual ~McCadGeomTorus(); + + virtual TCollection_AsciiString GetExpression(); /**< Get the expression of torus */ + virtual Standard_Boolean IsEqual(IGeomFace *& theSurf); /**< Judge the two torus is same or not */ + virtual void CleanObj() const; /**< Clean the generated objects */ + virtual Standard_Boolean Compare(const IGeomFace *& theGeoFace) ; /**< */ + virtual TCollection_AsciiString GetTransfNum() const; + + gp_Pnt GetCenter() const; /**< Get the center of torus */ + gp_Dir GetAxisDir() const; /**< Get the direction of axis */ + Standard_Real GetMajorRadius() const; /**< Get the major radius */ + Standard_Real GetMinorRadius() const; /**< Get the minor radius */ + +private: + + gp_Ax3 m_Axis; /**< The rotate axis of torus */ + gp_Dir m_Dir; /**< The direction of axis */ + Standard_Real m_MajorRadius; /**< Major radius */ + Standard_Real m_MinorRadius; /**< Minor radius */ + gp_Pnt m_Center; /**< Center of torus */ +}; + +#endif // MCCADGEOMTORUS_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadMcVoid.cxx b/src/MCCAD/McCadMcVoid/McCadMcVoid.cxx new file mode 100644 index 0000000..0af94f7 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadMcVoid.cxx @@ -0,0 +1,1044 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +using namespace std; + +Standard_Real McCadMcVoid::VolumeOfShape(const TopoDS_Shape& theShape) +{ + GProp_GProps GP; + BRepGProp::VolumeProperties(theShape, GP); + return GP.Mass(); +} + + +Standard_Real McCadMcVoid::AreaOfShape(const TopoDS_Shape& theShape) +{ + GProp_GProps GP; + BRepGProp::SurfaceProperties(theShape, GP); + return GP.Mass(); +} + + +gp_Pnt McCadMcVoid::ApproxBaryCenter(const TopoDS_Shape& theShape) +{ + Standard_Integer i; + TopExp_Explorer ex; + gp_XYZ xyz(0, 0, 0); + for (ex.Init(theShape, TopAbs_VERTEX), i = 1; ex.More(); ex.Next(), i++) + xyz += BRep_Tool::Pnt(TopoDS::Vertex(ex.Current())).XYZ(); + xyz /= i; + return gp_Pnt(xyz); +} + + +TopoDS_Shape McCadMcVoid::RelScale(const TopoDS_Shape& theShape, const gp_Pnt& thePnt, const Standard_Real theFact) +{ + gp_Trsf T; + // gp_Pnt thePnt = ApproxBaryCenter(S); + T.SetScale(thePnt, theFact); // we scale up or down relative to barycenter depending on theFact; + Handle(BRepTools_TrsfModification) TrsfMod = new BRepTools_TrsfModification(T); + BRepTools_Modifier Md; + Md.Init(theShape); + Md.Perform(TrsfMod); + if (Md.IsDone()) + { + return Md.ModifiedShape(theShape); + } + cout << "Can not scale/modify shape !! " << endl; + return theShape; +} + + +TopoDS_Shape McCadMcVoid::Scale(const TopoDS_Shape& theShape, const Standard_Real theFact) +{ + gp_Trsf T; + gp_Pnt thePnt(0, 0, 0); + T.SetScale(thePnt, theFact); // we scale up or down relative to barycenter depending on theFact; + Handle(BRepTools_TrsfModification) TrsfMod = new BRepTools_TrsfModification(T); + BRepTools_Modifier Md; + Md.Init(theShape); + Md.Perform(TrsfMod); + if (Md.IsDone()) + { + return Md.ModifiedShape(theShape); + } + cout << "Can not scale/modify shape !! " << endl; + return theShape; +} + + +Handle(McCadCSGGeom_Surface) McCadMcVoid::MakeMcCadSurf(GeomAdaptor_Surface& theAdapSurface) +{ + Handle(McCadCSGGeom_Surface) aCSGSurf; + + switch (theAdapSurface.GetType()) + { + case GeomAbs_Plane: + aCSGSurf = new McCadCSGGeom_Plane; + break; + case GeomAbs_Cylinder: + aCSGSurf = new McCadCSGGeom_Cylinder; + break; + case GeomAbs_Cone: + aCSGSurf = new McCadCSGGeom_Cone; + break; + case GeomAbs_Sphere: + aCSGSurf = new McCadCSGGeom_Sphere; + break; + case GeomAbs_Torus: + aCSGSurf = new McCadCSGGeom_Torus; + break; + case GeomAbs_BezierSurface: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (BezierSurface) " << endl; + break; + } + case GeomAbs_BSplineSurface: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (BSplineSurface) " << endl; + aCSGSurf = new McCadCSGGeom_GQ; + break; + } + case GeomAbs_SurfaceOfRevolution: + { + aCSGSurf = new McCadCSGGeom_SurfaceOfRevolution; + //cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (SurfaceOfRevolution) " << endl; + break; + } + case GeomAbs_SurfaceOfExtrusion: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (SurfaceOfExtrusion) " << endl; + break; + } + case GeomAbs_OffsetSurface: + { + cout << "_#_McCadMcVoid.cxx :: Surface is not analytic (OffsetSurface) " << endl; + break; + } + case GeomAbs_OtherSurface: + { + cout << "Surface is not analytic " << endl; + break; + } + } + + aCSGSurf->SetCasSurf(theAdapSurface); + + return aCSGSurf; +} + + +Standard_Boolean McCadMcVoid::ApproxGeomEqual(Handle(McCadCSGGeom_Surface)& S1,Handle(McCadCSGGeom_Surface)& S2) +{ + // only planar surface are treated + + Handle(Geom_Plane) Gpln1 = Handle_Geom_Plane::DownCast(S1->CasSurf()); + gp_Pln aPln = Gpln1->Pln(); + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + gp_Pnt loc = pos.Location (); + Standard_Real sA,sB,sC,sD; + aPln.Coefficients(sA,sB,sC,sD); + Standard_Real D1 = dir.X()*loc.X() + dir.Y()*loc.Y() + dir.Z()*loc.Z(); + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(S2->CasSurf()); + gp_Pln other = Gpln->Pln(); + + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + gp_Pnt otherLoc = otherPos.Location(); + Standard_Real D2 = otherDir.X()*otherLoc.X() + otherDir.Y()*otherLoc.Y() + otherDir.Z()*otherLoc.Z(); + if (dir.IsParallel(otherDir,0.1)) + { + if (fabs(D1 - D2) <= 1.0) // this gives the resolution of the cut planes: 25cm + { + return Standard_True; + } + } + // if(dir.Angle(otherDir) < 0.034906585) // about 2 deg. + // return Standard_True; + return Standard_False; +} + + +Standard_Boolean McCadMcVoid::ApproxGeomEqualFaces(TopoDS_Face& F1, TopoDS_Face& F2, Standard_Real theCFRes) +{ + // only planar face are treated + + TopLoc_Location l; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,l); + GeomAdaptor_Surface adSurf1(gS1); + if(adSurf1.GetType() != GeomAbs_Plane) + return Standard_False; + + Handle(Geom_Plane) Gpln1 = Handle_Geom_Plane::DownCast(gS1); + gp_Pln aPln = Gpln1->Pln(); + gp_Ax3 pos = aPln.Position(); + gp_Dir dir = pos.Direction(); + //gp_Pnt loc = pos.Location (); + // Standard_Real D1 = dir.X()*10.e10 + dir.Y()*10.e10 + dir.Z()*loc.Z(); + + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,l); + GeomAdaptor_Surface adSurf2(gS2); + if(adSurf2.GetType() != GeomAbs_Plane) + return Standard_False; + + Handle(Geom_Plane) Gpln = Handle_Geom_Plane::DownCast(gS2); + gp_Pln other = Gpln->Pln(); + gp_Ax3 otherPos = other.Position(); + gp_Dir otherDir = otherPos.Direction(); + //gp_Pnt otherLoc = otherPos.Location(); + // Standard_Real D2 = otherDir.X()*otherLoc.X() + otherDir.Y()*otherLoc.Y() + otherDir.Z()*otherLoc.Z() ; + //gp_Pnt pinf(10.e6,10.e6,10.e6); + gp_Pnt pinf(0,0,0); + if (dir.IsParallel(otherDir,0.0001)) + { + //cout << " Distance = " << fabs(aPln.Distance(pinf) - other.Distance(pinf)) << endl; + /* Standard_Real A,B,C,D; + aPln.Coefficients(A,B,C,D); + cout << "me. A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl; + other.Coefficients(A,B,C,D); + cout << "ot. A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl;*/ +//not reliable for infinit point!!! +// infp leads to major differences in output between GUI and non-GUI version. + // cout << " Dist : " << fabs(aPln.Distance(pinf) - other.Distance(pinf)) << " - "; + + if (fabs(aPln.Distance(pinf) - other.Distance(pinf)) <= theCFRes) + { + // cout << "REJECTED because of small distance : " << fabs(aPln.Distance(pinf) - other.Distance(pinf)); + return Standard_True; + } + } + + return Standard_False; +} + + +Handle(McCadDiscDs_HSequenceOfDiscFace) McCadMcVoid::DeleteApproxRedundant(Handle(McCadDiscDs_HSequenceOfDiscFace)& theVCutFaceSeq, Standard_Real theCFRes) +{ + /**/ + /**/ + + ///////////////////////////////////////////////////////////////////////////////////////////////// + if (theVCutFaceSeq->Length() < 1) + return theVCutFaceSeq; + + + // Sort by Area + for(Standard_Integer i=1 ; iLength(); i++) + { + for(Standard_Integer j=i+1; j<=theVCutFaceSeq->Length(); j++) + { + TopoDS_Face F1,F2; + F1 = TopoDS::Face(theVCutFaceSeq->Value(j).GetFace()); + F2 = TopoDS::Face(theVCutFaceSeq->Value(i).GetFace()); + if(AreaOfShape(F1) > AreaOfShape(F2)) + theVCutFaceSeq->Exchange(i,j); + } + } + + + // only planar faces are treated + /*cout << "=================================================================" << endl; + cout << " Cut Face Canditdates " <Length(); i++) // print all coefficients of plane-equations to screen + { + TopoDS_Face F1 = TopoDS::Face(theVCutFaceSeq->Value(i).GetFace()); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + gp_Pln aPln = As1.Plane(); + Standard_Real A,B,C,D; + aPln.Coefficients(A,B,C,D); + cout << i << ". A = " << A << " B = " << B << " C = " << C <<" D = " << D << endl; + }*/ + ///////////////////////////////////////////////////////////////////////////////////////////////// + + + vector theVCutFace, tmpVCutFace; + vector::iterator fit; + for (int i=1; i<= theVCutFaceSeq->Length(); i++)//put all vcutfaces in above vectors + { + tmpVCutFace.push_back(theVCutFaceSeq->Value(i)); + theVCutFace.push_back(theVCutFaceSeq->Value(i)); + } + + int io = 0; + for (fit = tmpVCutFace.begin(); fit!= tmpVCutFace.end(); fit++)//For all temp voxel faces delete 'double faces' + { + io++; + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + if(F1.IsNull()) + continue; + + vector::iterator fit2; + int ii = io; + for (fit2 = fit+1; fit2!= tmpVCutFace.end(); fit2++) + { + ii++; + // cout << "\n(" << io << "," << ii << ") : "; + + TopoDS_Face F2 = TopoDS::Face((*fit2).GetFace()); + + if(F2.IsNull()) + { + continue; + } + if (ApproxGeomEqualFaces(F1, F2, 1.e-3)) + { + McCadDiscDs_DiscFace vnull; // create empts DiscFace + //if(AreaOfShape(F2) 1) + { + for (fit = theVCutFace.begin() + 1; fit!= theVCutFace.end(); fit++) //arrange faces by size (decreasing) + { + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + Standard_Real areaF1 = AreaOfShape(F1); + vector::iterator fit2; + for (fit2 = fit - 1; fit2 >= theVCutFace.begin(); fit2--) + { + TopoDS_Face F2 = TopoDS::Face((*fit2).GetFace()); + Standard_Real areaF2 = AreaOfShape(F2); + if (areaF1 > areaF2) + { + iter_swap(fit2 + 1,fit2); + } + else + break; + } + } + } + + /////////////////////////////////////////////////////////////////////////////////////////////////// + ii = 0; + for (fit = theVCutFace.begin(); fit!= theVCutFace.end(); fit++) + { + ii++; + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + Standard_Real area = AreaOfShape(F1); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + gp_Pln aPln = As1.Plane(); + Standard_Real A,B,C,D; + aPln.Coefficients(A,B,C,D); + if(fabs(A)<1.e-7) A = 0.0;//MYMOD 230108 all 4 + if(fabs(B)<1.e-7) B = 0.0; + if(fabs(C)<1.e-7) C = 0.0; + if(fabs(D)<1.e-7) D = 0.0; + //cout << ii << ". A = " << A << " B = " << B << " C = " << C <<" D = " << D << " Area = " << area << endl; + }*/ + //cout << "================================================================= " << endl; + + theVCutFaceSeq->Clear(); + + for (fit = theVCutFace.begin(); fit!= theVCutFace.end(); fit++) + { + TopoDS_Face F1 = TopoDS::Face((*fit).GetFace()); + if(!F1.IsNull()) theVCutFaceSeq->Append(*fit); + } + + return theVCutFaceSeq; +} + + +Handle(TopTools_HSequenceOfShape) McCadMcVoid::DeleteOne(Handle(TopTools_HSequenceOfShape)& theFaceSeq) +{ + + if (theFaceSeq->Length() < 2 ) + return theFaceSeq; + + TopoDS_Face F1 = TopoDS::Face(theFaceSeq->Value(1)); + TopAbs_Orientation orient1 = F1.Orientation(); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + TopoDS_Face F2 = TopoDS::Face(theFaceSeq->Value(2)); + TopAbs_Orientation orient2 = F2.Orientation(); + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,loc); + GeomAdaptor_Surface As2(gS2); + + if (As1.GetType() != As2.GetType() ) + return theFaceSeq; + + Handle(McCadCSGGeom_Surface) S1 = MakeMcCadSurf(As1); + S1->SetCasSurf(As1); + + Handle(McCadCSGGeom_Surface) S2 = MakeMcCadSurf(As2); + S2->SetCasSurf(As2); + + //////////////////////////////////////////////////////////////////////////////////// + // a plane must be correctly orriented to be compared .... + if(As1.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = As1.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction(); + Standard_Real A,B,C,D; + if (locAxis.Direct()) + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + if ((D > 0 && (locDir.X() < 0 || locDir.Y() < 0 || locDir.Z() < 0 )) || (locDir.X() <= 0 && locDir.Y() <= 0 && locDir.Z() <= 0 )) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + Handle(Geom_Plane) tmpPl = new Geom_Plane(glAxis); + GeomAdaptor_Surface Ast(tmpPl); + S1->SetCasSurf(Ast); + if(orient1 == TopAbs_FORWARD) + F1.Orientation(TopAbs_REVERSED); + else if (orient1 == TopAbs_REVERSED) + F1.Orientation(TopAbs_FORWARD); + //else; + } + } + + ///////////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////////// + if(As2.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = As2.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction(); + Standard_Real A,B,C,D; + if (locAxis.Direct()) + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + if ((D > 0 && (locDir.X() < 0 || locDir.Y() < 0 || locDir.Z() < 0 )) || (locDir.X() <= 0 && locDir.Y() <= 0 && locDir.Z() <= 0 )) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + Handle(Geom_Plane) tmpPl = new Geom_Plane(glAxis); + GeomAdaptor_Surface Ast(tmpPl); + S2->SetCasSurf(Ast); + if(orient2 == TopAbs_FORWARD) + F2.Orientation(TopAbs_REVERSED); + else if (orient2 == TopAbs_REVERSED) + F2.Orientation(TopAbs_FORWARD); + //else; + } + } + ///////////////////////////////////////////////////////////////////////////////////// + + + if (S1->IsEqual(S2)) + { + if (F1.Orientation()!= F2.Orientation()) + { + theFaceSeq->Remove(2); + } + } + + return theFaceSeq; +} + + +Handle(TopTools_HSequenceOfShape) McCadMcVoid::ShellOrder(Handle(TopTools_HSequenceOfShape)& theFaceSeq,Handle(TopTools_HSequenceOfShape)& theSolidSeq) +{ + + if (theFaceSeq->Length() < 2) return theFaceSeq; + Handle(TColStd_HSequenceOfInteger) signChanges = new TColStd_HSequenceOfInteger(); + for (Standard_Integer i = 1; i<= theFaceSeq->Length(); i++) + { + Standard_Integer signChgs = 0; + TopoDS_Face F1 = TopoDS::Face(theFaceSeq->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) S1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface AS1(S1); + for (Standard_Integer j = 1; j<= theSolidSeq->Length(); j++) + { + Standard_Integer NbNegPnt=0, NbPosPnt=0; + TopoDS_Solid S1 = TopoDS::Solid(theSolidSeq->Value(j)); + for (TopExp_Explorer exV(S1,TopAbs_VERTEX); exV.More(); exV.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exV.Current())); + Standard_Real aVal = McCadGTOOL::Evaluate(AS1,aPnt); + if(aVal > 1.e-03 && aVal < 1.e+100) NbPosPnt++; + if (aVal < -1.e-03 && aVal > -1.e+100 ) NbNegPnt++; + } + if (NbPosPnt > 0 && NbNegPnt > 0 ) // changes sign on the solid + signChgs++; + } + signChanges->Append(signChgs); + } + // now we do the shell ordering according to sign changes!! + + for (Standard_Integer j = 2; j<= signChanges->Length(); j++) + { + Standard_Integer k; + Standard_Integer sign = signChanges->Value(j); + for (k = j-1; k>=1; k--) + { + if (sign < signChanges->Value(k)) + { + signChanges->SetValue(k+1,signChanges->Value(k)); + theFaceSeq->Exchange(k+1,k); + } + else + break; + } + signChanges->SetValue(k+1,sign); + } + cout << "========================================================= " << endl; + cout << "These are the sorted sign changing sequences " << endl; + for (Standard_Integer j = 1; j<= signChanges->Length(); j++) + cout << j << " " << signChanges->Value(j) << endl; + cout << "========================================================= " << endl; + return theFaceSeq; +} + + +Standard_Boolean McCadMcVoid::SignChanging(TopoDS_Solid& baseSolid, const McCadDiscDs_DiscFace& theVFace) +{ + TopoDS_Face F1 = TopoDS::Face(theVFace.GetFace()); + TopLoc_Location loc; + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + Handle(McCadCSGGeom_Surface) S1 = MakeMcCadSurf(As1); + S1->SetCasSurf(As1); + + for (TopExp_Explorer exF(baseSolid,TopAbs_FACE); exF.More(); exF.Next()) // if theVFace is equal to solid's bounding face, return false + { + TopoDS_Face F2 = TopoDS::Face(exF.Current()); + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,loc); + GeomAdaptor_Surface As2(gS2); + if (As1.GetType() == As2.GetType()) + { + Handle(McCadCSGGeom_Surface) S2 = MakeMcCadSurf(As2); + S2->SetCasSurf(As2); + if (S1->IsEqual(S2)) //BB-Interface + return Standard_False; + } + } + + Standard_Boolean inFound = Standard_False; + + Standard_Real MaxTol = 1.e-7; + BRepClass3d_SolidClassifier bsc3d (baseSolid); + Handle(TColgp_HSequenceOfPnt) tmpPntSeq = theVFace.GetPoints(); + + //cout << "Number of Sample Points : " << tmpPntSeq->Length() << endl; + + for (int j=1; j<= tmpPntSeq->Length(); j++) + { + gp_Pnt aPnt = tmpPntSeq->Value(j); + bsc3d.Perform(aPnt,MaxTol); + if (bsc3d.State() == TopAbs_IN) + { + inFound = Standard_True; + break; + } + } + + //cout << "SIGN CHANGING ????????????? > " << inFound << endl; + + if(inFound) + return Standard_True; + else + return Standard_False; +} + + +TopoDS_Shape McCadMcVoid::MakeHalfSpace(TopoDS_Shape& aSolid) +{ + gp_Pnt lPnt(-1.e5, -1.e5, -1.e5); + gp_Pnt uPnt(1.e5, 1.e5, 1.e5); + + return MakeHalfSpace(aSolid, lPnt, uPnt); +} + + +TopoDS_Shape McCadMcVoid::MakeHalfSpace(TopoDS_Shape& aSolid, gp_Pnt& theLPnt, gp_Pnt& theUPnt) +{ + TopoDS_Face aFace = TopoDS::Face(aSolid); + TopoDS_Shape HSol; + bool foundIN = false; + TopLoc_Location loc; + //TopAbs_Orientation orient = aFace.Orientation(); + + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(aFace,loc); + GeomAdaptor_Surface AS(theFaceSurface); + + /*STEPControl_Writer wrt; + wrt.Transfer(aSolid, STEPControl_AsIs); + wrt.Write("makeHalfSpace.stp");*/ + + //////////////////////////////////////////////////////////////////////////////////////////////////////// + gp_Pnt thePnt = theFaceSurface->Value(1,1); + gp_Pnt tempPnt; +//MYMOD 170108 + for (Standard_Integer j=1; j<= 3 ; j++) // Find a point that lies on the solid-side of the face + { + for (Standard_Integer k=-1; k<=1; k+=2) + { + tempPnt = thePnt; + tempPnt.SetCoord(j, tempPnt.Coord(j)+k); + if(PointState(aSolid, tempPnt)==TopAbs_IN) + { + foundIN = true; + break; + } + } + if (foundIN == true) + break; + } + + if(!foundIN) + cout << "_#_McCadMcVoid.cxx :: Could not determine inside point for half space construction!" << endl; + + + ///////////////////////////////////////////////////////////////////////////////////// + // find the eight projection points on the surface find the two points that are + // the farest away from the box + Handle(TColStd_HSequenceOfReal) uVals = new TColStd_HSequenceOfReal; + Handle(TColStd_HSequenceOfReal) vVals = new TColStd_HSequenceOfReal; + + if(theLPnt.IsEqual(theUPnt, 1.0)) + { + cout << "same point\n"; + gp_Pnt lPnt(-1.e5, -1.e5, -1.e5); + gp_Pnt uPnt(1.e5, 1.e5, 1.e5); + theLPnt = lPnt; + theUPnt = uPnt; + } + + TopoDS_Shape theBox = BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape(); + TopExp_Explorer ex; + + gp_Pnt2d the2dPnt; + Standard_Real uMin, uMax, vMin, vMax; + ShapeAnalysis_Surface sAs(theFaceSurface); + + for(ex.Init(theBox, TopAbs_VERTEX); ex.More(); ex.Next()) + { + //get point + TopoDS_Vertex theVertex = TopoDS::Vertex(ex.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(theVertex); + + //project on surface + GeomAPI_ProjectPointOnSurf pntProj(thePnt, theFaceSurface); + for(int j=1; j<=pntProj.NbPoints(); j++) + { + the2dPnt = sAs.ValueOfUV(pntProj.Point(j), 1e-3); + uVals->Append(the2dPnt.X()); + vVals->Append(the2dPnt.Y()); + } + } + + // minimize and maximize + uMin = uVals->Value(1); + uMax = uVals->Value(1); + for(int i=2; i<=uVals->Length(); i++) + { + Standard_Real theVal = uVals->Value(i); + + if(uMin > theVal) + uMin = theVal; + if(uMax < theVal) + uMax = theVal; + } + + vMin = vVals->Value(1); + vMax = vVals->Value(1); + for(int i=2; i<=vVals->Length(); i++) + { + Standard_Real theVal = vVals->Value(i); + if(vMin > theVal) + vMin = theVal; + if(vMax < theVal) + vMax = theVal; + } + + if(AS.GetType() == GeomAbs_Cylinder) + { + uMin = 0; + uMax = 2.*M_PI; + } + /////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef OCC650 + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax); +#else + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax, 1.e-7); +#endif + // if cylinder, don't make half space but build solid!!! + if(AS.GetType() == GeomAbs_Cylinder) + { + BRepBuilderAPI_Sewing tailor; + tailor.Add(F1); + + TopExp_Explorer ex; + for(ex.Init(F1, TopAbs_EDGE); ex.More(); ex.Next()) + { + TopoDS_Edge anEdge = TopoDS::Edge(ex.Current()); + BRepBuilderAPI_MakeWire wireMaker(anEdge); + TopoDS_Wire aWire = wireMaker.Wire(); + + if(!aWire.Closed()) + continue; + + BRepBuilderAPI_MakeFace faceMaker(aWire, Standard_True); + + if(faceMaker.IsDone()) + { + TopoDS_Face face = faceMaker.Face(); + tailor.Add(face); + } + } + + TopoDS_Shape sewedShape; + try + { + tailor.Perform(); + sewedShape = tailor.SewedShape(); + } + catch(...) + { + cout << "sewing failed\n"; + return aSolid; + } + + TopoDS_Shell theShell = TopoDS::Shell(sewedShape); + BRepBuilderAPI_MakeSolid solMaker(theShell); + + TopoDS_Solid retSol; + + if(solMaker.IsDone()) + { + retSol = solMaker.Solid(); + return retSol; + } + else + return aSolid; + } + + if (F1.IsNull()) + cout << "_#_McCadMcVoid.cxx :: Infinite face for half space construction could not be constructed!" << endl; + + try + { + BRepPrimAPI_MakeHalfSpace tmpHlfSpc(F1,tempPnt);//Standard_Construction_Error occures !!!!! + + if(tmpHlfSpc.IsDone()) + { + + /*STEPControl_Writer wrt; + wrt.Transfer(F1, STEPControl_AsIs); + wrt.Transfer(theBox, STEPControl_AsIs); + wrt.Transfer(BRepBuilderAPI_MakeVertex(tempPnt).Vertex(), STEPControl_AsIs); + wrt.Write("face_and_box.stp");*/ + + HSol = tmpHlfSpc.Solid(); + /*TopoDS_Shape common = BRepAlgoAPI_Common(HSol, theBox).Shape(); + return common;*/ + } + else + { + cout << "Half Space construction failed\n"; + return aSolid; + } + } + catch(...) + { + cout << "_#_McCadMcVoid.cxx :: Half space could not be constructed!!!" << endl; + } + +//MYMOD # + return HSol; +} + + +TopoDS_Shape McCadMcVoid::MakeTrimmHalf(TopoDS_Shape& aSolid, TopoDS_Shape& aFace) +{ + // we make a trimmed halfspace in the size of aSolid. + Bnd_Box theBB; + BRepBndLib::Add(aSolid, theBB); + theBB.SetGap(0.0); + Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax; + theBB.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); + gp_Pnt P1(Xmin, Ymin, Zmin); + gp_Pnt P2(Xmax, Ymax, Zmax); + + TopoDS_Shape Box = BRepPrimAPI_MakeBox(P1,P2).Shape(); + TopoDS_Shape fShape = MakeHalfSpace(aFace); + TopoDS_Shape aShape; + try + { + BRepAlgoAPI_Cut aCommonOp(fShape,Box); + + if(aCommonOp.IsDone()) + { + aShape = aCommonOp.Shape(); + } + else + { + cout << "_#_McCadMcVoid.cxx :: Boolean Operation on a trimmed halfspace failed !!!" << endl; + } + + } + catch(...) + { + cout << "_#_McCadMcVoid.cxx :: Boolean Operation on a trimmed halfspace failed !!!" << endl; + } + + return aShape; +} + + +TopAbs_State McCadMcVoid::PointState(const TopoDS_Shape& aShape,const gp_Pnt& aPnt) +{ + // This algorithm checks the state of a point relative to a basic semi-algebraic set. + // The point should lie within the bounding box of the basic semi-algebraic set. + // If this is not the case the method may fail due to evaluation in a connected component + // of the set. Check first if the point is not outside of the b-Box. + // for non basic sets use the classifier of cascade. + + TopExp_Explorer ex; +// TopoDS_Solid aSol = TopoDS::Solid(aShape); + bool onState=false; + for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face theFace = TopoDS::Face(ex.Current()); + TopLoc_Location loc; + Handle(Geom_Surface) S1 = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface As1(S1); + //////////////////////////////////////////////////////////////////////////////////// + // a plane must be correctly orriented + if(As1.GetType() == GeomAbs_Plane) + { + gp_Pln aP1 = As1.Plane(); + gp_Ax3 locAxis = aP1.Position(); + gp_Dir locDir = locAxis.Direction(); + /*gp_Ax3 glAxis (locAxis.Location(),gp_Vec(fabs(locDir.X()),fabs(locDir.Y()),fabs(locDir.Z()))); + gp_Dir glDir = glAxis.Direction();*/ + Standard_Real A,B,C,D; + if (locAxis.Direct()) + { + A = locDir.X(); + B = locDir.Y(); + C = locDir.Z(); + } + else + { + A = -locDir.X(); + B = -locDir.Y(); + C = -locDir.Z(); + } + const gp_Pnt& P = locAxis.Location(); + D =-(A * P.X() + B * P.Y() + C * P.Z()); + + if ((D > 0 && (locDir.X() < 0 || locDir.Y() < 0 || locDir.Z() < 0 )) || + (locDir.X() <= 0 && locDir.Y() <= 0 && locDir.Z() <= 0 )) + { + gp_Ax3 glAxis (locAxis.Location(),gp_Vec(-1*locDir.X(),-1*locDir.Y(),-1*locDir.Z())); + Handle(Geom_Plane) tmpPl = new Geom_Plane(glAxis); + As1.Load(tmpPl); + + if(theFace.Orientation() == TopAbs_FORWARD) + theFace.Orientation(TopAbs_REVERSED); + else if ( theFace.Orientation() == TopAbs_REVERSED) + theFace.Orientation(TopAbs_FORWARD); + else; + } + } + + Standard_Real aVal = McCadGTOOL::Evaluate(As1,aPnt); + // cout << aVal << endl; + + if (aVal >= -1.e-03 && aVal <= 1.e-3 ) + onState= true; + else if(aVal > 1.e-03 && aVal < 1.e+100) + aVal=1; + else if (aVal < -1.e-03 && aVal > -1.e+100 ) + aVal=-1; + else + return TopAbs_OUT; // NULL + + if ((theFace.Orientation() == TopAbs_FORWARD) && aVal==1) + { + return TopAbs_OUT; + } + if ((theFace.Orientation() == TopAbs_REVERSED) && aVal==-1) + { + return TopAbs_OUT; + } + + /*if(Abs(aVal)==1 && !onState) // double check!!! + { + BRepClass3d_SolidClassifier asc3d (aShape); + asc3d.Perform(aPnt, 1.0e-7); + if(asc3d.State() == TopAbs_OUT) + return TopAbs_OUT; + }*/ + } + + if (onState) + return TopAbs_ON; + else + { + return TopAbs_IN; + } +} diff --git a/src/MCCAD/McCadMcVoid/McCadMcVoid_ForwardCollision.cxx b/src/MCCAD/McCadMcVoid/McCadMcVoid_ForwardCollision.cxx new file mode 100644 index 0000000..0fa1e19 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadMcVoid_ForwardCollision.cxx @@ -0,0 +1,251 @@ +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +#include +#include +#include + + +McCadMcVoid_ForwardCollision::McCadMcVoid_ForwardCollision() +{ + myTolerance = 1e-7; + myIsDone = false; + myVSolids = NULL; +} + +McCadMcVoid_ForwardCollision::McCadMcVoid_ForwardCollision(Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) +{ + myTolerance = 1e-7; + myIsDone = false; + myVSolids = theDShape; +} + + +void McCadMcVoid_ForwardCollision::Init() +{ + ///////////////////////////////////////////////////////////////////////////////////////// + // forward collision test among solids + // SeqCSG is master complement set + cout << "\nPerforming forward collision test among solids!!"<< endl; + cout << "Number of solids = "<< myVSolids->Length() << endl; + cout << "=================================================================== " << endl; + + Standard_Integer shProgress(0), shNum(myVSolids->Length()), shOldCnt(-1); + Standard_Integer useCores(1); // number of cores to use + + //////////////////////////////////////////////////////////////////////////////////////// + //settings for parallelization +#ifndef MCCAD_USECORES + useCores = 1; //(omp_get_num_procs()-1); + + if (useCores < 1) + useCores = 1; +#endif //MCCAD_USECORES + + // get environmental variable to set number of cores to use + TCollection_AsciiString useProc; + if(getenv("MCCAD_USECORES")) + useProc = TCollection_AsciiString(getenv("MCCAD_USECORES")); + else + useProc = 1; + useProc.LeftAdjust(); + useProc.RightAdjust(); + if(useProc.Length()>0) + { + if(useProc.IsIntegerValue()) + { + Standard_Integer tmpInt = useProc.IntegerValue(); + if(tmpInt>0) + useCores = tmpInt; + } + } + + if(useCores > 1) + { + cout << "\tNumber of available processors : " << omp_get_num_procs() << endl; + cout << "\tNumber of used processors : " << useCores << endl; + } + + omp_set_num_threads(useCores); + + ////////////////////////////////////////////////////////////////////////////////////////// + // Perform forward collision test +#pragma omp parallel for + for (int iter = 1; iter <= shNum; iter++)//For all Solids check for collision with other solid + { + // show progress in shell + shProgress = Standard_Integer(100.0*Standard_Real(iter)/Standard_Real(shNum)); + if(shOldCnt < shProgress) + { + cout << "." << flush; + shOldCnt = shProgress; + } + + TopoDS_Solid aSol = TopoDS::Solid((myVSolids->Value(iter)).GetSolid()); + BRepClass3d_SolidClassifier bsc3d(aSol); + McCadDiscDs_DiscSolid aDiscSolid = myVSolids->Value(iter); + Bnd_Box aBB = aDiscSolid.GetBBox(); + //bsc3d.PerformInfinitePoint(myTolerance); + + //if (!bsc3d.State()==TopAbs_OUT) + // cout << "_#_McCadMcVoid_ForwardCollision.cxx :: Warning: There is a hole in the Shape!"<< endl; + + Handle(TopTools_HSequenceOfShape) aFaceSeq = new TopTools_HSequenceOfShape(); + for (int iter2 = iter+1; iter2 <= myVSolids->Length(); iter2++)//For all solids other then current solid test for overlaps + { + //bbox check + TopoDS_Solid sSol = TopoDS::Solid((myVSolids->Value(iter2)).GetSolid()); + BRepClass3d_SolidClassifier asc3d (sSol); + + McCadDiscDs_DiscSolid aDiscSolid = myVSolids->Value(iter2); + Bnd_Box sBB = aDiscSolid.GetBBox(); + + if(aBB.IsOut(sBB)) + { + continue; + } + //////////////////////////////////////////////////////////////////// + // the same face with different orientation + Standard_Boolean found = Standard_False; + for (TopExp_Explorer exF(aSol,TopAbs_FACE); exF.More(); exF.Next()) //For all faces of first current solid delete 'distorted' twins + { + TopoDS_Face aF = TopoDS::Face(exF.Current()); + aFaceSeq->Clear(); + for (TopExp_Explorer exFF(sSol,TopAbs_FACE); exFF.More(); exFF.Next())//For all faces of second current solid + { + TopoDS_Face sF = TopoDS::Face(exFF.Current()); + aFaceSeq->Append(aF); + aFaceSeq->Append(sF); + aFaceSeq = McCadMcVoid::DeleteOne(aFaceSeq); //if twin faces occure that differ in their orientation delete one. + if (aFaceSeq->Length() < 2) + { + found = Standard_True; + break; + } + aFaceSeq->Clear(); + } + if(found) break; + } + if(found) //same face different orientation --> two non colliding neighbouring solids + continue; + + /////////////////////////////////////////////////////////////////////// + Standard_Boolean inState = Standard_False; + // Standard_Boolean oneInState = Standard_False; + /////////////////////////////////////////////////////////////////////// + Handle(McCadDiscDs_HSequenceOfDiscFace) vFaces = (myVSolids->Value(iter2)).GetOwnVFaces(); + for(int ip = 1; ip <= vFaces->Length(); ip++)//For all faces check if their sample points lie inside the current solid + { + Bnd_Box fBB = (vFaces->Value(ip)).GetBBox(); + if(aBB.IsOut(fBB))//check if face is out of BB + { + // cout<< ssct << "." << ip << " BB based exclusion of a Face!!" << endl; + continue; + } + // this is forward check + + Handle(TColgp_HSequenceOfPnt) aPntSeq = (vFaces->Value(ip)).GetPoints(); + for (int k=1; k<=aPntSeq->Length();k++) + { + gp_Pnt aP = aPntSeq->Value(k); + + if(aBB.IsOut(aP)) + continue; + + // if(McCadMcVoid::PointState(aSol,aP) == TopAbs_IN ) //Check if point is inside the first current solid + bsc3d.Perform(aP,1.0e-05); // we check with higher tolerance to avoid backward check! + if ( bsc3d.State() == TopAbs_IN && McCadMcVoid::PointState(aSol,aP) == TopAbs_IN) + { + inState = Standard_True; //Collision Found!!! + /*STEPControl_Writer colWrt; + colWrt.Transfer(BRepBuilderAPI_MakeVertex(aP).Shape(), STEPControl_AsIs); + colWrt.Transfer(aSol, STEPControl_AsIs); + colWrt.Write("aCollision.stp");*/ + //exit(-1); + + break; + } + } + if (inState) + break; + } + + if (inState) //vanilla + { + (myVSolids->ChangeValue(iter)).AppendOtherVSolid(iter2); + continue; + } + /////////////////////////////////////////////////////////////////////////////////////////////////// + // otherwise simple backward check due to small voids may be available !! + // this is necessary!! + Handle(TColgp_HSequenceOfPnt) aPntSeq = (myVSolids->Value(iter)).GetVoxel(); + for (int k=1; k<=aPntSeq->Length();k++) + { + gp_Pnt aP = aPntSeq->Value(k); + + if(sBB.IsOut(aP)) + continue; + + // asc3d.Perform(aP,1.0e-07); + // if (asc3d.State() == TopAbs_IN) + if(McCadMcVoid::PointState(sSol,aP) == TopAbs_IN && asc3d.State() == TopAbs_IN) + { + inState = Standard_True; + break; + } + } + if (inState) //vanilla + { + (myVSolids->ChangeValue(iter)).AppendOtherVSolid(iter2); + continue; + } + } + } + + cout << "#" << endl; + myIsDone = true; + + //cout << "=================================================================== " << endl; + //cout << "Collision check finished \n"<< endl; + /////////////////////////////////////////////////////////////////////////////////////////// +} + +void McCadMcVoid_ForwardCollision::SetDsSolid(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) +{ + myVSolids = theDShape; +} + +Standard_Boolean McCadMcVoid_ForwardCollision::IsDone() const +{ + return myIsDone; +} + +void McCadMcVoid_ForwardCollision::SetTolerance(const Standard_Real theTol) +{ + myTolerance = theTol; +} + +Standard_Real McCadMcVoid_ForwardCollision::GetTolerance() const +{ + return myTolerance; +} diff --git a/src/MCCAD/McCadMcVoid/McCadMcVoid_Generator.cxx b/src/MCCAD/McCadMcVoid/McCadMcVoid_Generator.cxx new file mode 100644 index 0000000..0939521 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadMcVoid_Generator.cxx @@ -0,0 +1,2979 @@ +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +//qiu #include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + + +Standard_Boolean decompose(Standard_False); +Standard_Real originalBoxSize(0.0); +int glblCnt(0); + +McCadMcVoid_Generator::McCadMcVoid_Generator() +{ + myMinVolume = 1.25e2; + myMaxComplementedShapes = 10; + myMaxNbOfPreDecomposition = 500; + myMinDecompositionFaceArea = 500; + myMinRedecompositionFaceArea = 50; + myTolerance = 1.e-7; + myIsDone = false; + myVSolids = NULL; + myVVoids = new McCadDiscDs_HSequenceOfDiscSolid; + + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myCFRes = 5; +} + +McCadMcVoid_Generator::McCadMcVoid_Generator(Handle(McCadDiscDs_HSequenceOfDiscSolid)& theDShape) +{ + myMinVolume = 1.25e2; + myMaxComplementedShapes = 10; + myMaxNbOfPreDecomposition = 500; + myMinDecompositionFaceArea = 500; + myMinRedecompositionFaceArea = 50; + myTolerance = 1.e-7; + myIsDone = false; + myVSolids = theDShape; + myVVoids = new McCadDiscDs_HSequenceOfDiscSolid; + + myMaxNbPnt = 50; + myMinNbPnt = 10; + myXlen = 50; // 5cm resolution + myYlen = 50; + myCFRes = 5; +} + +void McCadMcVoid_Generator::SetDiscSolids(const Handle(McCadDiscDs_HSequenceOfDiscSolid)& theSolids) +{ + myVSolids = theSolids; +} + +#ifndef MCCAD_NONGUI +void McCadMcVoid_Generator::SetProgressIndicator(Handle_Message_ProgressIndicator& thePI) +{ + myPI = thePI; +} +#endif + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadMcVoid_Generator::GetDiscSolids() const +{ + return myVSolids; +} + + +Handle(McCadDiscDs_HSequenceOfDiscSolid) McCadMcVoid_Generator::GetDiscVoids() const +{ + if(myIsDone) return myVVoids; + else + { + cout << "_#_McCadMcVoid_Generator.cxx :: Void generation has not yet been performed or failed!" << endl; + return myVVoids; + } +} + + +void McCadMcVoid_Generator::SetBSolid(const Handle(TopTools_HSequenceOfShape)& theBSolid) +{ + myBSolid = theBSolid; +} + + +Handle(TopTools_HSequenceOfShape)McCadMcVoid_Generator::GetBSolid() const +{ + return myBSolid; +} + + +TopoDS_Shape McCadMcVoid_Generator::MkOuterSpace() +{ + /////////////////////////////////////////////////////////////////////////////////////////// + // here we make the outer sphere + Bnd_Box aBBBox; + + for(Standard_Integer i=1; i<=myBSolid->Length(); i++) + { + for (TopExp_Explorer exv(myBSolid->Value(i), TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + aBBBox.Add(aPnt); + } + } + + aBBBox.SetGap(0.0); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + aBBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + + gp_Pnt theCenterOfMass; + GProp_GProps Props; + Standard_Real theRadius; + + TopoDS_Shape BigB = BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape(); + BRepGProp::VolumeProperties(BigB, Props); + theCenterOfMass = Props.CentreOfMass(); + + theRadius = theCenterOfMass.Distance(theLPnt); + + if(theCenterOfMass.Distance(theUPnt) > theRadius) + theRadius = theCenterOfMass.Distance(theUPnt); + + mySphere = BRepPrimAPI_MakeSphere(gp_Pnt((theLPnt.X() + theUPnt.X())/2, (theLPnt.Y()+ theUPnt.Y())/2, (theLPnt.Z()+ theUPnt.Z())/2), theRadius + 100.0).Shape(); + + //////////////////////////////////////////////////////////////////////////////////////// + return mySphere; +} + + +void McCadMcVoid_Generator::SetMinVolume(const Standard_Real theVol) +{ + myMinVolume = theVol; +} + + +void McCadMcVoid_Generator::SetMaxComplementedShapes(const Standard_Integer theNumb) +{ + myMaxComplementedShapes = theNumb; +} + + +void McCadMcVoid_Generator::SetMaxNbOfPreDecomposition( const Standard_Integer theNumb) +{ + myMaxNbOfPreDecomposition = theNumb; +} + + +void McCadMcVoid_Generator::SetMinDecompositionFaceArea(const Standard_Real theArea) +{ + myMinDecompositionFaceArea = theArea; +} + + +void McCadMcVoid_Generator::SetMinRedecompositionFaceArea(const Standard_Real theArea) +{ + myMinRedecompositionFaceArea = theArea; +} + + +void McCadMcVoid_Generator::SetTolerance(const Standard_Real theTol) +{ + myTolerance = theTol; +} + + +Standard_Boolean McCadMcVoid_Generator::IsDone() const +{ + return myIsDone; +} + + +void McCadMcVoid_Generator::SetDiscParameter(const Standard_Integer theMaxNbPnt, const Standard_Integer theMinNbPnt, + const Standard_Real theXRes, const Standard_Real theYRes, const Standard_Real theTol) +{ + myMaxNbPnt = theMaxNbPnt; + myMinNbPnt = theMinNbPnt; + myXlen = theXRes; + myYlen = theYRes; +} + + +void McCadMcVoid_Generator::SetCutFaceResolution(const Standard_Real theCFRes) +{ + myCFRes = theCFRes; +} + + + +////////////////////////////////////////////////////////////////// +/*++++++++++++++++++++++++++++ INIT ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// +void McCadMcVoid_Generator::Init() +{ + PreDecompose(); + VoidGenerate(); + myIsDone = true; +} + +////////////////////////////////////////////////////////////////// +/*++++++++++++++++++++ PREDECOMPOSE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// + +void McCadMcVoid_Generator::PreDecompose() +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + Handle(TopTools_HSequenceOfShape) BoxSeq = new TopTools_HSequenceOfShape(); + + // For Debugging -- skip decomposition part and jump directly to + // voxelization and voidgenerate !!! + decompose = Standard_True; + Standard_Boolean havePredecomposed = Standard_False; + + if(getenv("MCCAD_PREDECOMPOSED") != NULL) + { + havePredecomposed = Standard_True; + TCollection_AsciiString PreDecomposedFile(getenv("MCCAD_PREDECOMPOSED")); + if(PreDecomposedFile.Length() > 0) + { + decompose = Standard_False; + + if(getenv("MCCAD_DECOMPOSE") != NULL) + decompose = Standard_True; + + cout << "\n==================================================\n" << + "!!! WARNING : Predecomposed Voids used from file : " << + PreDecomposedFile.ToCString() << endl << + "==================================================\n\n"; + STEPControl_Reader rdr; + rdr.ReadFile(PreDecomposedFile.ToCString()); + Standard_Integer nbRoots = rdr.NbRootsForTransfer(); + + cout << "\n-----------------------------------------\nNumber of roots : " << nbRoots << "\n\n"; + + for(Standard_Integer i=1; i<=nbRoots; i++) + { + if(!rdr.TransferRoot(i)) + { + cout << "!!! Warning : skipping root nb : " << i << endl; + continue; + } + + TopoDS_Shape aShape = rdr.Shape(i); + BoxSeq->Append(aShape); + } + } + } + + if(decompose) + { + ///////////////////////////////////////////////////////////////////// + // generate cut faces and do predecomposition using only planar faces + // compose cutfaces + + Handle(McCadDiscDs_HSequenceOfDiscFace) theVCutFace = new McCadDiscDs_HSequenceOfDiscFace(); + Handle(McCadDiscDs_HSequenceOfDiscFace) theResultants = new McCadDiscDs_HSequenceOfDiscFace(); + //NONPLANAR + Handle(McCadDiscDs_HSequenceOfDiscFace) theNPFace = new McCadDiscDs_HSequenceOfDiscFace(); + //#NONPLANAR + myPI->SetStep(5./myVSolids->Length()); + + + /* + * Use planar faces to cut bounding box + */ + for(int i = 1; i <= myVSolids->Length(); i++)//For all voxel solids append planar faces to theVCutFace and discretize these faces + { + TopoDS_Solid tmpSol = TopoDS::Solid(myVSolids->Value(i).GetSolid()); + Handle(McCadDiscDs_HSequenceOfDiscFace) ownVFaces = myVSolids->Value(i).GetOwnVFaces(); + + // cout << "\nSOLID No.: " << i << "....................." << endl; + + //Standard_Integer plnCnt(0); + for(int j = 1; j <= ownVFaces->Length(); j++)//For all faces check if planar, if true and if area is bigger MinDecomposition: append + { + TopoDS_Face aF = TopoDS::Face(ownVFaces->Value(j).GetFace()); + BRepAdaptor_Surface Bs1(aF,Standard_True); + GeomAdaptor_Surface AS = Bs1.Surface(); + + Standard_Real area = McCadMcVoid::AreaOfShape(aF); + + if(AS.GetType() == GeomAbs_Plane) + { + // cout << "Plane No: " << ++plnCnt << " area = " << area << endl; + if(area > myMinDecompositionFaceArea) + theVCutFace->Append(ownVFaces->Value(j)); + else + { + + } + } + else if(AS.GetType() == GeomAbs_Cylinder)// CYLINDRICAL ONLY -- so far + { + if(area > myMinDecompositionFaceArea) + theNPFace->Append(ownVFaces->Value(j)); + } + //#NONPLANAR + } + + /////////////////////////////////////////////////////////////////////////////// + McCadCSGTool_Extender Mext(tmpSol); + if(Mext.IsDone())// Append resultants for nonlinear surfaces. + { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + //TopoDS_Solid stSolid = mcSol->GetSolid(); + Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape(); + + if(mcSol->HaveExt()) + aSeq->Append(mcSol->GetFaces()); + + if (aSeq->Length()> 0) + { + for (Standard_Integer j = 1; j<= aSeq->Length(); j++) + { + TopoDS_Face aFace = TopoDS::Face(aSeq->Value(j)); + Standard_Real area = McCadMcVoid::AreaOfShape(aFace); + // cout << "\t\tarea:" << area << endl; + if(aFace.IsNull() || area < myMinDecompositionFaceArea) + continue; + + McCadDiscDs_DiscFace theDFace; + theDFace.SetFace(aFace); + McCadDiscretization_Face theDiscer(theDFace); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()) + theResultants->Append(theDiscer.GetFace()); + //theVCutFace->Append(theDiscer.GetFace()); + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!", + McCadMessenger_ErrorMsg); + } + } + } + else + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Extending solid failed!!", + McCadMessenger_ErrorMsg); + break; + } + + if(myPI->UserBreak()) + return; + myPI->Increment(); + } + ///////////////////////////////////////////////////////////////////////////////////////// + // we delete quasi redundant faces + // cout << "==================================================================" << endl; + // cout << " Total Number of Solid = " << myVSolids->Length() << endl; + // cout << " Total Number of redundant Cut Faces = " << theVCutFace->Length() << endl; + + //////////////////////////////////////////////////////////////////////////////////////// + // Rank by surface area DECREASING + cout << "Sorting cut faces : " << endl; + + for (int i=1; i<=theVCutFace->Length(); i++) + { + Standard_Real iArea, jArea; + TopoDS_Face iFace = TopoDS::Face(theVCutFace->Value(i).GetFace()); + + iArea = McCadMcVoid::AreaOfShape(iFace); + + for (int j=i+1; j<=theVCutFace->Length(); j++) + { + TopoDS_Face jFace = TopoDS::Face(theVCutFace->Value(j).GetFace()); + + jArea = McCadMcVoid::AreaOfShape(jFace); + + if(jArea > iArea) // swap faces + { + theVCutFace->Exchange(i,j); + iArea = jArea; + } + } + + cout << "." << flush; + } + cout << "Done\n"; + + + for(int i=1; i<=theResultants->Length(); i++) + { + Standard_Real iArea, jArea; + TopoDS_Face iFace = TopoDS::Face(theResultants->Value(i).GetFace()); + iArea = McCadMcVoid::AreaOfShape(iFace); + for(int j=i+1; j<=theResultants->Length(); j++) + { + TopoDS_Face jFace = TopoDS::Face(theResultants->Value(j).GetFace()); + jArea = McCadMcVoid::AreaOfShape(jFace); + + if(jArea > iArea) // swap faces + { + theResultants->Exchange(i,j); + iArea = jArea; + } + } + } + + //remove non-planar faces + for(int i=1; i<=theResultants->Length(); i++) + { + TopoDS_Face iFace = TopoDS::Face(theResultants->Value(i).GetFace()); + BRepAdaptor_Surface iBS(iFace,Standard_True); + GeomAdaptor_Surface iAS = iBS.Surface(); + if(iAS.GetType() != GeomAbs_Plane) + theResultants->Remove(i--); + } + + + // now the faces in theVCutFaces are sorted by their decreasing area + // theVCutFace = McCadMcVoid::DeleteApproxRedundant(theVCutFace, myCFRes); + + if(myBSolid->Length() < 1)//If bounding box does not exist, create overall BB for all voxelized Solids + { + cout << "\nCreating Bounding Box\n" << endl; + Bnd_Box bigBB; + for (Standard_Integer i = 1; i<= myVSolids->Length(); i++) + { + TopoDS_Solid bSol = TopoDS::Solid(myVSolids->Value(i).GetSolid()); + BRepBndLib::Add(bSol,bigBB); + bigBB.SetGap(0.0); + } + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + bigBB.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + myBSolid->Append(BRepPrimAPI_MakeBox(gp_Pnt(aXmin, aYmin, aZmin),gp_Pnt(aXmax, aYmax, aZmax)).Shape()); + } + + // start predecomposition using the Bsolid + if(!havePredecomposed) + BoxSeq->Append(myBSolid); + + TopoDS_Shape theBox = myBSolid->Value(1); + GProp_GProps GP1; + BRepGProp::VolumeProperties(theBox,GP1); + originalBoxSize = GP1.Mass(); + +/*STEPControl_Writer wrt; +for(int p=1; p<=theVCutFace->Length(); p++) + wrt.Transfer(theVCutFace->Value(p).GetFace(), STEPControl_AsIs); +for(int p=1; p<=theResultants->Length(); p++) + wrt.Transfer(theResultants->Value(p).GetFace(), STEPControl_AsIs); +wrt.Write("THECUTFACES.stp");*/ + + + cout << "\n\n##### LINEAR HALF SPACES #####" << endl; + BoxSeq = GoDecompose(BoxSeq, theVCutFace, myMaxNbOfPreDecomposition); //!!! run pre-decomposition + cout << "##### LINEAR HALF SPACES FROM RESULTANTS #####" << endl; + BoxSeq = GoDecompose(BoxSeq, theResultants, myMaxNbOfPreDecomposition); + + + /////////////////////////////////// + // perform cylindrical cuts, if environmental variable MCCAD_CYLINDRICALCUT is defined and set to 1 + if(getenv("MCCAD_CYLINDRICALCUT") != NULL) + { + TCollection_AsciiString val(getenv("MCCAD_CYLINDRICALCUT")); + if(val.IsIntegerValue()) + { + if(val.IntegerValue() == 1) + { + //NONPLANAR + /* + * Use non-planar faces to cut predecomposed bounding box solids + */ + + cout << "\n\nNumber of planar cutted BOXES : " << BoxSeq->Length() << endl; + cout << "Performing second order cuts!!!\n\n"; + + Standard_Real nbFaces(theNPFace->Length()); + myPI->SetStep(15./nbFaces); + + for(Standard_Integer npCnt=1; npCnt<=nbFaces; npCnt++) // for every non linear surface... + { + cout << "\t Face No.: " << npCnt << " of " << nbFaces << endl; + TopoDS_Shape faceShape = theNPFace->Value(npCnt).GetFace(); + + Handle(TColgp_HSequenceOfPnt) curPnts = theNPFace->Value(npCnt).GetPoints(); // get sample points on surf... + for(Standard_Integer bxCnt=1; bxCnt<=BoxSeq->Length(); bxCnt++) // for every box solid ... + { + Standard_Boolean hasInPoints(Standard_False); + TopoDS_Solid curSol = TopoDS::Solid(BoxSeq->Value(bxCnt)); + BRepClass3d_SolidClassifier solidClassifier(curSol); + Standard_Integer inCnt(0); + + for(Standard_Integer pntCnt = 1; pntCnt <= curPnts->Length(); pntCnt++)// for every sample point of current face, test if inside vsolid + { + solidClassifier.Perform(curPnts->Value(pntCnt),1e-7); + + if(solidClassifier.State() == TopAbs_IN && solidClassifier.State() != TopAbs_OUT && solidClassifier.State() != TopAbs_ON) + { + hasInPoints = Standard_True; + inCnt++; + } + } + + if(hasInPoints && Standard_Real(inCnt)/Standard_Real(curPnts->Length()) > 0.1) + { + /*STEPControl_Writer w; + w.Transfer(faceShape, STEPControl_AsIs); + w.Transfer(curSol, STEPControl_AsIs); + + + TopoDS_Compound newComp; + BRep_Builder compBuilder; + compBuilder.MakeCompound(newComp); + + for(Standard_Integer j=1; j < curPnts->Length(); j++) + compBuilder.Add(newComp, BRepBuilderAPI_MakeVertex(curPnts->Value(j)).Vertex()); + + + w.Transfer(newComp, STEPControl_AsIs); + + TCollection_AsciiString name("fc_"); + name += npCnt; + name += ".stp"; + w.Write(name.ToCString());*/ + + /* cout << "IN Points : " << inCnt << " of " << curPnts->Length() << " = " << Standard_Real(inCnt)/Standard_Real(curPnts->Length()) << endl; + + // 03092009 + // * + * this is a pre-"boolean-cut" test! if this test fails, it is most likely that the boolean operation fails or + * that it even causes the program to freeze. + * Put test in McCadMcVoid::HalfSpace and perform for non-planar surfaces only!!! + * */ + TopoDS_Face theFace = TopoDS::Face(faceShape); + + // make box + Bnd_Box tmpBox; + BRepBndLib::Add(curSol, tmpBox); + tmpBox.SetGap(10); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + tmpBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + Handle(TColStd_HSequenceOfReal) uVals = new TColStd_HSequenceOfReal; + Handle(TColStd_HSequenceOfReal) vVals = new TColStd_HSequenceOfReal; + TopoDS_Shape theBox = BRepPrimAPI_MakeBox(theLPnt,theUPnt).Shape(); + + // find extremal points for Face Creation + // we maximize the face, so it cuts the whole (void-)solid + TopLoc_Location loc; + Handle(Geom_Surface) theFaceSurface = BRep_Tool::Surface(theFace,loc); + GeomAdaptor_Surface AS(theFaceSurface); + TopExp_Explorer ex; + gp_Pnt2d the2dPnt; + Standard_Real uMin, uMax, vMin, vMax; + ShapeAnalysis_Surface sAs(theFaceSurface); + + for(ex.Init(theBox, TopAbs_VERTEX); ex.More(); ex.Next()) + { + //get point + TopoDS_Vertex theVertex = TopoDS::Vertex(ex.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(theVertex); + + //project on surface + GeomAPI_ProjectPointOnSurf pntProj(thePnt, theFaceSurface); + for(int j=1; j<=pntProj.NbPoints(); j++) + { + the2dPnt = sAs.ValueOfUV(pntProj.Point(j), 1e-3); + uVals->Append(the2dPnt.X()); + vVals->Append(the2dPnt.Y()); + } + } + + // minimize and maximize + uMin = uVals->Value(1); + uMax = uVals->Value(1); + for(int i=2; i<=uVals->Length(); i++) + { + Standard_Real theVal = uVals->Value(i); + + if(uMin > theVal) + uMin = theVal; + if(uMax < theVal) + uMax = theVal; + } + + vMin = vVals->Value(1); + vMax = vVals->Value(1); + for(int i=2; i<=vVals->Length(); i++) + { + Standard_Real theVal = vVals->Value(i); + if(vMin > theVal) + vMin = theVal; + if(vMax < theVal) + vMax = theVal; + } + + if(AS.GetType() == GeomAbs_Cylinder) + { + uMin = 0; + uMax = 2.*M_PI; + } + /////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef OCC650 + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax); +#else + TopoDS_Face F1 = BRepBuilderAPI_MakeFace(theFaceSurface, uMin, uMax, vMin, vMax, 1.e-7); +#endif + F1.Orientation(TopAbs_FORWARD); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // Build new solids + + Standard_Boolean preTestFailed(Standard_False); + // if pretest failes bop will most likely fail, in some cases it will freez the whole prog., that's why we do this + // pretest. + + for(TopExp_Explorer fExp(curSol, TopAbs_FACE); fExp.More(); fExp.Next()) + { + TopoDS_Face curF = TopoDS::Face(fExp.Current()); + + IntTools_FaceFace ffInt; + ffInt.SetParameters(Standard_True, Standard_False, Standard_True, 1e-3); + ffInt.Perform(curF, F1); + + if(!ffInt.IsDone()) + { + preTestFailed=Standard_True; + break; + } + + IntTools_SequenceOfCurves curves; + curves = ffInt.Lines(); + + Standard_Integer nbLines(0); + for(int i=1; i<=curves.Length(); i++) + nbLines++; + + if(nbLines < 1) + continue; + + if(nbLines > 2) + { + cout << "NB LINES : " << nbLines << endl; + + preTestFailed = Standard_True; + break; + } + + for(int i=1; i<=curves.Length(); i++) + { + IntTools_Curve intCurve = curves.Value(i); + if(!intCurve.HasBounds()) + { + preTestFailed = Standard_True; + break; + } + } + } + + if(preTestFailed) + { + cout << "Pre-Boolean_Operation-Test failed\nSkipping this solid\n"; + continue; + } + + Handle(TopTools_HSequenceOfShape) tmpShp = new TopTools_HSequenceOfShape; + tmpShp->Append(curSol); + + tmpShp = Decompose(tmpShp, faceShape); + + // # + // cout << "\t\t\tNumber Of Result Boxes : " << tmpShp->Length() << endl; + if(tmpShp->Length()>1) // decomposition successfull + { + // cout << "CUT SUCCESSFUL : " << tmpShp->Length() << endl; + Standard_Integer failCnt(0); + Standard_Boolean isFailed(Standard_False); + + for(int k=1; k<=tmpShp->Length(); k++) //check again if cutted model is valid, append valid boxes to BoxSeq + { + TopoDS_Shape aSol = tmpShp->Value(k); + + for (TopExp_Explorer exs(aSol,TopAbs_SHELL);exs.More();exs.Next()) + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + ////////////////////////////////////////////////////////////////////////// + BRepCheck_Shell shellCheck(sh); + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) + { + BRepBuilderAPI_MakeSolid Bu(sh); + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + + if(aSolid.IsNull()) + { + isFailed = Standard_True; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Null Solid Resulted", + McCadMessenger_ErrorMsg); + } + else + { + BoxSeq->Append(aSolid); + failCnt++; + } + } + else + cout << "# # # Could not build Solid!!!\n"; + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Model may be invalid!!", + McCadMessenger_WarningMsg); + } + } + + if(isFailed) // if resulting solids are invalid - remove already appended solids and keep original one + { + for(int l=1; l<=failCnt; l++) + BoxSeq->Remove(BoxSeq->Length()); + } + else + BoxSeq->Remove(bxCnt); + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Cut Failed !!!", + McCadMessenger_WarningMsg); + } + } + myPI->Increment(); + } + + cout << "Total number of BOXES after second order cut : " << BoxSeq->Length() << endl; + } + } + }//#NONPLANAR + } + + + if(getenv("MCCAD_WRITE_DECOMPOSED") != NULL) + { + STEPControl_Writer wrt; + for(int i=1; i<=BoxSeq->Length(); i++) + wrt.Transfer(BoxSeq->Value(i), STEPControl_AsIs); + wrt.Write("theVVoids.stp"); + } + + + ///////////////////////////////////////////////////////////////////////// + cout << "\nVoxelization of predecomposed voids" << endl; + cout << "====================================" << endl; + + for (Standard_Integer i = 1; i<= BoxSeq->Length(); i++)//Discretize cutted solids + { + cout << "." << flush; + TopoDS_Solid tmpSol = TopoDS::Solid(BoxSeq->Value(i)); + McCadDiscDs_DiscSolid aVSol; + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(i); + + // voxelize + McCadDiscretization_Solid theDiscer(aVSol); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()) + { + myVVoids->Append(theDiscer.GetSolid()); //myVVoids contains now discretized cutted solids with planar faces + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Voxelization of a predecomposed void failed", + McCadMessenger_ErrorMsg); + } + cout << "\n====================================" << endl; + cout << "End voxelization of predecomposition Voids \n" << endl; + + BoxSeq->Clear(); +} + + +Standard_Boolean McCadMcVoid_Generator::IsPolyhedral(TopoDS_Shape& shp) +{ + for(TopExp_Explorer ex(shp, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face face = TopoDS::Face(ex.Current()); + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(face,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + if(adaptorSurf.GetType() != GeomAbs_Plane) + return Standard_False; + } + + return Standard_True; +} + + +Standard_Boolean McCadMcVoid_Generator::PolyhedralOverlap(TopoDS_Shape& shp1, TopoDS_Shape& shp2) +{ + /* + * After sign-constant decomposition each polyhedral solid is convex. + * For 2 convex polyhedra that do not overlap there is at least one + * bounding surface of the two solids for which all vertices of the one solid + * lie on one side and all vertices of the other solid lie on the other side. + * If no such separating, bounding surface can be found the two solids must overlap. + * + * This method is supposed to be faster and more accurate than the "voxelized solids"-method! + */ + + Handle_TopTools_HSequenceOfShape vertex1Sequence = new TopTools_HSequenceOfShape; + Handle_TopTools_HSequenceOfShape vertex2Sequence = new TopTools_HSequenceOfShape; + Handle_TopTools_HSequenceOfShape faces1Sequence = new TopTools_HSequenceOfShape; + Handle_TopTools_HSequenceOfShape faces2Sequence = new TopTools_HSequenceOfShape; + + // 1 + /////////////////////////////////////////////// + for(TopExp_Explorer ex(shp1, TopAbs_VERTEX); ex.More(); ex.Next()) + { + TopoDS_Vertex aVertex = TopoDS::Vertex(ex.Current()); + vertex1Sequence->Append(aVertex); + } + + for(int i=1; i<=vertex1Sequence->Length(); i++) + { + for(int j=vertex1Sequence->Length(); j>i; j--) + { + if(vertex1Sequence->Value(i).IsSame(vertex1Sequence->Value(j))) + { + vertex1Sequence->Remove(j); + i--; + break; + } + } + } + + + for(TopExp_Explorer ex(shp1, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + faces1Sequence->Append(aFace); + } + + for(int i=1; i<=faces1Sequence->Length(); i++) + { + for(int j=faces1Sequence->Length(); j>i; j--) + { + if(faces1Sequence->Value(i).IsSame(faces1Sequence->Value(j))) + { + faces1Sequence->Remove(j); + i--; + break; + } + } + } + + + // 2 + ////////////////////////////////////////////////// + for(TopExp_Explorer ex(shp2, TopAbs_VERTEX); ex.More(); ex.Next()) + { + TopoDS_Vertex aVertex = TopoDS::Vertex(ex.Current()); + vertex2Sequence->Append(aVertex); + } + + /* for(int i=1; i<=vertex2Sequence->Length(); i++) + { + for(int j=vertex2Sequence->Length(); j>i; j--) + { + if(vertex2Sequence->Value(i).IsSame(vertex2Sequence->Value(j))) + { + vertex2Sequence->Remove(j); + i--; + break; + } + } + }*/ + + + for(TopExp_Explorer ex(shp2, TopAbs_FACE); ex.More(); ex.Next()) + { + TopoDS_Face aFace = TopoDS::Face(ex.Current()); + faces2Sequence->Append(aFace); + } + + for(int i=1; i<=faces2Sequence->Length(); i++) + { + for(int j=faces2Sequence->Length(); j>i; j--) + { + if(faces2Sequence->Value(i).IsSame(faces2Sequence->Value(j))) + { + faces2Sequence->Remove(j); + i--; + break; + } + } + } + + + /*cout << "STATS : \n======================\n\n"; + cout << vertex1Sequence->Length() << endl; + cout << faces1Sequence->Length() << endl; + cout << vertex2Sequence->Length() << endl; + cout << faces2Sequence->Length() << endl << endl; + + STEPControl_Writer wrt; + for(int i=1; i<=vertex2Sequence->Length(); i++) + wrt.Transfer(vertex2Sequence->Value(i), STEPControl_AsIs); + wrt.Transfer(shp1, STEPControl_AsIs); + wrt.Write("model.stp");*/ + + // exit(0); + + // 1 vs 2 + /////////////////////////////////////// + for(int i=1; i<=faces1Sequence->Length(); i++) + { + TopoDS_Face curFace = TopoDS::Face(faces1Sequence->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(curFace,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + int curSig(0); + + // determine in solid signum + for(int j=1; j<=vertex1Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex1Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + curSig = int(val/fabs(val)); + break; + } + } + + int breakCnt(0); + bool isFace(false); + + if(curSig == 0) + isFace = true; + + // test if solid has vertices with same signum + for(int j=1; j<=vertex2Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex2Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + int sign = int(val/fabs(val)); + + if(isFace) + { + if(curSig == 0) + { + curSig = sign; + continue; + } + else if(sign != curSig) + { + breakCnt++; + break; + } + } + else + { + if(sign == curSig) + { + breakCnt++; + break; + } + } + } + } + + if(breakCnt == 0) + { + //cout << "No Collision 1\n"; + return false; + } + } + + // 2 vs 1 + ////////////////////////////////////// + for(int i=1; i<=faces2Sequence->Length(); i++) + { + TopoDS_Face curFace = TopoDS::Face(faces2Sequence->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(curFace,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + int curSig(0); + + // determine in solid signum + for(int j=1; j<=vertex2Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex2Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + curSig = int(val/fabs(val)); + break; + } + } + + int breakCnt(0); + bool isFace(false); + + if(curSig == 0) + isFace = true; + + // test if solid has vertices with same signum + for(int j=1; j<=vertex1Sequence->Length(); j++) + { + TopoDS_Vertex curVertex = TopoDS::Vertex(vertex1Sequence->Value(j)); + gp_Pnt pnt = BRep_Tool::Pnt(curVertex); + double val = McCadGTOOL::Evaluate(adaptorSurf, pnt); + + if(fabs(val) > 1.0e-6) + { + int sign = int(val/fabs(val)); + + if(isFace) + { + if(curSig == 0) + { + curSig = sign; + continue; + } + else if(sign != curSig) + { + breakCnt++; + break; + } + } + else + { + if(sign == curSig) + { + breakCnt++; + break; + } + } + } + } + + if(breakCnt == 0) + { + //cout << "No Collision 2\n"; + return false; + } + } + + + return true; + + // check all vertices of solid 2 with all faces of solid 1 +/* for(TopExp_Explorer exF(shp2, TopAbs_FACE); exF.More(); exF.Next()) + { + Standard_Integer sign(0); + TopoDS_Face face2 = TopoDS::Face(exF.Current()); + + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(face2,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + + Standard_Integer breakCount(0); + + for(TopExp_Explorer exV(shp1, TopAbs_VERTEX); exV.More(); exV.Next()) + { + TopoDS_Vertex vertex1 = TopoDS::Vertex(exV.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(vertex1); + + Standard_Real val = McCadGTOOL::Evaluate(adaptorSurf, thePnt); + val = val/Abs(val); + sign = Standard_Integer(val); + + // forward oriented face => all vertices of own solid are on negative side, + // for reverse oriented face => the other way around + if(face2.Orientation() == TopAbs_REVERSED) + { + if(sign < -1.0e-6) + continue; + } + else if(sign > 1.0e-6) + continue; + + breakCount++; + break; + } + + // no break-call => no collision + if(breakCount == 0) + return Standard_False; + } + + + // check all faces of solid 1 with all vertices of solid 2 + for(TopExp_Explorer exF(shp1, TopAbs_FACE); exF.More(); exF.Next()) + { + Standard_Integer sign(0); + TopoDS_Face face1 = TopoDS::Face(exF.Current()); + + TopLoc_Location loc; + Handle(Geom_Surface) geomSurf = BRep_Tool::Surface(face1,loc); + GeomAdaptor_Surface adaptorSurf(geomSurf); + + Standard_Integer breakCount(0); + + for(TopExp_Explorer exV(shp2, TopAbs_VERTEX); exV.More(); exV.Next()) + { + TopoDS_Vertex vertex2 = TopoDS::Vertex(exV.Current()); + gp_Pnt thePnt = BRep_Tool::Pnt(vertex2); + + Standard_Real val = McCadGTOOL::Evaluate(adaptorSurf, thePnt); + val = val/Abs(val); + sign = Standard_Integer(val); + + if(face1.Orientation() == TopAbs_REVERSED) + { + if(sign < -1.0e-6) + continue; + } + else if(sign > 1.0e-6) + continue; + + breakCount++; + break; + } + + // no break-call => no collision + if(breakCount == 0) + return Standard_False; + } + + // no sign-constant surface found? => collision + return Standard_True;*/ +} + + +////////////////////////////////////////////////////////////////// +/*++++++++++++++++++++ VOIDGENERATE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// +// perform collision test between linearly cut void cells and decomposed input solids +void McCadMcVoid_Generator::VoidGenerate() +{ + ///////////////////////////////////////////////////////////////////////////////////////// + // append empty exp. after cell and outer seq. so that the output is smooth. + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + myPI->SetStep(5./myVVoids->Length()); + + Handle(TopTools_HSequenceOfShape) theFaceSeq = new TopTools_HSequenceOfShape(); + + cout << "\nFinalize void generation " << endl; + cout << "Checking voids against solids " << myVVoids->Length() << " " << myVSolids->Length() << endl; + cout << "====================================================== " << endl; + + Handle(TopTools_HSequenceOfShape) F1Seq = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) F2Seq = new TopTools_HSequenceOfShape(); + + for (int itv = 1; itv <= myVVoids->Length(); itv++)//For all voids + { + Standard_Boolean isErased = Standard_False; + +// cout << "Void : " << itv << " of " << myVVoids->Length() << endl; + cout << "." << flush; + + myPI->Increment(); + if(myPI->UserBreak()) + return; + + TopoDS_Solid aVoidSolid = TopoDS::Solid(myVVoids->Value(itv).GetSolid()); //Void-solids + Standard_Real aVol = McCadMcVoid::VolumeOfShape(aVoidSolid); + + //cout << "\n" << aVol << "\n\n"; + BRepClass3d_SolidClassifier voidClassifier (aVoidSolid); + + McCadDiscDs_DiscSolid aDiscSolid = myVVoids->Value(itv); + Bnd_Box aBB = aDiscSolid.GetBBox(); + if(aBB.IsWhole()) cout << "Is whole" << endl; + if(aBB.IsVoid()) cout << "Is Void" << endl; + if(aBB.IsXThin(1e-7)) cout << "Is xthin" << endl; + if(aBB.IsYThin(1e-7)) cout << "Is ythin" << endl; + if(aBB.IsZThin(1e-7)) cout << "Is zthin" << endl; + if(aBB.IsThin(1e-7)) cout << "Is thin" << endl; + + Standard_Real bXmin, bYmin, bZmin, bXmax, bYmax, bZmax; + aBB.Get(bXmin, bYmin, bZmin, bXmax, bYmax, bZmax); + //cout << bXmin << " " << bYmin<< " " << bZmin<< " " << bXmax<< " " << bYmax<< " " << bZmax << endl; + gp_Pnt bPnt1(bXmin, bYmin, bZmin), bPnt2(bXmax, bYmax, bZmax); + + for (int its = 1; its <= myVSolids->Length(); its++) + { + // cout<< "Checking Void number " << itv << " (" << myVVoids->Length() << ")" << " against solid number " << its << " of " << myVSolids->Length() << endl; + + /////////////////////////////////////////////////////////////////////////////////////////////////// + Standard_Boolean inState = Standard_False; + TopoDS_Solid sSol = TopoDS::Solid(myVSolids->Value(its).GetSolid()); //material solid + Standard_Real sVol = McCadMcVoid::VolumeOfShape(sSol); + BRepClass3d_SolidClassifier solidClassifier (sSol); + + ////////////////////////////////////////////////////////////// + //bounding box based exclusion + Bnd_Box sBB; // = myVSolids->Value(its).GetBBox(); + BRepBndLib::Add(myVSolids->Value(its).GetSolid(), sBB); + sBB.SetGap(0); + + Standard_Real sXmin, sYmin, sZmin, sXmax, sYmax, sZmax; + sBB.Get(sXmin, sYmin, sZmin, sXmax, sYmax, sZmax); + gp_Pnt sPnt1(sXmin, sYmin, sZmin), sPnt2(sXmax, sYmax, sZmax); + + if(aBB.IsOut(sBB) && sBB.IsOut(aBB) && + aBB.IsOut(sPnt1) && aBB.IsOut(sPnt2) && + sBB.IsOut(bPnt1) && sBB.IsOut(bPnt2) ) + continue; + + //////////////////////////////////////////////////////////////////// + // identical faces but different orientation + Standard_Boolean found(Standard_False); + Standard_Boolean haveNonLinFace(Standard_False); + F1Seq->Clear(); + F2Seq->Clear(); + + for (TopExp_Explorer exFF(sSol,TopAbs_FACE); exFF.More(); exFF.Next()) + { + TopoDS_Face sF = TopoDS::Face(exFF.Current()); + F2Seq->Append(sF); + } + + for (TopExp_Explorer exF(aVoidSolid,TopAbs_FACE); exF.More(); exF.Next()) + { + TopoDS_Face aF = TopoDS::Face(exF.Current()); + F1Seq->Append(aF); + + for(Standard_Integer i=1; i<=F2Seq->Length(); i++) + { + TopoDS_Face sF = TopoDS::Face(F2Seq->Value(i)); + TopLoc_Location loc; + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(sF,loc); + GeomAdaptor_Surface As2(gS2); + + if (As2.GetType() != GeomAbs_Plane) + { + haveNonLinFace = Standard_True; + continue; + } + + theFaceSeq->Clear(); + theFaceSeq->Append(aF); + theFaceSeq->Append(sF); + theFaceSeq = McCadMcVoid::DeleteOne(theFaceSeq); + if (theFaceSeq->Length() < 2) + { + //cout << "Opposing faces\n"; + found = Standard_True; + break; + } + } + + if(found) // voids are supposed to be all planar -- in further development this might change !!! + break; + } + + if(found) + continue; + /////////////////////////////////////////////////////////////////////// + // all surfaces are identical + // Handle(TopTools_HSequenceOfShape) nonIdenticalFaces = new TopTools_HSequenceOfShape(); + Standard_Integer if2(0); + TopLoc_Location loc; + + //cout << "\n\nSURFACE CHECK!!! : \n"; + + if(F1Seq->Length() == F2Seq->Length()) + { + for(int ic = 1; ic <= F1Seq->Length(); ic++) //For all void-faces compare with solid faces + { + TopoDS_Face F1 = TopoDS::Face(F1Seq->Value(ic)); + Handle(Geom_Surface) gS1 = BRep_Tool::Surface(F1,loc); + GeomAdaptor_Surface As1(gS1); + Handle(McCadCSGGeom_Surface) S1 = McCadMcVoid::MakeMcCadSurf(As1); + S1->SetCasSurf(As1); + + for(int ic2 = 1; ic2 <= F2Seq->Length(); ic2++) + { + //cout << " faces : " << ic << " - " << ic2 << endl; + TopoDS_Face F2 = TopoDS::Face(F2Seq->Value(ic2)); + Handle(Geom_Surface) gS2 = BRep_Tool::Surface(F2,loc); + GeomAdaptor_Surface As2(gS2); + + if (As1.GetType() == As2.GetType()) + { + Handle(McCadCSGGeom_Surface) S2 = McCadMcVoid::MakeMcCadSurf(As2); + S2->SetCasSurf(As2); + + if (S1->IsGeomEqual(S2)) + { + if2++; + } + } + } + + if (F2Seq->Length() == if2) //if all faces of void and solid are the same, the void-solid must be deleted + { + //cout << "Void erased because of \"identical faces\"\n"; + myVVoids->Remove(itv); + itv--; + isErased = Standard_True; + break; + } + } + + if(isErased) + break; //the void is deleted!!! + } + + ////////////////////////////////////////////////////////////////////// + // vertex based check void against solid/// + Standard_Boolean outState = Standard_False; + + //For all void vertices check if any lies outside the current solid + for (TopExp_Explorer exV(aVoidSolid,TopAbs_VERTEX); exV.More(); exV.Next()) + { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(exV.Current())); + solidClassifier.Perform(aP, 1.e-9); // 1.e-3 before 26082009 + + if (solidClassifier.State() == TopAbs_OUT ) + { + outState = Standard_True; + break; + } + } + + if(aVol - sVol <= 1.0e-5 && !outState) + { + Standard_Boolean deleteIt = Standard_True; + /////////////////////////////////////////////////////////////////////////// + if (haveNonLinFace) + deleteIt = Standard_False; + + if(deleteIt) + { + //cout << "Void erased because of \"inclusion in solid\"\n"; + myVVoids->Remove(itv); + itv--; + isErased = Standard_True; + break; + } + } + + if(isErased) + break; //the void is deleted!!! + + + // check if void center of mass lies inside solid + GProp_GProps Props; + BRepGProp::VolumeProperties(aVoidSolid, Props); + gp_Pnt vCenterOfMass = Props.CentreOfMass(); + solidClassifier.Perform(vCenterOfMass, 1e-9); + + if(solidClassifier.State() == TopAbs_IN) + { + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); + continue; + } + + + /////////////////////////////////////////////////////////////////// + // simplified overlap test for polyhedral solids -- the voids ARE polyhedral + if(!haveNonLinFace) + { + if(PolyhedralOverlap(aVoidSolid, sSol)) // OVERLAP + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); + continue; + } + + + // Voxel collision test + /////////////////////////////////////////////////////////////////////// + // forward check + Handle(McCadDiscDs_HSequenceOfDiscFace) vFaces = myVSolids->Value(its).GetOwnVFaces(); + inState = Standard_False; + Standard_Boolean allBBout(Standard_True); + + for(int ip = 1; ip <= vFaces->Length(); ip++)//For all Voxel Faces check for intersection + { + Bnd_Box fBB = vFaces->Value(ip).GetBBox(); + + if(aBB.IsOut(fBB)) + continue; + + allBBout = Standard_False; + + // this is forward check + Handle(TColgp_HSequenceOfPnt) aPntSeq = vFaces->Value(ip).GetPoints(); + for (int k=1; k<=aPntSeq->Length();k++) //For all voxel points of current face + { + gp_Pnt aP = aPntSeq->Value(k); + + if(aBB.IsOut(aP)) + continue; + + voidClassifier.Perform(aP, 1.0e-9); + + TopAbs_State theForwardState = voidClassifier.State(); + // before _MYTEST_ perform tolerance was 1e-7 and we only tested for in, not on. + if(theForwardState == TopAbs_IN && theForwardState != TopAbs_ON) // MYTEST!!! Wed Jan 19 09:54:20 CET 2011 + { + inState = Standard_True; + break; + } + } + if (inState) + break; + } + + // if no face bounding box collides with the void bounding box, continue + if(allBBout) + continue; + + if (inState) //vanilla voxel based method: inclusion should be checked here!!! + { + //cout << "myVVoids collides with : " << its << " and "; + //for(int d=1; d<=myVVoids->Value(itv).GetOtherVSolids()->Length(); d++) + // cout << myVVoids->Value(itv).GetOtherVSolids()->Value(d) << endl; + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); //otherVSolids are excluded later during cell building + continue; + } + + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // otherwise simple backward check due to small voids may be available !! + // this is necessery!! + + vFaces = myVVoids->Value(itv).GetOwnVFaces(); + for(int ip = 1; ip <= vFaces->Length(); ip++)//For all Voxel Faces check for intersection + { + Bnd_Box fBB = vFaces->Value(ip).GetBBox(); + + if(sBB.IsOut(fBB)) + continue; + + // this is backward check + Handle(TColgp_HSequenceOfPnt) aPntSeq = vFaces->Value(ip).GetPoints(); + for (int k=1; k<=aPntSeq->Length();k++) //For all voxel points of current face + { + gp_Pnt aP = aPntSeq->Value(k); + + if(sBB.IsOut(aP)) + continue; + + solidClassifier.Perform(aP, 1.0e-9); + + TopAbs_State theBackState = solidClassifier.State(); + if(theBackState == TopAbs_IN && theBackState != TopAbs_ON) // + { + inState = Standard_True; + break; + } + } + if (inState) + break; + } + if (inState) //vanilla voxel based method: inclusion should be checked here!!! + { + myVVoids->ChangeValue(itv).AppendOtherVSolid(its); + continue; + } + /////////////////////////////////////////////////////////////////////////////////////////////// + } + + if(isErased) + continue; + + ////////////////////////////////////////////////////////////////////// + //MYTEST Test for monster voids and split further if monster is found + //new implementation Wed Feb 15 16:38:43 CET 2004 + // We check for monster voids and decompose them further!!! + Handle(TColStd_HSequenceOfInteger) compList = myVVoids->Value(itv).GetOtherVSolids(); + + if (compList->Length() > myMaxComplementedShapes) + { + //cout << " \nbegin... Processing Monster Void : " << endl; + cout << " Monster Void : number of complement solids = " << compList->Length() << endl; + Handle(TopTools_HSequenceOfShape) locSeq = new TopTools_HSequenceOfShape(); + + locSeq->Append(aVoidSolid); // append the void to it + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpVSol = new McCadDiscDs_HSequenceOfDiscSolid; + Handle(McCadDiscDs_HSequenceOfDiscFace) tmpVCutFace = new McCadDiscDs_HSequenceOfDiscFace; + + for(int i = 1; i <= compList->Length(); i++) + { + int index = compList->Value(i); + tmpVSol->Append(myVSolids->Value(index)); + } + + for (int i = 1; i <= tmpVSol->Length(); i++) + { + TopoDS_Solid tmpSol = TopoDS::Solid(tmpVSol->Value(i).GetSolid()); + + Handle(McCadDiscDs_HSequenceOfDiscFace) lvFaces = tmpVSol->Value(i).GetOwnVFaces(); + + for (int j = 1; j <= lvFaces->Length(); j++) + { + TopoDS_Face aF = lvFaces->Value(j).GetFace(); + BRepAdaptor_Surface Bs1(aF,Standard_True); + GeomAdaptor_Surface AS = Bs1.Surface(); + if(AS.GetType() == GeomAbs_Plane) + { + Standard_Real area = McCadMcVoid::AreaOfShape(aF); + + if( area > myMinRedecompositionFaceArea) + tmpVCutFace->Append(lvFaces->Value(j)); + } + } + /////////////////////////////////////////////////////////////////////////////// + McCadCSGTool_Extender Mext(tmpSol); + if(Mext.IsDone()) + { + Handle(McCadTDS_ExtSolid) mcSol = Mext.ExtSolid(); + TopoDS_Solid stSolid = mcSol->GetSolid(); + Handle(TopTools_HSequenceOfShape) aSeq = new TopTools_HSequenceOfShape(); + if(mcSol->HaveExt()) aSeq->Append(mcSol->GetFaces()); + if (aSeq->Length()> 0) + { + for (Standard_Integer i = 1; i<= aSeq->Length(); i++) + { + TopoDS_Face aFace = TopoDS::Face(aSeq->Value(i)); + + Standard_Real area = McCadMcVoid::AreaOfShape(aFace); + + if(aFace.IsNull() || area < myMinRedecompositionFaceArea ) + continue; + + McCadDiscDs_DiscFace theDFace; + theDFace.SetFace(aFace); + + McCadDiscretization_Face theDiscer(theDFace); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + if(theDiscer.IsDone()) + { + tmpVCutFace->Append(theDiscer.GetFace()); + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!", + McCadMessenger_ErrorMsg); + } + } + } + else + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Extending solid failed!!", + McCadMessenger_ErrorMsg); + break; + } + } + ///////////////////////////////////////////////////////////////////////////////////////// + // we delet quasi redundant faces and the extend + tmpVCutFace = McCadMcVoid::DeleteApproxRedundant(tmpVCutFace, myCFRes); + //////////////////////////////////////////////////////////////////////////////////////// + + if(tmpVCutFace->Length() > 0) + { + int maxNbDec=5; + locSeq = GoDecompose(locSeq,tmpVCutFace,maxNbDec); + } + else + { + cout << " Number Cut Faces is zero = " << tmpVCutFace->Length() << endl; + cout << " Monster Void remains unprocessed.. " << endl; + } + + if(locSeq->Length() > 1) + { + cout << " Monster Void expanded to Voids: " << locSeq->Length() << endl; + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpVVoid = new McCadDiscDs_HSequenceOfDiscSolid; + for (Standard_Integer i = 1; i<= locSeq->Length(); i++) + { + + TopoDS_Solid tmpSol = TopoDS::Solid(locSeq->Value(i)); + + //check size of decomposed monster void + GProp_GProps volProp; + BRepGProp::VolumeProperties(tmpSol,volProp); + if(volProp.Mass() < myMinVolume) + { + tmpVVoid->Clear(); + break; + } + + McCadDiscDs_DiscSolid aVSol; + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(i); + // voxelize + McCadDiscretization_Solid theDiscer(aVSol); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + if(theDiscer.IsDone()) + { + tmpVVoid->Append(theDiscer.GetSolid()); + } + else + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Voxelization of a predecomposition Void failed.", + McCadMessenger_ErrorMsg); + + } + + if(tmpVVoid->Length() > 1) + { + myVVoids->Remove(itv); + itv--; // delete the current monster void + myVVoids->Append(tmpVVoid); + } + } + else if(aVol > myMinVolume) // make sure voids don't get too many and too small + { + // The idea was to cut monster voids along bisectioning planes of the bounding box + // the results are not good :( !!! + + /*STEPControl_Writer wrt; + wrt.Transfer(aVoidSolid, STEPControl_AsIs); + for(int i=1; i<=tmpVSol->Length(); i++) + wrt.Transfer(tmpVSol->Value(i).GetSolid(), STEPControl_AsIs); + wrt.Write("Monster.stp"); + exit(-1);*/ + +/* cout << "Performing bisectioning...\n"; + + STEPControl_Writer wrt; + for(int i=1; i<=tmpVSol->Length(); i++) + wrt.Transfer(tmpVSol->Value(i).GetSolid(), STEPControl_AsIs); + wrt.Write("bisectioning.stp"); + + + tmpVCutFace->Clear(); + + for(Standard_Integer i=1; i<=locSeq->Length(); i++) // max 1 + { + BRepBndLib boxExpander; + Bnd_Box tmpBox; + boxExpander.Add(locSeq->Value(i), tmpBox); + + Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax; + tmpBox.SetGap(0.0); + tmpBox.Get(aXMin, aYMin, aZMin, aXMax, aYMax, aZMax); + + // define points + gp_Pnt p1, p2, p3, p4; + + // make planes + // z half + p1 = gp_Pnt(aXMax, aYMin, (aZMin+aZMax)/2.0 ); + p2 = gp_Pnt(aXMax, aYMax, (aZMin+aZMax)/2.0 ); + p3 = gp_Pnt(aXMin, aYMax, (aZMin+aZMax)/2.0 ); + p4 = gp_Pnt(aXMin, aYMin, (aZMin+aZMax)/2.0 ); + TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(p1, p2).Edge(); + TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(p2, p3).Edge(); + TopoDS_Edge e3 = BRepBuilderAPI_MakeEdge(p3, p4).Edge(); + TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(p4, p1).Edge(); + TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(e1, e2, e3, e4).Wire(); + TopoDS_Face aFace = BRepBuilderAPI_MakeFace(aWire, Standard_True).Face(); + + McCadDiscDs_DiscFace theDFace; + theDFace.SetFace(aFace); + + McCadDiscretization_Face theDiscer(theDFace); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + + if(theDiscer.IsDone()) + tmpVCutFace->Append(theDiscer.GetFace()); + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!"); + + + // y half + p1 = gp_Pnt(aXMax, (aYMin+aYMax)/2.0, aZMin ); + p2 = gp_Pnt(aXMin, (aYMin+aYMax)/2.0, aZMin ); + p3 = gp_Pnt(aXMin, (aYMin+aYMax)/2.0, aZMax ); + p4 = gp_Pnt(aXMax, (aYMin+aYMax)/2.0, aZMax ); + e1 = BRepBuilderAPI_MakeEdge(p1, p2).Edge(); + e2 = BRepBuilderAPI_MakeEdge(p2, p3).Edge(); + e3 = BRepBuilderAPI_MakeEdge(p3, p4).Edge(); + e4 = BRepBuilderAPI_MakeEdge(p4, p1).Edge(); + aWire = BRepBuilderAPI_MakeWire(e1, e2, e3, e4).Wire(); + aFace = BRepBuilderAPI_MakeFace(aWire, Standard_True).Face(); + + theDFace.SetFace(aFace); + theDiscer.SetFace(theDFace); + theDiscer.Init(); + + if(theDiscer.IsDone()) + tmpVCutFace->Append(theDiscer.GetFace()); + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!"); + + + // x half + p1 = gp_Pnt((aXMin+aXMax)/2.0, aYMin, aZMin ); + p2 = gp_Pnt((aXMin+aXMax)/2.0, aYMax, aZMin ); + p3 = gp_Pnt((aXMin+aXMax)/2.0, aYMax, aZMax ); + p4 = gp_Pnt((aXMin+aXMax)/2.0, aYMin, aZMax ); + e1 = BRepBuilderAPI_MakeEdge(p1, p2).Edge(); + e2 = BRepBuilderAPI_MakeEdge(p2, p3).Edge(); + e3 = BRepBuilderAPI_MakeEdge(p3, p4).Edge(); + e4 = BRepBuilderAPI_MakeEdge(p4, p1).Edge(); + aWire = BRepBuilderAPI_MakeWire(e1, e2, e3, e4).Wire(); + aFace = BRepBuilderAPI_MakeFace(aWire, Standard_True).Face(); + + theDFace.SetFace(aFace); + theDiscer.SetFace(theDFace); + theDiscer.Init(); + + if(theDiscer.IsDone()) + tmpVCutFace->Append(theDiscer.GetFace()); + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Face discretization failed!!"); + } + + int maxNbDec=3; + locSeq = GoDecompose(locSeq,tmpVCutFace,maxNbDec); + + if(locSeq->Length() > 1) + { + cout << " Monster Void expanded to Voids: " << locSeq->Length() << endl; + + Handle(McCadDiscDs_HSequenceOfDiscSolid) tmpVVoid = new McCadDiscDs_HSequenceOfDiscSolid; + for (Standard_Integer i = 1; i<= locSeq->Length(); i++) + { + + TopoDS_Solid tmpSol = TopoDS::Solid(locSeq->Value(i)); + + //check size of decomposed monster void + GProp_GProps volProp; + BRepGProp::VolumeProperties(tmpSol,volProp); + if(volProp.Mass() < myMinVolume) + { + tmpVVoid->Clear(); + break; + } + + McCadDiscDs_DiscSolid aVSol; + aVSol.SetSolid(tmpSol); + aVSol.SetIndex(i); + // voxelize + McCadDiscretization_Solid theDiscer(aVSol); + theDiscer.SetMinNbPnt(myMinNbPnt); + theDiscer.SetMaxNbPnt(myMaxNbPnt); + theDiscer.SetXresolution(myXlen); + theDiscer.SetYresolution(myYlen); + theDiscer.SetTolerance(myTolerance); + theDiscer.Init(); + if(theDiscer.IsDone()) + { + tmpVVoid->Append(theDiscer.GetSolid()); + } + else + msgr.Error("_#_McCadMcVoid_Generator.cxx :: Voxelization of a predecomposition Void failed."); + + } + + if(tmpVVoid->Length() > 1) + { + myVVoids->Remove(itv); + itv--; // delete the current monster void + myVVoids->Append(tmpVVoid); + } + } + else + msgr.Warning("_#_McCadMcVoid_Generator.cxx :: Can't expand Monster Void!"); +*/ + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Can't expand Monster Void!", + McCadMessenger_WarningMsg); + } + cout << endl << locSeq->Length() << endl; + cout << " end... Processing Monster Void ...end " << endl; + } + + } + + if(getenv("MCCAD_WRITE_VOIDS") != NULL) + { + + STEPControl_Writer stpWrtr; + for(int p=1; p<=myVVoids->Length(); p++) + stpWrtr.Transfer(myVVoids->Value(p).GetSolid(), STEPControl_AsIs); + + stpWrtr.Write("mc_Void_Cells.stp"); + } + + cout<< "\n====================================================== " << endl; + cout<< "End checking voids against solids \n" << endl; + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// +} + + +void McCadMcVoid_Generator::VoidVoxelization(Handle(TopTools_HSequenceOfShape)& voidSolids) +{ + +} + +//Standard_Boolean McCadMcVoid_Generator::FacesIntersect(TopoDS_Shape shp1, TopoDS_Shape shp2) +Standard_Boolean McCadMcVoid_Generator::FacesIntersect(TopoDS_Shape& shp1, TopoDS_Shape& shp2) +{ + Standard_Boolean collides(Standard_False); + TopOpeBRep_ShapeIntersector shapeIntersector; + IntTools_FaceFace ffIntersector; + + for(TopExp_Explorer faceExp1(shp1, TopAbs_FACE); faceExp1.More(); faceExp1.Next()) + { + TopoDS_Face face1 = TopoDS::Face(faceExp1.Current()); + + for(TopExp_Explorer faceExp2(shp2, TopAbs_FACE); faceExp2.More(); faceExp2.Next()) + { + TopoDS_Face face2 = TopoDS::Face(faceExp2.Current()); + + shapeIntersector.InitIntersection(face1, face2); + + if(shapeIntersector.MoreIntersection()) + { + //cout << "\n\n----------------------------------\nCollision Detected\n----------------------------------\n\n"; + if(shapeIntersector.ChangeFacesIntersector().IsEmpty()) + { + // test if faces overlapp + // voxelize faces + TopoDS_Face theFace(TopoDS::Face(face1)); + Handle(TColgp_HSequenceOfPnt) thePntSeq = new TColgp_HSequenceOfPnt(); + BRepClass_FaceClassifier bsc3d; + + BRepAdaptor_Surface BS(theFace, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; + + BRepAdaptor_Curve2d curveAdaptor; + for(TopExp_Explorer edgeExp(theFace, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) + { + curveAdaptor.Initialize(TopoDS::Edge(edgeExp.Current()), theFace); + Standard_Real frstParam, lstParam; + frstParam = (!(Precision::IsNegativeInfinite(curveAdaptor.FirstParameter()))) ? curveAdaptor.FirstParameter() : -1.0; + lstParam = (!(Precision::IsPositiveInfinite(curveAdaptor.LastParameter()))) ? curveAdaptor.LastParameter() : 1.0; + + // ignore edges + frstParam += 1.0e-5; + lstParam -= 1.0e-5; + + for (int i=1; i<=100; i++) + { + Standard_Real a = Standard_Real(i)/100.; + Standard_Real par = (1.0-a)*frstParam + a*lstParam; + gp_Pnt2d p2 = curveAdaptor.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + // exclude edges + if(U < uMean) + U += 1.e-5; + else if(U > uMean) + U -= 1.e-5; + if(V < vMean) + V += 1.e-5; + else if(V > vMean) + V -= 1.e-5; + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bsc3d.Perform(theFace, p2, myTolerance); + + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON) + thePntSeq->Append(p1); + } + + theFace = TopoDS::Face(face2); + + int cnt(0); + for(int i=1; i<=thePntSeq->Length(); i++) + { + bsc3d.Perform(theFace, thePntSeq->Value(i), 1.0e-7); + if( bsc3d.State() == TopAbs_IN ) + { + cnt++; + if(cnt >= 3) + break; + } + } + + if(cnt >= 3) // overlapp !!! + { + collides = true; + break; + } + } + } + else + { + ffIntersector.Perform(face1, face2); + + if(!ffIntersector.IsDone()) + return Standard_True; + + if(ffIntersector.Lines().Length() < 1) + return Standard_False; + + /* IntTools_SequenceOfCurves intCurves; + intCurves = ffIntersector.Lines(); + + cout << "Number of Intersection Lines : " << intCurves.Length() << endl; + + Standard_Boolean notAnEdge(Standard_False); + + for(Standard_Integer i=1; i<=intCurves.Length(); i++) + { + Standard_Boolean hitEdge(Standard_False); + IntTools_Curve curIntCurve = intCurves.Value(i); + Standard_Real first, last; + gp_Pnt pnt_f, pnt_l; + curIntCurve.Bounds(first, last, pnt_f, pnt_l); + Handle(Geom_Curve) aCurve = curIntCurve.Curve(); + + TopoDS_Edge intEdge = BRepBuilderAPI_MakeEdge(aCurve, pnt_f, pnt_l).Edge(); + + for(TopExp_Explorer edgeExp1(face1, TopAbs_EDGE); edgeExp1.More(); edgeExp1.Next()) + { + if(TopoDS::Edge(edgeExp1.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(hitEdge) + { + cout << "HIT EDGE\n"; + continue; + } + + for(TopExp_Explorer edgeExp2(face2, TopAbs_EDGE); edgeExp2.More(); edgeExp2.Next()) + { + if(TopoDS::Edge(edgeExp2.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(hitEdge) + { + cout << "HIT EDGE\n"; + return Standard_False; + } + } + + + cout << "TRUE THE HARD WAY\n\n";*/ + + collides = true; + break; + } + } + } + + if(collides) + break; + } + + + + + /* + Handle(TColgp_HSequenceOfPnt) solidVoxelPoints = solidDS.GetVoxel(); + Handle(TColgp_HSequenceOfPnt) voidVoxelPoints = voidDS.GetVoxel(); + + // without forward check goes here!!!! Wed Nov 16 17:20:27 CET 2005 + /////////////////////////////////////////////////////////////////////// + // forward check + BRepClass3d_SolidClassifier solidClassifier (solidDS.GetSolid()); + BRepClass3d_SolidClassifier voidClassifier (voidDS.GetSolid()); + + for(Standard_Integer i=1; i<=solidVoxelPoints->Length(); i++) + { + voidClassifier.Perform(solidVoxelPoints->Value(i), 1.0e-7); + if(voidClassifier.State() == TopAbs_IN) + return Standard_True; + } + + for(Standard_Integer i=1; i<=voidVoxelPoints->Length(); i++) + { + solidClassifier.Perform(voidVoxelPoints->Value(i), 1.0e-7); + if(solidClassifier.State() == TopAbs_IN) + return Standard_True; + } + + return Standard_False;*/ + + /////////////////////////////////////////////////////////////////////////////////////////////// + + + +/* Handle(TColgp_HSequenceOfPnt) seamPointsOfSolid1 = new TColgp_HSequenceOfPnt(); + Handle(TColgp_HSequenceOfPnt) seamPointsOfSolid2 = new TColgp_HSequenceOfPnt(); + + BRepClass_FaceClassifier bfc3d; + + BRepAdaptor_Curve2d curveAdaptor; + + for(TopExp_Explorer faceExp1(shp1, TopAbs_FACE); faceExp1.More(); faceExp1.Next()) + { + TopoDS_Face face1 = TopoDS::Face(faceExp1.Current()); + BRepAdaptor_Surface BS(face1, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + Standard_Real uMin, uMax, vMin, vMax, uMean, vMean; + uMin = theASurface.FirstUParameter(); + uMax = theASurface.LastUParameter(); + vMin = theASurface.FirstVParameter(); + vMax = theASurface.LastVParameter(); + uMean = (uMin + uMax)/2.0; + vMean = (vMin + vMax)/2.0; + + for(TopExp_Explorer edgeExp(face1, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) + { + curveAdaptor.Initialize(TopoDS::Edge(edgeExp.Current()), face1); + Standard_Real frstParam, lstParam; + frstParam = (!(Precision::IsNegativeInfinite(curveAdaptor.FirstParameter()))) ? curveAdaptor.FirstParameter() : -1.0; + lstParam = (!(Precision::IsPositiveInfinite(curveAdaptor.LastParameter()))) ? curveAdaptor.LastParameter() : 1.0; + + // ignore edges + // frstParam += 1.0e-5; + // lstParam -= 1.0e-5; + + for (int i=1; i<=100; i++) + { + Standard_Real a = Standard_Real(i)/100.; + Standard_Real par = (1.0-a)*frstParam + a*lstParam; + gp_Pnt2d p2 = curveAdaptor.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + // exclude edges + if(U < uMean) + U += 1.e-5; + else if(U > uMean) + U -= 1.e-5; + if(V < vMean) + V += 1.e-5; + else if(V > vMean) + V -= 1.e-5; + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bfc3d.Perform(face1, p2, myTolerance); + + if (bfc3d.State() == TopAbs_IN || bfc3d.State() == TopAbs_ON) + seamPointsOfSolid1->Append(p1); + } + } + + for(TopExp_Explorer faceExp2(shp2, TopAbs_FACE); faceExp2.More(); faceExp2.Next()) + { + TopoDS_Face face2 = TopoDS::Face(faceExp2.Current()); + BRepAdaptor_Surface BS(face2, Standard_True); + GeomAdaptor_Surface theASurface = BS.Surface(); + + Handle(TColgp_HSequenceOfPnt) seamVoxelPntsOfFace2 = new TColgp_HSequenceOfPnt(); + + for(TopExp_Explorer edgeExp(face1, TopAbs_EDGE); edgeExp.More(); edgeExp.Next()) + { + curveAdaptor.Initialize(TopoDS::Edge(edgeExp.Current()), face2); + Standard_Real frstParam, lstParam; + frstParam = (!(Precision::IsNegativeInfinite(curveAdaptor.FirstParameter()))) ? curveAdaptor.FirstParameter() : -1.0; + lstParam = (!(Precision::IsPositiveInfinite(curveAdaptor.LastParameter()))) ? curveAdaptor.LastParameter() : 1.0; + + // ignore edges + // frstParam += 1.0e-5; + // lstParam -= 1.0e-5; + + for (int i=1; i<=100; i++) + { + Standard_Real a = Standard_Real(i)/100.; + Standard_Real par = (1.0-a)*frstParam + a*lstParam; + gp_Pnt2d p2 = curveAdaptor.Value(par); + Standard_Real U = p2.X(); + Standard_Real V = p2.Y(); + + // exclude edges + if(U < uMean) + U += 1.e-5; + else if(U > uMean) + U -= 1.e-5; + if(V < vMean) + V += 1.e-5; + else if(V > vMean) + V -= 1.e-5; + + gp_Pnt p1; + theASurface.D0(U, V, p1); + + bfc3d.Perform(face2, p2, myTolerance); + + if (bfc3d.State() == TopAbs_IN || bfc3d.State() == TopAbs_ON) + seamPointsOfSolid2->Append(p1); + } + } + } + } + + + // classify seam points + BRepClass3d_SolidClassifier solidClassifier; + solidClassifier.Load(shp2); + + for(Standard_Integer i=1; i<=seamPointsOfSolid1->Length(); i++) + { + solidClassifier.Perform(seamPointsOfSolid1->Value(i), 1.e-6); + + if(solidClassifier.State() == TopAbs_IN) + return Standard_True; + } + + solidClassifier.Load(shp1); + + for(Standard_Integer i=1; i<=seamPointsOfSolid2->Length(); i++) + { + if(solidClassifier.State() == TopAbs_IN) + return Standard_True; + } +*/ + + +/* ffIntersector.Perform(face1, face2); + + if(!ffIntersector.IsDone()) // something went wrong + return Standard_True; + + + if(ffIntersector.Lines().Length() > 0) + { + + IntTools_SequenceOfCurves intCurves; + intCurves = ffIntersector.Lines(); + + cout << "Number of Intersection Lines : " << intCurves.Length() << endl; + + Standard_Boolean notAnEdge(Standard_False); + + for(Standard_Integer i=1; i<=intCurves.Length(); i++) + { + Standard_Boolean hitEdge(Standard_False); + IntTools_Curve curIntCurve = intCurves.Value(i); + Standard_Real first, last; + gp_Pnt pnt_f, pnt_l; + curIntCurve.Bounds(first, last, pnt_f, pnt_l); + Handle(Geom_Curve) aCurve = curIntCurve.Curve(); + + TopoDS_Edge intEdge = BRepBuilderAPI_MakeEdge(aCurve, pnt_f, pnt_l).Edge(); + + STEPControl_Writer wrt; + wrt.Transfer(intEdge, STEPControl_AsIs); + wrt.Transfer(face1, STEPControl_AsIs); + wrt.Transfer(face2, STEPControl_AsIs); + wrt.Transfer(shp1, STEPControl_AsIs); + wrt.Transfer(shp2, STEPControl_AsIs); + wrt.Write("collision.stp"); + exit(-1); + + for(TopExp_Explorer edgeExp1(face1, TopAbs_EDGE); edgeExp1.More(); edgeExp1.Next()) + { + if(TopoDS::Edge(edgeExp1.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(hitEdge) + { + cout << "HIT EDGE\n"; + continue; + } + + for(TopExp_Explorer edgeExp2(face2, TopAbs_EDGE); edgeExp2.More(); edgeExp2.Next()) + { + if(TopoDS::Edge(edgeExp2.Current()).IsSame(intEdge)) + { + hitEdge = Standard_True; + break; + } + } + + if(!hitEdge) + { + return Standard_True; + } + else + cout << "Hit Edge\n"; + } + } + else + return Standard_False; // no lines, no intersections, right? ... +*/ + + + return collides; +} + + + +////////////////////////////////////////////////////////////////// +/*+++++++++++++++++++++ GODECOMPOSE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// +Handle(TopTools_HSequenceOfShape) McCadMcVoid_Generator::GoDecompose(Handle(TopTools_HSequenceOfShape)& BoxSeq, + const Handle(McCadDiscDs_HSequenceOfDiscFace)& theVCutFace, + const Standard_Integer MaxNbVoids ) +{ + McCadMessenger_Singleton * msgr = McCadMessenger_Singleton::Instance(); + + cout << "\nPerforming Decomposition\n=========================" << endl; + myPI->SetStep(30./theVCutFace->Length()); + + Standard_Real numOfCutFaces = theVCutFace->Length(); + + +// PERFORM CUTTING FOR ALL CUT FACES +////////////////////////////////////// + for (int fit = 1; fit <= numOfCutFaces; fit++) + { + if (BoxSeq->Length() >= MaxNbVoids ) + { + // this happens if saturation is achived ahead of end of the cutseq! legitimate situation + cout << " Cut processing is finished due to reaching maximum Number of Decomposition at : " << fit << endl; + cout << " maximum Number of Decompositions: " << MaxNbVoids << endl; + break; + } + + if (BoxSeq->Length() == 0) + { + // this happens if saturation is achived ahead of end of the cutseq! legitimate situation + cout << "************************************************************************************* " << endl; + cout << " Cut Processing is finished due to saturation at cut sequence number " << fit << endl; + cout << "************************************************************************************* " << endl; + } + + cout << "." << flush; +// cout << " Start Processing Face " << fit << " of " << numOfCutFaces << endl; + + TopoDS_Shape CutFaceSolid = theVCutFace->Value(fit).GetFace(); + Bnd_Box theBB = theVCutFace->Value(fit).GetBBox(); + + Handle(TopTools_HSequenceOfShape) tmpBoxSeq = new TopTools_HSequenceOfShape(); + Handle(TopTools_HSequenceOfShape) locBoxSeq = new TopTools_HSequenceOfShape(); + + // search for sign changing cut faces + //////////////////////////////////////// + for (Standard_Integer j=1; j<= BoxSeq->Length(); j++)//For all Shapes in BoxSeq + { + TopoDS_Solid aSol = TopoDS::Solid(BoxSeq->Value(j)); + + Bnd_Box aBB; + BRepBndLib::Add(aSol,aBB); + aBB.SetGap(0.0); + if(aBB.IsOut(theBB) && theBB.IsOut(aBB)) + { + locBoxSeq->Append(aSol); + continue; + } + + //////////////////////////////////////////////////////////////////////////////// + // if identical surface as bounding surface of void -> skip cutting + /* bool isSame(false); + for(TopExp_Explorer ex(aSol, TopAbs_FACE); ex.More(); ex.Next()) + { + Handle(TopTools_HSequenceOfShape) shapes; + TopoDS_Face curFace = TopoDS::Face(ex.Current()); + + shapes->Append(curFace); + shapes->Append(CutFaceSolid); + shapes = McCadMcVoid::DeleteOne(shapes); + + if(shapes->Length() != 2) + { + locBoxSeq->Append(aSol); + isSame = true; + break; + } + } + if(isSame) + continue;*/ + +// cout << j << "<<<<<<<" << endl; +//TODO more specific testing if plane interferes with solid volume +/* BRepClass3d_SolidClassifier solidClassifier (aSol); + Standard_Integer inPnts(0), outPnts(0); + + for(TopExp_Explorer vExp(CutFaceSolid); vExp.More(); vExp.Next()) + { + TopoDS_Vertex curV = TopoDS::Vertex(vExp.Current()); + gp_Pnt curPnt = BRep_Tool::Pnt(curV); + // check for all vertices!!! + + solidClassifier.Perform(curPnt, 1.0e-7); + if(solidClassifier.State() == TopAbs_IN && solidClassifier.State() != TopAbs_ON && solidClassifier.State() != TopAbs_OUT) + inPnts++; + else + outPnts++; + } + + if(inPnts == 0) + { + locBoxSeq->Append(aSol); + cout << "CONTINUE\n"; + continue; + }*/ +//#TODO + ///////////////////////////////////////////////////////////////////// + + + // if (McCadMcVoid::SignChanging(aSol, theVCutFace->Value(fit))) + if (PolyhedralOverlap(CutFaceSolid, aSol)) + tmpBoxSeq->Append(aSol); + else + locBoxSeq->Append(aSol); + } + + BoxSeq->Clear(); + BoxSeq->Append(locBoxSeq); + //////////////////////////////////////////////////////////////////////////////////////////// + + + if(tmpBoxSeq->Length() == 0) + { +// cout << " End Processing face " << fit << "\n" << endl; + continue; + } + + + // CALL DECOMPOSE + ////////////////////////////////////////// + Handle(TopTools_HSequenceOfShape) uniBoxSeq = Decompose(tmpBoxSeq,CutFaceSolid); //cut tmpBoxSeq, along CutFaceSolid and return resulting solid + + //check again if cutted model is valid, append valid boxes to BoxSeq + /////////////////////////////////////////////////////////////////////////////////////////////// + for(int k=1; k<=uniBoxSeq->Length(); k++) + { + TopoDS_Shape aSol = uniBoxSeq->Value(k); + for (TopExp_Explorer exs(aSol,TopAbs_SHELL);exs.More();exs.Next()) + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + ////////////////////////////////////////////////////////////////////////// + BRepCheck_Shell shellCheck(sh); + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) + { + BRepBuilderAPI_MakeSolid Bu(sh); + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + if(!aSolid.IsNull()) + BoxSeq->Append(aSolid); + } + } + else + msgr->Message("Model may be invalid!! ", + McCadMessenger_WarningMsg); + } + } + +// cout << " End Processing face " << fit << "\n" << endl; + + if(myPI->UserBreak()) + return NULL; + myPI->Increment(); + } + cout << "\n=========================\nDecomposition finished\n" << endl; + + return BoxSeq; +} + + +////////////////////////////////////////////////////////////////// +/*+++++++++++++++++++++++ DECOMPOSE ++++++++++++++++++++++++++*/ +////////////////////////////////////////////////////////////////// + +Handle(TopTools_HSequenceOfShape) McCadMcVoid_Generator::Decompose(Handle(TopTools_HSequenceOfShape)& tmpBoxSeq, TopoDS_Shape& aFaceSolid) +{ + // the heart of void the generation algorithm!! + // keep it simple and robust; it should work thousandfold !! + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + + Handle(TopTools_HSequenceOfShape) uniBoxSeq = new TopTools_HSequenceOfShape(); + + // redefine MakeHalfSpace, to make pseudo Half-Space with suitable size. Define bounding values by boxes to cut... + // this increases the chance of validity of boolean operations and reduces computation time during + // boolean operations, which are known to work slowly. + Bnd_Box tmpBox; + for(int cnt=1; cnt<=tmpBoxSeq->Length(); cnt++) + BRepBndLib::Add(tmpBoxSeq->Value(cnt), tmpBox); + + tmpBox.SetGap(10.); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + tmpBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + gp_Pnt theUPnt = gp_Pnt(aXmax, aYmax, aZmax); + gp_Pnt theLPnt = gp_Pnt(aXmin, aYmin, aZmin); + + TopoDS_Shape tmpS1; + TopoDS_Shape polSol1; + + TopoDS_Shape oldSol1 = McCadMcVoid::MakeHalfSpace(aFaceSolid, theLPnt, theUPnt); //half space created by theVFace-member (aFaceSolid) + +//////////////////////////////////////////////////////////////// +// process all solids in the void box sequence + for (int kt=1; kt<=tmpBoxSeq->Length(); kt++) + { + polSol1 = tmpBoxSeq->Value(kt); //polSol1 + + Standard_Boolean bOp = Standard_False; + Standard_Boolean small = Standard_False; + + /////////////////////////////////////////////////////////////// + // discard small volumes from cutting + GProp_GProps GP1; + BRepGProp::VolumeProperties(polSol1,GP1); + + if (GP1.Mass() < myMinVolume) + { + // cout << "Small Box Cutting discarded .... " << kt << endl; + uniBoxSeq->Append(polSol1); + continue; + } + + +/////////////////////////////////////////////////////////////// +// Compute Common part + + TopoDS_Shape bopShp1 = polSol1; + TopoDS_Shape bopShp2 = oldSol1; + + // This will speed up the boolean operations!!! + /*qiu BOPTools_DSFiller aDF; + aDF.SetShapes (bopShp1, bopShp2); + if(!aDF.IsDone()) + { + cout << "_#_McCadMcVoid_Generator.cxx :: ERROR!!! Could not init DSFiller!!!\n"; + uniBoxSeq->Append(polSol1); + continue; + } + + try + { + aDF.Perform(); + } + catch(...) + { + uniBoxSeq->Append(polSol1); + continue; + } +*/ + ////// + // perform boolean common operation + try + { + //qiu BRepAlgoAPI_Common aCommonOp(bopShp1, bopShp2, aDF); + BRepAlgoAPI_Common aCommonOp(bopShp1, bopShp2); + if(aCommonOp.BuilderCanWork() && aCommonOp.ErrorStatus() == 0 ) + { + if(aCommonOp.IsDone()) + { + bOp = Standard_True; + tmpS1 = aCommonOp.Shape(); //tmpS1 now is the common shape of half space oldSol and tmpBoxSeq(kt) + } + else + { + bOp = Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Boolean Operation on a halfspace has failed !!!", + McCadMessenger_WarningMsg); + } + } + else + bOp = Standard_False; + + } + catch(...) + { + bOp = Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Boolean Operation on a halfspace has failed (OCC Input?) !!!", + McCadMessenger_WarningMsg); + } + + + if(!bOp) + { + uniBoxSeq->Append(polSol1); + continue; + } + + /////////////////////////////////////////////////////////////////////////////////// + // Test for validity of Common Operation + if (tmpS1.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Null solid computed !!! ", + McCadMessenger_WarningMsg); + bOp = Standard_False; + + cout << "Cutting discarded .... " << kt << endl; + uniBoxSeq->Append(polSol1); + continue; + } + + if(!bOp) + { + uniBoxSeq->Append(polSol1); + continue; + } + + // Test for valid solids in computed shape + TopoDS_Shape& aShape = tmpS1; + BRepCheck_Analyzer BA(aShape,Standard_False); + + BA.Init(aShape,Standard_False); + if(!BA.IsValid()) + { + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for solid failed !!", + McCadMessenger_WarningMsg); + uniBoxSeq->Append(polSol1); + continue; + } + } + + int sCount=0; + + for (TopExp_Explorer ex(aShape,TopAbs_SOLID);ex.More();ex.Next()) //For all Solids in Common Shape check for validity + { + sCount++; + const TopoDS_Solid& solid = TopoDS::Solid(ex.Current()); + + if(solid.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BOP for solid failed: NULL SOLID computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + + for (TopExp_Explorer exs(solid,TopAbs_SHELL);exs.More();exs.Next()) //For all Shells in current Solid check if orientable + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + BA.Init(sh,Standard_False); + Handle(BRepCheck_Result) RES = BA.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + // BRepCheck::Print(iter.Value(),cout); + if( iter.Value() == BRepCheck_UnorientableShape) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for shell failed: unorientable shape!!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + + if(!BA.IsValid()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for shell failed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + } + + if(sCount!=1) // we take only one solid + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Compound containing no solid computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + + + if(!bOp) + { + uniBoxSeq->Append(polSol1); + continue; + } + + //////////////////////////////////////////////// + // See if Shell is closed + Standard_Real theVol(0.0); + if (bOp) + { + for (TopExp_Explorer exs(aShape,TopAbs_SHELL);exs.More();exs.Next()) //For all Shells of aShape ... + { + TopoDS_Shell tmpShell = TopoDS::Shell(exs.Current()); + ////////////////////////////////////////////////////////////////////////// + BRepCheck_Shell shellCheck(tmpShell); + if (shellCheck.Closed(Standard_False) == BRepCheck_NoError) // check if Shell is closed + { + BRepBuilderAPI_MakeSolid Bu(tmpShell); //Build a Solid + if(Bu.IsDone()) + { + TopoDS_Solid aSolid = Bu.Solid(); + + if(!aSolid.IsNull()) + { + //reject to thin solids + Bnd_Box theBB; + BRepBndLib::Add(aSolid, theBB); + if(theBB.IsXThin(0.5) || theBB.IsYThin(0.5) || theBB.IsZThin(0.5)) + { + small = Standard_True; + + cout << "IS THIN\n"; + break; + } + + GProp_GProps GP2; + // BRepGProp::VolumeProperties(polSol1,GP1); + BRepGProp::VolumeProperties(aSolid,GP2); + + // cout << "MYMINVOLUME : " << myMinVolume << " -- GP1.Mass() : " << GP1.Mass() << " -- GP2.Mass() : " << GP2.Mass() << endl; + + if (GP2.Mass() >= myMinVolume) // > resolution ^3 + uniBoxSeq->Append(aSolid); // big volume case + else + { + theVol = GP2.Mass(); + cout << "Cutting discarded .... small volume " << kt << endl; + cout << "Volume-Fraction : " << GP2.Mass()/GP1.Mass() << endl; + small = Standard_True; + break; + } + } + } + } + else + { + //try to repair open shell + if (shellCheck.Closed(Standard_False) == BRepCheck_NotClosed) + { + ShapeUpgrade_ShellSewing tailor; + TopoDS_Shape resultShp = tailor.ApplySewing(tmpShell, 1e-7); + + for (TopExp_Explorer shellExpl(resultShp, TopAbs_SHELL); shellExpl.More(); shellExpl.Next()) //For all Shells of aShape ... + { + TopoDS_Shell tmpShll = TopoDS::Shell(shellExpl.Current()); + BRepCheck_Shell shellCheck1(tmpShll); + if (shellCheck1.Closed(Standard_False) == BRepCheck_NoError) // check if Shell is closed + { + BRepBuilderAPI_MakeSolid sldMkr(tmpShll); + if(sldMkr.IsDone()) + uniBoxSeq->Append(sldMkr.Solid()); + else + { + cout << "* Warning: SubModel may be invalid!* " << endl; + uniBoxSeq->Append(polSol1); + continue; + } + } + else + { + cout << "* Warning: SubModel may be invalid!* " << endl; + uniBoxSeq->Append(polSol1); + continue; + } + } + } + else + { + cout << "************************************ " << endl; + cout << "* Warning: SubModel may be invalid!* " << endl; + cout << "************************************ " << endl; + + uniBoxSeq->Append(polSol1); + continue; + } //tst + } + } + } + else + { + cout << "Cutting discarded .... " << kt << endl; + uniBoxSeq->Append(polSol1); + continue; + } + + + if(small || uniBoxSeq->Length() < 1) + { + uniBoxSeq->Append(polSol1); + cout << "Putting back .... small volume " << kt << " ### Volume : " << theVol << endl; + continue; + } + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +// compute the cut part + bOp = Standard_False; + + // CUTMASTER: + try //Perform Cutting + { +//qiu BRepAlgoAPI_Cut aCutOp(bopShp1,bopShp2, aDF); + BRepAlgoAPI_Cut aCutOp(bopShp1,bopShp2); + + if(aCutOp.BuilderCanWork() && aCutOp.ErrorStatus() == 0 ) + { + Standard_Boolean done = Standard_False; + + try + { + done = aCutOp.IsDone(); + } + catch(...) + { + continue; + } + + if(done) + { + bOp= Standard_True; + tmpS1 = aCutOp.Shape(); + } + else + { + bOp= Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Boolean Cut Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + } + } + else + bOp = Standard_False; + } + catch(...) + { + bOp = Standard_False; + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Cut Operation on a halfspace failed !!!", + McCadMessenger_WarningMsg); + } + + if (tmpS1.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Null solid computed !!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + + TopoDS_Shape& acShape = tmpS1; + + BRepCheck_Analyzer BAc(acShape,Standard_False); + + sCount=0; + + for (TopExp_Explorer ex(acShape,TopAbs_SOLID);ex.More();ex.Next()) //For all Shapes of cutted Solid... + { + sCount++; + const TopoDS_Solid& aSolo = TopoDS::Solid(ex.Current()); + if(aSolo.IsNull()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BOP for solid failed: NULL SOLID computed !!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + + for (TopExp_Explorer exs(aSolo,TopAbs_SHELL);exs.More();exs.Next()) // check Validity + { + const TopoDS_Shell& sh = TopoDS::Shell(exs.Current()); + BAc.Init(sh,Standard_False); + Handle(BRepCheck_Result) RES = BAc.Result(sh); + BRepCheck_ListOfStatus StatusList; + StatusList = RES->Status(); + BRepCheck_ListIteratorOfListOfStatus iter; + + for (iter.Initialize(StatusList); iter.More(); iter.Next()) + { + // BRepCheck::Print(iter.Value(),cout); + if( iter.Value() == BRepCheck_UnorientableShape) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer : Unorientable Shape!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + BAc.Init(sh,Standard_False); + break; + } + } + + if(BAc.IsValid()); + else + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for shell failed !!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + break; + } + } + } + + BAc.Init(acShape,Standard_False); + if(!BAc.IsValid()) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: BRepCheck_Analyzer for solid failed !!!!", + McCadMessenger_WarningMsg); + bOp = Standard_False; + } + if(sCount==0) + { + msgr->Message("_#_McCadMcVoid_Generator.cxx :: Compound contains no solids!!", + McCadMessenger_WarningMsg); + /* STEPControl_Writer wrt; + wrt.Transfer(polSol1, STEPControl_AsIs); + wrt.Transfer(aFaceSolid, STEPControl_AsIs); + wrt.Write("failed.stp"); + exit(0);*/ + bOp = Standard_False; + } + //////////////////////////////////////////////// + // No Tolerance correction + if(bOp) + { + GProp_GProps GP2; + BRepGProp::VolumeProperties(acShape,GP2); + + if (GP2.Mass() >= myMinVolume) // > resolution ^3 + uniBoxSeq->Append(acShape); // big volume case + else + { + uniBoxSeq->Remove(uniBoxSeq->Length()); + uniBoxSeq->Append(polSol1); + TCollection_AsciiString msg("_#_McCadMcVoid_Generator.cxx :: Cut Processing void box number .... "); + msg += TCollection_AsciiString(kt); + msg += " .... failed."; + msgr->Message( msg.ToCString(), McCadMessenger_WarningMsg ); + } + } + else + { + // delet the common part and append the original box. + uniBoxSeq->Remove(uniBoxSeq->Length()); + uniBoxSeq->Append(polSol1); + TCollection_AsciiString msg("_#_McCadMcVoid_Generator.cxx :: Cut Processing void box number .... "); + msg += TCollection_AsciiString(kt); + msg += " .... failed."; + msgr->Message( msg.ToCString(), McCadMessenger_WarningMsg ); + } + //////////////////////////////////////////////////////////////////////////////////////////////////////////// + } + + + + return uniBoxSeq; +} + diff --git a/src/MCCAD/McCadMcVoid/McCadMcnpWriter.cxx b/src/MCCAD/McCadMcVoid/McCadMcnpWriter.cxx new file mode 100644 index 0000000..75bb6d3 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadMcnpWriter.cxx @@ -0,0 +1,708 @@ +#include "McCadMcnpWriter.hxx" + +#include + +#include +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" + +McCadMcnpWriter::McCadMcnpWriter() +{ +} + +McCadMcnpWriter::~McCadMcnpWriter() +{ +} + +/** ******************************************************************** +* @brief Print the head description of Mcnp input file. +* +* @param Standard_OStream & theStream (modify) +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadMcnpWriter::PrintHeadDesc(Standard_OStream& theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream.setf(ios::left); + theStream<<"McCad 0.4.0 generated Input "<m_SolidList.size()<m_VoidCellList.size()<m_GeomSurfList.size()<GetGeomData(); + assert(pData); + + theStream<<"c "<<"=============================== Cells Card =================================="<m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + + if (m_bHaveMaterial) + { + PrintGroupInfo(i+1,theStream); + } + + theStream.setf(ios::left); + theStream<GetID(); // Output the material number. + if(!m_bHaveMaterial) + { + theStream<GetDensity(); // Output the density. + } + + TCollection_AsciiString strCellDesc; + for(int j = 0; j < pSolid->GetConvexSolidList().size(); j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //pConvexSolid->ChangeFaceNum(*m_pManager); // Update the face number after sorting + + if ( j == 0 ) + { + strCellDesc += "("; + } + else + { + strCellDesc += ":("; + } + + strCellDesc += GetCellExpn(pConvexSolid); + strCellDesc += ")&"; + + strCellDesc.LeftAdjust(); // Trim the left and right space characters of string + strCellDesc.RightAdjust(); + } + + // Split the expression of void cell into several part according to the brackets + // and output them into different lines. + TCollection_AsciiString str_left; + TCollection_AsciiString str_right= strCellDesc; + + // If the length of expression beyond 80, then split it and print respectively. + int k = 0; + do + { + k++; + str_left = str_right; + str_right = str_left.Split(str_left.Search("&"));// & is the seperating symbol used. + str_left.Remove(str_left.Length()); + if (k == 1) + { + theStream<GetMatManager(); + assert(pMatManager); + + MaterialGroup * pGroup = pMatManager->GetGroupData(iSolid); + + if(pGroup != NULL) + { + QString groupName = pGroup->GetGroupName(); + int iMatID = pGroup->GetMaterialID(); + double fDensity = pGroup->GetDensity(); + QString materialName = pGroup->GetMaterialName(); + + int iStartNum = pGroup->GetStartNum() ; + int iEndNum = pGroup->GetEndNum(); + int iCellNum = pGroup->GetCellNum(); + + iStartNum += (m_iInitCellNum-1); + iEndNum += (m_iInitCellNum-1); + + TCollection_AsciiString group_info; + group_info = "From "; + group_info += TCollection_AsciiString(iStartNum); + group_info += " to "; + group_info += TCollection_AsciiString(iEndNum); + group_info += " , "; + group_info += TCollection_AsciiString(iCellNum); + group_info += " cells"; + int iLength = group_info.Length()%49; + + theStream<<"c "<GetGeomData(); + assert(pData); + + // Print the title of void cells geometry description. + TCollection_AsciiString void_info; + void_info = TCollection_AsciiString(int(pData->m_VoidCellList.size() + 1)) + " Cells"; + int iLength = void_info.Length()%50; + + theStream<<"c "<m_SolidList.size() + m_iInitCellNum; + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = pData->m_VoidCellList.at(i); + assert(pVoid); + + //pVoid->ChangeFaceNum(*m_pManager); // Update the surface number after sorting the surface list. + + theStream.setf(ios::left); + theStream<m_pOutVoid); + //pData->m_pOutVoid->ChangeFaceNum(*m_pManager); // Update the face number. + + theStream.setf(ios::left); + theStream<m_pOutVoid->GetOutVoidExpression()<GetGeomData(); + assert(pData); + + theStream<::iterator iterPos; + for (iterPos = pData->m_GeomSurfList.begin(); iterPos != pData->m_GeomSurfList.end(); ++iterPos) + { + IGeomFace * pFace = * iterPos; + assert(pFace); + theStream.setf(ios::left); + theStream<GetTransfNum(); // Transform card number + theStream<GetSurfSymb(); // The symbol of surface type + + // Output the each parameter of surface + theStream.setf(ios::fixed); + theStream<GetPrmtList()).size(); i++ ) + { + if ( i%4 == 0 && i != 0 ) + { + theStream<GetPrmtList().at(i)<<" "; + } + theStream<GetGeomData(); + assert(pData); + + vector::iterator iter; + for (iter = pData->m_TransfCardList.begin(); iter != pData->m_TransfCardList.end(); ++iter) + { + McCadTransfCard * pTrCard = * iter; + assert(pTrCard); + + theStream<<"TR"<GetTrNum(); + + theStream.unsetf(ios::fixed); + for (Standard_Integer i = 0; i < (pTrCard->GetPrmtList()).size(); i++ ) + { + if ( i%4 == 0 && i != 0 ) + { + theStream<GetPrmtList()).at(i); + } + theStream<GetMatManager(); + assert(pMatManager); + + Material * pMat = NULL; + vector material_list = pMatManager->GetMatList(); + + for(int i = 0; i < material_list.size(); i++) + { + pMat = material_list.at(i); + + theStream<<"c "<GetMatID()<<"|"<GetMatName().toStdString()<<"|"<GetMatDensity()<<"|"<GetMatCard(); + QStringList list; + list = strMatCard.split("\n"); + + bool bPrintMatID = false; // The material id has been printed or not + + for (int j = 0; j < list.size(); j++) + { + QString str = list.at(j).trimmed(); + if (str.startsWith("c ")||(str == "c") + ||str.startsWith("C ")||(str == "C")) + { + theStream<GetMatID()<GetFaces()).size(); i++) + { + + McCadExtFace * pExtFace = (pSolid->GetFaces()).at(i); + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + iStrLength += TCollection_AsciiString(iFaceNum).Length(); + + /***************** the length of cell expression can not be larger than 80 *******/ + /***************** & is used for splitting the expression ************************/ + if (iStrLength >= 80) + { + szExpression += "&"; + iStrLength = 20 + TCollection_AsciiString(iFaceNum).Length(); + } + else + { + szExpression += " "; + iStrLength ++; + } + /**********************************************************************************/ + + szExpression += TCollection_AsciiString(iFaceNum); + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + if (pAuxFace->GetAttri() == 1) + { + szAuxFaceUni += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceUni += ":"; + } + else + { + szAuxFaceSub += TCollection_AsciiString(iAuxFaceNum); + szAuxFaceSub += " "; + } + } + } + } + + szExpression += " "; + + if (!szAuxFaceSub.IsEmpty()) + { + szAuxFaceSub.Remove(szAuxFaceSub.Length()); + + // Avoid the length of expression beyond 80 + iStrLength += szAuxFaceSub.Length(); + if (iStrLength >= 80) + { + szExpression += "&"; + iStrLength = 20; + } + + szExpression += szAuxFaceSub; + szExpression += " "; + } + + if (!szAuxFaceUni.IsEmpty()) + { + szAuxFaceUni.Remove(szAuxFaceUni.Length()); + + // Avoid the length of expression beyond 80 + iStrLength += szAuxFaceUni.Length(); + if (iStrLength >= 80) + { + szExpression += "&"; + iStrLength = 20; + } + + if (szAuxFaceUni.Search(":") != -1 ) + { + szExpression += "("; + szExpression += szAuxFaceUni; + szExpression += ") "; + } + else + { + szExpression += szAuxFaceUni; + } + } + + szExpression.LeftAdjust(); + szExpression.RightAdjust(); + + return szExpression; +} + + + + + + +/** ******************************************************************** +* @brief Get the void spaces description +* +* @param +* @return TCollection_AsciiString +* +* @date 16/12/2013 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadMcnpWriter::GetVoidExpn(McCadVoidCell *& pVoidCell) +{ + TCollection_AsciiString szExpn; + szExpn += "("; + int iInitSurfNum = m_iInitFaceNum - 1; + for (Standard_Integer i = 0; i < (pVoidCell->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pVoidCell->GetFaces()).at(i); + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + szExpn += TCollection_AsciiString(iFaceNum); + szExpn += " "; + } + szExpn.Remove(szExpn.Length()); // Remove the last character " " + szExpn += ")"; + szExpn += "&"; + + int iStrLength; //initial string for describing the cell no and material + + for (Standard_Integer i = 0; i < (pVoidCell->GetCollision()).size(); i++) + { + COLLISION collision = (pVoidCell->GetCollision()).at(i); + iStrLength = 12; //initial string for describing the cell no and material + szExpn += "("; + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + int iCollidFaceNum = collision.FaceList.at(j); + iCollidFaceNum > 0 ? iCollidFaceNum += iInitSurfNum : iCollidFaceNum -= iInitSurfNum; + + int iNum = -1*(iCollidFaceNum); + + /**************** Avoid the length of expression beyond 80 column ***********/ + iStrLength += TCollection_AsciiString(iNum).Length(); // Add the length of number + iStrLength += 1; // Add the length of ":" + if (iStrLength >= 79) + { + szExpn += "&"; + iStrLength = 11 + TCollection_AsciiString(iNum).Length(); + } + /****************************************************************************/ + + szExpn += TCollection_AsciiString(iNum); + szExpn += ":"; + } + + for (Standard_Integer k = 0; k < (collision.AuxFaceList).size(); k++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(k); + if ( auxiliary_face_list.size() > 1) + { + szExpn += "("; + } + + for (Standard_Integer iAux = 0; iAux < auxiliary_face_list.size(); iAux++) + { + int iAuxFaceNum = auxiliary_face_list.at(iAux); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + int iNum = -1*(iAuxFaceNum); + + /**************** Avoid the length of expression beyond 80 column ***********/ + iStrLength += TCollection_AsciiString(iNum).Length(); + iStrLength += 1; + if (iStrLength >= 79) + { + szExpn += "&"; + iStrLength = 11 + TCollection_AsciiString(iNum).Length(); + } + /****************************************************************************/ + + szExpn += TCollection_AsciiString(iNum); + szExpn += " "; + } + + szExpn.Remove(szExpn.Length()); // Remove the last character + if (auxiliary_face_list.size() > 1) + { + szExpn += ")"; + } + szExpn += ":"; + } + + szExpn.Remove(szExpn.Length()); // Remove the last character ":" + szExpn += ")"; + szExpn += "&"; + } + return szExpn; +} + + + diff --git a/src/MCCAD/McCadMcVoid/McCadMcnpWriter.hxx b/src/MCCAD/McCadMcVoid/McCadMcnpWriter.hxx new file mode 100644 index 0000000..41560b8 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadMcnpWriter.hxx @@ -0,0 +1,47 @@ +#ifndef MCCADMCNPWRITER_HXX +#define MCCADMCNPWRITER_HXX + +#include "IMcCadWriter.hxx" + +class McCadMcnpWriter : public IMcCadWriter +{ + +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + +Standard_EXPORT McCadMcnpWriter(); +Standard_EXPORT McCadMcnpWriter(Standard_Boolean bMat, Standard_Boolean bVoid); +Standard_EXPORT ~McCadMcnpWriter(); + +public: + /** Print the output file, include head information, cell, void, surface, transform card */ +Standard_EXPORT void PrintFile(); /**< Print the file */ + +Standard_EXPORT void PrintHeadDesc(Standard_OStream& theStream); /**< Print the head */ +Standard_EXPORT void PrintCellDesc(Standard_OStream& theStream); /**< Print the cell card */ +Standard_EXPORT void PrintVoidDesc(Standard_OStream& theStream); /**< Print the void card */ +Standard_EXPORT void PrintSurfDesc(Standard_OStream& theStream); /**< Print the surfaces list */ +Standard_EXPORT void PrintTrsfDesc(Standard_OStream& theStream); /**< Print the transform card */ +Standard_EXPORT void PrintMatCard(Standard_OStream& theStream); /**< Print the material card */ +//qiu not implement void PrintVolumeCard(Standard_OStream& theStream); /**< Print the volume card */ + + /** Print the group information, including material name, group name, material id and density */ +Standard_EXPORT virtual void PrintGroupInfo(const int iSolid, Standard_OStream& theStream); + +Standard_EXPORT TCollection_AsciiString GetCellExpn(McCadConvexSolid *& pSolid); +Standard_EXPORT TCollection_AsciiString GetVoidExpn(McCadVoidCell *& pVoidCell); +}; + +#endif // MCCADMCNPWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadSolid.cxx b/src/MCCAD/McCadMcVoid/McCadSolid.cxx new file mode 100644 index 0000000..cca7f65 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadSolid.cxx @@ -0,0 +1,77 @@ +#include "McCadSolid.hxx" +#include + +McCadSolid::McCadSolid() +{ + m_id = 0; + m_density = 0; +} + +McCadSolid::~McCadSolid() +{ +} + + +/** ******************************************************************** +* @brief Add convex solids into convex solid list. A solid is consist of +* many convex solids commonly. +* +* @param McCadConvexSolid *pConvexSolid +* @return void +* +* @date 2/4/2013 +* @author Lei Lu +***********************************************************************/ +void McCadSolid::AddConvexSolid(McCadConvexSolid *& pConvexSolid) +{ + m_ConvexSolidList.push_back(pConvexSolid); +} + + + +/** ******************************************************************** +* @brief Get a convex solid list of a solid +* +* @param +* @return vector +* +* @date 2/4/2013 +* @author Lei Lu +***********************************************************************/ +vector McCadSolid::GetConvexSolidList() +{ + return m_ConvexSolidList; +} + + + +/** ******************************************************************** +* @brief Set Material Id and Density +* +* @param double fDensity +* @return void +* +* @date 05/11/2013 +* @author Lei Lu +***********************************************************************/ +void McCadSolid::SetMaterial(int theID, double theDensity) +{ + m_id = theID; + m_density = theDensity; +} + + + +/** ******************************************************************** +* @brief Set Material Name +* +* @param TCollection_AsciiString theMatName +* @return void +* +* @date 05/11/2013 +* @author Lei Lu +***********************************************************************/ +void McCadSolid::SetName(TCollection_AsciiString theMatName) +{ + m_name = theMatName; +} diff --git a/src/MCCAD/McCadMcVoid/McCadSolid.hxx b/src/MCCAD/McCadMcVoid/McCadSolid.hxx new file mode 100644 index 0000000..bba27b5 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadSolid.hxx @@ -0,0 +1,49 @@ +#ifndef MCCADSOLID_HXX +#define MCCADSOLID_HXX + +#include +#include "McCadConvexSolid.hxx" + +class McCadSolid +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +Standard_EXPORT McCadSolid(); +Standard_EXPORT ~McCadSolid(); + +private: + + vector m_ConvexSolidList; /**< Convex solid list */ + Standard_Integer m_id; + Standard_Real m_density; + TCollection_AsciiString m_name; + +public: + +Standard_EXPORT void AddConvexSolid(McCadConvexSolid *& pConvexSolid); /**< Set convex solid list */ +Standard_EXPORT vector GetConvexSolidList(); /**< Get convex solid list */ + +Standard_EXPORT void SetMaterial(int theID, double theDensity); +Standard_EXPORT Standard_Integer GetID(){return m_id;}; +Standard_EXPORT Standard_Real GetDensity(){return m_density;}; +Standard_EXPORT void SetName(TCollection_AsciiString theName); +Standard_EXPORT TCollection_AsciiString GetName(){return m_name;}; + +Standard_EXPORT vector GetTripoliCellList(); + +}; + +#endif // MCCADSOLID_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadTransfCard.cxx b/src/MCCAD/McCadMcVoid/McCadTransfCard.cxx new file mode 100644 index 0000000..6365d2b --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadTransfCard.cxx @@ -0,0 +1,69 @@ +#include "McCadTransfCard.hxx" + +McCadTransfCard::McCadTransfCard() +{ +} + + +McCadTransfCard::McCadTransfCard(gp_Ax3 theAxis,gp_Pnt theApex) +{ + gp_Trsf theTrsf; + gp_Ax3 stdAxis; + theTrsf.SetTransformation(theAxis, stdAxis); + gp_XYZ vector = theTrsf.TranslationPart(); + + if(Abs(theApex.X()) < 1.0e-7) + { + vector.SetX(0.0); + } + if(Abs(theApex.Y()) < 1.0e-7) + { + vector.SetY(0.0); + } + if(Abs(theApex.Z()) < 1.0e-7) + { + vector.SetZ(0.0); + } + m_PrmtList.push_back(theApex.X()); + m_PrmtList.push_back(theApex.Y()); + m_PrmtList.push_back(theApex.Z()); + + gp_Mat matrix = theTrsf.HVectorialPart(); + + for (int i = 1; i <= 3; i++) + { + gp_XYZ vec = matrix.Column(i); + if(Abs(vec.X()) < 1.e-10) + { + vec.SetX(0.0); + } + if(Abs(vec.Y()) < 1.e-10) + { + vec.SetY(0.0); + } + if(Abs(vec.Z()) < 1.e-10) + { + vec.SetZ(0.0); + } + + m_PrmtList.push_back(vec.X()); + m_PrmtList.push_back(vec.Y()); + m_PrmtList.push_back(vec.Z()); + } + +} + +void McCadTransfCard::SetTrNum(Standard_Integer iNum) +{ + m_iTrNum = iNum; +} + +Standard_Integer McCadTransfCard::GetTrNum() +{ + return m_iTrNum; +} + +vector McCadTransfCard::GetPrmtList() +{ + return m_PrmtList; +} diff --git a/src/MCCAD/McCadMcVoid/McCadTransfCard.hxx b/src/MCCAD/McCadMcVoid/McCadTransfCard.hxx new file mode 100644 index 0000000..7076b60 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadTransfCard.hxx @@ -0,0 +1,43 @@ +#ifndef MCCADTRANSFCARD_HXX +#define MCCADTRANSFCARD_HXX + +#include +#include +#include + +using namespace::std; + +class McCadTransfCard +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadTransfCard(); + McCadTransfCard(gp_Ax3 theAxis, gp_Pnt theApex); + + vector GetPrmtList(); + TCollection_AsciiString GetSymb(); + + void SetTrNum(Standard_Integer iNum); + Standard_Integer GetTrNum(); + +private: + + Standard_Integer m_iTrNum; + vector m_PrmtList; + +}; + +#endif // MCCADTRANSFCARD_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadTripoliCell.cxx b/src/MCCAD/McCadMcVoid/McCadTripoliCell.cxx new file mode 100644 index 0000000..2123e04 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadTripoliCell.cxx @@ -0,0 +1,125 @@ +#include "McCadTripoliCell.hxx" + +McCadTripoliCell::McCadTripoliCell() +{ + + + + + +} + + +TCollection_AsciiString McCadTripoliCell::GetEqua() +{ + if (!m_Equation.IsEmpty()) + { + return m_Equation; + } + + TCollection_AsciiString strDesc = "EQUA "; + + int iNumPlusFace = plus_list.size(); + int iNumMinusFace = minus_list.size(); + + for(int i = 0; i < iNumPlusFace; i++) + { + if (i == 0) + { + strDesc += "PLUS "; + strDesc += TCollection_AsciiString(iNumPlusFace); + strDesc += " "; + } + strDesc += TCollection_AsciiString(plus_list.at(i)); + strDesc += " "; + } + + for(int i = 0; i < iNumMinusFace; i++) + { + if (i == 0) + { + strDesc += "MINUS "; + strDesc += TCollection_AsciiString(iNumMinusFace); + strDesc += " "; + } + strDesc += TCollection_AsciiString(abs(minus_list.at(i))); + strDesc += " "; + } + + strDesc.LeftAdjust(); // Trim the left and right space characters of string + strDesc.RightAdjust(); + return strDesc; +} + + + +void McCadTripoliCell::SetVirtual(bool isVirtual) +{ + +} + +void McCadTripoliCell::SetBoolOp(int theBoolOp) +{ + m_boolOp = theBoolOp; +} + + +void McCadTripoliCell::SetCellNum(int theCellNum) +{ + m_CellNum = theCellNum; +} + +void McCadTripoliCell::AddSurface(int theSurfNum) +{ + if(theSurfNum > 0) + { + plus_list.push_back(theSurfNum); + } + else if(theSurfNum < 0) + { + minus_list.push_back(theSurfNum); + } +} + +void McCadTripoliCell::AddCldCell(McCadTripoliCell* pCell) +{ + m_childCellList.push_back(pCell); +} + +bool McCadTripoliCell::hasVirtualCell() +{ + if(!m_childCellList.empty()) + { + return true; + } + else + { + return false; + } +} + +McCadTripoliCell * McCadTripoliCell::GetVirtualCell(int index) +{ + if(m_childCellList.empty()) + { + return NULL; + } + else + { + return m_childCellList.at(index); + } +} + +int McCadTripoliCell::GetNumVirCell() +{ + if(m_childCellList.empty()) + { + return 0; + } + else + { + return m_childCellList.size(); + } +} + + diff --git a/src/MCCAD/McCadMcVoid/McCadTripoliCell.hxx b/src/MCCAD/McCadMcVoid/McCadTripoliCell.hxx new file mode 100644 index 0000000..4ba920c --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadTripoliCell.hxx @@ -0,0 +1,40 @@ +#ifndef MCCADTRIPOLICELL_HXX +#define MCCADTRIPOLICELL_HXX + +#include +#include + +using namespace std; + +class McCadTripoliCell +{ +public: +Standard_EXPORT McCadTripoliCell(); + +private: + + bool m_IsVirtual; // is virtual cell + int m_boolOp; // boolean operations + int m_CellNum; // cell number + vector m_childCellList; // the child cells included + + vector plus_list; // the plus surfaces list + vector minus_list; // the minus surfaces list + + TCollection_AsciiString m_Equation; // the generated TRIPOLI equation + +public: +Standard_EXPORT TCollection_AsciiString GetEqua(); +Standard_EXPORT void SetVirtual(bool isVirtual); +Standard_EXPORT void SetBoolOp(int theBoolOp); +Standard_EXPORT void SetCellNum(int theCellNum); +Standard_EXPORT void AddSurface(int theSurfNum); + +Standard_EXPORT void AddCldCell(McCadTripoliCell* pCell); +Standard_EXPORT bool hasVirtualCell(); + +Standard_EXPORT McCadTripoliCell * GetVirtualCell(int index); +Standard_EXPORT int GetNumVirCell(); +}; + +#endif // MCCADTRIPOLICELL_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadTripoliWriter.cxx b/src/MCCAD/McCadMcVoid/McCadTripoliWriter.cxx new file mode 100644 index 0000000..3cedefa --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadTripoliWriter.cxx @@ -0,0 +1,948 @@ +#include "McCadTripoliWriter.hxx" + +#include + +#include +#include +#include +#include + +#include "McCadGeomCylinder.hxx" +#include "McCadGeomSphere.hxx" +#include "McCadGeomCone.hxx" +#include //qiu + +#include "../McCadTool/McCadMathTool.hxx" + +McCadTripoliWriter::McCadTripoliWriter() +{ + m_mapSymb.clear(); + m_mapSymb.insert(pair("PX","PLANEX")); + m_mapSymb.insert(pair("PY","PLANEY")); + m_mapSymb.insert(pair("PZ","PLANEZ")); + m_mapSymb.insert(pair("P","PLANE")); + + m_mapSymb.insert(pair("CX","CYLX")); + m_mapSymb.insert(pair("CY","CYLY")); + m_mapSymb.insert(pair("CZ","CYLZ")); + m_mapSymb.insert(pair("C/X","CYLX")); + m_mapSymb.insert(pair("C/Y","CYLY")); + m_mapSymb.insert(pair("C/Z","CYLZ")); + + m_mapSymb.insert(pair("KX","CONEX")); + m_mapSymb.insert(pair("KY","CONEY")); + m_mapSymb.insert(pair("KZ","CONEZ")); + m_mapSymb.insert(pair("K/X","CONEX")); + m_mapSymb.insert(pair("K/Y","CONEY")); + m_mapSymb.insert(pair("K/Z","CONEZ")); + + m_mapSymb.insert(pair("S","SPHERE")); + m_mapSymb.insert(pair("SX","SPHERE")); + m_mapSymb.insert(pair("SY","SPHERE")); + m_mapSymb.insert(pair("SZ","SPHERE")); + m_mapSymb.insert(pair("SO","SPHERE")); + + m_mapSymb.insert(pair("TX","TORUSX")); + m_mapSymb.insert(pair("TY","TORUSY")); + m_mapSymb.insert(pair("TZ","TORUSZ")); + + m_mapSymb.insert(pair("GQ","QUAD")); +} + +McCadTripoliWriter::~McCadTripoliWriter() +{ +} + + +/** ******************************************************************** +* @brief Set the initial virtual cell number +* +* @param Standard_OStream & theStream (modify) +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadTripoliWriter::SetVirtCellNum(Standard_Integer theNum) +{ + m_virtualCellNum = theNum; +} + + +/** ******************************************************************** +* @brief Print the head description of TRIPOLI input file. +* +* @param Standard_OStream & theStream (modify) +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadTripoliWriter::PrintHeadDesc(Standard_OStream& theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream.setf(ios::left); + theStream<<"GEOMETRY"<m_SolidList.size()<m_VoidCellList.size()<m_GeomSurfList.size()<GetGeomData(); + assert(pData); + Standard_Integer iCellNum = m_iInitCellNum; + + theStream.setf(ios::left); + theStream<<"/* ============================= Volume Data Definitions ========================= */"<m_SolidList).size(); i++) + { + if (m_bHaveMaterial) + { + PrintGroupInfo(i+1,theStream); + } + + McCadSolid * pSolid = (pData->m_SolidList).at(i); + vector cell_list = GenTripoliCellList(pSolid); + + vector union_list; + int iNumEpn = cell_list.size(); // The number of virtual solids + + for(int j = 0; j < iNumEpn; j++) + { + McCadTripoliCell *pCell = cell_list.at(j); + //if (pCell->hasVirtualCell()) + vector sub_list; + int iNumVirCell = pCell->GetNumVirCell(); + for (int iVirCell = 0; iVirCell < iNumVirCell; iVirCell++) + { + McCadTripoliCell *pVirCell = pCell->GetVirtualCell(iVirCell); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream< 1) + { + theStream<GetMatManager(); + assert(pMatManager); + + MaterialGroup * pGroup = pMatManager->GetGroupData(iSolid); + if(pGroup != NULL) + { + QString groupName = pGroup->GetGroupName(); + int iMatID = pGroup->GetMaterialID(); + double fDensity = pGroup->GetDensity(); + QString materialName = pGroup->GetMaterialName(); + + int iStartNum = pGroup->GetStartNum() ; + int iEndNum = pGroup->GetEndNum(); + int iCellNum = pGroup->GetCellNum(); + + iStartNum += (m_iInitCellNum-1); + iEndNum += (m_iInitCellNum-1); + + TCollection_AsciiString group_info; + group_info = "From "; + group_info += TCollection_AsciiString(iStartNum); + group_info += " to "; + group_info += TCollection_AsciiString(iEndNum); + group_info += " , "; + group_info += TCollection_AsciiString(iCellNum); + group_info += " cells"; + int iLength = group_info.Length()%49; + + theStream<<"/*"<GetGeomData(); + assert(pData); + + /** Print the head information of the void card */ + TCollection_AsciiString void_info; + void_info = TCollection_AsciiString(int((pData->m_VoidCellList).size())) + " Cells"; + int iLength = void_info.Length()%50; + + theStream<<"/*"<m_ConvexSolidList).size() + m_iInitCellNum; + for (unsigned int i = 0; i < (pData->m_VoidCellList).size(); i++) + { + McCadVoidCell * pVoid = (pData->m_VoidCellList).at(i); + assert(pVoid); + + vector complement_list; + vector cell_list = GenTripoliVoidCellList(pVoid); + + int iNumEpn = cell_list.size(); // The number of virtual solids + for(int j = 0; j < iNumEpn-1; j++) + { + McCadTripoliCell *pCell = cell_list.at(j); + if (pCell->hasVirtualCell()) + { + vector sub_list; + int iNumVirCell = pCell->GetNumVirCell(); + for (int iVirCell = 0; iVirCell < iNumVirCell; iVirCell++) + { + McCadTripoliCell *pVirCell = pCell->GetVirtualCell(iVirCell); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream< 1) + { + theStream<GetGeomData(); + assert(pData); + + McCadVoidCell * pOutVoid = pData->m_pOutVoid; + vector outer_list; + + vector cell_list; + cell_list = GenOuterSpaceList(pOutVoid); + + int iNumEpn = cell_list.size(); // The number of virtual solids + for(int iOutCell = 0; iOutCell < iNumEpn; iOutCell++) + { + McCadTripoliCell *pCell = cell_list.at(iOutCell); + theStream<GetEqua(); + theStream<GetMatManager(); + assert(pMatManager); + + Material * pMat = NULL; + vector material_list = pMatManager->GetMatList(); + + /** Print all the material included */ + theStream<<"COMPOSITION "<GetMatName(); + theStream<GetGeomData(); + assert(pData); + + map > group_list; + /** Print the material name and the solids belong to this material group */ + for (unsigned int i = 0; i < (pData->m_SolidList).size(); i++) + { + McCadSolid * pSolid = (pData->m_SolidList).at(i); + assert(pSolid); + + TCollection_AsciiString material_name = pSolid->GetName(); + + if(material_name.IsEmpty()) + { + continue; + } + + map >::iterator iter; + iter = group_list.find(material_name); + if (iter != group_list.end()) + { + iter->second.push_back(iCellNum + i); + } + else + { + vector cell_list; + cell_list.push_back(iCellNum + i); + group_list.insert(pair >(material_name,cell_list)); + } + } + + /** ****************** print the materials of void cells ************************/ + Standard_Integer iMatSolid = (pData->m_SolidList).size(); + for (unsigned int k = 0; k < (pData->m_VoidCellList).size(); k++) + { + TCollection_AsciiString material_name = "Mat_Air"; + + map >::iterator iter; + iter = group_list.find(material_name); + if (iter != group_list.end()) + { + iter->second.push_back(iCellNum + k + iMatSolid); + } + else + { + vector cell_list; + cell_list.push_back(iCellNum + k + iMatSolid); + group_list.insert(pair >(material_name,cell_list)); + } + } + + theStream<<"GEOMCOMP"< >::iterator iter; + iter = group_list.begin(); + while (iter != group_list.end()) + { + int iNum = (iter->second).size(); + TCollection_AsciiString material_name = iter->first; + theStream<second).at(i)<<" "; + } + theStream< McCadTripoliWriter::GenTripoliCellList(McCadSolid *& pSolid) +{ + vector cell_list; + int iInitSurfNum = m_iInitFaceNum - 1; + + int iConvexSolid = (pSolid->GetConvexSolidList()).size(); + for(int j = 0; j < iConvexSolid; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + + McCadTripoliCell *pTriCell = new McCadTripoliCell(); + + for (Standard_Integer i = 0; i < (pConvexSolid->GetFaces()).size(); i++) + { + vector auxface_list; // Store some auxilury surfaces which attribute is 1 + McCadExtFace * pExtFace = (pConvexSolid->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + pTriCell->AddSurface(iFaceNum); + + + if (pExtFace->HaveAuxSurf()) + { + for(Standard_Integer j = 0; j < pExtFace->GetAuxFaces().size(); j++) + { + McCadExtFace *pAuxFace = pExtFace->GetAuxFaces().at(j); + int iAuxFaceNum = pAuxFace->GetFaceNum(); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + if (pAuxFace->GetAttri() == 1) + { + auxface_list.push_back(-iAuxFaceNum); + } + else + { + pTriCell->AddSurface(iAuxFaceNum); + } + } + } + + if (auxface_list.size() != 0) + { + McCadTripoliCell *pCldCell = new McCadTripoliCell(); + for (Standard_Integer k = 0; k < auxface_list.size(); k++) + { + int iFaceNum = auxface_list.at(k); + pCldCell->AddSurface(iFaceNum); + } + pTriCell->AddCldCell(pCldCell); // Add the virtual cell consisted of auxiliary surfaces into parent cell + pTriCell->SetBoolOp(2); // Substract the virtual cell + } + auxface_list.clear(); + } + + cell_list.push_back(pTriCell); + } + + return cell_list; +} + + + + +/** ******************************************************************** +* @brief +* +* @param +* @return +* +* @date +* @author Lei Lu +***********************************************************************/ +vector McCadTripoliWriter::GenTripoliVoidCellList(McCadVoidCell *& pVoidCell) +{ + vector cell_list; + int iInitSurfNum = m_iInitFaceNum - 1; + + for (Standard_Integer i = 0; i < (pVoidCell->GetCollision()).size(); i++) + { + McCadTripoliCell *pTriCell = new McCadTripoliCell(); + COLLISION collision = (pVoidCell->GetCollision()).at(i); + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + int iCollidFaceNum = collision.FaceList.at(j); + iCollidFaceNum > 0 ? iCollidFaceNum += iInitSurfNum : iCollidFaceNum -= iInitSurfNum; + pTriCell->AddSurface(iCollidFaceNum); + } + + for (Standard_Integer j = 0; j < (collision.AuxFaceList).size(); j++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(j); + McCadTripoliCell *pCldCell = new McCadTripoliCell(); + for (Standard_Integer k = 0; k < auxiliary_face_list.size(); k++) + { + int iAuxFaceNum = auxiliary_face_list.at(k); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + pCldCell->AddSurface(-iAuxFaceNum); + } + pTriCell->AddCldCell(pCldCell); // Add the virtual cell consisted of auxiliary surfaces into parent cell + pTriCell->SetBoolOp(2); // Substract the virtual cell + } + cell_list.push_back(pTriCell); + } + + McCadTripoliCell *pBox = new McCadTripoliCell(); + for (Standard_Integer i = 0; i < (pVoidCell->GetFaces()).size(); i++) + { + McCadExtFace * pExtFace = (pVoidCell->GetFaces()).at(i); + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + pBox->AddSurface(iFaceNum); + } + cell_list.push_back(pBox); + + return cell_list; +} + + +vector McCadTripoliWriter::GenOuterSpaceList(McCadVoidCell *& pVoidCell) +{ + vector outer_list; + int iInitSurfNum = m_iInitFaceNum - 1; + + for (Standard_Integer i = 0; i < (pVoidCell->GetFaces()).size(); i++) + { + McCadTripoliCell *pTriCell = new McCadTripoliCell(); + McCadExtFace * pExtFace = (pVoidCell->GetFaces()).at(i); + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + iFaceNum *= -1; + + pTriCell->AddSurface(iFaceNum); + outer_list.push_back(pTriCell); + } + return outer_list; +} + + + +/** ******************************************************************** +* @brief Print the surface list +* +* @param Standard_OStream & theStream +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +void McCadTripoliWriter::PrintSurfDesc(Standard_OStream & theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream<<"/* ============================ Surface Data Definitions ========================= */"<::iterator iterPos; + for (iterPos = (pData->m_GeomSurfList).begin(); iterPos != (pData->m_GeomSurfList).end(); ++iterPos) + { + IGeomFace * pFace = *iterPos; + assert(pFace); + theStream.setf(ios::left); + theStream<<"SURF "< surf_list = GetSurfPrmt(pFace); + for (Standard_Integer i = 0; i < surf_list.size(); i++ ) + { + if ( i%4 == 0 && i != 0 ) + { + theStream<GetSurfSymb(); + TCollection_AsciiString tri_symb; + + map::iterator iter; + iter = m_mapSymb.find(mcnp_symb); + if(iter != m_mapSymb.end()) + { + tri_symb = iter->second; + } + else + { + tri_symb = mcnp_symb; + } + return tri_symb; +} + + + +/** ******************************************************************** +* @brief Get the parameters of surface according to the format of TRIPOLI +* surface describtion +* +* @param IGeom * pFace +* @return vector parameters list +* +* @date 09/10/2013 +* @modify 10/09/2014 +* @author Lei Lu +***********************************************************************/ +vector McCadTripoliWriter::GetSurfPrmt(IGeomFace *& pFace) +{ + vector prmt_list; + TCollection_AsciiString McnpSymb = pFace->GetSurfSymb(); + if (McnpSymb == "P") + { + int iNum = (pFace->GetPrmtList()).size(); + for (Standard_Integer i = 0; i < iNum-1; i++ ) + { + prmt_list.push_back(pFace->GetPrmtList().at(i)); + } + prmt_list.push_back(-1*pFace->GetPrmtList().at(iNum-1)); + return prmt_list; + } + + if ( McnpSymb == "CX" ) + { + McCadGeomCylinder * pCyl = (McCadGeomCylinder*)(pFace); + prmt_list.push_back(pCyl->GetPoint().Y()); + prmt_list.push_back(pCyl->GetPoint().Z()); + prmt_list.push_back(pCyl->GetRadius()); + return prmt_list; + } + + if ( McnpSymb == "CY" ) + { + McCadGeomCylinder * pCyl = (McCadGeomCylinder*)(pFace); + prmt_list.push_back(pCyl->GetPoint().X()); + prmt_list.push_back(pCyl->GetPoint().Z()); + prmt_list.push_back(pCyl->GetRadius()); + return prmt_list; + } + + if ( McnpSymb == "CZ" ) + { + McCadGeomCylinder * pCyl = (McCadGeomCylinder*)(pFace); + prmt_list.push_back(pCyl->GetPoint().X()); + prmt_list.push_back(pCyl->GetPoint().Y()); + prmt_list.push_back(pCyl->GetRadius()); + return prmt_list; + } + + if (McnpSymb == "SO" || McnpSymb == "SY" || McnpSymb == "SZ" + ||McnpSymb == "SX" || McnpSymb == "S" ) + { + McCadGeomSphere * pSph = (McCadGeomSphere*)(pFace); + prmt_list.push_back(pSph->GetCenter().X()); + prmt_list.push_back(pSph->GetCenter().Y()); + prmt_list.push_back(pSph->GetCenter().Z()); + prmt_list.push_back(pSph->GetRadius()); + return prmt_list; + } + + if (McnpSymb == "K/X" || McnpSymb == "K/Y" || McnpSymb == "K/Z" + || McnpSymb == "KX" || McnpSymb == "KY" || McnpSymb == "KZ") + { + McCadGeomCone * pCon = (McCadGeomCone*)(pFace); + prmt_list.push_back(pCon->GetApex().X()); + prmt_list.push_back(pCon->GetApex().Y()); + prmt_list.push_back(pCon->GetApex().Z()); + prmt_list.push_back((pCon->GetSemiAngle()/M_PI)*180.); + return prmt_list; + } + + int iNum = (pFace->GetPrmtList()).size(); + for (Standard_Integer i = 0; i < iNum; i++ ) + { + prmt_list.push_back(pFace->GetPrmtList().at(i)); + } + return prmt_list; +} + + + diff --git a/src/MCCAD/McCadMcVoid/McCadTripoliWriter.hxx b/src/MCCAD/McCadMcVoid/McCadTripoliWriter.hxx new file mode 100644 index 0000000..2841f91 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadTripoliWriter.hxx @@ -0,0 +1,62 @@ +#ifndef MCCADTRIPOLIWRITER_HXX +#define MCCADTRIPOLIWRITER_HXX + +#include "IMcCadWriter.hxx" + +class McCadTripoliWriter : public IMcCadWriter +{ + +public: + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +Standard_EXPORT McCadTripoliWriter(); +Standard_EXPORT McCadTripoliWriter(Standard_Boolean bMat, Standard_Boolean bVoid); +Standard_EXPORT ~McCadTripoliWriter(); + +//private: //qiu +protected: + + Standard_Integer m_virtualCellNum; /**< The initial number of virtual cell */ + map m_mapSymb; + +public: +Standard_EXPORT void SetVirtCellNum(Standard_Integer theNum); /**< Set the initial virtual cell number */ +Standard_EXPORT void PrintFile(); /**< Print the file */ +Standard_EXPORT void PrintHeadDesc(Standard_OStream& theStream); /**< Print the head */ +Standard_EXPORT void PrintCellDesc(Standard_OStream& theStream); /**< Print the cell card */ +Standard_EXPORT void PrintVoidDesc(Standard_OStream& theStream); /**< Print the void card */ +Standard_EXPORT void PrintSurfDesc(Standard_OStream& theStream); /**< Print the surfaces list */ +Standard_EXPORT void PrintTrsfDesc(Standard_OStream& theStream); /**< Print the transform card */ +Standard_EXPORT void PrintMatCard(Standard_OStream& theStream); /**< Print the material card */ + +//private: //qiu +protected: + + /**< Print the outer spaces beside void cells and material cells */ +Standard_EXPORT void PrintOutSpace(Standard_OStream& theStream); + /** Print the group information, including material name, group name, material id and density */ +Standard_EXPORT void PrintGroupInfo(const int iSolid, Standard_OStream& theStream); + /** Generate the TRIPOLI cell object from a convex solid */ +Standard_EXPORT vector GenTripoliCellList(McCadSolid *& pSolid); + /** Generate the TRIPOLI cell object from a filling void solid */ +Standard_EXPORT vector GenTripoliVoidCellList(McCadVoidCell *& pVoidCell); + /** Generate the outer space tripoli cell list */ +Standard_EXPORT vector GenOuterSpaceList(McCadVoidCell *& pVoidCell); + +Standard_EXPORT vector GetSurfPrmt(IGeomFace *& pFace); /**< Get the parameter list of a surface */ +Standard_EXPORT TCollection_AsciiString GetSurfSymb(IGeomFace *& pFace);/**< Get the type of surface */ + +}; + +#endif // MCCADTRIPOLIWRITER_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadVoidCell.cxx b/src/MCCAD/McCadMcVoid/McCadVoidCell.cxx new file mode 100644 index 0000000..66ed9d2 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadVoidCell.cxx @@ -0,0 +1,1087 @@ +#include "McCadVoidCell.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "McCadVoidCellManager.hxx" +#include "McCadGeomPlane.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadGeomTool.hxx" + +#include +#include "../McCadTool/McCadMathTool.hxx" + +McCadVoidCell::McCadVoidCell() +{ +} + +McCadVoidCell::McCadVoidCell(const TopoDS_Solid & theSolid):TopoDS_Solid(theSolid) +{ + m_SplitAxis = XAxis; + GetBntBox(); + GetGeomFaceList(); + m_VertexList = new TColgp_HSequenceOfPnt; +} + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadVoidCell::AddColliedSolidNum(Standard_Integer iNum) +{ + m_CollidedSolidNumList.push_back(iNum); +} + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +vector McCadVoidCell::GetColliedSolidList() +{ + return m_CollidedSolidNumList; +} + + + +/** ******************************************************************** +* @brief Get the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadVoidCell::GetBntBox() +{ + if(m_bHaveBndBox) // If already have boundary box + { + return m_bBox; + } + else + { + /* Get Boundary box of current solid */ + BRepBndLib::Add(*this, m_bBox); + m_bBox.SetGap(0.0); + + /* Set the max and min position of the boundary box */ + Standard_Real fXmin, fYmin, fZmin, fXmax, fYmax, fZmax; + m_bBox.Get(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + + m_MaxPnt.SetCoord(fXmax, fYmax, fZmax); // The max point of the boundary box + m_MinPnt.SetCoord(fXmin, fYmin, fZmin); // The min point of the boundary box + + //m_bBoxShape = BRepPrimAPI_MakeBox(MinPnt,MaxPnt).Shape(); // Create the shape of boundary box + m_bHaveBndBox = Standard_True; // Already have boundary box + + return m_bBox; + } +} + + +/** ******************************************************************** +* @brief Set the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +Bnd_Box McCadVoidCell::SetBntBox(Standard_Real fXmin, Standard_Real fYmin, Standard_Real fZmin, + Standard_Real fXmax, Standard_Real fYmax, Standard_Real fZmax) +{ + m_bBox.Update(fXmin, fYmin, fZmin, fXmax, fYmax, fZmax); + m_bHaveBndBox = Standard_True; // Already have boundary box + + m_MaxPnt.SetCoord(fXmax, fYmax, fZmax); // The max point of the boundary box + m_MinPnt.SetCoord(fXmin, fYmin, fZmin); // The min point of the boundary box + + return m_bBox; +} + + +/** ******************************************************************** +* @brief Set the boundary box of solid +* +* @param +* @return TopoDS_Shape +* +* @date 31/8/2012 +* @author Lei Lu +************************************************************************/ +void McCadVoidCell::CalColliedFaces(McCadGeomData * pData) +{ + int b = 0; + + for (unsigned int i = 0; i < m_CollidedSolidNumList.size(); i++) + { + int index = m_CollidedSolidNumList.at(i); + McCadConvexSolid * pSolid = (pData->GetConvexSolid()).at(index); + assert(pSolid); + + Bnd_Box bbox_solid = pSolid->GetBntBox(); + Bnd_Box bbox_void = this->GetBntBox(); + + if(!CalColliedBox(bbox_solid)) + { + m_CollidedSolidNumList.erase(m_CollidedSolidNumList.begin()+i); + i--; + continue; + } + + //if(bbox_void.IsOut(bbox_solid)) + //{ + // m_CollidedSolidNumList.erase(m_CollidedSolidNumList.begin()+i); + // i--; + // continue; + //} + + COLLISION tmpCollision; + tmpCollision.SolidNum = index+1; + vector tmpAuxFaceList; + + for (unsigned int j = 0; j < pSolid->GetSTLFaceList().size(); j++) + { + McCadExtFace *pFace = pSolid->GetSTLFaceList()[j]; + Bnd_Box bbox_face = pFace->GetBndBox(); + + Standard_Boolean bCollied = Standard_False; + if( !CalColliedBox(bbox_face)) + { + continue; + } + + if (CalColliedPoints(pFace->GetEdgePntList())) + { + bCollied = Standard_True; + } + else if (CalColliedPoints(pFace->GetDiscPntList())) + { + bCollied = Standard_True; + } + else if (CalColliedFace(pFace)) + { + bCollied = Standard_True; + } + + if (!bCollied) + { + continue; + } + + tmpCollision.FaceList.push_back(pFace->GetFaceNum()); + if(pFace->HaveAuxSurf()) + { + vector auxface_list_solid; + for (Standard_Integer k = 0; k < pFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pFace->GetAuxFaces().at(k); + if(pAuxFace->GetAttri() == 1) + { + auxface_list_solid.push_back(pAuxFace->GetFaceNum()); + } + else + { + tmpCollision.FaceList.push_back(pAuxFace->GetFaceNum()); + } + } + + if (auxface_list_solid.size() == 1) + { + tmpAuxFaceList.push_back(auxface_list_solid.at(0)); + } + else if (auxface_list_solid.size() > 1) + { + tmpCollision.AuxFaceList.push_back(auxface_list_solid); + } + } + } + + if ( tmpAuxFaceList.size() != 0) + { + tmpCollision.AuxFaceList.push_back(tmpAuxFaceList); + } + + if(tmpCollision.FaceList.size() != 0) + { + m_Collision.push_back(tmpCollision); + continue; + } + + // Advanced collision detect.Judge the vertex of void cell is in the solid or not. + if(IsVertexInSolid(pSolid)) + { + vector tmpAuxFaceList; + for (unsigned int j = 0; j < pSolid->GetSTLFaceList().size(); j++) + { + McCadExtFace *pFace = pSolid->GetSTLFaceList().at(j); + tmpCollision.FaceList.push_back(pFace->GetFaceNum()); + if(pFace->HaveAuxSurf()) + { + vector auxface_list_solid; + for (Standard_Integer k = 0; k < pFace->GetAuxFaces().size(); k++) + { + McCadExtFace *pAuxFace = pFace->GetAuxFaces().at(k); + if(pAuxFace->GetAttri() == 1) + { + auxface_list_solid.push_back(pAuxFace->GetFaceNum()); + } + else + { + tmpCollision.FaceList.push_back(pAuxFace->GetFaceNum()); + } + } + + if (auxface_list_solid.size() == 1) + { + tmpAuxFaceList.push_back(auxface_list_solid.at(0)); + } + else if (auxface_list_solid.size() > 1) + { + tmpCollision.AuxFaceList.push_back(auxface_list_solid); + } + } + } + + if ( tmpAuxFaceList.size() != 0) + { + tmpCollision.AuxFaceList.push_back(tmpAuxFaceList); + } + + if(tmpCollision.FaceList.size() != 0) + { + m_Collision.push_back(tmpCollision); + } + } + } + + /* Print the collision information */ + /* if (m_Collision.size() == 0) + { + cout<<" null collision"<GetDiscPntList(); + Standard_Boolean bInVoid = Standard_False; + + for (unsigned int i = 1; i <= point_list->Length(); i++) + { + gp_Pnt pnt = point_list->Value(i); + //if(m_bBox.IsOut(pnt)) + if (!IsPointInBBox(pnt)) + { + continue; + } + else + { + bInVoid = Standard_True; + break; + } + } + return bInVoid; +} + + + +/** ******************************************************************** +* @brief Calculate the two boxes are connected and next to each other +* +* @param +* @return Standard_Boolean +* +* @date 15/3/2014 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadVoidCell::CalColliedBox(Bnd_Box & box) +{ + Standard_Boolean bConnected = Standard_False; + + box.SetGap(0.0); + Standard_Real xMin1, yMin1, zMin1, xMax1, yMax1, zMax1; + box.Get(xMin1, yMin1, zMin1, xMax1, yMax1, zMax1); + +// gp_Pnt v1(xMin, yMin, zMin); +// gp_Pnt v2(xMin, yMin, zMax); +// gp_Pnt v3(xMin, yMax, zMax); +// gp_Pnt v4(xMax, yMax, zMax); +// gp_Pnt v5(xMax, yMin, zMax); +// gp_Pnt v6(xMax, yMax, zMin); +// gp_Pnt v7(xMax, yMin, zMin); +// gp_Pnt v8(xMin, yMax, zMin); + + m_bBox.SetGap(0.0); + Standard_Real xMin2, yMin2, zMin2, xMax2, yMax2, zMax2; + m_bBox.Get(xMin2, yMin2, zMin2, xMax2, yMax2, zMax2); + + + if ( Abs(xMin1-xMax2)<1.0e-7 || Abs(xMax1-xMin2)<1.0e-7) + { + bConnected = Standard_True; + } + + if ( Abs(yMin1-yMax2)<1.0e-2 || Abs(yMax1 - yMin2)<1.0e-2) + { + //cout< xMin)) + { + if ((py < yMax) && (py > yMin)) + { + if ((pz < zMax) && (pz > zMin)) + { + return Standard_True; + } + } + } + + return Standard_False; +} + + + +/*Standard_Boolean McCadVoidCell::CalColliedVertex(McCadExtFace *& theFace) +{ + GetVertexList(); // Get the vertex of void cell + Standard_Boolean bInSolid = Standard_False; + int iSide = 1; + for (unsigned int i = 1; i <= m_VertexList->Length(); i++) + { + gp_Pnt pnt = m_VertexList->Value(i); + if (i == 1) + { + iSide = SideofFace(pnt,theFace); + continue; + } + + if(iSide != SideofFace(pnt,theFace)) + { + bInSolid = Standard_True; + break; + } + } + return bInSolid; +}*/ + + + +/** ******************************************************************** +* @brief Further collision detection, use the boolean operation between +* face and void box, if they have common section, then they are +* collied. +* Because same faces have been merged, so the merged same surfaces +* also have to be used for detecting the collision. +* +* @param +* @return TopoDS_Shape +* +* @date 20/3/2013 +* @author Lei Lu +************************************************************************/ +Standard_Boolean McCadVoidCell::CalColliedFace(McCadExtFace *& theFace) +{ + Standard_Boolean PerformNow = Standard_False; + int nCount = 0; + + if(!theFace->IsFusedFace()) + { + BRepAlgoAPI_Section section(*this,*theFace,PerformNow); + section.ComputePCurveOn1(Standard_True); + section.Approximation(Standard_True); + section.Build(); + TopoDS_Shape section_shape = section.Shape(); + + for (TopExp_Explorer ex(section_shape, TopAbs_VERTEX); ex.More(); ex.Next()) + { + nCount++; + } + if (nCount > 2) + { + //cout<<" "<IsFusedFace()) + if(theFace->GetSameFaces().size()!=0) + { + Standard_Boolean bCollision = Standard_False; + for (Standard_Integer i = 0 ; i < theFace->GetSameFaces().size(); i++) + { + McCadExtFace *pFace; + pFace = theFace->GetSameFaces().at(i); + bCollision = CalColliedFace(pFace); + if (!bCollision) + { + continue; + } + else + { + return bCollision; + } + } + } + + return Standard_False; +} + + +Standard_Boolean McCadVoidCell::IsVertexInSolid(McCadConvexSolid *& pSolid) +{ + SetVertexList(); // Set the vertex of void cell + BRepClass3d_SolidClassifier bsc3d(*pSolid); + for (unsigned int i = 1; i <= m_VertexList->Length(); i++) + { + gp_Pnt pnt = m_VertexList->Value(i); + bsc3d.Perform(pnt,1.0e-05); + if ( bsc3d.State() == TopAbs_IN) + { + return Standard_True; + } + } + return Standard_False; +} + + +void McCadVoidCell::SetVertexList() +{ + if(m_VertexList->Length()!=0) + { + return; + } + + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + m_bBox.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + gp_Pnt Pnt1(dXmax,dYmax,dZmax); + gp_Pnt Pnt2(dXmax,dYmax,dZmin); + gp_Pnt Pnt3(dXmax,dYmin,dZmax); + gp_Pnt Pnt4(dXmax,dYmin,dZmin); + + gp_Pnt Pnt5(dXmin,dYmin,dZmin); + gp_Pnt Pnt6(dXmin,dYmax,dZmin); + gp_Pnt Pnt7(dXmin,dYmin,dZmax); + gp_Pnt Pnt8(dXmin,dYmax,dZmax); + + m_VertexList->Append(Pnt1); + m_VertexList->Append(Pnt2); + m_VertexList->Append(Pnt3); + m_VertexList->Append(Pnt4); + m_VertexList->Append(Pnt5); + m_VertexList->Append(Pnt6); + m_VertexList->Append(Pnt7); + m_VertexList->Append(Pnt8); +} + + + + +Standard_Integer McCadVoidCell::SideofFace(gp_Pnt pnt, McCadExtFace *& theFace) +{ + TopLoc_Location loc; + Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(*theFace, loc); + GeomAdaptor_Surface surf_adoptor(geom_surface); + Standard_Real aVal = McCadGTOOL::Evaluate(surf_adoptor,pnt); + + if(aVal > 0.0 ) + { + return 1; + } + else if (aVal < 0.0) + { + return -1; + } + else if (fabs(aVal - 0.0) < 1.0e-7) + { + return 0; + } +} + + + +Standard_Boolean McCadVoidCell::IsPointInBBox(gp_Pnt pnt) +{ + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + m_bBox.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + McCadGeomTool::SimplifyPoint(pnt); + + if (( pnt.X()>dXmin && pnt.X()dYmin && pnt.Y()dZmin && pnt.Z()GetFaceOrientation() == MINUS) + { + //m_szExpression += "-"; + }*/ + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += " "; + } + m_szExpression.Remove(m_szExpression.Length()); // Remove the last character " " + m_szExpression += ")"; + m_szExpression += "&"; + + for (Standard_Integer i = 0; i < m_Collision.size(); i++) + { + COLLISION collision = m_Collision[i]; + m_szExpression += "("; + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + int iCollidFaceNum = collision.FaceList.at(j); + iCollidFaceNum > 0 ? iCollidFaceNum += iInitSurfNum : iCollidFaceNum -= iInitSurfNum; + + int iNum = -1*(iCollidFaceNum); + m_szExpression += TCollection_AsciiString(iNum); + m_szExpression += ":"; + } + + for (Standard_Integer k = 0; k < (collision.AuxFaceList).size(); k++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(k); + if ( auxiliary_face_list.size() > 1) + { + m_szExpression += "("; + } + + for (Standard_Integer k = 0; k < auxiliary_face_list.size(); k++) + { + int iAuxFaceNum = auxiliary_face_list.at(k); + iAuxFaceNum > 0 ? iAuxFaceNum += iInitSurfNum : iAuxFaceNum -= iInitSurfNum; + + int iNum = -1*(iAuxFaceNum); + m_szExpression += TCollection_AsciiString(iNum); + m_szExpression += " "; + } + + m_szExpression.Remove(m_szExpression.Length()); // Remove the last character + if (auxiliary_face_list.size() > 1) + { + m_szExpression += ")"; + } + m_szExpression += ":"; + } + + m_szExpression.Remove(m_szExpression.Length()); // Remove the last character ":" + m_szExpression += ")"; + m_szExpression += "&"; + } + return m_szExpression; +} + + + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString McCadVoidCell::GetOutVoidExpression() +{ + m_szExpression.Clear(); + m_szExpression += "("; + + int iInitSurfNum = McCadConvertConfig::GetInitSurfNum()-1; + for (Standard_Integer i = 0; i < m_FaceList.size(); i++) + { + McCadExtFace * pExtFace = m_FaceList[i]; + + int iFaceNum = pExtFace->GetFaceNum(); + iFaceNum > 0 ? iFaceNum += iInitSurfNum : iFaceNum -= iInitSurfNum; + iFaceNum *= -1; + + m_szExpression += TCollection_AsciiString(iFaceNum); + m_szExpression += ":"; + } + m_szExpression.Remove(m_szExpression.Length()); + m_szExpression += ")"; + + return m_szExpression; +} + + + +/** ******************************************************************** +* @brief Get the MCNP cell expression of solid +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +vector McCadVoidCell::GetGeomFaceList() +{ + if(!m_FaceList.empty()) + { + return m_FaceList; + } + + TopExp_Explorer exp; + + TopoDS_Solid void_solid = BRepPrimAPI_MakeBox(m_MinPnt,m_MaxPnt).Solid(); + for (exp.Init(void_solid, TopAbs_FACE); exp.More(); exp.Next()) + { + TopoDS_Face theFace = TopoDS::Face(exp.Current()); + McCadExtFace *pExtFace = new McCadExtFace(theFace); + pExtFace->SetFaceNum(-1); + m_FaceList.push_back(pExtFace); + } + return m_FaceList; +} + + +/** ******************************************************************** +* @brief +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @author Lei Lu +***********************************************************************/ +Standard_Boolean McCadVoidCell::SplitVoidCell(vector & void_list, + McCadGeomData *pData) +{ + //cout<<"+++"<<"VoidDecomposeDepth:"<GetExpression().Length() > McCadConvertConfig::GetMaxDiscLength()) + { + //cout<<"GetExpression():"<GetExpression().Length()<= yLength && xLength >= zLength) + { + m_SplitAxis = XAxis; + } + else if (yLength >= zLength) + { + m_SplitAxis = YAxis; + } + else + { + m_SplitAxis = ZAxis; + } + + if(this->m_SplitAxis == XAxis) + { + Standard_Integer xMid = (m_MaxPnt.X()+ m_MinPnt.X())/2; + + max_pntA.SetCoord(xMid,m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntA.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),m_MinPnt.Z()); + + max_pntB.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntB.SetCoord(xMid,m_MinPnt.Y(),m_MinPnt.Z()); + + //split_axis = YAxis; + + } + else if(this->m_SplitAxis == YAxis) + { + Standard_Integer yMid = (m_MaxPnt.Y()+ m_MinPnt.Y())/2; + + max_pntA.SetCoord(m_MaxPnt.X(),yMid,m_MaxPnt.Z()); + min_pntA.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),m_MinPnt.Z()); + + max_pntB.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntB.SetCoord(m_MinPnt.X(),yMid,m_MinPnt.Z()); + + //split_axis = ZAxis; + + } + else if(this->m_SplitAxis == ZAxis) + { + Standard_Integer zMid = (m_MaxPnt.Z()+ m_MinPnt.Z())/2; + + max_pntA.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),zMid); + min_pntA.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),m_MinPnt.Z()); + + max_pntB.SetCoord(m_MaxPnt.X(),m_MaxPnt.Y(),m_MaxPnt.Z()); + min_pntB.SetCoord(m_MinPnt.X(),m_MinPnt.Y(),zMid); + + //split_axis = XAxis; + } + + /* cout<SetCollidedSolidNumList(m_CollidedSolidNumList); + pVoidB->SetCollidedSolidNumList(m_CollidedSolidNumList); + + pVoidA->CalColliedFaces(pData); + pVoidB->CalColliedFaces(pData); + + //pVoidA->SetSplitAxis(split_axis); + //pVoidB->SetSplitAxis(split_axis); + pVoidA->SetSplitDepth(m_iSplitDepth+1); + pVoidB->SetSplitDepth(m_iSplitDepth+1); + + if(!pVoidA->SplitVoidCell(void_list,pData)) + { + void_list.push_back(pVoidA); + //cout<<"level"<SplitVoidCell(void_list,pData)) + { + void_list.push_back(pVoidB); + //cout<<"level"< theCollidedSolidNumList ) +{ + m_CollidedSolidNumList = theCollidedSolidNumList; +} + + +void McCadVoidCell::ChangeFaceNum(McCadGeomData *pData) +{ + for (Standard_Integer i = 0; i < m_FaceList.size(); i++) + { + McCadExtFace * pExtFace = m_FaceList[i]; + + Standard_Integer iFaceNumOld = pExtFace->GetFaceNum(); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + pExtFace->SetFaceNum(iFaceNumNew); + } + + for (Standard_Integer i = 0; i < m_Collision.size(); i++) + { + COLLISION collision = m_Collision[i]; + for (Standard_Integer j = 0; j < (collision.FaceList).size(); j++) + { + Standard_Integer iFaceNumOld = collision.FaceList.at(j); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + if(iFaceNumOld < 0) + { + iFaceNumNew *= -1; + } + m_Collision[i].FaceList.at(j) = iFaceNumNew; + } + + for (Standard_Integer k = 0; k < (collision.AuxFaceList).size(); k++) + { + vector auxiliary_face_list = collision.AuxFaceList.at(k); + for (Standard_Integer l = 0; l < auxiliary_face_list.size(); l++) + { + Standard_Integer iFaceNumOld = auxiliary_face_list.at(l); + Standard_Integer iFaceNumNew = pData->GetNewFaceNum(abs(iFaceNumOld)); + if(iFaceNumOld < 0) + { + iFaceNumNew *= -1; + } + m_Collision[i].AuxFaceList.at(k).at(l) = iFaceNumNew; + } + } + } +} + + + +/** ******************************************************************** +* @brief Get the expression of the cubic box represented the void space +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @modify 16/12/2013 +* @author Lei Lu +***********************************************************************/ +vector McCadVoidCell::GetFaces() +{ + return m_FaceList; +} + + + + +/** ******************************************************************** +* @brief Get the collision information of void box +* +* @param +* @return TCollection_AsciiString +* +* @date 31/8/2012 +* @modify 16/12/2013 +* @author Lei Lu +***********************************************************************/ +vector McCadVoidCell::GetCollision() +{ + return m_Collision; +} + + + +//for (int iVoidFace = 0; iVoidFace < m_FaceList.size(); iVoidFace++) +//{ +// if (b==1) +// { +// break; +// } + +// McCadExtFace *pVoidFace = m_FaceList.at(iVoidFace); +// McCadExtFace *pMatFace = NULL; +// for (int iMatFace = 0; iMatFace < pSolid->GetSTLFaceList().size();iMatFace++) +// { +// pMatFace = pSolid->GetSTLFaceList().at(iMatFace); + +// TopLoc_Location loc; +// Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(*pMatFace, loc); +// GeomAdaptor_Surface surf_adoptor(geom_surface); + +// Handle(Geom_Surface) geom_surface2 = BRep_Tool::Surface(*pVoidFace, loc); +// GeomAdaptor_Surface surf_adoptor2(geom_surface2); + +// if (surf_adoptor.GetType() == GeomAbs_Plane +// && surf_adoptor2.GetType() == GeomAbs_Plane) +// { +// gp_Pln plane1 = surf_adoptor.Plane(); // Get the geometry plane + +// Standard_Real PrmtA1; +// Standard_Real PrmtB1; +// Standard_Real PrmtC1; +// Standard_Real PrmtD1; + + + +// plane1.Coefficients(PrmtA1,PrmtB1,PrmtC1,PrmtD1); +// // If the parameter is less than 1.0e-07, it can be take as zero +// if(McCadMathTool::IsEqualZero(PrmtA1)) +// PrmtA1 = 0.0; +// if(McCadMathTool::IsEqualZero(PrmtB1)) +// PrmtB1 = 0.0; +// if(McCadMathTool::IsEqualZero(PrmtC1)) +// PrmtC1 = 0.0; +// if(McCadMathTool::IsEqualZero(PrmtD1)) +// PrmtD1 = 0.0; + + +// gp_Dir Dir1; +// Dir1.SetCoord(PrmtA1,PrmtB1,PrmtC1); +// // cout<GetFaceOrientation() == MINUS) +// { +// cout<<"----"<GetFaceOrientation() != pMatFace->GetFaceOrientation()) +// ) +// { +// cout< + +#include +#include + +#include +#include +#include +#include +#include "McCadConvexSolid.hxx" +#include + +using namespace std; + +typedef struct{ + int SolidNum; + vector FaceList; + vector< vector > AuxFaceList; +}COLLISION; + +enum SplitAxis{ XAxis = 1, + YAxis = 2, + ZAxis = 3}; + +class McCadVoidCellManager; +class McCadGeomData; + +class McCadVoidCell : public TopoDS_Solid +{ +public: +Standard_EXPORT McCadVoidCell(); +Standard_EXPORT McCadVoidCell(const TopoDS_Solid & theSolid); + +private: + enum cutplane{x=0,y=1,z=2}; // Cut the void cell when it is collied with too many solids + + + vector m_CollidedSolidNumList; // Record the solid no who is collided with void cell + // Which boundary faces of the solid is collied with the void cell. + // the first parameter(int) is the solid no, the second is the list + // of the collided boundary faces. + map mapCollidedFaceNo; + + gp_Pnt m_MaxPnt; // The max point of the boundary box + gp_Pnt m_MinPnt; // The min point of the boundary box + + TCollection_AsciiString m_szExpression; // MCNP expression of solid + int iLengthOfExpression; // Length of MCNP expression + + Standard_Boolean m_bHaveBndBox; /**< If Boundary box has been generated */ + Bnd_Box m_bBox; /**< The boundary box */ + + vector m_Collision; + vector m_FaceList; /**< Face list of void solid */ + + SplitAxis m_SplitAxis; + Standard_Integer m_iSplitDepth; + + Handle_TColgp_HSequenceOfPnt m_VertexList; + //Handle_TopTools_HSequenceOfShape m_NFaceList; + +public: + +Standard_EXPORT Standard_Boolean IsCollided(const TopoDS_Shape & Solid); // Whether is collided with solid +Standard_EXPORT void DetectCollision(const Handle(TopTools_HSequenceOfShape) & SolidList); // Detect the collision with solids list + +Standard_EXPORT void GenerateMCNPExpression(); // Generate the MCNP expression +Standard_EXPORT Bnd_Box GetBntBox(); +Standard_EXPORT void SetVertexList(); +Standard_EXPORT void AddColliedSolidNum(Standard_Integer iNum); + +Standard_EXPORT vector GetColliedSolidList(); + //void CalColliedFaces(vector & solid_list); +Standard_EXPORT Standard_Boolean CalColliedPoints(Handle_TColgp_HSequenceOfPnt point_list); + +Standard_EXPORT Bnd_Box SetBntBox(Standard_Real fXmin, Standard_Real fYmin, Standard_Real fZmin, + Standard_Real fXmax, Standard_Real fYmax, Standard_Real fZmax); +Standard_EXPORT TCollection_AsciiString GetExpression(); +Standard_EXPORT TCollection_AsciiString GetOutVoidExpression(); +Standard_EXPORT vector GetGeomFaceList(); + +Standard_EXPORT Standard_Boolean SplitVoidCell(vector & void_list, + McCadGeomData * pData); + +Standard_EXPORT void SetSplitAxis(SplitAxis split_axis); +Standard_EXPORT void SetCollidedSolidNumList(vector theCollidedSolidNumList ); +Standard_EXPORT void SetSplitDepth(Standard_Integer iSplitDepth); + +Standard_EXPORT void ChangeFaceNum(McCadGeomData * pData); +Standard_EXPORT void CalColliedFaces(McCadGeomData *pData); + +Standard_EXPORT Standard_Boolean IsPointInBBox(gp_Pnt pnt); + +Standard_EXPORT Standard_Integer SideofFace(gp_Pnt pnt, McCadExtFace *& theFace); +Standard_EXPORT Standard_Boolean CalColliedVertex(McCadExtFace *& theFace); +Standard_EXPORT Standard_Boolean IsVertexInSolid(McCadConvexSolid *& pSolid); +Standard_EXPORT Standard_Boolean CalColliedFace(McCadExtFace *& theFace); +Standard_EXPORT Standard_Boolean CalColliedBox(Bnd_Box & box); +Standard_EXPORT Standard_Boolean PntInBox(gp_Pnt &pnt, Bnd_Box & box); + + Standard_EXPORT vector GetFaces(); + Standard_EXPORT vector GetCollision(); + + +}; + +#endif // MCCADVOIDCELL_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadVoidCellManager.cxx b/src/MCCAD/McCadMcVoid/McCadVoidCellManager.cxx new file mode 100644 index 0000000..207cffb --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadVoidCellManager.cxx @@ -0,0 +1,253 @@ +#include "McCadVoidCellManager.hxx" +#include "McCadMcnpWriter.hxx" +#include "McCadTripoliWriter.hxx" +#include "McCadGDMLWriter.hxx" + +#include +#include +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadGeneTool.hxx" + +McCadVoidCellManager::McCadVoidCellManager() +{ + m_bGenerateVoid = McCadConvertConfig::GenerateVoid(); // Turn on/off the void generating switch + if (m_bGenerateVoid == 0) + { + McCadConvertConfig::SetMinMaxSmplPntNum(10,20); + } + m_Convertor = "MCNP"; // The default convetor is MCNP +} + +McCadVoidCellManager::~McCadVoidCellManager() +{ +} + + +/** ******************************************************************** +* @brief Set the output file name according to the input file name +* +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 07/01/2014 +* @author Lei Lu +***********************************************************************/ +void McCadVoidCellManager::SetOutFileName(TCollection_AsciiString theFileName) +{ + m_OutFileName = theFileName; +} + + + +/** ******************************************************************** +* @brief The main process control function +* 1. call the void generation and collision detect function +* 2. Load the material information +* 3. Output the input file +* +* @param null +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidCellManager::Process() +{ + // Add by Lei 12/11/2013 Load the material XML file. + //TCollection_AsciiString material_file = "material.xml"; + //ReadMatData(material_file); + // + + McCadVoidGenerator *pVoidGen = new McCadVoidGenerator(this); + pVoidGen->Process(); + + m_pGeomData->SortSurface(); + m_pGeomData->UpdateFaceNum(); + + IMcCadWriter * pWriter = NULL; + if (m_Convertor == "TRIPOLI") + { + pWriter = new McCadTripoliWriter(); + ((McCadTripoliWriter *)pWriter)->SetVirtCellNum(10000); + } + else if (m_Convertor == "MCNP") + { + pWriter = new McCadMcnpWriter(); + } + + //qiu add GDML option + else if (m_Convertor == "GDML") + { + pWriter = new McCadGDMLWriter(); + } + + if (pWriter != NULL) + { + pWriter->SetMaterial(m_bHaveMaterial); + pWriter->SetVoid(m_bGenerateVoid); + pWriter->SetManager(this); + pWriter->SetFileName(m_OutFileName); + pWriter->PrintFile(); + } + + cout<SetManager(this); +} + + +/** ******************************************************************** +* @brief Read the material data +* @param TCollection_AsciiString & theMatFile: Material XML file +* @return void +* +* @date 31/10/2012 +* @modify 18/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidCellManager::ReadMatData(TCollection_AsciiString &theMatFile) +{ + if(theMatFile.IsEmpty()) + { + cout<<"================ Step.2 Load material data =============="< didn't find material xml file ..."<LoadXMLfile(QString(theMatFile.ToCString()),true); + if (bSetMaterial) + { + cout< material.xml has been loaded..."<m_SolidList.size(); i++) + { + pSolid = m_pGeomData->m_SolidList.at(i); + + QString groupName = m_pMat->GetGroupName(i+1); // Get group name according to solid id + int iMatID = m_pMat->GetMatNum(groupName); // Get material id according to group name + double fDensity = m_pMat->GetMatDensity(iMatID); // Get material density according to material id + QString material_name = m_pMat->GetMatName(iMatID); // Get material name according to material id + + pSolid->SetMaterial(iMatID,fDensity); + pSolid->SetName(McCadGeneTool::ToAsciiString(material_name)); + } +} diff --git a/src/MCCAD/McCadMcVoid/McCadVoidCellManager.hxx b/src/MCCAD/McCadMcVoid/McCadVoidCellManager.hxx new file mode 100644 index 0000000..64b45f5 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadVoidCellManager.hxx @@ -0,0 +1,77 @@ +/** @file McCadVoidCellManager.hxx + * + * @brief The class manage the void generation and translate the CAD solids into MCNP file. + * There are two main functions: + * 1. Store the data including the CAD solid the void cells generated and the surfaces. + * 2. Control the main working flow including model reading, void filling and mcnp file printing. + * + * @author Lei Lu + * @date 1st.Aug.2012 + */ + +#ifndef MCCADVOIDCELLMANAGER_HXX +#define MCCADVOIDCELLMANAGER_HXX + +#include "McCadGeomData.hxx" +#include "McCadVoidGenerator.hxx" + +#include +#include +#include + +#include "../McCadTool/MaterialManager.hxx" + +using namespace std; + +class McCadVoidCellManager +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +Standard_EXPORT McCadVoidCellManager(); +Standard_EXPORT ~McCadVoidCellManager(); + +//private: //qiu +protected: + + Standard_Boolean m_bHaveMaterial; /**< If the material file is existed, set true, else set false */ + Standard_Boolean m_bGenerateVoid; /**< The switch of void generation */ + + auto_ptr m_pGeomData; /**< Smart pointer of geometry data*/ + auto_ptr m_pMat; /**< Smart pointer of materailManager */ + + TCollection_AsciiString m_Convertor; /**< The type of output file, e.g. Tripoli or Mcnp */ + TCollection_AsciiString m_OutFileName; /**< The name of output file */ + +public: + /** Read the model, create the McCadGeomData object to store the geometry data. */ +Standard_EXPORT void ReadGeomData(Handle_TopTools_HSequenceOfShape & solid_list); + /** Read the material xml file and store the material information */ +Standard_EXPORT void ReadMatData(TCollection_AsciiString &theMatFile); + +Standard_EXPORT void SetOutFileName(TCollection_AsciiString theFileName);/**< Set the output file name */ +Standard_EXPORT McCadGeomData * GetGeomData(); /**< Get the pointer of geometry data */ +Standard_EXPORT MaterialManager * GetMatManager(); /**< Get the material manager pointer */ +Standard_EXPORT void AddMatOnSolid(); /**< Add the material information on each solid */ +Standard_EXPORT void SetConvetor(TCollection_AsciiString theConvertor); /**< Set the convetor to tripoli or mcnp, or other codes */ +Standard_EXPORT Standard_Boolean GenVoid(); /**< Generate void or not */ + +Standard_EXPORT void Process(); /**< The main procesure */ + + +}; + + +#endif // MCCADVOIDCELLMANAGER_HXX diff --git a/src/MCCAD/McCadMcVoid/McCadVoidGenerator.cxx b/src/MCCAD/McCadMcVoid/McCadVoidGenerator.cxx new file mode 100644 index 0000000..9f6d6d5 --- /dev/null +++ b/src/MCCAD/McCadMcVoid/McCadVoidGenerator.cxx @@ -0,0 +1,308 @@ +#include "McCadVoidGenerator.hxx" + +#include +#include +#include + +#include "../McCadTool/McCadMathTool.hxx" + +McCadVoidGenerator::McCadVoidGenerator() +{ +} + +McCadVoidGenerator::~McCadVoidGenerator() +{ +} + +McCadVoidGenerator::McCadVoidGenerator(const McCadVoidCellManager * pManager) +{ +//qiu m_pManager = pManager; + m_pManager = const_cast (pManager); +} + + + +/** ********************************************************************** +* @brief Generate the void boxes based on the dimension of material solids +* +* @param const vector & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +**************************************************************************/ +void McCadVoidGenerator::GenVoidCells() +{ + Bnd_Box bnd_box; + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_ConvexSolidList.size(); i++) + { + cout<<"."; + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[i]; + assert(pSolid); + BRepBndLib::Add((TopoDS_Shape)(*pSolid),bnd_box); // Add each convex solid into bundary box + } + cout<SetBntBox(dXmin,dYmin,dZmin,dXmax,dYmax,dZmax); + pData->m_pOutVoid = pVoid; + + /* Split the boundar box into several parts */ + int iSplit = 2; + for (int iX = 0 ; iX < iSplit ; iX++) + { + Standard_Real xMin = dXmin+(dXmax-dXmin)*iX/iSplit; + Standard_Real xMax = dXmin+(dXmax-dXmin)*(iX+1)/iSplit; + for (int iY = 0; iY < iSplit; iY++ ) + { + Standard_Real yMin = dYmin+(dYmax-dYmin)*iY/iSplit; + Standard_Real yMax = dYmin+(dYmax-dYmin)*(iY+1)/iSplit; + for (int iZ = 0; iZ < iSplit; iZ++ ) + { + Standard_Real zMin = dZmin +(dZmax-dZmin)*iZ/iSplit; + Standard_Real zMax = dZmin +(dZmax-dZmin)*(iZ+1)/iSplit; + + McCadMathTool::Integer(xMin); + McCadMathTool::Integer(yMin); + McCadMathTool::Integer(zMin); + McCadMathTool::Integer(xMax); + McCadMathTool::Integer(yMax); + McCadMathTool::Integer(zMax); + + gp_Pnt max_pnt(xMax,yMax,zMax); + gp_Pnt min_pnt(xMin,yMin,zMin); + + pData->m_listVoidCell->Append(BRepPrimAPI_MakeBox(min_pnt,max_pnt).Shape()); + + McCadVoidCell * pVoid = new McCadVoidCell(BRepPrimAPI_MakeBox(min_pnt,max_pnt).Solid()); + pVoid->SetBntBox(xMin,yMin,zMin,xMax,yMax,zMax); + pData->m_VoidCellList.push_back(pVoid); + + cout<<"."; + } + } + } + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::VoidSolidCollision() +{ + McCadGeomData * pData = m_pManager->GetGeomData(); + + try + { + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell *pVoid = pData->m_VoidCellList[i]; + assert(pVoid); + + cout<<"Process No."<m_ConvexSolidList.size(); j++) + { + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[j]; + assert(pSolid); + + Bnd_Box bbox_solid = pSolid->GetBntBox(); + Bnd_Box bbox_void = pVoid->GetBntBox(); + + if(bbox_void.IsOut(bbox_solid)) // Detect the boundary boxes are collied or not + { + continue; + } + else + { + // Add the collided material solid's number into the void cell's list. + pVoid->AddColliedSolidNum(j); + } + } + cout<GetColliedSolidList().size(); j++) + { + cout<GetColliedSolidList()[j]<<" "; + } + cout <<"cells"<< endl; + }*/ + + } + catch(...) + { + cout << "#McCadVoidCellManage_Void & Face Collision Error" << endl; + } +} + + + + +/** ******************************************************************** +* @brief Calculate the collision between faces of solid and void cell +* +* @param const vector & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::VoidFaceCollision() +{ + McCadGeomData * pData = m_pManager->GetGeomData(); + + try + { + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell *pVoid = pData->m_VoidCellList[i]; + assert(pVoid); + cout<<"Void cell " << i+1 << " is collided with:"; + pVoid->CalColliedFaces(m_pManager->GetGeomData()); // Calculate the collision between the void cell and boundary surface. + } + cout< & theExtFaceList +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::SplitVoidCell() +{ + try + { + McCadGeomData * pData = m_pManager->GetGeomData(); + vector void_list; // Create a temporary void cell list to store the void cells after splitting. + for (int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = pData->m_VoidCellList.at(i); + assert(pVoid); + pVoid->SetSplitDepth(1); // Set the initial split depth. + + cout<<"Processing the "<SplitVoidCell(void_list, m_pManager->GetGeomData())) + { + pData->m_VoidCellList.erase(pData->m_VoidCellList.begin()+i); // Delete the original void cell + i--; // Move the point to the former position + } + cout<m_VoidCellList.push_back(void_list.at(j)); // Add the new void cell generated into void cell list. + } + void_list.clear(); + } + catch(...) + { + cout << "#McCadVoidCellManage_Void & Splitting Void Cell Error" << endl; + } + +} + + +/** ******************************************************************** +* @brief Generate the surface list of void cells. +* +* @param +* @return void +* +* @date 31/8/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::GenVoidSurfList() +{ + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_VoidCellList.size(); i++) + { + McCadVoidCell * pVoid = pData->m_VoidCellList.at(i); + assert(pVoid); + vector surf_list = pVoid->GetGeomFaceList(); + pData->AddGeomSurfList(surf_list); // Merge the sufaces with the surface list of material solids + } + + vector out_surf_list = pData->m_pOutVoid->GetGeomFaceList(); + pData->AddGeomSurfList(out_surf_list); // Add the surfaces of outer space into the surface list. +} + + +/** ******************************************************************** +* @brief The main process control function +* @param null +* @return void +* +* @date 31/10/2012 +* @modify 10/12/2013 +* @author Lei Lu +***********************************************************************/ +void McCadVoidGenerator::Process() +{ + if(m_pManager->GenVoid() == Standard_True)// If the switch of void generation is on + { + cout<<"=============== Step.3 Generate the void cells ==============="< +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif + +#define Item Handle_McCadConvexSolid +#define Item_hxx +#define TheSequence McCadMcRead_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadMcRead_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadMcRead_HSequenceOfCell_Type_() +#include + +Standard_EXPORT Handle_Standard_Type& McCad_HSequenceOfCell_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("TopTools_HsequenceOfConvexSolid", + sizeof(TopTools_HsequenceOfConvexSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(TopTools_HsequenceOfConvexSolid) Handle(TopTools_HsequenceOfConvexSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(TopTools_HsequenceOfConvexSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(TopTools_HsequenceOfConvexSolid))) { + _anOtherObject = Handle(TopTools_HsequenceOfConvexSolid)((Handle(TopTools_HsequenceOfConvexSolid)&)AnObject); + } + } + + return _anOtherObject ; +} + +const Handle(Standard_Type)& TopTools_HsequenceOfConvexSolid::DynamicType() const +{ + return STANDARD_TYPE(TopTools_HsequenceOfConvexSolid) ; +} diff --git a/src/MCCAD/McCadMcVoid/TopTools_HsequenceOfConvexSolid.hxx b/src/MCCAD/McCadMcVoid/TopTools_HsequenceOfConvexSolid.hxx new file mode 100644 index 0000000..71f446b --- /dev/null +++ b/src/MCCAD/McCadMcVoid/TopTools_HsequenceOfConvexSolid.hxx @@ -0,0 +1,151 @@ +#ifndef TOPTOOLS_HSEQUENCEOFCONVEXSOLID_H +#define TOPTOOLS_HSEQUENCEOFCONVEXSOLID_H + +// File generated by CPPExt (Transient) +// +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_HSequenceOfConvexSolid_HeaderFile +//#include +#endif + +#ifndef _MMgt_TShared_HeaderFile +#include +#endif + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif + +#include "McCadConvexSolid.hxx" + +class Standard_NoSuchObject; +class Standard_OutOfRange; + +class TopTools_HSequenceOfConvexSolid : public MMgt_TShared { + +public: +// Methods PUBLIC +// + +TopTools_HSequenceOfConvexSolid(); + + Standard_Boolean IsEmpty() const; + Standard_Integer Length() const; + + Standard_EXPORT void Clear() ; + Standard_EXPORT void Append(const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void Append(const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void Prepend(const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void Prepend(const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void Reverse() ; + + Standard_EXPORT void InsertBefore(const Standard_Integer anIndex, + const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void InsertBefore(const Standard_Integer anIndex, + const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void InsertAfter(const Standard_Integer anIndex, + const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT void InsertAfter(const Standard_Integer anIndex, + const Handle(TopTools_HSequenceOfConvexSolid)& aSequence) ; + Standard_EXPORT void Exchange(const Standard_Integer anIndex, + const Standard_Integer anOtherIndex) ; + Standard_EXPORT TopTools_HSequenceOfConvexSolid Split(const Standard_Integer anIndex) ; + Standard_EXPORT void SetValue(const Standard_Integer anIndex, + const Handle(McCadConvexSolid)& anItem) ; + Standard_EXPORT const Handle_McCadConvexSolid& Value(const Standard_Integer anIndex) const; + + Standard_EXPORT Handle_McCadConvexSolid& ChangeValue(const Standard_Integer anIndex) ; + Standard_EXPORT void Remove(const Standard_Integer anIndex) ; + Standard_EXPORT void Remove(const Standard_Integer fromIndex,const Standard_Integer toIndex) ; + + const TopTools_HSequenceOfConvexSolid& Sequence() const; + + TopTools_HSequenceOfConvexSolid& ChangeSequence() ; + + Standard_EXPORT Handle_TopTools_HSequenceOfConvexSolid ShallowCopy() const; + //Standard_EXPORT ~McCadCSGGeom_HSequenceOfCell(); + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + + protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + TopTools_HSequenceOfConvexSolid mySequence; + + +}; + +#define Item Handle_McCadCSGGeom_Cell +#define Item_hxx +#define TheSequence McCadCSGGeom_SequenceOfCell +#define TheSequence_hxx +#define TCollection_HSequence McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadCSGGeom_HSequenceOfCell +#define TCollection_HSequence_Type_() McCadCSGGeom_HSequenceOfCell_Type_() + +#include + +#undef Item +#undef Item_hxx +#undef TheSequence +#undef TheSequence_hxx +#undef TCollection_HSequence +#undef TCollection_HSequence_hxx +#undef Handle_TCollection_HSequence +#undef TCollection_HSequence_Type_ + + +// other Inline functions and methods (like "C++: function call" methods) +// +inline Handle_TopTools_HSequenceOfConvexSolid ShallowCopy(const Handle_TopTools_HSequenceOfConvexSolid& me) { + return me->ShallowCopy(); +} + + +#endif // TOPTOOLS_HSEQUENCEOFCONVEXSOLID_H +//#endif diff --git a/src/MCCAD/McCadMcWrite/McCadMcWrite_McInputGenerator.cxx b/src/MCCAD/McCadMcWrite/McCadMcWrite_McInputGenerator.cxx new file mode 100644 index 0000000..b81d309 --- /dev/null +++ b/src/MCCAD/McCadMcWrite/McCadMcWrite_McInputGenerator.cxx @@ -0,0 +1,25 @@ +#include + +McCadMcWrite_McInputGenerator::McCadMcWrite_McInputGenerator() +{ + myHeader = new TColStd_HSequenceOfAsciiString; +} + +void McCadMcWrite_McInputGenerator::MakeHeader() const +{ + +} + +void McCadMcWrite_McInputGenerator::AddHeaderText(const TCollection_AsciiString& theText) +{ + myHeader->Append(theText); +} + +void McCadMcWrite_McInputGenerator::PrintHeader(Standard_OStream& theStream) +{ +} + +void McCadMcWrite_McInputGenerator::PrintAll(Standard_OStream& theStream) +{ +} + diff --git a/src/MCCAD/McCadMcWrite/McCadMcWrite_McnpInputGenerator.cxx b/src/MCCAD/McCadMcWrite/McCadMcWrite_McnpInputGenerator.cxx new file mode 100644 index 0000000..813ab44 --- /dev/null +++ b/src/MCCAD/McCadMcWrite/McCadMcWrite_McnpInputGenerator.cxx @@ -0,0 +1,389 @@ +#include +#include + +#include +#include +#include +#include +#include +#include + + + +McCadMcWrite_McnpInputGenerator::McCadMcWrite_McnpInputGenerator() +{ + myNbMatCells = 0; + myNbVoidCells = 0; + myNbOuterCells = 0; + myNbTrsfCards = 0; + myNbSurfCards = 0; + myIsHeaded = false; + myIsNumbered = false; + myHeader = new TColStd_HSequenceOfAsciiString; + myCellSeq = NULL; + myInitSurfNb = 0; + myInitCellNb = 0; +} + + +McCadMcWrite_McnpInputGenerator::McCadMcWrite_McnpInputGenerator(const Handle(McCadCSGGeom_HSequenceOfCell)& theCellSeq) +{ + myCellSeq = theCellSeq; + myNbMatCells = 0; + myNbVoidCells = 0; + myNbOuterCells = 0; + myNbTrsfCards = 0; + myNbSurfCards = 0; + myIsHeaded = false; + myIsNumbered = false; + myHeader = new TColStd_HSequenceOfAsciiString; + myInitSurfNb = 0; + myInitCellNb = 0; +} + + +void McCadMcWrite_McnpInputGenerator::SetInitialSurfaceNumber(Standard_Integer& theInt) +{ + myInitSurfNb = theInt; +} + +void McCadMcWrite_McnpInputGenerator::SetInitialCellNumber(Standard_Integer& theInt) +{ + myInitCellNb = theInt; +} + + +void McCadMcWrite_McnpInputGenerator::SetCells(const Handle(McCadCSGGeom_HSequenceOfCell)& theCells) +{ + myCellSeq = theCells; +} + + +Handle(McCadCSGGeom_HSequenceOfCell) McCadMcWrite_McnpInputGenerator::GetCells() const +{ + return myCellSeq; +} + + +void McCadMcWrite_McnpInputGenerator::SetNbOfMatCells(const Standard_Integer theNumber) +{ + myNbMatCells = theNumber; +} + + +Standard_Integer McCadMcWrite_McnpInputGenerator::GetNbOfMatCells() const +{ + return myNbMatCells; +} + +void McCadMcWrite_McnpInputGenerator::SetNbOfVoidCells(const Standard_Integer theNumber) +{ + myNbVoidCells = theNumber; +} + + +Standard_Integer McCadMcWrite_McnpInputGenerator::GetNbOfVoidCells() const +{ + return myNbVoidCells; +} + + +void McCadMcWrite_McnpInputGenerator::SetNbOfOuterCells( const Standard_Integer theNumber) +{ + myNbOuterCells = theNumber; +} + + +Standard_Integer McCadMcWrite_McnpInputGenerator::GetNbOfOuterCells() const +{ + return myNbOuterCells; +} + + +void McCadMcWrite_McnpInputGenerator::MakeHeader() +{ + if (myHeader->Length() == 0) { + myHeader->Append("message:xsdir=xsdir"); + myHeader->Append(" ");; + myHeader->Append("McCad generated Input "); + myHeader->Append("c ------ Cells ------- "); + myHeader->Append(TCollection_AsciiString("c ------ Material cells ---------- ") + TCollection_AsciiString(myNbMatCells)); + myHeader->Append(TCollection_AsciiString("c ------ Void cells -------------- ") + TCollection_AsciiString(myNbVoidCells)); + myHeader->Append(TCollection_AsciiString("c ------ Outer Void cells -------- ") + TCollection_AsciiString(myNbOuterCells)); + } + myIsHeaded = true; +} + + +void McCadMcWrite_McnpInputGenerator::AppendToHeader(const TCollection_AsciiString& theText) +{ + myHeader->Append(theText); +} + + +void McCadMcWrite_McnpInputGenerator::SurfNumbering() +{ + myIsNumbered = true; + Standard_Integer icell=0, isurf=0; + + //modify isurf to manipulate start value of surface counter + isurf = myInitSurfNb; + icell = myInitCellNb; + //if cell counter is modified take also care of the complement cells in (this)->PrintCell() + + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface gloIter; + ofstream volOut("CadVolumes"); + if(!volOut) + { + cout << "Could not open file \"CadVolumes\" to save the CAD-Cell volumes \n\n"; + } + volOut << "Solid" << " " << "Volume\n==========================\n"; + + /////////////////////////////////////////////////////////////////// + for (Standard_Integer i=1; i<= myCellSeq->Length(); i++) //For all cells ... + { + TColStd_DataMapOfIntegerInteger surfNumMap; + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface locIter; + + Handle(McCadCSGGeom_Cell) curCell = myCellSeq->Value(i); + + curCell->SetCellNumber(icell+i); + curCell->SetSurfCounter(0); + + if(!curCell->IsVoid()) + volOut << curCell->GetCellNumber() << " \t" << setw(10) << curCell->GetVolume() << endl; + + /////////////////////////////////////////////////////////////////// + locIter = curCell->GetSurface(); + Standard_Integer gloSurfNum, locSurfNum; + Standard_Boolean isFound = Standard_False; + + for (; locIter.More() ; locIter.Next())//For all surfaces of current cell + { + Handle(McCadCSGGeom_Surface) locSurf = locIter.Value();//current surface + + locSurfNum = locIter.Key();//get local surface number + + for (gloIter.Initialize(myGlSurfaceMap); gloIter.More(); gloIter.Next()) + { + Handle(McCadCSGGeom_Surface) gloSurf = gloIter.Value(); + if(gloSurf->IsEqual(locSurf)) + { + isFound = Standard_True; + gloSurfNum = gloIter.Key(); + break; + } + else isFound = Standard_False; + } + if (isFound) + { + surfNumMap.Bind(locSurfNum,gloSurfNum); + } + else + { + isurf++; + gloSurfNum = isurf; + locSurf->SetNumber(gloSurfNum); + myGlSurfaceMap.Bind(gloSurfNum,locSurf); + surfNumMap.Bind(locSurfNum,gloSurfNum); + } + } + //////////////////////////////////////////////////////////////////// + // update the CSG expression + Handle(TColStd_HSequenceOfAsciiString) orCSG; + Handle(TColStd_HSequenceOfAsciiString) modCSG = new TColStd_HSequenceOfAsciiString; + + orCSG = curCell->GetCSG(); + + for(int j=1;j<= orCSG->Length();j++) + { + if((orCSG->Value(j)).IsIntegerValue()) + { + Standard_Integer orSurfNum = (orCSG->Value(j)).IntegerValue(); + Standard_Integer absOrSurfNum = abs(orSurfNum); + Standard_Integer glSurfNum = surfNumMap(absOrSurfNum); + + glSurfNum = abs(glSurfNum)*(orSurfNum/absOrSurfNum); // sign setting + modCSG->Append(glSurfNum); + } + else modCSG->Append(orCSG->Value(j)); + } + ///////////////////////////////////////////////////////////// + curCell->SetCSG(modCSG); + } +} + + +void McCadMcWrite_McnpInputGenerator::PrintHeader(Standard_OStream& theStream) +{ + if (myIsHeaded) { + for (Standard_Integer i=1; i<= myHeader->Length(); i++) + { + theStream << myHeader->Value(i) << endl; + } + } else { + MakeHeader(); + PrintHeader(theStream); + } +} + + +void McCadMcWrite_McnpInputGenerator::PrintCell(Standard_OStream& theStream) +{ + if (myIsNumbered) + { + Standard_Boolean haveVoidCommentPrinted = Standard_False; + TCollection_AsciiString previousComment("noComment"); + + for (Standard_Integer i=1; i<= myCellSeq->Length(); i++) + { + // add the complement cell to the csg of the cell + Handle_McCadCSGGeom_Cell theCell = myCellSeq->Value(i); + + Handle(TColStd_HSequenceOfInteger) theComplementCells = theCell->GetComplementCells(); + if(theComplementCells->Length() > 0 ) + { + for (Standard_Integer ii=1; ii<= theComplementCells->Length(); ii++) + { + TCollection_AsciiString tmpCSG(" "); + tmpCSG.InsertAfter(tmpCSG.Length(), "#"); + tmpCSG.InsertAfter(tmpCSG.Length(), TCollection_AsciiString(myInitCellNb + theComplementCells->Value(ii))); + tmpCSG.InsertAfter(tmpCSG.Length(), " "); // we close if com. + theCell->AppendToCSG(tmpCSG); + // aCSG.InsertAfter(aCSG.Length(),tmpCSG); + } + //theCell->AppendToCSG(aCSG); + } + + if(!haveVoidCommentPrinted) + { + if(theCell->GetComment() != previousComment) + { + previousComment = theCell->GetComment(); + theCell->PrintComment(theStream); //print comment of cell + } + } + + if(theCell->IsVoid()) + haveVoidCommentPrinted = Standard_True; + else + haveVoidCommentPrinted = Standard_False; + + theCell->PrintCell(theStream); + } + } + else + cout << "_#_McCadMcWrite_McnpInputGenerator.cxx :: Can not print cells due to missing numbering !!"<< endl; +} + + +void McCadMcWrite_McnpInputGenerator::PrintSurface(Standard_OStream& theStream) +{ + if (myIsNumbered) + { + ////////////////////////////////////////////////////////////////////////////// + theStream << " "<< endl; + theStream << "c ------ Surfaces -------- "<< endl; + int isurf=0; + // we put the global surface map into the first cell use its print function + (myCellSeq->Value(1))->SetSurface(myGlSurfaceMap); + (myCellSeq->Value(1))->SetSurfCounter(isurf); + (myCellSeq->Value(1))->PrintSurfaces(theStream); + } + else + cout << "_#_McCadMcWrite_McnpInputGenerator.cxx :: Can not print surface due to missing numbering !!"<< endl; + +} + + +void McCadMcWrite_McnpInputGenerator::PrintTrsf(Standard_OStream& theStream) +{ + if (myIsNumbered) + { + // theStream << " "<< endl; + int itrsf=0; + // we print here the trsf matrices + (myCellSeq->Value(1))->SetTrsfCounter(itrsf); + itrsf += (myCellSeq->Value(1))->GetNbOfSurfTrsf(); + (myCellSeq->Value(1))->PrintSurfaceTrsfMat(theStream); + // theStream << " "<< endl; + } else + cout + << "_#_McCadMcWrite_McnpInputGenerator.cxx :: Can not print surface transformation cards due to missing numbering !!" << endl; +} + + +void McCadMcWrite_McnpInputGenerator::PrintAllCells(Standard_OStream& theStream) +{ + theStream << "imp:n 1 " << myNbMatCells + myNbVoidCells << "r 0" << endl; +} + + +void McCadMcWrite_McnpInputGenerator::PrintAll(Standard_OStream& theStream) +{ + PrintHeader(theStream); + PrintCell(theStream); + PrintSurface(theStream); + PrintTrsf(theStream); +} + + +void McCadMcWrite_McnpInputGenerator::PrintAll(OSD_File& theFile) +{ + OSD_Path thePath; + theFile.Path(thePath); + TCollection_AsciiString theName = thePath.Name() + thePath.Extension(); + const char* strName = theName.ToCString(); + ofstream theStream(strName); + + PrintHeader(theStream); + PrintCell(theStream); + PrintSurface(theStream); + PrintMaterial(theStream); + PrintTrsf(theStream); +// PrintAllCells(theStream); +} + +void McCadMcWrite_McnpInputGenerator::PrintMaterial(Standard_OStream& theStream) +{ + Handle(TColStd_HSequenceOfInteger) numSeq = myMDReader.GetMCardNumbers(); + theStream << " "<< endl; + + //rank numbers and delete multiple MCards + ///////////////////////////////////////// + for(Standard_Integer i=1; i < numSeq->Length(); i++) + { + Standard_Integer iVal = numSeq->Value(i); + + for(Standard_Integer j=numSeq->Length(); j > i; j--) + { + Standard_Integer jVal = numSeq->Value(j); + + if(iVal == jVal) + numSeq->Remove(j); + + if(iVal > jVal) + { + numSeq->Exchange(i,j); + i--; + break; + } + + } + } + + //print material cards + //////////////////////////////////////// + for(Standard_Integer i=1; i<=numSeq->Length(); i++) + { + TCollection_AsciiString curMCard; + myMDReader.GetMCard(numSeq->Value(i), curMCard); + theStream << curMCard.ToCString(); + theStream << endl; + } +} + +void McCadMcWrite_McnpInputGenerator::SetMDReader(const McCadMDReader_Reader& theMDReader) +{ + myMDReader = theMDReader; +} diff --git a/src/MCCAD/McCadMcWrite/McCadMcWrite_TripoliInputGenerator.cxx b/src/MCCAD/McCadMcWrite/McCadMcWrite_TripoliInputGenerator.cxx new file mode 100644 index 0000000..8a27486 --- /dev/null +++ b/src/MCCAD/McCadMcWrite/McCadMcWrite_TripoliInputGenerator.cxx @@ -0,0 +1,389 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +McCadMcWrite_TripoliInputGenerator::McCadMcWrite_TripoliInputGenerator() +{ + myNbMatCells = 0; + myNbVoidCells = 0; + myNbOuterCells = 0; + myNbTrsfCards = 0; + myNbSurfCards = 0; + myIsHeaded = false; + myIsNumbered = false; + myHeader = new TColStd_HSequenceOfAsciiString; + myCellSeq = NULL; + myInitSurfNb = 0; + myInitCellNb = 0; +} + + +McCadMcWrite_TripoliInputGenerator::McCadMcWrite_TripoliInputGenerator(const Handle(McCadCSGGeom_HSequenceOfCell)& theCellSeq) +{ + myCellSeq = theCellSeq; + myNbMatCells = 0; + myNbVoidCells = 0; + myNbOuterCells = 0; + myNbTrsfCards = 0; + myNbSurfCards = 0; + myIsHeaded = false; + myIsNumbered = false; + myHeader = new TColStd_HSequenceOfAsciiString; + myInitSurfNb = 0; + myInitCellNb = 0; +} + + +void McCadMcWrite_TripoliInputGenerator::SetInitialSurfaceNumber(Standard_Integer& theInt) +{ + myInitSurfNb = theInt; +} + +void McCadMcWrite_TripoliInputGenerator::SetInitialCellNumber(Standard_Integer& theInt) +{ + myInitCellNb = theInt; +} + + +void McCadMcWrite_TripoliInputGenerator::SetCells(const Handle(McCadCSGGeom_HSequenceOfCell)& theCells) +{ + myCellSeq = theCells; +} + + +Handle(McCadCSGGeom_HSequenceOfCell) McCadMcWrite_TripoliInputGenerator::GetCells() const +{ + return myCellSeq; +} + + +void McCadMcWrite_TripoliInputGenerator::SetNbOfMatCells(const Standard_Integer theNumber) +{ + myNbMatCells = theNumber; +} + + +Standard_Integer McCadMcWrite_TripoliInputGenerator::GetNbOfMatCells() const +{ + return myNbMatCells; +} + +void McCadMcWrite_TripoliInputGenerator::SetNbOfVoidCells(const Standard_Integer theNumber) +{ + myNbVoidCells = theNumber; +} + + +Standard_Integer McCadMcWrite_TripoliInputGenerator::GetNbOfVoidCells() const +{ + return myNbVoidCells; +} + + +void McCadMcWrite_TripoliInputGenerator::SetNbOfOuterCells( const Standard_Integer theNumber) +{ + myNbOuterCells = theNumber; +} + + +Standard_Integer McCadMcWrite_TripoliInputGenerator::GetNbOfOuterCells() const +{ + return myNbOuterCells; +} + + +void McCadMcWrite_TripoliInputGenerator::MakeHeader() +{ + if (myHeader->Length() == 0) + { + myHeader->Append("COMMENT"); + myHeader->Append(" ------ Volumes ------- "); + myHeader->Append(TCollection_AsciiString(" ------ Material ---------- ") + TCollection_AsciiString(myNbMatCells)); + myHeader->Append(TCollection_AsciiString(" ------ Void -------------- ") + TCollection_AsciiString(myNbVoidCells)); + myHeader->Append("COMMENT \n\n"); + } + myIsHeaded = true; +} + + +void McCadMcWrite_TripoliInputGenerator::AppendToHeader(const TCollection_AsciiString& theText) +{ + myHeader->Append(theText); +} + + +void McCadMcWrite_TripoliInputGenerator::SurfNumbering() +{ + myIsNumbered = true; + Standard_Integer icell=0, isurf=0; + + //modify isurf to manipulate start value of surface counter + isurf = myInitSurfNb; + icell = myInitCellNb; + //if cell counter is modified take also care of the complement cells in (this)->PrintCell() + + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface gloIter; + ofstream volOut(".cadVolumes"); + if(!volOut) + cout << "Could not open file \".cadVolumes\" to save the CAD-Cell volumes \n\n"; + volOut << "Solid" << " " << "Volume\n==========================\n"; + + /////////////////////////////////////////////////////////////////// + for (Standard_Integer i=1; i<= myCellSeq->Length(); i++) //For all cells ... + { + McCadCSGGeom_DataMapOfIntegerSurface locSurfMap; + TColStd_DataMapOfIntegerInteger surfNumMap; + McCadCSGGeom_DataMapIteratorOfDataMapOfIntegerSurface locIter; + + Handle(McCadCSGGeom_Cell) curCell = myCellSeq->Value(i); + + curCell->SetCellNumber(icell+i); + curCell->SetSurfCounter(0); + + if(!curCell->IsVoid()) + volOut << icell+i << " \t" << setw(10) << curCell->GetVolume() << endl; + /////////////////////////////////////////////////////////////////// + locIter = curCell->GetSurface(); + Standard_Integer gloSurfNum, locSurfNum; + Standard_Boolean isFound = Standard_False; + + for (; locIter.More() ; locIter.Next())//For all surfaces of current cell + { + Handle(McCadCSGGeom_Surface) locSurf = locIter.Value();//current surface + + locSurfNum = locIter.Key();//get local surface number + + for (gloIter.Initialize(myGlSurfaceMap); gloIter.More(); gloIter.Next()) + { + Handle(McCadCSGGeom_Surface) gloSurf = gloIter.Value(); + if(gloSurf->IsEqual(locSurf)) + { + isFound = Standard_True; + gloSurfNum = gloIter.Key(); + break; + } + else isFound = Standard_False; + } + if (isFound) + { + surfNumMap.Bind(locSurfNum,gloSurfNum); + } + else + { + isurf++; + gloSurfNum = isurf; + locSurf->SetNumber(gloSurfNum); + myGlSurfaceMap.Bind(gloSurfNum,locSurf); + + surfNumMap.Bind(locSurfNum,gloSurfNum); + } + } + //////////////////////////////////////////////////////////////////// + // update the CSG expression + Handle(TColStd_HSequenceOfAsciiString) orCSG; + Handle(TColStd_HSequenceOfAsciiString) modCSG = new TColStd_HSequenceOfAsciiString; + + orCSG = curCell->GetCSG(); + + for(int j=1;j<= orCSG->Length();j++) + { + if((orCSG->Value(j)).IsIntegerValue()) + { + Standard_Integer orSurfNum = (orCSG->Value(j)).IntegerValue(); + Standard_Integer absOrSurfNum = abs(orSurfNum); + Standard_Integer glSurfNum = surfNumMap(absOrSurfNum); + + glSurfNum = abs(glSurfNum)*(orSurfNum/absOrSurfNum); // sign setting + modCSG->Append(glSurfNum); + } + else modCSG->Append(orCSG->Value(j)); + } + ///////////////////////////////////////////////////////////// + curCell->SetCSG(modCSG); + } +} + + +void McCadMcWrite_TripoliInputGenerator::PrintHeader(Standard_OStream& theStream) +{ + if (myIsHeaded) { + for (Standard_Integer i=1; i<= myHeader->Length(); i++) + { + theStream << myHeader->Value(i) << endl; + } + } else { + MakeHeader(); + PrintHeader(theStream); + } +} + + +void McCadMcWrite_TripoliInputGenerator::PrintCell(Standard_OStream& theStream) +{ + if (myIsNumbered) + { + Standard_Boolean haveVoidCommentPrinted = Standard_False; + + theStream << "// ------ Volumes --------" << endl; + + for (Standard_Integer i=1; i<= myCellSeq->Length(); i++) + { + Handle(McCadCSGGeom_Cell) theCell = myCellSeq->Value(i); + theCell->SetMCType(McCadCSGGeom_TRIPOLI); + + Handle(TColStd_HSequenceOfInteger) theComplementCells = theCell->GetComplementCells(); + if(theComplementCells->Length() > 0 ) + { + TCollection_AsciiString aCSG(" "); + for (Standard_Integer ii=1; ii<= theComplementCells->Length(); ii++) + { + TCollection_AsciiString tmpCSG(" "); + tmpCSG.InsertAfter(tmpCSG.Length(), "#"); + tmpCSG.InsertAfter(tmpCSG.Length(), TCollection_AsciiString(myInitCellNb + theComplementCells->Value(ii))); + tmpCSG.InsertAfter(tmpCSG.Length(), " "); // we close if com. + aCSG.InsertAfter(aCSG.Length(),tmpCSG); + } + theCell->AppendToCSG(aCSG); + } + + if(!haveVoidCommentPrinted) + theCell->PrintComment(theStream); //print comment of cell + + if(theCell->IsVoid()) + haveVoidCommentPrinted = Standard_True; + else + haveVoidCommentPrinted = Standard_False; + + theStream << setw(8) << " VOLU " << theCell->GetCellNumber() << " EQUA"; + theCell->PrintCell(theStream); + theStream << "\tENDV\n"; + } + } + else + cout << "_#_McCadMcWrite_TripoliInputGenerator.cxx :: Can not print cells due to missing numbering !!"<< endl; +} + + +void McCadMcWrite_TripoliInputGenerator::PrintSurface(Standard_OStream& theStream) +{ + if (myIsNumbered) + { + ////////////////////////////////////////////////////////////////////////////// + theStream << " "<< endl; + theStream << "// ------ Surfaces -------- "<< endl; + int isurf=0; + // we put the global surface map into the first cell use its print function + (myCellSeq->Value(1))->SetSurface(myGlSurfaceMap); + (myCellSeq->Value(1))->SetSurfCounter(isurf); + (myCellSeq->Value(1))->SetMCType(McCadCSGGeom_TRIPOLI); + (myCellSeq->Value(1))->PrintSurfaces(theStream); + } + else + cout << "_#_McCadMcWrite_TripoliInputGenerator.cxx :: Can not print surface due to missing numbering !!"<< endl; + +} + + +void McCadMcWrite_TripoliInputGenerator::PrintTrsf(Standard_OStream& theStream) +{ + if (myIsNumbered) + { + // theStream << " "<< endl; + int itrsf=0; + // we print here the trsf matrices + (myCellSeq->Value(1))->SetTrsfCounter(itrsf); + itrsf += (myCellSeq->Value(1))->GetNbOfSurfTrsf(); // good for nothing + (myCellSeq->Value(1))->PrintSurfaceTrsfMat(theStream); + // theStream << " "<< endl; + } else + cout + << "_#_McCadMcWrite_TripoliInputGenerator.cxx :: Can not print surface transformation cards due to missing numbering !!" << endl; +} + + +void McCadMcWrite_TripoliInputGenerator::PrintAllCells(Standard_OStream& theStream) +{ + theStream << "imp:n " << myNbMatCells + myNbVoidCells + myNbOuterCells << endl; +} + + +void McCadMcWrite_TripoliInputGenerator::PrintAll(Standard_OStream& theStream) +{ + PrintHeader(theStream); + PrintSurface(theStream); + PrintCell(theStream); + //PrintTrsf(theStream); +} + + +void McCadMcWrite_TripoliInputGenerator::PrintAll(OSD_File& theFile) +{ + OSD_Path thePath; + theFile.Path(thePath); + TCollection_AsciiString theName = thePath.Name() + thePath.Extension(); + const char* strName = theName.ToCString(); + ofstream theStream(strName); + + PrintHeader(theStream); + theStream << "GEOMETRY\n"; + theStream << "\t TITLE \t >>> McCad generated Input <<<\n"; // TITLE is mandatory!!! + PrintSurface(theStream); + PrintCell(theStream); + theStream << "ENDGEOM\n"; + + /*PrintMaterial(theStream); + PrintTrsf(theStream); + PrintAllCells(theStream);*/ +} + +void McCadMcWrite_TripoliInputGenerator::PrintMaterial(Standard_OStream& theStream) +{ + Handle(TColStd_HSequenceOfInteger) numSeq = myMDReader.GetMCardNumbers(); + theStream << " "<< endl; + + //rank numbers and delete multiple MCards + ///////////////////////////////////////// + for(Standard_Integer i=1; i < numSeq->Length(); i++) + { + Standard_Integer iVal = numSeq->Value(i); + + for(Standard_Integer j=numSeq->Length(); j > i; j--) + { + Standard_Integer jVal = numSeq->Value(j); + + if(iVal == jVal) + numSeq->Remove(j); + + if(iVal > jVal) + { + numSeq->Exchange(i,j); + i--; + break; + } + + } + } + + //print material cards + //////////////////////////////////////// + for(Standard_Integer i=1; i<=numSeq->Length(); i++) + { + TCollection_AsciiString curMCard; + myMDReader.GetMCard(numSeq->Value(i), curMCard); + theStream << curMCard.ToCString(); + theStream << endl; + } +} + +void McCadMcWrite_TripoliInputGenerator::SetMDReader(const McCadMDReader_Reader& theMDReader) +{ + myMDReader = theMDReader; +} diff --git a/src/MCCAD/McCadMessenger/McCadMessenger_Singleton.cxx b/src/MCCAD/McCadMessenger/McCadMessenger_Singleton.cxx new file mode 100644 index 0000000..110f7d3 --- /dev/null +++ b/src/MCCAD/McCadMessenger/McCadMessenger_Singleton.cxx @@ -0,0 +1,21 @@ +#include +#include + +McCadMessenger_Singleton* McCadMessenger_Singleton::m_instance = NULL; + +void McCadMessenger_Singleton::Register(McCadMessenger_ObserverInterface* observer){ + m_observers.push_back(observer); +} + +void McCadMessenger_Singleton::Message( std::string msg, +//qiu McCadMessenger_MessageType msgType = McCadMessenger_DefaultMsg){ + McCadMessenger_MessageType msgType ){ + + std::vector::iterator it; + + for( it = m_observers.begin(); it != m_observers.end(); it++){ + McCadMessenger_ObserverInterface* observer = (*it); + observer->PrintMessage(msg, msgType); + } + +} diff --git a/src/MCCAD/McCadMessenger/McCadMessenger_StdOut.cxx b/src/MCCAD/McCadMessenger/McCadMessenger_StdOut.cxx new file mode 100644 index 0000000..db85c78 --- /dev/null +++ b/src/MCCAD/McCadMessenger/McCadMessenger_StdOut.cxx @@ -0,0 +1,11 @@ +#include +#include + + +McCadMessenger_StdOut::McCadMessenger_StdOut(){ + +} + +void McCadMessenger_StdOut::PrintMessage(std::string message, McCadMessenger_MessageType type){ + std::cout << " McCad :: " << message << std::endl; +} diff --git a/src/MCCAD/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_0.cxx new file mode 100644 index 0000000..18eaa3f --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapOfIntegerExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtFace +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerExtFace +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_0.cxx new file mode 100644 index 0000000..760cd23 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_0.cxx @@ -0,0 +1,56 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapOfIntegerSolid_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtSolid +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerSolid +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_0.cxx new file mode 100644 index 0000000..3159b06 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapOfIntegerExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif +//McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace::~McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace", + sizeof(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace) Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace))) { + _anOtherObject = Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)((Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace) ; +} +//Standard_Boolean McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace::~Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtFace +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerExtFace +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_0.cxx new file mode 100644 index 0000000..da4cde0 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_0.cxx @@ -0,0 +1,102 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapOfIntegerSolid_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_HeaderFile +#include +#endif +//McCadTDS_DataMapNodeOfDataMapOfIntegerSolid::~McCadTDS_DataMapNodeOfDataMapOfIntegerSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_DataMapNodeOfDataMapOfIntegerSolid", + sizeof(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid) Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid))) { + _anOtherObject = Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)((Handle(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_DataMapNodeOfDataMapOfIntegerSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid) ; +} +//Standard_Boolean McCadTDS_DataMapNodeOfDataMapOfIntegerSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_DataMapNodeOfDataMapOfIntegerSolid) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid::~Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtSolid +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerSolid +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_DataMapOfIntegerExtFace_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_DataMapOfIntegerExtFace_0.cxx new file mode 100644 index 0000000..3983294 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_DataMapOfIntegerExtFace_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtFace +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerExtFace +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerExtFace_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerExtFace +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_DataMapOfIntegerSolid_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_DataMapOfIntegerSolid_0.cxx new file mode 100644 index 0000000..e40e4b9 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_DataMapOfIntegerSolid_0.cxx @@ -0,0 +1,59 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_HeaderFile +#include +#endif +#ifndef _McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem Handle_McCadTDS_ExtSolid +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_DataMapNode McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator McCadTDS_DataMapIteratorOfDataMapOfIntegerSolid +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_McCadTDS_DataMapNodeOfDataMapOfIntegerSolid +#define TCollection_DataMapNode_Type_() McCadTDS_DataMapNodeOfDataMapOfIntegerSolid_Type_() +#define TCollection_DataMap McCadTDS_DataMapOfIntegerSolid +#define TCollection_DataMap_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_ExtFace.cxx b/src/MCCAD/McCadTDS/McCadTDS_ExtFace.cxx new file mode 100644 index 0000000..ab37bc4 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_ExtFace.cxx @@ -0,0 +1,79 @@ +#include + +McCadTDS_ExtFace::McCadTDS_ExtFace() +{ + myPosPoints = new TColgp_HSequenceOfPnt(); + myNegPoints = new TColgp_HSequenceOfPnt(); + myHaveExt = Standard_False; + +} + +McCadTDS_ExtFace::McCadTDS_ExtFace(const TopoDS_Face& theFace) +{ + + myPosPoints = new TColgp_HSequenceOfPnt; + myNegPoints = new TColgp_HSequenceOfPnt; + myHaveExt = Standard_False; + myFace = theFace; +} + +void McCadTDS_ExtFace::SetFace(const TopoDS_Face& theFace) +{ + myFace = theFace; +} + +TopoDS_Face McCadTDS_ExtFace::GetFace() const +{ + return myFace; +} + +void McCadTDS_ExtFace::AppendPosPnt(const gp_Pnt& thePnt) +{ + myPosPoints->Append(thePnt); +} + +void McCadTDS_ExtFace::AppendNegPnt(const gp_Pnt& thePnt) +{ + myNegPoints->Append(thePnt); +} + +gp_Pnt McCadTDS_ExtFace::GetPosPnt() const +{ + return myPosPoints->Value(myPosPoints->Length()); +} + +gp_Pnt McCadTDS_ExtFace::GetNegPnt() const +{ + return myNegPoints->Value(myNegPoints->Length()); +} + +Standard_Integer McCadTDS_ExtFace::NbPosPnt() const +{ + return myPosPoints->Length(); +} + +Standard_Integer McCadTDS_ExtFace::NbNegPnt() const +{ + return myNegPoints->Length(); +} + +Handle(TColgp_HSequenceOfPnt) McCadTDS_ExtFace::GetPosPoints() const +{ + return myPosPoints; +} + +Handle(TColgp_HSequenceOfPnt) McCadTDS_ExtFace::GetNegPoints() const +{ + return myNegPoints; +} + +void McCadTDS_ExtFace::SetHaveExt(const Standard_Boolean theHaveExt) +{ + myHaveExt = theHaveExt; +} + +Standard_Boolean McCadTDS_ExtFace::HaveExt() const +{ + return myHaveExt; +} + diff --git a/src/MCCAD/McCadTDS/McCadTDS_ExtSolid.cxx b/src/MCCAD/McCadTDS/McCadTDS_ExtSolid.cxx new file mode 100644 index 0000000..7e6d4cb --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_ExtSolid.cxx @@ -0,0 +1,124 @@ +#include +#include + +McCadTDS_ExtSolid::McCadTDS_ExtSolid() +{ + myFaces = new TopTools_HSequenceOfShape; + myHaveExt = Standard_False; + myComplementFaces = new TopTools_HSequenceOfShape; + myHaveComplement = Standard_False; + myComment = TCollection_AsciiString("c McCad Generated Decomposed Solid!"); +} + + +McCadTDS_ExtSolid::McCadTDS_ExtSolid(const TopoDS_Solid& theSolid) +{ + mySolid = theSolid; + myFaces = new TopTools_HSequenceOfShape; + myHaveExt = Standard_False; + myComplementFaces = new TopTools_HSequenceOfShape; + myHaveComplement = Standard_False; + myComment = TCollection_AsciiString("c McCad Generated Decomposed Solid!"); +} + + +void McCadTDS_ExtSolid::SetSolid(const TopoDS_Solid& theSolid) +{ + mySolid = theSolid; +} + + +TopoDS_Solid McCadTDS_ExtSolid::GetSolid() const +{ + return mySolid; +} + + +void McCadTDS_ExtSolid::AppendFace(const TopoDS_Face& theFace) +{ + myFaces->Append(theFace); +} + + +void McCadTDS_ExtSolid::AppendFaces(const Handle(TopTools_HSequenceOfShape)& theFaceSeq) +{ + myFaces->Append(theFaceSeq); +} + + +TopoDS_Face McCadTDS_ExtSolid::GetFace() const +{ + return TopoDS::Face(myFaces->Value(myFaces->Length())); +} + + +Handle(TopTools_HSequenceOfShape) McCadTDS_ExtSolid::GetFaces() const +{ + return myFaces; +} + + +void McCadTDS_ExtSolid::SetHaveExt(const Standard_Boolean theHaveExt) +{ + myHaveExt = theHaveExt; +} + + +Standard_Boolean McCadTDS_ExtSolid::HaveExt() const +{ + return myHaveExt; +} + + +void McCadTDS_ExtSolid::SetHaveComp(const Standard_Boolean theHaveComp) +{ + myHaveComplement = theHaveComp; +} + + +Standard_Boolean McCadTDS_ExtSolid::HaveComp() const +{ + return myHaveComplement; +} + + +void McCadTDS_ExtSolid::AppendCompFace(const TopoDS_Face& theFace) +{ + myComplementFaces->Append(theFace); +} + + +void McCadTDS_ExtSolid::AppendCompFaces(const Handle(TopTools_HSequenceOfShape)& theFaceSeq) +{ + myComplementFaces->Append(theFaceSeq); +} + + +TopoDS_Face McCadTDS_ExtSolid::GetCompFace() const +{ + return TopoDS::Face(myComplementFaces->Value(myFaces->Length())); +} + + +Handle(TopTools_HSequenceOfShape) McCadTDS_ExtSolid::GetCompFaces() const +{ + return myComplementFaces; +} + + +void McCadTDS_ExtSolid::SetComment(const TCollection_AsciiString& theComment) +{ + myComment = theComment; +} + + +TCollection_AsciiString McCadTDS_ExtSolid::GetComment() const +{ + return myComment; +} + + +void McCadTDS_ExtSolid::PrintComment(Standard_OStream& theStream) +{ + theStream << (myComment).ToCString() << " " << endl; +} diff --git a/src/MCCAD/McCadTDS/McCadTDS_HSequenceOfExtFace_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_HSequenceOfExtFace_0.cxx new file mode 100644 index 0000000..8b08163 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_HSequenceOfExtFace_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_SequenceOfExtFace_HeaderFile +#include +#endif +//McCadTDS_HSequenceOfExtFace::~McCadTDS_HSequenceOfExtFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_HSequenceOfExtFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_HSequenceOfExtFace", + sizeof(McCadTDS_HSequenceOfExtFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_HSequenceOfExtFace) Handle(McCadTDS_HSequenceOfExtFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_HSequenceOfExtFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_HSequenceOfExtFace))) { + _anOtherObject = Handle(McCadTDS_HSequenceOfExtFace)((Handle(McCadTDS_HSequenceOfExtFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_HSequenceOfExtFace::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_HSequenceOfExtFace) ; +} +//Standard_Boolean McCadTDS_HSequenceOfExtFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_HSequenceOfExtFace) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTDS_HSequenceOfExtFace::~Handle_McCadTDS_HSequenceOfExtFace() {} +#define Item Handle_McCadTDS_ExtFace +#define Item_hxx +#define TheSequence McCadTDS_SequenceOfExtFace +#define TheSequence_hxx +#define TCollection_HSequence McCadTDS_HSequenceOfExtFace +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadTDS_HSequenceOfExtFace +#define TCollection_HSequence_Type_() McCadTDS_HSequenceOfExtFace_Type_() +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_HSequenceOfExtSolid_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_HSequenceOfExtSolid_0.cxx new file mode 100644 index 0000000..9e6562a --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_HSequenceOfExtSolid_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _McCadTDS_SequenceOfExtSolid_HeaderFile +#include +#endif +//McCadTDS_HSequenceOfExtSolid::~McCadTDS_HSequenceOfExtSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_HSequenceOfExtSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_HSequenceOfExtSolid", + sizeof(McCadTDS_HSequenceOfExtSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_HSequenceOfExtSolid) Handle(McCadTDS_HSequenceOfExtSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_HSequenceOfExtSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_HSequenceOfExtSolid))) { + _anOtherObject = Handle(McCadTDS_HSequenceOfExtSolid)((Handle(McCadTDS_HSequenceOfExtSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_HSequenceOfExtSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_HSequenceOfExtSolid) ; +} +//Standard_Boolean McCadTDS_HSequenceOfExtSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_HSequenceOfExtSolid) == AType || MMgt_TShared::IsKind(AType)); +//} +//Handle_McCadTDS_HSequenceOfExtSolid::~Handle_McCadTDS_HSequenceOfExtSolid() {} +#define Item Handle_McCadTDS_ExtSolid +#define Item_hxx +#define TheSequence McCadTDS_SequenceOfExtSolid +#define TheSequence_hxx +#define TCollection_HSequence McCadTDS_HSequenceOfExtSolid +#define TCollection_HSequence_hxx +#define Handle_TCollection_HSequence Handle_McCadTDS_HSequenceOfExtSolid +#define TCollection_HSequence_Type_() McCadTDS_HSequenceOfExtSolid_Type_() +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_NormFace.cxx b/src/MCCAD/McCadTDS/McCadTDS_NormFace.cxx new file mode 100644 index 0000000..e7407f5 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_NormFace.cxx @@ -0,0 +1,112 @@ +#include + +McCadTDS_NormFace::McCadTDS_NormFace() +{ + myHaveExt = Standard_False; + myID = 0; + myVertPnt = new TColgp_HSequenceOfPnt; + myVoxelSeq = new TColgp_HSequenceOfPnt; +} + +McCadTDS_NormFace::McCadTDS_NormFace(const TopoDS_Face& theFace) +{ + myFace = theFace; + myOirentation = theFace.Orientation(); + myHaveExt = Standard_False; + myID = 0; + myVertPnt = new TColgp_HSequenceOfPnt; + myVoxelSeq = new TColgp_HSequenceOfPnt; +} + +void McCadTDS_NormFace::SetFace(const TopoDS_Face& theFace) +{ + myFace = theFace; + myOirentation = theFace.Orientation(); +} + +TopoDS_Face McCadTDS_NormFace::GetFace() const +{ + return myFace; +} + +void McCadTDS_NormFace::SetVoxel(const Handle(TColgp_HSequenceOfPnt)& thePntSeq) +{ + myVoxelSeq->Clear(); + myVoxelSeq->Append(thePntSeq); + +} + +Handle(TColgp_HSequenceOfPnt) McCadTDS_NormFace::GetVoxel() const +{ + return myVoxelSeq; +} + +void McCadTDS_NormFace::SetVertPnt(const Handle(TColgp_HSequenceOfPnt)& thePntSeq) +{ + myVertPnt->Clear(); + myVertPnt->Append(thePntSeq); +} + +Handle(TColgp_HSequenceOfPnt) McCadTDS_NormFace::GetVertPnt() const +{ + return myVertPnt; +} + +void McCadTDS_NormFace::SetOirentation(const TopAbs_Orientation theOrient) +{ + myOirentation = theOrient; +} + +TopAbs_Orientation McCadTDS_NormFace::GetOirentation() const +{ + return myOirentation; +} + +Standard_Integer McCadTDS_NormFace::NbVoxelPnt() const +{ + return myVoxelSeq->Length(); +} + +Standard_Integer McCadTDS_NormFace::NbVertPnt() const +{ + return myVertPnt->Length(); +} + +void McCadTDS_NormFace::SetBBox(const Bnd_Box& theBBox) +{ + myBBox = theBBox; +} + +Bnd_Box McCadTDS_NormFace::GetBBox() const +{ + return myBBox; +} + +void McCadTDS_NormFace::SetID(const Standard_Integer theID) +{ + myID = theID; +} + +Standard_Integer McCadTDS_NormFace::GetID() const +{ + return myID; +} + +void McCadTDS_NormFace::DoVertPnt() +{ + for (TopExp_Explorer exV(myFace,TopAbs_VERTEX); exV.More(); exV.Next()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exV.Current())); + myVertPnt->Append(aPnt); + } + + +} + +void McCadTDS_NormFace::DoVoxel() +{ +} + +void McCadTDS_NormFace::DoBBox() +{ +} diff --git a/src/MCCAD/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtFace_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtFace_0.cxx new file mode 100644 index 0000000..9bac9f0 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtFace_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_SequenceOfExtFace_HeaderFile +#include +#endif +//McCadTDS_SequenceNodeOfSequenceOfExtFace::~McCadTDS_SequenceNodeOfSequenceOfExtFace() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_SequenceNodeOfSequenceOfExtFace_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_SequenceNodeOfSequenceOfExtFace", + sizeof(McCadTDS_SequenceNodeOfSequenceOfExtFace), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace) Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtFace))) { + _anOtherObject = Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)((Handle(McCadTDS_SequenceNodeOfSequenceOfExtFace)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_SequenceNodeOfSequenceOfExtFace::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtFace) ; +} +//Standard_Boolean McCadTDS_SequenceNodeOfSequenceOfExtFace::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtFace) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace::~Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace() {} +#define SeqItem Handle_McCadTDS_ExtFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtFace_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtFace +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtSolid_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtSolid_0.cxx new file mode 100644 index 0000000..b1cf366 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_SequenceNodeOfSequenceOfExtSolid_0.cxx @@ -0,0 +1,90 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _McCadTDS_SequenceOfExtSolid_HeaderFile +#include +#endif +//McCadTDS_SequenceNodeOfSequenceOfExtSolid::~McCadTDS_SequenceNodeOfSequenceOfExtSolid() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTDS_SequenceNodeOfSequenceOfExtSolid_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_SeqNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTDS_SequenceNodeOfSequenceOfExtSolid", + sizeof(McCadTDS_SequenceNodeOfSequenceOfExtSolid), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid) Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtSolid))) { + _anOtherObject = Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)((Handle(McCadTDS_SequenceNodeOfSequenceOfExtSolid)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTDS_SequenceNodeOfSequenceOfExtSolid::DynamicType() const +{ + return STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtSolid) ; +} +//Standard_Boolean McCadTDS_SequenceNodeOfSequenceOfExtSolid::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTDS_SequenceNodeOfSequenceOfExtSolid) == AType || TCollection_SeqNode::IsKind(AType)); +//} +//Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid::~Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid() {} +#define SeqItem Handle_McCadTDS_ExtSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtSolid_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtSolid +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_SequenceOfExtFace_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_SequenceOfExtFace_0.cxx new file mode 100644 index 0000000..251bb59 --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_SequenceOfExtFace_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtFace_HeaderFile +#include +#endif +#ifndef _McCadTDS_SequenceNodeOfSequenceOfExtFace_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadTDS_ExtFace +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtFace +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtFace_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtFace +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadTDS/McCadTDS_SequenceOfExtSolid_0.cxx b/src/MCCAD/McCadTDS/McCadTDS_SequenceOfExtSolid_0.cxx new file mode 100644 index 0000000..2e4092d --- /dev/null +++ b/src/MCCAD/McCadTDS/McCadTDS_SequenceOfExtSolid_0.cxx @@ -0,0 +1,47 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _McCadTDS_ExtSolid_HeaderFile +#include +#endif +#ifndef _McCadTDS_SequenceNodeOfSequenceOfExtSolid_HeaderFile +#include +#endif + + +#define SeqItem Handle_McCadTDS_ExtSolid +#define SeqItem_hxx +#define TCollection_SequenceNode McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_hxx +#define Handle_TCollection_SequenceNode Handle_McCadTDS_SequenceNodeOfSequenceOfExtSolid +#define TCollection_SequenceNode_Type_() McCadTDS_SequenceNodeOfSequenceOfExtSolid_Type_() +#define TCollection_Sequence McCadTDS_SequenceOfExtSolid +#define TCollection_Sequence_hxx +#include + diff --git a/src/MCCAD/McCadTool/Material.cxx b/src/MCCAD/McCadTool/Material.cxx new file mode 100644 index 0000000..8263d15 --- /dev/null +++ b/src/MCCAD/McCadTool/Material.cxx @@ -0,0 +1,51 @@ +#include "Material.hxx" + +Material::Material() +{ +} + +Material::~Material() +{ +} + + +/** ******************************************************************** +* @brief Set material +* +* @param int theID, material ID +* QString theName, material name +* double theDensity, material density +* QString theMatCard material card include compositions +* @return +* +* @date 12/11/2013 +* @author Lei Lu +************************************************************************/ +Material::Material(int theID, QString theName, double theDensity, QString theMatCard) +{ + m_ID = theID; + m_Name = theName; + m_Density = theDensity; + m_MatCard = theMatCard; +} + + +/** ******************************************************************** +* @brief Set material +* +* @param int theID, material ID +* QString theName, material name +* double theDensity, material density +* QString theMatCard material card include compositions +* @return +* +* @date 12/11/2013 +* @author Lei Lu +************************************************************************/ +void Material::SetMaterial(int theID, QString theName, double theDensity, QString theMatCard) +{ + m_ID = theID; + m_Name = theName; + m_Density = theDensity; + m_MatCard = theMatCard; +} diff --git a/src/MCCAD/McCadTool/Material.hxx b/src/MCCAD/McCadTool/Material.hxx new file mode 100644 index 0000000..decce9b --- /dev/null +++ b/src/MCCAD/McCadTool/Material.hxx @@ -0,0 +1,35 @@ +#ifndef MATERIAL_HXX +#define MATERIAL_HXX + +#include +#include + +class Material +{ +public: + Material(); + Material(int theID, QString theName, + double theDensity,QString theMatCard); + ~Material(); + +private: + int m_ID; // Material ID + QString m_Name; // Material Name + double m_Density; // Material Density + QString m_MatCard; // Composition of Material + +public: + //void SetMatID(Standard_Integer theID); + int GetMatID(){return m_ID;}; + + //void SetMatName(TCollection_AsciiString theName); + QString GetMatName(){return m_Name;}; + QString GetMatCard(){return m_MatCard;}; + + //void SetMatDensity(Standard_Real theDensity); + double GetMatDensity(){return m_Density;}; + void SetMaterial(int theID, QString theName, double theDensity, QString theMatCard); + void SetMatName(QString theName) {m_Name = theName;} +}; + +#endif // MATERIAL_HXX diff --git a/src/MCCAD/McCadTool/MaterialGroup.cxx b/src/MCCAD/McCadTool/MaterialGroup.cxx new file mode 100644 index 0000000..1d2b81d --- /dev/null +++ b/src/MCCAD/McCadTool/MaterialGroup.cxx @@ -0,0 +1,39 @@ +#include "MaterialGroup.hxx" + +MaterialGroup::MaterialGroup() +{ +} + +MaterialGroup::MaterialGroup(int iStartNum, int iEndNum, QString theName, Material theMaterial) +{ + m_iStartNum = iStartNum; + m_iEndNum = iEndNum; + m_iCellNum = iEndNum - iStartNum + 1; + m_strGroupName = theName; + m_Material = theMaterial; +} + +MaterialGroup::~MaterialGroup() +{ +} + + +QString MaterialGroup::GetMaterialName() +{ + return m_Material.GetMatName(); +} + +double MaterialGroup::GetDensity() +{ + return m_Material.GetMatDensity(); +} + +int MaterialGroup::GetMaterialID() +{ + return m_Material.GetMatID(); +} + +QString MaterialGroup::GetMaterialCard() +{ + return m_Material.GetMatCard(); +} diff --git a/src/MCCAD/McCadTool/MaterialGroup.hxx b/src/MCCAD/McCadTool/MaterialGroup.hxx new file mode 100644 index 0000000..02532b0 --- /dev/null +++ b/src/MCCAD/McCadTool/MaterialGroup.hxx @@ -0,0 +1,35 @@ +#ifndef MATERIALGROUP_HXX +#define MATERIALGROUP_HXX + +#include "Material.hxx" + +class MaterialGroup +{ +public: + MaterialGroup(); + MaterialGroup(int iStartNum, int iEndNum, QString theName, Material theMaterial); + ~MaterialGroup(); + +private: + int m_iStartNum; // the start number of material group + int m_iEndNum; // the end number of material group + + int m_iCellNum; // the number of cells in this group + Material m_Material; // the material of this group + + QString m_strGroupName; // the name of this group + + +public: + int GetStartNum(){return m_iStartNum;}; + int GetEndNum(){return m_iEndNum;}; + int GetCellNum(){return m_iCellNum;}; + QString GetGroupName(){return m_strGroupName;}; + + QString GetMaterialName(); + QString GetMaterialCard(); + double GetDensity(); + int GetMaterialID(); +}; + +#endif // MATERIALGROUP_HXX diff --git a/src/MCCAD/McCadTool/MaterialManager.cxx b/src/MCCAD/McCadTool/MaterialManager.cxx new file mode 100644 index 0000000..2225324 --- /dev/null +++ b/src/MCCAD/McCadTool/MaterialManager.cxx @@ -0,0 +1,977 @@ +#include "MaterialManager.hxx" +#include +#include +#include + +#include + +MaterialManager::MaterialManager() +{ + +} + +MaterialManager::~MaterialManager() +{ + // Delete the mapIDMat + map::iterator iter; + iter = m_mapMaterial.begin(); + + while(iter != m_mapMaterial.end()) + { + delete iter->second; + iter->second = NULL; + + //m_mapMaterial.erase(iter); + iter++; + } + m_mapMaterial.clear(); + + MaterialGroup *pGroup = NULL; + for(int i = 0; i::iterator,bool> result; + result = m_mapMaterial.insert(pair(theID,pMaterial)); + + if(result.second) + { + return Standard_True; + } + else + { + delete pMaterial; // Delete the created Material class + pMaterial = NULL; + return Standard_False; + } +} + + + + +/** ******************************************************************** +* @brief Delete the material from the map, with the input key +* +* @param int index // The key of the material being deleted +* @return Material* +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +Standard_Boolean MaterialManager::DeleteMaterial(int index) +{ + map::iterator iter; + iter = m_mapMaterial.find(index); + if (iter != m_mapMaterial.end()) + { + delete iter->second; + iter->second = NULL; + m_mapMaterial.erase(iter); // Remove the material from map + + return Standard_True; + } + else + { + return Standard_False; + } +} + + + + +/** ******************************************************************** +* @brief Get the material with key index +* +* @param int index // The key of the material map +* @return Material* +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +Material* MaterialManager::GetMaterial(const int index) +{ + map::iterator iter; + iter = m_mapMaterial.find(index); + if (iter != m_mapMaterial.end()) + { + return iter->second; + } + else + { + return NULL; + } +} + + + + +/** ******************************************************************** +* @brief Get the material list +* +* @param int index // The key of the material map +* @return Material* +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +vector MaterialManager::GetMatList() +{ + vector MatList; + map::iterator iter; + iter = m_mapMaterial.begin(); + while (iter != m_mapMaterial.end()) + { + MatList.push_back(iter->second); + iter++; + } + return MatList; +} + + + +/** ******************************************************************** +* @brief Get the detail material information +* +* @param const int index, // solid ID + int &iMatNum, // material ID + QString &groupName, // group name + double &fDensity, // density + QString &materialName // material name +* @return +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::GetMatInfo(const int index, + int &iMatNum, + QString &groupName, + double &fDensity, + QString &materialName) +{ + map::iterator iterGroup; + iterGroup = m_mapSolidGroup.find(index); + if (iterGroup != m_mapSolidGroup.end()) + { + groupName = iterGroup->second; + } + + map::iterator iterMat; + iterMat = m_mapGroupMaterial.find(groupName); + if (iterMat != m_mapGroupMaterial.end()) + { + iMatNum = iterMat->second; + } + + Material *pMat = NULL; + pMat = GetMaterial(iMatNum); + + fDensity = pMat->GetMatDensity(); + materialName = pMat->GetMatName(); +} + + +/** ******************************************************************** +* @brief Get the detail material information +* +* @param const int index, // solid ID + int &iMatNum, // material ID + QString &groupName, // group name + double &fDensity, // density + QString &materialName // material name +* @return +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +QString MaterialManager::GetGroupName(const int index) +{ + map::iterator iter; + iter = m_mapSolidGroup.find(index); + if (iter != m_mapSolidGroup.end()) + { + return iter->second; + } + else + { + return ""; + } +} + + +/** ******************************************************************** +* @brief Get the material id of one group +* +* @param QString &groupName, // group name + +* @return int // material id of this group +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +int MaterialManager::GetMatNum(const QString groupName) +{ + map::iterator iter; + iter = m_mapGroupMaterial.find(groupName); + if (iter != m_mapGroupMaterial.end()) + { + return iter->second; + } + else + { + return 0; + } +} + + +/** ******************************************************************** +* @brief Get the material density of a solid +* +* @param const int index, // solid ID + +* @return float // material density +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +float MaterialManager::GetMatDensity(const int index) +{ + Material *pMat = NULL; + pMat = GetMaterial(index); + if (pMat != NULL) + { + return pMat->GetMatDensity(); + } + else + { + return 0.0; + } +} + + + +/** ******************************************************************** +* @brief Input the solid id and get the material name +* +* @param const int index, // solid ID + +* @return (QString) // material name +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +QString MaterialManager::GetMatName(const int index) +{ + Material *pMat = NULL; + pMat = GetMaterial(index); + if (pMat != NULL) + { + return pMat->GetMatName(); + } + else + { + return ""; + } +} + + +/** ******************************************************************** +* @brief Insert a new material into the map record the +* material number and material information +* +* @param int index // The key of the item being changed +* int theID // New materia ID +* double theDensity // New material density +* QString theName, // New material name +* QString theMatCard // New material composition +* @return Standard_Boolean +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +Standard_Boolean MaterialManager::UpdateMaterial(int index, + int theID, + double theDensity, + QString theName, + QString theMatCard) +{ + map::iterator iter; + iter = m_mapMaterial.find(index); + if (iter != m_mapMaterial.end()) + { + m_mapMaterial.erase(iter); // Delete the original one + m_mapMaterial.insert(pair(theID,iter->second)); // update the map + + iter->second->SetMaterial(theID,theName,theDensity,theMatCard); //replace with the new material data + return Standard_True; + } + else + { + return Standard_False; + } +} + + + +/** ******************************************************************** +* @brief Insert a material group into material group and material map +* +* @param +* @return +* +* @date +* @author Lei Lu +************************************************************************/ +Standard_Boolean MaterialManager::InsertMatGroup(QString &GroupName, int &MateriaID) +{ + //map::iterator iter; + map::iterator iter; + iter = m_mapGroupMaterial.find(GroupName); + if (iter != m_mapGroupMaterial.end()) + { + m_mapGroupMaterial.erase(iter); // Delete the original one + m_mapGroupMaterial.insert(pair(GroupName,MateriaID)); // update the map + return Standard_True; + } + else + { + m_mapGroupMaterial.insert(pair(GroupName,MateriaID)); + return Standard_False; + } +} + + +/** ******************************************************************** +* @brief return the all the material number stored +* +* @param +* @return +* +* @date 27/10/2013 +* @author Lei Lu +************************************************************************/ +vector MaterialManager::GetMatIDList() +{ + vector MatIDList; + map::iterator iter; + iter = m_mapMaterial.begin(); + while (iter != m_mapMaterial.end()) + { + MatIDList.push_back(iter->first); + iter++; + } + return MatIDList; +} + + + + +/** ******************************************************************** +* @brief Generate a map to connect the solid id and material group +* +* @param int iSolidIDBegin, +* int iSolidIDEnd, +* QString strMatGroup +* @return +* +* @date 27/10/2013 +* @author Lei Lu +************************************************************************/ +Standard_Boolean MaterialManager::GenSolidGroupMap(int iSolidIDBegin, int iSolidIDEnd, + QString strMatGroup) +{ + if (0 == iSolidIDEnd) + { + return Standard_False; + } + + for (int i = iSolidIDBegin; i <= iSolidIDEnd; i++) + { + pair::iterator,bool> result; + result = m_mapSolidGroup.insert(pair(i,strMatGroup)); + + if(!result.second) + { + return Standard_False; + } + } +} + + + + +/** ******************************************************************** +* @brief Save the material information into a XML file +* +* @param QString theFileName(the XML file) +* @return +* +* @date 27/10/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::SaveXMLfile(QString theFileName) +{ + //theFileName.replace("/","\/"); + QFile *file = new QFile(theFileName); + if(!file->open(QFile::WriteOnly|QFile::Truncate)) + { + return; + } + + QDomDocument doc; + QDomProcessingInstruction instruction; + instruction = doc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\""); + doc.appendChild(instruction); + + QDomElement root=doc.createElement(("Material")); + doc.appendChild(root); + + if(!m_mapSolidGroup.empty()) + { + SaveSolidGroupMap(root, doc); // Save solidID-materialGroup map + } + + if(!m_mapGroupMaterial.empty()) + { + SaveMaterialGroupMap(root, doc); + } + + if(!m_mapMaterial.empty()) + { + SaveMaterialMap(root, doc); + } + + QTextStream out(file); + doc.save(out,4); + file->close(); +} + + + + +/** ******************************************************************** +* @brief Save the map connect the solid id and group name +* +* @param +* @return +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::SaveSolidGroupMap(QDomElement &prntItem, QDomDocument &domDoc) +{ + QDomElement solidGroupItem = domDoc.createElement(("SolidGroupMap")); + + map::iterator iter; + iter = m_mapSolidGroup.begin(); + + int iBegin = iter->first; + int iEnd = iBegin; + QString strGroup = iter->second; + int iGroup = 0; + + while(iter != m_mapSolidGroup.end()) + { + int iSolidID = iter->first; + QString strNextGroup = iter->second; + + iter++; + + if(iter == m_mapSolidGroup.end()) + { + iGroup ++; + iEnd = iSolidID; + } + else if (strNextGroup != strGroup) + { + iGroup ++; + iEnd = iSolidID - 1; + } + else + { + continue; + } + + QDomElement groupNode = domDoc.createElement("Group"); + groupNode.setAttribute("number",QString::number(iGroup)); + + QDomElement idBeginNode = domDoc.createElement("begin"); + QDomElement idEndNode = domDoc.createElement("end"); + QDomElement matNameNode = domDoc.createElement("name"); + + QDomText txtBegin = domDoc.createTextNode(QString::number(iBegin)); + QDomText txtEnd = domDoc.createTextNode(QString::number(iEnd)); + QDomText txtMaterial = domDoc.createTextNode(strGroup); + + idBeginNode.appendChild(txtBegin); + idEndNode.appendChild(txtEnd); + matNameNode.appendChild(txtMaterial); + + groupNode.appendChild(idBeginNode); + groupNode.appendChild(idEndNode); + groupNode.appendChild(matNameNode); + + solidGroupItem.appendChild(groupNode); + + strGroup = strNextGroup; + iBegin = iSolidID; + } + prntItem.appendChild(solidGroupItem); +} + + +/** ******************************************************************** +* @brief Save the material map +* +* @param +* @return +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::SaveMaterialMap(QDomElement &prntItem, QDomDocument &domDoc) +{ + QDomElement materialItem = domDoc.createElement(("MaterialMap")); + + map::iterator iter; + iter = m_mapMaterial.begin(); + + while(iter != m_mapMaterial.end()) + { + int iMatID = iter->first; // Material number + Material * pMat = iter->second; // Get the material + + QDomElement materialIDNode = domDoc.createElement("MaterialID"); + materialIDNode.setAttribute("number",QString::number(iMatID)); + + QDomElement idNode = domDoc.createElement("id"); + QDomElement nameNode = domDoc.createElement("name"); + QDomElement densityNode = domDoc.createElement("density"); + QDomElement mcardNode = domDoc.createElement("card"); + + QDomText txtID = domDoc.createTextNode(QString::number(pMat->GetMatID())); + QDomText txtName = domDoc.createTextNode(pMat->GetMatName()); + QDomText txtDensity = domDoc.createTextNode(QString::number(pMat->GetMatDensity())); + QDomText txtMatcard = domDoc.createTextNode(pMat->GetMatCard()); + + idNode.appendChild(txtID); + nameNode.appendChild(txtName); + densityNode.appendChild(txtDensity); + mcardNode.appendChild(txtMatcard); + + materialIDNode.appendChild(idNode); + materialIDNode.appendChild(nameNode); + materialIDNode.appendChild(densityNode); + materialIDNode.appendChild(mcardNode); + + materialItem.appendChild(materialIDNode); + iter++; + } + prntItem.appendChild(materialItem); +} + + +/** ******************************************************************** +* @brief Save the map connect groups and materials +* +* @param +* @return +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::SaveMaterialGroupMap(QDomElement &prntItem, QDomDocument &domDoc) +{ + QDomElement materialGroupItem = domDoc.createElement(("MaterialGroupMap")); + + map::iterator iter; + iter = m_mapGroupMaterial.begin(); + + do{ + QString strGroupNam = iter->first; + int iMaterialID = iter->second; + + QDomElement groupNode = domDoc.createElement("MatGroup"); + groupNode.setAttribute("Name",strGroupNam); + QDomText materialID = domDoc.createTextNode(QString::number(iMaterialID)); + groupNode.appendChild(materialID); + materialGroupItem.appendChild(groupNode); + + iter++; + }while(iter != m_mapGroupMaterial.end()) ; + + prntItem.appendChild(materialGroupItem); +} + + +/** ******************************************************************** +* @brief Read the XML file, load the material information +* +* @param QString theFileName (the input XML file which saves +* the material information) +* @return +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +Standard_Boolean MaterialManager::LoadXMLfile(QString theFileName, bool bRdSldGrpMap) +{ + // QString fileName = QString(theFileName.ToCString()); + QFile file(theFileName); + if(!file.open(QFile::ReadOnly)) + { + return Standard_False; + } + + QDomDocument doc; + if(!doc.setContent(&file)) + { + file.close(); + return Standard_False; + } + + // Store the mateirals map + QDomNodeList materialList = doc.elementsByTagName("MaterialMap"); + if (materialList.size() != 0) + { + LoadMaterialMap(materialList); + } + + if(bRdSldGrpMap) + { + // Store the group-material map + QDomNodeList materialGroupList = doc.elementsByTagName("MaterialGroupMap"); + if (materialGroupList.size() != 0) + { + LoadMaterialGroupMap(materialGroupList); + } + + // Store the solid-group map + QDomNodeList solidGroupList = doc.elementsByTagName("SolidGroupMap"); + if (solidGroupList.size() != 0) + { + LoadSolidGroupMap(solidGroupList); + } + } + + file.close(); + GenGroupData(); + return Standard_True; +} + + + +/** ******************************************************************** +* @brief Load the map connect groups and materials +* +* @param +* @return +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::LoadSolidGroupMap(QDomNodeList & theList) +{ + m_mapSolidGroup.clear(); + QDomNodeList groupList = theList.at(0).childNodes(); + for(int i = 0; i < groupList.size(); i++) + { + QDomNode groupNode = groupList.at(i).firstChild(); + int iBegin = 0; + int iEnd = 0; + QString strGroupName = ""; + + while(!groupNode.isNull()) + { + QDomElement groupElem = groupNode.toElement(); // convert the node to an element. + if(!groupElem.isNull()) + { + if (groupElem.tagName() == "begin") + { + iBegin = groupElem.text().toInt(); + } + else if(groupElem.tagName() == "end") + { + iEnd = groupElem.text().toInt(); + } + else if(groupElem.tagName() == "name") + { + strGroupName = groupElem.text(); + } + } + groupNode = groupNode.nextSibling(); + } + GenSolidGroupMap(iBegin,iEnd,strGroupName);// Create the solid id and material group map. + + // Add the group into the group list. + Material *pMat = GetMaterial(GetMatNum(strGroupName)); + MaterialGroup *pGroup = new MaterialGroup(iBegin,iEnd,strGroupName,*pMat); + m_Group.push_back(pGroup); + } +} + + + +/** ******************************************************************** +* @brief Load the map connect materials and groups +* +* @param +* @return +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::LoadMaterialGroupMap(QDomNodeList & theList) +{ + m_mapGroupMaterial.clear(); + QDomNodeList materialList = theList.at(0).childNodes(); + for(int i = 0; i < materialList.size(); i++) + { + QDomNode materialNode = materialList.at(i); + QString strGrpName(""); + int iMat; + + QDomElement materialElem = materialNode.toElement(); // convert the node to an element. + if(!materialElem.isNull()) + { + strGrpName = materialElem.attribute("Name"); + iMat = materialElem.text().toInt(); + } + InsertMatGroup(strGrpName,iMat);// Create the material and correspond material group map. + } +} + + + +/** ******************************************************************** +* @brief Load the map connect materials and their detail information +* +* @param +* @return +* +* @date 05/11/2013 +* @author Lei Lu +************************************************************************/ +void MaterialManager::LoadMaterialMap(QDomNodeList & theList) +{ + m_mapMaterial.clear(); + QDomNodeList materialList = theList.at(0).childNodes(); + for(int i = 0; i < materialList.size(); i++) + { + QDomNode materialNode = materialList.at(i).firstChild(); + + int iID = 0; // Serienumer of aterial + double fDensity = 0; // Density of material + QString strName = ""; // Material name + QString strMatCard = ""; // Material card includes the composition + + while(!materialNode.isNull()) + { + QDomElement materialElem = materialNode.toElement(); // convert the node to an element. + if(!materialElem.isNull()) + { + if (materialElem.tagName() == "id") + { + iID = materialElem.text().toInt(); + } + else if(materialElem.tagName() == "name") + { + strName = materialElem.text(); + } + else if(materialElem.tagName() == "density") + { + fDensity = materialElem.text().toDouble(); + } + else if(materialElem.tagName() == "card") + { + strMatCard = materialElem.text(); + } + } + materialNode = materialNode.nextSibling(); + } + InsertNewMaterial(iID,fDensity,strName,strMatCard); + + } +} + + + +/** ******************************************************************** +* @brief Input the group number, and get the corresponding group +* +* @param int theGroup, the number of group. +* @return +* +* @date 12/11/2013 +* @author Lei Lu +************************************************************************/ +MaterialGroup* MaterialManager::GetMaterialGroup(const int index) +{ + if( index >= m_Group.size() ) + { + return NULL; + } + + MaterialGroup * pGroup = m_Group.at(index); + return pGroup; +} + + + +/** ******************************************************************** +* @brief Generate the material information, e.g. each material group +* information +* +* @param +* @return void +* +* @date 05/11/2013 +* @author Lei Lu +***********************************************************************/ +void MaterialManager::GenGroupData() +{ + MaterialGroup *pGroup = NULL; + QString strCompare = ""; // record the group name for comparing + int iGroup = 0; // the serial number of group + + map::iterator iter; + iter = m_mapSolidGroup.begin(); + + while(iter != m_mapSolidGroup.end()) + { + int iSolid = iter->first; // Get the id of solid + QString groupName = iter->second; // Get the material + + /** Generate a map to store the material group information. + It will be printed before each one material group*/ + if (groupName != strCompare) // A new group starts + { + pGroup = GetMaterialGroup(iGroup); + iGroup++; + + // insert a new group information in group information map + pair::iterator,bool> result; + result = m_groupInfo.insert(pair(iSolid,pGroup)); + if(result.second) + { + strCompare = groupName; + } + } + iter++; + } + +// map::iterator iter; +// iter = m_mapMaterial.begin(); +// while (iter != m_mapMaterial.end()) +// { +// Material * pMat = GetMaterial(iter->first); +// m_material.push_back(pMat); +// iter++; +// } +} + + +MaterialGroup * MaterialManager::GetGroupData(const int index) +{ + map::iterator iter; + iter = m_groupInfo.find(index); + if(iter != m_groupInfo.end()) + { + return iter->second; + } + else + { + return NULL; + } +} + + + + + + + + + + + + + + + + + + + + + + + + + +/* TCollection_AsciiString theFileName = "test.txt"; + + OSD_Path thePath(theFileName); + OSD_File theFile(thePath); + theFile.Build(OSD_ReadWrite , OSD_Protection()); + + TCollection_AsciiString FileName = thePath.Name() + thePath.Extension(); + const char* strName = FileName.ToCString(); + ofstream theStream(strName); + + theStream.setf(ios::left); + + int iNumOfMat = m_mapSolidGroup.size(); + + map::iterator iter; + iter = m_mapSolidGroup.begin(); + + for(int i = 1; i <= iNumOfMat; i++ ) + { + int iSolidID = iter->first; + QString strGroup = iter->second; + + map::iterator material_iter; + material_iter = m_mapMatGroup.find(strGroup); + if (material_iter != m_mapMatGroup.end()) + { + int iMat = m_mapMatGroup.at(strGroup); + double fdensity = GetMaterial(iMat)->GetMatDensity(); + theStream< +#include +#include "Material.hxx" +#include "MaterialGroup.hxx" + +#include +#include +#include + +using namespace std; + +class MaterialManager +{ +public: + MaterialManager(); + ~MaterialManager(); + +public: + void SaveXMLfile(QString theFileName); + Standard_Boolean LoadXMLfile(QString theXMLfile, bool bRdSldGrpMap); + + Standard_Boolean InsertNewMaterial(int, double, QString, QString); // Insert Materia into map + Standard_Boolean DeleteMaterial(int index); // Delete Material from map + Standard_Boolean UpdateMaterial(int,int,double,QString,QString);// Change the material related to input key + Material* GetMaterial(const int index); // Get the material with key + vector GetMatIDList(); // Get the already stored material id + + // Get material number and group information based on the input index of solids. + void GetMatInfo(const int index, int&, QString&, double&, QString&); + + QString GetGroupName(const int index); + int GetMatNum(const QString groupName); + float GetMatDensity(const int index); + QString GetMatName(const int index); + + MaterialGroup* GetMaterialGroup(const int index); + + Standard_Boolean InsertMatGroup(QString &, int&); // Insert a new material group + Standard_Boolean GenSolidGroupMap(int iSolidIDBegin, int iSolidIDEnd, QString strMatGroup); // Generate a map connect the solid id and material group + + void GenGroupData(); + MaterialGroup * GetGroupData(const int index); + vector GetMatList(); + +private: + + map m_mapMaterial; // map stores the material number and corresponding material + map m_mapGroupMaterial; // map stores the group and corresponding material number + map m_mapSolidGroup; // map stores the solid id and corresponding group name + + vector m_Group; // record information of each group + + map m_groupInfo; /**< Store the material group information */ + //vector m_material; /**< Material list */ + + void SaveSolidGroupMap(QDomElement &, QDomDocument &); + void SaveMaterialGroupMap(QDomElement &, QDomDocument &); + void SaveMaterialMap(QDomElement &, QDomDocument &); + + void LoadSolidGroupMap(QDomNodeList &theList); + void LoadMaterialGroupMap(QDomNodeList &theList); + void LoadMaterialMap(QDomNodeList &theList); + //map mapSolidMatGrp; + //map<*MaterialGroup,*Material> mapMatGrpMat; + //map mapMaterialGroup; + +}; + +#endif // MATERIALMANAGER_HXX diff --git a/src/MCCAD/McCadTool/McCadConvertConfig.cxx b/src/MCCAD/McCadTool/McCadConvertConfig.cxx new file mode 100644 index 0000000..9704557 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadConvertConfig.cxx @@ -0,0 +1,369 @@ +#include "McCadConvertConfig.hxx" +#include + +#include +#include + +bool McCadConvertConfig::m_bWriteCollisionFile =false; +bool McCadConvertConfig::m_bVoidGenerate = true; + +double McCadConvertConfig::m_dTolerance = 1.0e-7; +double McCadConvertConfig::m_dMinIptSolidVol = 1.0; +double McCadConvertConfig::m_dMaxDiscLength = 200; +double McCadConvertConfig::m_dMinDecomFaceArea = 50; +double McCadConvertConfig::m_dMinVoidVol = 1.0; +double McCadConvertConfig::m_dAngleTolerance = 1.0e-3; + +unsigned int McCadConvertConfig::m_iVoidDecomposeDepth = 10; +unsigned int McCadConvertConfig::m_iInitCellNum = 0; +unsigned int McCadConvertConfig::m_iInitSurfNum = 0; +unsigned int McCadConvertConfig::m_iXResolution = 50; +unsigned int McCadConvertConfig::m_iYResolution = 50; +double McCadConvertConfig::m_iRResolution = 0.0314; + +unsigned int McCadConvertConfig::m_iMaxSmplPntNum = 50; +unsigned int McCadConvertConfig::m_iMinSmplPntNum = 20; + +TCollection_AsciiString McCadConvertConfig::m_strInputFileName = ""; +TCollection_AsciiString McCadConvertConfig::m_strMatFile = ""; +TCollection_AsciiString McCadConvertConfig::m_strDirectory = ""; +McCadGeom_Unit McCadConvertConfig::m_units; +map McCadConvertConfig::m_SurfSeq; + +McCadConvertConfig::McCadConvertConfig() +{ +} + +void McCadConvertConfig::SetSurfSequ() +{ + // xiugai lei + m_SurfSeq.clear(); + m_SurfSeq.insert(pair("PX",1)); + m_SurfSeq.insert(pair("PY",2)); + m_SurfSeq.insert(pair("PZ",3)); + m_SurfSeq.insert(pair("P",4)); + m_SurfSeq.insert(pair("SO",5)); + m_SurfSeq.insert(pair("SX",6)); + m_SurfSeq.insert(pair("SY",7)); + m_SurfSeq.insert(pair("SZ",8)); + m_SurfSeq.insert(pair("S ",9)); + m_SurfSeq.insert(pair("CX",10)); + m_SurfSeq.insert(pair("CY",11)); + m_SurfSeq.insert(pair("CZ",12)); + m_SurfSeq.insert(pair("C/X",13)); + m_SurfSeq.insert(pair("C/Y",14)); + m_SurfSeq.insert(pair("C/Z",15)); + m_SurfSeq.insert(pair("KX",16)); + m_SurfSeq.insert(pair("KY",17)); + m_SurfSeq.insert(pair("KZ",18)); + m_SurfSeq.insert(pair("K/X",19)); + m_SurfSeq.insert(pair("K/Y",20)); + m_SurfSeq.insert(pair("K/Z",21)); + m_SurfSeq.insert(pair("TX",22)); + m_SurfSeq.insert(pair("TY",23)); + m_SurfSeq.insert(pair("TZ",24)); + m_SurfSeq.insert(pair("GQ",25)); +} + + +/*qiu static*/ Standard_Integer McCadConvertConfig::GetSurfSequNum(TCollection_AsciiString SurfSymb) +{ + return m_SurfSeq[SurfSymb]; +} + +/*void McCadVoidPrmt::ReadPrmt(const TCollection_AsciiString InputFileName) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString message; + + QString fileName(InputFileName.ToCString()); + QFile file(fileName); + if(!file.open(QFile::ReadOnly|QFile::Text)) + { + message.AssignCat("Cannot open parameter XML file : "); + msgr->Message( message.ToCString(), McCadMessenger_ErrorMsg ); + file.close(); + return; + } + + QDomDocument doc; + QString errStr; + int errLine, errCol; + if (doc.setContent(&file,false,&errStr,&errLine,&errCol)) + { + message.AssignCat("Cannot open parameter XML file : "); + msgr->Message( message.ToCString(), McCadMessenger_ErrorMsg ); + file.close(); + return; + } + + QDomElement root = doc.documentElement(); + + bWriteCollisionFile = root.attributeNode("WriteCollisionFile").nodeValue().toInt(); + + iVoidDecomposeDepth = root.attributeNode("VoidDocomposeDepth").nodeValue().toInt(); + iInitCellNum = root.attributeNode("InitCellNum").nodeValue().toInt(); + iInitSurfNum = root.attributeNode("InitSurfNum").nodeValue().toInt(); + + iXResolution = root.attributeNode("XResolution").nodeValue().toInt(); + iYResolution = root.attributeNode("YResolution").nodeValue().toInt(); + + iMaxSmplPntNum = root.attributeNode("MaxSamplePoints").nodeValue().toInt(); + iMinSmplPntNum = root.attributeNode("MinSamplePoints").nodeValue().toInt(); + + dMinIptSolidVol = root.attributeNode("MinInputSolidVolume").nodeValue().toDouble(); + dMaxDiscLength = root.attributeNode("MaxDescriptionLength").nodeValue().toDouble(); + + dTolerance = root.attributeNode("Tolerance").nodeValue().toDouble(); + + strInputFileName = root.attributeNode("InputModelName").nodeValue().toStdString(); + strMatFile = root.attributeNode("MaterialFile").nodeValue().toStdString(); + strDirectory = root.attributeNode("WorkingDirectory").nodeValue().toStdString(); + +}*/ + +bool McCadConvertConfig::ReadPrmt(const TCollection_AsciiString InputFileName) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString message("_#_McCadConvertTools_InputFileParser :: "); + + // open parameter file + ifstream inFile(InputFileName.ToCString()); + if (!inFile) { + message.AssignCat("Cannot open parameter file : "); + message.AssignCat(InputFileName); + msgr->Message( message.ToCString(), McCadMessenger_ErrorMsg ); + return false; + } + + m_strInputFileName = InputFileName; + + // read file line by line + while(inFile) { + char str[255]; + inFile.getline(str,255); + TCollection_AsciiString iString(str); + + // skip empty lines + if(iString.IsEmpty()) + continue; + + // skip comment lines + iString.LeftAdjust(); + iString.RightAdjust(); + if(iString.Value(1) == '#') + continue; + + // turn tabs into spaces + iString.ChangeAll('\t', ' ', Standard_False); + + // directories to add + if( iString.Search(" ") < 0 ) { + iString += TCollection_AsciiString(" "); + m_strDirectory += iString; + } + //codeword with parameter + else { + int i = iString.Search(" "); + TCollection_AsciiString numString = iString.Split(i); + numString.LeftAdjust(); + numString.RightAdjust(); + iString.LeftAdjust(); + iString.RightAdjust(); + iString.UpperCase(); + + // search for codewords + if(iString.IsEqual("WRITECOLLISIONFILE")) { + if( numString.IsEqual("1") || numString.IsEqual("true") || + numString.IsEqual("True") || numString.IsEqual("TRUE") ) + { + m_bWriteCollisionFile = true; + } + else + m_bWriteCollisionFile = false; + } + else if(iString.IsEqual("MINIMUMINPUTSOLIDVOLUME")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString, numString); + else + m_dMinIptSolidVol = numString.RealValue(); + } + else if(iString.IsEqual("MINIMUMVOIDVOLUME")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else { + m_dMinVoidVol = numString.RealValue(); + } + } + else if(iString.IsEqual("MINIMUMSIZEOFDECOMPOSITIONFACEAREA")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_dMinDecomFaceArea = numString.RealValue(); + } + else if(iString.IsEqual("MAXCELLEXPRESSIONLENGTH")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_dMaxDiscLength = numString.RealValue(); + } + else if(iString.IsEqual("MAXDECOMPOSEDEPTH")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_iVoidDecomposeDepth = numString.IntegerValue(); + } + else if(iString.IsEqual("XRESOLUTION")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_iXResolution = numString.IntegerValue(); + } + else if(iString.IsEqual("YRESOLUTION")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_iYResolution = numString.IntegerValue(); + } + else if(iString.IsEqual("RRESOLUTION")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_iRResolution = numString.RealValue(); + } + else if(iString.IsEqual("MINIMUMNUMBEROFSAMPLEPOINTS")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_iMinSmplPntNum = numString.IntegerValue(); + } + else if(iString.IsEqual("MAXIMUMNUMBEROFSAMPLEPOINTS")) { + if(!numString.IsIntegerValue() && !numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_iMaxSmplPntNum = numString.IntegerValue(); + } + else if(iString.IsEqual("TOLERANCE")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_dTolerance = numString.RealValue(); + } + else if(iString.IsEqual("ANGLETOLERANCE")) { + if(!numString.IsRealValue()) + MissmatchMessage(iString,numString); + else + m_dAngleTolerance = numString.RealValue(); + } + else if(iString.IsEqual("MDFILE")) { + m_strMatFile = numString; + } + else if(iString.IsEqual("INITSURFNB")) { + if(!numString.IsIntegerValue()) + MissmatchMessage(iString,numString); + else + m_iInitSurfNum = numString.IntegerValue(); + } + else if(iString.IsEqual("INITCELLNB")) { + if(!numString.IsIntegerValue()) + MissmatchMessage(iString,numString); + else + m_iInitCellNum = numString.IntegerValue(); + } + else if(iString.IsEqual("VOIDGENERATE")) { + if( numString.IsEqual("1") || numString.IsEqual("true") || + numString.IsEqual("True") || numString.IsEqual("TRUE") ) + { + m_bVoidGenerate = true; + } + else + m_bVoidGenerate = false; + } + else if(iString.IsEqual("UNITS")) { + if(numString.IsEqual("CM") || numString.IsEqual("cm")) + m_units = McCadGeom_CM; + if(numString.IsEqual("MM") || numString.IsEqual("mm")) + m_units = McCadGeom_MM; + if(numString.IsEqual("INCH") || numString.IsEqual("inch")) + m_units = McCadGeom_Inch; + } + else{ + TCollection_AsciiString message("_#_McCadIOHelper_InputFileParser :: Unknown keyword : "); + message.AssignCat(iString); + msgr->Message(message.ToCString(), McCadMessenger_WarningMsg); + } + } + } + SetSurfSequ(); + return true; +} + +void McCadConvertConfig::MissmatchMessage(TCollection_AsciiString &keyword, TCollection_AsciiString ¶meter) +{ + McCadMessenger_Singleton* msgr = McCadMessenger_Singleton::Instance(); + TCollection_AsciiString message("_#_McCadConvertTools_InputFileParser :: "); + message.AssignCat("unexpected data type for keyword \'"); + message.AssignCat(keyword); + message.AssignCat("\' ( "); + message.AssignCat(parameter); + message.AssignCat(" ) "); + + msgr->Message(message.ToCString()); +} + + +void McCadConvertConfig::SetMinMaxSmplPntNum(int iMinPnt,int iMaxPnt) +{ + m_iMinSmplPntNum = iMinPnt; + m_iMaxSmplPntNum = iMaxPnt; +} + + + +bool McCadConvertConfig::WriteCollisionFile(){return m_bWriteCollisionFile;} +bool McCadConvertConfig::GenerateVoid(){return m_bVoidGenerate;} + +double McCadConvertConfig::GetTolerence(){return m_dTolerance;} +double McCadConvertConfig::GetAngleTolerance(){return m_dAngleTolerance;} +double McCadConvertConfig::GetMinIptSolidVod(){return m_dMinIptSolidVol;} +double McCadConvertConfig::GetMaxDiscLength(){return m_dMaxDiscLength;} +double McCadConvertConfig::GetMinDecomFaceArea(){return m_dMinDecomFaceArea;} +double McCadConvertConfig::GetMinVoidVol(){return m_dMinVoidVol;} + +unsigned int McCadConvertConfig::GetVoidDecomposeDepth(){return m_iVoidDecomposeDepth;} +unsigned int McCadConvertConfig::GetInitCellNum(){return m_iInitCellNum;} +unsigned int McCadConvertConfig::GetInitSurfNum(){return m_iInitSurfNum;} +unsigned int McCadConvertConfig::GetXResolution(){return m_iXResolution;} +unsigned int McCadConvertConfig::GetYResolution(){return m_iYResolution;} +unsigned int McCadConvertConfig::GetRResolution(){return m_iRResolution;} +unsigned int McCadConvertConfig::GetMaxSmplPntNum(){return m_iMaxSmplPntNum;} +unsigned int McCadConvertConfig::GetMinSmplPntNum(){return m_iMinSmplPntNum;} + +TCollection_AsciiString McCadConvertConfig::GetInputFileName(){return m_strInputFileName;} +TCollection_AsciiString McCadConvertConfig::GetMatFile(){return m_strMatFile;} +TCollection_AsciiString McCadConvertConfig::GetDirectory(){return m_strDirectory;} + + + +void McCadConvertConfig::SetWriteCollisionFile(const bool & bWriteCollisionFile){ m_bWriteCollisionFile = bWriteCollisionFile;} +void McCadConvertConfig::SetGenerateVoid(const bool & bVoidGenerate){ m_bVoidGenerate = bVoidGenerate;} + +void McCadConvertConfig::SetTolerence(const double & dTolerance){ m_dTolerance = dTolerance;} +void McCadConvertConfig::SetAngleTolerance(const double & dAngleTolerance){ m_dAngleTolerance = dAngleTolerance;} +void McCadConvertConfig::SetMinIptSolidVod(const double & dMinIptSolidVol){ m_dMinIptSolidVol = dMinIptSolidVol;} +void McCadConvertConfig::SetMaxDiscLength(const double & dMaxDiscLength ){ m_dMaxDiscLength = dMaxDiscLength;} +void McCadConvertConfig::SetMinDecomFaceArea(const double & dMinDecomFaceArea){ m_dMinDecomFaceArea = dMinDecomFaceArea;} +void McCadConvertConfig::SetMinVoidVol(const double & dMinVoidVol ){ m_dMinVoidVol = dMinVoidVol;} + +void McCadConvertConfig::SetVoidDecomposeDepth(const unsigned int & iVoidDecomposeDepth){ m_iVoidDecomposeDepth = iVoidDecomposeDepth;} +void McCadConvertConfig::SetInitCellNum(const unsigned int & iInitCellNum){ m_iInitCellNum = iInitCellNum;} +void McCadConvertConfig::SetInitSurfNum(const unsigned int & iInitSurfNum){ m_iInitSurfNum = iInitSurfNum;} +void McCadConvertConfig::SetXResolution(const unsigned int & iXResolution){ m_iXResolution = iXResolution;} +void McCadConvertConfig::SetYResolution(const unsigned int & iYResolution){ m_iYResolution = iYResolution;} +void McCadConvertConfig::SetRResolution(const unsigned int & iRResolution){ m_iRResolution = iRResolution;} +void McCadConvertConfig::SetMaxSmplPntNum(const unsigned int & iMaxSmplPntNum){ m_iMaxSmplPntNum = iMaxSmplPntNum;} +void McCadConvertConfig::SetMinSmplPntNum(const unsigned int & iMinSmplPntNum){ m_iMinSmplPntNum = iMinSmplPntNum;} + +void McCadConvertConfig::SetInputFileName(const TCollection_AsciiString &strInputFileName){ m_strInputFileName = strInputFileName;} +void McCadConvertConfig::SetMatFile(const TCollection_AsciiString &strMatFile){ m_strMatFile = strMatFile ;} +void McCadConvertConfig::SetDirectory(const TCollection_AsciiString &strDirectory){ m_strDirectory = strDirectory;} \ No newline at end of file diff --git a/src/MCCAD/McCadTool/McCadConvertConfig.hxx b/src/MCCAD/McCadTool/McCadConvertConfig.hxx new file mode 100644 index 0000000..aedf403 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadConvertConfig.hxx @@ -0,0 +1,125 @@ +#ifndef MCCADCONVERTCONFIG_HXX +#define MCCADCONVERTCONFIG_HXX + +#include +#include +#include + + + +enum McCadGeom_Unit { + McCadGeom_CM = 0, + McCadGeom_MM = 1, + McCadGeom_Inch = 2 +}; + +using namespace std; + +class McCadConvertConfig +{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + McCadConvertConfig(); + +private: + + static bool m_bWriteCollisionFile; /**< Whether write collision file or not */ + static bool m_bVoidGenerate; /**< Whether generate the void */ + + static double m_dTolerance; /**< Tolerence, the value less than tolerence will be treat as zero*/ + static double m_dMinIptSolidVol; /**< The minimum volume of input solid */ + static double m_dMaxDiscLength; /**< The maximum length of cell discription */ + static double m_dMinDecomFaceArea; + static double m_dMinVoidVol; + static double m_dAngleTolerance; /**< The angle toleranve between two direction */ + + static unsigned int m_iVoidDecomposeDepth; /**< The depth of void decomposition */ + static unsigned int m_iInitCellNum; /**< Initial cell number */ + static unsigned int m_iInitSurfNum; /**< Initial surface number */ + static unsigned int m_iXResolution; /**< Resolution of X axis */ + static unsigned int m_iYResolution; /**< Resolution of Y axis */ + static double m_iRResolution; /**< R direction */ + + static unsigned int m_iMaxSmplPntNum; /**< Max sample point number */ + static unsigned int m_iMinSmplPntNum; /**< Min sample point number */ + + static TCollection_AsciiString m_strInputFileName; /**< Input file name */ + static TCollection_AsciiString m_strMatFile; /**< Material file */ + static TCollection_AsciiString m_strDirectory; /**< Working directory */ + + static McCadGeom_Unit m_units; /**< Units of CAD model*/ + static map m_SurfSeq; + +public: + +Standard_EXPORT static void MissmatchMessage(TCollection_AsciiString &keyword, TCollection_AsciiString ¶meter); +Standard_EXPORT static void SetSurfSequ(); +Standard_EXPORT void AssignPrmt(const TCollection_AsciiString StringLine); + + Standard_EXPORT static Standard_Integer GetSurfSequNum(TCollection_AsciiString SurfSymb); + + Standard_EXPORT static bool ReadPrmt(const TCollection_AsciiString InputFileName); + Standard_EXPORT static bool WriteCollisionFile(); + Standard_EXPORT static bool GenerateVoid(); + + Standard_EXPORT static double GetTolerence(); + Standard_EXPORT static double GetAngleTolerance(); + Standard_EXPORT static double GetMinIptSolidVod(); + Standard_EXPORT static double GetMaxDiscLength(); + Standard_EXPORT static double GetMinDecomFaceArea(); + Standard_EXPORT static double GetMinVoidVol(); + + Standard_EXPORT static unsigned int GetVoidDecomposeDepth(); + Standard_EXPORT static unsigned int GetInitCellNum(); + Standard_EXPORT static unsigned int GetInitSurfNum(); + Standard_EXPORT static unsigned int GetXResolution(); + Standard_EXPORT static unsigned int GetYResolution(); + Standard_EXPORT static unsigned int GetRResolution(); + Standard_EXPORT static unsigned int GetMaxSmplPntNum(); + Standard_EXPORT static unsigned int GetMinSmplPntNum(); + + Standard_EXPORT static TCollection_AsciiString GetInputFileName(); + Standard_EXPORT static TCollection_AsciiString GetMatFile(); + Standard_EXPORT static TCollection_AsciiString GetDirectory(); + + Standard_EXPORT static void SetMinMaxSmplPntNum(int iMinPnt,int iMaxPnt); + + Standard_EXPORT static void SetWriteCollisionFile(const bool & bWriteCollisionFile); + Standard_EXPORT static void SetGenerateVoid(const bool & bVoidGenerate); + + Standard_EXPORT static void SetTolerence(const double & dTolerance); + Standard_EXPORT static void SetAngleTolerance(const double & dAngleTolerance); + Standard_EXPORT static void SetMinIptSolidVod(const double & dMinIptSolidVol); + Standard_EXPORT static void SetMaxDiscLength(const double & dMaxDiscLength ); + Standard_EXPORT static void SetMinDecomFaceArea(const double & dMinDecomFaceArea); + Standard_EXPORT static void SetMinVoidVol(const double & dMinVoidVol ); + + Standard_EXPORT static void SetVoidDecomposeDepth(const unsigned int & iVoidDecomposeDepth); + Standard_EXPORT static void SetInitCellNum(const unsigned int & iInitCellNum); + Standard_EXPORT static void SetInitSurfNum(const unsigned int & iInitSurfNum); + Standard_EXPORT static void SetXResolution(const unsigned int & iXResolution); + Standard_EXPORT static void SetYResolution(const unsigned int & iYResolution); + Standard_EXPORT static void SetRResolution(const unsigned int & iRResolution); + Standard_EXPORT static void SetMaxSmplPntNum(const unsigned int & iMaxSmplPntNum); + Standard_EXPORT static void SetMinSmplPntNum(const unsigned int & iMinSmplPntNum); + + Standard_EXPORT static void SetInputFileName(const TCollection_AsciiString &strInputFileName); + Standard_EXPORT static void SetMatFile(const TCollection_AsciiString &strMatFile); + Standard_EXPORT static void SetDirectory(const TCollection_AsciiString &strDirectory); +}; + +#endif // MCCADVOIDPRMT_HXX diff --git a/src/MCCAD/McCadTool/McCadFuseSurface.cxx b/src/MCCAD/McCadTool/McCadFuseSurface.cxx new file mode 100644 index 0000000..0c741eb --- /dev/null +++ b/src/MCCAD/McCadTool/McCadFuseSurface.cxx @@ -0,0 +1,551 @@ +#include "McCadFuseSurface.hxx" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../McCadMcVoid/IGeomFace.hxx" +#include "../McCadMcVoid/McCadGeomCylinder.hxx" +#include "../McCadMcVoid/McCadGeomCone.hxx" +#include "../McCadMcVoid/McCadGeomSphere.hxx" +#include "../McCadMcVoid/McCadGeomTorus.hxx" +#include "../McCadMcVoid/McCadGeomRevolution.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadTool/McCadMathTool.hxx" + +McCadFuseSurface::McCadFuseSurface() +{ +} + +McCadFuseSurface::~McCadFuseSurface() +{ +} + +/** ******************************************************************** +* @brief Judge the two edges are same or not, from the geometries of +* curves and start and end vertices +* +* @param edgeA(TopoDS_Edge&) edgeB(TopoDS_Edge&) +* @return bool +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +bool McCadFuseSurface::IsSameEdge(TopoDS_Edge & edgeA, TopoDS_Edge & edgeB ) +{ + /// Get the start and end points of the curves + Standard_Real fStartA, fEndA; + Handle(Geom_Curve) theCurveA = BRep_Tool::Curve(edgeA, fStartA, fEndA); + + gp_Pnt posStartA, posEndA; + theCurveA->D0(fStartA, posStartA); + theCurveA->D0(fEndA, posEndA); + + Standard_Real fStartB, fEndB; + Handle(Geom_Curve) theCurveB = BRep_Tool::Curve(edgeB, fStartB, fEndB); + + gp_Pnt posStartB, posEndB; + theCurveB->D0(fStartB, posStartB); + theCurveB->D0(fEndB, posEndB); + + /// If the type of curves are not same, return false. + if(GeomAdaptor_Curve(theCurveA).GetType() != GeomAdaptor_Curve(theCurveB).GetType()) + { + return false; + } + + /// If the start and end points of the two curves are same, then they are same curves + if ( ( posStartA.IsEqual(posEndB,1.e-5) && posEndA.IsEqual(posStartB,1.e-5) ) + || ( posStartA.IsEqual(posStartB,1.e-5) && posEndB.IsEqual(posEndA,1.e-5)) ) + { + return true; + } + else + { + return false; + } +} + + + +/** ******************************************************************** +* @brief . +* +* @param +* @return bool +* +* @date 13/03/2014 +* @author Lei Lu +***********************************************************************/ +bool McCadFuseSurface::IsSameSurfaces(GeomAdaptor_Surface &SurfA, GeomAdaptor_Surface &SurfB) +{ + IGeomFace * pGeomFaceA = NULL; + IGeomFace * pGeomFaceB = NULL; + switch (SurfA.GetType()) + { + case GeomAbs_Cylinder: + { + pGeomFaceA = new McCadGeomCylinder(SurfA); + pGeomFaceB = new McCadGeomCylinder(SurfB); + break; + } + case GeomAbs_Cone: + { + pGeomFaceA = new McCadGeomCone(SurfA); + pGeomFaceB = new McCadGeomCone(SurfB); + cout<<"GeomAbs_Cone"<IsEqual(pGeomFaceB)) + { + delete pGeomFaceA; + delete pGeomFaceB; + + pGeomFaceA = NULL; + pGeomFaceB = NULL; + + return true; + } + else + { + delete pGeomFaceA; + delete pGeomFaceB; + + pGeomFaceA = NULL; + pGeomFaceB = NULL; + + return false; + } + } + else + { + return false; + } +} + + +/** ******************************************************************** +* @brief . +* +* @param +* @return bool +* +* @date 13/03/2014 +* @author Lei Lu +***********************************************************************/ +bool McCadFuseSurface::HasCommonEdge(GeomAdaptor_Surface &SurfA, GeomAdaptor_Surface &SurfB) +{ + + /// Judge the surfaces have the common edge + for(TopExp_Explorer ex1(m_surfA, TopAbs_EDGE); ex1.More(); ex1.Next()) + { + TopoDS_Edge e1 = TopoDS::Edge(ex1.Current()); + for(TopExp_Explorer ex2(m_surfB, TopAbs_EDGE); ex2.More(); ex2.Next()) + { + TopoDS_Edge e2 = TopoDS::Edge(ex2.Current()); + if (IsSameEdge(e1, e2)) + { + return true; + } + } + } + return false; +} + + + +/** ******************************************************************** +* @brief Judge the two surfaces can be fused or not, from the geometries +* and whether they have the common edge or not. +* +* @param +* @return bool +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +bool McCadFuseSurface::CanbeFused() +{ + /// Get the geometries of the faces and judge they are same or not. + TopLoc_Location loc; + Handle_Geom_Surface hGeomA = BRep_Tool::Surface(m_surfA,loc); + GeomAdaptor_Surface GemoAdptSurfA(hGeomA); + + Handle_Geom_Surface hGeomB = BRep_Tool::Surface(m_surfB,loc); + GeomAdaptor_Surface GemoAdptSurfB(hGeomB); + + /// The planes are no need to add assisted surfaces, so they are no need to be fused + if( GemoAdptSurfA.GetType() == GeomAbs_Plane + || GemoAdptSurfB.GetType() == GeomAbs_Plane) + { + return false; + } + + if(GemoAdptSurfA.GetType() != GemoAdptSurfB.GetType()) + { + return false; + } + + TopAbs_Orientation orientA = m_surfA.Orientation(); + TopAbs_Orientation orientB = m_surfB.Orientation(); + if ((orientA != orientB)) + { + return false; + } + + if( GemoAdptSurfA.GetType() == GeomAbs_Torus + && GemoAdptSurfB.GetType() == GeomAbs_Torus) + { + if(orientA == TopAbs_REVERSED || orientB == TopAbs_REVERSED) + { + return false; + } + + if(IsSameSurfaces(GemoAdptSurfA,GemoAdptSurfB)) + { + return true; + } + else + { + return false; + } + } + else + { + if(orientA == TopAbs_FORWARD || orientB == TopAbs_FORWARD) + { + return false; + } + + if(IsSameSurfaces(GemoAdptSurfA,GemoAdptSurfB)&&HasCommonEdge(GemoAdptSurfA,GemoAdptSurfB)) + { + cout<<"Two cylinders with same geometries are merged."<= 2*M_PI ) + { + isClose = Standard_True; + } + + Standard_Real UMin(0.0),UMax(0.0), VMin(0.0), VMax(0.0); + +// if( Abs(UMin1-UMax2) < 1.0e-2 || ( UMin1 == 0 && Abs(UMax2-2*M_PI) < 1e-7 )) +// { +// UMin = UMin2; +// UMax = UMax1; +// } +// else if( Abs(UMin2-UMax1) < 1.0e-2 || ( UMin2 == 0 && Abs(UMax1-2*M_PI) < 1e-7 ) ) +// { +// UMin = UMin1; +// UMax = UMax2; +// } + + + if(UMax1 > 2*M_PI) + { + UMax1 -= 2*M_PI; + } + if(UMax2 > 2*M_PI) + { + UMax2 -= 2*M_PI; + } + if(UMin1 > 2*M_PI) + { + UMin1 -= 2*M_PI; + } + if(UMin2 > 2*M_PI) + { + UMin2 -= 2*M_PI; + } + + if( Abs(UMin1-UMax2) < Abs(UMin2-UMax1)) + { + UMin = UMin2; + UMax = UMax1; + } + else + { + UMin = UMin1; + UMax = UMax2; + } + + if(isClose) + { + UMin = 0; + UMax = 2*M_PI; + } + + if(isClose) + { + UMin = 0; + UMax = 2*M_PI; + } + + (VMin1 <= VMin2) ? VMin = VMin1 : VMin = VMin2; + (VMax1 >= VMax2) ? VMax = VMax1 : VMax = VMax2; + + TopLoc_Location loc; + const Handle(Geom_Surface)& aS1 = BRep_Tool::Surface(m_surfA,loc); + + TopoDS_Face face = BRepBuilderAPI_MakeFace(aS1, UMin,UMax, VMin, VMax, 1.e-7).Face(); + + Standard_Real UMin3,UMax3,VMin3,VMax3; + BRepTools::UVBounds(face,UMin3,UMax3,VMin3,VMax3); + + return face; + +// vector edge_listA; +// vector edge_listB; +// vector edge_listF; + +// /// Judge the surfaces have the common edge +// for(TopExp_Explorer ex1(m_surfA, TopAbs_EDGE); ex1.More(); ex1.Next()) +// { +// TopoDS_Edge e1 = TopoDS::Edge(ex1.Current()); +// edge_listA.push_back(e1); +// } + +// for(TopExp_Explorer ex2(m_surfB, TopAbs_EDGE); ex2.More(); ex2.Next()) +// { +// TopoDS_Edge e2 = TopoDS::Edge(ex2.Current()); +// edge_listB.push_back(e2); +// } + +// for(int i = 0; i < edge_listA.size(); i++) +// { +// bool bRepeat = false; +// TopoDS_Edge e1 = edge_listA.at(i); +// for (int j = 0; j < edge_listB.size(); j++) +// { +// TopoDS_Edge e2 = edge_listB.at(j); +// if (IsSameEdge(e1, e2)) +// { +// bRepeat = true; + +// edge_listB.erase(edge_listB.begin()+j); +// break; +// } +// } + +// if (!bRepeat) +// { +// edge_listF.push_back(e1); +// } +// } +} + + + +/** ******************************************************************** +* @brief connect the edges to be a wire . +* +* @param edge_list(vector) +* @return TopoDS_Wire +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +TopoDS_Wire McCadFuseSurface::MakeWire(vector &edge_list) +{ + BRepBuilderAPI_MakeWire wireMaker; + for(int i = 0; i < edge_list.size(); i++) + { + wireMaker.Add(edge_list.at(i)); + } + + TopoDS_Wire theWire = wireMaker.Wire(); + return theWire; +} + + + +/** ******************************************************************** +* @brief Fuse faces on the same surface that share an common edge . +* +* @param +* @return bool +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +bool McCadFuseSurface::Fuse() +{ + if (!CanbeFused()) + { + return false; + } + + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + + try + { + m_newSurf = FuseSurfaces(); + } + catch(...) + { + msgr->Message("_#_McCadFuseSurface :: Boolean Fuse Operation crashed!!!\n", + McCadMessenger_WarningMsg); + return false; + } + + BRepCheck_Analyzer face_analyzer(m_newSurf, true); // check validity of Result + if(!face_analyzer.IsValid()) + { + msgr->Message("_#_McCadFuseSurface :: The fused surface is not available\n", + McCadMessenger_WarningMsg); + return false; + } + + /// adjust orientation if neccessary - in some cases this is needed (even for fusion of planar faces)!!! + if(m_newSurf.Orientation() != m_surfA.Orientation()) + { + m_newSurf.Orientation(m_surfA.Orientation()); + } + + return true; + +// try +// { +// BRepAlgo_Fuse Fuser(m_surfA, m_surfB); +// if(!Fuser.IsDone()) +// { +// msgr->Message("_#_McCadFuseSurface :: Boolean Fuse Operation failed for two faces!", +// McCadMessenger_WarningMsg); +// return false; +// } + +// fused_shape = Fuser.Shape(); +// } +// catch(...) +// { +// msgr->Message("_#_McCadFuseSurface :: Boolean Fuse Operation crashed!!!\n", +// McCadMessenger_WarningMsg); +// return false; +// } +// for(TopExp_Explorer ex(fused_shape, TopAbs_FACE); ex.More(); ex.Next()) +// { +// m_newSurf = TopoDS::Face(ex.Current()); +// } + +} + + + +/** ******************************************************************** +* @brief Set the surfaces to be fused . +* +* @param surfA(TopoDS_Face) surfB(TopoDS_Face) +* @return void +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +void McCadFuseSurface::SetSurfaces(TopoDS_Face surfA, TopoDS_Face surfB) +{ + m_surfA = surfA; + m_surfB = surfB; +} + + + +/** ******************************************************************** +* @brief Get the new fused surface. +* +* @param +* @return TopoDS_Face +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +TopoDS_Face McCadFuseSurface::GetNewSurf() +{ + return m_newSurf; +} diff --git a/src/MCCAD/McCadTool/McCadFuseSurface.hxx b/src/MCCAD/McCadTool/McCadFuseSurface.hxx new file mode 100644 index 0000000..639fe00 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadFuseSurface.hxx @@ -0,0 +1,55 @@ +/** @file McCadFuseSurface.hxx + * + * @brief The class implements the fuse of two surfaces in solid with same geometries + * and common edge, the fuse of these surfaces will not generate the assisted + * surfaces for two separated surfaces respectively, but only one to the surface + * after fused. + * + * @author Lei Lu + * @date 4st.Feb.2014 + */ + +#ifndef MCCADFUSESURFACE_HXX +#define MCCADFUSESURFACE_HXX + +#include + +#include +#include +#include + +#include + +using namespace std; + +class McCadFuseSurface +{ +public: + McCadFuseSurface(); + ~McCadFuseSurface(); + + +public: + bool IsSame(); /**< The two surfaces are same or not */ + bool Fuse(); /**< Fuse the surfaces */ + void SetSurfaces(TopoDS_Face surfA, TopoDS_Face surfB); /**< Input the surfaces */ + TopoDS_Face GetNewSurf(); /**< Return the surface after fused */ + +private: + + TopoDS_Face m_surfA; /**< SurfaceA to be fused */ + TopoDS_Face m_surfB; /**< SurfaceB to be fused */ + TopoDS_Face m_newSurf; /**< New surface after fused */ + + bool CanbeFused(); /**< Judge the two surfaces satisfy the conditions of fuse */ + bool IsSameEdge(TopoDS_Edge & edgeA, TopoDS_Edge & edgeB); /**< The surfaces have common edge.*/ + TopoDS_Face FuseSurfaces(); /**< Fuse the two surfaces, use the UV boundaries */ + TopoDS_Wire MakeWire(vector &edge_list); /**< Connect the edges and make a wire*/ + + /**< Judge the two surfaces have same geometries */ + bool IsSameSurfaces(GeomAdaptor_Surface &SurfA, GeomAdaptor_Surface &SurfB); + bool HasCommonEdge(GeomAdaptor_Surface &SurfA, GeomAdaptor_Surface &SurfB); + +}; + +#endif // MCCADFUSESURFACE_HXX diff --git a/src/MCCAD/McCadTool/McCadGeneTool.cxx b/src/MCCAD/McCadTool/McCadGeneTool.cxx new file mode 100644 index 0000000..42cc4d6 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadGeneTool.cxx @@ -0,0 +1,15 @@ +#include "McCadGeneTool.hxx" + +McCadGeneTool::McCadGeneTool() +{ +} + +TCollection_AsciiString McCadGeneTool::ToAsciiString(const QString& theStr) +{ +//qiu char aStr[theStr.length()]; +//qiu QByteArray ba = theStr.toAscii(); +//qiu strcpy(aStr, ba.data()); +//qiu TCollection_AsciiString anAsciiStr(aStr); + TCollection_AsciiString anAsciiStr(theStr.toStdString().c_str()); + return anAsciiStr; +} diff --git a/src/MCCAD/McCadTool/McCadGeneTool.hxx b/src/MCCAD/McCadTool/McCadGeneTool.hxx new file mode 100644 index 0000000..2bbda2b --- /dev/null +++ b/src/MCCAD/McCadTool/McCadGeneTool.hxx @@ -0,0 +1,29 @@ +#ifndef MCCADGENETOOL_HXX +#define MCCADGENETOOL_HXX + +#include +#include + +class McCadGeneTool +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +public: + McCadGeneTool(); + Standard_EXPORT static TCollection_AsciiString ToAsciiString(const QString& theStr); +}; + +#endif // MCCADGENETOOL_HXX diff --git a/src/MCCAD/McCadTool/McCadGeomTool.cxx b/src/MCCAD/McCadTool/McCadGeomTool.cxx new file mode 100644 index 0000000..0335385 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadGeomTool.cxx @@ -0,0 +1,309 @@ +#include "McCadGeomTool.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "McCadConvertConfig.hxx" + +Standard_Real McCadGeomTool::m_MaxNbPnt; +Standard_Real McCadGeomTool::m_MinNbPnt; +Standard_Real McCadGeomTool::m_Xlen; +Standard_Real McCadGeomTool::m_Ylen; +Standard_Real McCadGeomTool::m_Rlen; +Standard_Real McCadGeomTool::m_Tolerance; + +McCadGeomTool::McCadGeomTool() +{ + +} + + +void McCadGeomTool::SetPrmt() +{ + m_MaxNbPnt = McCadConvertConfig::GetMaxSmplPntNum(); + m_MinNbPnt = McCadConvertConfig::GetMinSmplPntNum(); + m_Xlen = McCadConvertConfig::GetXResolution(); + m_Ylen = McCadConvertConfig::GetYResolution(); + m_Rlen = McCadConvertConfig::GetRResolution(); + m_Tolerance = McCadConvertConfig::GetTolerence(); +} + + +Handle_TColgp_HSequenceOfPnt McCadGeomTool::GetFaceSamplePnt(const TopoDS_Face& theFace) +{ + SetPrmt(); // Set the basic prameters for the mesh + Handle(TColgp_HSequenceOfPnt) thePntList = new TColgp_HSequenceOfPnt(); + + BRepClass_FaceClassifier bsc3d; // Classifier of face + + BRepAdaptor_Surface bSurf(theFace, Standard_True); // Create the face adaptor + GeomAdaptor_Surface gSurf = bSurf.Surface(); // Get the geometry surface + + for (TopExp_Explorer exv(theFace, TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt pnt_vtx = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + thePntList->Prepend(pnt_vtx); + } + + /* Traverse the edges of face, add them into sample points list */ + for (TopExp_Explorer ex(theFace, TopAbs_EDGE); ex.More(); ex.Next()) + { + DiscreteEdge(TopoDS::Edge(ex.Current()),theFace,gSurf,thePntList); + } + + RemoveRepeatPnt(thePntList); + + /* Get the points on face, add them into sample points list */ + Standard_Real U1, U2, V1, V2; + BRepTools::UVBounds(theFace, U1, U2, V1, V2); + + Standard_Real du = 1, dv = 1; + Standard_Real xLen = U2 - U1; + Standard_Real yLen = V2 - V1; + Standard_Integer xNumPnt; + Standard_Integer yNumPnt; + + if (gSurf.GetType() == GeomAbs_Cone ||gSurf.GetType() == GeomAbs_Cylinder) + { + m_Xlen = m_Rlen; + } + if (gSurf.GetType() == GeomAbs_Sphere ||gSurf.GetType() == GeomAbs_Torus) + { + m_Xlen = m_Rlen; + m_Ylen = m_Rlen; + } + + xNumPnt = AdjustSampleNum(xLen,m_Xlen); + yNumPnt = AdjustSampleNum(yLen,m_Ylen); + + ScaleSampleNum(3, xNumPnt, yNumPnt); + + du = xLen/Standard_Real(xNumPnt); + dv = yLen/Standard_Real(yNumPnt); + + if (gSurf.GetType() == GeomAbs_Sphere ||gSurf.GetType() == GeomAbs_Torus) + { + /*cout << "XLen = " << xLen << endl; + cout << "YLen = " << yLen << endl; + cout << "XNUMPNT = " << xNumPnt << endl; + cout << "YNUMPNT = " << yNumPnt << endl; + cout << "myMinNbPnt = " << m_MinNbPnt << endl;*/ + } + + for ( int j = 0; j <= yNumPnt; j++ ) + { + Standard_Real V = V1 + dv*j; + for ( int i = 0; i <= xNumPnt; i++ ) + { + gp_Pnt SamplePnt; + Standard_Real U = U1 + du*i; + gSurf.D0(U, V, SamplePnt); + gp_Pnt2d pnt2d(U, V); + + bsc3d.Perform(theFace, pnt2d, m_Tolerance); + if (bsc3d.State() == TopAbs_IN /*|| bsc3d.State() == TopAbs_ON*/) //MYTEST comment + { + thePntList->Append(SamplePnt); + } + } + } + + return thePntList; +} + + +void McCadGeomTool::DiscreteEdge(const TopoDS_Edge& theEdge, + const TopoDS_Face& theFace, + const GeomAdaptor_Surface & theSurf, + Handle(TColgp_HSequenceOfPnt) & thePntSeq) +{ + BRepAdaptor_Curve2d curve; // 2D curve to define the edge + curve.Initialize(theEdge, theFace); // Get the curve + + Standard_Real prmtFst = -1.0; // The first point parameter of curve + Standard_Real prmtLst = 1.0; // The last point parameter of curve + + if ( !(Precision::IsNegativeInfinite(curve.FirstParameter())) ) + { + prmtFst = curve.FirstParameter(); + } + + if ( !(Precision::IsPositiveInfinite(curve.LastParameter())) ) + { + prmtLst = curve.LastParameter(); + } + + gp_Pnt2d pnt2dFst = curve.Value(prmtFst); + gp_Pnt2d pnt2dLst = curve.Value(prmtLst); + gp_Pnt pnt3dFst = theSurf.Value(pnt2dFst.X(), pnt2dFst.Y()); + gp_Pnt pnt3dLst = theSurf.Value(pnt2dLst.X(), pnt2dLst.Y()); + + Standard_Real EgdeLen = pnt3dFst.Distance(pnt3dLst); + Standard_Integer NumPnt; + + NumPnt = AdjustEdgeSampleNum(EgdeLen,m_Ylen); + + BRepClass_FaceClassifier bsc3d; + for (int i = 0; i <= NumPnt; i++ ) + { + Standard_Real dPrmt = Standard_Real(i)/Standard_Real(NumPnt); + Standard_Real vPrmt = prmtFst + dPrmt*(prmtLst - prmtFst); + + gp_Pnt2d pnt2d = curve.Value(vPrmt); + gp_Pnt pnt3d = theSurf.Value(pnt2d.X(), pnt2d.Y()); + + bsc3d.Perform(theFace, pnt2d, m_Tolerance); + + if (bsc3d.State() == TopAbs_IN || bsc3d.State() == TopAbs_ON) + { + SimplifyPoint(pnt3d); + thePntSeq->Append(pnt3d); + } + } +} + + + +Handle_TColgp_HSequenceOfPnt McCadGeomTool::GetEdgeSamplePnt(const TopoDS_Face& theFace) +{ + SetPrmt(); // Set the basic prameters for the mesh + Handle(TColgp_HSequenceOfPnt) thePntList = new TColgp_HSequenceOfPnt(); + + BRepClass_FaceClassifier bsc3d; // Classifier of face + + BRepAdaptor_Surface bSurf(theFace, Standard_True); // Create the face adaptor + GeomAdaptor_Surface gSurf = bSurf.Surface(); // Get the geometry surface + + for (TopExp_Explorer exv(theFace, TopAbs_VERTEX); exv.More(); exv.Next()) + { + gp_Pnt pnt_vtx = BRep_Tool::Pnt(TopoDS::Vertex(exv.Current())); + thePntList->Prepend(pnt_vtx); + } + + /* Traverse the edges of face, add them into sample points list */ + for (TopExp_Explorer ex(theFace, TopAbs_EDGE); ex.More(); ex.Next()) + { + DiscreteEdge(TopoDS::Edge(ex.Current()),theFace,gSurf,thePntList); + } + + RemoveRepeatPnt(thePntList); + return thePntList; +} + + + + +void McCadGeomTool::SimplifyPoint(gp_Pnt & pnt3d) +{ + Standard_Real x = pnt3d.X(); + Standard_Real y = pnt3d.Y(); + Standard_Real z = pnt3d.Z(); + + x = ((long int)(x*10000000.0))/10000000.0; + y = ((long int)(y*10000000.0))/10000000.0; + z = ((long int)(z*10000000.0))/10000000.0; + + pnt3d.SetX(x); + pnt3d.SetY(y); + pnt3d.SetZ(z); +} + + + +void McCadGeomTool::ScaleSampleNum(int iCyc, int &xNum, int &yNum ) +{ + for(int i = 0; i < iCyc; i++) + { + if(( (xNum-1)*(yNum-1) )<( 10*10 )) //xiugai lei + { + xNum *= 2; + yNum *= 2; + } + else + { + break; + } + } +} + + + +void McCadGeomTool::RemoveRepeatPnt(Handle_TColgp_HSequenceOfPnt & thePntList) +{ + for (int i = 1; i < thePntList->Length(); i++) + { + gp_XYZ pA = ( thePntList->Value(i) ).XYZ(); + for (int j = i+1 ; j <= thePntList->Length(); j++) + { + gp_XYZ pB = ( thePntList->Value(j) ).XYZ(); + if (pA.IsEqual(pB, 1.e-05)) + { + thePntList->Remove(j); + } + } + } +} + + + +Standard_Integer McCadGeomTool::AdjustSampleNum(Standard_Real dLen, Standard_Real dPdfLen) +{ + Standard_Integer iNumPnt; + + if (int(dLen/dPdfLen) < m_MinNbPnt) + { + iNumPnt = m_MinNbPnt; + } + else if (int(dLen/dPdfLen) > m_MaxNbPnt) + { + iNumPnt = m_MaxNbPnt; + } + else + { + iNumPnt = (int(dLen/dPdfLen)); + } + return iNumPnt; +} + + + +Standard_Integer McCadGeomTool::AdjustEdgeSampleNum(Standard_Real dLen, Standard_Real dPdfLen) +{ + Standard_Integer iNumPnt; + if (int(dLen/dPdfLen) < m_MinNbPnt) + { + iNumPnt = m_MinNbPnt*10; + } + else if (int(dLen/dPdfLen) > m_MaxNbPnt) + { + iNumPnt = m_MaxNbPnt*10; + } + else + { + iNumPnt = (int(dLen/dPdfLen))*10; + } + return iNumPnt; +} + + + +Standard_Real McCadGeomTool::GetVolume(const TopoDS_Shape &theShape) +{ + GProp_GProps GP; + BRepGProp::VolumeProperties(theShape,GP); + return GP.Mass(); + //return 0; +} + + + diff --git a/src/MCCAD/McCadTool/McCadGeomTool.hxx b/src/MCCAD/McCadTool/McCadGeomTool.hxx new file mode 100644 index 0000000..c43375f --- /dev/null +++ b/src/MCCAD/McCadTool/McCadGeomTool.hxx @@ -0,0 +1,63 @@ +#ifndef MCCADGEOMTOOL_HXX +#define MCCADGEOMTOOL_HXX + +#include +#include +#include +#include +#include +#include + +class McCadGeomTool +{ + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +public: + McCadGeomTool(); + + Standard_EXPORT static Handle_TColgp_HSequenceOfPnt GetFaceSamplePnt(const TopoDS_Face& theFace); + Standard_EXPORT static Handle_TColgp_HSequenceOfPnt GetEdgeSamplePnt(const TopoDS_Face& theFace); + + static void DiscreteEdge( const TopoDS_Edge& theEdge, + const TopoDS_Face& theFace, + const GeomAdaptor_Surface & theSurf, + Handle(TColgp_HSequenceOfPnt) & thePntSeq); + + static void ScaleSampleNum(int iCyc, int &xNum, int &yNum ); + static void RemoveRepeatPnt(Handle_TColgp_HSequenceOfPnt & thePntList); + static Standard_Integer AdjustSampleNum(Standard_Real dLen, Standard_Real dPreDefLen); + static Standard_Integer AdjustEdgeSampleNum(Standard_Real dLen, Standard_Real dPdfLen); + + + Standard_EXPORT static Standard_Real GetVolume(const TopoDS_Shape &theShape); + static void SimplifyPoint(gp_Pnt &pnt3d); + static void SetPrmt(); + + //Standard_EXPORT static IsFaceCutSolid(const GeomAdaptor_Surface& theSurf, const gp_Pnt& thePoint) + +private: + + static Standard_Real m_MaxNbPnt; + static Standard_Real m_MinNbPnt; + static Standard_Real m_Xlen; + static Standard_Real m_Ylen; + static Standard_Real m_Rlen; + static Standard_Real m_Tolerance; + +}; + +#endif // MCCADGEOMTOOL_HXX diff --git a/src/MCCAD/McCadTool/McCadMathTool.cxx b/src/MCCAD/McCadTool/McCadMathTool.cxx new file mode 100644 index 0000000..ced5283 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadMathTool.cxx @@ -0,0 +1,67 @@ +#include "McCadMathTool.hxx" +#include "McCadConvertConfig.hxx" + +#include + +McCadMathTool::McCadMathTool() +{ +} + +void McCadMathTool::Integer(Standard_Real &theValue) +{ + if(theValue >= 0.0) + { + theValue = ceil(theValue); + } + else + { + theValue = floor(theValue); + } +} + +Standard_Boolean McCadMathTool::IsEqualZero(Standard_Real theValue) +{ + if( Abs(theValue) < McCadConvertConfig::GetTolerence() ) + { + return Standard_True; + } + else + { + return Standard_False; + } +} + + +/** ******************************************************************** +* @brief Set the value to be zero when it less than tolerance +* +* @param theValue(Standard_Real &), dTolerance (Standard_Real) +* @return theValue(Standard_Real &) +* +* @date 04/01/2014 +* @author Lei Lu +***********************************************************************/ +void McCadMathTool::ZeroValue(Standard_Real &theValue, Standard_Real dTolerance) +{ + if(Abs(theValue) < dTolerance) + { + theValue = 0.0; + } +} + +/** ******************************************************************** +* @brief Return the maximum value from the tree values +* +* @param value1(Standard_Real &), value2(Standard_Real &),value3(Standard_Real &) +* @return maximum value(Standard_Real &) +* +* @date 12/05/2015 +* @author Lei Lu +***********************************************************************/ +Standard_EXPORT /*qiu static*/ Standard_Real McCadMathTool::MaxValue(Standard_Real value1, + Standard_Real value2, + Standard_Real value3) +{ + return MAX3(value1,value2,value3); +} + diff --git a/src/MCCAD/McCadTool/McCadMathTool.hxx b/src/MCCAD/McCadTool/McCadMathTool.hxx new file mode 100644 index 0000000..006b1c1 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadMathTool.hxx @@ -0,0 +1,46 @@ +#ifndef MCCADMATHTOOL_HXX +#define MCCADMATHTOOL_HXX + +#include + +#include +#include + +#define MAX2(X, Y) (Abs(X) > Abs(Y)? Abs(X) : Abs(Y)) +#define MAX3(X, Y, Z) (MAX2(MAX2(X,Y) , Z) ) + +class McCadMathTool +{ +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + +public: + McCadMathTool(); + + /**< Change the float data to interger */ + Standard_EXPORT static void Integer(Standard_Real &theValue); + + /**< If the value less than the default tolerance, set it zero */ + Standard_EXPORT static Standard_Boolean IsEqualZero(Standard_Real theValue); + + /**< If the value less than tolerance set it zero */ + Standard_EXPORT static void ZeroValue(Standard_Real &theValue, Standard_Real dTolerance); + + /**< Reture the max one of the three input values */ + Standard_EXPORT static Standard_Real MaxValue(Standard_Real value1, Standard_Real value2, Standard_Real value3); + +}; + +#endif // MCCADMATHTOOL_HXX diff --git a/src/MCCAD/McCadTool/McCadTool_BooleanUnion.cxx b/src/MCCAD/McCadTool/McCadTool_BooleanUnion.cxx new file mode 100644 index 0000000..bb39ac3 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_BooleanUnion.cxx @@ -0,0 +1,201 @@ +#include + +void McCadTool_Task::Destroy() +{ + +} + +void McCadTool_BooleanUnion::Initialize(const Handle(McCadCom_CasDocument)& theDoc, + const Handle(McCadCom_CasView)& theView, + const Standard_Boolean theNeedSelect, + const Standard_Boolean theNeedDlg, + const Standard_Boolean theNeedRect, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myNeedSelect = theNeedSelect; + myNeedDlg = theNeedDlg; + myNeedRect = theNeedRect; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_SolidUnion; +} + + +void McCadTool_BooleanUnion::Execute() +{ + //Start(); + + Handle(AIS_InteractiveContext) theIC = myDoc->GetContext(); + + for(theIC->InitCurrent(); theIC->MoreCurrent(); theIC->NextCurrent()) + theIC->Erase(theIC->Current(),0,1); + + theIC->UpdateCurrentViewer(); + + + Done(); +} + +Standard_Boolean McCadTool_BooleanUnion::IsNull() +{ + return Standard_True; +} + +void McCadTool_BooleanUnion::UnExecute() +{ + Start(); + Done(); +} + + +void McCadTool_BooleanUnion::Suspend() +{ + Waiting(); +} + + +void McCadTool_BooleanUnion::Resume() +{ + Start(); +} + + +void McCadTool_BooleanUnion::SetState(const McCadTool_State theState) +{ + myState = theState; +} + + +void McCadTool_BooleanUnion::Start() +{ + SetState(McCadTool_Start); +} + + +void McCadTool_BooleanUnion::Running() +{ + SetState(McCadTool_Running); +} + + +void McCadTool_BooleanUnion::Waiting() +{ + SetState(McCadTool_Waiting); +} + + +void McCadTool_BooleanUnion::Done() +{ + SetState(McCadTool_Done); +} + + +McCadTool_State McCadTool_BooleanUnion::State() const +{ + return myState; +} + + +void McCadTool_BooleanUnion::MousePressEvent(const QMouseEvent& e) +{ +} + +void McCadTool_BooleanUnion::MouseReleaseEvent(const QMouseEvent& e) +{ +} + + +void McCadTool_BooleanUnion::MouseMoveEvent(const QMouseEvent& e) +{ +} + + +void McCadTool_BooleanUnion::MouseLeaveEvent() +{ +} + +void McCadTool_BooleanUnion::MouseEnterEvent() +{ +} + + +void McCadTool_BooleanUnion::SetCanUndo(const Standard_Boolean theState) +{ + myUndoState = theState; +} + +void McCadTool_BooleanUnion::SetCanRedo(const Standard_Boolean theState) +{ + myRedoState = theState; +} + + +Standard_Boolean McCadTool_BooleanUnion::CanUndo() const +{ + if (myUndoState) + return Standard_True; + else + return Standard_False; +} + + +Standard_Boolean McCadTool_BooleanUnion::CanRedo() const +{ + if (myRedoState) + return Standard_True; + else + return Standard_False; +} + + +void McCadTool_BooleanUnion::SetID(const McCadTool_BooleanUnionID theID) +{ + myID = theID; +} + + +McCadTool_BooleanUnionID McCadTool_BooleanUnion::GetID() const +{ + return myID; +} + + +Standard_Boolean McCadTool_BooleanUnion::NeedDlg() const +{ + return myNeedDlg; +} + + +void McCadTool_BooleanUnion::SetNeedDlg(const Standard_Boolean theState) +{ + myNeedDlg = theState; +} + + +Standard_Boolean McCadTool_BooleanUnion::NeedRect() const +{ + return myNeedRect; +} + + +void McCadTool_BooleanUnion::SetNeedRect(const Standard_Boolean theState) +{ + myNeedRect = theState; +} + + +Standard_Boolean McCadTool_BooleanUnion::NeedSelect() const +{ + return myNeedSelect; +} + + +void McCadTool_BooleanUnion::SetNeedSelect(const Standard_Boolean theState) +{ + myNeedSelect = theState; +} diff --git a/src/MCCAD/McCadTool/McCadTool_ListIteratorOfListOfTask_0.cxx b/src/MCCAD/McCadTool/McCadTool_ListIteratorOfListOfTask_0.cxx new file mode 100644 index 0000000..e79769f --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_ListIteratorOfListOfTask_0.cxx @@ -0,0 +1,52 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadTool_ListOfTask_HeaderFile +#include +#endif +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadTool_ListNodeOfListOfTask_HeaderFile +#include +#endif + + +#define Item Handle_McCadTool_Task +#define Item_hxx +#define TCollection_ListNode McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadTool_ListIteratorOfListOfTask +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_Type_() McCadTool_ListNodeOfListOfTask_Type_() +#define TCollection_List McCadTool_ListOfTask +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadTool/McCadTool_ListNodeOfListOfTask_0.cxx b/src/MCCAD/McCadTool/McCadTool_ListNodeOfListOfTask_0.cxx new file mode 100644 index 0000000..1d300b8 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_ListNodeOfListOfTask_0.cxx @@ -0,0 +1,95 @@ +// File generated by CPPExt (Transient) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadTool_ListOfTask_HeaderFile +#include +#endif +#ifndef _McCadTool_ListIteratorOfListOfTask_HeaderFile +#include +#endif +//McCadTool_ListNodeOfListOfTask::~McCadTool_ListNodeOfListOfTask() {} + + + +Standard_EXPORT Handle_Standard_Type& McCadTool_ListNodeOfListOfTask_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("McCadTool_ListNodeOfListOfTask", + sizeof(McCadTool_ListNodeOfListOfTask), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(McCadTool_ListNodeOfListOfTask) Handle(McCadTool_ListNodeOfListOfTask)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(McCadTool_ListNodeOfListOfTask) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(McCadTool_ListNodeOfListOfTask))) { + _anOtherObject = Handle(McCadTool_ListNodeOfListOfTask)((Handle(McCadTool_ListNodeOfListOfTask)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& McCadTool_ListNodeOfListOfTask::DynamicType() const +{ + return STANDARD_TYPE(McCadTool_ListNodeOfListOfTask) ; +} +//Standard_Boolean McCadTool_ListNodeOfListOfTask::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(McCadTool_ListNodeOfListOfTask) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_McCadTool_ListNodeOfListOfTask::~Handle_McCadTool_ListNodeOfListOfTask() {} +#define Item Handle_McCadTool_Task +#define Item_hxx +#define TCollection_ListNode McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadTool_ListIteratorOfListOfTask +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_Type_() McCadTool_ListNodeOfListOfTask_Type_() +#define TCollection_List McCadTool_ListOfTask +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadTool/McCadTool_ListOfTask_0.cxx b/src/MCCAD/McCadTool/McCadTool_ListOfTask_0.cxx new file mode 100644 index 0000000..11d0d69 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_ListOfTask_0.cxx @@ -0,0 +1,49 @@ +// File generated by CPPExt (Value) +// +// Copyright (C) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. +// +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _McCadTool_ListIteratorOfListOfTask_HeaderFile +#include +#endif +#ifndef _McCadTool_Task_HeaderFile +#include +#endif +#ifndef _McCadTool_ListNodeOfListOfTask_HeaderFile +#include +#endif + + +#define Item Handle_McCadTool_Task +#define Item_hxx +#define TCollection_ListNode McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_hxx +#define TCollection_ListIterator McCadTool_ListIteratorOfListOfTask +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_McCadTool_ListNodeOfListOfTask +#define TCollection_ListNode_Type_() McCadTool_ListNodeOfListOfTask_Type_() +#define TCollection_List McCadTool_ListOfTask +#define TCollection_List_hxx +#include + diff --git a/src/MCCAD/McCadTool/McCadTool_Task.cxx b/src/MCCAD/McCadTool/McCadTool_Task.cxx new file mode 100644 index 0000000..8663f2b --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_Task.cxx @@ -0,0 +1,192 @@ +#include + +void McCadTool_Task::Destroy() +{ + +} + +void McCadTool_Task::Initialize(const Handle(McCadCom_CasDocument)& theDoc, + const Handle(McCadCom_CasView)& theView, + const Standard_Boolean theNeedSelect, + const Standard_Boolean theNeedDlg, + const Standard_Boolean theNeedRect, + const McCadTool_State theState, + const Standard_Boolean theUndoState, + const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myNeedSelect = theNeedSelect; + myNeedDlg = theNeedDlg; + myNeedRect = theNeedRect; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_NoID; +} + + +void McCadTool_Task::Execute() +{ + Start(); + Done(); +} + +Standard_Boolean McCadTool_Task::IsNull() +{ + return Standard_True; +} + +void McCadTool_Task::UnExecute() +{ + Start(); + Done(); +} + + +void McCadTool_Task::Suspend() +{ + Waiting(); +} + + +void McCadTool_Task::Resume() +{ + Start(); +} + + +void McCadTool_Task::SetState(const McCadTool_State theState) +{ + myState = theState; +} + + +void McCadTool_Task::Start() +{ + SetState(McCadTool_Start); +} + + +void McCadTool_Task::Running() +{ + SetState(McCadTool_Running); +} + + +void McCadTool_Task::Waiting() +{ + SetState(McCadTool_Waiting); +} + + +void McCadTool_Task::Done() +{ + SetState(McCadTool_Done); +} + + +McCadTool_State McCadTool_Task::State() const +{ + return myState; +} + + +void McCadTool_Task::MousePressEvent(const QMouseEvent& e) +{ +} + +void McCadTool_Task::MouseReleaseEvent(const QMouseEvent& e) +{ +} + + +void McCadTool_Task::MouseMoveEvent(const QMouseEvent& e) +{ +} + + +void McCadTool_Task::MouseLeaveEvent() +{ +} + +void McCadTool_Task::MouseEnterEvent() +{ +} + + +void McCadTool_Task::SetCanUndo(const Standard_Boolean theState) +{ + myUndoState = theState; +} + +void McCadTool_Task::SetCanRedo(const Standard_Boolean theState) +{ + myRedoState = theState; +} + + +Standard_Boolean McCadTool_Task::CanUndo() const +{ + if (myUndoState) + return Standard_True; + else + return Standard_False; +} + + +Standard_Boolean McCadTool_Task::CanRedo() const +{ + if (myRedoState) + return Standard_True; + else + return Standard_False; +} + + +void McCadTool_Task::SetID(const McCadTool_TaskID theID) +{ + myID = theID; +} + + +McCadTool_TaskID McCadTool_Task::GetID() const +{ + return myID; +} + + +Standard_Boolean McCadTool_Task::NeedDlg() const +{ + return myNeedDlg; +} + + +void McCadTool_Task::SetNeedDlg(const Standard_Boolean theState) +{ + myNeedDlg = theState; +} + + +Standard_Boolean McCadTool_Task::NeedRect() const +{ + return myNeedRect; +} + + +void McCadTool_Task::SetNeedRect(const Standard_Boolean theState) +{ + myNeedRect = theState; +} + + +Standard_Boolean McCadTool_Task::NeedSelect() const +{ + return myNeedSelect; +} + + +void McCadTool_Task::SetNeedSelect(const Standard_Boolean theState) +{ + myNeedSelect = theState; +} diff --git a/src/MCCAD/McCadTool/McCadTool_TaskHistory.cxx b/src/MCCAD/McCadTool/McCadTool_TaskHistory.cxx new file mode 100644 index 0000000..5aa835a --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_TaskHistory.cxx @@ -0,0 +1,216 @@ +#include +#include + +McCadTool_TaskHistory::McCadTool_TaskHistory(const Standard_Integer theSize) +{ + mySize = theSize; +} + +void McCadTool_TaskHistory::Destroy() +{ + +} + +void McCadTool_TaskHistory::SetSize(const Standard_Integer theSize) +{ + mySize = theSize; +} + +Standard_Integer McCadTool_TaskHistory::GetSize() const +{ + return mySize; +} + +void McCadTool_TaskHistory::Log(const Handle(McCadTool_Task)& theTask) +{ + if (theTask->CanUndo()) + { + if( myUndoList.Extent() >= mySize) + { + // delete the oldest task; + myUndoList.RemoveFirst(); + myUndoList.Append(theTask); + } + else + { + myUndoList.Append(theTask); + } + } + if(theTask->CanRedo()) + { + if( myRedoList.Extent() >= mySize) + { + myRedoList.RemoveFirst(); + myRedoList.Append(theTask); + } + else + { + myRedoList.Append(theTask); + } + } +} + +Standard_Boolean McCadTool_TaskHistory::CanUndo() const +{ + return myUndoList.Extent() > 0; +} + +void McCadTool_TaskHistory::Undo() +{ + if( myUndoList.IsEmpty()) + return; + + Handle(McCadTool_Task) theTask = myUndoList.Last(); + theTask->UnExecute(); + + McCadTool_ListIteratorOfListOfTask iter; + Standard_Integer cnt(0); + for(iter.Initialize(myUndoList); iter.More(); iter.Next()) + { + cout << ".\n"; + if(cnt++ == myUndoList.Extent()) + myUndoList.Remove(iter); + } + + if(theTask->CanRedo()) + { + if( myRedoList.Extent() >= mySize) + { + myRedoList.RemoveFirst(); + myRedoList.Append(theTask); + } + else + { + myRedoList.Append(theTask); + } + } +} + +void McCadTool_TaskHistory::Undo(const Standard_Integer theIndex) +{ + Handle(McCadTool_Task) theTask; + + Standard_Integer i=0; + Standard_Boolean found = Standard_False; + + McCadTool_ListIteratorOfListOfTask iter; + for (iter.Initialize(myUndoList); iter.More(); iter.Next()) + { + i++; + if(i == theIndex) + { + theTask = iter.Value(); + found = Standard_True; + } + } + + if(found) + { + theTask->UnExecute(); + + McCadTool_ListIteratorOfListOfTask iter; + for (iter.Initialize(myUndoList); iter.More(); iter.Next()); + myUndoList.Remove(iter); + if(theTask->CanRedo()) + { + if( myRedoList.Extent() >= mySize) + { + myRedoList.RemoveFirst(); + myRedoList.Append(theTask); + } + else + { + myRedoList.Append(theTask); + } + } + } +} + +Standard_Boolean McCadTool_TaskHistory::CanRedo() const +{ + return myRedoList.Extent() > 0; +} + +void McCadTool_TaskHistory::Redo() +{ + + if( myRedoList.IsEmpty()) + return; + + Handle(McCadTool_Task) theTask = myRedoList.Last(); + theTask->Execute(); + + McCadTool_ListIteratorOfListOfTask iter; + for (iter.Initialize(myUndoList); iter.More(); iter.Next()); + myRedoList.Remove(iter); + + if(theTask->CanUndo()) + { + if( myUndoList.Extent() >= mySize) + { + myUndoList.RemoveFirst(); + myUndoList.Append(theTask); + } + else + { + myUndoList.Append(theTask); + } + } +} + +void McCadTool_TaskHistory::Redo(const Standard_Integer theIndex) +{ + Handle(McCadTool_Task) theTask; + Standard_Integer i=0; + Standard_Boolean found = Standard_False; + + McCadTool_ListIteratorOfListOfTask iter; + for (iter.Initialize(myRedoList); iter.More(); iter.Next()) + { + i++; + if(i == theIndex) + { + theTask = iter.Value(); + found = Standard_True; + } + + } + + if(found) + { + theTask->Execute(); + McCadTool_ListIteratorOfListOfTask iter; + for (iter.Initialize(myUndoList); iter.More(); iter.Next()); + myRedoList.Remove(iter); + if(theTask->CanUndo()) + { + if( myUndoList.Extent() >= mySize) + { + myUndoList.RemoveFirst(); + myUndoList.Append(theTask); + } + else + { + myUndoList.Append(theTask); + } + } + } + +} + +void McCadTool_TaskHistory::Clear() +{ + ClearUndoList(); + ClearRedoList(); +} + +void McCadTool_TaskHistory::ClearUndoList() +{ + myUndoList.Clear(); +} + +void McCadTool_TaskHistory::ClearRedoList() +{ + myRedoList.Clear(); +} + diff --git a/src/MCCAD/McCadTool/McCadTool_TaskMaster.cxx b/src/MCCAD/McCadTool/McCadTool_TaskMaster.cxx new file mode 100644 index 0000000..070a265 --- /dev/null +++ b/src/MCCAD/McCadTool/McCadTool_TaskMaster.cxx @@ -0,0 +1,178 @@ +#include + +McCadTool_TaskMaster::McCadTool_TaskMaster() +{ + myView = NULL; + myDefaultTask = new McCadTool_Task; + myCurrentTask = new McCadTool_Task; + myTaskHistory = new McCadTool_TaskHistory(10); + +} + +McCadTool_TaskMaster::McCadTool_TaskMaster(const Handle(McCadCom_CasView)& theView) +{ + myView = theView; + myDefaultTask = new McCadTool_Task; + myCurrentTask = new McCadTool_Task; + myTaskHistory = new McCadTool_TaskHistory(10); +} + +void McCadTool_TaskMaster::Destroy() +{ +} + +void McCadTool_TaskMaster::SetView(const Handle(McCadCom_CasView)& theView) +{ + myView = theView; +} + +Handle(McCadCom_CasView) McCadTool_TaskMaster::GetView() const +{ + return myView; +} + +void McCadTool_TaskMaster::SetDefaultTask(const Handle(McCadTool_Task)& theTask) +{ + myDefaultTask = theTask; +} + +Handle(McCadTool_Task) McCadTool_TaskMaster::GetDefaultTask() const +{ + return myDefaultTask; + +} + +void McCadTool_TaskMaster::SetCurrentTask(const Handle(McCadTool_Task)& theTask) +{ + myCurrentTask = theTask; +} + +Handle(McCadTool_Task) McCadTool_TaskMaster::GetCurrentTask() const +{ + return myCurrentTask; +} + +void McCadTool_TaskMaster::SetTaskHistory(const Handle(McCadTool_TaskHistory)& theTaskHist) +{ + myTaskHistory = theTaskHist; +} + +Handle(McCadTool_TaskHistory) McCadTool_TaskMaster::GetTaskHistory() const +{ + return myTaskHistory; +} + +void McCadTool_TaskMaster::Execute() +{ + if (myView == NULL) + { + cout << "Error: No view for the Task!" << endl; + return; + } + if (myCurrentTask == NULL) + { + cout << "Error: No Task for Execution!" << endl; + return; + } + + if (State() != McCadTool_Done) // current task is not executed! + { + myCurrentTask->Execute(); + myTaskHistory->Log(myCurrentTask); + } + else // current command is executed use History! + { + if (myTaskHistory->CanRedo()) + myTaskHistory->Redo(); + } +} + +void McCadTool_TaskMaster::UnExecute() +{ + if (myView == NULL) + { + cout << "Error: No view for the Task" << endl; + return; + } + if (myTaskHistory->CanUndo()) + myTaskHistory->Undo(); + else + return; +} + +void McCadTool_TaskMaster::Suspend() +{ + + if (myView != NULL && myCurrentTask != NULL) + myCurrentTask->Suspend(); + else + cout << "Error: No view for the Task" << endl; + +} + +void McCadTool_TaskMaster::Resume() +{ + if (myView != NULL && myCurrentTask != NULL) + myCurrentTask->Resume(); + else + cout << "Error: No view for the Task" << endl; +} + +void McCadTool_TaskMaster::SetState(const McCadTool_State theState) +{ + if (myView != NULL && myCurrentTask != NULL) + myCurrentTask->SetState(theState); + else + cout << "Error: No view for the Task" << endl; +} + +McCadTool_State McCadTool_TaskMaster::State() const +{ + McCadTool_State theState= McCadTool_None; + if (myView != NULL && myCurrentTask != NULL) + theState = myCurrentTask->State(); + else + cout << "Error: No view for the Task" << endl; + return theState; +} + +void McCadTool_TaskMaster::MousePressEvent(const QMouseEvent& e) +{ + if (myView != NULL) + return myCurrentTask->MousePressEvent(e); + else + cout << "Error: No view for the Task" << endl; +} + +void McCadTool_TaskMaster::MouseReleaseEvent(const QMouseEvent& e) +{ + if (myView != NULL) + return myCurrentTask->MouseReleaseEvent(e); + else + cout << "Error: No view for the Task" << endl; +} + +void McCadTool_TaskMaster::MouseMoveEvent(const QMouseEvent& e) +{ + if (myView != NULL) + return myCurrentTask->MouseMoveEvent(e); + else + cout << "Error: No view for the Task" << endl; +} + +void McCadTool_TaskMaster::MouseLeaveEvent() +{ + if (myView != NULL) + return myCurrentTask->MouseLeaveEvent(); + else + cout << "Error: No view for the Task" << endl; +} + +void McCadTool_TaskMaster::MouseEnterEvent() +{ + if (myView != NULL) + return myCurrentTask->MouseEnterEvent(); + else + cout << "Error: No view for the Task" << endl; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Axis.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Axis.cxx new file mode 100644 index 0000000..f5a948a --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Axis.cxx @@ -0,0 +1,76 @@ +#include +#include + +McCadViewTool_Axis::McCadViewTool_Axis(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Axis; +} + +void McCadViewTool_Axis::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_Axis::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_Axis::Execute() +{ + Handle(V3d_View) aView = myView->View(); + +//#ifdef OCC_PATCHED + aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_YELLOW, 0.1, V3d_ZBUFFER ); +/*#else + aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.1, V3d_WIREFRAME ); +#endif*/ + + aView->Redraw(); + Done(); +} + +void McCadViewTool_Axis::UnExecute() +{ + Handle(V3d_View) aView = myView->View(); + aView->TriedronErase(); + aView->Redraw(); + Done(); +} + +void McCadViewTool_Axis::Suspend() +{ + return; +} + +void McCadViewTool_Axis::Resume() +{ + + return; +} + +void McCadViewTool_Axis::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_Axis::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_Axis::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_Axis::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Axo.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Axo.cxx new file mode 100644 index 0000000..05470d9 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Axo.cxx @@ -0,0 +1,48 @@ +#include + +McCadViewTool_Axo::McCadViewTool_Axo(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myID = McCadTool_Axo; +} + +Standard_Boolean McCadViewTool_Axo::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_Axo::Destroy() +{ +} + + void McCadViewTool_Axo::Execute() +{ +} + + void McCadViewTool_Axo::UnExecute() +{ +} + + void McCadViewTool_Axo::Suspend() +{ +} + + void McCadViewTool_Axo::Resume() +{ +} + + void McCadViewTool_Axo::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Axo::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Axo::MouseLeaveEvent() +{ +} + + void McCadViewTool_Axo::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_BackProject.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_BackProject.cxx new file mode 100644 index 0000000..ecd4942 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_BackProject.cxx @@ -0,0 +1,71 @@ +#include +#include +#include + +McCadViewTool_BackProject::McCadViewTool_BackProject(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_BackProject; +} + +void McCadViewTool_BackProject::Destroy() +{ + return; +} + +void McCadViewTool_BackProject::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetProj(V3d_Xneg); + aView->FitAll(); + /*gp_Dir privDir(-1,0,0); + gp_Pnt ori(0,0,0); + gp_Ax3 privAx(ori, privDir); + myView->View()->Viewer()->SetPrivilegedPlane(privAx);*/ + Done(); +} + +Standard_Boolean McCadViewTool_BackProject::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_BackProject::UnExecute() +{ + return; +} + +void McCadViewTool_BackProject::Suspend() +{ + return; +} + +void McCadViewTool_BackProject::Resume() +{ + return; +} + +void McCadViewTool_BackProject::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_BackProject::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_BackProject::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_BackProject::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_BottomProject.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_BottomProject.cxx new file mode 100644 index 0000000..6c2fb71 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_BottomProject.cxx @@ -0,0 +1,67 @@ +#include +#include + +McCadViewTool_BottomProject::McCadViewTool_BottomProject(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_BottomProject; +} + +void McCadViewTool_BottomProject::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_BottomProject::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_BottomProject::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetProj( V3d_Zneg ); + aView->FitAll(); + Done(); +} + +void McCadViewTool_BottomProject::UnExecute() +{ + return; +} + +void McCadViewTool_BottomProject::Suspend() +{ + return; +} + +void McCadViewTool_BottomProject::Resume() +{ + return; +} + +void McCadViewTool_BottomProject::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_BottomProject::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; + +} + +void McCadViewTool_BottomProject::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_BottomProject::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Delete.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Delete.cxx new file mode 100644 index 0000000..121b234 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Delete.cxx @@ -0,0 +1,161 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadViewTool_Delete::McCadViewTool_Delete(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ModelErase; +} + +void McCadViewTool_Delete::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_Delete::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_Delete::Execute() +{ + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); +// Standard_Boolean haveSelection = Standard_False; + + Handle(TDocStd_Document) tDoc = myDoc->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(tDoc->Main()); + + /*TDF_LabelSequence labSeq; + + for (theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent() ) + { + //theContext->Erase(theContext->Current(),Standard_False,Standard_False); + Handle(TPrsStd_AISPresentation) curPres = Handle(TPrsStd_AISPresentation::DownCast(theContext->Current()->GetOwner())); + + labSeq.Append(curPres->Label()); + haveSelection = Standard_True; + } + if(!haveSelection) + { + QMcCad_Application::GetAppMainWin()->Mcout("No objects selected - nothing to delete"); + return; + } + + tDoc->NewCommand(); + { + for(Standard_Integer i=1; i<=labSeq.Length(); i++) + labSeq.Value(i).ForgetAllAttributes(); + + theContext->UpdateCurrentViewer(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->UpdateDocument(QMcCad_Application::GetAppMainWin()->GetEditor()->ID()); + } tDoc->CommitCommand();*/ + + Handle(TopTools_HSequenceOfShape) shpSeq = new TopTools_HSequenceOfShape; + for (theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent() ) + { + Handle(AIS_InteractiveObject) curIO = theContext->Current(); + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(curIO); + TopoDS_Shape theShp = aisShp->Shape(); + shpSeq->Append(theShp); +//qiu theContext->Erase(curIO, 0, 0); + theContext->Erase(curIO, 0); + } + theContext->UpdateCurrentViewer(); + + Standard_Integer editorID = QMcCad_Application::GetAppMainWin()->GetEditor()->ID(); + QList listDeletedLabel; + + // find and remove all shapes in shpSeq from theTDoc + for(Standard_Integer i=1; i<=shpSeq->Length(); i++) + { + TDF_Label shpLab = sTool->FindShape(shpSeq->Value(i),1); + + TCollection_AsciiString labEntry; + TDF_Tool::Entry(shpLab, labEntry); + + labEntry.Prepend("_"); + labEntry.Prepend(editorID); + listDeletedLabel.append(labEntry); + + if(!shpLab.IsNull()) + { + shpLab.ForgetAllAttributes(); + } + } + + Standard_Integer EditorID = QMcCad_Application::GetAppMainWin()->GetEditor()->ID(); + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->UpdateDocument(editorID,listDeletedLabel); + + /*AIS_ListOfInteractive ioList, tmpList; + theContext->DisplayedObjects(ioList, 0); + theContext->ObjectsInCollector(tmpList); + ioList.Append(tmpList); + AIS_ListIteratorOfListOfInteractive it(tmpList); + + for(; it.More(); it.Next()) + { + + }*/ + + Done(); +} + +void McCadViewTool_Delete::UnExecute() +{ + if(myListOfLastDeleted.Extent()<1) + return; + + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + AIS_ListIteratorOfListOfInteractive it(myListOfLastDeleted); + for(; it.More(); it.Next()) + theContext->Display(it.Value(), Standard_True); +} + +void McCadViewTool_Delete::Suspend() +{ + return; +} + +void McCadViewTool_Delete::Resume() +{ + return; + +} + +void McCadViewTool_Delete::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_Delete::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_Delete::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_Delete::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_DisplaySelectedOnly.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_DisplaySelectedOnly.cxx new file mode 100644 index 0000000..9ba7a35 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_DisplaySelectedOnly.cxx @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include +#include + +McCadViewTool_DisplaySelectedOnly::McCadViewTool_DisplaySelectedOnly(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_DispSelOnly; +} + +Standard_Boolean McCadViewTool_DisplaySelectedOnly::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_DisplaySelectedOnly::Destroy() +{ +} + + void McCadViewTool_DisplaySelectedOnly::Execute() +{ + Handle(AIS_InteractiveContext) theIC = myDoc->GetContext(); + AIS_ListOfInteractive ioList; + + theIC->DisplayedObjects(ioList); + AIS_ListIteratorOfListOfInteractive it(ioList); + + for(; it.More(); it.Next()) + { + if(!theIC->IsSelected(it.Value())) +//qiu theIC->Erase(it.Value(),0,1); + theIC->Erase(it.Value(),0); + } + + theIC->UpdateCurrentViewer(); + + Done(); +} + + void McCadViewTool_DisplaySelectedOnly::UnExecute() +{ +} + + void McCadViewTool_DisplaySelectedOnly::Suspend() +{ +} + + void McCadViewTool_DisplaySelectedOnly::Resume() +{ +} + + void McCadViewTool_DisplaySelectedOnly::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_DisplaySelectedOnly::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_DisplaySelectedOnly::MouseLeaveEvent() +{ +} + + void McCadViewTool_DisplaySelectedOnly::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Dump.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Dump.cxx new file mode 100644 index 0000000..9564029 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Dump.cxx @@ -0,0 +1,66 @@ +#include +#include + +McCadViewTool_Dump::McCadViewTool_Dump(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Hardcopy; +} + + void McCadViewTool_Dump::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_Dump::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_Dump::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->Redraw(); + Done(); +} + + void McCadViewTool_Dump::UnExecute() +{ + return; +} + + void McCadViewTool_Dump::Suspend() +{ + return; +} + + void McCadViewTool_Dump::Resume() +{ + return; +} + + void McCadViewTool_Dump::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_Dump::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_Dump::MouseLeaveEvent() +{ +return; + +} + + void McCadViewTool_Dump::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_FitAll.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_FitAll.cxx new file mode 100644 index 0000000..2eb77c9 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_FitAll.cxx @@ -0,0 +1,67 @@ +#include +#include + +McCadViewTool_FitAll::McCadViewTool_FitAll(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_FitAll; +} + +void McCadViewTool_FitAll::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_FitAll::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_FitAll::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->FitAll(); + aView->Redraw(); + Done(); +} + +void McCadViewTool_FitAll::UnExecute() +{ + return; +} + +void McCadViewTool_FitAll::Suspend() +{ + return; +} + +void McCadViewTool_FitAll::Resume() +{ + return; + +} + +void McCadViewTool_FitAll::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_FitAll::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_FitAll::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_FitAll::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_FrontProject.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_FrontProject.cxx new file mode 100644 index 0000000..6dd88b1 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_FrontProject.cxx @@ -0,0 +1,66 @@ +#include +#include + +McCadViewTool_FrontProject::McCadViewTool_FrontProject(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_FrontProject; +} + + void McCadViewTool_FrontProject::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_FrontProject::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_FrontProject::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetProj(V3d_Xpos); + aView->FitAll(); + Done(); +} + + void McCadViewTool_FrontProject::UnExecute() +{ + return; +} + + void McCadViewTool_FrontProject::Suspend() +{ + return; +} + + void McCadViewTool_FrontProject::Resume() +{ + return; +} + + void McCadViewTool_FrontProject::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_FrontProject::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_FrontProject::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_FrontProject::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Grid.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Grid.cxx new file mode 100644 index 0000000..8f8c328 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Grid.cxx @@ -0,0 +1,76 @@ +#include +#include +#include + +McCadViewTool_Grid::McCadViewTool_Grid(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Grid; +} + +void McCadViewTool_Grid::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_Grid::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_Grid::Execute() +{ + //get width and hight of the current view + Handle(V3d_View) aView = myView->View(); + Standard_Real theWidth, theHeight; + + aView->Size(theWidth, theHeight); + + + Handle(V3d_Viewer) aViewer = myDoc->GetContext()->CurrentViewer(); + aViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Lines); + aViewer->SetRectangularGridGraphicValues(theWidth + 200, theHeight + 200, 0); + + Done(); +} + +void McCadViewTool_Grid::UnExecute() +{ + return; +} + +void McCadViewTool_Grid::Suspend() +{ + return; +} + +void McCadViewTool_Grid::Resume() +{ + return; +} + +void McCadViewTool_Grid::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_Grid::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; + +} + +void McCadViewTool_Grid::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_Grid::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_HideSelected.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_HideSelected.cxx new file mode 100644 index 0000000..af5e4a4 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_HideSelected.cxx @@ -0,0 +1,73 @@ +#include +#include +#include +#include + +McCadViewTool_HideSelected::McCadViewTool_HideSelected(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_HideSelected; +} + +void McCadViewTool_HideSelected::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_HideSelected::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_HideSelected::Execute() +{ + Handle(AIS_InteractiveContext) theIC = myDoc->GetContext(); + + for(theIC->InitCurrent(); theIC->MoreCurrent(); theIC->NextCurrent()) +//qiu theIC->Erase(theIC->Current(),Standard_False,Standard_True); + theIC->Erase(theIC->Current(),Standard_False); + + theIC->UpdateCurrentViewer(); + + Done(); +} + +void McCadViewTool_HideSelected::UnExecute() +{ +} + +void McCadViewTool_HideSelected::Suspend() +{ + return; +} + +void McCadViewTool_HideSelected::Resume() +{ + + return; +} + +void McCadViewTool_HideSelected::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_HideSelected::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_HideSelected::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_HideSelected::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_LeftProject.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_LeftProject.cxx new file mode 100644 index 0000000..dcba044 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_LeftProject.cxx @@ -0,0 +1,66 @@ +#include +#include + +McCadViewTool_LeftProject::McCadViewTool_LeftProject(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_LeftProject; +} + + void McCadViewTool_LeftProject::Destroy() +{ + return; +} + + Standard_Boolean McCadViewTool_LeftProject::IsNull() + { + return Standard_False; + } + + void McCadViewTool_LeftProject::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetProj(V3d_Ypos); + aView->FitAll(); + Done(); +} + + void McCadViewTool_LeftProject::UnExecute() +{ + return; +} + + void McCadViewTool_LeftProject::Suspend() +{ + return; +} + + void McCadViewTool_LeftProject::Resume() +{ + return; +} + + void McCadViewTool_LeftProject::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_LeftProject::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_LeftProject::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_LeftProject::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Pan.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Pan.cxx new file mode 100644 index 0000000..71c63b4 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Pan.cxx @@ -0,0 +1,76 @@ +#include +#include + +McCadViewTool_Pan::McCadViewTool_Pan(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Pan; + myXmin = 0; + myXmax = 0; + myYmin = 0; + myYmax = 0; +} + + void McCadViewTool_Pan::Destroy() +{ +} + + +Standard_Boolean McCadViewTool_Pan::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_Pan::Execute() +{ + Suspend(); +} + + void McCadViewTool_Pan::UnExecute() +{ +} + + void McCadViewTool_Pan::Suspend() +{ +} + + void McCadViewTool_Pan::Resume() +{ +} + + void McCadViewTool_Pan::MousePressEvent(const QMouseEvent& e) +{ + QPoint aPoint = e.pos(); + + myXmin = aPoint.x(); + myYmin = aPoint.y(); + myXmax = aPoint.x(); + myYmax = aPoint.y(); +} + + void McCadViewTool_Pan::MouseReleaseEvent(const QMouseEvent& e) +{ + Done(); +} + + void McCadViewTool_Pan::MouseMoveEvent(const QMouseEvent& e) +{ + QPoint aPoint = e.pos(); + + Handle(V3d_View) aView = myView->View(); + aView->Pan(aPoint.x() - myXmax, myYmax - aPoint.y()); + +} + + void McCadViewTool_Pan::MouseLeaveEvent() +{ +} + + void McCadViewTool_Pan::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_ReadValueList.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_ReadValueList.cxx new file mode 100644 index 0000000..384d95a --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_ReadValueList.cxx @@ -0,0 +1,185 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +McCadViewTool_ReadValueList::McCadViewTool_ReadValueList(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ReadValueList; +} + +void McCadViewTool_ReadValueList::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_ReadValueList::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_ReadValueList::Execute() +{ + Handle(V3d_View) aView = myView->View(); + Handle_AIS_InteractiveContext theIC = myDoc->GetContext(); + + // Read File and process Data + QMcCad_ReadListDialog* readDialog = new QMcCad_ReadListDialog; + readDialog->exec(); + + if(!readDialog->Done()) + return; + + list cellNumberList; + list valueList; + + cellNumberList = readDialog->GetCellNumberList(); + valueList = readDialog->GetValueList(); + int nbColors(12); + nbColors = readDialog->GetNbColors(); + + // initialize ColorSacle + aView->ColorScaleDisplay(); + Handle(Aspect_ColorScale) colorScale = aView->ColorScale(); + colorScale->SetXPosition(0.9); + colorScale->SetYPosition(0.1); + colorScale->SetSize(0.1, 0.8); + colorScale->SetNumberOfIntervals(nbColors); + colorScale->SetMin(readDialog->GetLowerBound()); + colorScale->SetMax(readDialog->GetUpperBound()); + + // Assign Colors to Solids + list::iterator cellIt = cellNumberList.begin(); + list::iterator valueIt = valueList.begin(); + + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + Handle(TDocStd_Document) theTDoc = QMcCad_Application::GetAppMainWin()->GetEditor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ColorTool) cTool = XCAFDoc_DocumentTool::ColorTool(theTDoc->Main()); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + + for(; cellIt != cellNumberList.end(); cellIt++) + { + Quantity_Color curColor; + colorScale->FindColor(*valueIt, curColor); + + TCollection_AsciiString cellName(*cellIt); + + // find matching names + McCadXCAF_TDocShapeLabelIterator it(myDoc->GetTDoc()); + for(; it.More(); it.Next()) + { + TDF_Label curLab = it.Current(); + Handle_TDataStd_Name theName = new TDataStd_Name; + if(curLab.FindAttribute(TDataStd_Name::GetID(),theName)) + { + TCollection_AsciiString curName(theName->Get()); + if(curName == cellName) + { + // assign color to solid associated with this label + TDF_Label cLab = cTool->AddColor(curColor); + cTool->SetColor(curLab, cLab, XCAFDoc_ColorGen); + + // find interactive Object coresponding to Shape + AIS_ListOfInteractive ioList; + AIS_ListOfInteractive tmpList; + +//qiu theIC->ObjectsInCollector(tmpList); + theIC->ErasedObjects(tmpList); + theIC->DisplayedObjects(ioList, 0); + ioList.Append(tmpList); + + Handle(TNaming_NamedShape) nShp; + if(! curLab.FindAttribute(TNaming_NamedShape::GetID(), nShp)) + continue; + + TopoDS_Shape refShp = nShp->Get(); + + for(AIS_ListIteratorOfListOfInteractive it(ioList); it.More(); it.Next()) + { + if(theIC->IsSelected(it.Value())) + continue; + + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(it.Value()); + TopoDS_Shape curShp = aisShp->Shape(); + + if(curShp.IsEqual(refShp)) + it.Value()->SetColor(curColor); + } + + } + } + } + + valueIt++; + } + + + + aView->Redraw(); + Done(); +} + +void McCadViewTool_ReadValueList::UnExecute() +{ + Handle(V3d_View) aView = myView->View(); + aView->ColorScaleErase(); + aView->Redraw(); + Done(); +} + +void McCadViewTool_ReadValueList::Suspend() +{ + return; +} + +void McCadViewTool_ReadValueList::Resume() +{ + + return; +} + +void McCadViewTool_ReadValueList::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_ReadValueList::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_ReadValueList::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_ReadValueList::MouseEnterEvent() +{ + return; +} + +// Private Functions +/////////////////////////// + +bool McCadViewTool_ReadValueList::ParseFile() +{ +return false; +} diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_RedisplaySelected.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_RedisplaySelected.cxx new file mode 100644 index 0000000..e9b2fc4 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_RedisplaySelected.cxx @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +McCadViewTool_RedisplaySelected::McCadViewTool_RedisplaySelected(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_RedispSelected; +} + +Standard_Boolean McCadViewTool_RedisplaySelected::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_RedisplaySelected::Destroy() +{ +} + + void McCadViewTool_RedisplaySelected::Execute() +{ + AIS_ListOfInteractive ioList; + QMcCad_Application::GetAppMainWin()->GetTreeWidget()->GetSelected(ioList); + + Handle(AIS_InteractiveContext) theIC = myDoc->GetContext(); + + AIS_ListIteratorOfListOfInteractive it(ioList); + + for(; it.More(); it.Next()) + theIC->Display(it.Value(), Standard_False); + + theIC->UpdateCurrentViewer(); + + + Done(); +} + + void McCadViewTool_RedisplaySelected::UnExecute() +{ +} + + void McCadViewTool_RedisplaySelected::Suspend() +{ +} + + void McCadViewTool_RedisplaySelected::Resume() +{ +} + +void McCadViewTool_RedisplaySelected::MousePressEvent(const QMouseEvent& e) +{ + +} + +void McCadViewTool_RedisplaySelected::MouseReleaseEvent(const QMouseEvent& e) +{ + +} + + + void McCadViewTool_RedisplaySelected::MouseLeaveEvent() +{ +} + + void McCadViewTool_RedisplaySelected::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Redraw.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Redraw.cxx new file mode 100644 index 0000000..710b0a2 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Redraw.cxx @@ -0,0 +1,66 @@ +#include +#include + +McCadViewTool_Redraw::McCadViewTool_Redraw(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Redraw; +} + +void McCadViewTool_Redraw::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_Redraw::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_Redraw::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->Redraw(); + Done(); +} + +void McCadViewTool_Redraw::UnExecute() +{ + return; +} + +void McCadViewTool_Redraw::Suspend() +{ + return; +} + +void McCadViewTool_Redraw::Resume() +{ + return; +} + +void McCadViewTool_Redraw::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_Redraw::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; + +} + +void McCadViewTool_Redraw::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_Redraw::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Reset.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Reset.cxx new file mode 100644 index 0000000..420d001 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Reset.cxx @@ -0,0 +1,48 @@ +#include + +McCadViewTool_Reset::McCadViewTool_Reset(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ +} + +Standard_Boolean McCadViewTool_Reset::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_Reset::Destroy() +{ +} + + void McCadViewTool_Reset::Execute() +{ + Done(); +} + + void McCadViewTool_Reset::UnExecute() +{ +} + + void McCadViewTool_Reset::Suspend() +{ +} + + void McCadViewTool_Reset::Resume() +{ +} + + void McCadViewTool_Reset::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Reset::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Reset::MouseLeaveEvent() +{ +} + + void McCadViewTool_Reset::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_RightProject.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_RightProject.cxx new file mode 100644 index 0000000..3fe5812 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_RightProject.cxx @@ -0,0 +1,66 @@ +#include +#include + +McCadViewTool_RightProject::McCadViewTool_RightProject(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_RightProject; +} + + void McCadViewTool_RightProject::Destroy() +{ + return; +} + + Standard_Boolean McCadViewTool_RightProject::IsNull() + { + return Standard_False; + } + + void McCadViewTool_RightProject::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetProj(V3d_Yneg); + aView->FitAll(); + Done(); +} + + void McCadViewTool_RightProject::UnExecute() +{ + return; +} + + void McCadViewTool_RightProject::Suspend() +{ + return; +} + + void McCadViewTool_RightProject::Resume() +{ + return; +} + + void McCadViewTool_RightProject::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_RightProject::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_RightProject::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_RightProject::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Rotate.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Rotate.cxx new file mode 100644 index 0000000..8559391 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Rotate.cxx @@ -0,0 +1,68 @@ +#include +#include + +McCadViewTool_Rotate::McCadViewTool_Rotate(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Rotate; +} + + void McCadViewTool_Rotate::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_Rotate::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_Rotate::Execute() +{ + /*Done();*/ +} + + void McCadViewTool_Rotate::UnExecute() +{ + return; +} + + void McCadViewTool_Rotate::Suspend() +{ + return; +} + + void McCadViewTool_Rotate::Resume() +{ + return; +} + + void McCadViewTool_Rotate::MouseMoveEvent(const QMouseEvent& e) + { + return; + } + + void McCadViewTool_Rotate::MousePressEvent(const QMouseEvent& e) +{ + return; +} + + void McCadViewTool_Rotate::MouseReleaseEvent(const QMouseEvent& e) +{ + return; +} + + void McCadViewTool_Rotate::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_Rotate::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetAntialiasing.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetAntialiasing.cxx new file mode 100644 index 0000000..18d5b71 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetAntialiasing.cxx @@ -0,0 +1,63 @@ +#include +#include + +McCadViewTool_SetAntialiasing::McCadViewTool_SetAntialiasing(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_Antialiasing; +} + + void McCadViewTool_SetAntialiasing::Destroy() +{ +} + +Standard_Boolean McCadViewTool_SetAntialiasing::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_SetAntialiasing::Execute() +{ + Handle(V3d_View) aView = myView->View(); + + if(aView->Antialiasing()) + aView->SetAntialiasingOff(); + else + aView->SetAntialiasingOn(); + + aView->Redraw(); + Done(); +} + + void McCadViewTool_SetAntialiasing::UnExecute() +{ +} + + void McCadViewTool_SetAntialiasing::Suspend() +{ +} + + void McCadViewTool_SetAntialiasing::Resume() +{ +} + + void McCadViewTool_SetAntialiasing::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetAntialiasing::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetAntialiasing::MouseLeaveEvent() +{ +} + + void McCadViewTool_SetAntialiasing::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetBackgroundColor.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetBackgroundColor.cxx new file mode 100644 index 0000000..37c836f --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetBackgroundColor.cxx @@ -0,0 +1,100 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +McCadViewTool_SetBackgroundColor::McCadViewTool_SetBackgroundColor(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = Standard_True; + myRedoState = theRedoState; + myID = McCadTool_BackgroundColor; + myPreviousColor = myView->View()->BackgroundColor(); +} + + +Standard_Boolean McCadViewTool_SetBackgroundColor::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_SetBackgroundColor::Destroy() +{ +} + + void McCadViewTool_SetBackgroundColor::Execute() +{ + QColor aColor; + Standard_Real R1; + Standard_Real G1; + Standard_Real B1; + + Handle(V3d_View) aView = myView->View(); + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + + aView->BackgroundColor(Quantity_TOC_RGB, R1, G1, B1); + aColor.setRgb(int(R1*255), int(G1*255), int(B1*255)); + QColorDialog* aColorDialog; + + QColor aRetColor = aColorDialog->getColor(aColor); + + if (aRetColor.isValid() ) + { + QMcCad_Application::GetAppMainWin()->SetBgColor(aRetColor); + R1 = aRetColor.red()/255.; + G1 = aRetColor.green()/255.; + B1 = aRetColor.blue()/255.; + aView->SetBackgroundColor(Quantity_TOC_RGB, R1, G1, B1); + } + + aView->Redraw(); + Done(); +} + + void McCadViewTool_SetBackgroundColor::UnExecute() +{ + if(myView==NULL) + { + cout << "NULL VIEW\n"; + return; + } + + cout << "UNDO\n"; + myView->View()->SetBackgroundColor(myPreviousColor); + cout << "done\n"; +} + + void McCadViewTool_SetBackgroundColor::Suspend() +{ +} + + void McCadViewTool_SetBackgroundColor::Resume() +{ +} + + void McCadViewTool_SetBackgroundColor::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetBackgroundColor::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetBackgroundColor::MouseLeaveEvent() +{ +} + + void McCadViewTool_SetBackgroundColor::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetHiddenLine.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetHiddenLine.cxx new file mode 100644 index 0000000..695dc0b --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetHiddenLine.cxx @@ -0,0 +1,103 @@ +#include +#include +#include +#include +#include +#include +#include + +McCadViewTool_SetHiddenLine::McCadViewTool_SetHiddenLine(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_SetHiddenLine; +} + + void McCadViewTool_SetHiddenLine::Destroy() +{ +} + + Standard_Boolean McCadViewTool_SetHiddenLine::IsNull() + { + return Standard_False; + } + + void McCadViewTool_SetHiddenLine::Execute() +{ +// Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); +// Handle(V3d_View) aView = myView->View(); +// /*if(theContext->DrawHiddenLine()) +// { +// theContext->DisableDrawHiddenLine(); +// cout << "Setting Hidden Line OFF \n"; +// } +// else +// { +// theContext->EnableDrawHiddenLine(); +// cout << "Setting Hidden Line ON \n"; +// } */ + +// aView->SetComputedMode(!aView->ComputedMode()); +// aView->Redraw(); +// Done(); + + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + Standard_Boolean haveSelection = Standard_False; + + //if(myView->View()->ComputedMode()) + myView->View()->SetComputedMode(Standard_False); + + for (theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent() ) + { + theContext->SetDisplayMode(theContext->Current(), 2, Standard_False); + haveSelection = Standard_True; + } + + if(!haveSelection) + { + AIS_ListOfInteractive aList; + theContext->DisplayedObjects( aList ); + AIS_ListIteratorOfListOfInteractive aListIterator; + + for ( aListIterator.Initialize( aList ); aListIterator.More(); aListIterator.Next() ) + theContext->SetDisplayMode(aListIterator.Value(), 2, Standard_False); + } + + theContext->UpdateCurrentViewer(); + Done(); + + + +} + + void McCadViewTool_SetHiddenLine::UnExecute() +{ +} + + void McCadViewTool_SetHiddenLine::Suspend() +{ +} + + void McCadViewTool_SetHiddenLine::Resume() +{ +} + + void McCadViewTool_SetHiddenLine::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetHiddenLine::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetHiddenLine::MouseLeaveEvent() +{ +} + + void McCadViewTool_SetHiddenLine::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetShadingMode.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetShadingMode.cxx new file mode 100644 index 0000000..81b2994 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetShadingMode.cxx @@ -0,0 +1,128 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../McCadMcVoid/IGeomFace.hxx" +#include "../McCadMcVoid/McCadGeomPlane.hxx" + +McCadViewTool_SetShadingMode::McCadViewTool_SetShadingMode(const Handle(McCadCom_CasDocument)& theDoc, const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_FlatShade; +} + + void McCadViewTool_SetShadingMode::Destroy() +{ +} + + +Standard_Boolean McCadViewTool_SetShadingMode::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_SetShadingMode::Execute() +{ + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + + for(theContext->InitSelected();theContext->MoreSelected();theContext->NextSelected()) + { + QMcCad_Application::GetAppMainWin()->Mcout("Yes In it"); + + TopoDS_Shape shape = theContext->SelectedShape(); + TopoDS_Face face = TopoDS::Face(shape); + //TopoDS_Face *pFace = new TopoDS_Face(face); + + if(face.ShapeType() == TopAbs_FACE) + { + QMcCad_Application::GetAppMainWin()->Mcout("Get the face"); + + TopLoc_Location loc; + Handle(Geom_Surface) geom_surface = BRep_Tool::Surface(face, loc); + GeomAdaptor_Surface surf_adoptor(geom_surface); + + IGeomFace * pGeomFace = NULL; + + switch (surf_adoptor.GetType()) + { + case GeomAbs_Plane: + { + QMcCad_Application::GetAppMainWin()->Mcout("This is a plane"); + pGeomFace = new McCadGeomPlane(surf_adoptor); + break; + } + case GeomAbs_Cylinder: + { + QMcCad_Application::GetAppMainWin()->Mcout("This is a Cylinder"); + break; + } + case GeomAbs_Cone: + { + QMcCad_Application::GetAppMainWin()->Mcout("This is a Cone"); + break; + } + case GeomAbs_Sphere: + { + QMcCad_Application::GetAppMainWin()->Mcout("This is a Sphere"); + break; + } + case GeomAbs_Torus: + { + QMcCad_Application::GetAppMainWin()->Mcout("This is a Torus"); + break; + } + } + + TCollection_AsciiString surf_info; + surf_info = pGeomFace->GetExpression(); + + QMcCad_Application::GetAppMainWin()->Mcout(surf_info.ToCString()); + + + } + } + + theContext->UpdateCurrentViewer(); + Done(); +} + + void McCadViewTool_SetShadingMode::UnExecute() +{ +} + + void McCadViewTool_SetShadingMode::Suspend() +{ +} + + void McCadViewTool_SetShadingMode::Resume() +{ +} + + void McCadViewTool_SetShadingMode::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetShadingMode::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetShadingMode::MouseLeaveEvent() +{ +} + + void McCadViewTool_SetShadingMode::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetShapeColor.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetShapeColor.cxx new file mode 100644 index 0000000..e7873c8 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetShapeColor.cxx @@ -0,0 +1,128 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +McCadViewTool_SetShapeColor::McCadViewTool_SetShapeColor(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ShapeColor; +} + + +Standard_Boolean McCadViewTool_SetShapeColor::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_SetShapeColor::Destroy() +{ +} + + void McCadViewTool_SetShapeColor::Execute() +{ + QColor aColor; + Standard_Real R1; + Standard_Real G1; + Standard_Real B1; + Handle(V3d_View) aView = myView->View(); + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + + aView->BackgroundColor(Quantity_TOC_RGB, R1, G1, B1); + aColor.setRgb(int(R1*255), int(G1*255), int(B1*255)); + QColorDialog* aColorDialog; + + QColor aRetColor = aColorDialog->getColor(aColor); + if (aRetColor.isValid() ) + { + Handle(TDocStd_Document) theTDoc = QMcCad_Application::GetAppMainWin()->GetEditor()->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ColorTool) cTool = XCAFDoc_DocumentTool::ColorTool(theTDoc->Main()); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + Quantity_Color color(aRetColor.red() / 255., aRetColor.green() / 255., aRetColor.blue() / 255., Quantity_TOC_RGB); + /*TDF_Label cLab = cTool->AddColor(color); + TCollection_AsciiString newCLab; + TDF_Tool::Entry(cLab,newCLab);*/ + + AIS_ListOfInteractive ioList; + for(theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent()) + ioList.Append(theContext->Current()); + + AIS_ListIteratorOfListOfInteractive it(ioList); + + for ( ; it.More(); it.Next() ) + { + Handle(AIS_InteractiveObject) io = it.Value();//theContext->Current(); + io->SetColor(color); + + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(io); + + if(aisShp == NULL) + continue; + + TopoDS_Shape theShp = aisShp->Shape(); + TDF_Label curL = sTool->FindShape(theShp,1); + + //TopoDS_Shape aShape = Handle(AIS_Shape)::DownCast(io)->Shape(); + //Handle(TPrsStd_AISPresentation) prs = Handle(TPrsStd_AISPresentation::DownCast(io->GetOwner())); + //theContext->Clear(prs->GetAIS(),0); //delete current presentation, do not update viewer + TDF_Label cLab = cTool->AddColor(color); + cTool->SetColor(curL, cLab, XCAFDoc_ColorGen); + //cTool->SetColor(prs->Label(), newCLab, XCAFDoc_ColorGen); + //TPrsStd_AISViewer::Update(theTDoc->GetData()->Root()); + //prs->Update(); + //theContext->Display(prs->GetAIS(),0); + } + theContext->UpdateCurrentViewer(); + } + + aView->Redraw(); + Done(); +} + + void McCadViewTool_SetShapeColor::UnExecute() +{ +} + + void McCadViewTool_SetShapeColor::Suspend() +{ +} + + void McCadViewTool_SetShapeColor::Resume() +{ +} + + void McCadViewTool_SetShapeColor::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetShapeColor::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetShapeColor::MouseLeaveEvent() +{ +} + + void McCadViewTool_SetShapeColor::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetVisuMaterial.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetVisuMaterial.cxx new file mode 100644 index 0000000..b29ef79 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetVisuMaterial.cxx @@ -0,0 +1,73 @@ +#include +#include +#include + +McCadViewTool_SetVisuMaterial::McCadViewTool_SetVisuMaterial(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ShapeMaterial; +} + +void McCadViewTool_SetVisuMaterial::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_SetVisuMaterial::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_SetVisuMaterial::Execute() +{ + Handle(V3d_View) aView = myView->View(); + + + + Done(); +} + +void McCadViewTool_SetVisuMaterial::UnExecute() +{ + Done(); +} + +void McCadViewTool_SetVisuMaterial::Suspend() +{ + return; +} + +void McCadViewTool_SetVisuMaterial::Resume() +{ + + return; +} + +void McCadViewTool_SetVisuMaterial::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_SetVisuMaterial::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_SetVisuMaterial::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_SetVisuMaterial::MouseEnterEvent() +{ + return; +} + +void McCadViewTool_SetVisuMaterial::SetMaterialName(Graphic3d_NameOfMaterial theNOM) +{ + myNOM = theNOM; +} diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_SetVisualization.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_SetVisualization.cxx new file mode 100644 index 0000000..49975e1 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_SetVisualization.cxx @@ -0,0 +1,43 @@ +#include + +McCadViewTool_SetVisualization::McCadViewTool_SetVisualization(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ +} + + void McCadViewTool_SetVisualization::Destroy() +{ +} + + void McCadViewTool_SetVisualization::Execute() +{ + Done(); +} + + void McCadViewTool_SetVisualization::UnExecute() +{ +} + + void McCadViewTool_SetVisualization::Suspend() +{ +} + + void McCadViewTool_SetVisualization::Resume() +{ +} + + void McCadViewTool_SetVisualization::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetVisualization::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_SetVisualization::MouseLeaveEvent() +{ +} + + void McCadViewTool_SetVisualization::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_ShowAll.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_ShowAll.cxx new file mode 100644 index 0000000..71620c3 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_ShowAll.cxx @@ -0,0 +1,80 @@ +#include +#include +#include +#include +#include + + +McCadViewTool_ShowAll::McCadViewTool_ShowAll(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ShowAll; +} + +void McCadViewTool_ShowAll::Destroy() +{ + return; +} + +Standard_Boolean McCadViewTool_ShowAll::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_ShowAll::Execute() +{ + Handle(AIS_InteractiveContext) theIC = myDoc->GetContext(); + + AIS_ListOfInteractive ioList; +//qiu theIC->ObjectsInCollector(ioList); + //qiu replace it with a function with same function specifications + theIC->ErasedObjects(ioList); + + AIS_ListIteratorOfListOfInteractive it(ioList); + + for(; it.More(); it.Next()) + theIC->Display(it.Value(), Standard_False); + + theIC->UpdateCurrentViewer(); + Done(); +} + +void McCadViewTool_ShowAll::UnExecute() +{ +} + +void McCadViewTool_ShowAll::Suspend() +{ + return; +} + +void McCadViewTool_ShowAll::Resume() +{ + + return; +} + +void McCadViewTool_ShowAll::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_ShowAll::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + +void McCadViewTool_ShowAll::MouseLeaveEvent() +{ + return; +} + +void McCadViewTool_ShowAll::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Size.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Size.cxx new file mode 100644 index 0000000..db13e62 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Size.cxx @@ -0,0 +1,43 @@ +#include + +McCadViewTool_Size::McCadViewTool_Size(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ +} + + void McCadViewTool_Size::Destroy() +{ +} + + void McCadViewTool_Size::Execute() +{ + Done(); +} + + void McCadViewTool_Size::UnExecute() +{ +} + + void McCadViewTool_Size::Suspend() +{ +} + + void McCadViewTool_Size::Resume() +{ +} + + void McCadViewTool_Size::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Size::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Size::MouseLeaveEvent() +{ +} + + void McCadViewTool_Size::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_TopProject.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_TopProject.cxx new file mode 100644 index 0000000..9ff60d4 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_TopProject.cxx @@ -0,0 +1,67 @@ +#include +#include + +McCadViewTool_TopProject::McCadViewTool_TopProject(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_FrontProject; +} + + void McCadViewTool_TopProject::Destroy() +{ + return; +} + + Standard_Boolean McCadViewTool_TopProject::IsNull() + { + return Standard_False; + } + + + void McCadViewTool_TopProject::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetProj(V3d_Zpos); + aView->FitAll(); + Done(); +} + + void McCadViewTool_TopProject::UnExecute() +{ + return; +} + + void McCadViewTool_TopProject::Suspend() +{ + return; +} + + void McCadViewTool_TopProject::Resume() +{ + return; +} + + void McCadViewTool_TopProject::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_TopProject::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_TopProject::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_TopProject::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Transparency.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Transparency.cxx new file mode 100644 index 0000000..1c2004e --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Transparency.cxx @@ -0,0 +1,48 @@ +#include + +McCadViewTool_Transparency::McCadViewTool_Transparency(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myID = McCadTool_ShapeTransparency; +} + +Standard_Boolean McCadViewTool_Transparency::IsNull() +{ + return Standard_False; +} + + void McCadViewTool_Transparency::Destroy() +{ +} + + void McCadViewTool_Transparency::Execute() +{ +} + + void McCadViewTool_Transparency::UnExecute() +{ +} + + void McCadViewTool_Transparency::Suspend() +{ +} + + void McCadViewTool_Transparency::Resume() +{ +} + + void McCadViewTool_Transparency::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Transparency::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_Transparency::MouseLeaveEvent() +{ +} + + void McCadViewTool_Transparency::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_WireFrame.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_WireFrame.cxx new file mode 100644 index 0000000..5bfc4bd --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_WireFrame.cxx @@ -0,0 +1,89 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +McCadViewTool_WireFrame::McCadViewTool_WireFrame(const Handle(McCadCom_CasDocument)& theDoc, const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_FlatShade; +} + + void McCadViewTool_WireFrame::Destroy() +{ +} + + +Standard_Boolean McCadViewTool_WireFrame::IsNull() +{ + return Standard_False; +} + +void McCadViewTool_WireFrame::Execute() +{ + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + Standard_Boolean haveSelection = Standard_False; + + for (theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent() ) + { + theContext->SetDisplayMode(theContext->Current(), 0, Standard_False); + haveSelection = Standard_True; + } + + if(!haveSelection) + { + AIS_ListOfInteractive aList; + theContext->DisplayedObjects( aList ); + AIS_ListIteratorOfListOfInteractive aListIterator; + + for ( aListIterator.Initialize( aList ); aListIterator.More(); aListIterator.Next() ) + { + theContext->SetDisplayMode(aListIterator.Value(), 0, Standard_False); + } + } + + //theContext->OpenLocalContext(); + //theContext->ActivateStandardMode(TopAbs_SOLID); + + theContext->UpdateCurrentViewer(); + Done(); +} + + void McCadViewTool_WireFrame::UnExecute() +{ +} + + void McCadViewTool_WireFrame::Suspend() +{ +} + + void McCadViewTool_WireFrame::Resume() +{ +} + + void McCadViewTool_WireFrame::MousePressEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_WireFrame::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ +} + + void McCadViewTool_WireFrame::MouseLeaveEvent() +{ +} + + void McCadViewTool_WireFrame::MouseEnterEvent() +{ +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_Zoom.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_Zoom.cxx new file mode 100644 index 0000000..582a854 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_Zoom.cxx @@ -0,0 +1,81 @@ +#include +#include + +McCadViewTool_Zoom::McCadViewTool_Zoom(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ZoomWindow; + + myXmin = 0; + myXmax = 0; + myYmin = 1024; + myYmax = 768; +} + + void McCadViewTool_Zoom::Destroy() +{ +} + +Standard_Boolean McCadViewTool_Zoom::IsNull() +{ + return Standard_False; +} + + +void McCadViewTool_Zoom::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->WindowFit(myXmin, myYmin, myXmax , myYmax); + Done(); +} + + void McCadViewTool_Zoom::UnExecute() +{ +} + + void McCadViewTool_Zoom::Suspend() +{ + SetState(McCadTool_Waiting); +} + + void McCadViewTool_Zoom::Resume() +{ +} + + void McCadViewTool_Zoom::MousePressEvent(const QMouseEvent& e) +{ + QPoint aPoint = e.pos(); + + myXmin = aPoint.x(); + myYmin = aPoint.y(); + myXmax = aPoint.x(); + myYmax = aPoint.y(); +} + + void McCadViewTool_Zoom::MouseReleaseEvent(const QMouseEvent& e) +{ + QPoint aPoint = e.pos(); + + myXmax = aPoint.x(); + myYmax = aPoint.y(); + + //Execute(); +} + + void McCadViewTool_Zoom::MouseLeaveEvent() +{ +} + + void McCadViewTool_Zoom::MouseEnterEvent() +{ +} + +Standard_Boolean McCadViewTool_Zoom::NeedRect() const +{ + return Standard_True; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_ZoomIn.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_ZoomIn.cxx new file mode 100644 index 0000000..6894227 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_ZoomIn.cxx @@ -0,0 +1,65 @@ +#include +#include + +McCadViewTool_ZoomIn::McCadViewTool_ZoomIn(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ZoomIn; +} + + void McCadViewTool_ZoomIn::Destroy() +{ + return; +} + + Standard_Boolean McCadViewTool_ZoomIn::IsNull() + { + return Standard_False; + } + + void McCadViewTool_ZoomIn::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetZoom(1.2); + Done(); +} + + void McCadViewTool_ZoomIn::UnExecute() +{ + return; +} + + void McCadViewTool_ZoomIn::Suspend() +{ + return; +} + + void McCadViewTool_ZoomIn::Resume() +{ + return; +} + + void McCadViewTool_ZoomIn::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_ZoomIn::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_ZoomIn::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_ZoomIn::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadViewTool/McCadViewTool_ZoomOut.cxx b/src/MCCAD/McCadViewTool/McCadViewTool_ZoomOut.cxx new file mode 100644 index 0000000..db437b4 --- /dev/null +++ b/src/MCCAD/McCadViewTool/McCadViewTool_ZoomOut.cxx @@ -0,0 +1,65 @@ +#include +#include + +McCadViewTool_ZoomOut::McCadViewTool_ZoomOut(const Handle(McCadCom_CasDocument)& theDoc,const Handle(McCadCom_CasView)& theView,const McCadTool_State theState,const Standard_Boolean theUndoState,const Standard_Boolean theRedoState) +{ + myDoc = theDoc; + myView = theView; + myState = theState; + myUndoState = theUndoState; + myRedoState = theRedoState; + myID = McCadTool_ZoomOut; +} + + void McCadViewTool_ZoomOut::Destroy() +{ + return; +} + + Standard_Boolean McCadViewTool_ZoomOut::IsNull() + { + return Standard_False; + } + + void McCadViewTool_ZoomOut::Execute() +{ + Handle(V3d_View) aView = myView->View(); + aView->SetZoom(0.833); + Done(); +} + + void McCadViewTool_ZoomOut::UnExecute() +{ + return; +} + + void McCadViewTool_ZoomOut::Suspend() +{ + return; +} + + void McCadViewTool_ZoomOut::Resume() +{ + return; +} + + void McCadViewTool_ZoomOut::MousePressEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_ZoomOut::MouseReleaseEvent(const McCadWin_MouseEvent& e) +{ + return; +} + + void McCadViewTool_ZoomOut::MouseLeaveEvent() +{ + return; +} + + void McCadViewTool_ZoomOut::MouseEnterEvent() +{ + return; +} + diff --git a/src/MCCAD/McCadWin/McCadWin_MouseEvent.cxx b/src/MCCAD/McCadWin/McCadWin_MouseEvent.cxx new file mode 100644 index 0000000..56fabb1 --- /dev/null +++ b/src/MCCAD/McCadWin/McCadWin_MouseEvent.cxx @@ -0,0 +1,2 @@ +#include + diff --git a/src/MCCAD/McCadXCAF/McCadXCAF_Application.cxx b/src/MCCAD/McCadXCAF/McCadXCAF_Application.cxx new file mode 100644 index 0000000..1e73950 --- /dev/null +++ b/src/MCCAD/McCadXCAF/McCadXCAF_Application.cxx @@ -0,0 +1,36 @@ +#include +#include +#include +#include + +McCadXCAF_Application::McCadXCAF_Application() +{ +} + + void McCadXCAF_Application::Formats(TColStd_SequenceOfExtendedString& theFormats) +{ + //theFormats.Append(TCollection_ExtendedString("XmlXCAF")); + XCAFApp_Application::GetApplication()->Formats(theFormats); + //theFormats.Append("McCad_Document"); +} + + Standard_CString McCadXCAF_Application::ResourcesName() +{ + return XCAFApp_Application::GetApplication()->ResourcesName(); + //return Standard_CString("XCAF"); + // return "Standard"; +} + + + const Handle(McCadXCAF_Application)& McCadXCAF_Application::GetApplication() + { + static Handle(McCadXCAF_Application) anApp = new McCadXCAF_Application; + return anApp; + } + + +void McCadXCAF_Application::InitDocument (const Handle(TDocStd_Document)& theDoc) const +{ + TDF_Label aL = theDoc->Main().FindChild (1, Standard_True); //0:1:1 + XCAFDoc_DocumentTool::Set (aL.FindChild (1, Standard_True), Standard_False); //0:1:1:1 +} diff --git a/src/MCCAD/McCadXCAF/McCadXCAF_TDocShapeLabelIterator.cxx b/src/MCCAD/McCadXCAF/McCadXCAF_TDocShapeLabelIterator.cxx new file mode 100644 index 0000000..b768111 --- /dev/null +++ b/src/MCCAD/McCadXCAF/McCadXCAF_TDocShapeLabelIterator.cxx @@ -0,0 +1,132 @@ +/* + * McCadXCAF_TDocShapeLabelIterator.cxx + * + * Created on: Mar 5, 2009 + * Author: grosse + */ + +#include + +McCadXCAF_TDocShapeLabelIterator::McCadXCAF_TDocShapeLabelIterator() +{ + +} + +McCadXCAF_TDocShapeLabelIterator::McCadXCAF_TDocShapeLabelIterator(const Handle_TDocStd_Document& theTDoc) +{ + Initialize(theTDoc); +} + + +void McCadXCAF_TDocShapeLabelIterator::Initialize(const Handle_TDocStd_Document& theTDoc) +{ + myCurrentCnt = 1; + + mySTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + mySTool->GetFreeShapes(myFreeShapes); + + //cout << ":: Number of free shapes : " << myFreeShapes.Length() << endl; + + myEnd = NumberOfShapes(); +} + + +Standard_Boolean McCadXCAF_TDocShapeLabelIterator::More() +{ + if(myCurrentCnt <= myEnd) + return Standard_True; + + return Standard_False; +} + + +void McCadXCAF_TDocShapeLabelIterator::Next() +{ + myCurrentCnt++; + myPrevious = myCurrent; +} + +TDF_Label McCadXCAF_TDocShapeLabelIterator::Current() +{ + Standard_Integer cnt(0); + TDF_Label retLab; + + for(Standard_Integer i=1; i <= myFreeShapes.Length(); i++) + { + cnt++; //increase number of shapes + TDF_Label curLab = myFreeShapes.Value(i); + + if(cnt == myCurrentCnt) + { + retLab = curLab; + break; + } + + retLab = Traverse(curLab, cnt, myCurrentCnt); + + if(cnt==myCurrentCnt) + break; + } + + myCurrent = retLab; + + return myCurrent; +} + + +TDF_Label McCadXCAF_TDocShapeLabelIterator::GetAt(int index) +{ + myCurrentCnt = index; + return Current(); +} + + + +TDF_Label McCadXCAF_TDocShapeLabelIterator::Previous() +{ + return myPrevious; +} + +TDF_Label McCadXCAF_TDocShapeLabelIterator::Value() +{ + return Current(); +} + +/** + * + * + * Private Functions + */ +Standard_Integer McCadXCAF_TDocShapeLabelIterator::NumberOfShapes() +{ + Standard_Integer cnt(0); + + for(Standard_Integer i=1; i <= myFreeShapes.Length(); i++) + { + cnt++; //increase number of shapes + TDF_Label curLab = myFreeShapes.Value(i); + Traverse(curLab, cnt); + } + + return cnt; +} + + +TDF_Label McCadXCAF_TDocShapeLabelIterator::Traverse(const TDF_Label& theLab, Standard_Integer& theInt, const Standard_Integer& stop) +{ + TDF_Label aLab = theLab; + + for( TDF_ChildIterator it( theLab, Standard_False ); it.More(); it.Next() ) + { + if(mySTool->IsShape(it.Value())) + { + theInt++; + + Traverse( it.Value() , theInt, stop ); + if(theInt == stop && stop != 0) + return it.Value(); + } + } + + return aLab; +} diff --git a/src/MCCAD/QMcCad/CADProperties.cpp b/src/MCCAD/QMcCad/CADProperties.cpp new file mode 100644 index 0000000..30ee7e7 --- /dev/null +++ b/src/MCCAD/QMcCad/CADProperties.cpp @@ -0,0 +1,330 @@ +#include "CADProperties.h" +#include + +QString ToQString(const TCollection_ExtendedString& theName) +{ + TCollection_AsciiString aMessage(theName); + char aStr[aMessage.Length()]; + char* ba = aMessage.ToCString(); + strcpy(aStr, ba); + QString aqMessage(aStr); + return aqMessage; +} + + +CADProperties::CADProperties (QWidget* theFather) : QWidget(theFather) +{ + uiProps.setupUi(this); + + myTransSlider = uiProps.transparencySlider; + myTransLCD = uiProps.transparencyLCDNumber; + myColorButton = uiProps.buttonColor; + //myMaterialButton = uiProps.buttonMaterial; + myMaterialCombo = uiProps.comboMaterial; + myViewSolidButton = uiProps.buttonSolid; + myViewWireFrameButton = uiProps.buttonWireFrame; + myBackgroundColorButton = uiProps.toolBackgroundColor; + + FillMaterialBox(); + + myTreeWidget = uiProps.treeView; + myTreeWidget->setColumnCount(1); + myTreeWidget->headerItem()->setText(0, QApplication::translate("Dialog", "Assemblies/Shapes", 0, QApplication::UnicodeUTF8)); + //myTreeWidget->setSelectionMode(QAbstractItemView::ContiguousSelection | QAbstractItemView::ExtendedSelection); + + + //********** SIGNALS/SLOTS ************ + connect(myTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(SlotItemSelectionChanged())); + connect(myMaterialCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(SlotMaterialSelected(QString))); +} + +/* + * Slots + */ +void CADProperties::SlotItemSelectionChanged() +{ + //retrieve labels and change selection in AISView + //cout << "Selection changed\n"; + QMcCad_Editor* theEditor = QMcCad_Application::GetAppMainWin()->GetEditor(); + QList selectedItems = myTreeWidget->selectedItems(); + + for(int i=0; iMcout(theLabString.ToCString()); + + //check who is father: + TDF_Label theFather = curLab.Father(); + TDF_Tool::Entry(theFather, theLabString); + QMcCad_Application::GetAppMainWin()->Mcout(theLabString.ToCString()); + } +} + +void CADProperties::SlotMaterialSelected(QString theMaterialName) +{ + std::string stdString = theMaterialName.toStdString(); + TCollection_AsciiString theAString(stdString.c_str()); + + Graphic3d_NameOfMaterial theNOM = Graphic3d_NOM_DEFAULT; + + if(theAString.IsEqual("Aluminium")) + theNOM = Graphic3d_NOM_ALUMINIUM; + if(theAString.IsEqual("Brass")) + theNOM = Graphic3d_NOM_BRASS; + if(theAString.IsEqual("Bronze")) + theNOM = Graphic3d_NOM_BRONZE; + if(theAString.IsEqual("Chrome")) + theNOM = Graphic3d_NOM_CHROME; + if(theAString.IsEqual("Copper")) + theNOM = Graphic3d_NOM_COPPER; + if(theAString.IsEqual("Gold")) + theNOM = Graphic3d_NOM_GOLD; + if(theAString.IsEqual("Jade")) + theNOM = Graphic3d_NOM_JADE; + if(theAString.IsEqual("Metalized")) + theNOM = Graphic3d_NOM_METALIZED; + if(theAString.IsEqual("Neon_Gnc")) + theNOM = Graphic3d_NOM_NEON_GNC; + if(theAString.IsEqual("Neon_Phc")) + theNOM = Graphic3d_NOM_NEON_PHC; + if(theAString.IsEqual("Pewter")) + theNOM = Graphic3d_NOM_PEWTER; + if(theAString.IsEqual("Plaster")) + theNOM = Graphic3d_NOM_PLASTER; + if(theAString.IsEqual("Plastic")) + theNOM = Graphic3d_NOM_PLASTIC; + if(theAString.IsEqual("Satin")) + theNOM = Graphic3d_NOM_SATIN; + if(theAString.IsEqual("Silver")) + theNOM = Graphic3d_NOM_SILVER; + if(theAString.IsEqual("Shiny_Plastic")) + theNOM = Graphic3d_NOM_SHINY_PLASTIC; + if(theAString.IsEqual("Steel")) + theNOM = Graphic3d_NOM_STEEL; + if(theAString.IsEqual("Stone")) + theNOM = Graphic3d_NOM_STONE; + + emit MaterialSelected(theNOM); +} + +/* + * Tree Widget Stuff + */ +QTreeWidget* CADProperties::GetTreeWidget() +{ + return myTreeWidget; +} + +void CADProperties::NewEditorAdded(const int theEditorID, const QString& theName) +{ + QTreeWidgetItem* newItem = new QTreeWidgetItem(myTreeWidget); + newItem->setText(0,theName); + newItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + newItem->setTextColor(0, Qt::black); + myEditorTreeMap[theEditorID] = newItem; +} + +void CADProperties::SetModelName(const int theEditorID, const QString& theName) +{ + (myEditorTreeMap[theEditorID])->setText(0, theName); +} + +void CADProperties::EditorClosed(const int theEditorID) +{ + delete myEditorTreeMap[theEditorID]; +} + + +void CADProperties::AddAssembliesToTree(int theEditorID, const Handle(TDocStd_Document) theTDoc ) +{ + Handle(XCAFDoc_ShapeTool) theAssembly = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + TDF_LabelSequence theAssemblyLabelSeq; + theAssembly->GetFreeShapes(theAssemblyLabelSeq); + + for(int j=1; j<=theAssemblyLabelSeq.Length(); j++) + { + TCollection_AsciiString theLabString; + + TDF_Label theLab = theAssemblyLabelSeq.Value(j); + TDF_Tool::Entry(theLab, theLabString); + + //test if label is already bound + if(myLabelList.contains(theLab)) + continue; + + //register label + myLabelList.append(theLab); + + + Handle(TDataStd_Name) theName = new TDataStd_Name; + + Standard_GUID theNameGUID = TDataStd_Name::GetID(); + Standard_Boolean hasName = theLab.FindAttribute(theNameGUID, theName); + Standard_Boolean hasChildren = theLab.HasChild(); + + //QTreeWidgetItem* assemblyPtr; + //QTreeWidgetItem* partPtr; + + if(hasName) + { + //cout << theLabString.ToCString() << " : " << theName->Get() << endl; + Standard_Integer numColon = CountNumberOfColons(theLabString); + + QTreeWidgetItem* assemblyPtr = new QTreeWidgetItem(myEditorTreeMap[theEditorID]); + assemblyPtr->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + assemblyPtr->setText(0,ToQString(theName->Get())); + assemblyPtr->setTextColor(0, Qt::black); + + //bind label + myQTWItemLabelMap[assemblyPtr] = theLab; + + if(hasChildren) + { + TDF_ChildIterator it; + + int cnt(0); + for(it.Initialize(theLab); it.More(); it.Next()) + { + cnt++; + QTreeWidgetItem* partPtr = new QTreeWidgetItem(assemblyPtr); + partPtr->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + + if(it.Value().FindAttribute(theNameGUID, theName)) //has Name + partPtr->setText(0,ToQString(theName->Get())); + else + { + QString defName("part "); + QString theNum; + theNum.setNum(cnt); + defName.append(theNum); + partPtr->setText(0,defName); + } + + partPtr->setTextColor(0, Qt::black); + myQTWItemLabelMap[partPtr] = it.Value(); + myLabelList.append(it.Value()); + myLabelList.append(theAssemblyLabelSeq.Value(j+cnt)); + } + } + } + else + { + QTreeWidgetItem* assemblyPtr = new QTreeWidgetItem(myEditorTreeMap[theEditorID]); + assemblyPtr->setText(0,"assembly"); + assemblyPtr->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + //bind label + myQTWItemLabelMap[assemblyPtr] = theLab; + + if(hasChildren) + { + TDF_ChildIterator it; + + int cnt(0); + for(it.Initialize(theLab); it.More(); it.Next()) + { + cnt++; + QTreeWidgetItem* partPtr = new QTreeWidgetItem(assemblyPtr); + + if(it.Value().FindAttribute(theNameGUID, theName)) //has Name + partPtr->setText(0,ToQString(theName->Get())); + else + { + QString defName("part "); + defName.append(QString(cnt)); + partPtr->setText(0,defName); + } + partPtr->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + partPtr->setTextColor(0, Qt::black); + myQTWItemLabelMap[partPtr] = it.Value(); + myLabelList.append(it.Value()); + myLabelList.append(theAssemblyLabelSeq.Value(j+cnt)); + } + } + } + } +} + + +Standard_Integer CADProperties::CountNumberOfColons(const TCollection_AsciiString theLabString) +{ + Standard_Integer numb(0); + Standard_Integer colPos(0); + + TCollection_AsciiString tmpStr = theLabString; + colPos = tmpStr.Search(":"); + + while(colPos > 0) + { + tmpStr.Remove(1, colPos); + colPos = tmpStr.Search(":"); + numb++; + } + + return numb; +} + + +/* + * + */ + +QSlider* CADProperties::GetSlider() +{ + return myTransSlider; +} + +QToolButton* CADProperties::GetColorButton() +{ + return myColorButton; +} + +QComboBox* CADProperties::GetMaterialCombo() +{ + return myMaterialCombo; +} + +QToolButton* CADProperties::GetViewSolidButton() +{ + return myViewSolidButton; +} + +QToolButton* CADProperties::GetViewWireFrameButton() +{ + return myViewWireFrameButton; +} + +QToolButton* CADProperties::GetBackgroundColorButton() +{ + return myBackgroundColorButton; +} + +void CADProperties::ResetSlider() +{ + myTransSlider->setValue(0); + myTransLCD->display(0); +} + +void CADProperties::FillMaterialBox() +{ + myMaterialCombo->addItem("Shape Material"); + myMaterialCombo->addItem("Aluminium"); + myMaterialCombo->addItem("Brass"); + myMaterialCombo->addItem("Bronze"); + myMaterialCombo->addItem("Chrome"); + myMaterialCombo->addItem("Copper"); + myMaterialCombo->addItem("Gold"); + myMaterialCombo->addItem("Jade"); + myMaterialCombo->addItem("Metalized"); + myMaterialCombo->addItem("Neon_Gnc"); + myMaterialCombo->addItem("Neon_Phc"); + myMaterialCombo->addItem("Pewter"); + myMaterialCombo->addItem("Plaster"); + myMaterialCombo->addItem("Plastic"); + myMaterialCombo->addItem("Satin"); + myMaterialCombo->addItem("Silver"); + myMaterialCombo->addItem("Shiny_Plastic"); + myMaterialCombo->addItem("Steel"); + myMaterialCombo->addItem("Stone"); +} diff --git a/src/MCCAD/QMcCad/QMcCad_ActionFactory.cpp b/src/MCCAD/QMcCad/QMcCad_ActionFactory.cpp new file mode 100644 index 0000000..23ad023 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_ActionFactory.cpp @@ -0,0 +1,486 @@ +#include + +QMcCad_ActionFactory::QMcCad_ActionFactory(QWidget* theWin) +{ + myWin = theWin; +} + +QMcCad_ActionFactory::~QMcCad_ActionFactory() +{ + +} + +QAction* QMcCad_ActionFactory::CreateAction(McCadTool_TaskID theID, QObject* aMaster) +{ + if (aMaster==NULL) + { + std::cerr << "Missing Action Master for " << theID << endl; + return NULL; + } + + if (myWin==NULL) + { + std::cerr << "Missing Application Window for " << theID << endl; + return NULL; + } + + QAction* action = NULL; + + switch (theID) + { + case McCadTool_NoID: + std::cerr << "No Tool Id " << endl; + break; + + case McCadTool_FileNew: + action = new QAction(QIcon(":images/new.png"), tr("&New"), myWin); + action->setShortcut(tr("Ctrl+N")); + action->setStatusTip(tr("Creates new document")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotFileNew())); + break; + + case McCadTool_FileOpen: + action = new QAction(QIcon(":images/open.png"), tr("&Open"), myWin); + action->setShortcut(tr("Ctrl+O")); + action->setStatusTip(tr("Opens file")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotFileOpen())); + break; + + case McCadTool_FileOpenNew: + action = new QAction(QIcon(":images/openNew.png"), tr("&Open New"), myWin); + action->setShortcut(tr("Ctrl+M")); + action->setStatusTip(tr("Opens file in new document")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotFileOpenNew())); + break; + + case McCadTool_FileClose: + action = new QAction(QIcon(":images/close.png"), tr("&Close"), myWin); + action->setShortcut(tr("Ctrl+Q")); + action->setStatusTip(tr("Closes file")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotFileClose())); + break; + + + case McCadTool_ImportGeom: + action = new QAction( tr("&Import"), myWin); + action->setShortcut(tr("Ctrl+I")); + action->setStatusTip(tr("Imports Geometry")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotImport())); + break; + + + case McCadTool_ExportGeom: + action = new QAction(tr("&Export"), myWin); + action->setShortcut(tr("Ctrl+E")); + action->setStatusTip(tr("Exports Geometry Tree")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotExport())); + break; + + + case McCadTool_FileSave: + action = new QAction( QIcon(":images/save.png"), tr("&Save"), myWin); + action->setShortcut(tr("Ctrl+S")); + action->setStatusTip(tr("Saves file")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotFileSave())); + break; + + case McCadTool_FileSaveAs: + action = new QAction( QIcon(":images/saveas.png"), tr("Save &as"), myWin); + action->setShortcut(tr("Ctrl+A")); + action->setStatusTip(tr("Save as ...")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotFileSaveAs())); + break; + + case McCadTool_Hardcopy: + action = new QAction(tr("&Hardcopy"), myWin); + action->setShortcut(tr("Ctrl+H")); + action->setStatusTip(tr("Window Hardcopy")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotHardcopy())); + break; + + case McCadTool_Print: + action = new QAction(QIcon(":images/print.png"), tr("&Print"), myWin); + action->setShortcut(tr("Ctrl+P")); + action->setStatusTip(tr("Prints the document")); + connect(action, SIGNAL(triggered()), myWin, SLOT(SlotPrint())); + break; + + case McCadTool_EditUndo: + action = new QAction( QIcon(":images/undo.png"), tr("&Undo"), myWin); + action->setShortcut(tr("Ctrl+U")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotUndo())); + break; + + case McCadTool_EditRedo: + action = new QAction( QIcon(":images/redo.png"), tr("&Redo"), myWin); + action->setShortcut(tr("Ctrl+R")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotRedo())); + break; + + case McCadTool_EditCut: + action = new QAction( QIcon(":images/cut.png"), tr("&Cut"), myWin); + action->setShortcut(tr("Ctrl+X")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotCut())); + break; + + case McCadTool_EditCopy: + action = new QAction( QIcon(":images/copy.png"), tr("&Copy"), myWin); + action->setShortcut(tr("Ctrl+C")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotCopy())); + break; + + case McCadTool_EditPaste: + action = new QAction( QIcon(":images/past.png"), tr("&Past"), myWin); + action->setShortcut(tr("Ctrl+V")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotPast())); + break; + + case McCadTool_Select: + action = new QAction( QIcon(":images/select.png"), tr("&Select"), myWin); + action->setShortcut(tr("Ctrl+W")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotSelect())); + break; + + case McCadTool_SelectAll: + action = new QAction( tr("&SelectAll"), myWin); + action->setShortcut(tr("Ctrl+Z")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotSelectAll())); + break; + + case McCadTool_DeselectAll: + action = new QAction( tr("&DeselectAll"), myWin); + action->setShortcut(tr("Ctrl+Y")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotDeselectAll())); + break; + + case McCadTool_Redraw: + action = new QAction( QIcon(":images/draw.png"), tr("Redraw"), myWin); + //action->setShortcut(tr("Alt+D")); + action->setStatusTip(tr("Redraw")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotRedraw())); + break; + + case McCadTool_ZoomWindow: + action = new QAction(QIcon(":images/wzoom.png"), tr("&WindowZoom"), myWin); + action->setShortcut(tr("Alt+W")); + action->setStatusTip(tr("Window Zoom")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotZooomWindow())); + break; + + case McCadTool_ZoomDynamic: + action = new QAction(QIcon(":images/dzoom.png"), tr("&DynamicZoom"), myWin); + action->setShortcut(tr("Alt+Y")); + action->setStatusTip(tr("Dynamic Zoom")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotZoomDynamic())); + break; + + /*case McCadTool_ZoomScale: + action = new QAction(QIcon(":images/szoom.png"), tr("&ScaleZoom"), myWin); + action->setShortcut(tr("Alt+S")); + action->setStatusTip(tr("Scale Zoom")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotZoomScale())); + break;*/ + + case McCadTool_FitAll: + action = new QAction(QIcon(":images/fitall.png"), tr("&FitAll"), myWin); + action->setShortcut(tr("Ctrl+F")); + action->setStatusTip(tr("Fit All")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotFitAll())); + break; + + case McCadTool_ZoomIn: + action = new QAction(QIcon(":images/izoom.png"), tr("&ZoomIn"), myWin); + action->setShortcut(tr("Alt+I")); + action->setStatusTip(tr("Zoom In")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotZoomIn())); + break; + + case McCadTool_ZoomOut: + action = new QAction( QIcon(":images/ozoom.png"), tr("&ZoomOut"), myWin); + action->setShortcut(tr("Alt+O")); + action->setStatusTip(tr("Zoom Out")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotZoomOut())); + break; + + case McCadTool_Pan: + action = new QAction( QIcon(":images/panview.png"), tr("&Pan"), myWin); + action->setShortcut(tr("Alt+P")); + action->setStatusTip(tr("Pan")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotPan())); + break; + + case McCadTool_Rotate: + action = new QAction( QIcon(":images/rotate.png"), tr("&Rotate"), myWin); + action->setShortcut(tr("Alt+R")); + action->setStatusTip(tr("Rotate")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotRotate())); + break; + + case McCadTool_BackProject: + action = new QAction(QIcon(":images/backview.png"), tr("&Back"), myWin); + action->setStatusTip(tr("Back Projection")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotBackProject())); + break; + + case McCadTool_FrontProject: + action = new QAction(QIcon(":images/frontview.png"),tr("&Front"), myWin); + action->setStatusTip(tr("Fron Projection")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotFrontProject())); + break; + + case McCadTool_TopProject: + action = new QAction(QIcon(":images/topview.png"),tr("&Top"), myWin); + action->setStatusTip(tr("Top Projection")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotTopProject())); + break; + + case McCadTool_BottomProject: + action = new QAction(QIcon(":images/bottomview.png"),tr("&Bottom"), myWin); + action->setStatusTip(tr("Bottom Projection")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotBottomProject())); + break; + + case McCadTool_LeftProject: + action = new QAction(QIcon(":images/leftview.png"),tr("&Left"), myWin); + action->setStatusTip(tr("Left Projection")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotLeftProject())); + break; + + case McCadTool_RightProject: + action = new QAction(QIcon(":images/rightview.png"),tr("&Right"), myWin); + action->setStatusTip(tr("Right Projection")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotRightProject())); + break; + + case McCadTool_WireFrame: + action = new QAction(QIcon(":images/wireframe.png"),tr("&WireFrame"), myWin); + action->setStatusTip(tr("Wireframe")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotWireFrame())); + break; + + case McCadTool_FlatShade: + action = new QAction(QIcon(":images/shading.png"),tr("&Shade"), myWin); + action->setStatusTip(tr("Shading")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotShade())); + break; + + // AssistActions; + + case McCadTool_MeasureDistance: + action = new QAction(tr("&Distance"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotDistance())); + break; + + case McCadTool_MeasureAngle: + action = new QAction(tr("&Angle"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotAngle())); + break; + + case McCadTool_MeasureArea: + action = new QAction(tr("&Area"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotArea())); + break; + + case McCadTool_MeasureVolume: + action = new QAction(tr("&Volume"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotVolume())); + break; + + case McCadTool_PropertyCurve: + action = new QAction(tr("&CurveProperty"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotCurveProperty())); + break; + + case McCadTool_PropertySurface: + action = new QAction(tr("&SurfaceProperty"), myWin); + connect(action, SIGNAL(triggered()), aMaster, + SLOT(SlotSurfaceProperty())); + break; + + case McCadTool_MakeBox: + action = new QAction(tr("&Box"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeBox())); + break; + + case McCadTool_MakeCone: + action = new QAction(tr("&Cone"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeCone())); + break; + + case McCadTool_MakeCylinder: + action = new QAction(tr("&Cylinder"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeCylinder())); + break; + + case McCadTool_MakeHalfSpace: + action = new QAction(tr("&HalfSpace"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeHalfSpace())); + break; + + case McCadTool_MakeSphere: + action = new QAction(tr("&Sphere"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeSphere())); + break; + + case McCadTool_MakeTorus: + action = new QAction(tr("&Torus"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeTorus())); + break; + + case McCadTool_MakeWedge: + action = new QAction(tr("&Wedge"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMakeWedge())); + break; + + //modify + + case McCadTool_ModelErase: + action = new QAction(tr("&Erase"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotErase())); + break; + + case McCadTool_ModelCopy: + action = new QAction(tr("&Copy"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotModelCopy())); + break; + + case McCadTool_ModelMirror: + action = new QAction(tr("&Mirror"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMirror())); + break; + + case McCadTool_ModelMove: + action = new QAction(tr("&Move"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotMove())); + break; + + case McCadTool_ModelRotate: + action = new QAction(tr("&Rotate"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotModelRotate())); + break; + + case McCadTool_ModelScale: + action = new QAction(tr("&Scale"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotScale())); + break; + + case McCadTool_ModelStrech: + //action = new QAction(tr("&Strech"), myWin); + //connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotStrech())); + break; + + case McCadTool_SolidUnion: + action = new QAction(tr("&Union"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotUnion())); + break; + + case McCadTool_SolidIntersection: + action = new QAction(tr("&Intersection"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotIntersection())); + break; + + case McCadTool_SolidDifference: + action = new QAction(tr("&Difference"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotDifference())); + break; + + case McCadTool_BackgroundColor: + action = new QAction( QIcon(":images/color.png"), tr("&BackgroundColor"), myWin); + action->setShortcut(tr("Alt+B")); + action->setStatusTip(tr("Background Color")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotBackgroundColor())); + break; + + case McCadTool_ShapeColor: + action = new QAction( QIcon(":images/scolor.png"), tr("&ShapeColor"), myWin); + action->setShortcut(tr("Alt+C")); + action->setStatusTip(tr("Shape Color")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotShapeColor())); + break; + + case McCadTool_ShapeMaterial: + action = new QAction( QIcon(":images/material.png"), tr("&ShapeMaterial"), myWin); + action->setShortcut(tr("Alt+M")); + action->setStatusTip(tr("Shape Material")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotShapeMaterial())); + break; + + case McCadTool_ShapeTransparency: + action = new QAction( QIcon(":images/transparency.png"), tr("&Transparency"), myWin); + //action->setShortcut(tr("Alt+T")); + action->setStatusTip(tr("Shape Transparency")); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotShapeTransparency())); + break; + + case McCadTool_ReadValueList: + action = new QAction(tr("Read Value List"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotReadValueList())); + break; + + case McCadTool_Antialiasing: + action = new QAction(tr("&Antialiasing"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotAntialiasing())); + break; + + case McCadTool_SetHiddenLine: + action = new QAction(tr("&HiddenLine"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotSetHiddenLine())); + break; + + + case McCadTool_Grid: + action = new QAction(tr("Set/Unset Grid"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotSetGrid())); + break; + + case McCadTool_Axis: + action = new QAction(tr("Set/Unset Axis"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotSetAxis())); + break; + + case McCadTool_DispSelOnly: + action = new QAction(QIcon(":images/viewselectedonly.png"),tr("Display Selected Only"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotDispSelOnly())); + break; + + case McCadTool_ShowAll: + action = new QAction(QIcon(":images/viewall.png"),tr("Show All"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotShowAll())); + break; + + case McCadTool_HideSelected: + action = new QAction(QIcon(":images/selected2ghost.png"),tr("Hide Selected"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotHideSelected())); + break; + + case McCadTool_RedispSelected: + action = new QAction(QIcon(":images/ghost2displayed.png"),tr("Redisplay Selected"), myWin); + connect(action, SIGNAL(triggered()), aMaster, SLOT(SlotRedisplaySelected())); + break; + + /*case McCadTool_AddMaterialGroup: + action = new QAction(tr("Edit"), myWin); + connect(action,SIGNAL(triggered()), aMaster, SLOT(SlotAddMaterialGroup())); + break; // Lei + + case McCadTool_AddToMaterialGroup: + action = new QAction(tr("Add solids to material group"), myWin); + connect(action,SIGNAL(triggered()), aMaster, SLOT(SlotAddToMaterialGroup())); + connect(action,SIGNAL(triggered()), aMaster, SLOT(SlotEditMaterialCards())); + */ +break; + + case McCadTool_ClippingPlane: + action = new QAction(tr("Define new Clipping Plane"), myWin); + action->setShortcut(tr("Ctrl+L")); + connect(action,SIGNAL(triggered()), aMaster, SLOT(SlotClippingPlane())); + break; + + default: + std::cerr << "No Tool " << theID << " found!!" << endl; + break; + } + + return action; +} + diff --git a/src/MCCAD/QMcCad/QMcCad_ActionMaster.cpp b/src/MCCAD/QMcCad/QMcCad_ActionMaster.cpp new file mode 100644 index 0000000..9d0e439 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_ActionMaster.cpp @@ -0,0 +1,658 @@ +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//#include +//#include +#include +#include + +#include +//#include + + +#include +#include + + + +QMcCad_ActionMaster::QMcCad_ActionMaster() +{ + McCadTool_TaskHistory newTaskHistory(20); + myTaskHistory = newTaskHistory; +} + +QMcCad_ActionMaster::~QMcCad_ActionMaster() +{ + +} + +void QMcCad_ActionMaster::Mcout(const QString & aMessage) +{ + QString theEdMess = "QMcCad: "; + theEdMess = theEdMess + aMessage; + QMcCad_Application::GetAppMainWin()->Mcout(theEdMess.toUtf8().constData()); +} + + +Handle(McCadTool_Task) QMcCad_ActionMaster::GetCurrentAction() +{ + QMcCad_View* aView = QMcCad_Application::GetAppMainWin()->GetView(); + + if (aView !=NULL) + return aView->GetCurrentTask(); + else + return NULL; +} + +void QMcCad_ActionMaster::SetCurrentAction(McCadTool_TaskID theID) +{ + Handle(McCadTool_Task) aT = new McCadTool_Task; + aT->Initialize(); + Handle(McCadCom_CasDocument) theDoc = QMcCad_Application::GetAppMainWin()->GetDocument(); + QMcCad_View* theView = QMcCad_Application::GetAppMainWin()->GetView(); + + + if (theView == NULL || theDoc == NULL) + { + QMcCad_Application::GetAppMainWin()->Mcout("Missing application document or view"); + return; + } + switch (theID) + { + case McCadTool_NoID: + break; + /*handled else where*/ + case McCadTool_FileNew: + break; + case McCadTool_FileOpen: + break; + case McCadTool_FileClose: + break; + case McCadTool_FileSave: + break; + case McCadTool_FileSaveAs: + break; + case McCadTool_Hardcopy: + break; + case McCadTool_ImportBREP: + break; + case McCadTool_ImportIGES: + break; + case McCadTool_ImportSTEP: + break; + case McCadTool_ImportMCNP: + break; + case McCadTool_ExportBREP: + break; + case McCadTool_ExportIGES: + break; + case McCadTool_ExportSTEP: + break; + case McCadTool_ExportMCNP: + break; + /*------------------------------*/ + case McCadTool_Printer: + Mcout("Not yet implemented!"); + break; + case McCadTool_PrinterSetup: + break; + case McCadTool_PrintPreview: + break; + case McCadTool_Print: + Mcout("Not yet implemented!"); + break; + case McCadTool_ResentFiles: + Mcout("Not yet implemented!"); + break; + case McCadTool_EditUndo: + Mcout("Not yet implemented!"); + break; + case McCadTool_EditRedo: + Mcout("Not yet implemented!"); + break; + case McCadTool_EditCut: + Mcout("Not yet implemented!"); + break; + case McCadTool_EditCopy: + Mcout("Not yet implemented!"); + break; + case McCadTool_EditPaste: + Mcout("Not yet implemented!"); + break; + case McCadTool_Select: + Mcout("Not yet implemented!"); + break; + case McCadTool_SelectAll: + Mcout("Not yet implemented!"); + break; + case McCadTool_DeselectAll: + Mcout("Not yet implemented!"); + break; + + /*view tools*/ + case McCadTool_Redraw: + aT = new McCadViewTool_Redraw(theDoc, theView); + break; + case McCadTool_ZoomWindow: + aT = new McCadViewTool_Zoom(theDoc, theView); + break; + case McCadTool_ZoomDynamic: + Mcout("Not yet implemented!"); + break; + /*case McCadTool_ZoomScale: + break;*/ + case McCadTool_FitAll: + aT = new McCadViewTool_FitAll(theDoc, theView); + break; + case McCadTool_ZoomIn: + aT = new McCadViewTool_ZoomIn(theDoc, theView); + break; + case McCadTool_ZoomOut: + aT = new McCadViewTool_ZoomOut(theDoc, theView); + break; + case McCadTool_Pan: + aT = new McCadViewTool_Pan(theDoc, theView); + break; + case McCadTool_Rotate: + aT = new McCadViewTool_Rotate(theDoc, theView); + break; + case McCadTool_ReadValueList: + aT = new McCadViewTool_ReadValueList(theDoc, theView); + break; + case McCadTool_FrontProject: + aT = new McCadViewTool_FrontProject(theDoc,theView); + break; + case McCadTool_TopProject: + aT = new McCadViewTool_TopProject(theDoc,theView); + break; + case McCadTool_BottomProject: + aT = new McCadViewTool_BottomProject(theDoc,theView); + break; + case McCadTool_LeftProject: + aT = new McCadViewTool_LeftProject(theDoc, theView); + break; + case McCadTool_RightProject: + aT = new McCadViewTool_RightProject(theDoc, theView); + break; + case McCadTool_WireFrame: + aT = new McCadViewTool_WireFrame(theDoc, theView); + break; + case McCadTool_FlatShade: + aT = new McCadViewTool_SetShadingMode(theDoc, theView); + break; + case McCadTool_MeasureDistance: + Mcout("Not yet implemented!"); + break; + case McCadTool_MeasureAngle: + Mcout("Not yet implemented!"); + break; + case McCadTool_MeasureArea: + Mcout("Not yet implemented!"); + break; + case McCadTool_MeasureVolume: + Mcout("Not yet implemented!"); + break; + case McCadTool_PropertyCurve: + Mcout("Not yet implemented!"); + break; + case McCadTool_PropertySurface: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeBox: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeCone: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeCylinder: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeHalfSpace: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeSphere: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeTorus: + Mcout("Not yet implemented!"); + break; + case McCadTool_MakeWedge: + Mcout("Not yet implemented!"); + break; + case McCadTool_ModelErase: + aT = new McCadViewTool_Delete(theDoc, theView); + break; + case McCadTool_ModelCopy: + Mcout("Not yet implemented!"); + break; + case McCadTool_ModelMirror: + Mcout("Not yet implemented!"); + break; + case McCadTool_ModelMove: + Mcout("Not yet implemented!"); + break; + case McCadTool_ModelRotate: + Mcout("Not yet implemented!"); + break; + case McCadTool_ModelScale: + //Mcout("Not yet implemented!"); + break; + case McCadTool_ModelStrech: + Mcout("Not yet implemented!"); + break; + case McCadTool_SolidUnion: + Mcout("Not yet implemented!"); + break; + case McCadTool_SolidIntersection: + Mcout("Not yet implemented!"); + break; + case McCadTool_SolidDifference: + Mcout("Not yet implemented!"); + break; + case McCadTool_BackgroundColor: + aT = new McCadViewTool_SetBackgroundColor(theDoc, theView); + break; + case McCadTool_ShapeColor: + aT = new McCadViewTool_SetShapeColor(theDoc, theView); + break; + case McCadTool_ShapeMaterial: + break; + case McCadTool_ShapeTransparency: + aT = new McCadViewTool_Transparency(theDoc, theView); + break; + case McCadTool_Antialiasing: + aT = new McCadViewTool_SetAntialiasing(theDoc, theView); + break; + case McCadTool_SetHiddenLine: + aT = new McCadViewTool_SetHiddenLine(theDoc, theView); + break; + case McCadTool_Axis: + aT = new McCadViewTool_Axis(theDoc, theView); + break; + case McCadTool_BackProject: + aT = new McCadViewTool_BackProject(theDoc,theView); + break; + case McCadTool_ShowAll: + aT = new McCadViewTool_ShowAll(theDoc, theView); + break; + case McCadTool_HideSelected: + aT = new McCadViewTool_HideSelected(theDoc, theView); + break; + case McCadTool_RedispSelected: + aT = new McCadViewTool_RedisplaySelected(theDoc, theView); + break; + case McCadTool_DispSelOnly: + aT = new McCadViewTool_DisplaySelectedOnly(theDoc, theView); + break; + case McCadTool_ClippingPlane: + theView->ClippingPlaneDialog(); + return; + break; + default: + Mcout("QMcCad_ActionMaster :: no such action found."); + break; + } + + if (!aT->IsNull()) + { + theView->SetCurrentTask(aT); + myTaskHistory.Log(aT); + emit ActionStarted(); + } +} + +void QMcCad_ActionMaster::SlotUndo() +{ + QMcCad_Editor* theEditor = QMcCad_Application::GetAppMainWin()->GetEditor(); + Handle(TDocStd_Document) theTDoc = theEditor->GetDocument()->GetTDoc(); + + if(!theTDoc->Undo()) + //cout << "could not UNDO command\n"; + + theEditor->GetDocument()->GetContext()->UpdateCurrentViewer(); + + if(myTaskHistory.CanUndo()) + myTaskHistory.Undo(); +} +void QMcCad_ActionMaster::SlotRedo() +{ + QMcCad_Application::GetAppMainWin()->GetEditor()->GetDocument()->GetTDoc()->Redo(); + //SetCurrentAction(McCadTool_EditRedo); +} +void QMcCad_ActionMaster::SlotCut() +{ + SetCurrentAction(McCadTool_EditCut); +} +void QMcCad_ActionMaster::SlotCopy() +{ + SetCurrentAction(McCadTool_EditCopy); +} +void QMcCad_ActionMaster::SlotPast() +{ + SetCurrentAction(McCadTool_EditPaste); +} +void QMcCad_ActionMaster::SlotSelect() +{ + SetCurrentAction(McCadTool_Select); +} +void QMcCad_ActionMaster::SlotSelectAll() +{ + SetCurrentAction(McCadTool_SelectAll); +} +void QMcCad_ActionMaster::SlotDeselectAll() +{ + SetCurrentAction(McCadTool_DeselectAll); +} + +// view ............................................................ +void QMcCad_ActionMaster::SlotRedraw() +{ + SetCurrentAction(McCadTool_Redraw); +} + +void QMcCad_ActionMaster::SlotZooomWindow() +{ + SetCurrentAction(McCadTool_ZoomWindow); +} +void QMcCad_ActionMaster::SlotZoomDynamic() +{ + SetCurrentAction(McCadTool_ZoomDynamic); +} +void QMcCad_ActionMaster::SlotDispSelOnly() +{ + SetCurrentAction(McCadTool_DispSelOnly); +} +void QMcCad_ActionMaster::SlotRedisplaySelected() +{ + SetCurrentAction(McCadTool_RedispSelected); +} +void QMcCad_ActionMaster::SlotHideSelected() +{ + SetCurrentAction(McCadTool_HideSelected); +} +void QMcCad_ActionMaster::SlotShowAll() +{ + SetCurrentAction(McCadTool_ShowAll); +} +/*void QMcCad_ActionMaster::SlotZoomScale() +{ + SetCurrentAction(McCadTool_ZoomScale); +}*/ +void QMcCad_ActionMaster::SlotFitAll() +{ + SetCurrentAction(McCadTool_FitAll); +} +void QMcCad_ActionMaster::SlotZoomIn() +{ + SetCurrentAction(McCadTool_ZoomIn); +} +void QMcCad_ActionMaster::SlotZoomOut() +{ + SetCurrentAction(McCadTool_ZoomOut); +} +void QMcCad_ActionMaster::SlotPan() +{ + SetCurrentAction(McCadTool_Pan); +} +void QMcCad_ActionMaster::SlotRotate() +{ + SetCurrentAction(McCadTool_Rotate); +} +void QMcCad_ActionMaster::SlotBackProject() +{ + SetCurrentAction(McCadTool_BackProject); +} +void QMcCad_ActionMaster::SlotFrontProject() +{ + SetCurrentAction(McCadTool_FrontProject); +} +void QMcCad_ActionMaster::SlotTopProject() +{ + SetCurrentAction(McCadTool_TopProject); +} +void QMcCad_ActionMaster::SlotBottomProject() +{ + SetCurrentAction(McCadTool_BottomProject); +} +void QMcCad_ActionMaster::SlotLeftProject() +{ + SetCurrentAction(McCadTool_LeftProject); +} +void QMcCad_ActionMaster::SlotRightProject() +{ + SetCurrentAction(McCadTool_RightProject); +} +void QMcCad_ActionMaster::SlotWireFrame() +{ + SetCurrentAction(McCadTool_WireFrame); +} +void QMcCad_ActionMaster::SlotShade() +{ + SetCurrentAction(McCadTool_FlatShade); +} +// assist.............................................................. +void QMcCad_ActionMaster::SlotDistance() +{ + SetCurrentAction(McCadTool_MeasureDistance); +} +void QMcCad_ActionMaster::SlotAngle() +{ + SetCurrentAction(McCadTool_MeasureAngle); +} +void QMcCad_ActionMaster::SlotArea() +{ + SetCurrentAction(McCadTool_MeasureArea); +} +void QMcCad_ActionMaster::SlotVolume() +{ + SetCurrentAction(McCadTool_MeasureVolume); +} +void QMcCad_ActionMaster::SlotCurveProperty() +{ + SetCurrentAction(McCadTool_PropertyCurve); +} +void QMcCad_ActionMaster::SlotSurfaceProperty() +{ + SetCurrentAction(McCadTool_PropertySurface); +} + +// model ............................................................... +void QMcCad_ActionMaster::SlotMakeBox() +{ + //SetCurrentAction(McCadTool_MakeBox); + McCadDesign_MakeBox boxMaker(QMcCad_Application::GetAppMainWin()); + boxMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + boxMaker.exec(); +} +void QMcCad_ActionMaster::SlotMakeCone() +{ + //SetCurrentAction(McCadTool_MakeCone); + McCadDesign_MakeCone coneMaker(QMcCad_Application::GetAppMainWin()); + coneMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + coneMaker.exec(); +} +void QMcCad_ActionMaster::SlotMakeCylinder() +{ + //SetCurrentAction(McCadTool_MakeCylinder); + McCadDesign_MakeCylinder cylinderMaker(QMcCad_Application::GetAppMainWin()); + cylinderMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + cylinderMaker.exec(); +} +void QMcCad_ActionMaster::SlotMakeHalfSpace() +{ + SetCurrentAction(McCadTool_MakeHalfSpace); +} +void QMcCad_ActionMaster::SlotMakeSphere() +{ + //SetCurrentAction(McCadTool_MakeSphere); + McCadDesign_MakeSphere sphereMaker(QMcCad_Application::GetAppMainWin()); + sphereMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + sphereMaker.exec(); +} +void QMcCad_ActionMaster::SlotMakeTorus() +{ + SetCurrentAction(McCadTool_MakeTorus); +} +void QMcCad_ActionMaster::SlotMakeWedge() +{ + SetCurrentAction(McCadTool_MakeWedge); +} + +// modify ............................................................... +void QMcCad_ActionMaster::SlotErase() +{ + SetCurrentAction(McCadTool_ModelErase); +} +void QMcCad_ActionMaster::SlotModelCopy() +{ + McCadDesign_CopyTo copyMaker(QMcCad_Application::GetAppMainWin()); + copyMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + copyMaker.exec(); + //SetCurrentAction(McCadTool_ModelCopy); +} +void QMcCad_ActionMaster::SlotMirror() +{ + SetCurrentAction(McCadTool_ModelMirror); +} +void QMcCad_ActionMaster::SlotMove() +{ + McCadDesign_MoveTo moveMaker(QMcCad_Application::GetAppMainWin()); + moveMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + moveMaker.exec(); + //SetCurrentAction(McCadTool_ModelMove); +} +void QMcCad_ActionMaster::SlotModelRotate() +{ + McCadDesign_Rotate rotationMaker(QMcCad_Application::GetAppMainWin()); + rotationMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + rotationMaker.exec(); + //SetCurrentAction(McCadTool_ModelRotate); +} +void QMcCad_ActionMaster::SlotScale() +{ + //SetCurrentAction(McCadTool_ModelScale); + McCadDesign_Scale scaleMaker(QMcCad_Application::GetAppMainWin()); + scaleMaker.SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + scaleMaker.exec(); +} + +void QMcCad_ActionMaster::SlotReadValueList() +{ + SetCurrentAction(McCadTool_ReadValueList); +} + +void QMcCad_ActionMaster::SlotStrech() +{ + SetCurrentAction(McCadTool_ModelStrech); +} +void QMcCad_ActionMaster::SlotUnion() +{ + SetCurrentAction(McCadTool_SolidUnion); +} +void QMcCad_ActionMaster::SlotIntersection() +{ + SetCurrentAction(McCadTool_SolidIntersection); +} +void QMcCad_ActionMaster::SlotDifference() +{ + SetCurrentAction(McCadTool_SolidDifference); +} + +//window +void QMcCad_ActionMaster::SlotBackgroundColor() +{ + SetCurrentAction(McCadTool_BackgroundColor); +} +void QMcCad_ActionMaster::SlotShapeColor() +{ + SetCurrentAction(McCadTool_ShapeColor); +} +void QMcCad_ActionMaster::SlotShapeMaterial() +{ + SetCurrentAction(McCadTool_ShapeMaterial); +} +void QMcCad_ActionMaster::SlotShapeTransparency() +{ + //SetCurrentAction(McCadTool_ShapeTransparency); + QMcCad_TransparencyDialog transDial(QMcCad_Application::GetAppMainWin()); + transDial.exec(); +} +void QMcCad_ActionMaster::SlotAntialiasing() +{ + SetCurrentAction(McCadTool_Antialiasing); +} +void QMcCad_ActionMaster::SlotSetHiddenLine() +{ + SetCurrentAction(McCadTool_SetHiddenLine); +} +void QMcCad_ActionMaster::SlotSetAxis() +{ + SetCurrentAction(McCadTool_Axis); +} +void QMcCad_ActionMaster::SlotSetGrid() +{ + SetCurrentAction(McCadTool_Grid); +} + +// QMcCadGeomeTree related stuff +void QMcCad_ActionMaster::SlotAddMaterialGroup() +{ + (QMcCad_Application::GetAppMainWin()->GetTreeWidget())->SlotAddMaterialGroup(); +} + +void QMcCad_ActionMaster::SlotAddToMaterialGroup() +{ + (QMcCad_Application::GetAppMainWin()->GetTreeWidget())->SlotAddToMaterialGroup(); +} + +/*void QMcCad_ActionMaster::SlotOnClickRButton() // Lei +{ + (QMcCad_Application::GetAppMainWin()->GetTreeWidget())->SlotAddMaterialGroup(); +}*/ + +void QMcCad_ActionMaster::SlotClippingPlane() +{ + SetCurrentAction(McCadTool_ClippingPlane); + //QMcCad_ClippingPlaneDialog cpDial(QMcCad_Application::GetAppMainWin()); + //cpDial.exec(); +} diff --git a/src/MCCAD/QMcCad/QMcCad_Application.cpp b/src/MCCAD/QMcCad/QMcCad_Application.cpp new file mode 100644 index 0000000..44da830 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_Application.cpp @@ -0,0 +1,1307 @@ +#include +// #include + +#include +#include +#include +#include +#ifndef _OSD_Directory_HeaderFile +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +//extern QString theProgName; +// QAssistantClient* QMcCad_Application::myAssistant = NULL; +QMcCad_Application* QMcCad_Application::myApp = NULL; + + +TCollection_AsciiString ToAStr(const QString& theStr) +{ + char aStr[theStr.length()]; + QByteArray ba = theStr.toAscii(); + strcpy(aStr, ba.data()); + TCollection_AsciiString anAsciiStr(aStr); + return anAsciiStr; +} + +QMcCad_Application::QMcCad_Application(QWidget *parent, const char *name) : QMainWindow(parent) +{ + if(name); + + myXCAFApp = McCadXCAF_Application::GetApplication(); //create XCAF application to use XDE and OCAF from OpenCascade + + myApp = this; + myPrinter = new QPrinter( QPrinter::HighResolution ); + myAcM = new QMcCad_ActionMaster(); + + myWS = new QWorkspace(this); + setCentralWidget(myWS); + + connect(myWS, SIGNAL(windowActivated(QWidget *)),this, SLOT(SlotUpdateMenus())); + + OSD_Directory theResourceDir = ResourceDir(); + OSD_Path theResourcePath; + theResourceDir.Path(theResourcePath); + TCollection_AsciiString aPathName; + theResourcePath.SystemName(aPathName); + QString theDocumentDir(aPathName.ToCString()); + theDocumentDir = theDocumentDir+"/doc"; + + // if (!myAssistant) + // myAssistant = new QAssistantClient( QDir( theDocumentDir).absolutePath(), this ); + CreateActions(); + CreateMenus(); + CreateToolBars(); + CreateStatusBar(); + CreateLogWindow(); + CreateTreeView(); + ReadSettings(); + SlotUpdateMenus(); + myEditorIDCnt = 0; + + if(myWorkingDirectory.isEmpty()) + myWorkingDirectory = "."; + + setWindowTitle(tr("McCad")); + setWindowIcon(QIcon(":images/icon.png")); + Mcout("McCad_Ready:"); + showMaximized(); + + SlotFileNew(); + + McCadMessenger_ObserverInterface *qmessenger = new QMcCadMessenger_MainWindowMessage; + m_messenger = McCadMessenger_Singleton::Instance(); + m_messenger->Register(qmessenger); + + Mcout("Please notice: Warnings and error messages are not yet fully available via the GUI. Please run McCad from inside a shell to have all available debug messages printed out.", McCadMessenger_WarningMsg); +} + + +Handle(TDocStd_Application) QMcCad_Application::GetXCAFApp() +{ + return myXCAFApp; +} + + +QWorkspace* QMcCad_Application::GetWorkSpace() +{ + return myWS; +} + + +QMcCad_Editor* QMcCad_Application::GetEditor() +{ + if (myWS != NULL) + { + return (QMcCad_Editor*)myWS->activeWindow(); + } + else + { + return NULL; + } +} + + +QColor QMcCad_Application::GetBgColor() +{ + return myBgCol; +} + +QMcCad_Editor* QMcCad_Application::GetEditor(int theID) +{ + return myIDEditorMap[theID]; +} + + +QMcCad_View* QMcCad_Application::GetView() +{ + QMcCad_Editor* theEditor = GetEditor(); + if (theEditor !=NULL) + { + return theEditor->GetView(); + } + return NULL; +} + + +Handle(McCadCom_CasDocument) QMcCad_Application::GetDocument() +{ + QMcCad_Editor* theEditor = GetEditor(); + if (theEditor !=NULL) + { + return theEditor->GetDocument(); + } + return NULL; +} + + +Standard_Boolean QMcCad_Application::NewDocument(Handle(TDocStd_Document)& theTDoc) +{ + myXCAFApp->NewDocument("XmlXCAF", theTDoc); + + if(!XCAFDoc_DocumentTool::IsXCAFDocument(theTDoc)) + { + Mcout("Couldn't initialize Document. Not a XmlXCAF Doc!!!\n", McCadMessenger_ErrorMsg); + return Standard_False; + } + + return Standard_True; +} + + +void QMcCad_Application::SetCurrentFile(const QString &fileName) +{ + myCurrentFileName = fileName; + //setWindowModified(false); + + QString winName = "Untitled"; + if (!myCurrentFileName.isEmpty()) + { + winName = StrippedName(myCurrentFileName); + myRecentFiles.removeAll(myCurrentFileName); + myRecentFiles.prepend(myCurrentFileName); + UpdateRecentFileItems(); + } + //setWindowTitle(tr("%1[*] - %2").arg(winName).arg(tr("McCad"))); +} + + +void QMcCad_Application::SetBgColor(const QColor theCol) +{ + myBgCol = theCol; +} + + +QString QMcCad_Application::GetCurrentFile() +{ + return myCurrentFileName; +} + + +QString QMcCad_Application::StrippedName(const QString &fullFileName) +{ + return QFileInfo(fullFileName).fileName(); +} + + +void QMcCad_Application::UpdateRecentFileItems() +{ + QMutableStringListIterator iter(myRecentFiles); + while (iter.hasNext()) + { + if (!QFile::exists(iter.next())) + iter.remove(); + } + + for (int j = 0; j < MaxRecentFiles; ++j) + { + if (j < myRecentFiles.count()) + { + QString text = tr("&%1 %2").arg(j + 1).arg(StrippedName(myRecentFiles[j])); + myRecentFileActions[j]->setText(text); + myRecentFileActions[j]->setData(myRecentFiles[j]); + myRecentFileActions[j]->setVisible(true); + } + else + { + myRecentFileActions[j]->setVisible(false); + } + } +} + + +void QMcCad_Application::OpenRecentFile() +{ + QAction *theAction = qobject_cast(sender()); + if (theAction) + { + QString theName(theAction->data().toString()); + SlotFileOpen(theName); + /*QMcCad_Editor* theEditor = GetEditor(); + if (theEditor != NULL) + { + theEditor->Import(theAction->data().toString()); + } + else + { + SlotFileNew(); + theEditor = GetEditor(); + if (theEditor !=NULL) + { + theEditor->Import(theAction->data().toString()); + } + else + statusBar()->showMessage("Loading aborted", 2000); + }*/ + } +} + + +/*void QMcCad_Application::Mcout(const QString & aMessage, McCadGUI_MessageType msgType) +{ + if(msgType == McCadGUI_DefaultMsg) + myOut->Append(aMessage); + else if(msgType == McCadGUI_WarningMsg) + myOut->Warning(aMessage); + else if(msgType == McCadGUI_ErrorMsg) + myOut->Error(aMessage); + else if(msgType == McCadGUI_HeadingMsg) + myOut->Heading(aMessage); + else + myOut->Append(aMessage); + +}*/ + +void QMcCad_Application::Mcout(const std::string& message, McCadMessenger_MessageType msgType) +{ + QString qMessage(message.c_str()); + if(msgType == McCadMessenger_DefaultMsg) + myOut->Append(qMessage); + else if(msgType == McCadMessenger_WarningMsg) + myOut->Warning(qMessage); + else if(msgType == McCadMessenger_ErrorMsg) + myOut->Error(qMessage); + else if(msgType == McCadMessenger_HeadingMsg) + myOut->Heading(qMessage); + else + myOut->Append(qMessage); + +} + + + + + +void QMcCad_Application::WriteSettings() +{ + // prepare recent files for saving + QString recentFiles; + for(int i=0; i(); + settings.endGroup(); + + // manage background color + if(!myBgCol.isValid()) + myBgCol = QColor(50,50,50); + + // update recent files ... + TCollection_AsciiString files = ToAStr(recentFiles); + while(true) + { + if(files.Search(";;") < 1) + { + myRecentFiles.append(files.ToCString()); + break; + } + + TCollection_AsciiString tmpStr = files; + files = tmpStr.Split(tmpStr.Search(";;")+1); + tmpStr.Remove(tmpStr.Length()-1,2); + //cout << tmpStr.ToCString() << endl; + myRecentFiles.append(tmpStr.ToCString()); + } + + UpdateRecentFileItems(); +} + + +/*#################################################################################### + * + * SLOTS SECTION + * + * ################################################################################### + */ + +void QMcCad_Application::SlotPrint() +{ + /*myPrinter->setFullPage(TRUE); + QMcCad_Editor* theEditor = GetEditor(); + if (theEditor != NULL) + theEditor->Print(myPrinter); + else + { + Mcout("Printing aborted ... "); + }*/ + Mcout("McCad: Printing not yet implemented..."); + /*Mcout("Taking Pictures !!!"); + GetEditor()->MakeRotationMoviePictures();*/ +} + + +void QMcCad_Application::SetOpenFile(const TCollection_AsciiString& inName) +{ + if(inName.IsEqual(".")) + { + myWorkingDirectory = "."; + return; + } + + QMcCad_Editor* theEditor = GetEditor(); + theEditor->Import(inName.ToCString()); + theEditor->setWindowModified(true); + theEditor->UpdateView(); + GetTreeWidget()->LoadDocument(theEditor->ID()); +} + + +void QMcCad_Application::SlotImport() +{ + QString theFilter = "All Formats (*.stp *.step *.igs *.iges *.rle *.brep *.mcn *.d *.tri);;CAD Files (*.stp *.step *.igs *.iges *.rle *.brep);;MCNP (*.mcn);;Tripoli (*.d *.tri)"; + + cout << "Import : " << myWorkingDirectory.toStdString() << endl; + + QFileDialog theDialog(this,tr("Import Geometry"), myWorkingDirectory, theFilter); + QStringList theFiles; + theDialog.setFileMode(QFileDialog::ExistingFiles); + theDialog.setLabelText(QFileDialog::Accept,"Import"); + + if(theDialog.exec()) + theFiles = theDialog.selectedFiles(); + QString theFileName;// = theDialog.getOpenFileName(this, tr("Open CAD/MCNP File"), myWorkingDirectory, theFilter); + + theDialog.hide(); + + //Cancel Open + if(theFiles.count() < 1) + return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + //Get current file filter + TCollection_AsciiString FF = ToAStr(theFileName); + FF.Remove(1,FF.SearchFromEnd(".")-1); + FF.Prepend("*"); + QString theSelectedFileFilter(FF.ToCString()); + + QMcCad_Editor* theEditor = GetEditor(); + + for(int f=0; fGetDocument(); + McCadXCAF_TDocShapeLabelIterator slIter(theDoc->GetTDoc()); + Standard_Integer iNumBeforeImp = slIter.NumberOfShapes(); + + theEditor->Import(theFileName); + + // use the file name as the material group's name. + TCollection_AsciiString strGroupName = ToAStr(theFileName); + strGroupName.Remove(1,strGroupName.SearchFromEnd("/")); + strGroupName.Remove(strGroupName.SearchFromEnd("."),strGroupName.Length()-strGroupName.SearchFromEnd(".")+1); + + Standard_Integer iNumAfterImp; + myTreeView->UpdateTreeWidget(theEditor->ID(),iNumBeforeImp,iNumAfterImp,strGroupName); + + QString qstrMatGroup(strGroupName.ToCString()); + theEditor->GetMatManager()->GenSolidGroupMap(iNumBeforeImp+1,iNumAfterImp,qstrMatGroup);// Set solid id and material group map + + theDoc->SetIsModified(Standard_True); + theEditor->setWindowModified(true); + } + else + { + SlotFileNew(); + theEditor = GetEditor(); + Handle(McCadCom_CasDocument) theDoc = theEditor->GetDocument(); + + if (theEditor != NULL) + theEditor->Import(theFileName); + else + { + statusBar()->showMessage("Loading aborted", 200); + QApplication::restoreOverrideCursor(); + return; + } + } + } + + theEditor->SetCurrentFilter(theSelectedFileFilter); + + + + + + // update tree view + ///////////////////////// + theEditor->UpdateView(); + //myTreeView->LoadDocument(theEditor->ID()); + + //end import section + ///////////////////////// + QApplication::restoreOverrideCursor(); + myWorkingDirectory = QFileInfo(theFileName).absolutePath(); //save path for future + + QString theMessage("File(s) : "); + for(int i=0; i0) + filter.Remove(1,filter.SearchFromEnd(".")-1); + else + { + if(selectedFilter == "MCNP (*.mcn)") + theFileName += ".mcn"; + if(selectedFilter == "STEP (*.stp *.step)") + theFileName += ".stp"; + if(selectedFilter == "IGES (*.igs *.iges)") + theFileName += ".igs"; + if(selectedFilter == "BREP (*.rle *.brep)") + theFileName += ".brep"; + if(selectedFilter == "Tripoli (*.d *.tri)") + theFileName += ".d"; + } + + if(!ed->Export(ToAStr(theFileName))) + return; + + QString theMessage("Exported to : "); + theMessage.append(theFileName); + Mcout(theMessage.toUtf8().constData()); +} + + +void QMcCad_Application::SlotFileNew() // create new editor ... +{ + bool isFirst = false; + + QMcCad_Editor* curEd = GetEditor(); + + if(curEd==NULL) + isFirst=true; + else if(curEd->isMaximized()) + curEd->showNormal(); + + QMcCad_Editor* ed = new QMcCad_Editor(myWS,0, ++myEditorIDCnt); + ed->setWindowIcon(QIcon(":images/document.png")); + + //Set context menu options + ed->setContextMenuPolicy(Qt::ActionsContextMenu); + ed->addAction(myActionBackgroundColor); + ed->addAction(myActionShapeColor); + ed->addAction(myActionShapeTransparency); +// ed->addAction(myActionHideSelected); +// ed->addAction(myActionShowAll); + + + //ed->addAction(myActionShapeMaterial); + + TCollection_ExtendedString anErrorMessage; + + ed->UpdateWindowTitle(); + + myWS->addWindow(ed); + myCurrentFileName.clear(); + + connect(ed, SIGNAL(destroyed(int)), this, SLOT(SlotEditorClosed(int))); + connect(ed, SIGNAL(saveAs()), this, SLOT(SlotFileSaveAs())); + + ed->show(); + ed->resize(600, 400); + + if(isFirst) // first editor? -> show maximized + ed->showMaximized(); + + //Register new editor + myIDEditorMap[myEditorIDCnt]=ed; + + myTreeView->AddEditor(myEditorIDCnt); + + myAcM->SetCurrentAction(McCadTool_Axis); //show axis + //ed->GradientBackground(); +} + + +void QMcCad_Application::SlotFileSave() +{ + QMcCad_Editor* ed = GetEditor(); + if(ed == NULL) + return; + + if(!ed->GetDocument()->IsNew()) + ed->Save(); + else + SlotFileSaveAs(); +} + + +void QMcCad_Application::SlotFileSaveAs() +{ + QString fileFilters("*.xml"); + Handle(TColStd_HSequenceOfAsciiString) Filters = Formats(); + + QString theFileName = QFileDialog::getSaveFileName(this, tr("Save As"), ".", fileFilters ); + + if ( !theFileName.isEmpty() ) + { + if(!theFileName.endsWith(".xml")) + theFileName.append(".xml"); + + QMcCad_Editor* ed = GetEditor(); + + SetCurrentFile(theFileName); + + if (ed != NULL) + { + if(ed->Save(ToAStr(theFileName))) + { + myTreeView->UpdateEditorName(ed->ID()); + QString theMessage("\nDocument saved as : "); + theMessage.append(StrippedName(theFileName)); + Mcout(theMessage.toUtf8().constData()); + } + } + else + Mcout("No document available - nothing to save.", McCadMessenger_ErrorMsg); + } + else + Mcout("Saving aborted"); +} + + +void QMcCad_Application::SlotFileOpen(QString& fileName) +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + + TCollection_AsciiString anAStr = ToAStr(fileName); + TCollection_ExtendedString loadFile(anAStr); + + if(GetEditor()==NULL) + SlotFileNew(); + + QMcCad_Editor* ed = GetEditor(); + + Handle_TDocStd_Document theTDoc = ed->GetDocument()->GetTDoc(); + + myXCAFApp->Open(loadFile,theTDoc); + ed->SetIsLoaded(Standard_True); // workaround + ed->GetDocument()->SetTDoc(theTDoc); + + //link V3d_Viewer to TPrsStd_Viewer in Document + /*TDF_Label rootLabel = theTDoc->GetData()->Root(); + Handle(V3d_Viewer) theViewer = ed->GetViewer()->GetViewer(); + TPrsStd_AISViewer::New(rootLabel, theViewer); + + //delete all PrsStd_AISPresentations attached to the Labels + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + TDF_LabelSequence freeShapes; + sTool->GetFreeShapes(freeShapes); + + Handle(TPrsStd_AISPresentation) prs; + for(Standard_Integer i=1; i<=freeShapes.Length(); i++) + { + TDF_Label curL = freeShapes.Value(i); + if(sTool->IsAssembly(curL)) + { + TDF_LabelSequence subShapes; + sTool->GetSubShapes(curL, subShapes); + for(TDF_ChildIterator it( curL, Standard_False ); it.More(); it.Next()) + if ( it.Value().FindAttribute( TPrsStd_AISPresentation::GetID(), prs ) ) + it.Value().ForgetAttribute(TPrsStd_AISPresentation::GetID()); + } + else + { + if ( curL.FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) + curL.ForgetAttribute(TPrsStd_AISPresentation::GetID()); + } + }*/ + + //Visualize + ed->UpdateView(); + + //Update TreeView + myTreeView->LoadDocument(myEditorIDCnt); + + //update names + ed->GetDocument()->SetDocName(anAStr); + ed->UpdateWindowTitle(); + myTreeView->UpdateEditorName(ed->ID()); + + QApplication::restoreOverrideCursor(); +} + + +void QMcCad_Application::SlotFileOpen() +{ + QString ff("*.xml"); + QStringList theFiles; + + QFileDialog theFileDialog(this, Qt::Dialog); + theFileDialog.setWindowTitle("Open McCad Document"); + theFileDialog.setFilter(ff); + theFileDialog.setDirectory(myWorkingDirectory); + if(theFileDialog.exec()) + theFiles = theFileDialog.selectedFiles(); + else + return; + + QString theFileName = theFiles.at(0); + + if(theFileName == "") // open dialog has been cancelled + return; + + SlotFileOpen(theFileName); +} + + +void QMcCad_Application::SlotFileClose() +{ + QMcCad_Editor* theEditor = GetEditor(); + if (theEditor !=NULL) + { + theEditor->close(); + } +} + + +void QMcCad_Application::SlotUpdateMainTitle() +{ +/* QMcCad_Editor* theEditor = GetEditor(); + if(theEditor != NULL) + SetCurrentFile(theEditor->GetQFileName());*/ +} + + +void QMcCad_Application::SlotEditorClosed(int theID) +{ + //cout << "editor " << theID << " closed\n"; +// myCADPropWidget->EditorClosed(theID); + myTreeView->RemoveEditor(theID); + QMcCad_Editor* theEditor; + theEditor = GetEditor(); + if(theEditor == NULL) // last editor closed?... + setWindowTitle("McCad"); + else //set title active editor... + SetCurrentFile(theEditor->GetQFileName()); + + statusBar()->showMessage("Editor closed", 2000); +} + + +void QMcCad_Application::closeEvent(QCloseEvent *e) +{ + QWidgetList windows = myWS->windowList(); + + WriteSettings(); + + if (windows.count() ) + { + for (int i = 0; i < int(windows.count()); ++i) + { + QWidget *window = windows.at(i); + if ( !window->close() ) + { + e->ignore(); + return; + } + } + } +} + + +void QMcCad_Application::SlotAbout() +{ + QString strMessage("

McCad Version "); + strMessage = strMessage + QString::number(MCCAD_VERSION_MAJOR) + QString(".") + QString::number(MCCAD_VERSION_MINOR) + QString(".") + QString::number(MCCAD_VERSION_PATCH); + strMessage = strMessage + QString("

Copyright © 2014 Karlsruhe Institut of Technology (KIT)

McCad is a CAD interface for Monte Carlo transport codes."); + QMessageBox::about( this, tr("About McCad"), strMessage); +} + + +void QMcCad_Application::SlotQuit() +{ + WriteSettings(); + this->close(); +} + + + +QMcCadGeomeTree_TreeWidget* QMcCad_Application::GetTreeWidget() +{ + return myTreeView; +} + + +void QMcCad_Application::contextMenuEvent(QContextMenuEvent *event) +{ + /* + QPopupMenu contextMenu(this); + cutAct->addTo(&contextMenu); + copyAct->addTo(&contextMenu); + pasteAct->addTo(&contextMenu); + */ + //myContextMenu->exec(event->globalPos()); +} + + + +void QMcCad_Application::SlotHelp() +{ + OSD_Directory theResourceDir = ResourceDir(); + OSD_Path theResourcePath; + theResourceDir.Path(theResourcePath); + TCollection_AsciiString aPathName; + theResourcePath.SystemName(aPathName); + + QString theDocumentDir(aPathName.ToCString()); + theDocumentDir = theDocumentDir+"/doc"; + /* + if (myAssistant==NULL) + { + myAssistant = new QAssistantClient(QDir(theDocumentDir).absPath(), this); + QStringList argList; + argList << "-profile"; + argList << QDir::convertSeparators(theDocumentDir + "/McCaddoc.adp"); + myAssistant->setArguments(argList); + } + myAssistant->openAssistant(); + */ + /*myAssistant->showPage(QString("index.html")); + if (myAssistant->isOpen()) + { + cout << "Can not open the assistant!! " << qPrintable(theDocumentDir) << endl; + } + else + { + cout << "Assistant is open!! " << qPrintable(theDocumentDir) << endl; + }*/ +} + +void QMcCad_Application::SlotUpdateMenus() +{ + bool haveEditor = (GetEditor() != 0); + + for (int i = 0; i < myEditActionList.size(); ++i) + myEditActionList[i]->setEnabled(false); + for (int i = 0; i < 2; ++i) + myEditActionList[i]->setEnabled(haveEditor); + + for (int i = 0; i < myViewActionList.size(); ++i) + myViewActionList[i]->setEnabled(haveEditor); + + for (int i = 0; i < myAssistActionList.size(); ++i) + myAssistActionList[i]->setEnabled(false); + + for (int i = 4; i < myDesignActionList.size(); ++i) + myDesignActionList[i]->setEnabled(false); + for (int i = 0; i < 4; ++i) + myDesignActionList[i]->setEnabled(haveEditor); + + myModifyActionList[0]->setEnabled(haveEditor); + + for (int i = 0; i < myModifyActionList.size(); ++i) + myModifyActionList[i]->setEnabled(haveEditor); + + for (int i = 0; i < myWindowActionList.size(); ++i) + // myWindowActionList[i]->setEnabled(false); + myWindowActionList[1]->setEnabled(haveEditor); + + myFileActionList[0]->setEnabled(true); //always active + myFileActionList[1]->setEnabled(true); // " + for(int i = 2; i< myFileActionList.size(); i++) + myFileActionList[i]->setEnabled(haveEditor); +} + + +void QMcCad_Application::SlotHardcopy() +{ + QString theFile = QFileDialog::getSaveFileName(this, "Choose a filename for saving hardcopy", ".", "Image Files (*.bmp *.gif *.xwd)"); + + QFileInfo fi(theFile); + QString ext = fi.suffix(); + + if (!theFile.isNull() ) + { + if ( !ext.length() ) + theFile += QString(".bmp"); + QMcCad_Editor* theEditor = GetEditor(); + if (theEditor !=NULL) + { + theEditor->Hardcopy(theFile); + } + else + Mcout("No active Editor available for hardcopy!!", McCadMessenger_ErrorMsg); + } +} + + + +/* ###################################################################### + * + * CREATE SECTION + * + * ###################################################################### + */ + + + +void QMcCad_Application::CreateTreeView() +{ + QDockWidget* theDockWid = new QDockWidget(this); + myTreeView = new QMcCadGeomeTree_TreeWidget(theDockWid); + myTreeView->setContextMenuPolicy(Qt::ActionsContextMenu); + //myTreeView->addAction(myActionBackgroundColor); + //myTreeView->addAction(myActionShapeColor); + //myTreeView->addAction(myActionShapeTransparency); + /*myTreeView->addAction(myActionHideSelected); + myTreeView->addAction(myActionRedisplaySelected); + myTreeView->addAction(myActionDisplaySelectedOnly); + myTreeView->addAction(myActionShowAll);*/ + //myTreeView->addAction(myActionAddMaterialGroup); // Lei + //myTreeView->addAction(myActionAddToMaterialGroup); // Lei + //myTreeView->addAction(myActionModelErase); + theDockWid->setFeatures(QDockWidget::DockWidgetMovable); + theDockWid->setWidget(myTreeView); + theDockWid->setMinimumSize(150,350); + theDockWid->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored); + addDockWidget(Qt::LeftDockWidgetArea, theDockWid); +} + + +void QMcCad_Application::CreateLogWindow() +{ + QDockWidget *dock = new QDockWidget(this); + dock->setAllowedAreas(Qt::BottomDockWidgetArea); + dock->setGeometry(x(), y(), 1/200*width(), 1/200*height()); + myOut = new QMcCad_LogWindow(dock); + dock->setWidget(myOut); + addDockWidget(Qt::BottomDockWidgetArea, dock); +} + + +void QMcCad_Application::CreateStatusBar() +{ + statusBar()->showMessage("Ready"); +} + +void QMcCad_Application::CreateMenus() +{ +//FILE + myFileMenu = menuBar()->addMenu(tr("&File")); + myFileMenu->addAction(myActionFileNew); + myFileMenu->addAction(myActionFileOpen); + myFileMenu->addAction(myActionFileClose); + myFileMenu->addAction(myActionFileSave); + myFileMenu->addAction(myActionFileSaveAs); + + myFileMenu->addSeparator(); + myFileMenu->addAction(myActionImportGeom); + myFileMenu->addAction(myActionExportGeom); + + myFileMenu->addSeparator(); + myFileMenu->addAction(myActionHardCopy); + myFileMenu->addAction(myActionPrint); + + myFileMenu->addSeparator(); + for (int i = 0; i < MaxRecentFiles; ++i) + myFileMenu->addAction(myRecentFileActions[i]); + myFileMenu->addSeparator(); + + myFileMenu->addAction(myActionQuit); + +//EDIT + myEditMenu = menuBar()->addMenu(tr("&Edit")); + myEditMenu->addAction(myActionEditUndo); + myEditMenu->addAction(myActionEditRedo); + myEditMenu->addAction(myActionEditCut); + myEditMenu->addAction(myActionEditCopy); + myEditMenu->addAction(myActionEditPaste); + myEditMenu->addAction(myActionSelect); + myEditMenu->addAction(myActionSelectAll); + myEditMenu->addAction(myActionDeselectAll); + +//VIEW + myViewMenu = menuBar()->addMenu(tr("&View")); + myViewMenu->addAction(myActionRedraw); + myZoomSubMenu = myViewMenu->addMenu(tr("&Zoom")); + myZoomSubMenu->addAction(myActionZoomWindow); + //myZoomSubMenu->addAction(myActionZoomDynamic); + //myZoomSubMenu->addAction(myActionZoomScale); + myZoomSubMenu->addAction(myActionZoomIn); + myZoomSubMenu->addAction(myActionZoomOut); + myZoomSubMenu->addAction(myActionFitAll); + myViewMenu->addAction(myActionPan); + myViewMenu->addAction(myActionRotate); + myProjectionSubMenu = myViewMenu->addMenu(tr("&Projection")); + myProjectionSubMenu->addAction(myActionBackProject); + myProjectionSubMenu->addAction(myActionFrontProject); + myProjectionSubMenu->addAction(myActionTopProject); + myProjectionSubMenu->addAction(myActionBottomProject); + myProjectionSubMenu->addAction(myActionLeftProject); + myProjectionSubMenu->addAction(myActionRightProject); + myViewMenu->addSeparator(); + myShadeSubMenu = myViewMenu->addMenu(tr("&Mode")); + myShadeSubMenu->addAction(myActionWireFrame); + myShadeSubMenu->addAction(myActionFlatShade); + myShadeSubMenu->addAction(myActionSetHiddenLine); + myViewMenu->addAction(myActionAntialiasing); + myViewMenu->addAction(myActionBackgroundColor); + myViewMenu->addAction(myActionShapeColor); + myViewMenu->addAction(myActionShapeTransparency); + // myInsertMenu = new QPopupMenu(this); + +//ASSIST + myAssistMenu = menuBar()->addMenu(tr("&Assist")); + myAssistMenu->addAction(myActionMeasureDistance); + myAssistMenu->addAction(myActionMeasureAngle); + myAssistMenu->addAction(myActionMeasureArea); + myAssistMenu->addAction(myActionMeasureVolume); + myAssistMenu->addAction(myActionPropertyCurve); + myAssistMenu->addAction(myActionPropertySurface); + +//DESIGN + myDesignMenu = menuBar()->addMenu(tr("&Design")); + myDesignMenu->addAction(myActionMakeBox); + myDesignMenu->addAction(myActionMakeCone); + myDesignMenu->addAction(myActionMakeCylinder); + myDesignMenu->addAction(myActionMakeHalfSpace); + myDesignMenu->addAction(myActionMakeSphere); + myDesignMenu->addAction(myActionMakeTorus); + myDesignMenu->addAction(myActionMakeWedge); + +//TOOLS + myModifyMenu = menuBar()->addMenu(tr("&Tools")); + myModifyMenu->addAction(myActionModelErase); + myModifyMenu->addAction(myActionModelCopy); + myModifyMenu->addAction(myActionModelMirror); + myModifyMenu->addAction(myActionModelMove); + myModifyMenu->addAction(myActionModelRotate); + myModifyMenu->addAction(myActionModelScale); + //myModifyMenu->addAction(myActionModelStrech); + myBooleanSubMenu = myModifyMenu->addMenu(tr("&Boolean")); + myBooleanSubMenu->addAction(myActionSolidUnion); + myBooleanSubMenu->addAction(myActionSolidIntersection); + myBooleanSubMenu->addAction(myActionSolidDifference); + myModifyMenu->addSeparator(); + myModifyMenu->addAction(myActionReadValueList); + +//WINDOW + myWindowMenu = menuBar()->addMenu(tr("&Window")); + myWindowMenu->addAction(myActionSetGrid); + myWindowMenu->addAction(myActionSetAxis); + + menuBar()->addSeparator(); + +//HELP + myHelpMenu = menuBar()->addMenu(tr("&Help")); + myHelpMenu->addAction(myActionAbout); + myHelpMenu->addAction(myActionHelp); +} + + +void QMcCad_Application::CreateToolBars() +{ + myFileToolBar = addToolBar(tr("File")); + myFileToolBar->addAction(myActionFileNew); + myFileToolBar->addAction(myActionFileOpen); + myFileToolBar->addAction(myActionFileSave); + myFileToolBar->addAction(myActionFileSaveAs); + myFileToolBar->addAction(myActionFileClose); + + + // myFileToolBar->addAction(myActionFileSaveAs); + myFileToolBar->addAction(myActionPrint); + + myViewToolBar = addToolBar(tr("View")); + myViewToolBar->addAction(myActionRedraw); + myViewToolBar->addAction(myActionFitAll); + myViewToolBar->addAction(myActionZoomWindow); + //myViewToolBar->addAction(myActionZoomDynamic); + //myViewToolBar->addAction(myActionZoomScale); + myViewToolBar->addAction(myActionZoomIn); + myViewToolBar->addAction(myActionZoomOut); + myViewToolBar->addAction(myActionPan); + myViewToolBar->addAction(myActionRotate); + myViewToolBar->addAction(myActionBackProject); + myViewToolBar->addAction(myActionFrontProject); + myViewToolBar->addAction(myActionTopProject); + myViewToolBar->addAction(myActionBottomProject); + myViewToolBar->addAction(myActionLeftProject); + myViewToolBar->addAction(myActionRightProject); + myViewToolBar->addAction(myActionWireFrame); + myViewToolBar->addAction(myActionFlatShade); + myViewToolBar->addSeparator(); + myViewToolBar->addAction(myActionHideSelected); + myViewToolBar->addAction(myActionRedisplaySelected); + myViewToolBar->addAction(myActionDisplaySelectedOnly); + myViewToolBar->addAction(myActionShowAll); +} + + +void QMcCad_Application::CreateActions() +{ + QMcCad_ActionFactory myActionFactory(this); + + // file menu + myActionFileNew = myActionFactory.CreateAction(McCadTool_FileNew, this); + myActionFileOpen = myActionFactory.CreateAction(McCadTool_FileOpen, this); + myActionFileClose = myActionFactory.CreateAction(McCadTool_FileClose, this); + myActionFileSave = myActionFactory.CreateAction(McCadTool_FileSave, this); + myActionFileSaveAs = myActionFactory.CreateAction(McCadTool_FileSaveAs, this); + myActionImportGeom = myActionFactory.CreateAction(McCadTool_ImportGeom, this); + myActionExportGeom = myActionFactory.CreateAction(McCadTool_ExportGeom, this); + myActionHardCopy = myActionFactory.CreateAction(McCadTool_Hardcopy, this); + myActionPrint = myActionFactory.CreateAction(McCadTool_Print, this); + myActionQuit = new QAction(tr("E&xit"), this); + //myActionQuit->setShortcut(tr("Ctrl+Q")); + myActionQuit->setStatusTip(tr("Exit the application")); + + connect(myActionQuit, SIGNAL(triggered()), this, SLOT(SlotQuit())); + + for (int i = 0; i < MaxRecentFiles; ++i) + { + myRecentFileActions[i] = new QAction(this); + myRecentFileActions[i]->setVisible(false); + connect(myRecentFileActions[i], SIGNAL(triggered()), this, SLOT(OpenRecentFile())); + } + + myFileActionList.append(myActionFileNew); + myFileActionList.append(myActionFileOpen); + myFileActionList.append(myActionFileClose); + myFileActionList.append(myActionFileSave); + myFileActionList.append(myActionFileSaveAs); + myFileActionList.append(myActionImportGeom); + myFileActionList.append(myActionExportGeom); + myFileActionList.append(myActionHardCopy); + myFileActionList.append(myActionPrint); + + //edit Menu + myActionEditUndo = myActionFactory.CreateAction(McCadTool_EditUndo, myAcM); + myActionEditRedo = myActionFactory.CreateAction(McCadTool_EditRedo, myAcM); + myActionEditCut = myActionFactory.CreateAction(McCadTool_EditCut, myAcM); + myActionEditCopy = myActionFactory.CreateAction(McCadTool_EditCopy, myAcM); + myActionEditPaste = myActionFactory.CreateAction(McCadTool_EditPaste, myAcM); + myActionSelect = myActionFactory.CreateAction(McCadTool_Select, myAcM); + myActionSelectAll = myActionFactory.CreateAction(McCadTool_SelectAll, myAcM); + myActionDeselectAll = myActionFactory.CreateAction(McCadTool_DeselectAll, myAcM); + + myEditActionList.append(myActionEditUndo); + myEditActionList.append(myActionEditRedo); + myEditActionList.append(myActionEditCut); + myEditActionList.append(myActionEditCopy); + myEditActionList.append(myActionEditPaste); + myEditActionList.append(myActionSelect); + myEditActionList.append(myActionSelectAll); + myEditActionList.append(myActionDeselectAll); + + //view Menu + + myActionRedraw = myActionFactory.CreateAction(McCadTool_Redraw, myAcM); + myActionZoomWindow = myActionFactory.CreateAction(McCadTool_ZoomWindow, myAcM); + myActionDisplaySelectedOnly = myActionFactory.CreateAction(McCadTool_DispSelOnly, myAcM); + //myActionZoomDynamic = myActionFactory.CreateAction(McCadTool_ZoomDynamic, myAcM); + //myActionZoomScale = myActionFactory.CreateAction(McCadTool_ZoomScale, myAcM); + myActionZoomIn = myActionFactory.CreateAction(McCadTool_ZoomIn, myAcM); + myActionZoomOut = myActionFactory.CreateAction(McCadTool_ZoomOut, myAcM); + myActionFitAll = myActionFactory.CreateAction(McCadTool_FitAll, myAcM); + myActionPan = myActionFactory.CreateAction(McCadTool_Pan, myAcM); + myActionRotate = myActionFactory.CreateAction(McCadTool_Rotate, myAcM); + myActionBackProject = myActionFactory.CreateAction(McCadTool_BackProject, myAcM); + myActionFrontProject = myActionFactory.CreateAction(McCadTool_FrontProject, myAcM); + myActionTopProject = myActionFactory.CreateAction(McCadTool_TopProject, myAcM); + myActionBottomProject = myActionFactory.CreateAction(McCadTool_BottomProject, myAcM); + myActionLeftProject = myActionFactory.CreateAction(McCadTool_LeftProject, myAcM); + myActionRightProject = myActionFactory.CreateAction(McCadTool_RightProject, myAcM); + myActionWireFrame = myActionFactory.CreateAction(McCadTool_WireFrame, myAcM); + myActionFlatShade = myActionFactory.CreateAction(McCadTool_FlatShade, myAcM); + myActionSetHiddenLine = myActionFactory.CreateAction( McCadTool_SetHiddenLine, myAcM); + myActionBackgroundColor = myActionFactory.CreateAction( McCadTool_BackgroundColor, myAcM); + myActionShapeColor = myActionFactory.CreateAction(McCadTool_ShapeColor, myAcM); + myActionShapeMaterial = myActionFactory.CreateAction( McCadTool_ShapeMaterial, myAcM); + myActionAntialiasing = myActionFactory.CreateAction(McCadTool_Antialiasing, myAcM); + myActionShapeTransparency = myActionFactory.CreateAction(McCadTool_ShapeTransparency, myAcM); + myActionShowAll = myActionFactory.CreateAction(McCadTool_ShowAll, myAcM); + myActionHideSelected = myActionFactory.CreateAction(McCadTool_HideSelected, myAcM); + myActionRedisplaySelected = myActionFactory.CreateAction(McCadTool_RedispSelected, myAcM); + + myViewActionList.append(myActionRedraw); + myViewActionList.append(myActionZoomWindow); + //myViewActionList.append(myActionZoomDynamic); + //myViewActionList.append(myActionZoomScale); + myViewActionList.append(myActionZoomIn); + myViewActionList.append(myActionZoomOut); + myViewActionList.append(myActionFitAll); + myViewActionList.append(myActionPan); + myViewActionList.append(myActionRotate); + myViewActionList.append(myActionBackProject); + myViewActionList.append(myActionFrontProject); + myViewActionList.append(myActionTopProject); + myViewActionList.append(myActionBottomProject); + myViewActionList.append(myActionLeftProject); + myViewActionList.append(myActionRightProject); + myViewActionList.append(myActionWireFrame); + myViewActionList.append(myActionFlatShade); + myViewActionList.append(myActionSetHiddenLine); + myViewActionList.append(myActionAntialiasing); + myViewActionList.append(myActionBackgroundColor); + myViewActionList.append(myActionShapeColor); + myViewActionList.append(myActionShapeMaterial); + myViewActionList.append(myActionShapeTransparency); + myViewActionList.append(myActionShowAll); + myViewActionList.append(myActionHideSelected); + myViewActionList.append(myActionRedisplaySelected); + myViewActionList.append(myActionDisplaySelectedOnly); + + // assis menu + myActionMeasureDistance = myActionFactory.CreateAction( McCadTool_MeasureDistance, myAcM); + myActionMeasureAngle = myActionFactory.CreateAction(McCadTool_MeasureAngle, myAcM); + myActionMeasureArea = myActionFactory.CreateAction(McCadTool_MeasureArea,myAcM); + myActionMeasureVolume = myActionFactory.CreateAction(McCadTool_MeasureVolume, myAcM); + myActionPropertyCurve = myActionFactory.CreateAction(McCadTool_PropertyCurve, myAcM); + myActionPropertySurface = myActionFactory.CreateAction(McCadTool_PropertySurface, myAcM); + + myAssistActionList.append(myActionMeasureDistance); + myAssistActionList.append(myActionMeasureAngle); + myAssistActionList.append(myActionMeasureArea); + myAssistActionList.append(myActionMeasureVolume); + myAssistActionList.append(myActionPropertyCurve); + myAssistActionList.append(myActionPropertySurface); + + // DesignMenu; + myActionMakeBox = myActionFactory.CreateAction(McCadTool_MakeBox, myAcM); + myActionMakeCone = myActionFactory.CreateAction(McCadTool_MakeCone, myAcM); + myActionMakeCylinder = myActionFactory.CreateAction(McCadTool_MakeCylinder, myAcM); + myActionMakeSphere = myActionFactory.CreateAction(McCadTool_MakeSphere, myAcM); + myActionMakeHalfSpace = myActionFactory.CreateAction(McCadTool_MakeHalfSpace, myAcM); + myActionMakeTorus = myActionFactory.CreateAction(McCadTool_MakeTorus, myAcM); + myActionMakeWedge = myActionFactory.CreateAction(McCadTool_MakeWedge, myAcM); + + myDesignActionList.append(myActionMakeBox); + myDesignActionList.append(myActionMakeCone); + myDesignActionList.append(myActionMakeCylinder); + myDesignActionList.append(myActionMakeSphere); + myDesignActionList.append(myActionMakeHalfSpace); + myDesignActionList.append(myActionMakeTorus); + myDesignActionList.append(myActionMakeWedge); + + + //ModifyMenu; + myActionModelErase = myActionFactory.CreateAction(McCadTool_ModelErase, myAcM); + myActionModelCopy = myActionFactory.CreateAction(McCadTool_ModelCopy, myAcM); + myActionModelMirror = myActionFactory.CreateAction(McCadTool_ModelMirror, myAcM); + myActionModelMove = myActionFactory.CreateAction(McCadTool_ModelMove, myAcM); + myActionModelRotate = myActionFactory.CreateAction(McCadTool_ModelRotate, myAcM); + myActionModelScale = myActionFactory.CreateAction(McCadTool_ModelScale, myAcM); + //myActionModelStrech = myActionFactory.CreateAction(McCadTool_ModelStrech,myAcM); + myActionSolidUnion = myActionFactory.CreateAction(McCadTool_SolidUnion, myAcM); + myActionSolidIntersection = myActionFactory.CreateAction( McCadTool_SolidIntersection, myAcM); + myActionSolidDifference = myActionFactory.CreateAction( McCadTool_SolidDifference, myAcM); + myActionReadValueList = myActionFactory.CreateAction(McCadTool_ReadValueList, myAcM); + + myModifyActionList.append(myActionModelErase); + myModifyActionList.append(myActionModelCopy); + myModifyActionList.append(myActionModelMirror); + myModifyActionList.append(myActionModelMove); + myModifyActionList.append(myActionModelRotate); + myModifyActionList.append(myActionModelScale); + //myModifyActionList.append(myActionModelStrech); + myModifyActionList.append(myActionSolidUnion); + myModifyActionList.append(myActionSolidIntersection); + myModifyActionList.append(myActionSolidDifference); + myModifyActionList.append(myActionReadValueList); + + //WindowMenu + myActionSetGrid = myActionFactory.CreateAction( McCadTool_ClippingPlane, myAcM); + myActionSetAxis = myActionFactory.CreateAction( McCadTool_Axis, myAcM); + + myWindowActionList.append(myActionSetGrid); + myWindowActionList.append(myActionSetAxis); + + //HelpMenu + myActionAbout = new QAction(tr("&About"),this); + myActionAbout->setStatusTip(tr("Show the application's About box")); + connect(myActionAbout, SIGNAL(triggered()), this, SLOT(SlotAbout())); + + myActionHelp = new QAction(tr("Manua&l"), this); + myActionHelp->setStatusTip(tr("Online Manual")); + connect(myActionHelp, SIGNAL(triggered()), this, SLOT(SlotHelp())); + // Lei 15/10 + //myActionAddMaterialGroup = myActionFactory.CreateAction(McCadTool_AddMaterialGroup, myAcM); + //myActionAddToMaterialGroup = myActionFactory.CreateAction(McCadTool_AddToMaterialGroup, myAcM); + //myActionClippingPlane = myActionFactory.CreateAction(McCadTool_ClippingPlane, myAcM); +} + + diff --git a/src/MCCAD/QMcCad/QMcCad_ClippingPlaneDialog.cpp b/src/MCCAD/QMcCad/QMcCad_ClippingPlaneDialog.cpp new file mode 100644 index 0000000..c2e2d06 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_ClippingPlaneDialog.cpp @@ -0,0 +1,246 @@ +/* + * QMcCad_ClippingPlaneDialog.cpp + * + * Created on: Jul 18, 2008 + * Author: grosse + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +TCollection_AsciiString GetAStr(QString str) +{ + char aStr[str.length()]; + QByteArray ba = str.toAscii(); + strcpy(aStr, ba.data()); + TCollection_AsciiString anAsciiStr(aStr); + return anAsciiStr; + //return anAsciiStr.RealValue(); +} + +QMcCad_ClippingPlaneDialog::QMcCad_ClippingPlaneDialog(QWidget* theFather) : QDialog(theFather) +{ + uiClipDial.setupUi(this); + myA=0; + myB=0; + myC=0; + myD=0; + + myPln3D = NULL; + + myVisuState = Standard_False; + myEntriesChanged = Standard_False; + + connect(uiClipDial.plnSlider, SIGNAL(valueChanged(int)), this, SLOT(SliderValChanged(int))); + connect(uiClipDial.checkBox, SIGNAL(stateChanged(int)), this, SLOT(VisuStateChanged(int))); + connect(uiClipDial.okButton, SIGNAL(clicked()), this, SLOT(IsAccepted())); + connect(uiClipDial.cancelButton, SIGNAL(clicked()), this, SLOT(IsCanceled())); + connect(uiClipDial.dirX, SIGNAL(editingFinished()), this, SLOT(LineEdited())); + connect(uiClipDial.dirY, SIGNAL(editingFinished()), this, SLOT(LineEdited())); + connect(uiClipDial.dirZ, SIGNAL(editingFinished()), this, SLOT(LineEdited())); + connect(uiClipDial.locX, SIGNAL(editingFinished()), this, SLOT(LineEdited())); + connect(uiClipDial.locY, SIGNAL(editingFinished()), this, SLOT(LineEdited())); + connect(uiClipDial.locZ, SIGNAL(editingFinished()), this, SLOT(LineEdited())); +} + + +void QMcCad_ClippingPlaneDialog::LineEdited() +{ + myEntriesChanged = Standard_True; +} + + +void QMcCad_ClippingPlaneDialog::SliderValChanged(int slVal) +{ + //TCollection_AsciiString valStr(slVal); + Standard_Real v(slVal); + v /= 100.; + + if(myA == 0 && myB == 0 && myC == 0 && myD == 0) + return; + + /*TCollection_AsciiString locX, locY, locZ, dirX, dirY, dirZ, a, b, c, d; + GetFormData(locX, locY, locZ, dirX, dirY, dirZ, a, b, c, d);*/ + Standard_Real a,b,c,d; + gp_Pln pln(myA, myB, myC, myD); + gp_Pnt loc = pln.Location(); + gp_Pnt newLoc(loc.X()+myDir.X()*v, loc.Y()+myDir.Y()*v, loc.Z()+myDir.Z()*v); + pln.SetLocation(newLoc); + pln.Coefficients(a, b, c, d); + if(myPln3D != NULL) + QMcCad_Application::GetAppMainWin()->GetView()->View()->SetPlaneOff(); + + // show vals + TCollection_AsciiString aTAS(a), bTAS(b), cTAS(c), dTAS(d); + uiClipDial.A->setText(aTAS.ToCString()); + uiClipDial.B->setText(bTAS.ToCString()); + uiClipDial.C->setText(cTAS.ToCString()); + uiClipDial.D->setText(dTAS.ToCString()); + TCollection_AsciiString xLocTAS(newLoc.X()), yLocTAS(newLoc.Y()), zLocTAS(newLoc.Z()); + uiClipDial.locX->setText(xLocTAS.ToCString()); + uiClipDial.locY->setText(yLocTAS.ToCString()); + uiClipDial.locZ->setText(zLocTAS.ToCString()); + + if(myVisuState) + UpdateClippingPlane(a,b,c,d); +} + +void QMcCad_ClippingPlaneDialog::VisuStateChanged(int chVal) +{ + myVisuState = chVal; + + if(!myVisuState) + { + if(myPln3D != NULL) + QMcCad_Application::GetAppMainWin()->GetView()->View()->SetPlaneOff(); + + QMcCad_Application::GetAppMainWin()->GetEditor()->GetViewer()->GetViewer()->Update(); + return; + } + + //if(myA == 0 && myB == 0 && myC == 0 && myC == 0) + IsAccepted(); + /*else + UpdateClippingPlane(myA, myB, myC, myD);*/ +} + +void QMcCad_ClippingPlaneDialog::IsCanceled() +{ + VisuStateChanged(0); +} + + +void QMcCad_ClippingPlaneDialog::SetInitialValues(Standard_Real& a, Standard_Real& b, Standard_Real& c, Standard_Real& d, Standard_Boolean& visuState) +{ + myVisuState = visuState; + if(myVisuState) + uiClipDial.checkBox->setCheckState(Qt::Checked); + + myA = a; + myB = b; + myC = c; + myD = d; + + gp_Pln tmpPln(a,b,c,d); + gp_Ax1 axis = tmpPln.Axis(); + gp_Dir dir = axis.Direction(); + + if(a!=0 || b!=0 || c!=0 || d!=0) + { + TCollection_AsciiString xdir(dir.X()); + TCollection_AsciiString ydir(dir.Y()); + TCollection_AsciiString zdir(dir.Z()); + + uiClipDial.dirX->setText(xdir.ToCString()); + uiClipDial.dirY->setText(ydir.ToCString()); + uiClipDial.dirZ->setText(zdir.ToCString()); + } + + SliderValChanged(0); +} + + +void QMcCad_ClippingPlaneDialog::IsAccepted() +{ + TCollection_AsciiString locX, locY, locZ, dirX, dirY, dirZ, a, b, c, d; + + if(!myVisuState) // canceled + return; + + locX = GetAStr(uiClipDial.locX->text()); + locY = GetAStr(uiClipDial.locY->text()); + locZ = GetAStr(uiClipDial.locZ->text()); + dirX = GetAStr(uiClipDial.dirX->text()); + dirY = GetAStr(uiClipDial.dirY->text()); + dirZ = GetAStr(uiClipDial.dirZ->text()); + a = GetAStr(uiClipDial.A->text()); + b = GetAStr(uiClipDial.B->text()); + c = GetAStr(uiClipDial.C->text()); + d = GetAStr(uiClipDial.D->text()); + + if(!QMcCad_Application::GetAppMainWin()->GetView()->View()->IfMorePlanes()) + return; + + if(!a.IsEmpty() && !b.IsEmpty() && !c.IsEmpty() && !d.IsEmpty() && !myEntriesChanged) + { + if(a.IsRealValue() && b.IsRealValue() && c.IsRealValue() && d.IsRealValue()) + { + myA = a.RealValue(); + myB = b.RealValue(); + myC = c.RealValue(); + myD = d.RealValue(); + + gp_Pln aPln(myA, myB, myC, myD); + gp_Ax1 ax1 = aPln.Axis(); + myDir = ax1.Direction(); + } + else + return; + } + else if(!locX.IsEmpty() && !locY.IsEmpty() && !locZ.IsEmpty() && + !dirX.IsEmpty() && !dirY.IsEmpty() && !dirZ.IsEmpty() ) + { + myEntriesChanged = Standard_False; + if(locX.IsRealValue() && locY.IsRealValue() && locZ.IsRealValue() && + dirX.IsRealValue() && dirY.IsRealValue() && dirZ.IsRealValue() ) + { + gp_Dir aDir(dirX.RealValue(), dirY.RealValue(), dirZ.RealValue()); + myDir = aDir; + gp_Pln pln(gp_Pnt(locX.RealValue(), locY.RealValue(), locZ.RealValue()), myDir ); + pln.Coefficients(myA,myB,myC,myD); + } + else + return; + } + else + { + // False Entry ... + return; + } + if(!myVisuState) + { + if(myPln3D != NULL) + QMcCad_Application::GetAppMainWin()->GetView()->View()->SetPlaneOff(myPln3D); + return; + } + + QMcCad_Application::GetAppMainWin()->GetView()->SetClippingPlaneParameters(myA, myB, myC, myD, myVisuState); + + UpdateClippingPlane(myA, myB, myC, myD); +} + +void QMcCad_ClippingPlaneDialog::UpdateClippingPlane(Standard_Real a, Standard_Real b, Standard_Real c, Standard_Real d) +{ + Handle(V3d_Viewer) theViewer = QMcCad_Application::GetAppMainWin()->GetEditor()->GetViewer()->GetViewer(); +#ifdef OCC650 + myPln3D = new V3d_Plane(theViewer, a, b, c, d); +#else + myPln3D = new V3d_Plane(a, b, c, d); +#endif + QMcCad_Application::GetAppMainWin()->GetView()->View()->SetPlaneOn(myPln3D); + theViewer->Update(); +} + + +void QMcCad_ClippingPlaneDialog::GetFormData(TCollection_AsciiString& locX, TCollection_AsciiString& locY, TCollection_AsciiString& locZ , + TCollection_AsciiString& dirX, TCollection_AsciiString& dirY, TCollection_AsciiString& dirZ, + TCollection_AsciiString& a, TCollection_AsciiString& b, TCollection_AsciiString& c, TCollection_AsciiString& d) +{ + locX = GetAStr(uiClipDial.locX->text()); + locY = GetAStr(uiClipDial.locY->text()); + locZ = GetAStr(uiClipDial.locZ->text()); + dirX = GetAStr(uiClipDial.dirX->text()); + dirY = GetAStr(uiClipDial.dirY->text()); + dirZ = GetAStr(uiClipDial.dirZ->text()); + a = GetAStr(uiClipDial.A->text()); + b = GetAStr(uiClipDial.B->text()); + c = GetAStr(uiClipDial.C->text()); + d = GetAStr(uiClipDial.D->text()); +} diff --git a/src/MCCAD/QMcCad/QMcCad_Editor.cpp b/src/MCCAD/QMcCad/QMcCad_Editor.cpp new file mode 100644 index 0000000..c7da7ca --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_Editor.cpp @@ -0,0 +1,1022 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +//******************************************************************* +TCollection_AsciiString ToAsciiString(const QString& theStr) +{ + char aStr[theStr.length()]; + QByteArray ba = theStr.toAscii(); + strcpy(aStr, ba.data()); + TCollection_AsciiString anAsciiStr(aStr); + return anAsciiStr; +} + +TCollection_AsciiString Filter(TCollection_AsciiString& aName) +{ + TCollection_AsciiString aFileName = aName; + aFileName.LeftAdjust(); + Standard_Integer i = aFileName.SearchFromEnd("."); + TCollection_AsciiString theFilter = aFileName.Split(i-1); + return theFilter; +} +//****************************************************************** + +//CTOR +QMcCad_Editor::QMcCad_Editor(QWidget* theParent, const char* theName, const Standard_Integer& theID) : QMainWindow(theParent) +{ + myID = theID; + myIsLoaded = Standard_False; + + setFocusPolicy(Qt::ClickFocus); + + //Make sure no triangles are visual when Antialiasing applied + OSD_Environment theEnv("CALL_OPENGL_ANTIALIASING_MODE","1"); + theEnv.Build(); + + //QT-window options + setMinimumSize(50, 50); + resize(700,500); + InitViewer(); + InitDocument(); + InitTDoc(); + myDoc->SetContext(myViewer->GetContext()); + + //viewer + QMcCad_View* theView = new QMcCad_View(this, myViewer, myDoc); + QMcCadGeomeTree_TreeWidget* theTreeWidget = (QMcCad_Application::GetAppMainWin())->GetTreeWidget(); + + myViewer->SetView(theView); + if (!myViewer->IsConfigured()) + myViewer->Reconfigure(); + setCentralWidget(theView); + setAttribute(Qt::WA_DeleteOnClose); + + + //Signals/Slots + connect(theView, SIGNAL(SigSelectionChanged()), theTreeWidget, SLOT(SlotVisuSelectionChanged())); + connect(this, SIGNAL(keyPressed(QKeyEvent*)), theView, SLOT(keyPressEvent(QKeyEvent*))); + connect(this, SIGNAL(keyReleased(QKeyEvent*)), theView, SLOT(keyReleaseEvent(QKeyEvent*))); + connect(theView, SIGNAL(viewModified()), this, SLOT(SlotViewModified())); + + if(myID > 1) + { + TCollection_AsciiString aMessage("Editor No. "); + aMessage += TCollection_AsciiString(myID); + aMessage += " opened."; + Mcout(aMessage.ToCString()); + } + + m_pMatManager = new MaterialManager(); +} + + +void QMcCad_Editor::GradientBackground() // doesn't work :( +{ + /*cout << "1\n"; + Handle(V3d_View) V3dView = myViewer->GetView()->View(); + Handle_Visual3d_ViewManager viewManager = myViewer->GetViewer()->Viewer(); + + Quantity_Color aTopColor (0, 0, 0, Quantity_TOC_RGB); + Quantity_Color aBottomColor (1, 1, 1, Quantity_TOC_RGB); + cout << "2\n"; +// if (aLayer.IsNull()) + //{ + Standard_Boolean aSizeDependant = Standard_True; //each window to have particular mapped layer? + static Handle(Visual3d_Layer) aLayer = new Visual3d_Layer(viewManager, Aspect_TOL_UNDERLAY, aSizeDependant); + //} + + int aWidth = myViewer->GetView()->width(), aHeight = myViewer->GetView()->height(); //e.g. QWidget::width() and height() for Qt-based apps + aLayer->Clear(); //make sure we draw on a clean layer + aLayer->Begin(); + aLayer->SetViewport(aWidth, aHeight); + + cout << aWidth << " " << aHeight << endl; + cout << "3\n"; + //now draw a polygon using top and bottom colors + //remember that default boundary is [-1,1;-1,1] and origin is in the left bottom corner + + //check position for the middle color - if transition should be non-uniform then + //additional points should be inserted and techiques changes - 2 polygons instead of 1 + aLayer->BeginPolygon(); + aLayer->SetColor (aTopColor); + aLayer->AddVertex (-1,1); + aLayer->AddVertex (1,1); + cout << "4\n"; + aLayer->SetColor (aBottomColor); + aLayer->AddVertex (1,-1); + aLayer->AddVertex (-1,-1); + aLayer->ClosePrimitive(); + aLayer->End(); + cout << "5\n";*/ +} + + +QMcCad_Editor::~QMcCad_Editor() // DTOR +{ + delete myViewer; + + delete m_pMatManager; // Add by Lei 23/10/2013 + m_pMatManager = NULL; +} + + +Standard_Integer QMcCad_Editor::ID() //Get ID Number +{ + return myID; +} + + +void QMcCad_Editor::updateProgress(int a) //Update Progress Bar +{ +/* if(!myProgressBar->isVisible()) + myProgressBar->show(); + myProgressBar->setValue(a); + if(a == 100) + { + myProgressBar->hide(); + myProgressBar->setValue(0); + //myViewer->GetView()->View()->Redraw(); + }*/ +} + +QMcCad_ActionMaster* QMcCad_Editor::GetActionMaster() +{ + return QMcCad_Application::GetAppMainWin()->GetActionMaster(); +} + + +void QMcCad_Editor::Mcout(const QString & aMessage, McCadMessenger_MessageType msgType) +{ + //QString theEdMess = "QMcCad_Editor: "; + //theEdMess = theEdMess + aMessage; + QMcCad_Application::GetAppMainWin()->Mcout(aMessage.toUtf8().constData(), msgType); +} + + +Handle(McCadCom_CasDocument) QMcCad_Editor::GetDocument() +{ + return myDoc; +} + + +QMcCad_View* QMcCad_Editor::GetView() +{ + if (myViewer != NULL) + return myViewer->GetView(); + else + Mcout("Missing Viewer", McCadMessenger_ErrorMsg); + return NULL; +} + + +QMcCad_Viewer* QMcCad_Editor::GetViewer() +{ + if (myViewer != NULL) + return myViewer; + else + Mcout("Missing Viewer", McCadMessenger_ErrorMsg); + return NULL; +} + +TDF_LabelSequence* QMcCad_Editor::GetLabelSequence() +{ + return &myLabelSequence; +} + +//Traverses the document tree and prints it's structure +void Traverse( TDF_Label label , TCollection_AsciiString thePrefix ) +{ + TCollection_AsciiString plusPrefix(" | - "); + TCollection_AsciiString aString; + TDF_Tool::Entry(label, aString); + cout << aString.ToCString(); + + Handle(TDataStd_Name) theName = new TDataStd_Name; + Standard_GUID theNameGUID = TDataStd_Name::GetID(); + Standard_Boolean HasAttribute = label.FindAttribute(theNameGUID, theName); + if(HasAttribute) + { + cout << " : "; + cout << "\"" << theName->Get() << "\""; + } + + cout << endl; + for( TDF_ChildIterator it( label, Standard_False ); it.More(); it.Next() ) + { + cout << thePrefix.ToCString(); + Traverse( it.Value() , plusPrefix+thePrefix ); + } +} + + +// Open/Load/Import a file to TDoc +void QMcCad_Editor::Import(const QString& theFileName) +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + TCollection_AsciiString aName = ToAsciiString(theFileName); + TCollection_AsciiString aFileFilter = Filter(aName); + + OSD_OpenMode aMode = OSD_ReadOnly; + OSD_Protection aProtect(OSD_RW, OSD_RW, OSD_RW, OSD_RW); + OSD_Path aPath(aName); + OSD_File aFile(aPath); + aFile.Append(aMode, aProtect); + + if (!(aFile.Exists() && aFile.IsOpen())) + { + Mcout("Can not open the file: ", McCadMessenger_ErrorMsg); + Mcout("theFileName"); + return; + } + + McCadGUI_GuiFactoryPtr theGuiFactory = McCadGUI_GuiFactory::Instance(); + theGuiFactory->SetType(McCadGUI_Base); + + McCadEXPlug_ExchangePlugin *theReader; + + if (QMcCad_Application::GetAppMainWin()->CheckExtension(aFileFilter)) + { + theReader = QMcCad_Application::GetAppMainWin()->GetPlugin(aFileFilter); + theReader->SetFilename(aName); + } + else + { + Mcout("Can't read file, no reader available for the this file: ", McCadMessenger_ErrorMsg); + Mcout(theFileName); + QApplication::restoreOverrideCursor(); + return; + } + + /////////////////////////////////////////////////////////////////// + //read data and store file name +//MYMOD + + //IMPORT file + + Handle(TDocStd_Document) theTDoc = myDoc->GetTDoc(); + QApplication::restoreOverrideCursor(); + if(!theReader->ImportToDocument(theTDoc)) + { + QString theError(" could not be loaded, or import has aborted."); + theError.prepend(theFileName); + Mcout(theError, McCadMessenger_ErrorMsg); + } + + //ctrl stays locked after ctrl+i; here we release it manualy + QKeyEvent* releaseCtrl = new QKeyEvent(QEvent::KeyRelease, Qt::Key_Control, Qt::NoModifier); + keyReleaseEvent(releaseCtrl); + + QApplication::restoreOverrideCursor(); +} + + +bool QMcCad_Editor::Export(const TCollection_AsciiString& theFileName) +{ + Handle(TDocStd_Document) theTDoc = myDoc->GetTDoc(); + mySaveName = theFileName; + TCollection_AsciiString aFileFilter = Filter(mySaveName); + + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + + OSD_OpenMode aMode = OSD_ReadOnly; + OSD_Protection aProtect(OSD_RW, OSD_RW, OSD_RW, OSD_RW); + OSD_Path aPath(mySaveName); + OSD_File aFile(aPath); + aFile.Append(aMode, aProtect); + + if (!(aFile.Exists() && aFile.IsOpen())) + { + Mcout("Can not open the file: ", McCadMessenger_ErrorMsg); + Mcout(theFileName.ToCString()); + return false; + } + + McCadGUI_GuiFactoryPtr theGuiFactory = McCadGUI_GuiFactory::Instance(); + theGuiFactory->SetType(McCadGUI_Base); + + //The Writer + //////////////////////////////////////// + McCadEXPlug_ExchangePlugin *theWriter; + + if (QMcCad_Application::GetAppMainWin()->CheckExtension(aFileFilter)) + { + theWriter = QMcCad_Application::GetAppMainWin()->GetPlugin(aFileFilter); + theWriter->SetFilename(mySaveName); + } + else + { + TCollection_AsciiString theMessage("Can't write file, no writer available for this file: "); + theMessage += theFileName; + Mcout(theMessage.ToCString()); + + return false; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + + //Prepare TDoc + /////////////////////////////////////////// + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + McCadXCAF_TDocShapeLabelIterator it(theTDoc); + for( ; it.More(); it.Next()) + { + TDF_Label curL = it.Current(); + + if(sTool->IsAssembly(curL)) //assemblies are not shown, only substructures + continue; + + Handle(TPrsStd_AISPresentation) prs; + + if ( curL.FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) //remove all deleted objects permanently from TDoc + { + Handle(AIS_InteractiveObject) anAISObject = prs->GetAIS(); + + if(!theContext->IsDisplayed(anAISObject) /*&& !theContext->IsInCollector(anAISObject)*/) + curL.ForgetAllAttributes(1); + } + } + + //Export + if(!theWriter->ExportFromDocument(theTDoc)) + { + Mcout("Could not export Document!", McCadMessenger_ErrorMsg); + return false; + } + + QApplication::restoreOverrideCursor(); + myDoc->SetDocName(theFileName); + myDoc->SetIsModified(Standard_False); + Mcout("File saved..."); + + return true; +} + + +void QMcCad_Editor::UpdateView() +{ + Handle(AIS_InteractiveContext) theContext = myDoc->GetContext(); + + //theContext->CloseLocalContext(); + + Handle(TDocStd_Document) theTDoc = myDoc->GetTDoc(); + TCollection_AsciiString dummy; + Traverse(theTDoc->Main(), dummy); + + //Init Visualization Drivers + /*Handle(XCAFPrs_Driver) aPrsDriver = new XCAFPrs_Driver(); + TPrsStd_DriverTable::Get(); + TPrsStd_DriverTable::Get()->InitStandardDrivers(); + TPrsStd_DriverTable::Get()->AddDriver(XCAFPrs_Driver::GetID(), aPrsDriver);*/ + + //print document structure + //TCollection_AsciiString dummy; + //Traverse(theTDoc->Main(), dummy); + + //Update Visualization + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + Handle(XCAFDoc_ColorTool) cTool = XCAFDoc_DocumentTool::ColorTool(theTDoc->Main()); + + McCadGUI_ProgressDialogPtr theProgress = new McCadGUI_ProgressDialog(QMcCad_Application::GetAppMainWin()); + Handle(Message_ProgressIndicator) thePI = Handle(Message_ProgressIndicator)::DownCast(theProgress); + theProgress->SetLabelText("Updating View."); + theProgress->SetCancelButtonText("Cancel"); + theProgress->SetTotalSteps(100); + theProgress->SetProgress(0); + TDF_LabelSequence labSeq; + sTool->GetFreeShapes(labSeq); + thePI->SetStep(100.5/labSeq.Length()); + + srand ( time(NULL) ); + + Standard_Real r,g,b; + //r = (rand() % 255) / 256.0; + //g = (rand() % 255) / 256.0; + //b = (rand() % 255) / 256.0; + TCollection_AsciiString theName; + TCollection_AsciiString labelName; + Standard_GUID theNameGUID = TDataStd_Name::GetID(); + Handle(TDataStd_Name) tmpName; + + McCadXCAF_TDocShapeLabelIterator it(theTDoc); + TCollection_AsciiString strGroupName(""); + Quantity_Color theCol; // the display color for each group + for( ; it.More(); it.Next()) //iterate through all toplevel shapes and children + { + thePI->Increment(); + if(thePI->UserBreak()) + return; + + TDF_Label curL = it.Current(); + Handle(TNaming_NamedShape) nmdShp; + + if(!curL.FindAttribute(TNaming_NamedShape::GetID(), nmdShp)) + continue; + + // skip already registered labels + Handle(TDataStd_BooleanList) bList; + if(curL.FindAttribute(TDataStd_BooleanList::GetID(), bList) && !myIsLoaded) + continue; + + if(!myIsLoaded) + { + bList = new TDataStd_BooleanList; + curL.AddAttribute(bList); + } + + // visualize ... + Handle(AIS_Shape) aisShp = new AIS_Shape(nmdShp->Get()); +// Handle(AIS_TexturedShape) aisShp = new AIS_TexturedShape(nmdShp->Get()); +/* TCollection_AsciiString tFileName("/home/grosse/Testarea/TexturedShapes/myface.bmp"); + aisShp->SetTextureFileName(tFileName); + aisShp->SetTextureMapOn(); + aisShp->SetTextureRepeat(true,2, 1); + aisShp->SetTextureScale(0.1,0.1); + aisShp->SetDisplayMode(3);*/ + + TDF_Tool::Entry(curL, labelName); + if(curL.FindAttribute(theNameGUID, tmpName)) + theName = tmpName->Get(); + else + theName = labelName; + + // theName.Remove(theName.SearchFromEnd(" ")); + if (!theName.IsEqual(strGroupName)) // @color Lei Lu 10/10/2013 + { + r = ((rand() % 236)+10) / 256.0; + g = ((rand() % 236)+10) / 256.0; + b = ((rand() % 236)+10) / 256.0; + strGroupName = theName; + theCol.SetValues(r,g,b, Quantity_TOC_RGB); + } +// if(cTool->GetColor(curL, XCAFDoc_ColorGen ,cLab)) +// { +// cTool->GetColor(curL, XCAFDoc_ColorGen, theCol); +// } +// else +// { +// // random color +// //theCol.SetValues(0.12,0.77,1,Quantity_TOC_RGB); +// /* Standard_Real r,g,b;*/ +// //r = (rand() % 255) / 256.0; +// //g = (rand() % 255) / 256.0; +// //b = (rand() % 255) / 256.0; + +// } + +// cTool->GetColor(curL, theCol); + + aisShp->SetColor(theCol); + aisShp->SetMaterial(Graphic3d_NOM_PLASTIC); + aisShp->SetDisplayMode(AIS_Shaded); + aisShp->SetWidth(2.); + + theContext->Display(aisShp, Standard_False); +// theContext->SetMaterial(aisShp, Graphic3d_NOM_PLASTIC); +// theContext->UpdateCurrentViewer(); +// aisShp->UpdateAttributes(); + + //Handle(TPrsStd_AISPresentation) prs; + + /*if ( ! curL.FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) && ! sTool->IsAssembly(curL)) + { + prs = TPrsStd_AISPresentation::Set(curL,XCAFPrs_Driver::GetID()); + prs->SetMode(1);*/ + + //prs->Display(Standard_True); + //prs->SetMaterial(Graphic3d_NOM_PLASTIC); + //theContext->Display(prs->GetAIS(), 0); + //theContext->HilightWithColor(prs->GetAIS(),Quantity_NOC_BLACK,0); + //} + } + myIsLoaded = Standard_False; + theContext->UpdateCurrentViewer(); + GetView()->FitAll(); +} + + +/* * + * save and export functions + * */ +bool QMcCad_Editor::Save() +{ + TCollection_ExtendedString saveName(myDoc->GetDocName()); //get name + + if(saveName.SearchFromEnd(".xml") < 0 || saveName.SearchFromEnd(".xml") > (saveName.Length()-3)) //check extension + saveName += TCollection_ExtendedString(".xml"); + + return Save(saveName); +} + + +bool QMcCad_Editor::Save(const TCollection_AsciiString& saveName) // save function +{ + TCollection_ExtendedString outString; + Handle(TDocStd_Application) theXCAFApp = QMcCad_Application::GetAppMainWin()->GetXCAFApp(); + QApplication::setOverrideCursor(Qt::WaitCursor); +#ifdef OCC650 + CDF_StoreStatus theStat; +#else + PCDM_StoreStatus theStat; +#endif + theStat = theXCAFApp->SaveAs(myDoc->GetTDoc(), saveName, outString); + QApplication::restoreOverrideCursor(); + +#ifdef OCC650 + if(theStat==CDF_SS_DriverFailure) + Mcout("PCDM_SS_DriverFailure", McCadMessenger_ErrorMsg); + if(theStat==CDF_SS_WriteFailure) + Mcout("PCDM_SS_WriteFailure", McCadMessenger_ErrorMsg); + if(theStat==CDF_SS_Failure) + Mcout("PCDM_SS_Failure", McCadMessenger_ErrorMsg); +#else + if(theStat==PCDM_SS_DriverFailure) + Mcout("PCDM_SS_DriverFailure", McCadMessenger_ErrorMsg); + if(theStat==PCDM_SS_WriteFailure) + Mcout("PCDM_SS_WriteFailure", McCadMessenger_ErrorMsg); + if(theStat==PCDM_SS_Failure) + Mcout("PCDM_SS_Failure", McCadMessenger_ErrorMsg); +#endif + + + cout << "SAVE FILE AS : " << saveName.ToCString() << endl; + TCollection_AsciiString statMess(outString); + cout << "StatusMessage: " << statMess.ToCString() << endl; + + myDoc->SetDocName(saveName); + myDoc->SetIsModified(Standard_False); + UpdateWindowTitle(); + setWindowModified(false); + return true; +} + + +/* * + * set functions + * */ + +void QMcCad_Editor::SetDocument(Handle(McCadCom_CasDocument) theDoc) +{ + myDoc = theDoc; +} + + +void QMcCad_Editor::SetView(QMcCad_View* theView) +{ + if (myViewer != NULL) + return myViewer->SetView(theView); + else + Mcout(QString("Missing Viewer"), McCadMessenger_ErrorMsg); +} + + +void QMcCad_Editor::SetViewer(QMcCad_Viewer* theViewer) +{ + myViewer = theViewer; +} + + +void QMcCad_Editor::SetID(Standard_Integer theID) // Set ID number +{ + myID = theID; +} + + + +/* * + * Init functions + * */ + +void QMcCad_Editor::InitDocument() +{ + //if (myViewer != NULL) + //{ + //Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + //myDoc = new McCadCom_CasDocument(theContext); + //myDoc->NewDocument(myID); + //} + //else + // Mcout(QString("No viewer found. Editor could not be created.")); + myDoc = new McCadCom_CasDocument(myID); + QColor theBgColor = QMcCad_Application::GetAppMainWin()->GetBgColor(); + Quantity_Color bgCol(theBgColor.red()/255., theBgColor.green()/255., theBgColor.blue()/255., Quantity_TOC_RGB); + myDoc->SetBgColor(bgCol); +} + + +void QMcCad_Editor::InitDocument(Handle(McCadCom_CasDocument) theDoc) +{ + if(myViewer != NULL) + { + Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + theDoc->SetContext(theContext); + myDoc = theDoc; + } + else + Mcout(QString("Can not create a Document"), McCadMessenger_ErrorMsg); +} + + +void QMcCad_Editor::SetIsLoaded(Standard_Boolean status) +{ + myIsLoaded = status; +} + + +void QMcCad_Editor::InitTDoc() +{ + Handle(TDocStd_Document) theTDoc; // = new TDocStd_Document("XmlXCAF"); + /*if(!QMcCad_Application::GetAppMainWin()->NewDocument(theTDoc)); + return;*/ // crashes ... + Handle(TDocStd_Application) theXCAFApp = QMcCad_Application::GetAppMainWin()->GetXCAFApp(); + theXCAFApp->NewDocument("XmlXCAF", theTDoc); //initialize Document + //theXCAFApp->NewDocument("McCad_Document", theTDoc); + + if(!XCAFDoc_DocumentTool::IsXCAFDocument(theTDoc)) + { + cout << "Couldn't initialize Document. Not a XmlXCAF Doc!!!\n"; + Mcout("Couldn't initialize Document. Not a XmlXCAF Doc!!!\n", McCadMessenger_ErrorMsg); + return; + } + + //Undo + theTDoc->SetUndoLimit(50); + + //XDE Viewer // DOESN'T WORK FOR ME ... WHY ??? +/* Handle(TPrsStd_AISViewer) aTViewer; + TDF_Label rootLabel = theTDoc->GetData()->Root(); + + if (!TPrsStd_AISViewer::Find (rootLabel, aTViewer)) + { + Handle(AIS_InteractiveContext) theIC = myViewer->GetContext(); + TPrsStd_AISViewer::New(rootLabel, theIC); + } + else + Mcout("TPrsStd_AISViewer already attached to the root label!"); +*/ + //Set label for MCards 21.11.2013, Lei Lu + /*Handle(TDataStd_Name) theMCardName; + Handle(TDF_Data) theData = theTDoc->GetData(); + TDF_Label theLab; + TCollection_AsciiString mCardLab("0:1:1:1:6"); + + TDF_Tool::Label(theData, mCardLab, theLab, Standard_True); //create new Label for MCards + + if(theLab.IsNull()) + Mcout("MCard Label could not be set.", McCadMessenger_ErrorMsg); + else + theMCardName->Set(theLab, "MCards");*/ + + GetDocument()->SetTDoc(theTDoc); +} + + +void QMcCad_Editor::InitViewer() +{ + myViewer = new QMcCad_Viewer(this); +} + + +void QMcCad_Editor::Hardcopy(const QString& theFileName) +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + if (myViewer != NULL) + { + TCollection_AsciiString aFileName = ToAsciiString(theFileName); + myViewer->GetView()->Dump(aFileName.ToCString(), Aspect_FOSP_A4); + Mcout("Picture written into file:"); + Mcout(theFileName); + } + else + Mcout("Missing Viewer", McCadMessenger_ErrorMsg); + QApplication::restoreOverrideCursor(); +} + + +void QMcCad_Editor::MakeRotationMoviePictures() +{ + /*Standard_Integer i(0), j(0); + + for(j=1; j<= 200; j++) + { + TCollection_AsciiString nm("pic"); + myViewer->GetView()->View()->SetZoom(1.01); + myViewer->GetView()->View()->Redraw(); + TCollection_AsciiString num; + if(j<10) + num += "0"; + if(j<100) + num += "0"; + + num += j; + nm += num; + nm += ".bmp"; + myViewer->GetView()->Dump(nm.ToCString(), Aspect_FOSP_A4); + } + + for(i=j; i<=j+360; i++) + { + TCollection_AsciiString nm("pic"); + // perform rotation + Standard_Real ang(1*PI/180.); + myViewer->GetView()->View()->Rotate(V3d_Z, ang, 858.35, -47.075, 49.875); + myViewer->GetView()->View()->Redraw(); + + // dump view + TCollection_AsciiString num; + if(i<10) + num += "0"; + if(i<100) + num += "0"; + + num += i; + nm += num; + nm += ".bmp"; + myViewer->GetView()->Dump(nm.ToCString(), Aspect_FOSP_A4); + }*/ +} + + +void QMcCad_Editor::Print(QPrinter* thePrinter) +{ + /* + static QString filter = "Images Files (*.bmp *.gif *.xwd)"; + QFileDialog fd (this,"McCad Printer",filter); + int ret = fd.exec(); + + // update the desktop after the dialog is closed + // QApplication::processEvents(); + QString file (ret == QDialog::Accepted ? fd.selectedFile() : QString::null); + if ( !file.isNull() ) + { + QApplication::setOverrideCursor(Qt::WaitCursor); + if ( !QFileInfo( file ).extension().length() ) + file += QString( ".bmp" ); + + } + */ + // bool res = GetView()->dump((Standard_CString)file.latin1()); + /* + bool res = false; + QApplication::restoreOverrideCursor(); + if ( !res ) + { + // QMessageBox::information ( QApplication::mainWidget(),tr("TIT_ERROR"), tr("INF_ERROR"), tr("BTN_OK"), + QString::null, QString::null, 0, 0 ); + // QApplication::processEvents(); + // } + } + */ + cout << "NOT YET IMPLEMENTED\n"; +} + + +void QMcCad_Editor::closeEvent(QCloseEvent *e) +{ + QString closedMessage("Editor No. "); + TCollection_AsciiString id(myID); + id += " closed."; + closedMessage.append(id.ToCString()); + + if (myDoc->IsSetModified() ) + { + TCollection_AsciiString theName = myDoc->GetDocName(); + + theName.Prepend("\""); + theName+=TCollection_AsciiString("\""); + + QString addText = tr(" has been modified!\nSave changes?"); + QString saveText = theName.ToCString() + addText; + + switch (QMessageBox::warning(this, tr("Save Changes"), saveText, tr("Yes"), tr("No"), tr("Cancel") )) + { + case 0: + if(Save()) + { + Mcout(closedMessage); + e->accept(); + emit destroyed(myID); + } + else + e->ignore(); + break; + case 1: + Mcout(closedMessage); + e->accept(); + emit destroyed(myID); + break; + default: + e->ignore(); + break; + } + } + else + { + Mcout(closedMessage); + emit destroyed(myID); + e->accept(); + } +} + + +QString QMcCad_Editor::GetQFileName() +{ + TCollection_AsciiString aName(myDoc->GetDocName()); + QString qName(aName.ToCString()); + return qName; +} + +void QMcCad_Editor::SetCurrentFilter(QString theFilter) +{ + myCurrentFilter = theFilter; +} + + +QString QMcCad_Editor::GetCurrentFilter() +{ + return myCurrentFilter; +} + + +void QMcCad_Editor::UpdateWindowTitle() +{ + TCollection_AsciiString docName = myDoc->GetDocName(); + if(docName.Search("/")>0) + docName.Remove(1,docName.SearchFromEnd("/")); + /*if(docName.Search(".")>0) + docName.Remove(docName.SearchFromEnd("."), docName.Length()-docName.SearchFromEnd(".")+1);*/ + QString theTitle(docName.ToCString() + QString("[*]")); + setWindowTitle(theTitle); +} + + +void QMcCad_Editor::keyPressEvent(QKeyEvent* e) +{ + emit keyPressed(e); +} + +void QMcCad_Editor::keyReleaseEvent(QKeyEvent* e) +{ + emit keyReleased(e); +} + +void QMcCad_Editor::SlotViewModified() +{ + myDoc->SetIsModified(Standard_True); + setWindowModified(true); +} + +MaterialManager* QMcCad_Editor::GetMatManager() +{ + return m_pMatManager; +} + + +/** ******************************************************************** +* @brief +* @param +* @return +* +* @date 21/11/2013 +* @author Lei Lu +***********************************************************************/ +Standard_Boolean QMcCad_Editor::AddTreeItem(TCollection_AsciiString theLabel, QTreeWidgetItem *& pItem) +{ + if(!m_IDLabelItemMap.contains(theLabel)) + { + m_IDLabelItemMap.insert(theLabel,pItem); + } + else + { + return Standard_False; + } + + if(!m_ItemSolidMap.contains(pItem)) + { + m_ItemSolidMap.insert(pItem,theLabel); + } + else + { + return Standard_False; + } +} + + + +/** ******************************************************************** +* @brief +* @param +* @return +* +* @date 21/11/2013 +* @author Lei Lu +***********************************************************************/ +void QMcCad_Editor::DeleteSelectedItem(TCollection_AsciiString theLabel) +{ + QTreeWidgetItem *pItem = m_IDLabelItemMap[theLabel]; + m_IDLabelItemMap.remove(theLabel); + m_ItemSolidMap.remove(pItem); + delete pItem; + pItem = NULL; +} + + +/** ******************************************************************** +* @brief +* @param +* @return +* +* @date 21/11/2013 +* @author Lei Lu +***********************************************************************/ +TCollection_AsciiString QMcCad_Editor::GetSolidFromItem(QTreeWidgetItem *& pItem) +{ + if(m_ItemSolidMap.contains(pItem)) + { + return m_ItemSolidMap[pItem]; + } + else + { + return ""; + } +} + + + +/** ******************************************************************** +* @brief +* @param +* @return +* +* @date 21/11/2013 +* @author Lei Lu +***********************************************************************/ +QTreeWidgetItem * QMcCad_Editor::GetTreeItem(TCollection_AsciiString theLabel) +{ + if(m_IDLabelItemMap.contains(theLabel)) + { + QTreeWidgetItem * pItem = NULL; + pItem = m_IDLabelItemMap[theLabel]; + return pItem; + } +} + + + +/** ******************************************************************** +* @brief +* @param +* @return +* +* @date 21/11/2013 +* @author Lei Lu +***********************************************************************/ +void QMcCad_Editor::DeleteTreeItem() +{ + QMap::const_iterator iter; + for(iter = m_IDLabelItemMap.constBegin(); iter != m_IDLabelItemMap.constEnd(); ++iter) + { + delete iter.value(); + } + + m_ItemSolidMap.clear(); +} + + + diff --git a/src/MCCAD/QMcCad/QMcCad_LogWindow.cpp b/src/MCCAD/QMcCad/QMcCad_LogWindow.cpp new file mode 100644 index 0000000..978b618 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_LogWindow.cpp @@ -0,0 +1,58 @@ +#include + +QMcCad_LogWindow::QMcCad_LogWindow(QWidget* parent) : + QTextEdit(parent) +{ + myString = " "; + myParent=parent; + myWColor = QColor(125,25,225); + myEColor = QColor(255,0,0); + myColor = QColor(0,0,0); +} + +void QMcCad_LogWindow::Append(QString theString) +{ + setTextColor(myColor); + myString = theString; + append(theString); +} + +QSize QMcCad_LogWindow::sizeHint() const +{ + QSize theSize(1/25*myParent->width(), 1/25*myParent->height()); + return theSize; +} + +void QMcCad_LogWindow::SetTextColor(int r, int g, int b) +{ + QColor c(r, g, b); + setTextColor(c); +} + +void QMcCad_LogWindow::SetTextColor(QColor& c) +{ + setTextColor(c); +} + + +void QMcCad_LogWindow::Error(QString theString) +{ + setTextColor(myEColor); + append(theString); + setTextColor(myColor); +} + +void QMcCad_LogWindow::Warning(QString theString) +{ + setTextColor(myWColor); + append(theString); + setTextColor(myColor); +} + +void QMcCad_LogWindow::Heading(QString theString) +{ + setFontWeight(QFont::Bold); + append(theString); + setFontWeight(QFont::Normal); +} + diff --git a/src/MCCAD/QMcCad/QMcCad_ReadListDialog.cxx b/src/MCCAD/QMcCad/QMcCad_ReadListDialog.cxx new file mode 100644 index 0000000..d190074 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_ReadListDialog.cxx @@ -0,0 +1,174 @@ +#include +#include +#include +#include + +QMcCad_ReadListDialog::QMcCad_ReadListDialog() +{ + myUI.setupUi(this); + myFileSelected = false; + + myIsDone = true; + + + QPushButton *okButton = myUI.buttonBox->button(QDialogButtonBox::Ok); + okButton->setDisabled(true); + + connect(myUI.loadButton, SIGNAL(clicked()), this, SLOT(SlotOpenFile())); + connect(myUI.buttonBox, SIGNAL(accepted()), this, SLOT(SlotDyeSolids())); +} + + +bool QMcCad_ReadListDialog::FileSelected() +{ + return myFileSelected; +} + + +TCollection_AsciiString QMcCad_ReadListDialog::GetFileName() +{ + return myFileName; +} + + +double QMcCad_ReadListDialog::GetLowerBound() +{ + return myLowerBound; +} + + +double QMcCad_ReadListDialog::GetUpperBound() +{ + return myUpperBound; +} + +list QMcCad_ReadListDialog::GetCellNumberList() +{ + return myCellNumberList; +} + +int QMcCad_ReadListDialog::GetNbColors() +{ + TCollection_AsciiString nbAStr(myUI.nbColorsEdit->text().toAscii().data()); + if(!nbAStr.IsIntegerValue()) + return 12; + + return nbAStr.IntegerValue(); +} + +list QMcCad_ReadListDialog::GetValueList() +{ + return myValueList; +} + +void QMcCad_ReadListDialog::SlotDyeSolids() +{ + + QString upperQStr = myUI.maximumEdit->text(); + // read bounds + TCollection_AsciiString upperAStr(upperQStr.toAscii().data()); + TCollection_AsciiString lowerAStr(myUI.minimumEdit->text().toAscii().data()); + + myUpperBound = upperAStr.RealValue(); + myLowerBound = lowerAStr.RealValue(); +} + + + +void QMcCad_ReadListDialog::SlotOpenFile() +{ + QFileDialog* fileDialog = new QFileDialog(this); + + QString qFileName = fileDialog->getOpenFileName(); + myFileName = TCollection_AsciiString(qFileName.toAscii().data()); + + if(!this->ParseFile()) + { + cout << "_#_QMcCad_ReadListDialog :: File Parsing Error!!!\n"; + myIsDone = false; + } + else + myIsDone = true; + + TCollection_AsciiString upperAStr(myUpperBound); + TCollection_AsciiString lowerAStr(myLowerBound); + QString upperValueStr(upperAStr.ToCString()); + QString lowerValueStr(lowerAStr.ToCString()); + myUI.maximumEdit->setText(upperValueStr); + myUI.minimumEdit->setText(lowerValueStr); + + QPushButton *okButton = myUI.buttonBox->button(QDialogButtonBox::Ok); + okButton->setDisabled(false); +} + +bool QMcCad_ReadListDialog::Done() +{ + return myIsDone; +} + + +// private functions +bool QMcCad_ReadListDialog::ParseFile() +{ + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + + ifstream fileReader; + fileReader.open(myFileName.ToCString()); + + myCellNumberList.clear(); + myValueList.clear(); + + while(!fileReader.eof()) + { + char lineArray[256]; + fileReader.getline(lineArray, 256); + TCollection_AsciiString line(lineArray); + + // skip empty lines + line.LeftAdjust(); + line.RightAdjust(); + if(line.Length() < 3) + continue; + + TCollection_AsciiString cellNumberString; + TCollection_AsciiString valueString; + + cellNumberString = line.Token(" \t", 1); + valueString = line.Token(" \t", 3); + + if(!cellNumberString.IsIntegerValue()) + { + msgr->Message("_#_QMcCad_ReadListDialog :: Error : integer value expected\n", + McCadMessenger_ErrorMsg); + return false; + } + if(!valueString.IsRealValue()) + { + msgr->Message("_#_QMcCad_ReadListDialog :: Error : real value expected\n", + McCadMessenger_ErrorMsg); + return false; + } + + myCellNumberList.push_back(cellNumberString.IntegerValue()); + myValueList.push_back(valueString.RealValue()); + } + + + // find bounds + double lower(100.0), upper(0.0); + list::iterator valueIt = myValueList.begin(); + for(; valueIt != myValueList.end(); valueIt++) + { + double currentValue = *valueIt; + if(currentValue < lower) + lower = currentValue; + if(currentValue > upper) + upper = currentValue; + } + + myUpperBound = upper; + myLowerBound = lower; + + return true; +} + diff --git a/src/MCCAD/QMcCad/QMcCad_TransparencyDialog.cpp b/src/MCCAD/QMcCad/QMcCad_TransparencyDialog.cpp new file mode 100644 index 0000000..f46639e --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_TransparencyDialog.cpp @@ -0,0 +1,45 @@ +/* + * QMcCad_VGParamDialog.cpp + * + * Created on: Jul 18, 2008 + * Author: grosse + */ +#include +#include +#include +#include +#include +#include + + +QMcCad_TransparencyDialog::QMcCad_TransparencyDialog(QWidget* theFather) : QDialog(theFather) +{ + uiTranspDial.setupUi(this); + connect(uiTranspDial.okButton, SIGNAL(clicked()), this, SLOT(IsAccepted())); + connect(uiTranspDial.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency(int))); +} + +void QMcCad_TransparencyDialog::IsAccepted() +{ + SetTransparency(0); +} + + +void QMcCad_TransparencyDialog::SetTransparency(int val) +{ + Handle(AIS_InteractiveContext) theContext = QMcCad_Application::GetAppMainWin()->GetEditor()->GetDocument()->GetContext(); + + AIS_ListOfInteractive ioList; + for(theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent()) + ioList.Append(theContext->Current()); + + AIS_ListIteratorOfListOfInteractive it(ioList); + + for ( ; it.More(); it.Next() ) + { + Handle(AIS_InteractiveObject) io = it.Value(); + Standard_Real tVal = Standard_Real(val)/100.; + io->SetTransparency(tVal); + } + theContext->UpdateCurrentViewer(); +} diff --git a/src/MCCAD/QMcCad/QMcCad_VGParamDialog.cpp b/src/MCCAD/QMcCad/QMcCad_VGParamDialog.cpp new file mode 100644 index 0000000..67f5039 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_VGParamDialog.cpp @@ -0,0 +1,148 @@ +/* + * QMcCad_VGParamDialog.cpp + * + * Created on: Jul 18, 2008 + * Author: grosse + */ +#include + +QMcCad_VGParamDialog::QMcCad_VGParamDialog(QWidget* theFather) : QDialog(theFather) +{ + uiVGParams.setupUi(this); + myAccepted = false; + myAcceptButton = uiVGParams.acceptButton; + myCM = uiVGParams.checkCM; + myMM = uiVGParams.checkMM; + connect(myCM, SIGNAL(stateChanged(int)), this, SLOT(SlotCMStateChanged(int))); + connect(myMM, SIGNAL(stateChanged(int)), this, SLOT(SlotMMStateChanged(int))); + connect(myAcceptButton, SIGNAL(clicked()), this, SLOT(IsAccepted())); +} + +bool QMcCad_VGParamDialog::GetWriteCollision() +{ + return uiVGParams.checkCollision->checkState(); +} + +bool QMcCad_VGParamDialog::GetWriteDiscretModel() +{ + return uiVGParams.checkDiscrete->checkState(); +} + +double QMcCad_VGParamDialog::GetTolerance() +{ + return (uiVGParams.tolSet->text()).toFloat(); +} + +double QMcCad_VGParamDialog::GetXRes() +{ + return (uiVGParams.xRes->text()).toDouble(); +} + +double QMcCad_VGParamDialog::GetYRes() +{ + return (uiVGParams.yRes->text()).toDouble(); +} + +int QMcCad_VGParamDialog::GetMaxSamplePnts() +{ + return (uiVGParams.maxSamplePoints->text()).toInt(); +} + +int QMcCad_VGParamDialog::GetMinSamplePnts() +{ + return (uiVGParams.minSamplePoints->text()).toInt(); +} + +int QMcCad_VGParamDialog::GetMaxComplemented() +{ + return (uiVGParams.maxComplementCells->text()).toDouble(); +} + +int QMcCad_VGParamDialog::GetMaxPreDec() +{ + return (uiVGParams.maxPredecCells->text()).toInt(); +} + +int QMcCad_VGParamDialog::GetInitialCellNumber() +{ + return (uiVGParams.initCellNb->text()).toInt(); +} + +int QMcCad_VGParamDialog::GetInitialSurfaceNumber() +{ + return (uiVGParams.initSurfNb->text()).toInt(); +} + +double QMcCad_VGParamDialog::GetMinDecFace() +{ + return (uiVGParams.minDecFaceArea->text()).toDouble(); +} + +double QMcCad_VGParamDialog::GetMinReDecFace() +{ + return (uiVGParams.minReDecFaceArea->text()).toDouble(); +} + +double QMcCad_VGParamDialog::GetMinVoidVolume() +{ + return (uiVGParams.minVoidVolume->text()).toDouble(); +} + +double QMcCad_VGParamDialog::GetMinInputVolume() +{ + return (uiVGParams.minInputVolume->text()).toDouble(); +} + +/*QString* QMcCad_VGParamDialog::GetBoundingBox() +{ + return &(uiVGParams.lineBoundingBox->text()); +}*/ + +QPushButton* QMcCad_VGParamDialog::GetAcceptButton() +{ + return myAcceptButton; +} + +bool QMcCad_VGParamDialog::Accepted() +{ + return myAccepted; +} + +void QMcCad_VGParamDialog::IsAccepted() +{ + myAccepted = true; + accept(); +} + +McCadCSGGeom_Unit QMcCad_VGParamDialog::GetUnits() +{ + return myUnit; +} + +void QMcCad_VGParamDialog::SlotCMStateChanged(int theState) +{ + if(theState == 2) + { + myUnit = McCadCSGGeom_CM; + myMM->setCheckState(Qt::Unchecked); + } + else + { + if(myMM->checkState()==Qt::Unchecked) + myCM->setCheckState(Qt::Checked); + } +} + +void QMcCad_VGParamDialog::SlotMMStateChanged(int theState) +{ + if(theState == 2) + { + myUnit = McCadCSGGeom_MM; + myCM->setCheckState(Qt::Unchecked); + } + else + { + if(myCM->checkState()==Qt::Unchecked) + myMM->setCheckState(Qt::Checked); + } +} diff --git a/src/MCCAD/QMcCad/QMcCad_View.cpp b/src/MCCAD/QMcCad/QMcCad_View.cpp new file mode 100644 index 0000000..7034495 --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_View.cpp @@ -0,0 +1,524 @@ +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +//////////////////////////////////// +#include +#include +#include +/////////////////////////////////////// +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +QMcCad_View::QMcCad_View(QWidget* theParent, QMcCad_Viewer* theViewer,Handle(McCadCom_CasDocument) theDoc) +:QGLWidget((QWidget*) theParent), McCadCom_CasView(theDoc) +{ + myAxisSet = Standard_False; + QApplication::syncX(); + // setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer)); + setMouseTracking(true); + myRubberBand = new QRubberBand(QRubberBand::Rectangle, this); + // setMouseTracking( true ); + setAutoFillBackground( false ); + setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_PaintOnScreen); + + // setAutoBufferSwap( false ); + // setAttribute( Qt::WA_OpaquePaintEvent ); + setWindowIcon(QPixmap(":images/mccad.png")); + myViewer = theViewer; + myXmin = 0; + myYmin = 0; + myXmax = 0; + myYmax = 0; + myCPA = 0.0; + myCPB = 0.0; + myCPC = 0.0; + myCPD = 0.0; + myCPVisState = Standard_False; + myIsInit = Standard_False; + mySelectionMode=Standard_False; + myRectangleMode=Standard_False; + myShiftSelect = Standard_False; + myControlDown = Standard_False; + + ///////////////////////////////////////////////////// + myAcM = myViewer->GetActionMaster(); + + connect(myAcM, SIGNAL(ActionStarted()),this, SLOT(SlotInitTask())); + connect(this, SIGNAL(InitFinished()),this, SLOT(PreExecute())); +} + +QMcCad_View::~QMcCad_View() +{ +} + +QSize QMcCad_View::minimumSizeHint() const +{ + return QSize(250, 250); +} + + +QSize QMcCad_View::sizeHint() const +{ + return QSize(400, 400); +} + + +void QMcCad_View::initializeGL() +{ + + int windowHandle = (int) winId(); + short hi; + short lo; + lo = (short) windowHandle; + hi = (short) (windowHandle >> 16); + + Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + Handle(Xw_Window) theXWindow = new Xw_Window(Handle(Graphic3d_GraphicDevice)::DownCast(theContext->CurrentViewer()->Device()), + (int) hi,(int) lo,Xw_WQ_SAMEQUALITY,Quantity_NOC_BLACK); + Init(theXWindow); + FitAll(); + myIsInit = Standard_True; +} + + +void QMcCad_View::paintGL() +{ + Redraw(); +} + + +void QMcCad_View::resizeGL(int width, int height) +{ + //int w=width; + //int h=height; + Resize(); +} + + +void QMcCad_View::SlotInitTask() +{ + Handle(McCadTool_Task) aTask = GetCurrentTask(); + myCurrentTID = aTask->GetID(); + + if(aTask->IsNull()) + return; + + if (aTask->NeedRect()) + { + aTask->Suspend(); + myRectangleMode = Standard_True; + } + if (aTask->NeedSelect()) + { + aTask->Suspend(); + mySelectionMode = Standard_True; + } + + emit InitFinished(); +} + + +void QMcCad_View::PreExecute() +{ + Handle(McCadTool_Task) aTask = GetCurrentTask(); + if (aTask->GetID() == McCadTool_NoID) + return; + + if (aTask->State() != McCadTool_Start) + aTask->Resume(); + else + Execute(); +} + + +void QMcCad_View::Execute() +{ + Handle(McCadTool_Task) aTask = GetCurrentTask(); + + aTask->Execute(); + + if(myCurrentTID == McCadTool_Axis) // show/hide Axis + { + if(myAxisSet) + { + aTask->UnExecute(); + myAxisSet = Standard_False; + } + else + myAxisSet = Standard_True; + } + + //Reset Current Task after current Task is done; + Handle(McCadTool_Task) aT = new McCadTool_Task; + aT->Initialize(); + + if(aTask->State() == McCadTool_Done) + { + SetCurrentTask(aT); + myCurrentTID = McCadTool_NoID; + mySelectionMode = Standard_False; + myRectangleMode = Standard_False; + } +} + + +void QMcCad_View::Select() +{ + Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + theContext->Select(); + mySelectionMode=Standard_False; + emit InitFinished(); +} + + +void QMcCad_View::ShiftSelect() +{ + Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + theContext->ShiftSelect(); + mySelectionMode=Standard_False; + emit InitFinished(); +} + + +void QMcCad_View::DrawRectangle() +{ + /*QPainter aPainter(this); + aPainter.setPen(Qt::white); + //aPainter.setBrush(Qt::NoBrush); + //QRect aRectangle; + //aRectangle.setRect(myXmin, myYmin, abs(myXmax-myXmin), abs(myYmax-myYmin)); + //aPainter.drawRect(aRectangle); + aPainter.drawRect(myXmin, myYmin, abs(myXmax-myXmin), abs(myYmax-myYmin)); + + myRectangleMode=Standard_False; + emit InitFinished();*/ +} + + +void QMcCad_View::mousePressEvent(QMouseEvent* e) +{ + QPoint aPoint = e->pos(); + myXmin = aPoint.x(); + myYmin = aPoint.y(); + myXmax = aPoint.x(); + myYmax = aPoint.y(); + + if(e->button() == Qt::LeftButton) + { + myLMBpushed = Standard_True; + MousePressEvent(*e); + + if(myCurrentTID == McCadTool_NoID) // Selection mode + { + mySelectionMode = Standard_True; + + myRubberBand->setGeometry(QRect(aPoint, QSize())); + myRubberBand->setStyle((QStyle*) new QPlastiqueStyle() ); + myRubberBand->show(); + } + + if(myCurrentTID == McCadTool_Rotate) + View()->StartRotation(aPoint.x(), aPoint.y() ); + } + else if(e->button()==Qt::MidButton) + { + myMMBpushed = Standard_True; + View()->StartRotation(aPoint.x(), aPoint.y() ); + } +} + + +void QMcCad_View::mouseReleaseEvent(QMouseEvent* e) +{ + QPoint aPoint = e->pos(); + + Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + + MouseReleaseEvent(*e); + + if(mySelectionMode) + { + if (e->button() == Qt::LeftButton) + { + myXmax = aPoint.x(); + myYmax = aPoint.y(); + + if (myControlDown) + ShiftSelect(); + else + Select(); + } + emit SigSelectionChanged(); //Update TreeWidget + } + + if (myRectangleMode) + { + if (e->button() == Qt::LeftButton) + { + myXmax = aPoint.x(); + myYmax = aPoint.y(); + if(myCurrentTID == McCadTool_NoID) + { + theContext->Select(myXmin, myYmin, myXmax, myYmax, View()); + emit SigSelectionChanged(); + } + + myRubberBand->hide(); + } + } + + Execute(); + + mySelectionMode = Standard_False; + myRectangleMode = Standard_False; + myCurrentTID = McCadTool_NoID; + myLMBpushed = Standard_False; + myMMBpushed = Standard_False; +} + + +Standard_Boolean QMcCad_View::ConvertToPlane(const Standard_Integer Xs, const Standard_Integer Ys, Standard_Real& X, Standard_Real& Y, Standard_Real& Z) +{ + Standard_Real Xv(0.), Yv(0.), Zv(0.); + Standard_Real Vx(0.), Vy(0.), Vz(0.); + gp_Pln aPlane(myView->Viewer()->PrivilegedPlane()); + //myView->Viewer()->DisplayPrivilegedPlane(Standard_True, 100); + + //Standard_Real A,B,C,D; + //(myView->ActivePlane())->Plane(A,B,C,D); + //cout << A << " " << B << " " << C << " " << D << endl; + + // The + 1 overcomes a fault in OCC, in "OpenGl_togl_unproject_raster.c", + // which transforms the Y axis ordinate. The function uses the height of the + // window, not the Y maximum which is (height - 1). + myView->Convert( Xs, Ys + 1, Xv, Yv, Zv ); + + X = Xv; Y = Yv; Z = Zv; + + return Standard_True; + + myView->Proj( Vx, Vy, Vz ); +// cout << "PROJ : " << Vx << " " << Vy << " " << Vz << endl; + gp_Lin aLine(gp_Pnt(Xv, Yv, Zv), gp_Dir(Vx, Vy, Vz)); + IntAna_IntConicQuad theIntersection( aLine, aPlane, Precision::Angular() ); + if (theIntersection.IsDone()) + { + if (!theIntersection.IsParallel()) + { + if (theIntersection.NbPoints() > 0) + { + gp_Pnt theSolution(theIntersection.Point(1)); + X = theSolution.X(); + Y = theSolution.Y(); + Z = theSolution.Z(); + + return Standard_True; + } + } + } + + return Standard_False; +} + + +void QMcCad_View::mouseMoveEvent(QMouseEvent* e) +{ + QPoint aPoint = e->pos(); + Standard_Integer x,y; + + MouseMoveEvent(*e); + + //Hilight object under the cursor + x=aPoint.x(); + y=aPoint.y(); + + if(myCurrentTID != McCadTool_Rotate && !myMMBpushed) + { + myViewer->GetContext()->MoveTo(x, y, myView); + + // visualize cursor position on plane + Standard_Real theX, theY, theZ; + ConvertToPlane( x, y, theX, theY, theZ ); + + + //myView->ConvertToGrid( x, y, theX , theY , theZ ); + //cout << theX << " " << theY << " " << theZ << endl; + Standard_Real projX, projY, projZ; + myView->Proj(projX, projY, projZ); + if( (projX == 0 && projY == 0) || + (projX == 0 && projZ == 0) || + (projY == 0 && projZ == 0) ) // projection + { + QString aString; + TCollection_AsciiString numStr; + if(projX != 0) + numStr = "0"; + else + numStr = theX; + aString.append(numStr.ToCString()); + aString.append(" , "); + if(projY != 0) + numStr = "0"; + else + numStr = theY; + aString.append(numStr.ToCString()); + aString.append(" , "); + if(projZ != 0) + numStr = "0"; + else + numStr = theZ; + aString.append(numStr.ToCString()); + QMcCad_Application::GetAppMainWin()->statusBar()->showMessage(aString); + } + else + QMcCad_Application::GetAppMainWin()->statusBar()->showMessage("Ready"); + } + + //handle mouse clicks + if(myMMBpushed) + View()->Rotation(x, y); + + if(myLMBpushed) + { + if(myControlDown) + { + myCurrentTID = McCadTool_Pan; + mySelectionMode = false; + } + + switch(myCurrentTID) + { + case McCadTool_Rotate: + View()->Rotation(x, y); + break; + case McCadTool_Pan: + View()->Pan(x - myXmax, myYmax - y ); + myXmax = x; + myYmax = y; + break; + default: + myRubberBand->setGeometry(QRect(QPoint(myXmin, myYmin), e->pos()).normalized()); + Redraw(); + myRectangleMode = Standard_True; + break; + } + } +} + + +void QMcCad_View::LeaveEvent(QEvent*) +{ + MouseLeaveEvent() ; +} + + +void QMcCad_View::EnterEvent(QEvent*) +{ + MouseEnterEvent() ; +} + + +void QMcCad_View::FocusInEvent(QFocusEvent*) +{ +} + + +void QMcCad_View::FocusOutEvent(QFocusEvent*) +{ +} + + +void QMcCad_View::wheelEvent(QWheelEvent* e) //ZOOM +{ + int numSteps = e->delta(); + + if(numSteps > 0) + myAcM->SlotZoomIn(); + else if(numSteps < 0) + myAcM->SlotZoomOut(); +} + + +void QMcCad_View::keyPressEvent(QKeyEvent* e) +{ + if(e->key() == Qt::Key_Control) + myControlDown = Standard_True; + + if(e->key() == Qt::Key_Delete) + { + Handle(AIS_InteractiveContext) theContext = myViewer->GetContext(); + if(theContext->NbCurrents() > 0) + emit viewModified(); + myAcM->SlotErase(); + } + if(e->key() == Qt::Key_Shift) + myShiftSelect = Standard_True; + else + e->ignore(); +} + + +void QMcCad_View::keyReleaseEvent(QKeyEvent* e) +{ + if(e->key()==Qt::Key_Control) + myControlDown = Standard_False; + if(e->key() == Qt::Key_Shift) + myShiftSelect = Standard_False; + else + e->ignore(); +} + +void QMcCad_View::ClippingPlaneDialog() +{ + QMcCad_ClippingPlaneDialog cpDial(this/*QMcCad_Application::GetAppMainWin()*/); + cpDial.SetInitialValues(myCPA, myCPB, myCPC, myCPD, myCPVisState); + cpDial.exec(); +} + +void QMcCad_View::SetClippingPlaneParameters(Standard_Real a, Standard_Real b, Standard_Real c, Standard_Real d, Standard_Boolean state) +{ + myCPA = a; + myCPB = b; + myCPC = c; + myCPD = d; + myCPVisState = state; +} diff --git a/src/MCCAD/QMcCad/QMcCad_Viewer.cpp b/src/MCCAD/QMcCad/QMcCad_Viewer.cpp new file mode 100644 index 0000000..7da68ed --- /dev/null +++ b/src/MCCAD/QMcCad/QMcCad_Viewer.cpp @@ -0,0 +1,116 @@ +#include + +//qiu #include +#include +#include +#include + +#include +#include + +//qiu #include +#include +#include + +QMcCad_Viewer::QMcCad_Viewer(QMcCad_Editor* theEditor) +{ + myEditor = theEditor; + myIsConfigured = false; + + Standard_ExtString aName, cName; + TCollection_ExtendedString a3DName("Visu3D"); + TCollection_ExtendedString collectorName("Collector"); + aName=a3DName.ToExtString(); + cName=collectorName.ToExtString(); + Standard_CString aDomain("McCad"); + myViewer = MakeCasViewer(getenv("DISPLAY"), aName, aDomain, 1000.0, V3d_XposYnegZpos, Standard_True, Standard_True); // McCadAEV_Viewer... + myCollector = MakeCasViewer(getenv("DISPLAY"), cName, aDomain, 1000.0, V3d_XposYnegZpos, Standard_True, Standard_True); + myViewer->Init(); + myViewer->SetDefaultLights(); + myViewer->SetLightOn(); + /*myViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Lines); + Standard_Real theW, theH; + cout << theW << " " << theH << endl; + myView->View()->Size(theW, theH); + myViewer->SetRectangularGridGraphicValues(theW + 200, theH + 200, 0);*/ +// myViewer->SetDefaultVisualization(V3d_WIREFRAME); + myContext = new AIS_InteractiveContext(myViewer, myCollector); + myContext->SetHilightColor(Quantity_NOC_HOTPINK); + //myContext->SelectionColor(Quantity_NOC_PURPLE); + myContext->SelectionColor(Quantity_NOC_YELLOW); + + //make output look a little more smooth + //no good performance for more complex models + //in a later version the user should be able to set resolution as high/low as is neccessary for the system in use + + myContext->SetDeviationAngle(myContext->DeviationAngle() / 4.5); + myContext->SetDeviationCoefficient(myContext->DeviationCoefficient() / 4.5); + // Lei lu 25.11.2013 + //myContext->CloseAllContexts(); + //myContext->OpenLocalContext(); + //myContext->ActivateStandardMode(TopAbs_FACE); + + //myContext->SetHLRDeviationCoefficient(myContext->HLRDeviationCoefficient() / 4.5); * + //myContext->SetHLRAngle(myContext->HLRAngle() / 4.5); +} + + +QMcCad_Viewer::~QMcCad_Viewer() +{ + // delete myViewer; + // delete myView; +} + + + +QMcCad_ActionMaster* QMcCad_Viewer::GetActionMaster() +{ + return myEditor->GetActionMaster(); +} + + +QMcCad_View* QMcCad_Viewer::GetView() +{ + return myView; +} + + +void QMcCad_Viewer::SetView(QMcCad_View* theView) +{ + myView = theView; +} + + +void QMcCad_Viewer::Update() +{ + +} + + +void QMcCad_Viewer::Reconfigure() +{ + Handle_McCadCom_CasDocument theDoc = myEditor->GetDocument(); + if (myView == NULL) + { + Mcout("No view found!!!"); + myIsConfigured = false; + } + else + { + theDoc->Attach(myView); + SetView(myView); + myIsConfigured = true; + } +} + + +QMcCad_Editor* QMcCad_Viewer::GetEditor() +{ + return myEditor; +} + + +void QMcCad_Viewer::Mcout(const QString & aMessage) +{ + myEditor->Mcout(aMessage); +} diff --git a/src/MCCAD/QMcCad/_qrc_qmccad.cpp_ b/src/MCCAD/QMcCad/_qrc_qmccad.cpp_ new file mode 100644 index 0000000..d40f3ea --- /dev/null +++ b/src/MCCAD/QMcCad/_qrc_qmccad.cpp_ @@ -0,0 +1,4131 @@ +/**************************************************************************** +** Resource object code +** +** Created: Tue Jan 20 14:13:01 2009 +** by: The Resource Compiler for Qt version 4.1.1 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include + +static const unsigned char qt_resource_data[] = { + // /home/grosse/Workarea/mccwb/src/QMcCad/images/mouse.png + 0x0,0x0,0x4,0xb, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, + 0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd0,0x9,0x1d,0x6,0x27,0x0,0xaf, + 0xc1,0x95,0x6b,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0, + 0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb, + 0x11,0x0,0x0,0xb,0x11,0x1,0x7f,0x64,0x5f,0x91,0x0,0x0,0x3,0x88,0x49,0x44, + 0x41,0x54,0x58,0xc3,0xed,0x96,0x49,0x4b,0x1b,0x71,0x18,0xc6,0xfd,0x24,0x7e,0xc, + 0x3f,0x80,0x9e,0x4,0x2f,0x92,0x83,0x58,0xa,0x6,0xf,0x1e,0x3c,0x58,0x82,0x7a, + 0x10,0x41,0xf,0x52,0x10,0x4,0x17,0xf0,0x24,0x7a,0x88,0x8,0x6e,0x7,0x15,0x83, + 0x88,0xb,0x11,0xd,0x2a,0x2a,0x6e,0x49,0xe3,0x9e,0x68,0x16,0xc5,0x2c,0x6a,0x62, + 0x4c,0x62,0xb6,0xa7,0xf3,0xbc,0x65,0xa6,0x41,0xec,0x92,0x54,0x6d,0xa1,0xe,0xbc, + 0x68,0x66,0x86,0xff,0xf3,0x7b,0xf7,0x29,0x28,0x78,0xbf,0xbe,0x5f,0x78,0xc6,0xde, + 0x5c,0xfc,0xaf,0x7a,0x5e,0xf0,0xdf,0x2,0xe4,0xa,0xf1,0x6a,0xb5,0xf2,0xab,0xc3, + 0xe4,0xf9,0xc2,0xc2,0x2,0xd2,0xe9,0xb4,0x66,0x83,0x83,0x83,0x2f,0xa,0xf2,0xa3, + 0xc3,0x44,0xd8,0x6a,0xb5,0xa2,0xa6,0xa6,0x46,0xec,0xf6,0xf6,0x16,0x89,0x44,0x42, + 0x3,0xe1,0xf3,0x57,0x1,0x29,0x29,0x29,0xc1,0xc9,0xc9,0x9,0x6e,0x6e,0x6e,0x10, + 0xa,0x85,0x70,0x7f,0x7f,0x8f,0x40,0x20,0xa0,0x81,0x64,0x32,0x19,0x9c,0x9e,0x9e, + 0x6a,0xbf,0xc7,0xc6,0xc6,0x5e,0x16,0xc4,0x60,0x30,0x88,0xa7,0xb4,0x78,0x3c,0x2e, + 0x96,0x4c,0x26,0x45,0x98,0x9e,0xab,0xc2,0x84,0xf2,0x7a,0xbd,0xd8,0xde,0xde,0x96, + 0x68,0x64,0xa5,0x26,0x7f,0x71,0xb3,0xd9,0xc,0xb7,0xdb,0xad,0x89,0x50,0x98,0xa2, + 0xd9,0xe2,0x4,0x4a,0x78,0x3c,0x88,0x2b,0xe9,0xb9,0xbb,0xbb,0xc3,0xe5,0xe5,0x25, + 0x2e,0x2e,0x2e,0x70,0x78,0x78,0x88,0xf9,0xf9,0xf9,0xbc,0x21,0x30,0x3b,0x3b,0x8b, + 0xeb,0xeb,0x6b,0x44,0xa3,0x51,0x2d,0xcf,0x2a,0x48,0x24,0x12,0x91,0xbf,0x3e,0x9f, + 0x4f,0x60,0x32,0x9f,0x3f,0x23,0x5d,0x57,0x87,0xc7,0xc7,0x47,0x49,0x91,0xdf,0xef, + 0x97,0x68,0x1c,0x1c,0x1c,0xe4,0xd,0x81,0x99,0x99,0x19,0x9c,0x9f,0x9f,0xcb,0x61, + 0xb1,0x58,0x4c,0x0,0xe8,0xad,0xa,0x42,0x6f,0xa3,0xc9,0x28,0x7c,0x51,0x1f,0xec, + 0x8b,0x8b,0xf0,0xad,0xad,0x21,0xb3,0xbf,0x8f,0x94,0x92,0xaa,0x40,0x20,0x82,0xbd, + 0x3d,0x9f,0x12,0x3d,0x6f,0xde,0x91,0x40,0x6b,0x6b,0xab,0x72,0xc8,0x1e,0x9c,0x4e, + 0xa7,0x78,0xfa,0xf0,0xf0,0xa0,0x15,0x1f,0xc5,0xe9,0xb9,0xd1,0x69,0x84,0xce,0xac, + 0x43,0x67,0x67,0x27,0xec,0x4a,0xba,0x32,0x4a,0xde,0x13,0xa1,0x8,0x3e,0x7e,0x70, + 0xc2,0xf0,0xc9,0x5,0x8f,0x3b,0x28,0x29,0xc9,0x7,0x2,0x75,0x4a,0x48,0x4d,0x26, + 0x13,0xec,0x76,0xbb,0x6,0xd1,0xd0,0xd0,0x80,0xab,0xab,0xab,0x6f,0x61,0x57,0x6c, + 0xc0,0x31,0x80,0x42,0x53,0x21,0xf4,0x16,0x3d,0xfc,0x31,0xbf,0xdc,0xa3,0xb8,0xcd, + 0x1a,0x95,0x7a,0x61,0xfa,0x8,0xed,0x72,0xb9,0xa4,0x85,0x73,0x81,0x40,0x59,0x59, + 0x99,0x40,0x4c,0x4c,0x4c,0x88,0x7,0x3b,0x3b,0x3b,0x2,0x40,0xef,0xd5,0x54,0x50, + 0xb0,0xed,0x4b,0x1b,0x9c,0x11,0x27,0xc2,0xe1,0xa4,0x26,0xae,0x2,0x12,0x22,0x1c, + 0xe,0x4b,0x14,0x8e,0x8e,0x8e,0xb0,0xba,0xba,0x9a,0x1b,0x44,0x45,0x45,0x5,0xea, + 0xeb,0xeb,0xa5,0x1e,0x7a,0x7a,0x7a,0x70,0x7c,0x7c,0x2c,0xde,0xd0,0x2b,0x15,0x82, + 0xc2,0x14,0x7d,0x2a,0xae,0x76,0xa,0xeb,0x87,0xef,0x3b,0x1c,0xe,0x89,0xe6,0xa2, + 0x52,0x2f,0xbf,0xd,0x50,0x5c,0x5c,0x8c,0xca,0xca,0x4a,0xf1,0x9c,0x0,0x5b,0x5b, + 0x5b,0x72,0xc8,0xd9,0xd9,0x99,0x6,0x11,0x89,0xa4,0x9e,0x15,0x7f,0x1a,0x5,0xb6, + 0x33,0x1d,0x58,0x5f,0x5f,0xcf,0x2d,0xa,0xa5,0xa5,0xa5,0xa8,0xae,0xae,0x46,0x53, + 0x53,0x13,0xfa,0xfb,0xfb,0x25,0x8c,0xcc,0x27,0x3b,0x24,0x18,0xc,0xa,0x44,0x2a, + 0x95,0x7a,0x56,0x5c,0x8d,0x2,0xdf,0x61,0xd,0x11,0x7c,0x77,0x77,0x57,0x5a,0x3c, + 0xa7,0x82,0xac,0xaa,0xaa,0x92,0x28,0x74,0x77,0x77,0x63,0x78,0x78,0x18,0x1b,0x1b, + 0x1b,0x52,0x17,0xf4,0x8a,0x35,0xc1,0xe,0x51,0xf7,0x42,0xb6,0x38,0x2f,0x35,0xa, + 0x7c,0x8f,0xd0,0x84,0xb7,0x58,0x2c,0xe8,0xea,0xea,0xca,0xd,0xa2,0xb6,0xb6,0x16, + 0xed,0xed,0xed,0xe8,0xeb,0xeb,0xc3,0xe8,0xe8,0xa8,0x14,0x25,0x3d,0xe2,0xc0,0xe1, + 0xc0,0x92,0xb9,0xa0,0x54,0xfd,0x53,0x10,0x5e,0xfc,0x4d,0x48,0x16,0x23,0x53,0xc8, + 0x71,0x3d,0x34,0x34,0x94,0xfb,0x6c,0x68,0x6e,0x6e,0x46,0x6f,0x6f,0x2f,0x8c,0x46, + 0x23,0xa6,0xa6,0xa6,0xb0,0xb4,0xb4,0x24,0x5e,0xd1,0x8,0xc2,0xa1,0xc5,0x49,0xa8, + 0xee,0x8b,0xec,0xb5,0xcd,0x7b,0x7c,0xce,0xc5,0x66,0xb3,0xd9,0xd0,0xd2,0xd2,0x92, + 0xdf,0x84,0x6c,0x6c,0x6c,0x14,0x88,0x91,0x91,0x11,0x4c,0x4e,0x4e,0xca,0xe2,0xa1, + 0x47,0x2c,0x30,0x8f,0xb2,0x13,0x98,0x6b,0x6e,0x4d,0x7a,0x2c,0x7b,0x42,0x89,0x8, + 0x61,0x38,0xa6,0x79,0x9f,0x51,0x60,0xf4,0x74,0x3a,0x5d,0xfe,0x7b,0x82,0x46,0x88, + 0xe9,0xe9,0x69,0x69,0xab,0x95,0x95,0x15,0x6c,0x6e,0x6e,0x8a,0x77,0x14,0xc8,0x5e, + 0xdd,0x6a,0x5a,0x68,0x6c,0xc9,0xf1,0xf1,0x71,0x69,0xed,0xa2,0xa2,0xa2,0x3f,0xdf, + 0x96,0xb4,0xb9,0xb9,0x39,0x69,0xad,0x7d,0x65,0xf,0x70,0xd8,0xb0,0x30,0x29,0x4e, + 0x63,0x5d,0xd0,0xd8,0x86,0x1c,0xeb,0x2c,0x62,0xbd,0x5e,0x2f,0x9d,0xf5,0xe2,0x9f, + 0x72,0xcb,0xcb,0xcb,0xb2,0x86,0xe9,0xbd,0x3a,0x82,0x99,0x6b,0xae,0x74,0x16,0x2d, + 0xc5,0xd9,0xca,0xe5,0xe5,0xe5,0xaf,0xf6,0x11,0x2c,0x7,0xf3,0xeb,0x88,0xe1,0xe6, + 0xca,0xe6,0xff,0x9c,0x1b,0x1c,0xe7,0x1d,0x1d,0x1d,0x6f,0xf6,0xf5,0x8d,0x9f,0xd8, + 0xfb,0xf5,0xef,0x5d,0x5f,0x1,0x7d,0x6f,0x24,0x3e,0xa1,0x41,0x41,0xeb,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/saveas.png + 0x0,0x0,0x4,0x7f, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0xf9,0x43,0xbb,0x7f,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1, + 0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0x1,0x14, + 0xc,0x3b,0x9,0x57,0x8a,0xa0,0xc7,0x0,0x0,0x3,0xff,0x49,0x44,0x41,0x54,0x38, + 0xcb,0x95,0x95,0x7f,0x4c,0x94,0x75,0x1c,0xc7,0x5f,0xcf,0x73,0x77,0x78,0xc0,0x21, + 0xf1,0x6b,0x22,0x34,0xea,0x44,0xf1,0x47,0x6d,0x29,0x5b,0xb3,0x62,0x88,0xcc,0x6c, + 0xa5,0x5c,0xfe,0xaa,0xf9,0x6b,0xa4,0xab,0xdc,0x54,0x4a,0xac,0x15,0xd,0x75,0x65, + 0x83,0xc9,0xcc,0xa2,0xf9,0xb3,0xb2,0x72,0x41,0x96,0xe2,0xd4,0x21,0xc2,0xc8,0x8d, + 0x26,0xd4,0xa0,0xe4,0x8f,0x12,0x8e,0x43,0x11,0xa3,0x3b,0xb8,0x10,0x38,0x7e,0x1c, + 0xc7,0x71,0x70,0xc7,0x73,0x7c,0xfb,0x43,0x40,0x12,0x4e,0xe9,0xbd,0x7d,0xf6,0xec, + 0xd9,0xbe,0x9f,0xd7,0x5e,0xcf,0xf7,0xf3,0x6c,0x1f,0x49,0x8,0x1,0x80,0x24,0x49, + 0x32,0xa0,0x1a,0x57,0xd2,0x48,0xf9,0x4c,0x7d,0xe5,0x9f,0x89,0x1a,0x21,0x61,0x6d, + 0xb7,0x9a,0x93,0xd7,0xa5,0x58,0x0,0xef,0x68,0xc9,0xa3,0x50,0x83,0xc1,0xb0,0x21, + 0x22,0x22,0xc2,0x6,0xc,0x0,0x4e,0xa0,0xf,0x70,0xf8,0xaa,0x1d,0xbb,0xb6,0x39, + 0xa2,0xd4,0x3,0x25,0xbd,0x85,0xdf,0x97,0x44,0x59,0xac,0xa6,0xad,0x1b,0xd7,0xdb, + 0x80,0x2d,0x80,0xe,0xd0,0x48,0x42,0x8,0x24,0x49,0xd2,0xa4,0xa4,0xa4,0x5c,0x8d, + 0x5f,0xe5,0x48,0x8,0x9c,0xd1,0x49,0x86,0xc1,0xf4,0x20,0x51,0x14,0xef,0x30,0x96, + 0x9b,0x57,0xb0,0x57,0x9f,0xa7,0xbb,0xbc,0x9,0x6e,0x3a,0xb1,0xe9,0x1f,0xc3,0x1c, + 0x1b,0xd7,0xb6,0xf7,0x40,0x4e,0x12,0x60,0x53,0x8f,0x9c,0x55,0xb9,0x5c,0xae,0x84, + 0xc0,0x19,0x9d,0x5c,0x3a,0x75,0x8b,0xc,0x3,0x64,0x66,0x66,0xfa,0x4,0x67,0xef, + 0xd9,0x8e,0xea,0xce,0x45,0xbc,0xaa,0x76,0xa,0x6b,0x9a,0x78,0xda,0xee,0x20,0xd0, + 0xee,0x60,0x79,0x5c,0x42,0xe4,0xb5,0x97,0x52,0xe6,0x16,0x95,0x16,0xf7,0x8f,0x81, + 0xdd,0x6e,0x37,0xde,0x61,0x37,0x42,0x28,0x0,0xe4,0xe4,0xe4,0x4c,0x4e,0x15,0x1e, + 0x5a,0xab,0xd6,0x20,0x94,0x56,0xe,0x1e,0xad,0xa7,0xae,0x49,0xc7,0x23,0x61,0x83, + 0x44,0xf7,0x35,0x53,0x52,0x78,0x96,0x22,0x63,0xb5,0x7,0x98,0x36,0xa,0x1e,0x1b, + 0x52,0xd2,0xc6,0xbb,0xcf,0xc9,0x8c,0x83,0x74,0xfe,0x24,0x3c,0xd5,0x4a,0x64,0x98, + 0x8b,0x83,0x47,0x8c,0xdc,0x34,0xcb,0xc,0xfb,0xd9,0x59,0xb9,0x73,0x21,0x1d,0xba, + 0x50,0xf2,0x76,0x96,0x1,0xa8,0x1,0xd5,0x4,0xf0,0x68,0xee,0x37,0x16,0xca,0x30, + 0x9d,0xa6,0xd3,0x74,0x78,0xae,0x93,0xfb,0x95,0x85,0x5f,0x6b,0x63,0x19,0x70,0xff, + 0xc5,0xfe,0xbd,0x31,0xd8,0xe7,0xc8,0x94,0xfe,0x5d,0x36,0x7a,0x54,0x6,0x24,0xb5, + 0xaf,0x7b,0x1c,0x6f,0x9c,0x9d,0x95,0x85,0xb5,0x36,0x1f,0x59,0x54,0x50,0x5c,0xdc, + 0x48,0x55,0xf9,0x0,0xfd,0xf6,0x56,0x32,0xdf,0x89,0x26,0x69,0x69,0xa,0xf9,0x96, + 0x53,0x13,0xfa,0x7d,0x82,0xc7,0x1b,0x1b,0x6b,0xce,0x11,0xa6,0xb2,0x50,0xf9,0x4b, + 0x3f,0x3f,0x9e,0x6d,0xc5,0xd9,0xeb,0x20,0x6d,0x7d,0x8,0x89,0x8b,0x9f,0xe3,0xf1, + 0xf8,0x4f,0x50,0xcc,0xc7,0x26,0xf4,0xcb,0x3c,0x24,0xbd,0xdd,0x37,0x8,0xb,0x30, + 0x51,0x6f,0x6d,0xe3,0xb3,0x93,0x46,0x94,0x9e,0xe9,0x18,0x12,0xfc,0x58,0xfd,0xea, + 0x5c,0x66,0x3d,0x7b,0x0,0x8d,0xc6,0x7f,0xd2,0xbe,0x49,0x8d,0x33,0xb,0xee,0x5d, + 0xf9,0xf6,0x79,0x87,0x19,0xea,0x15,0xec,0xfb,0xb4,0x88,0x16,0xbb,0x87,0x15,0x7a, + 0xc1,0x6b,0x1b,0xe7,0x71,0xde,0x56,0xcb,0x60,0xd9,0x2c,0x9f,0x42,0x93,0x82,0x8b, + 0x3f,0xf,0xe3,0x76,0x4d,0x2f,0x69,0xaf,0xaf,0xc4,0x6f,0x76,0x34,0x1f,0x67,0x95, + 0xd2,0xde,0x34,0xc0,0xfc,0x18,0x17,0xbb,0xd2,0xe6,0xb3,0x6c,0x87,0x9,0x5b,0x8f, + 0x1b,0x80,0x98,0x5,0xb0,0xe9,0xc3,0x29,0x82,0x5b,0x1b,0x3d,0xe4,0x7d,0xfb,0x16, + 0x2f,0x24,0x2e,0xe1,0xfd,0xb4,0x13,0xfc,0x66,0x72,0x31,0x3b,0x44,0xe1,0xa3,0xb7, + 0x83,0xa9,0x68,0xe,0x67,0xf7,0x7b,0xeb,0xd1,0xeb,0xf5,0x7c,0x90,0xbd,0x89,0xe6, + 0xfa,0x29,0x1a,0xbb,0xda,0x82,0x38,0x9c,0xf3,0x6,0xc9,0x89,0xc9,0x64,0x65,0x1f, + 0xa7,0xda,0x58,0x47,0x48,0xf0,0x20,0xbb,0xd3,0xf4,0x38,0x95,0x21,0x6e,0xdf,0x59, + 0xc0,0xa2,0x85,0xd1,0xe8,0x74,0x3a,0x54,0x2a,0xdf,0xb3,0xf9,0xcf,0xf0,0x16,0xcc, + 0x5c,0xc9,0x9c,0x81,0x15,0xac,0x59,0xbd,0x84,0x2f,0x8e,0x9e,0xa6,0xa2,0xdc,0x88, + 0x4a,0xdd,0xcd,0xee,0x37,0x83,0x89,0x79,0x32,0x88,0x53,0xa5,0x6e,0x54,0xb2,0x1f, + 0x5a,0xad,0x16,0x8d,0x46,0xf3,0xc0,0xa1,0x8f,0x19,0xbf,0x9b,0x9e,0xce,0xf3,0x8f, + 0x46,0xe1,0xda,0x7c,0x8b,0xdc,0x6f,0x2e,0x71,0xe6,0x42,0x3,0x21,0xa2,0x9f,0x1d, + 0x5b,0x23,0x99,0xbf,0x28,0x96,0xdc,0x2f,0x6b,0xb8,0x7e,0xc3,0xc1,0xc2,0x27,0xc2, + 0x90,0x65,0x19,0x49,0x92,0x1e,0xe,0xce,0x3d,0x76,0x64,0xfa,0xda,0xb5,0xcf,0xd0, + 0x54,0x7d,0x99,0x9f,0xaf,0x56,0x72,0x21,0xff,0xa,0x92,0x2c,0xb1,0x6a,0x5d,0xc, + 0xf1,0x8b,0xb5,0x9c,0x2b,0x69,0xa3,0xbc,0xae,0xb,0x0,0xbd,0x5e,0x8f,0x56,0xab, + 0x45,0x96,0xef,0x7d,0xac,0x57,0x1,0xc5,0x33,0xf6,0x3a,0xc,0x8,0x35,0xc0,0x86, + 0xd4,0x57,0x36,0xbb,0x1c,0xff,0x10,0x3c,0x6d,0x26,0x1,0x4a,0x38,0xfe,0xb2,0x9d, + 0x84,0x65,0x1,0x2c,0x7d,0x31,0x8a,0xc2,0x8b,0x1d,0x14,0x54,0x98,0x51,0xee,0xfe, + 0x4,0x64,0xec,0xdf,0x34,0xc1,0xae,0xcb,0xa,0x66,0x23,0x0,0xd,0x80,0x2,0x78, + 0x25,0x21,0x4,0x4e,0x8f,0x3b,0xdf,0x6e,0xae,0x4a,0xb5,0x37,0xd6,0xd2,0xd7,0xd5, + 0x42,0x83,0xed,0x27,0xe2,0x16,0x6b,0x38,0x93,0xd7,0xcd,0xd7,0xdf,0xdd,0xc1,0xad, + 0xc,0x31,0x85,0x34,0x0,0xc5,0xc0,0x45,0xc0,0xa2,0x6,0xf0,0x38,0xbd,0x97,0x2a, + 0xab,0xae,0xa5,0x86,0x7,0x58,0x10,0xf4,0xa0,0x26,0xc6,0x79,0xe2,0x50,0x43,0xf9, + 0xf,0x45,0xcd,0x27,0x99,0x5a,0x86,0x47,0x4c,0xfb,0x80,0x4e,0xc0,0xa5,0x6,0xb0, + 0xb6,0xfc,0xde,0x9d,0x95,0x73,0xc8,0xb2,0xf6,0xe5,0xe5,0xfb,0xc2,0x43,0x43,0x7, + 0xd3,0xf7,0x14,0xfc,0x31,0x6e,0xef,0x4d,0x25,0x62,0x64,0xd7,0xb9,0x1,0x17,0xe0, + 0x92,0x84,0x10,0x94,0x5e,0x3e,0x2c,0x75,0xf5,0x4,0x46,0xa6,0x6e,0xd9,0xd6,0xf9, + 0x7f,0x96,0xe9,0x7d,0x60,0x31,0x7e,0x99,0xfe,0xb,0x33,0xdb,0xa5,0x23,0x1c,0x72, + 0x88,0xd0,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/close.png + 0x0,0x0,0x1,0x3d, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x4,0x0,0x0,0x0,0x6e,0xbd,0xa4,0xb0, + 0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0xbd,0x1f,0x5d,0xec,0x3,0x0,0x0, + 0x0,0x71,0x49,0x44,0x41,0x54,0x78,0xda,0x63,0x60,0x18,0x5,0x64,0x2,0x46,0x38, + 0xeb,0x3f,0x86,0x8,0x6,0x60,0x42,0x30,0xef,0xc0,0x34,0xa1,0x42,0xec,0x26,0xff, + 0x67,0x60,0x84,0x69,0x60,0x78,0x2,0xa5,0x1d,0x50,0x6c,0x42,0x32,0xf9,0x2e,0x9c, + 0xf5,0x84,0x41,0x86,0x90,0x33,0x94,0x91,0x4c,0x84,0xd0,0x7,0x70,0x2b,0xbe,0xcb, + 0xc0,0xc0,0x20,0x83,0x64,0xee,0x1,0x6,0x7,0xdc,0x8a,0x11,0xe0,0x9,0x54,0xe9, + 0x1,0x42,0x8a,0x61,0xe6,0x3a,0x10,0x67,0xf2,0x13,0xa8,0x6b,0x31,0x4d,0x66,0x41, + 0x30,0x97,0x40,0x31,0x3,0x56,0xcf,0xa1,0x85,0x33,0x3,0x76,0x80,0x27,0x46,0x87, + 0x2,0x0,0x0,0xc,0x88,0x1f,0xfb,0xc0,0x1c,0xa4,0x91,0x0,0x0,0x0,0x43,0x74, + 0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x0,0x40,0x28,0x23,0x29, + 0x49,0x6d,0x61,0x67,0x65,0x4d,0x61,0x67,0x69,0x63,0x6b,0x20,0x34,0x2e,0x32,0x2e, + 0x38,0x20,0x39,0x39,0x2f,0x30,0x38,0x2f,0x30,0x31,0x20,0x63,0x72,0x69,0x73,0x74, + 0x79,0x40,0x6d,0x79,0x73,0x74,0x69,0x63,0x2e,0x65,0x73,0x2e,0x64,0x75,0x70,0x6f, + 0x6e,0x74,0x2e,0x63,0x6f,0x6d,0x91,0xba,0x21,0xb8,0x0,0x0,0x0,0x2a,0x74,0x45, + 0x58,0x74,0x53,0x69,0x67,0x6e,0x61,0x74,0x75,0x72,0x65,0x0,0x33,0x34,0x32,0x64, + 0x31,0x32,0x35,0x66,0x30,0x65,0x37,0x63,0x34,0x65,0x31,0x31,0x35,0x31,0x30,0x64, + 0x64,0x39,0x31,0x30,0x63,0x31,0x30,0x63,0x35,0x30,0x37,0x62,0xa5,0xcd,0xbb,0x8e, + 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/wireframe.png + 0x0,0x0,0x1,0x99, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x60,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0x51,0xe,0xc3,0x20, + 0x8,0x86,0xb1,0xd9,0x65,0xe4,0x40,0x3d,0x4f,0xcf,0xd3,0x53,0xf4,0x14,0x7a,0x9b, + 0xb2,0x87,0x85,0x96,0xda,0x2a,0x60,0x9b,0xf5,0x4f,0x96,0xb8,0x45,0xe4,0x13,0x1, + 0x5d,0x20,0x22,0x82,0x17,0xf5,0x1,0x0,0xc8,0x39,0xbb,0x8c,0x10,0xe7,0xc3,0xf7, + 0x94,0xc6,0x2e,0xe7,0x88,0x8,0x83,0xdf,0x68,0x36,0xfd,0xa6,0x69,0x59,0x16,0x0, + 0x0,0x1f,0x0,0x3b,0x92,0x3b,0xe6,0x71,0xf,0x84,0xb,0xe0,0xca,0xf9,0x13,0x10, + 0x26,0x80,0x96,0xf3,0xbb,0x10,0x2a,0x80,0xc5,0xf9,0x1d,0x88,0x8f,0x75,0x51,0x0, + 0x80,0x18,0x71,0x1b,0xef,0xc5,0x3b,0x15,0xf3,0x93,0xd9,0xb9,0x9,0x40,0x3a,0xcd, + 0x79,0x5f,0xbc,0x16,0x99,0xda,0xfc,0x2e,0x80,0x18,0xd1,0xb4,0x88,0x94,0x9c,0x6f, + 0xb1,0xaf,0xe6,0x40,0x8f,0xf3,0x2b,0x18,0x19,0x11,0x17,0x0,0x43,0xdc,0x91,0xc5, + 0xbe,0x79,0x4,0xe5,0xe,0x2c,0x11,0x29,0xe7,0x6b,0x10,0x6a,0x12,0x96,0x67,0xca, + 0xaa,0x55,0x81,0xf7,0xd8,0x54,0x80,0xda,0xe2,0x9e,0xfe,0xd0,0x92,0xfb,0x32,0xb2, + 0x6a,0x5d,0xd7,0x77,0x1,0x86,0xc1,0xb6,0x74,0x17,0x80,0x6c,0xb5,0xbd,0xb7,0x60, + 0x37,0xc0,0x53,0xef,0x1,0x96,0x39,0x9,0xb9,0x2,0xea,0xf,0xb8,0x69,0x1b,0x79, + 0x2a,0xe1,0x4,0xc0,0xbb,0x21,0x3a,0x96,0x5d,0x8,0xbb,0x83,0x32,0xf3,0x65,0x4, + 0x52,0x1a,0x5d,0xd,0x4c,0x6d,0x44,0x57,0xe,0x4a,0xa5,0x34,0x6e,0x73,0x10,0xe7, + 0xc3,0x8d,0x18,0x23,0x36,0x4b,0xb6,0xa,0x20,0xbb,0x18,0xd1,0x2f,0x2,0xda,0x83, + 0x84,0x1d,0x9d,0xbb,0x67,0x3d,0x47,0x9a,0x11,0x90,0x61,0x27,0x9a,0xa0,0xec,0x7a, + 0xa5,0x38,0x3f,0xd8,0xce,0xd2,0xa4,0xaa,0x0,0x65,0xd8,0x73,0xf6,0x74,0x3c,0x79, + 0x1c,0x6d,0x3b,0xb5,0xc,0x7b,0x5a,0xad,0xb4,0xd1,0x4a,0xd4,0xf4,0x26,0xe4,0x4f, + 0x2f,0x44,0x4b,0xae,0xcb,0xc8,0x22,0x2f,0xe8,0x9,0xe0,0xee,0xed,0xe6,0xd5,0xe3, + 0x11,0xf0,0x6e,0x60,0x3,0xe0,0xff,0x6a,0xff,0x56,0x20,0x22,0xa,0x21,0xbc,0xe2, + 0x1c,0x0,0xe0,0xb,0x19,0xd2,0xb6,0xa5,0x5,0x41,0xe3,0x57,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/leftview.png + 0x0,0x0,0x1,0x9a, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x61,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xe1,0x11,0x83,0x20, + 0xc,0x85,0x1f,0x9e,0xcb,0x98,0x81,0x1c,0xc2,0x29,0x9c,0xc7,0x29,0x98,0x2,0xb6, + 0x31,0xfd,0xd1,0x8b,0x45,0x5,0x12,0xa8,0xd7,0xbe,0xbb,0x5e,0x2d,0x35,0xbc,0xf, + 0x49,0x0,0x1d,0x33,0x33,0xfe,0xa8,0x11,0x0,0x62,0x8c,0x4d,0x41,0x44,0xdb,0xe9, + 0x77,0x8,0x73,0x97,0x39,0x11,0x61,0x68,0xf,0xda,0x4c,0x6d,0x9a,0xbc,0xf7,0x0, + 0xd0,0x6,0x20,0x46,0xe9,0x88,0xe5,0xba,0x7,0xa2,0x9,0x20,0x67,0xfe,0x4,0x84, + 0x9,0xa0,0x66,0xfe,0x2d,0x84,0xa,0x60,0x31,0xbf,0x43,0x2c,0x66,0x80,0xd1,0xda, + 0xa9,0x55,0xef,0xfb,0xed,0x31,0x2a,0x80,0x88,0x36,0x3a,0x37,0xac,0xd2,0xbe,0x9a, + 0xcd,0xc2,0x1c,0xfa,0x0,0xc4,0x3c,0xed,0xa0,0x65,0x6a,0x6e,0xf0,0x89,0xf4,0x1c, + 0xd8,0x28,0x4b,0x6e,0x95,0x16,0x5f,0x7d,0x2,0x42,0x7e,0xfd,0x6,0x60,0x9e,0x2, + 0xd,0xfe,0x6,0x30,0x11,0x21,0x86,0x4f,0x90,0x74,0x70,0x1d,0x89,0x65,0xa,0x6a, + 0x8f,0x5e,0x74,0x9b,0x82,0x18,0x2,0x26,0xd2,0x3,0x9f,0x52,0x36,0x7,0x7e,0x9, + 0x31,0x2,0x28,0x9a,0xf1,0xa,0xc4,0xbe,0x8d,0xe,0xfb,0xbe,0xdb,0x1,0xd2,0x39, + 0x17,0x4d,0x44,0x70,0x2b,0xd0,0x9b,0xff,0xc3,0x60,0xdb,0x66,0xb2,0x55,0x70,0x24, + 0xe2,0x25,0x89,0x7a,0xaa,0x40,0x4b,0x44,0xb5,0xa,0xa4,0x93,0xa3,0x1a,0xa,0x9b, + 0x4d,0xae,0x1a,0x24,0xae,0xb6,0x16,0x64,0xab,0xc0,0x62,0x1e,0xc2,0x7c,0x32,0x2d, + 0x81,0x69,0xb,0x91,0x63,0x66,0x4e,0x8f,0x64,0x69,0x7d,0x5b,0xea,0x58,0x53,0xc9, + 0xdc,0x7b,0x8f,0x65,0x59,0xea,0x2b,0x61,0x69,0xe4,0x39,0xd5,0xee,0xa9,0x2d,0x5a, + 0xe6,0xf3,0x40,0xcd,0xfc,0xfa,0x5f,0xcb,0xa1,0xa4,0xa,0x60,0x35,0xff,0x6,0xa2, + 0x8,0xd0,0x6a,0xde,0xb,0xa1,0x4e,0x41,0xcf,0x99,0xbf,0x5,0xc2,0x94,0x3,0xf2, + 0xe9,0x85,0xa8,0xc9,0x7c,0x24,0xb3,0xaa,0x15,0xf4,0x6,0xd0,0xfb,0x9a,0xd5,0xab, + 0xc7,0x9f,0x40,0xeb,0x0,0xe,0x0,0x79,0x57,0xfb,0xb5,0x1c,0x33,0xb3,0x73,0xee, + 0x2f,0xe6,0x0,0xf0,0x2,0xad,0xda,0xc7,0x3a,0x2e,0x77,0xf3,0x70,0x0,0x0,0x0, + 0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/open.png + 0x0,0x0,0x5,0x2b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x4,0xbd,0x49,0x44,0x41,0x54,0x48,0xc7,0x95, + 0x95,0x6b,0x6c,0x53,0x65,0x18,0xc7,0x7f,0x6f,0xdb,0xdd,0x5b,0x56,0x16,0x58,0x58, + 0x77,0x61,0xb0,0x8d,0x5d,0x3b,0xc6,0x3a,0xa,0x13,0x86,0x83,0x5d,0x2,0xc2,0xc6, + 0x17,0x22,0xa8,0x31,0x18,0x13,0x9c,0x8,0x7e,0x32,0x12,0x21,0x31,0x1a,0xe3,0x96, + 0xc5,0x80,0x91,0x88,0x9b,0x23,0x40,0x34,0x44,0x14,0x51,0x37,0x60,0x3,0xbb,0x19, + 0xe5,0xba,0x65,0xc,0xd8,0x40,0xb9,0xc,0x36,0x1,0x45,0xd8,0xa,0x3,0xd9,0xb2, + 0x5b,0xfb,0xbe,0xad,0x1f,0x76,0x5a,0xeb,0xc2,0x17,0x4f,0xf2,0xff,0x70,0x72,0x4e, + 0x7e,0xff,0xe7,0xf9,0x9f,0xf3,0x3e,0x8f,0xf0,0x7a,0xbd,0x4,0x5e,0x42,0x8,0x1d, + 0xa0,0x9f,0x24,0xa1,0x3d,0x56,0x1,0xf2,0x68,0xf2,0x2,0x78,0x27,0x81,0x44,0xe0, + 0xbd,0x10,0x42,0x0,0x4e,0xa0,0x1,0xf8,0x0,0x68,0x7,0x62,0x80,0x13,0xc0,0x46, + 0xe0,0x9,0xe0,0xd6,0x24,0x3,0xe0,0x3e,0x3,0xbf,0x44,0x40,0x35,0x2,0xb8,0xba, + 0x7f,0xff,0xfe,0xd4,0xae,0xae,0x2e,0x9a,0x8e,0x37,0x79,0xb7,0x6e,0xdb,0x2a,0x6c, + 0x39,0x36,0xde,0x78,0xeb,0x75,0xf7,0x29,0xc7,0x99,0x21,0x60,0x17,0xf0,0x15,0x30, + 0xf2,0x14,0xf8,0x7f,0xba,0x11,0x80,0x1,0xd0,0x69,0xe0,0xb1,0xc3,0xd,0xd,0x58, + 0x62,0x63,0x71,0xb9,0x5c,0xd4,0xd6,0xd6,0x62,0x36,0x9b,0x9,0x8b,0x8,0x63,0x56, + 0x5a,0x22,0x8e,0x16,0x7,0x87,0xf,0x1c,0xb9,0xb,0x9c,0xd3,0x3a,0xaa,0x1,0x42, + 0x81,0x57,0x81,0xfe,0x80,0x6e,0xdc,0x2,0x8,0x3,0xec,0x40,0x37,0x70,0x7f,0x4f, + 0x5d,0x1d,0xf1,0xf1,0xf1,0x4c,0x31,0x9b,0x9,0xa,0xe,0xa6,0xa7,0xa7,0x87,0xce, + 0xce,0x4e,0x7a,0x7b,0x7b,0x29,0x5d,0x51,0xca,0xb8,0x18,0xa7,0xea,0xbd,0x2a,0x96, + 0x3d,0x57,0xe8,0x2e,0x2d,0x5e,0x1e,0xd4,0xd9,0x75,0x91,0x4f,0x2a,0x77,0x8e,0x0, + 0x5d,0xc0,0x76,0x2d,0xbe,0x31,0x1,0xec,0x5,0xd6,0x3,0xbf,0x3,0x29,0x6f,0x6f, + 0xde,0x4c,0x88,0x5e,0x4f,0x72,0x5a,0x1a,0x96,0xc4,0x44,0x4c,0x91,0x91,0x18,0x82, + 0x82,0x18,0x78,0x34,0x40,0x7d,0x7d,0x3d,0x4e,0xa7,0x13,0x7b,0x81,0x9d,0x5,0xb, + 0xed,0x4c,0x33,0x4f,0x67,0x74,0x7c,0x4,0xe7,0x3,0x27,0x75,0xbb,0xeb,0x68,0x3c, + 0xd4,0xa4,0x80,0x4a,0x60,0x8f,0x0,0xbc,0x47,0xda,0x1a,0x38,0x77,0xb6,0x83,0xbd, + 0x3b,0xf7,0x91,0x36,0x33,0x69,0xfc,0x7e,0x77,0x77,0xb0,0xd5,0x6a,0x15,0x99,0x39, + 0x39,0x24,0x65,0x64,0x10,0x93,0x90,0x80,0xd1,0x64,0xf2,0x1b,0x1c,0xfc,0xf6,0x20, + 0xe3,0x9e,0x71,0x66,0xc4,0xce,0xa0,0x7c,0x4d,0x39,0x3a,0x4,0x7a,0x8f,0x9e,0x2b, + 0x4f,0x7e,0x63,0x43,0x61,0x85,0xb,0xc8,0x11,0xc0,0x68,0x73,0x97,0x23,0xd4,0x12, + 0x1b,0x83,0xa3,0xb1,0x19,0xc7,0x91,0x66,0xee,0xdc,0xb8,0xe3,0x49,0x89,0xb6,0xe8, + 0x6e,0x5f,0xbf,0x4e,0x5a,0x5a,0x1a,0x56,0x9b,0x8d,0xa4,0x8c,0xc,0x66,0xc4,0xc5, + 0x11,0x61,0x32,0x61,0x30,0x18,0xb8,0xd9,0x73,0x93,0xb,0x97,0x2f,0xd0,0x79,0xe9, + 0x22,0x65,0xeb,0xca,0x48,0x4c,0x9a,0x49,0x42,0x7e,0x3c,0x36,0x9d,0x1d,0x20,0x4f, + 0x0,0xb9,0x15,0x5b,0x5e,0xeb,0x78,0x73,0xcb,0x66,0x1d,0x42,0x30,0x32,0x3c,0x42, + 0xdb,0x89,0x56,0x5a,0x4f,0xb5,0xf1,0xe0,0xfe,0x43,0x86,0xff,0x70,0x32,0x3c,0xf0, + 0x88,0x6c,0xab,0x95,0xcc,0xdc,0x5c,0x92,0xd2,0xd3,0x89,0xb6,0x58,0x88,0x30,0x1a, + 0xd1,0x1b,0xc,0xc,0xe,0xe,0x52,0xb3,0xb7,0x86,0x90,0xa8,0x60,0x36,0x56,0x55, + 0xb0,0xd8,0xf4,0x2c,0x40,0x81,0x0,0x12,0x80,0x7d,0x1f,0x7f,0xb9,0xa3,0xa8,0x78, + 0x45,0x11,0x4a,0x79,0x50,0x4a,0xa1,0xa4,0xe4,0x7c,0xeb,0x79,0x1a,0xbf,0x3f,0x86, + 0x31,0x24,0x8c,0xc7,0x77,0xfb,0xe8,0xbb,0x79,0x8b,0x2c,0xab,0x95,0x1c,0xbb,0x9d, + 0xd9,0xa9,0xa9,0x44,0x5b,0x2c,0x84,0x19,0x8d,0xe8,0xf5,0x7a,0xe,0x9d,0x38,0xc8, + 0xd2,0x75,0x85,0x2c,0x8f,0x5b,0x9,0xb0,0x4c,0x0,0xd1,0xc0,0xaa,0xe2,0xd5,0xc5, + 0x9f,0x57,0xef,0xaa,0xa,0x12,0x42,0x68,0x60,0x85,0x94,0x13,0x6,0x1d,0xed,0xe7, + 0x69,0x3b,0xd9,0x46,0xdf,0x9f,0x7d,0x8c,0xdd,0x1b,0xc0,0x3d,0x32,0x8a,0x2d,0x67, + 0x1e,0xf3,0xf2,0xf3,0xc9,0xb4,0xd9,0x88,0x9c,0x3a,0x95,0x6f,0x7e,0xfc,0x1a,0x7b, + 0x79,0x1e,0x6b,0xe7,0xbe,0x8,0x50,0x22,0x80,0xa9,0xc0,0x94,0xd0,0xf0,0xd0,0x96, + 0xaa,0xda,0xf,0x53,0x16,0x2f,0x2d,0x40,0x69,0x40,0xa5,0x14,0x52,0x4a,0xa4,0x5b, + 0xa1,0x94,0xe4,0x56,0xef,0x6d,0xea,0xf,0xd4,0x13,0x11,0x12,0xca,0xe0,0x5f,0x3, + 0xb8,0x86,0x86,0xd9,0xb0,0x69,0x13,0xa9,0xd9,0xd9,0x34,0xb4,0x34,0x30,0x7b,0xf1, + 0x2c,0x2a,0x8a,0x36,0x2,0x94,0xa,0xc0,0x8,0x44,0x0,0xb6,0x65,0xab,0x96,0x1e, + 0xad,0xfc,0xb4,0x52,0xa7,0xdc,0x12,0xa5,0x3c,0x48,0x25,0x51,0x1a,0xd4,0x7,0x57, + 0x4a,0x71,0xf5,0xf2,0x55,0xda,0x4e,0xb5,0x33,0xd0,0xff,0x90,0xac,0xc4,0x64,0xd6, + 0xbe,0xf0,0x32,0xa7,0x2f,0xb4,0x12,0x91,0x1c,0xc6,0x3b,0xeb,0xb6,0xf9,0xc1,0x21, + 0xda,0x21,0x31,0x1,0xc7,0x76,0x7c,0xb1,0x3d,0x2b,0x6f,0xe1,0x7c,0x94,0x74,0xfb, + 0xa3,0x50,0x52,0x69,0xd5,0x2b,0x7f,0xfe,0x52,0x2a,0x1e,0x3d,0x18,0xa0,0xab,0xfd, + 0x12,0xb6,0x64,0x2b,0x4f,0x5c,0xa3,0xc,0x99,0x6,0xa9,0xde,0xf4,0x91,0x1f,0x1c, + 0x4,0x4,0x3,0xe1,0xc0,0xb4,0xb8,0xc4,0xb8,0x46,0xdb,0x22,0x5b,0xe2,0xea,0xe7, + 0xcb,0x74,0x96,0x38,0xb,0x52,0x4e,0x54,0xaf,0xa4,0x44,0x2a,0xf,0x1e,0xb7,0xf4, + 0x77,0x22,0x95,0xe4,0xf4,0xc9,0x33,0x84,0xc,0xe9,0x98,0x93,0x91,0xc5,0x8d,0xa1, + 0x6e,0xea,0xde,0xdf,0xed,0x7,0xeb,0x34,0x78,0x88,0x6,0x37,0x1,0x5,0x51,0xd3, + 0xcd,0xd5,0x45,0xe5,0xc5,0xd3,0x6c,0xf6,0x5c,0x91,0x9a,0x9e,0x8a,0xf4,0x55,0xaa, + 0x7d,0x58,0x25,0x25,0xd2,0x2d,0xe9,0x77,0xf6,0x73,0xad,0xf3,0xa,0x39,0x73,0xf2, + 0xe8,0xb8,0x7d,0x8e,0x43,0x35,0xdf,0xf9,0xc1,0x42,0x9b,0xb9,0x86,0x80,0x58,0x7c, + 0xb9,0x6f,0x88,0xb6,0x44,0xaf,0xcc,0x9e,0x6f,0x4d,0x2c,0x5d,0x55,0x4a,0x6c,0xbc, + 0x5,0x29,0x3d,0x28,0xe5,0x46,0xba,0x27,0xf2,0x56,0x6e,0xc9,0xd1,0x86,0x26,0x4a, + 0xf2,0x4b,0x39,0x76,0xb6,0x89,0x9f,0x7f,0xf8,0x65,0x2,0xec,0xf5,0x7a,0x7d,0x73, + 0xd8,0x7,0xf,0xd6,0x26,0x56,0x98,0xd6,0x41,0x38,0x50,0x18,0x69,0x8e,0x7c,0x77, + 0x51,0xc9,0x33,0x53,0xac,0x36,0xab,0x48,0x4e,0x49,0xd2,0xf2,0x9f,0xf8,0x6b,0x46, + 0x86,0x87,0x79,0xec,0xfc,0x9b,0x66,0x87,0x83,0x4b,0x6d,0xbf,0xfe,0xb,0xe,0x18, + 0xf2,0xbe,0x8d,0xe1,0xcb,0x7d,0xb2,0xc9,0xfa,0xa8,0xe8,0xa8,0x35,0x73,0x32,0x53, + 0x62,0x96,0x94,0x2c,0x21,0x36,0xce,0x82,0x52,0xa,0xb7,0x5b,0xf2,0xd3,0xf1,0x16, + 0xae,0x75,0x5d,0xe3,0xee,0xad,0x7b,0x13,0x7,0xe4,0x29,0x1b,0x64,0xb2,0x81,0x2f, + 0x7f,0x9f,0x41,0x18,0xf0,0x4a,0xb8,0x31,0xfc,0xa5,0x9c,0x5,0x73,0xcd,0xe9,0xd6, + 0x34,0x91,0x92,0x9a,0x42,0x7f,0x7f,0x3f,0x9f,0x55,0xd7,0xe2,0x1a,0x73,0x4d,0x1c, + 0xe9,0xc9,0x3b,0x2f,0xc0,0x40,0xa7,0xc9,0xa0,0x69,0xb2,0x81,0x11,0x28,0xd3,0x86, + 0x7c,0xb4,0xf6,0xe,0xda,0xfa,0x2a,0x7a,0x2a,0xf8,0x7f,0x18,0xf8,0x14,0xac,0x75, + 0xe8,0x1,0x5c,0xc0,0xc8,0x3f,0xd8,0x60,0x2b,0x47,0x61,0x7b,0xa0,0xe6,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/redo.png + 0x0,0x0,0x0,0xe5, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x37,0x4,0x95,0x65,0x7e,0x42,0x0,0x0,0x0,0x72,0x49,0x44, + 0x41,0x54,0x78,0xda,0xed,0x93,0x41,0xb,0xc0,0x20,0x8,0x85,0xb5,0xdf,0x1d,0x3b, + 0xc8,0xfb,0xdf,0xee,0x30,0x82,0x65,0x29,0xe1,0xb6,0xc3,0xa0,0xf,0x3a,0x94,0xbd, + 0xa7,0xa1,0x11,0x6d,0x7e,0xb,0xdb,0x3,0x8,0xb4,0x1e,0xde,0xf5,0xca,0x49,0x63, + 0xe8,0x9a,0xcc,0x4b,0x0,0x6d,0x31,0x9e,0x57,0x1a,0x9,0xbd,0x4,0x2d,0x66,0x8c, + 0x6d,0x20,0xe6,0x9e,0xa0,0xf2,0xb8,0x27,0x2a,0xb9,0xd6,0xcc,0x2a,0xed,0x29,0xf9, + 0xbe,0xc7,0x2f,0x7b,0x60,0x1c,0x37,0xba,0x7c,0x61,0xda,0x19,0x43,0x56,0x45,0xab, + 0x23,0x39,0x88,0xae,0x5,0x49,0x19,0xf8,0x3f,0x6f,0x36,0x3a,0x9b,0xcd,0x3b,0x9c, + 0x59,0x6e,0x28,0xb1,0x52,0x2f,0x22,0x22,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/backview.png + 0x0,0x0,0x1,0xa9, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x70,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xeb,0x71,0xc3,0x20, + 0x10,0x84,0x17,0x4f,0x9a,0xf1,0x15,0xa4,0x22,0x54,0x5,0xf5,0xa8,0xa,0xaa,0x40, + 0xdd,0xe8,0xf2,0x23,0xc1,0x3,0x8,0xd0,0x1e,0x56,0xe2,0x9d,0xf1,0xd8,0x46,0x1c, + 0xfb,0xf1,0x38,0x40,0x4e,0x55,0x15,0x1f,0xd4,0x17,0x0,0xec,0xfb,0x6e,0xa,0x12, + 0xd9,0x8a,0xff,0x31,0x2e,0x53,0xe6,0x22,0x82,0x87,0x3d,0x68,0xa3,0xca,0x7a,0x7a, + 0x8a,0x0,0x0,0x42,0x8,0x0,0x60,0x3,0x48,0x46,0x79,0x8f,0xd3,0x6f,0x6,0xe2, + 0x29,0x82,0x3d,0xc6,0xa2,0x8c,0x6,0x68,0x99,0x5b,0x20,0x5a,0xe6,0x34,0xc0,0xc8, + 0x9c,0x81,0xe8,0x99,0x53,0x0,0x8c,0xf9,0x19,0x62,0xa5,0xcc,0x81,0xdf,0x2c,0x60, + 0x1a,0x1d,0x29,0x37,0xf9,0xa9,0xbf,0x50,0xe6,0x14,0x40,0x92,0x6c,0x52,0x16,0xf8, + 0x54,0xee,0xa1,0x8d,0xe7,0xea,0x1,0xe7,0x1,0x64,0xe5,0x71,0x39,0xc3,0x50,0x0, + 0xa9,0xf1,0xbc,0x81,0x62,0x6a,0xbc,0x14,0xcf,0x52,0xcf,0x63,0x15,0xdf,0xd2,0xf5, + 0x1a,0xd8,0xa4,0x49,0xde,0x53,0x3d,0xec,0x57,0xf1,0xc3,0x11,0x48,0xe4,0xf5,0x37, + 0x80,0xe6,0x14,0xb0,0xc3,0x4e,0x3,0xe4,0xd,0xd4,0x3d,0xa9,0xa7,0x40,0x3d,0x8a, + 0x61,0x3f,0x1,0xcf,0x2,0x58,0x94,0xb6,0xd9,0x97,0xfc,0x75,0xcc,0x2d,0x0,0xdd, + 0x54,0x23,0x46,0xc0,0x7c,0x18,0xb1,0x3a,0x8e,0x83,0xaa,0xf7,0x67,0x0,0x8f,0x7, + 0xd7,0xb4,0x69,0xa,0x7a,0x59,0x40,0xc7,0xcc,0x2,0xe4,0x19,0xd0,0x3b,0xf1,0x5a, + 0x5b,0x76,0x8a,0x1b,0xed,0x5,0xa6,0x8d,0x28,0x37,0x8f,0x71,0x29,0x4c,0x7b,0x60, + 0x57,0x1b,0x91,0x53,0x55,0xcd,0xaf,0x64,0x79,0x7e,0x33,0x79,0x7c,0xa5,0x9e,0x79, + 0x8,0x1,0xeb,0xba,0x8e,0xa7,0xa0,0xd7,0xf3,0x96,0x46,0x75,0x46,0x47,0x3a,0x7d, + 0x1f,0x18,0x99,0xd7,0xcf,0x2c,0x77,0xc4,0x21,0x0,0x6b,0xfe,0xe,0x44,0x17,0xc0, + 0x6a,0x3e,0xb,0x71,0x39,0x5,0x33,0x77,0x7e,0xb,0x4,0xb5,0x6,0xd2,0x67,0x16, + 0x62,0xa4,0x5b,0x4f,0x43,0xc0,0xb6,0x0,0x9b,0x0,0xb3,0xaf,0x59,0xb3,0xba,0x7d, + 0x4,0xac,0x1d,0x78,0x1,0xa4,0x77,0xb5,0xff,0x96,0x53,0x55,0x75,0xce,0x7d,0xc4, + 0x1c,0x0,0xbe,0x1,0x38,0x12,0xdc,0xda,0x44,0xd9,0x16,0x20,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/transparency.png + 0x0,0x0,0x5,0xd2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x5,0x99,0x49,0x44,0x41,0x54,0x68,0x81,0xed,0x59,0x5b,0x6e,0x24,0x3b, + 0x8,0xc5,0xd1,0x2c,0x8c,0x5a,0x59,0x57,0xaf,0xac,0xbc,0x33,0xdf,0xf,0x1b,0x73, + 0xe,0xe0,0x24,0xba,0xf,0x4d,0x74,0x35,0x48,0x51,0x57,0x57,0xdb,0xc0,0xe1,0x6d, + 0xa7,0x89,0xe8,0x90,0xff,0x1,0x7d,0xfc,0x6e,0x5,0xfe,0x2d,0xfa,0x3,0xe4,0xa7, + 0xd1,0x1f,0x20,0x3f,0x8d,0x7e,0xfd,0x93,0xcd,0x63,0x3c,0xd2,0xda,0x25,0x63,0x3c, + 0xe5,0xef,0xad,0x5d,0x7b,0x9d,0x88,0x48,0xbb,0x9a,0x48,0x57,0x5a,0xdf,0xda,0x1b, + 0x76,0xf4,0xbf,0xad,0x4b,0xfb,0x7e,0xf9,0x55,0x19,0xe3,0xb5,0x15,0x34,0x10,0xa8, + 0x28,0x31,0x6e,0xef,0xbd,0xbe,0x14,0xbc,0x40,0x21,0xdf,0xcc,0xe3,0xda,0xb2,0xbf, + 0x2,0x79,0x0,0x82,0x4a,0x4f,0x85,0x2a,0xc5,0xa6,0x35,0xa7,0x80,0xe8,0x1d,0xb6, + 0xb4,0x91,0x29,0x63,0x8a,0xe9,0xe6,0x3d,0x79,0x38,0x7f,0x7,0x1,0x1e,0x85,0x77, + 0x91,0x8a,0xd0,0x52,0xfa,0x66,0xcc,0x11,0x4c,0x25,0x4,0xc1,0xa0,0x82,0xa8,0x28, + 0xf3,0x57,0x11,0xbd,0xa5,0x35,0x97,0x83,0xeb,0xa2,0x41,0x26,0x2f,0x4,0xa4,0x12, + 0xbc,0xa4,0xc3,0xfe,0x4e,0x24,0x72,0xc3,0x9f,0xaf,0x15,0xb9,0xe9,0x33,0xed,0x51, + 0x59,0xeb,0x6f,0x5a,0x33,0xdf,0xdf,0xbc,0x76,0xf3,0xd2,0x92,0x5f,0x94,0x83,0x7a, + 0x8b,0xe8,0xf8,0x88,0x5e,0x70,0xb,0x5c,0xd2,0xda,0xbb,0x70,0xbb,0x2e,0xcb,0xbf, + 0xc3,0xfa,0xf7,0x8c,0xfb,0x4d,0x7d,0xe7,0x80,0x5b,0x7c,0x79,0xb2,0xdf,0xb4,0x97, + 0xc9,0xbd,0x19,0x65,0x6c,0x39,0xc5,0x3e,0xca,0x91,0x1c,0x8b,0xe6,0x3e,0xa5,0x4d, + 0x1e,0x6,0xbd,0xc8,0x89,0x9e,0xf8,0x20,0x70,0xcc,0x29,0x5b,0x13,0xab,0x58,0xce, + 0x4f,0xb,0xa5,0x48,0xbd,0x2,0xa2,0x7b,0x53,0x25,0x4,0x15,0x8f,0x5e,0xaa,0x94, + 0x89,0x6,0x48,0xb9,0xa2,0xf7,0xf6,0x4c,0x5a,0xa3,0xb7,0x8c,0x87,0x6b,0x50,0x36, + 0x1c,0x27,0x3e,0x34,0x44,0x43,0xa7,0xe0,0x3e,0xb6,0xc2,0x18,0xcf,0xa,0x9f,0xe, + 0xcc,0x6d,0xcf,0xb5,0xc3,0x51,0xf4,0x4e,0x7b,0x53,0xbf,0xe8,0xf7,0x5a,0x27,0xe4, + 0x1,0xe4,0x8d,0x7f,0x26,0x3f,0xf3,0x5a,0xfc,0xb9,0xfc,0x9a,0xf0,0x1e,0xc2,0x1, + 0xc1,0xea,0x16,0xce,0x55,0xc6,0xad,0x89,0xfd,0x81,0xc3,0xa2,0x27,0x39,0xfb,0x79, + 0x81,0x42,0x2f,0x31,0xc0,0x48,0x9d,0xbe,0xfd,0x8a,0x3f,0x4e,0x0,0x59,0xf9,0xa9, + 0x94,0xbf,0xa3,0x35,0x50,0x46,0x4d,0x11,0x7,0xaa,0xf4,0x3c,0xc3,0x66,0x19,0x49, + 0xbb,0x3f,0xf7,0x7b,0xca,0x32,0x2f,0x3d,0x63,0x35,0xcd,0x3b,0xf4,0x97,0xa,0xd4, + 0x31,0xd9,0xf3,0xd8,0x70,0xfe,0x4d,0x49,0x71,0xcc,0x33,0xcc,0x95,0xa8,0x4c,0xd5, + 0x8,0x29,0xf,0x17,0x8,0x36,0x4a,0xa4,0x5e,0x1,0xd1,0x24,0x34,0x87,0x85,0x86, + 0x10,0xba,0xcb,0x10,0x43,0x65,0x19,0xbc,0x87,0x6c,0x1e,0x77,0x72,0x81,0x70,0x10, + 0xde,0x64,0xd1,0x18,0x8,0x84,0xfa,0xc8,0x18,0x4f,0x50,0xcc,0xde,0xbf,0x44,0xa8, + 0xaa,0xbd,0x56,0x55,0x71,0x46,0x16,0x12,0x3b,0xe1,0x4d,0x20,0xf5,0x16,0xf0,0xc6, + 0xd5,0x76,0x78,0xf9,0x1a,0x25,0x5e,0xae,0x30,0x8f,0x32,0x11,0x4,0x0,0xe9,0x32, + 0xe3,0x3e,0xcf,0x3c,0xa6,0xdc,0xfc,0xdd,0x87,0x45,0x1b,0x19,0xbc,0xc9,0xb1,0x31, + 0x7c,0x9f,0x51,0x9f,0x39,0xb1,0x40,0x6c,0x85,0xa9,0x4,0x77,0x2e,0xbd,0xa1,0xaa, + 0x7d,0x36,0x84,0x86,0xf3,0x48,0xdf,0x88,0x4d,0x79,0x44,0xee,0xbd,0x42,0x41,0x51, + 0x15,0xcf,0xa3,0x17,0xec,0x9d,0xeb,0xbc,0x1f,0xa8,0x48,0xbf,0x57,0x62,0xeb,0x12, + 0xe7,0x20,0xc6,0x78,0x89,0x68,0x9f,0x6b,0xac,0xc4,0x87,0x3e,0x63,0xa5,0xb8,0x2, + 0x44,0x40,0x30,0x7e,0xa7,0x65,0x9f,0xa5,0x3c,0x8f,0x25,0xf3,0xf7,0x17,0x3c,0xe3, + 0x18,0xdf,0x8f,0x5e,0x99,0xca,0xde,0x12,0xf3,0x40,0x24,0x84,0x60,0xbf,0xb9,0xc1, + 0x5a,0x18,0x92,0x61,0x13,0xf,0x1b,0xbc,0x78,0x0,0xfc,0x6c,0x78,0x8b,0x3,0xa3, + 0xa8,0xec,0x3d,0xa7,0x61,0x52,0x54,0x7c,0xdd,0xfa,0xc4,0x1,0x72,0xef,0xc1,0x75, + 0x36,0xa8,0xc2,0x7a,0x7a,0xf,0x43,0x63,0x2a,0xbf,0xd5,0x58,0x52,0x59,0xf0,0x5c, + 0x12,0x5,0x62,0xbf,0xcf,0x70,0x59,0x56,0x8e,0xa3,0x87,0x4f,0x1,0x8b,0x27,0xf4, + 0xe,0xa6,0x2e,0x9e,0x8f,0x98,0xf8,0xdd,0x79,0xe5,0xf2,0xcb,0x67,0xc,0x2e,0x8f, + 0x1,0x0,0x28,0xd6,0xae,0x36,0x15,0xa9,0x4a,0x31,0x9c,0x6,0x71,0x1f,0x1e,0x7d, + 0x77,0x68,0x15,0x20,0x4c,0xbf,0x6f,0x94,0x5f,0x47,0x5d,0x4f,0xc0,0x4e,0xed,0x6a, + 0x81,0xe1,0xb5,0x3b,0x73,0xd5,0xe0,0x5a,0x7b,0x4f,0xb0,0xda,0xf9,0x37,0x28,0xb9, + 0x9,0x3c,0x78,0x9,0x41,0xf8,0xec,0x65,0x85,0xc8,0x29,0x9d,0x10,0xcf,0xcd,0x4a, + 0x72,0xb9,0x8c,0xd6,0x33,0x4b,0x7,0x8f,0x4d,0x9e,0x63,0x25,0xad,0xc8,0x18,0x63, + 0xcb,0xda,0x7c,0x49,0x3e,0xfe,0xae,0x24,0x62,0x2,0x62,0x10,0x22,0xa1,0x6a,0x59, + 0xb3,0x33,0x2b,0x44,0x6b,0xcd,0xf0,0x0,0x26,0x68,0x39,0xc,0x97,0x8,0x3a,0xc, + 0x84,0xd1,0x3,0xe3,0x19,0x45,0x48,0x89,0xcc,0x28,0xe1,0xa,0xe9,0xba,0x25,0xe2, + 0xa3,0xee,0xe9,0xd8,0x1b,0xab,0x1b,0x56,0x1f,0x3f,0xd6,0xfa,0x91,0x38,0x56,0xb1, + 0x58,0x81,0xf6,0x1e,0xac,0x60,0xbb,0x12,0x15,0x55,0xf,0xf4,0xab,0x2a,0x57,0xba, + 0xa0,0x3b,0x1d,0x5c,0xbc,0x0,0x74,0xb2,0xea,0xee,0x3b,0xcf,0x70,0xcb,0xeb,0xd, + 0x9d,0xff,0x50,0xd9,0x80,0xb6,0x2c,0xdc,0xbf,0x72,0x31,0x8e,0x4b,0x3c,0xfb,0xf5, + 0xcd,0xa3,0xbc,0xa0,0x3b,0x5f,0xa0,0x71,0xd3,0x14,0x79,0xad,0x64,0xb7,0xdf,0x3c, + 0xb4,0x7c,0x14,0xb9,0xf7,0xf7,0x49,0x30,0xf5,0x3e,0x23,0xe4,0xe1,0x52,0x72,0x87, + 0x60,0x7d,0xf9,0x57,0xdd,0x77,0x95,0x63,0xbc,0x1,0x38,0xdd,0x39,0x55,0x0,0x71, + 0x4d,0x3c,0xd2,0x7a,0xc2,0xe7,0x73,0x45,0x75,0xbc,0x3d,0x8f,0xec,0x5a,0xc8,0x98, + 0x40,0xc8,0x23,0xd5,0x5,0x42,0xdc,0xf8,0xd9,0xe0,0x56,0xaf,0x7b,0xad,0x30,0x19, + 0x69,0x8d,0x1d,0xc8,0xa6,0xf7,0xee,0xa4,0x74,0xfe,0x8e,0x7,0xba,0x4e,0x72,0x9, + 0x88,0x2b,0xcd,0x8a,0xc5,0x4b,0xba,0xf8,0x8c,0x7b,0xb9,0x9,0xde,0x3b,0x7f,0xc8, + 0x82,0xd0,0xed,0x69,0x1a,0x16,0x2c,0xb9,0xa6,0xa8,0x4a,0xce,0x8f,0x4c,0xd4,0xd9, + 0x4f,0x63,0xc7,0x77,0x42,0xac,0xba,0x17,0x4e,0xa7,0x4a,0xea,0x33,0x1d,0xb8,0xb8, + 0x82,0x5f,0xe9,0x90,0x87,0xd1,0xd,0x1a,0x6f,0xec,0x72,0xf9,0xb3,0x77,0xe5,0xb0, + 0x18,0x6e,0x10,0x73,0xc9,0xbe,0xe9,0x19,0x4b,0x70,0xdc,0x87,0xef,0x72,0xa9,0xd5, + 0xc0,0x47,0xd3,0xdf,0x7,0xba,0x8d,0x43,0xe8,0x2,0x4b,0xdb,0x75,0x4f,0x1d,0x4a, + 0xf1,0xda,0x6,0xcf,0xd,0xfe,0xbe,0xbb,0x17,0xa0,0xf9,0xed,0x43,0x1a,0xdd,0x63, + 0x29,0x84,0x18,0x7e,0x37,0xd9,0x8f,0xc4,0x30,0xfb,0x70,0x17,0xf7,0xbd,0x9,0x3f, + 0x73,0x1d,0xf7,0x83,0x57,0x15,0x6,0x9c,0x43,0x79,0x52,0x40,0x23,0x90,0x9c,0x95, + 0x27,0x5c,0x70,0xce,0x39,0x19,0xf5,0x4d,0xd,0x31,0x2a,0x93,0x3f,0x9d,0x1,0x2b, + 0x2a,0x7b,0x8d,0xc7,0xf3,0x53,0xae,0x29,0xa9,0xe3,0x74,0x8b,0x63,0x3b,0xe7,0x47, + 0xe6,0xd5,0x45,0x44,0xd,0x88,0x4a,0x74,0x55,0x65,0x81,0xfc,0xff,0x9,0x3d,0x7a, + 0x64,0x3e,0xe3,0x2d,0x4c,0x2e,0xe5,0xbc,0x57,0xc9,0xfb,0x66,0x88,0x78,0xf6,0x38, + 0xf5,0x18,0xba,0x7c,0x40,0x61,0xfe,0xdc,0x41,0x21,0x4d,0xfd,0xa5,0xf6,0x96,0xed, + 0x67,0x45,0x62,0x13,0x8b,0x0,0xa3,0x72,0xd5,0xfa,0x93,0x77,0xc3,0xf4,0xfb,0xe, + 0x16,0xb5,0x84,0x53,0x78,0x77,0xed,0xf8,0x8f,0x97,0xe,0xe9,0xec,0x52,0x34,0xd8, + 0x49,0xb9,0xb0,0xc4,0xb0,0xc1,0xd2,0x8d,0xc9,0x7d,0xfa,0xaf,0x55,0xb8,0x7c,0xe0, + 0x3,0x53,0x45,0x38,0x17,0xd9,0x33,0xc6,0x6f,0x7d,0x75,0xa3,0x29,0xc6,0x99,0xbf, + 0x29,0x19,0x3d,0xc0,0x9,0xef,0xa0,0x32,0xa5,0x86,0xc8,0xc,0x19,0xa0,0x85,0xc8, + 0x89,0x59,0x29,0xa0,0x98,0xb1,0x30,0x79,0xb9,0x39,0x6a,0x0,0xaa,0xa4,0xc3,0x67, + 0xd,0x91,0x8e,0xba,0xa7,0x6a,0x85,0x6b,0x22,0x88,0xd8,0x5f,0xf0,0x5d,0x7d,0x7, + 0xc5,0x45,0x3,0xaf,0x9e,0xc,0x28,0x5e,0x32,0xf0,0xfe,0x1e,0x40,0xf8,0xbb,0x74, + 0x1b,0x6f,0xc7,0xc8,0xac,0x70,0x9d,0x3,0x71,0xc,0xc1,0xeb,0xd5,0xbc,0xdf,0x28, + 0x8e,0x43,0x66,0x20,0xfb,0xb4,0xe3,0x81,0xdd,0x23,0x7c,0x1d,0xf2,0x34,0xc6,0x7f, + 0x46,0x5f,0x85,0xd3,0xe9,0x3f,0x5d,0x6,0xa2,0xba,0x86,0x3d,0xad,0xb7,0x3d,0xb1, + 0xba,0x7d,0x2a,0xff,0xbb,0x40,0x26,0xe9,0xfa,0x9c,0x2,0xbe,0x3e,0x4d,0xa2,0x62, + 0x11,0x1c,0xf,0x97,0x55,0x8f,0xfa,0xf,0x81,0xfc,0x5c,0xfa,0xb,0x56,0xab,0x7c, + 0xbd,0xff,0x56,0x79,0xbc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/cut.png + 0x0,0x0,0x0,0xe9, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x39,0x31,0x5d,0x55,0x97,0xef,0x0,0x0,0x0,0x76,0x49,0x44, + 0x41,0x54,0x78,0xda,0xcd,0xd4,0xc1,0xe,0x80,0x20,0x8,0x6,0x60,0xe0,0xc1,0x3d, + 0xf8,0xe2,0x7f,0x37,0x2b,0x47,0x13,0x2,0x4a,0x2e,0x4e,0xa7,0xdf,0x0,0x9d,0x44, + 0x3f,0x5,0x9c,0xeb,0x23,0xa4,0x2a,0xa3,0xad,0x60,0x64,0xc1,0x1a,0xc4,0x51,0x98, + 0xab,0x5b,0x1,0x4f,0x1b,0x3c,0x19,0xc1,0x7b,0x46,0x68,0x83,0x40,0x41,0x8f,0x3b, + 0xee,0x63,0xa,0x3c,0x30,0x3e,0xe7,0x1d,0xc1,0xea,0xe7,0x4c,0xaf,0xe0,0x6b,0x5c, + 0x43,0x66,0xcc,0x8d,0x3f,0x1,0x1a,0xa4,0xe3,0xa2,0x6f,0x6c,0xfc,0xf1,0x27,0xd4, + 0xd8,0x5a,0xbe,0xc4,0x2f,0xd7,0x5c,0x9d,0xe5,0x82,0xd6,0x4f,0x8e,0xd7,0x78,0xbc, + 0xdf,0xa9,0x71,0x0,0xfb,0xf7,0x2f,0xac,0x14,0x2c,0x74,0x27,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/cut.png + 0x0,0x0,0x0,0xe9, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x39,0x31,0x5d,0x55,0x97,0xef,0x0,0x0,0x0,0x76,0x49,0x44, + 0x41,0x54,0x78,0xda,0xcd,0xd4,0xc1,0xe,0x80,0x20,0x8,0x6,0x60,0xe0,0xc1,0x3d, + 0xf8,0xe2,0x7f,0x37,0x2b,0x47,0x13,0x2,0x4a,0x2e,0x4e,0xa7,0xdf,0x0,0x9d,0x44, + 0x3f,0x5,0x9c,0xeb,0x23,0xa4,0x2a,0xa3,0xad,0x60,0x64,0xc1,0x1a,0xc4,0x51,0x98, + 0xab,0x5b,0x1,0x4f,0x1b,0x3c,0x19,0xc1,0x7b,0x46,0x68,0x83,0x40,0x41,0x8f,0x3b, + 0xee,0x63,0xa,0x3c,0x30,0x3e,0xe7,0x1d,0xc1,0xea,0xe7,0x4c,0xaf,0xe0,0x6b,0x5c, + 0x43,0x66,0xcc,0x8d,0x3f,0x1,0x1a,0xa4,0xe3,0xa2,0x6f,0x6c,0xfc,0xf1,0x27,0xd4, + 0xd8,0x5a,0xbe,0xc4,0x2f,0xd7,0x5c,0x9d,0xe5,0x82,0xd6,0x4f,0x8e,0xd7,0x78,0xbc, + 0xdf,0xa9,0x71,0x0,0xfb,0xf7,0x2f,0xac,0x14,0x2c,0x74,0x27,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/color.png + 0x0,0x0,0x0,0xe3, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x98,0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x92,0xc1,0x11, + 0xc3,0x20,0xc,0x4,0xd7,0x19,0xca,0x48,0x1,0xe9,0x2,0x95,0xe1,0x72,0x54,0x8c, + 0x1f,0x29,0x3,0xba,0x48,0x9,0xe9,0x42,0x79,0x8,0xfc,0xf0,0x80,0x4c,0x1,0xb9, + 0x8f,0x86,0x11,0x3a,0x96,0x1b,0xc1,0x5f,0x1b,0x60,0x41,0xef,0x56,0x9,0xc0,0x4a, + 0xf1,0x93,0xc8,0xfa,0x64,0xd3,0x23,0xe8,0xd9,0x8a,0x41,0x2,0xe0,0xf9,0xf5,0x93, + 0x2,0xaf,0x1d,0xfb,0xbc,0x9d,0x44,0xb1,0x3b,0x20,0x37,0x38,0xf6,0xe8,0x4e,0x27, + 0x19,0x1a,0x6d,0x80,0x99,0x79,0x6,0xb5,0xa,0x39,0x43,0xad,0xde,0xec,0xd1,0xa8, + 0xce,0xd,0x52,0x1f,0x5c,0xd0,0x90,0xc4,0xbf,0x90,0xfd,0x29,0x99,0x19,0xe9,0xa5, + 0x5e,0xd,0x64,0x8d,0x60,0x1e,0x62,0x69,0x74,0x22,0x15,0xc8,0x40,0xb,0x81,0x2, + 0x48,0xab,0x63,0x84,0x68,0xf,0x96,0x14,0xad,0x72,0x34,0x73,0xea,0x7,0xd0,0x54, + 0x25,0xa6,0xae,0x89,0xbd,0x26,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42, + 0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/szoom.png + 0x0,0x0,0x1,0xb2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x79,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xdb,0x99,0x83,0x20, + 0x10,0x85,0xf,0xfb,0xa5,0x86,0xf4,0xc0,0x34,0xb1,0xda,0x44,0x8a,0x48,0x15,0x6e, + 0x13,0x29,0xc2,0x26,0x64,0x9b,0xc0,0x1e,0xd2,0x4,0xfb,0xc0,0x8e,0x72,0xf1,0x2, + 0xa8,0xe1,0xbc,0x24,0x19,0x34,0xf3,0x3b,0x37,0x44,0x18,0x63,0xc,0x2a,0xea,0x6, + 0x0,0x42,0xfc,0x7c,0xdc,0xb1,0xd6,0xf,0x10,0x91,0x5,0x60,0x43,0xae,0xa4,0x94, + 0x18,0xc7,0x31,0xfb,0x3e,0xa2,0x1e,0x4a,0x29,0x0,0x98,0x1,0xce,0x16,0xf5,0x34, + 0x7d,0xd7,0xf,0xbd,0x7a,0xdd,0xd7,0x55,0x0,0xa9,0xda,0x8d,0x0,0xd1,0x33,0xb2, + 0x69,0xfd,0xba,0x1e,0x60,0x76,0xdc,0xad,0xae,0x19,0x33,0xf8,0x76,0x27,0xec,0x6b, + 0xf6,0x30,0x1d,0x11,0x40,0xe8,0xd8,0x98,0xef,0xe8,0xf,0x85,0xe8,0xfe,0x3f,0x7f, + 0x1,0x74,0x87,0x22,0xe2,0x1,0x58,0xe7,0xeb,0x8e,0x59,0xbc,0xc6,0x0,0x44,0xcf, + 0x62,0x88,0x20,0x2,0xfb,0xce,0x43,0x10,0xb,0x61,0xe5,0x86,0x37,0xbb,0xb,0xe6, + 0xbc,0xa6,0x39,0x77,0x21,0x38,0xa,0x25,0xaa,0xde,0x86,0xe,0x40,0x97,0xfd,0xf4, + 0xac,0x23,0x51,0xb8,0x6c,0x12,0x6e,0xe5,0xdd,0x55,0xf5,0x14,0x9c,0x1e,0x1,0x29, + 0x65,0x5d,0x80,0xdc,0xdd,0xd1,0x2b,0x42,0xb7,0xa7,0x73,0x74,0x64,0x22,0x56,0xaf, + 0x81,0x9,0x80,0xe9,0x73,0xa3,0xc0,0x4f,0xaf,0xd4,0xb0,0x7b,0xed,0x26,0x80,0x55, + 0x97,0x5,0xe1,0x5e,0xd7,0x34,0x2d,0xde,0xef,0xbc,0x2,0x4,0x82,0x22,0xd4,0xfa, + 0x35,0xd,0x13,0xde,0xf1,0x96,0x77,0x43,0x76,0xdc,0x79,0xf6,0xa6,0x69,0xa1,0xd4, + 0x80,0xfb,0x3d,0xbd,0x10,0xa3,0x2e,0xe0,0x54,0x84,0x20,0xbe,0xd8,0xc6,0x61,0x6f, + 0x8b,0x21,0x56,0xdb,0x30,0x4,0x59,0x5a,0x93,0xd2,0xb6,0x1d,0xd1,0x50,0xc,0xb1, + 0x3b,0x7,0x52,0x5a,0x4b,0xeb,0x72,0x88,0xf8,0x8d,0x68,0xe5,0xb5,0xca,0x73,0xb8, + 0x30,0xe7,0x4b,0x21,0x4e,0x9d,0x3,0x5a,0x8f,0x98,0xeb,0x62,0x86,0xd8,0xea,0x8e, + 0xd3,0x7,0x51,0x2e,0x44,0xdc,0x5,0x89,0xdb,0xe8,0x1e,0x44,0x6a,0x3a,0x26,0x0, + 0xa2,0xfe,0xb0,0xe3,0x58,0x8d,0xff,0xab,0x89,0xcf,0xa0,0x37,0xc0,0x9e,0xb,0xf9, + 0xac,0xf6,0x69,0x9,0x63,0x8c,0x11,0x42,0x54,0x71,0xe,0x0,0x7f,0x65,0x15,0xb3, + 0x26,0xe4,0x84,0x54,0x8c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/save.png + 0x0,0x0,0x2,0x2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x1,0x94,0x49,0x44,0x41,0x54,0x48,0xc7,0x63, + 0xf8,0xff,0xff,0x3f,0x3,0x8,0x3,0x1,0x13,0x10,0xb3,0x2,0x31,0x7,0x10,0x73, + 0x3,0x31,0xf,0x10,0xf3,0x12,0x89,0x79,0xa0,0x7a,0x38,0xa0,0x66,0x30,0xc1,0xd, + 0xf5,0xf5,0xf5,0x8d,0x12,0x15,0x15,0xfd,0x0,0x64,0xff,0x27,0x7,0x73,0x70,0x70, + 0x7c,0x4,0xd2,0xe9,0x40,0x2c,0x8,0xc4,0xec,0x30,0x83,0x59,0x7d,0x7c,0x7c,0x8e, + 0xd4,0xcd,0xb6,0xfb,0xdf,0xb9,0x49,0xeb,0x3f,0xa9,0xa0,0x75,0xbd,0xe2,0xff,0xb8, + 0x66,0xb0,0x5,0xe7,0x80,0x58,0xd,0x6c,0x38,0xd4,0x60,0xe,0x27,0x27,0x27,0xb0, + 0xa1,0x56,0x1,0x2c,0x60,0xc5,0x15,0x15,0x15,0x38,0x31,0xb2,0x3c,0x98,0xbd,0x82, + 0xe1,0x7f,0xc6,0x4,0xb8,0xeb,0xad,0x80,0x58,0x1a,0x66,0x30,0xb7,0xb5,0xb5,0xf5, + 0xff,0xb6,0xd,0xca,0xff,0x2d,0xfd,0x19,0x48,0x76,0x31,0xc8,0xe0,0xb4,0x3e,0xb8, + 0xc1,0xee,0x40,0xac,0x4,0x33,0x98,0x7,0x66,0x30,0x48,0x11,0x39,0x2e,0x46,0x32, + 0xd8,0x1b,0x88,0x55,0x61,0x6,0xf3,0xa2,0x1b,0x4c,0x81,0x8b,0x7d,0xc1,0xe1,0x8c, + 0xcb,0x60,0x5c,0x2e,0x24,0xc2,0xc5,0xf8,0xd,0xa6,0x99,0x8b,0x69,0x62,0x30,0x39, + 0x98,0x28,0x83,0x75,0xcc,0x85,0x89,0xce,0x71,0x72,0x5a,0x24,0x18,0xc,0x52,0x60, + 0x60,0x25,0xf5,0x5f,0x41,0x97,0x1,0x3,0xe7,0xe4,0xe4,0xfc,0x6f,0x6d,0x6d,0xfd, + 0xbf,0x6c,0xd9,0xb2,0xff,0xb2,0x5a,0x10,0xb5,0x24,0x19,0x8c,0xcd,0x50,0x10,0x2e, + 0x2e,0x2e,0xfe,0xbf,0x60,0xc1,0x82,0xff,0x9b,0x36,0x6d,0x2,0xf3,0xa9,0x66,0x70, + 0x51,0x51,0xd1,0xff,0x15,0x2b,0x56,0xfc,0xdf,0xbe,0x7d,0x3b,0x75,0xd,0x6,0x5, + 0xc3,0xaa,0x55,0xab,0xfe,0xef,0xd8,0xb1,0x83,0x28,0x83,0x79,0x4c,0x4c,0x4c,0xc0, + 0xa5,0x14,0x21,0x83,0x41,0x61,0xb,0xa,0x86,0x5d,0xbb,0x76,0xc1,0xd,0x2e,0x5d, + 0xc2,0xf0,0x3f,0xa9,0x3,0x7b,0x96,0xe6,0x96,0x95,0x95,0x3d,0x1,0x2a,0xfa,0x60, + 0xa5,0x94,0x8c,0x1a,0x71,0x18,0xa4,0x16,0x64,0xa8,0x53,0x34,0x98,0x7d,0x3,0xbd, + 0x10,0xe2,0x80,0x16,0xd2,0xe7,0xc8,0x2d,0xe8,0xa1,0x86,0xf6,0xa0,0x17,0x9b,0xac, + 0xd0,0x92,0x5f,0xd,0x2a,0xe1,0xe,0xf5,0x92,0x2f,0x91,0xd8,0x1b,0xaa,0xc7,0xa, + 0xbd,0xa0,0x67,0x2,0x57,0x27,0x10,0xc3,0xa5,0xc1,0x5e,0x1,0x85,0x13,0x44,0x11, + 0x31,0x58,0x15,0xaa,0x47,0x1a,0xa5,0x6a,0xa2,0x45,0x65,0xa,0x0,0x58,0xc4,0x17, + 0xe0,0xd,0x6c,0x62,0x9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/splash.png + 0x0,0x0,0x6f,0xba, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x1,0x8d,0x0,0x0,0x0,0xe5,0x8,0x6,0x0,0x0,0x0,0xaf,0x77,0xab,0x52, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0, + 0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x7,0xb,0xf,0x6,0xe,0xd7,0x2c,0xc3,0x3f,0x0,0x0,0x20,0x0,0x49,0x44, + 0x41,0x54,0x78,0x9c,0xec,0x9d,0x77,0x78,0x54,0x55,0xfa,0xc7,0xbf,0x77,0xfa,0x24, + 0x93,0x4c,0x7a,0xef,0x85,0x24,0xa4,0x40,0xe8,0x5d,0x8a,0x88,0xd8,0xd0,0x55,0x57, + 0x5d,0x1b,0x16,0xec,0xa0,0xb,0x58,0xd6,0xbe,0xba,0x28,0xba,0x2a,0xb2,0xea,0x8a, + 0x2b,0x36,0x10,0x61,0xa9,0x8a,0x88,0x34,0x43,0x87,0x24,0x4,0x48,0x48,0x42,0x3a, + 0xe9,0xbd,0x4c,0x26,0x65,0x32,0xf5,0xde,0xdf,0x1f,0xf9,0x25,0xeb,0x30,0x49,0xee, + 0x99,0xcc,0x4c,0x48,0xf0,0x7c,0x9e,0x87,0x3f,0xb8,0x39,0x73,0xef,0x99,0x3b,0xf7, + 0x9e,0xf7,0x9c,0xf7,0xbc,0xef,0xf7,0x65,0x38,0x8e,0xe3,0x40,0xa1,0x50,0x28,0x14, + 0xa,0x1,0x82,0x2b,0xdd,0x1,0xa,0x85,0x42,0xa1,0x8c,0x1c,0xa8,0xd1,0xa0,0x50, + 0x28,0x14,0xa,0x31,0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14, + 0xa,0x85,0x42,0xc,0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85, + 0x42,0xa1,0x10,0x43,0x8d,0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1, + 0x50,0x28,0xc4,0x50,0xa3,0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28, + 0x14,0xa,0x31,0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa, + 0x85,0x42,0xc,0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x46,0x74,0xa5,0x3b,0x40,0xa1, + 0x50,0x28,0x7f,0x64,0x38,0x8e,0x83,0xc1,0x64,0x80,0xde,0xa4,0xef,0xfd,0x7,0x0, + 0x3e,0xa,0x1f,0x8,0x98,0xe1,0x37,0xaf,0xa7,0x46,0x83,0x42,0xa1,0x50,0x86,0x8, + 0x8e,0xe3,0xa0,0xea,0x52,0xa1,0xbe,0xbd,0x1e,0xd5,0xad,0xd5,0xa8,0x6b,0xaf,0x43, + 0x8d,0xba,0x6,0xb5,0xea,0x5a,0x54,0xab,0xab,0x51,0xd5,0x5a,0x85,0xda,0xb6,0x5a, + 0x44,0x7a,0x45,0x62,0xc3,0x7d,0x1b,0x10,0xa0,0xc,0xb8,0xd2,0x5d,0xb6,0x80,0x1a, + 0xd,0xa,0x85,0x42,0xb1,0x3,0x2c,0xc7,0xa2,0xcb,0xd0,0x85,0x4e,0x5d,0x27,0x3a, + 0xf5,0xdd,0xff,0x9a,0x3a,0x9a,0x50,0xa1,0xaa,0x40,0x49,0x53,0x9,0xca,0x55,0xe5, + 0x28,0x6b,0x29,0x43,0xab,0xa6,0x15,0x5a,0xa3,0x16,0x5a,0x83,0x16,0x5a,0xa3,0x16, + 0x7a,0xa3,0x1e,0x1c,0xcc,0xcb,0x1a,0x79,0x38,0x79,0xc0,0x49,0xe2,0x74,0x85,0xbe, + 0xc9,0xc0,0x50,0xa3,0x41,0xa1,0x50,0x28,0x36,0x92,0x56,0x9e,0x86,0x6d,0x99,0xdb, + 0xd0,0xd4,0xd1,0x84,0x86,0xf6,0x6,0x34,0x74,0x34,0xa0,0xa9,0xa3,0x9,0x6d,0xda, + 0x36,0xb,0x83,0xc0,0x7,0xc3,0x30,0x18,0xed,0x37,0x1a,0x4a,0x99,0xd2,0x41,0xbd, + 0xb5,0xd,0x6a,0x34,0x28,0x14,0xa,0xc5,0x6,0xf4,0x46,0x3d,0xbe,0x4a,0xfd,0xa, + 0xdb,0xce,0x6f,0xb3,0xcb,0xf9,0x44,0x2,0x11,0xa6,0x47,0x4c,0x7,0xc3,0x30,0x76, + 0x39,0x9f,0xbd,0xb1,0xda,0x68,0x6c,0xca,0xd8,0x84,0x5f,0x2f,0xfe,0x6a,0xd7,0x4e, + 0xb8,0xc8,0x5c,0xf0,0xcc,0xac,0x67,0x10,0xef,0x17,0x6f,0xd7,0xf3,0x5e,0x29,0x4e, + 0x97,0x9d,0xc6,0xfa,0xd3,0xeb,0xa1,0x33,0xe8,0xec,0x7a,0xde,0x19,0x91,0x33,0xf0, + 0xc4,0xf4,0x27,0xec,0x7a,0x4e,0xca,0xff,0x30,0xb2,0x46,0x18,0x59,0x23,0x4c,0xac, + 0x9,0x6d,0x5d,0x6d,0x28,0x57,0x95,0xa3,0x46,0x5d,0x83,0xa6,0xce,0x26,0x34,0x74, + 0x34,0x40,0xa5,0x51,0x41,0x67,0xd4,0x41,0x67,0xd4,0x41,0x6f,0xd4,0x83,0xe5,0x58, + 0x88,0x85,0x62,0x38,0x89,0x9d,0xa0,0x94,0x2b,0xe1,0x26,0x77,0x83,0x9f,0xab,0x1f, + 0xfc,0x5d,0xfd,0x11,0xe2,0x11,0x2,0x5f,0x85,0x2f,0x24,0x22,0x9,0x44,0x2,0x11, + 0x84,0x2,0xe1,0xb0,0xdc,0xd4,0xa4,0xd8,0x4e,0x63,0x67,0x23,0x2a,0x54,0x15,0x10, + 0xb,0xc5,0xe0,0x38,0xe,0x2c,0xc7,0x82,0xe5,0xd8,0x41,0x9f,0x4f,0x22,0x94,0x60, + 0x5c,0xd0,0x38,0x3b,0xf6,0xd0,0xbe,0x58,0x65,0x34,0xf4,0x46,0x3d,0x7e,0xcc,0xfe, + 0x11,0x87,0xa,0xe,0xd9,0xb5,0x13,0x12,0x91,0x4,0xb3,0xa3,0x67,0x5f,0x15,0x46, + 0x43,0x6b,0xd0,0x62,0xd5,0xfe,0x55,0x38,0x59,0x7a,0xd2,0xee,0xe7,0x9e,0x1e,0x31, + 0xdd,0xee,0xe7,0xfc,0x23,0xc3,0x81,0x83,0x4a,0xa3,0xc2,0xc5,0xba,0x8b,0xb8,0xd4, + 0x7c,0x9,0xd9,0x35,0xd9,0xb8,0x58,0x77,0x11,0xa5,0xcd,0xa5,0xa8,0x6b,0xaf,0x3, + 0xc7,0x59,0xe7,0x56,0xb8,0x1c,0x27,0x89,0x13,0x42,0xdd,0x43,0x31,0xda,0x6f,0x34, + 0x46,0xf9,0x8c,0x42,0xac,0x4f,0x2c,0xa2,0xbc,0xa3,0x10,0xe1,0x19,0x1,0x99,0x58, + 0x66,0xa7,0x6f,0x41,0xb9,0xd2,0xb8,0x3b,0xb9,0xe3,0xad,0x85,0x6f,0xa1,0xba,0xb5, + 0x1a,0x4d,0x9a,0x26,0x34,0x76,0x34,0xa2,0xa5,0xb3,0x5,0x6a,0xad,0x1a,0xad,0x5d, + 0xad,0x68,0xee,0x6c,0x46,0x7e,0x7d,0x3e,0xba,0xc,0x5d,0x44,0xe7,0x4b,0xf0,0x4f, + 0x80,0xa7,0xb3,0xa7,0x83,0x7b,0x3d,0x78,0xac,0x32,0x1a,0x35,0x6d,0x35,0xa8,0x51, + 0xd7,0xd8,0xbd,0x13,0x7a,0xa3,0x1e,0xc5,0x8d,0xc5,0x60,0x39,0x76,0x44,0xcf,0xc6, + 0x58,0x8e,0xc5,0xcf,0xb9,0x3f,0x23,0xb5,0x3c,0xd5,0xee,0xe7,0x66,0xc0,0x60,0x7c, + 0xf0,0x78,0xbb,0x9f,0xf7,0x8f,0x86,0xd6,0xa0,0x45,0x43,0x47,0x3,0xb2,0xaa,0xb3, + 0x70,0x20,0xff,0x0,0xce,0x57,0x9f,0x47,0x7d,0x7b,0x3d,0xd4,0x5d,0x6a,0x18,0x4c, + 0x6,0xbb,0x5e,0x4b,0xa3,0xd7,0x20,0xaf,0x3e,0xf,0x79,0xf5,0x79,0x0,0x0,0x67, + 0x89,0x33,0x3c,0x9c,0x3d,0xe0,0xef,0xea,0x8f,0x19,0x11,0x33,0x70,0x4d,0xd4,0x35, + 0x88,0xf1,0x89,0x81,0x87,0x93,0x7,0xc4,0x42,0xb1,0x5d,0xaf,0x4d,0x19,0x3a,0x9c, + 0xc4,0x4e,0x98,0x14,0x3a,0x9,0x8,0xfd,0xdf,0x31,0x96,0x63,0xa1,0x37,0xea,0xa1, + 0x35,0x6a,0xa1,0xd1,0x6b,0x70,0xe2,0xd2,0x9,0xbc,0xb2,0xe7,0x15,0x34,0x75,0x36, + 0xf1,0x9e,0x6f,0x5a,0xf8,0x34,0x7,0xf6,0xd6,0x76,0xac,0x32,0x1a,0xed,0xda,0x76, + 0xb8,0xca,0x5c,0xe1,0xe9,0xe4,0x9,0x55,0x97,0xca,0xa6,0x25,0xd8,0xe5,0xe4,0xd6, + 0xe5,0x8e,0x78,0xa3,0x51,0xd9,0x5a,0x89,0xcf,0x8e,0x7f,0x6,0x13,0x6b,0xb2,0xfa, + 0xb3,0xc,0x18,0x78,0x29,0xbc,0x10,0xec,0x16,0xdc,0xe7,0x0,0x22,0x13,0xcb,0x10, + 0xe3,0x13,0x63,0x8f,0x6e,0xfe,0x21,0x69,0xd7,0xb5,0xe3,0x44,0xc9,0x9,0xec,0xc9, + 0xdd,0x83,0x93,0x97,0x4e,0xa2,0x5c,0x55,0x3e,0xe4,0x7d,0xe8,0x89,0xa8,0xa9,0x54, + 0x55,0x22,0xbd,0x3c,0x1d,0x1f,0x1f,0xf9,0x18,0x9,0xfe,0x9,0x98,0x16,0x3e,0xd, + 0x37,0xc6,0xdf,0x88,0x49,0xa1,0x93,0x20,0x11,0x4a,0x86,0xbc,0x5f,0x14,0xfb,0x23, + 0x60,0x4,0x90,0x89,0x65,0x90,0x89,0x65,0x70,0x93,0xbb,0x61,0x41,0xdc,0x2,0x7c, + 0x72,0xec,0x13,0x5e,0xa3,0x21,0x13,0xcb,0x30,0x21,0x64,0xc2,0x10,0xf5,0x72,0x70, + 0x58,0x65,0x34,0xe2,0xfc,0xe2,0xb0,0xf9,0xc1,0xcd,0x30,0x98,0xc,0xe8,0x32,0x74, + 0xa1,0xb1,0xa3,0x11,0xb5,0x6d,0xb5,0xa8,0x6f,0xaf,0x47,0x85,0xaa,0x2,0x59,0xd5, + 0x59,0x38,0x5b,0x79,0x16,0x1d,0xba,0xe,0xab,0x3b,0x92,0x5d,0x93,0xd,0x13,0x6b, + 0x82,0x48,0x30,0x32,0xf7,0xe6,0x39,0x70,0xf8,0xfa,0xf4,0xd7,0xc8,0xa9,0xc9,0xb1, + 0xfa,0xb3,0xee,0x72,0x77,0x2c,0xbb,0x66,0x19,0xee,0x1e,0x7f,0x37,0xe4,0x22,0x79, + 0x9f,0x1b,0x60,0xc,0xc3,0x40,0x21,0x51,0xd8,0xa3,0xab,0x7f,0x18,0x58,0x8e,0xc5, + 0xa5,0xe6,0x4b,0x48,0x29,0x4c,0xc1,0xb7,0x69,0xdf,0xa2,0x42,0x55,0x81,0x4e,0x7d, + 0x27,0xd1,0x67,0x5d,0x65,0xae,0xf0,0x51,0xf8,0xc0,0xc7,0xc5,0x7,0xc1,0xee,0xc1, + 0x8,0xf5,0x8,0x85,0xbf,0x8b,0x3f,0x94,0x72,0x25,0x64,0x62,0x19,0x4,0x10,0x40, + 0x6b,0xd4,0xa2,0xcb,0xd0,0x85,0xa6,0xce,0x26,0xd4,0xaa,0x6b,0x51,0xd6,0x52,0x86, + 0x1a,0x75,0xd,0x1a,0x3a,0x1a,0x50,0xdf,0x5e,0xcf,0x3b,0x79,0x60,0x39,0x16,0x17, + 0x6a,0x2e,0x20,0xbb,0x36,0x1b,0x9b,0x32,0x36,0x21,0xde,0x3f,0x1e,0xf7,0x4f,0xbc, + 0x1f,0xd7,0x8e,0xba,0x16,0xde,0x2e,0xde,0x60,0x30,0x3c,0x37,0x42,0x29,0xd6,0xd3, + 0xa6,0x6d,0x83,0xce,0xc8,0xbf,0xc7,0x19,0xa4,0xc,0x42,0x84,0x67,0xc4,0x10,0xf4, + 0x68,0xf0,0x58,0x35,0x42,0x8b,0x4,0x22,0xb8,0xc9,0xdd,0x7a,0xff,0x1f,0xe2,0x1e, + 0x62,0xf6,0xf7,0xe,0x5d,0x7,0xd6,0x1c,0x59,0x83,0x4f,0x8f,0x7d,0xda,0x9b,0xd5, + 0x48,0x4a,0x8d,0xba,0x6,0x2a,0x8d,0xa,0x7e,0xae,0x7e,0x56,0x7d,0x6e,0xb8,0x50, + 0xd8,0x50,0x88,0x1f,0xce,0xfe,0x0,0x13,0x67,0xdd,0x2a,0x43,0xc0,0x8,0xb0,0x78, + 0xf2,0x62,0x3c,0x39,0xe3,0x49,0x48,0x45,0x52,0x7,0xf5,0xee,0x8f,0x47,0x87,0xae, + 0x3,0x5f,0xa5,0x7e,0x85,0xff,0x9e,0xff,0x2f,0xa,0xea,0xb,0x88,0x56,0xc5,0xc, + 0x18,0xc4,0xfa,0xc6,0x62,0xe1,0xe8,0x85,0x98,0x1c,0x3a,0x19,0x61,0x1e,0x61,0x8, + 0x76,0xf,0x86,0x5c,0x2c,0x27,0xba,0x26,0xc7,0x71,0x68,0xea,0x6c,0x42,0x79,0x4b, + 0x39,0xb2,0x6b,0xb2,0xf1,0x63,0xf6,0x8f,0x38,0x5d,0x76,0x9a,0xd7,0xed,0xc5,0x71, + 0x1c,0xda,0x75,0xed,0x48,0x2d,0x4b,0x45,0x46,0x45,0x6,0xa6,0x85,0x4f,0xc3,0x43, + 0x93,0x1f,0xc2,0xa2,0xa4,0x45,0xd4,0x70,0x5c,0x25,0x54,0xa8,0x2a,0xd0,0xda,0xd5, + 0xca,0xdb,0x2e,0xc0,0x2d,0x0,0x41,0x6e,0x41,0x43,0xd0,0xa3,0xc1,0x63,0xd7,0x69, + 0xbd,0x42,0xaa,0xc0,0x92,0xa9,0x4b,0xb0,0xf9,0xec,0x66,0xd4,0xb6,0xd5,0x5a,0xf5, + 0x59,0x96,0x63,0x71,0xb6,0xf2,0x2c,0x6e,0x8c,0xbf,0xd1,0x9e,0x5d,0x1a,0x12,0xda, + 0xb4,0x6d,0x78,0xe7,0xc0,0x3b,0x68,0xee,0x6c,0xb6,0xfa,0xb3,0x9e,0xce,0x9e,0x78, + 0x6e,0xf6,0x73,0xd4,0x60,0xd8,0x89,0x76,0x5d,0x3b,0x7e,0xc8,0xf8,0x1,0x9f,0x9f, + 0xf8,0x9c,0xd8,0x5,0x15,0xe6,0x11,0x86,0x39,0xd1,0x73,0xf0,0xe0,0xa4,0x7,0x91, + 0xe0,0x9f,0x0,0xa1,0x40,0x38,0xa8,0x6b,0x33,0xc,0x3,0x6f,0x85,0x37,0xbc,0x15, + 0xde,0x98,0x10,0x32,0x1,0x8b,0x27,0x2f,0x46,0x71,0x53,0x31,0x3e,0x4c,0xf9,0x10, + 0xfb,0xf3,0xf7,0x13,0xd,0x1a,0x46,0xd6,0x88,0x63,0x25,0xc7,0x90,0x56,0x9e,0x6, + 0x91,0x40,0x84,0x9b,0x12,0x6e,0x1a,0x54,0x5f,0x28,0xc3,0x7,0xe,0x1c,0x2e,0x54, + 0x5f,0x20,0x1a,0x1f,0x26,0x87,0x4e,0x86,0x42,0x3a,0xbc,0x3d,0xa,0x76,0xf7,0x5, + 0xb9,0xc9,0xdd,0x20,0x12,0xe,0xee,0xb4,0xd9,0xb5,0xd9,0x23,0xd2,0x68,0x1c,0x2e, + 0x3a,0x8c,0x43,0x85,0x87,0xac,0x4e,0xe2,0x1,0x80,0x79,0xa3,0xe6,0xc1,0x55,0xe6, + 0xea,0x80,0x5e,0xfd,0xb1,0x30,0xb1,0x26,0x64,0x56,0x67,0x62,0xed,0xd1,0xb5,0x38, + 0x98,0x7f,0x10,0x5a,0xa3,0x76,0xc0,0xf6,0x3d,0x3,0xfc,0xa2,0xc4,0x45,0x78,0x68, + 0xd2,0x43,0x88,0xf4,0x8a,0x84,0x44,0x64,0xdf,0xfd,0x4,0x86,0x61,0x10,0xed,0x1d, + 0x8d,0xf,0x6f,0xfb,0x10,0x37,0x15,0xdd,0x84,0xd7,0xf7,0xbe,0x8e,0xb2,0x96,0x32, + 0xa2,0xa8,0x2c,0x91,0x40,0x84,0x51,0x3e,0xa3,0xec,0xda,0x1f,0xca,0x95,0xc1,0x64, + 0xea,0x7e,0x36,0x49,0x56,0xbb,0x93,0x43,0x27,0xf,0x41,0x8f,0x6c,0xc3,0xee,0x46, + 0x43,0xad,0x55,0xf,0x6a,0x23,0x18,0x0,0x72,0x6b,0x73,0xa1,0x37,0xea,0xed,0xfe, + 0xf2,0x3a,0x92,0xba,0xb6,0x3a,0x7c,0x78,0xf8,0x43,0x68,0xf4,0x1a,0xab,0x3f,0x2b, + 0x12,0x88,0x30,0x77,0xd4,0x5c,0x7,0xf4,0xea,0x8f,0x45,0xa7,0xbe,0x13,0x1b,0xcf, + 0x6c,0xc4,0x7,0x29,0x1f,0x10,0xcd,0xe6,0x24,0x42,0x9,0xae,0x8f,0xbb,0x1e,0x7f, + 0x9d,0xf3,0x57,0x8c,0x9,0x1c,0xe3,0x70,0x17,0x90,0xb3,0xc4,0x19,0x37,0xc5,0xdf, + 0x84,0x70,0xcf,0x70,0x2c,0xdf,0xb5,0x1c,0xe9,0xe5,0xe9,0xbc,0x9f,0xf1,0x77,0xf5, + 0x47,0x94,0x77,0x94,0x43,0xfb,0x45,0x19,0x1a,0xf4,0x26,0x3d,0x4e,0x97,0x9e,0xe6, + 0x6d,0xe7,0x22,0x73,0xc1,0xd8,0xc0,0xb1,0x43,0xd0,0x23,0xdb,0xb0,0x7b,0xa8,0x52, + 0x69,0x73,0xa9,0x45,0x3c,0xb2,0x97,0xb3,0x17,0x51,0x5c,0x7a,0xb5,0xba,0x1a,0xd, + 0x1d,0xd,0xf6,0xee,0x92,0xc3,0x30,0x98,0xc,0xf8,0x2a,0xf5,0x2b,0xe4,0xd7,0xe7, + 0xf7,0x1e,0x63,0xc0,0x20,0x50,0x19,0x48,0xa4,0x1b,0xe3,0xe3,0xe2,0x83,0x48,0xcf, + 0x48,0x47,0x76,0xf1,0xaa,0xa7,0xb4,0xb9,0x14,0xcf,0xed,0x7c,0xe,0x6f,0xed,0x7b, + 0x8b,0xc8,0x60,0x84,0xb8,0x87,0xe0,0xdd,0x9b,0xdf,0xc5,0xa7,0x77,0x7c,0x8a,0xb1, + 0x81,0x63,0x87,0x74,0xcf,0x20,0xde,0x2f,0x1e,0xff,0x5c,0xf4,0x4f,0xc4,0xfa,0xc6, + 0xf2,0xb6,0x9d,0x16,0x3e,0x6d,0x44,0x47,0x12,0x52,0xfe,0x47,0x59,0x4b,0x19,0xaa, + 0xd5,0xd5,0xbc,0xed,0xc6,0x5,0x8d,0x83,0xb3,0xc4,0x79,0x8,0x7a,0x64,0x1b,0x76, + 0x7f,0x2a,0xf3,0xeb,0xf3,0xcd,0x22,0x54,0x18,0x30,0x58,0x38,0x7a,0x21,0xc2,0x3c, + 0xc2,0x78,0x3f,0x5b,0xdb,0x56,0x3b,0xa2,0x8c,0x46,0x41,0x43,0x1,0xbe,0x49,0xfd, + 0xc6,0x6c,0xa3,0x53,0x2e,0x96,0xe3,0x91,0xa9,0x8f,0x10,0x19,0xd,0x7f,0x57,0x7f, + 0x4,0xba,0x5,0x3a,0xb2,0x8b,0x57,0x35,0x17,0xeb,0x2f,0xe2,0xd1,0xcd,0x8f,0x62, + 0x67,0xd6,0x4e,0xa2,0xc4,0xa9,0x78,0xff,0x78,0x7c,0x75,0xcf,0x57,0x58,0x3c,0x79, + 0x31,0x5c,0x64,0x2e,0x43,0xd0,0x43,0x4b,0x12,0xfd,0x13,0xf1,0xca,0x75,0xaf,0xc0, + 0x49,0xdc,0xff,0xf3,0x21,0x60,0x4,0x98,0x1c,0x36,0xfc,0xdd,0x14,0x14,0x32,0x52, + 0xcb,0x52,0x89,0x5c,0x53,0x13,0x82,0x27,0x8c,0x8,0x2f,0x8b,0x5d,0x8d,0x86,0xde, + 0xa4,0x47,0x76,0x6d,0x36,0xf4,0xc6,0xff,0x45,0x4e,0x89,0x85,0x62,0x4c,0x9,0x9b, + 0x82,0x4,0xbf,0x4,0xde,0xcf,0x37,0xb4,0x37,0xa0,0xbc,0x65,0xe8,0xe3,0xe7,0x7, + 0x83,0x5a,0xab,0xc6,0xbb,0x7,0xdf,0x45,0xb3,0xe6,0x7f,0xb3,0x5b,0x91,0x40,0x84, + 0xc7,0xa6,0x3f,0x6,0x67,0x89,0x33,0x54,0x1a,0x15,0xef,0x39,0x22,0x3c,0x23,0xe0, + 0xad,0xf0,0x76,0x64,0x37,0xaf,0x5a,0xf6,0x5e,0xdc,0x8b,0xfb,0x37,0xdc,0x8f,0x73, + 0x55,0xe7,0x78,0x5f,0x48,0x86,0x61,0x70,0x5b,0xd2,0x6d,0xd8,0xf4,0xc0,0x26,0x4c, + 0x8,0x99,0x70,0x45,0x67,0xf0,0xc,0xc3,0xe0,0x86,0xd1,0x37,0xe0,0xb6,0x31,0xb7, + 0xf5,0xdb,0xc6,0xd7,0xc5,0x17,0xb1,0x3e,0xfc,0xab,0x11,0xca,0xf0,0xc7,0x68,0x32, + 0xe2,0xe4,0x25,0x7e,0x75,0x8,0x17,0xa9,0xb,0xc6,0x6,0x8d,0x1d,0x11,0xab,0x4b, + 0xbb,0xf6,0x50,0xa3,0xd7,0x98,0xb9,0x6a,0x80,0x6e,0x89,0x90,0x4,0xff,0x4,0xc4, + 0xfb,0xf3,0x4b,0x84,0xb0,0x1c,0x8b,0x9c,0x5a,0xeb,0xf3,0x1c,0xae,0x4,0xbf,0xe4, + 0xfe,0x82,0x63,0x25,0xc7,0xcc,0x8e,0x25,0xf8,0x27,0xe0,0xbe,0x9,0xf7,0x21,0xa7, + 0x36,0x87,0x68,0x5f,0x27,0x39,0x28,0x79,0x44,0x3c,0x24,0xc3,0x9,0x96,0x63,0x91, + 0x52,0x94,0x82,0x97,0x76,0xbf,0x84,0x4b,0xcd,0x97,0x78,0xdb,0xb,0x5,0x42,0x2c, + 0x8c,0x5b,0x88,0x77,0x6f,0x7e,0x17,0xa1,0xee,0xa1,0xbc,0xed,0x87,0x2,0x1,0x23, + 0xc0,0xdd,0xe3,0xee,0xee,0x57,0x2a,0x22,0xc8,0x2d,0x88,0xae,0x40,0xaf,0x12,0xea, + 0x3b,0xea,0x51,0xda,0x52,0xca,0xdb,0xce,0xc3,0xc9,0x3,0xa3,0xbc,0x47,0x46,0xe0, + 0x83,0x5d,0x47,0x2c,0xb5,0x56,0x6d,0x31,0xe8,0x2b,0x65,0x4a,0xc4,0xfa,0xc6,0x62, + 0x6c,0x10,0x99,0xff,0xf8,0x4c,0xc5,0x19,0x7b,0x76,0xc9,0x21,0x34,0xb4,0x37,0xe0, + 0x1f,0xfb,0xff,0x61,0x96,0xc4,0x28,0x11,0x4a,0xf0,0xca,0x75,0xaf,0x20,0xc8,0x2d, + 0x8,0x69,0xe5,0x69,0x44,0xe7,0x99,0x1a,0x3e,0xd5,0x51,0x5d,0xbc,0x6a,0xf9,0x35, + 0xef,0x57,0x3c,0xb5,0xf5,0x29,0x54,0xb6,0x56,0x12,0xb5,0xbf,0x35,0xf1,0x56,0x7c, + 0x7a,0xe7,0xa7,0xf0,0x75,0xf1,0x75,0x70,0xcf,0xac,0x23,0x39,0x28,0x19,0x53,0xc3, + 0xfa,0xfe,0xfd,0x47,0xfb,0x8d,0x86,0x8f,0xc2,0x67,0x88,0x7b,0x44,0x71,0x4,0x65, + 0x2d,0x65,0x28,0x6b,0x29,0xe3,0x6d,0x17,0xec,0x1e,0x8c,0x8,0xaf,0xe1,0x9d,0xd4, + 0xd7,0x83,0x5d,0x8d,0x46,0x51,0x43,0x11,0xda,0xb4,0x6d,0x66,0xc7,0x12,0x3,0x12, + 0x21,0x11,0x4a,0x10,0xa8,0xc,0x84,0xbb,0x93,0x3b,0xef,0x39,0xf2,0xeb,0xf3,0xa1, + 0x31,0x58,0x1f,0x89,0x34,0x54,0x68,0xd,0x5a,0x7c,0x72,0xec,0x13,0xb3,0x3c,0x14, + 0x1,0x23,0xc0,0x6d,0x49,0xb7,0x61,0x46,0xe4,0xc,0x34,0x77,0x36,0xe3,0x52,0x13, + 0xff,0xc,0xd8,0xcb,0xd9,0x6b,0xd8,0xcc,0x7c,0x47,0x2,0x1c,0xc7,0xe1,0xc4,0xa5, + 0x13,0x78,0x63,0xef,0x1b,0xa8,0x6f,0xaf,0xe7,0x6d,0xcf,0x30,0xc,0xe6,0x46,0xcf, + 0xc5,0x6b,0xd7,0xbf,0x6,0x77,0x39,0xff,0x73,0x37,0xd4,0x38,0x4b,0x9c,0x31,0x6f, + 0xd4,0xbc,0x3e,0xff,0x36,0x39,0x74,0xf2,0xb0,0x95,0xc5,0xa6,0x58,0x47,0x5e,0x5d, + 0x1e,0x51,0x7e,0xce,0xa4,0xd0,0x49,0x23,0x46,0xd,0xc3,0xae,0x46,0xa3,0xaf,0x50, + 0xc2,0x1e,0x1d,0x15,0x57,0x99,0x2b,0xc2,0x3d,0xc3,0x79,0xcf,0xd1,0xa9,0xef,0x44, + 0x41,0x7d,0x81,0x3d,0xbb,0x65,0x57,0x4e,0x95,0x9d,0xc2,0xf,0x67,0x7f,0x30,0x3b, + 0x16,0xe2,0x11,0x82,0x67,0x67,0x3f,0xb,0x99,0x48,0x86,0xb3,0x95,0x67,0x61,0x64, + 0x8d,0xbc,0xe7,0x49,0xc,0x48,0xa4,0x4a,0xa7,0x56,0x50,0xda,0x5c,0x8a,0x17,0x7e, + 0x7a,0x1,0x25,0x4d,0x25,0x44,0xed,0x23,0x3c,0x23,0xb0,0xfa,0x96,0xd5,0xc3,0xda, + 0x30,0xcf,0x8e,0x9a,0x6d,0x71,0x4c,0xc0,0x8,0xe8,0xa,0xf4,0x2a,0xe2,0x64,0xe9, + 0x49,0xa2,0xbc,0x9c,0xe9,0xe1,0x23,0x47,0xc1,0xda,0x6e,0x46,0xc3,0xc8,0x1a,0x91, + 0x51,0x99,0x61,0x76,0x4c,0x2a,0x92,0x62,0x4c,0xc0,0x18,0x0,0xe4,0x46,0xc3,0x60, + 0x32,0x20,0xab,0x3a,0xcb,0x5e,0xdd,0xb2,0x2b,0xaa,0x2e,0x15,0x56,0x1f,0x5a,0x8d, + 0x16,0x4d,0x4b,0xef,0x31,0x89,0x50,0x82,0x65,0xb3,0x96,0x21,0xd6,0x27,0x16,0x1c, + 0x38,0xa4,0x96,0xf1,0x2b,0xdc,0x32,0x60,0x30,0x36,0x68,0x2c,0x15,0xa7,0x23,0xa4, + 0xae,0xad,0xe,0x2f,0xfe,0xfc,0x62,0xaf,0x5a,0x2c,0x1f,0xde,0xa,0x6f,0xac,0xba, + 0x69,0x15,0xa2,0xbd,0xa3,0x1d,0xdc,0x33,0xdb,0x8,0x72,0xf,0x42,0xa0,0xd2,0x7c, + 0xef,0x22,0xda,0x3b,0x7a,0xc4,0x4a,0xe9,0x50,0xcc,0xd1,0x19,0x75,0x48,0x2b,0xe3, + 0x77,0x55,0x7,0xba,0x5,0x22,0xd2,0x6b,0xe4,0x84,0xde,0xdb,0xcd,0x68,0xd4,0xb6, + 0xd5,0x5a,0xc8,0xa6,0xfb,0xb9,0xfa,0xc1,0x5f,0xe9,0xf,0x0,0x90,0x89,0x64,0x8, + 0xf7,0xc,0xe7,0xdd,0xf8,0x35,0x9a,0x8c,0xc8,0x6f,0xc8,0x1f,0x74,0x82,0xa0,0xa3, + 0x30,0xb1,0x26,0xfc,0x70,0xf6,0x7,0x64,0x55,0x99,0x1b,0xb4,0x69,0x11,0xd3,0xb0, + 0x28,0x71,0x11,0x18,0x86,0x41,0xa7,0xae,0x13,0xf9,0xd,0xf9,0xfd,0x9c,0xe1,0x7f, + 0x48,0xc5,0x52,0xc4,0xfa,0xc4,0xe,0x5a,0xae,0xe2,0x8f,0xc6,0xbf,0x4f,0xfc,0x1b, + 0xc7,0x8a,0x8f,0xf1,0x37,0xfc,0x7f,0x1e,0x99,0xf2,0x48,0x9f,0xb3,0xf8,0xe1,0x86, + 0x80,0x11,0x20,0xd2,0xdb,0x7c,0xb0,0x18,0x1f,0x3c,0x7e,0xc4,0xb8,0x29,0x28,0x3, + 0x53,0xd0,0x50,0x40,0xe4,0x9a,0x8a,0xf3,0x8d,0x33,0xd3,0xf4,0x1b,0xee,0xd8,0xcd, + 0x68,0x14,0x35,0x14,0x59,0xe4,0x58,0x84,0xba,0x87,0xf6,0xce,0xa4,0x18,0x86,0x41, + 0x82,0x5f,0x2,0x6f,0x1c,0x32,0x7,0xe,0xf9,0xf5,0xf9,0x50,0x77,0xa9,0xed,0xd5, + 0x35,0xbb,0x90,0x55,0x9d,0x85,0xb5,0x47,0xd6,0x9a,0x9,0x31,0x7a,0x29,0xbc,0xf0, + 0xfa,0x82,0xd7,0xe1,0xe1,0xe4,0x1,0x0,0xa8,0x6a,0xad,0x22,0xa,0x19,0xf6,0x70, + 0xf2,0x20,0x4a,0xf0,0xfa,0xa3,0xc3,0x71,0x1c,0x7e,0xb9,0xf8,0xb,0x3e,0x3d,0x4e, + 0x2e,0x80,0x39,0x25,0x6c,0xa,0xfe,0x3a,0xe7,0xaf,0x23,0x42,0xcb,0x8b,0x1,0x63, + 0x96,0xdc,0xd9,0x13,0x9e,0x4e,0x8d,0xc6,0xd5,0xc1,0x89,0x4b,0x27,0x78,0x9f,0x5b, + 0x1,0x23,0x40,0x72,0x50,0xf2,0x15,0xcb,0x1b,0x1a,0xc,0x76,0x31,0x1a,0x1c,0x38, + 0x14,0x37,0x15,0x5b,0xc,0xf4,0x11,0x5e,0x11,0x66,0xba,0x4a,0xd1,0x3e,0xd1,0x44, + 0x2e,0x99,0xd2,0xe6,0x52,0xa8,0xb5,0xc3,0xc7,0x68,0x74,0xea,0x3b,0xf1,0xc9,0xf1, + 0x4f,0xd0,0xd8,0xd1,0xd8,0x7b,0x4c,0xc8,0x8,0xf1,0x97,0xf1,0x7f,0xc1,0x98,0xc0, + 0x31,0xbd,0xc7,0xaa,0xd5,0xd5,0x44,0x42,0x8d,0xee,0x72,0x77,0x84,0x7b,0xf0,0xbb, + 0xea,0xfe,0xe8,0x94,0xb5,0x94,0x61,0xcd,0xe1,0x35,0xc4,0x15,0xf4,0x7c,0x5c,0x7c, + 0xb0,0x62,0xce,0x8a,0x91,0xe3,0xf6,0x63,0xba,0x27,0x1e,0x3d,0x78,0x38,0x79,0xc, + 0x7b,0x97,0x1a,0x85,0xc,0xad,0x51,0xdb,0x5b,0xee,0x61,0x20,0x64,0x22,0x19,0xc6, + 0x4,0x8c,0x19,0x51,0xa1,0xf7,0x76,0xe9,0x29,0xcb,0xb2,0x38,0x57,0x69,0x99,0x64, + 0x35,0x31,0x64,0xa2,0xd9,0xcd,0x88,0xf4,0x8c,0x24,0x52,0x70,0xac,0x6a,0xad,0x22, + 0x4a,0xbb,0x1f,0xa,0x38,0x8e,0xc3,0xb6,0xf3,0xdb,0x70,0x20,0xff,0x80,0xd9,0xf1, + 0xf1,0x21,0xe3,0xf1,0xd8,0xb4,0xc7,0xcc,0xbe,0xdf,0x85,0xea,0xb,0x44,0x1a,0x54, + 0xa3,0xfd,0x46,0x8f,0xa8,0x99,0xc5,0x95,0x62,0xdd,0xc9,0x75,0x38,0x5b,0x79,0x96, + 0xb8,0xfd,0x9f,0x92,0xfe,0x84,0x39,0xd1,0x73,0x1c,0xd8,0x23,0xfb,0xc2,0x80,0xe9, + 0x5d,0xa5,0x2,0xdd,0x46,0x2f,0xc6,0x97,0x16,0xda,0xba,0x1a,0x68,0xee,0x6c,0xc6, + 0xc5,0xba,0x8b,0xbc,0xed,0x9c,0x24,0x4e,0x18,0x1f,0x32,0xb2,0x2a,0x72,0xda,0xc5, + 0x68,0x98,0x38,0x93,0xc5,0xcb,0xdd,0x57,0x79,0x52,0x89,0x48,0x42,0xe4,0x96,0x61, + 0x39,0x16,0xe7,0xab,0xce,0xdb,0xa3,0x6b,0x36,0x53,0xad,0xae,0xc6,0x9a,0x23,0x6b, + 0xcc,0x8c,0x81,0x44,0x28,0xc1,0xf3,0x73,0x9f,0x47,0x80,0x6b,0x80,0x59,0x5b,0xd2, + 0xfc,0x8c,0xe1,0x5e,0x99,0x6b,0x38,0x90,0x5e,0x9e,0x8e,0x9d,0x59,0x3b,0x89,0xdb, + 0x7,0xb9,0x5,0x61,0xc9,0xb4,0x25,0x23,0x6e,0x9f,0x48,0x2a,0xfc,0x9f,0x1b,0x2d, + 0xde,0x2f,0x7e,0x44,0xf9,0xb6,0x29,0xfd,0x53,0xd7,0x56,0x87,0xe2,0xa6,0x62,0xde, + 0x76,0xd1,0xde,0xd1,0xf0,0x55,0xc,0xaf,0x1c,0x22,0x3e,0xec,0xe2,0x3c,0x6d,0xee, + 0x6c,0xb6,0xc8,0xce,0xf5,0x54,0x78,0xf6,0xa9,0x37,0x95,0xe8,0x9f,0x88,0x94,0xc2, + 0x14,0xde,0x73,0x5a,0x33,0xc3,0x74,0x14,0x5a,0xa3,0x16,0x6b,0x8f,0xae,0x45,0x85, + 0xaa,0xc2,0xec,0xf8,0x4d,0x9,0x37,0x61,0xee,0xa8,0xb9,0x66,0xb1,0xf4,0x3a,0xa3, + 0xe,0x59,0x35,0xfc,0x51,0x5f,0x42,0x81,0x10,0xc9,0x81,0xc9,0x76,0xef,0xeb,0xd5, + 0x44,0xa7,0xbe,0x13,0xff,0x39,0xfd,0x1f,0x33,0x89,0x96,0x81,0x10,0x9,0x44,0xb8, + 0x7b,0xdc,0xdd,0x16,0x45,0xc1,0x46,0x2,0x53,0xc2,0xa7,0x60,0xf5,0xcd,0xab,0x1, + 0x0,0x13,0x43,0x27,0xd2,0xa2,0x4b,0x57,0x9,0x59,0xd5,0x59,0x44,0x5e,0x87,0xa9, + 0xe1,0x53,0x47,0x5c,0x4e,0x8e,0x5d,0x8c,0x46,0x7a,0x79,0xba,0x85,0x6b,0x6a,0x42, + 0xf0,0x84,0x3e,0x37,0xf4,0xc6,0x4,0x76,0xfb,0xef,0xf8,0xf4,0x82,0xf2,0xea,0xf2, + 0xd0,0xa6,0x6d,0xbb,0xa2,0xb5,0x26,0xf6,0xe6,0xee,0xc5,0xd6,0xf3,0x5b,0xcd,0x8e, + 0xc5,0xf9,0xc6,0xe1,0xf9,0xb9,0xcf,0x5b,0xf8,0x20,0x73,0xeb,0x72,0x89,0x36,0xef, + 0xc3,0x3c,0xc2,0x7a,0x23,0xca,0x86,0x13,0x3a,0xa3,0xe,0xe5,0x2d,0xe5,0xa8,0x52, + 0x57,0x21,0xa7,0x26,0x7,0x85,0x8d,0x85,0x28,0x6b,0x29,0x43,0x7d,0x7b,0x3d,0x3a, + 0x74,0x1d,0xd0,0x19,0x75,0x10,0xb,0xc5,0x70,0x95,0xb9,0x76,0xcb,0x76,0x7b,0x45, + 0x21,0x39,0x28,0x19,0xa3,0x7c,0x46,0x21,0xc6,0x27,0x6,0x4a,0xb9,0xd2,0x6e,0x3, + 0xde,0xd1,0xe2,0xa3,0xf8,0x39,0xfb,0x67,0xe2,0xbd,0x8c,0x60,0xb7,0x60,0xdc,0x37, + 0xf1,0xbe,0x11,0xb9,0x81,0x1c,0xe7,0x1b,0x87,0x38,0xdf,0xb8,0x2b,0xdd,0x8d,0x5e, + 0xf4,0x26,0x3d,0xea,0xdb,0xeb,0x51,0xd5,0x5a,0x85,0x2a,0x55,0x15,0xa,0x1a,0xa, + 0x70,0xa9,0xf9,0x12,0xea,0xdb,0xeb,0x51,0xdf,0x5e,0x8f,0x2e,0x43,0x17,0xb4,0x6, + 0xad,0xd5,0x15,0x2a,0xfb,0x22,0xc1,0x2f,0x1,0x5b,0x1f,0xda,0x4a,0x24,0xee,0x39, + 0x14,0x98,0x58,0x13,0x1a,0x3a,0x1a,0x50,0xa9,0xaa,0x44,0x8d,0xba,0x6,0x39,0x75, + 0x39,0xbd,0x25,0x7c,0x1b,0xdb,0x1b,0xa1,0xd1,0x6b,0xa0,0x35,0x92,0x7d,0x77,0x92, + 0xd2,0xae,0x12,0xa1,0xa4,0x5f,0x55,0x80,0xe1,0x8c,0x5d,0xde,0xb2,0xbe,0x56,0x5, + 0x3d,0xc6,0xe1,0x72,0x2,0x95,0x81,0x70,0x93,0xbb,0x99,0xe5,0x3a,0xf4,0x85,0x5a, + 0xab,0xc6,0xa5,0xe6,0x4b,0x57,0x4c,0x5f,0x5e,0xad,0x55,0xe3,0xa3,0xc3,0x1f,0x99, + 0x65,0xb8,0xb,0x18,0x1,0x1e,0x99,0xf2,0x8,0x62,0x7c,0x2c,0xfd,0xce,0x17,0xaa, + 0x2f,0xc0,0xc0,0xe,0x5c,0xd6,0x13,0x0,0xa2,0xbc,0xa2,0x86,0xcd,0x7e,0x86,0x89, + 0x33,0xa1,0x55,0xd3,0x8a,0x83,0x5,0x7,0xb1,0x2f,0x6f,0x1f,0x2e,0xd6,0x5d,0x44, + 0x75,0x6b,0xf5,0x80,0x19,0xf9,0xd,0xed,0xd,0x28,0x6e,0x2c,0xc6,0xf1,0x92,0xe3, + 0xf8,0x2e,0xfd,0x3b,0x78,0x38,0x7b,0x20,0xc9,0x3f,0x9,0xb,0x47,0x2f,0xc4,0x1d, + 0x63,0xef,0x80,0x52,0xa6,0xb4,0x69,0xe6,0xa4,0x35,0x68,0xf1,0x6d,0xda,0xb7,0x56, + 0x95,0xb,0x5e,0x38,0x7a,0xe1,0xb0,0x4e,0xe2,0x1b,0xee,0x18,0x59,0x23,0x9a,0x3a, + 0x9a,0x70,0xac,0xe4,0x18,0x7e,0xbd,0xf8,0x2b,0xca,0x5a,0xca,0x50,0xae,0x2a,0x47, + 0x6b,0x57,0x2b,0xb1,0xe1,0x1e,0xc,0xe1,0x9e,0xe1,0x57,0xdc,0x60,0x98,0x58,0x13, + 0x3a,0xf5,0x9d,0x38,0x5a,0x7c,0x14,0x7,0xa,0xe,0x20,0xaf,0x2e,0xf,0xe5,0xaa, + 0x72,0xb4,0x74,0xb6,0x10,0x29,0xd3,0xda,0x42,0xa0,0x5b,0xe0,0xb0,0x2f,0xed,0xda, + 0x17,0x36,0x1b,0x8d,0x36,0x6d,0x9b,0x85,0xde,0x94,0xb3,0xc4,0x19,0x9,0xfe,0x9, + 0x7d,0xe,0x1e,0xbe,0x2e,0xbe,0x8,0x54,0x6,0x12,0x19,0x8d,0xbc,0xba,0xbc,0x2b, + 0x62,0x34,0x74,0x46,0x1d,0x3e,0x4c,0xf9,0xd0,0x2c,0x99,0x8c,0x1,0x83,0x5,0xb1, + 0xb,0x70,0xd7,0xb8,0xbb,0x2c,0xbe,0x97,0xc1,0x64,0xc0,0xb9,0xaa,0x73,0x30,0x9a, + 0x6,0xce,0x4,0x67,0x18,0xa6,0x7b,0x13,0x5c,0x7a,0x65,0x8d,0x6,0xc7,0x71,0x38, + 0x53,0x71,0x6,0xbb,0x73,0x76,0x63,0xf3,0xd9,0xcd,0xbc,0xbf,0x45,0x7f,0xb0,0x1c, + 0x8b,0xa6,0x8e,0x26,0xa4,0x14,0xa5,0x20,0xa5,0x28,0x5,0x9f,0x1d,0xff,0xc,0xcb, + 0xe7,0x2c,0xc7,0x9f,0xc6,0xfc,0x69,0xd0,0x75,0x1,0x8e,0x14,0x1f,0xb1,0x4a,0x7f, + 0xcc,0xd7,0xc5,0x17,0xf7,0x8c,0xbf,0x67,0x50,0xd7,0xfa,0xa3,0xd3,0xd2,0xd9,0x82, + 0xa3,0x25,0x47,0xf1,0x73,0xce,0xcf,0xd8,0x9f,0xbf,0x7f,0x50,0x85,0xc4,0x6c,0x61, + 0x7e,0xec,0xfc,0x21,0xbd,0xde,0xef,0xd1,0x1a,0xb4,0xc8,0xa8,0xcc,0xc0,0xce,0xac, + 0x9d,0xf8,0xe5,0xe2,0x2f,0x68,0x68,0x1f,0xfa,0x92,0xc,0xd1,0xde,0xd1,0x7f,0x4c, + 0xa3,0x51,0xd7,0x5e,0x87,0xaa,0xd6,0x2a,0xb3,0x63,0x9e,0xce,0x9e,0x8,0xf5,0xe8, + 0x7b,0xe6,0xe7,0xe9,0xec,0x9,0x3f,0x57,0x3f,0x64,0xd7,0x66,0xf,0x78,0x5e,0x9d, + 0x41,0x87,0x82,0x86,0x2,0x98,0x58,0xd3,0x90,0x6f,0x6e,0xa6,0x95,0xa7,0x61,0xf3, + 0xd9,0xcd,0x66,0x33,0xd,0x5f,0x17,0x5f,0x2c,0x9d,0xb5,0x14,0xce,0x52,0xcb,0xc1, + 0xb0,0xb5,0xab,0x95,0x68,0xd3,0x4b,0x2a,0x94,0x22,0xde,0x3f,0xfe,0x8a,0x85,0xd7, + 0x99,0x58,0x13,0x2e,0x35,0x5f,0xc2,0xb7,0x69,0xdf,0x62,0xd7,0x85,0x5d,0xa8,0x6f, + 0xaf,0xef,0x73,0x36,0x25,0x15,0x49,0xe1,0x24,0x76,0x82,0x58,0x24,0x6,0xd0,0xfd, + 0x82,0xb5,0xeb,0xda,0x79,0x67,0x9d,0x65,0x2d,0x65,0x78,0x79,0xcf,0xcb,0x38,0x53, + 0x71,0x6,0x6f,0x2e,0x7c,0xd3,0x2c,0x32,0x88,0x4,0x83,0xc9,0x80,0x6d,0x99,0xdb, + 0xac,0xca,0xd1,0x99,0x11,0x31,0x83,0x48,0x69,0x80,0xd2,0xd,0x7,0xe,0x8d,0xed, + 0x8d,0xf8,0xad,0xf0,0x37,0x7c,0x95,0xfa,0x15,0xa,0x1a,0xa,0xcc,0x84,0x37,0xfb, + 0x43,0x2c,0x14,0x43,0x2e,0x96,0x43,0x22,0x94,0x40,0x28,0x10,0x82,0x1,0x3,0x23, + 0x6b,0x84,0xc6,0xa0,0x41,0x97,0xa1,0xcb,0xea,0x15,0x89,0xb7,0xc2,0xfb,0x8a,0xb8, + 0xe5,0x34,0x7a,0xd,0x32,0x2a,0x33,0xf0,0xe5,0xa9,0x2f,0x91,0x56,0x9e,0x66,0x16, + 0x46,0xdf,0x1f,0x2,0x46,0x0,0x99,0x48,0x6,0xb1,0x50,0xc,0xb1,0x50,0xc,0x91, + 0x40,0x4,0x16,0x2c,0x8c,0x26,0x23,0xb4,0x46,0xed,0xa0,0xbe,0x3f,0x0,0x24,0x5, + 0x24,0xf5,0x39,0x9e,0xc,0x77,0x6c,0x36,0x1a,0x35,0xad,0x35,0xa8,0x6e,0x35,0xf, + 0x8f,0xf5,0x52,0x78,0xf5,0x9b,0x87,0xa0,0x90,0x2a,0x10,0xe9,0x15,0x89,0x83,0x5, + 0x7,0x7,0x3c,0x2f,0x7,0xe,0x39,0xb5,0x39,0xd0,0x19,0x75,0x43,0xba,0x84,0x6d, + 0xed,0x6a,0xc5,0xfb,0xbf,0xbd,0x8f,0xa6,0xce,0xa6,0xde,0x63,0xc,0x18,0xdc,0x37, + 0xf1,0xbe,0x7e,0x35,0x81,0x5a,0x34,0x2d,0x28,0x6a,0x28,0xe2,0x3d,0xb7,0x54,0xfc, + 0x3f,0x59,0x95,0xa1,0x46,0x6b,0xd0,0x62,0xf3,0xb9,0xcd,0xf8,0xe4,0xd8,0x27,0x28, + 0x6d,0xee,0x5b,0xaa,0x59,0x29,0x53,0x62,0x56,0xd4,0x2c,0xcc,0x1b,0x35,0xf,0x11, + 0x9e,0x11,0xf0,0x52,0x78,0x81,0xe3,0x38,0x54,0xb6,0x56,0xe2,0xd7,0x8b,0xbf,0xe2, + 0xa7,0xec,0x9f,0x78,0x33,0x5c,0x3b,0x74,0x1d,0xd8,0x78,0x66,0x23,0x4c,0xac,0x9, + 0x6f,0xdf,0xf8,0xb6,0x55,0x86,0xa3,0x42,0x55,0x81,0xbd,0xb9,0x7b,0x89,0x6b,0xad, + 0x8b,0x85,0x62,0x2c,0x4a,0x5c,0x34,0x22,0xaa,0x9d,0xd,0x7,0xba,0xc,0x5d,0xd8, + 0x97,0xb7,0xf,0x9f,0x1d,0xff,0xc,0x99,0xd5,0x99,0xbc,0x39,0x4,0x42,0x81,0x10, + 0xe1,0x9e,0xe1,0x98,0x1e,0x3e,0x1d,0x71,0x7e,0x71,0xbd,0xf5,0x5f,0x9c,0x24,0x4e, + 0x60,0xc0,0xa0,0x5d,0xd7,0x8e,0xb2,0xe6,0x32,0x64,0xd7,0x66,0xe3,0x40,0xde,0x1, + 0xe4,0x37,0xe4,0x13,0xbb,0x74,0x12,0x3,0x12,0xcd,0x72,0x54,0x86,0x82,0xac,0xea, + 0x2c,0xfc,0xe7,0xd4,0x7f,0xb0,0xeb,0xc2,0x2e,0xa2,0xa2,0x5d,0x4a,0xb9,0x12,0x63, + 0x3,0xc7,0x62,0x72,0xe8,0x64,0x44,0x7b,0x47,0xc3,0xc3,0xc9,0x3,0x1e,0x4e,0x1e, + 0x50,0x48,0x15,0x30,0xb0,0x6,0xa8,0xbb,0xd4,0xa8,0x51,0xd7,0x20,0xaf,0x3e,0xf, + 0xe7,0x2a,0xcf,0x11,0x25,0xf3,0xfd,0x9e,0xe9,0x11,0xd3,0x47,0x64,0xe0,0x83,0xcd, + 0x46,0xe3,0x42,0xcd,0x5,0xb,0x1f,0xf8,0x68,0xdf,0xd1,0x3,0xe6,0x63,0xfc,0x3e, + 0x21,0x6e,0x20,0xb2,0x6b,0xb2,0xa1,0x31,0x68,0x86,0xcc,0x68,0x18,0x59,0x23,0xd6, + 0x9f,0x5e,0x8f,0x33,0xe5,0xe6,0xee,0x91,0xa9,0xe1,0x53,0xb1,0x78,0xd2,0xe2,0x7e, + 0x3f,0x57,0xd4,0x58,0x44,0x14,0xe9,0xe3,0xad,0xf0,0xbe,0x22,0xb3,0xe2,0x82,0x86, + 0x2,0xbc,0x7f,0xe8,0x7d,0xec,0xcd,0xdb,0xb,0xad,0x41,0x6b,0xf1,0x77,0x67,0x89, + 0x33,0xe6,0xc7,0xce,0xc7,0x73,0xd7,0x3c,0x87,0x28,0xef,0x28,0x8b,0x41,0x78,0xb4, + 0xdf,0x68,0xcc,0x8e,0x9a,0x8d,0x5b,0x12,0x6f,0xc1,0xd3,0xdb,0x9e,0x46,0x5d,0x5b, + 0x1d,0xef,0x35,0xb7,0x65,0x6e,0x83,0xbf,0xab,0x3f,0x5e,0x59,0xf0,0xa,0xd1,0x8b, + 0xc1,0x71,0x1c,0x76,0x66,0xed,0x84,0xd6,0x68,0xd9,0xbf,0xfe,0xf0,0x51,0xf8,0xf4, + 0xab,0x14,0x4b,0xf9,0x1f,0x26,0xd6,0x84,0xec,0x9a,0x6c,0x7c,0x74,0xe4,0x23,0xfc, + 0x56,0xf8,0xdb,0x80,0x6e,0x28,0x6,0xc,0xbc,0x14,0x5e,0x98,0x11,0x31,0xa3,0x37, + 0x79,0x55,0x29,0x53,0xf6,0xab,0xe4,0x30,0x2e,0x68,0x1c,0x16,0x25,0x2e,0xc2,0xd3, + 0x33,0x9e,0xc6,0x9e,0x8b,0x7b,0xf0,0xef,0xe3,0xff,0x46,0x71,0x53,0xf1,0x80,0x33, + 0x6f,0x1,0x23,0x40,0x72,0x60,0x32,0x94,0x32,0xa5,0xcd,0xdf,0x8d,0x84,0xa6,0xce, + 0x26,0x6c,0x3b,0xbf,0xd,0x1f,0x1d,0xfe,0x8,0x2d,0x9a,0x81,0xf7,0x2a,0xa4,0x22, + 0x29,0x46,0xfb,0x8d,0xc6,0xa2,0xc4,0x45,0xb8,0x7d,0xcc,0xed,0x70,0x95,0xb9,0x42, + 0x21,0x55,0xc,0xe8,0x1d,0x30,0x71,0x26,0x68,0x74,0x1a,0xe4,0x37,0xe4,0xe3,0xcb, + 0x53,0x5f,0xe2,0xe7,0x9c,0x9f,0x79,0x9f,0x63,0xb9,0x58,0x8e,0x9,0xc1,0x23,0x33, + 0xf4,0xde,0x66,0xa3,0xd1,0xd7,0x26,0x78,0x72,0xd0,0xc0,0x21,0xa5,0x9,0xfe,0xfc, + 0x55,0xfc,0x0,0xa0,0xa1,0xa3,0x1,0xd5,0xad,0xd5,0xf0,0x72,0x1e,0x9a,0x19,0x49, + 0x51,0x63,0x11,0xfe,0x73,0xea,0x3f,0x66,0xb3,0x5,0x89,0x50,0x82,0xa5,0xb3,0x96, + 0x22,0xc0,0x2d,0xa0,0xdf,0xcf,0x9d,0xad,0x3c,0x4b,0xb4,0x3c,0x1d,0x13,0x30,0x66, + 0xc8,0x5d,0x6d,0x59,0xd5,0x59,0x78,0x6a,0xdb,0x53,0xc8,0xaf,0xef,0x7b,0x16,0xe8, + 0xee,0xe4,0x8e,0x17,0xe6,0xbd,0x80,0xfb,0x27,0xde,0x3f,0xe0,0x8c,0x5d,0x2a,0x92, + 0x62,0x76,0xd4,0x6c,0xac,0x9c,0xbb,0x12,0xaf,0xef,0x7d,0x9d,0xd7,0xff,0x6d,0x30, + 0x19,0xf0,0x6d,0xfa,0xb7,0xb8,0x6f,0xe2,0x7d,0x44,0xa5,0x7e,0x9b,0x35,0xcd,0x38, + 0x52,0x7c,0x84,0xb7,0xdd,0xef,0x99,0x1f,0x3b,0xff,0x8a,0x6f,0xa4,0xe,0x77,0xc, + 0x26,0x3,0x76,0x64,0xed,0xc0,0xbb,0x7,0xdf,0x45,0xa5,0xaa,0x92,0x77,0x15,0x77, + 0x4b,0xe2,0x2d,0x58,0x3c,0x79,0x31,0xa6,0x87,0x4f,0x87,0x58,0x28,0x26,0xba,0x86, + 0x50,0x20,0x84,0x97,0xc2,0xb,0xf,0x4c,0x7c,0x0,0xc1,0xca,0x60,0xdc,0xff,0xfd, + 0xfd,0x3,0xce,0xe4,0xa5,0x22,0xe9,0x90,0x55,0x50,0x2c,0x6f,0x29,0xc7,0xcb,0x7b, + 0x5e,0xc6,0xa1,0xc2,0x43,0x66,0x15,0x45,0xfb,0x22,0xc4,0x3d,0x4,0x4b,0x67,0x2d, + 0xc5,0x8d,0xa3,0x6f,0xb4,0x2a,0xc2,0x51,0xc8,0x8,0xe1,0x22,0x73,0xc1,0xc4,0x90, + 0x89,0x8,0xf3,0x8,0xc3,0xf9,0xea,0xf3,0x28,0x6e,0x1c,0xd8,0x5d,0x9d,0x14,0x90, + 0x34,0x62,0x57,0xc8,0x36,0x19,0xd,0x9d,0x51,0x67,0xa1,0x6c,0x2b,0x12,0x88,0x30, + 0x29,0x74,0xd2,0x80,0x9f,0x8b,0xf6,0x8e,0x86,0x8b,0xd4,0x5,0xed,0xba,0x76,0xde, + 0x6b,0xa4,0x96,0xa5,0x12,0xaf,0x4c,0x6c,0x41,0xd5,0xa5,0xc2,0x1b,0x7b,0xdf,0x30, + 0xf3,0x71,0xa,0x18,0x1,0xee,0x1e,0x7f,0x37,0x16,0xc4,0x2d,0xe8,0x77,0xb6,0x6c, + 0x62,0x4d,0x38,0x55,0x7a,0x8a,0xe8,0x1a,0xd3,0xc2,0xa7,0xd9,0xa5,0xaf,0x24,0x70, + 0x1c,0x87,0xcd,0xe7,0x36,0xe3,0xad,0x7d,0x6f,0xf5,0x5b,0x7f,0x22,0xdc,0x33,0x1c, + 0x9f,0xdf,0xf9,0x39,0x26,0x85,0x4e,0x22,0x8a,0x78,0x12,0x30,0x2,0xdc,0x3b,0xfe, + 0x5e,0xec,0xbd,0xb8,0x97,0x28,0xd7,0x46,0xa5,0x51,0x61,0xeb,0xf9,0xad,0x78,0x7e, + 0xee,0xf3,0xbc,0xe7,0x3f,0x5f,0x75,0x1e,0x17,0x6a,0x2e,0xf0,0x9e,0xb3,0x7,0x67, + 0x89,0x33,0x16,0xc6,0x2d,0x24,0x6e,0xff,0x47,0xa4,0xa1,0xbd,0x1,0x2f,0xef,0x79, + 0x19,0xbb,0x73,0x76,0x9b,0xd5,0xb1,0xef,0x8b,0xa4,0x80,0x24,0xfc,0x75,0xce,0x5f, + 0x71,0x4b,0xc2,0x2d,0x83,0x1e,0xcc,0x5,0x8c,0x0,0xf5,0x1d,0xf5,0xbc,0xa5,0x1, + 0x5c,0x65,0xae,0xe,0xf,0x35,0x35,0xb2,0x46,0xfc,0x7a,0xf1,0x57,0xbc,0xb2,0xe7, + 0x15,0xde,0x82,0x5d,0xce,0x12,0x67,0xdc,0x33,0xfe,0x1e,0x2c,0x9f,0xb3,0x1c,0xfe, + 0xae,0xb6,0x85,0xc3,0x6b,0xf4,0x1a,0x8b,0x3d,0xde,0xbe,0x98,0x1d,0x3d,0x7b,0xc4, + 0xe5,0x67,0xf4,0x60,0x93,0xa9,0x2f,0x6e,0x2a,0xb6,0x28,0xba,0x14,0xe8,0x16,0xc8, + 0x5b,0xf7,0x5a,0x24,0x10,0xf5,0x19,0xb6,0xda,0x17,0xd9,0xb5,0xd9,0xc4,0x3e,0x6e, + 0x5b,0xd8,0x91,0xb9,0x3,0x27,0x4b,0xcd,0x6b,0xf9,0x46,0x7b,0x47,0xe3,0xb1,0xa9, + 0x8f,0xd,0xe8,0x5e,0xa9,0x69,0xab,0x21,0x72,0xd7,0x38,0x4b,0x9d,0x31,0xca,0x67, + 0x68,0xca,0x39,0x1a,0x59,0x23,0x76,0x64,0xed,0xc0,0x9b,0xbf,0xbe,0x39,0xa0,0xc1, + 0x58,0x7d,0xf3,0x6a,0x4c,0xe,0xb3,0xae,0xe0,0x8f,0x4c,0x2c,0xc3,0x9f,0x92,0xfe, + 0x44,0xe4,0x72,0x62,0x39,0x16,0xb9,0x75,0xb9,0x44,0x45,0xb5,0x4e,0x97,0x9e,0x26, + 0xda,0x90,0xed,0x21,0xcc,0x23,0x8c,0xea,0x34,0xd,0x40,0x5e,0x7d,0x1e,0x9e,0xdd, + 0xf1,0x2c,0x76,0x66,0xed,0x1c,0xd0,0x60,0x88,0x85,0x62,0xdc,0x30,0xfa,0x6,0x7c, + 0x71,0xd7,0x17,0x58,0x94,0xb0,0xc8,0xa6,0xd9,0xbf,0xde,0xa4,0x47,0x46,0x45,0x6, + 0x6f,0x14,0x61,0x82,0x7f,0x2,0x94,0x72,0xc7,0xb9,0xa6,0xf4,0x46,0x3d,0x36,0x9e, + 0xd9,0x88,0x17,0x7e,0x7a,0x81,0xd7,0x60,0x4,0x2a,0x3,0xb1,0xea,0xa6,0x55,0x78, + 0xeb,0x86,0xb7,0x6c,0x36,0x18,0x40,0x77,0xbe,0x56,0x5f,0x2e,0xe0,0xdf,0xd3,0x13, + 0x5d,0x3a,0x52,0xb1,0x69,0xa5,0x71,0xae,0xf2,0x9c,0x45,0x12,0x4b,0x82,0x5f,0x2, + 0xef,0xb2,0x8b,0x61,0x18,0x8c,0x9,0x1c,0x63,0xb1,0x4a,0xe9,0x8b,0xe2,0xa6,0x62, + 0xb4,0x6b,0xdb,0x1d,0x9a,0xe4,0x57,0xa1,0xaa,0xc0,0xbb,0x7,0xdf,0x35,0x73,0xb9, + 0x30,0xc,0x83,0x67,0x67,0x3f,0xcb,0x5b,0xdb,0xfc,0x62,0xdd,0x45,0x22,0xf9,0xe3, + 0x10,0xf7,0x10,0x4,0x28,0xfb,0x77,0x71,0xd9,0xb,0xe,0x1c,0xb6,0x67,0x6e,0xc7, + 0xdf,0x7e,0xfe,0x5b,0xbf,0xfd,0x52,0x48,0x15,0xf8,0xe7,0xa2,0x7f,0xe,0x7a,0x3f, + 0x60,0x6a,0xf8,0x54,0x78,0x3a,0x7b,0x9a,0x5,0xb,0xf4,0x47,0x4b,0x67,0xb,0xba, + 0xf4,0x5d,0x3,0x3e,0x13,0x1c,0xc7,0xf1,0x6,0x46,0x5c,0x4e,0xbc,0x7f,0xfc,0x88, + 0xcc,0x0,0x77,0x34,0x1c,0xc7,0xe1,0x6c,0xe5,0x59,0x3c,0xb3,0xfd,0x19,0x14,0x34, + 0xc,0x5c,0xcc,0x4c,0x2e,0x96,0x63,0xc9,0xb4,0x25,0x78,0x61,0xee,0xb,0x76,0x89, + 0xe2,0x69,0xea,0x68,0x42,0x46,0x65,0x6,0xef,0x24,0xef,0xda,0x98,0x6b,0x6d,0xbe, + 0x56,0x7f,0x68,0xf4,0x1a,0xac,0x3f,0xbd,0x1e,0xff,0x38,0xf0,0xf,0xde,0xd5,0x55, + 0xa4,0x57,0x24,0x3e,0xb9,0xe3,0x13,0x4c,0x9,0x9b,0x62,0xd7,0xc4,0x54,0x3e,0xfc, + 0x5d,0xfd,0x47,0x4c,0x3d,0xf0,0xbe,0x18,0xf4,0xb4,0xc2,0xc8,0x1a,0x91,0x5d,0x9b, + 0x6d,0x36,0xab,0x60,0x18,0x6,0xb1,0xbe,0xb1,0xbc,0x7e,0x66,0x1,0x23,0x40,0x9c, + 0x5f,0x1c,0xd1,0xac,0xa6,0xa9,0xa3,0xc9,0xa2,0x4e,0x87,0x3d,0x69,0xd7,0xb6,0x5b, + 0x14,0x56,0x62,0x18,0x6,0xf3,0x63,0xe6,0xe3,0x96,0x84,0x5b,0x6,0xfc,0x2c,0xc7, + 0x71,0xc8,0xab,0xcf,0x43,0xa7,0xae,0x93,0xf7,0x3a,0xa1,0xee,0xa1,0xe,0xaf,0xfb, + 0xcc,0x72,0x2c,0xf6,0x5d,0xdc,0x87,0x7f,0xec,0xff,0x47,0xbf,0x6,0xc3,0x49,0xec, + 0x84,0xe7,0xe7,0x3d,0x6f,0x53,0xbd,0x9,0xa5,0x4c,0x49,0x2c,0xac,0x27,0x17,0xcb, + 0x21,0x12,0xe,0x3c,0x37,0xb9,0xd4,0x7c,0x89,0xa8,0x8e,0xf2,0xef,0x99,0x11,0x39, + 0x63,0xc4,0xe9,0x4c,0x39,0x1a,0x96,0x63,0x71,0xb2,0xf4,0x24,0x9e,0xdc,0xf6,0x24, + 0xa,0x1b,0xb,0x7,0x6c,0xab,0x90,0x2a,0xf0,0xf2,0xfc,0x97,0xed,0x66,0x30,0x80, + 0xee,0xdf,0x91,0xaf,0xea,0xa6,0x9b,0xdc,0xcd,0x61,0x11,0x84,0x3a,0xa3,0xe,0x1f, + 0x1f,0xf9,0x18,0xef,0xff,0xf6,0x3e,0xaf,0xc1,0x98,0x10,0x32,0x1,0xff,0xb9,0xfb, + 0x3f,0x98,0x12,0x6a,0x3f,0x83,0xd1,0xda,0xd5,0x4a,0x54,0x40,0x2e,0xc8,0x2d,0x8, + 0x21,0x1e,0x23,0x77,0xc2,0x33,0x68,0xa3,0xd1,0xa6,0x6d,0x43,0x61,0x43,0xa1,0xd9, + 0xac,0x42,0x2e,0x96,0x13,0x1b,0x83,0x50,0x8f,0x50,0xa2,0xd5,0x83,0xa3,0x8d,0xc6, + 0xbe,0xfc,0x7d,0xd8,0x9d,0xbd,0xdb,0xec,0x98,0x8f,0xc2,0x7,0x7f,0x9d,0xfd,0x57, + 0xde,0x15,0x93,0xce,0xa8,0x43,0x4e,0x4d,0xe,0x91,0xac,0x40,0xac,0x6f,0x2c,0x91, + 0xc2,0xaf,0x2d,0x14,0x37,0x15,0xe3,0xe5,0x3d,0x2f,0xf,0xa8,0x10,0x7c,0x6d,0xcc, + 0xb5,0x58,0x3c,0x69,0xb1,0x4d,0x3,0xae,0xb3,0xd4,0x99,0x68,0x96,0x2f,0x60,0x4, + 0x18,0x17,0x3c,0x8e,0xf7,0x77,0x4e,0x2b,0x4f,0x23,0x92,0x5d,0xf8,0xfd,0x79,0x47, + 0x52,0x79,0xcc,0xa1,0x22,0xa3,0x22,0x3,0xcb,0x77,0x2d,0x47,0x71,0xe3,0xc0,0xd1, + 0x4b,0xce,0x12,0x67,0x2c,0x9d,0xb5,0x14,0x4f,0xcd,0x7c,0xca,0xae,0x79,0x2,0x87, + 0xa,0xe,0xf1,0x86,0x9c,0x46,0x78,0x46,0x38,0x64,0xc0,0xd4,0x9b,0xf4,0xf8,0x2e, + 0xfd,0x3b,0x7c,0x7c,0xf4,0x63,0x74,0xea,0x7,0x9e,0xc4,0x45,0x79,0x45,0xe1,0xfd, + 0x5b,0xde,0xc7,0xb8,0xa0,0x71,0x76,0xdd,0x57,0x28,0x69,0x2a,0xe1,0x75,0x87,0x1, + 0xdd,0x85,0xb6,0x64,0xa2,0x91,0x5b,0xea,0x79,0xd0,0x46,0x43,0xa5,0x51,0x59,0xcc, + 0x2a,0xac,0xf1,0xd5,0x85,0xb8,0x87,0xc0,0xd3,0xd9,0x93,0xb7,0x5d,0x9b,0xb6,0x8d, + 0x28,0x71,0x6e,0x30,0x54,0xa8,0x2a,0xb0,0xfa,0xe0,0x6a,0xb3,0x87,0x4c,0xc0,0x8, + 0xb0,0x64,0xda,0x12,0xde,0xcd,0x7c,0xa0,0x3b,0xee,0x9d,0x54,0x8d,0x77,0x4a,0xd8, + 0x94,0x41,0xf7,0x93,0x84,0x6a,0x75,0x35,0x56,0xfe,0xb8,0x72,0xc0,0x19,0x7b,0x98, + 0x47,0x18,0x5e,0x5d,0xf0,0xaa,0xcd,0xae,0x3e,0xa9,0x48,0x8a,0x40,0x65,0x20,0xef, + 0xb,0x17,0xe7,0x1b,0x87,0x47,0xa6,0x3c,0x32,0x70,0xb8,0x22,0x6b,0x42,0x66,0x75, + 0x26,0xaf,0x1f,0xfc,0xf7,0x44,0x7b,0x47,0xc3,0xd7,0x65,0x64,0x29,0x83,0x3a,0x9a, + 0x9c,0xda,0x1c,0x3c,0xfe,0xdf,0xc7,0x79,0xa3,0x76,0xc4,0x42,0x31,0x9e,0x9f,0xfb, + 0x3c,0x9e,0xbd,0xe6,0x59,0xbb,0x46,0x2f,0xb5,0x69,0xdb,0x70,0xa8,0xe0,0x10,0x6f, + 0xbb,0x78,0xff,0x78,0xf8,0xb9,0xd8,0xb7,0x9c,0x2d,0xcb,0xb1,0xd8,0x90,0xbe,0x1, + 0x6f,0xed,0x7f,0x8b,0x77,0x85,0x11,0xee,0x19,0x8e,0xcf,0xee,0xfc,0xcc,0x21,0x4a, + 0x13,0xe7,0x2a,0xcf,0xa1,0xbe,0xad,0xef,0x3d,0xc4,0xdf,0x73,0x4d,0xd4,0x35,0x76, + 0xbf,0xf6,0x50,0x32,0xe8,0xa7,0xa6,0x52,0x55,0x69,0x51,0xa9,0xcf,0x4d,0xee,0x46, + 0x14,0x5e,0x9,0x0,0x1,0xae,0x1,0x44,0x32,0xd0,0x1c,0x38,0xe4,0xd6,0xe5,0xe, + 0xa6,0x8b,0x3,0xa2,0x35,0x68,0xb1,0xee,0xe4,0x3a,0x94,0xab,0xcc,0x2b,0xed,0x25, + 0x7,0x25,0xe3,0x9e,0x71,0xf7,0x10,0xbd,0x50,0x8d,0x1d,0x8d,0x16,0xa,0xb8,0x7d, + 0xc1,0x30,0x8c,0x43,0xe5,0x50,0x38,0x8e,0xc3,0xe7,0xc7,0x3f,0x1f,0xb0,0x3e,0xb9, + 0x44,0x28,0xc1,0xe2,0xc9,0x8b,0xed,0x92,0x27,0xc2,0x80,0x41,0xb4,0x77,0xb4,0x99, + 0xac,0xf7,0xe5,0x7f,0x8f,0xf1,0x89,0xc1,0xbb,0x37,0xbf,0xcb,0x1b,0x14,0xd1,0x93, + 0x20,0x66,0x4d,0xb0,0x43,0x62,0x40,0x22,0x71,0x38,0xe8,0x1f,0x81,0xa,0x55,0x5, + 0x5e,0xfd,0xe5,0x55,0x94,0xb5,0xc,0x7c,0x1f,0x85,0x8c,0x10,0x7f,0x4a,0xfa,0x13, + 0x96,0x4c,0x5b,0x62,0xf7,0xca,0x86,0x19,0x95,0x19,0xa8,0x69,0xe3,0xf7,0x8,0x4c, + 0xb,0x9f,0x66,0x57,0xb7,0x22,0x7,0xe,0xc7,0x4b,0x8e,0xe3,0xc3,0xc3,0x1f,0xf2, + 0xba,0x89,0x5d,0xa4,0x2e,0x78,0x71,0xde,0x8b,0xc4,0xd1,0x82,0xd6,0x92,0x52,0x94, + 0xc2,0xeb,0x75,0xf0,0x72,0xf6,0x42,0x94,0x77,0x94,0xdd,0xaf,0x3d,0x94,0xc,0xda, + 0x68,0xa4,0x96,0xa7,0x5a,0xc4,0xfd,0x8f,0xb,0x1e,0x47,0xfc,0x30,0x2a,0xa4,0xa, + 0xe2,0x8,0xaa,0xb3,0x15,0xf6,0x97,0x49,0x4f,0x29,0x4a,0xc1,0x37,0x69,0xdf,0x98, + 0x65,0xc5,0xba,0xc8,0x5c,0xf0,0xf2,0xfc,0x97,0x89,0x37,0xac,0xd3,0xca,0xd3,0x78, + 0xc3,0xb,0x81,0xee,0x99,0x31,0xdf,0xe0,0x39,0x58,0x38,0x74,0x6f,0x22,0x7f,0x71, + 0xea,0x8b,0x1,0x67,0x59,0x63,0x2,0xc7,0xe0,0x91,0x29,0x8f,0xd8,0x4d,0x9,0x76, + 0x41,0xdc,0x2,0x24,0x6,0x24,0x5a,0x1c,0x77,0x77,0x72,0xc7,0xdd,0xe3,0xee,0xc6, + 0xce,0x47,0x77,0x62,0x66,0xe4,0x4c,0xde,0xf3,0xa8,0x34,0x2a,0x94,0x34,0x95,0x10, + 0x5f,0x57,0xc0,0x8,0x30,0x26,0x60,0xc,0xc4,0x2,0x6a,0x34,0x80,0x6e,0x19,0xf9, + 0x95,0x3f,0xae,0x24,0xda,0x80,0x9d,0x17,0x33,0xf,0xef,0xdc,0xfc,0x8e,0xdd,0x73, + 0x5b,0xc,0x26,0x3,0xf6,0xe7,0xed,0x87,0x4a,0xa3,0x1a,0xb0,0x9d,0x48,0x20,0xc2, + 0xec,0xe8,0xd9,0x76,0xbd,0x76,0x41,0x7d,0x1,0x96,0xef,0x5a,0xce,0x1b,0xc1,0xc8, + 0x30,0x4c,0xaf,0x2e,0x9a,0x23,0x68,0xd1,0xb4,0xe0,0x70,0xd1,0x61,0xde,0x76,0xe3, + 0x83,0xc7,0xc3,0x55,0x7a,0xe5,0x94,0xbb,0xed,0xc1,0xa0,0x46,0x10,0x8e,0xe3,0x70, + 0xae,0xf2,0x9c,0xc5,0xf1,0x71,0x41,0xe3,0xac,0x3a,0xf,0xa9,0x2b,0xab,0xa4,0xb9, + 0x4,0x9d,0xfa,0x4e,0xbb,0x25,0xc3,0xd4,0xa8,0x6b,0xf0,0xf1,0x91,0x8f,0xcd,0x42, + 0xe3,0x4,0x8c,0x0,0xb7,0x26,0xde,0x4a,0x34,0xd0,0x1,0xdd,0x83,0x35,0x49,0xf4, + 0x17,0xd0,0x7d,0x5f,0x1c,0x25,0x17,0x50,0xa9,0xaa,0xc4,0x47,0x87,0x3f,0x1a,0xd0, + 0x78,0x49,0x45,0x52,0x2c,0x99,0xb6,0xc4,0xae,0x7b,0x2a,0x4a,0x99,0x12,0x6b,0x6e, + 0x5b,0x83,0x6f,0xd2,0xbe,0x41,0x7a,0x45,0x3a,0x5c,0x65,0xae,0x98,0x14,0x32,0x9, + 0xb,0xe2,0x16,0x20,0xc1,0x9f,0x3f,0x82,0xae,0x87,0x76,0x5d,0x3b,0xea,0xda,0xf9, + 0x43,0x96,0x7b,0x70,0x96,0x38,0x23,0xcc,0x23,0x6c,0xc4,0xc6,0xb8,0xdb,0x13,0x9d, + 0x51,0x87,0x75,0x27,0xd7,0x11,0xd,0x56,0x61,0x9e,0x61,0xf8,0xdb,0xfc,0xbf,0x59, + 0xad,0x7,0x46,0x2,0xa9,0x6b,0x6a,0xb4,0xdf,0x68,0xbb,0x26,0xea,0xaa,0x34,0x2a, + 0xac,0x3e,0xb4,0xda,0xa2,0x96,0xcf,0xe5,0x30,0xc,0x83,0x6b,0xa2,0xae,0xc1,0xa3, + 0x53,0x1f,0x75,0xd8,0xa,0xf5,0x60,0xc1,0x41,0xde,0x7d,0x39,0x86,0x61,0x90,0x14, + 0x90,0x4,0x99,0x64,0xe4,0xee,0x67,0x0,0x83,0x34,0x1a,0x8d,0x9d,0x8d,0x28,0x69, + 0x36,0x9f,0x1d,0xca,0x44,0xb2,0x3e,0x67,0x9e,0x3,0x41,0x9a,0xb4,0xa7,0x37,0xea, + 0x91,0x57,0x9f,0x67,0x97,0xb4,0x7b,0x13,0x6b,0xc2,0x17,0xa7,0xbe,0xb0,0xd8,0x8b, + 0x88,0xf6,0x8e,0xc6,0xd2,0x59,0x4b,0x89,0x1f,0xaa,0xb6,0xae,0x36,0xe4,0xd5,0xe5, + 0xf1,0xb6,0xeb,0xd9,0xc,0x76,0xd4,0x20,0xf7,0x7d,0xc6,0xf7,0x48,0xaf,0x48,0x1f, + 0xb0,0xcd,0xe4,0xd0,0xc9,0x98,0x13,0x65,0xff,0x32,0xa8,0xf1,0xfe,0xf1,0xf8,0xe0, + 0xd6,0xf,0x6c,0x3a,0x47,0x5d,0x5b,0x9d,0x55,0xea,0xaa,0x2e,0x32,0x17,0x4,0xbb, + 0x7,0xdb,0x74,0xcd,0xab,0x85,0xdf,0xa,0x7f,0xc3,0x27,0xc7,0x3e,0xe1,0x5d,0xed, + 0xca,0xc5,0x72,0xbc,0x74,0xed,0x4b,0x48,0xa,0x48,0x72,0x48,0x3f,0x4e,0x95,0x9e, + 0xe2,0x1d,0xb8,0x81,0x6e,0x5f,0xbe,0x90,0xb1,0x8f,0x6b,0x8a,0xe3,0x38,0x7c,0x95, + 0xfa,0x15,0xf6,0xe5,0xed,0xe3,0x6d,0x1b,0xa4,0xc,0xc2,0xab,0xd7,0xbd,0xea,0xb0, + 0x40,0x94,0x4e,0x7d,0x27,0xf6,0x5e,0xdc,0xcb,0xdb,0x4e,0x21,0x51,0x60,0x4c,0xe0, + 0x18,0xbb,0xdd,0x83,0x2b,0xc5,0xa0,0xdc,0x53,0x5,0xf5,0x5,0x16,0x4a,0xa4,0xa1, + 0x1e,0xa1,0x56,0x6f,0x70,0x85,0xb8,0x87,0x10,0xef,0x6b,0x64,0x55,0xf1,0x87,0xb2, + 0x91,0x70,0xa6,0xe2,0xc,0xbe,0x3a,0xfd,0x95,0xd9,0x8b,0x26,0x14,0x8,0xb1,0x62, + 0xce,0xa,0x44,0x7a,0x45,0x12,0x9f,0xa7,0xac,0xa5,0x8c,0x68,0x86,0xec,0xee,0xe4, + 0xee,0xb0,0x98,0xec,0xec,0x9a,0x6c,0x7c,0x7f,0xe6,0x7b,0x5e,0x9d,0x9f,0xfb,0x27, + 0xde,0xf,0x4f,0x5,0x7f,0xd0,0xc1,0x95,0x80,0x64,0xb0,0xf9,0x3d,0x2e,0x52,0x17, + 0x4,0xba,0x5,0x3a,0xa8,0x37,0x23,0x87,0xb2,0x96,0x32,0xac,0x3a,0xb0,0x8a,0x57, + 0x11,0x58,0xc0,0x8,0x70,0x5b,0xd2,0x6d,0xb8,0x2d,0xe9,0x36,0x87,0xc8,0x76,0x74, + 0x19,0xba,0xb0,0xe5,0xdc,0x16,0xde,0x76,0xce,0x12,0x67,0x4c,0xc,0x99,0x68,0xb7, + 0xc9,0x53,0x56,0x4d,0x16,0xfe,0x75,0xf4,0x5f,0xbc,0xb3,0x7b,0x1,0x23,0xc0,0x13, + 0x33,0x9e,0x70,0xe8,0x9e,0x62,0x71,0x63,0x31,0x32,0x2a,0xf8,0xbd,0xe,0x4a,0xb9, + 0xd2,0x61,0x86,0x7b,0x28,0x19,0xd4,0x53,0x54,0xd8,0x58,0x68,0x91,0x9,0x1e,0xea, + 0x11,0xa,0xf,0x67,0xeb,0x96,0xbe,0x4e,0x12,0x27,0xa2,0x8d,0x59,0x8e,0xe3,0x70, + 0xb1,0xfe,0xa2,0xcd,0x45,0x51,0x9a,0x3a,0x9b,0xf0,0xd1,0xe1,0x8f,0x2c,0x42,0xf2, + 0xa6,0x87,0x4f,0xc7,0xad,0x49,0xb7,0x5a,0xf5,0x52,0x95,0xab,0xca,0xd1,0xd8,0xce, + 0x2f,0xab,0xec,0xe5,0xec,0xd5,0xaf,0x4c,0xbc,0x2d,0xe8,0x8c,0x3a,0x7c,0x9f,0xf1, + 0x7d,0xbf,0x19,0xdf,0x3d,0xf8,0xba,0xf8,0x62,0xe1,0xe8,0x85,0xc3,0x56,0x4d,0xd3, + 0xda,0x70,0x6a,0xa5,0x5c,0x9,0x77,0xb9,0xbb,0x83,0x7a,0x33,0x32,0xd0,0x19,0x75, + 0x58,0x77,0x62,0x1d,0x6f,0xf2,0x1e,0xd0,0x1d,0xe2,0xfa,0xd4,0xcc,0xa7,0x20,0x11, + 0xf6,0x2d,0x38,0x68,0x2b,0xb9,0xb5,0xb9,0x38,0x5f,0xcd,0x1f,0x41,0xe8,0xeb,0xe2, + 0x4b,0xbc,0x87,0xc9,0x87,0x4a,0xa3,0xc2,0x87,0x29,0x1f,0x12,0xc9,0x10,0x4d,0x8, + 0x99,0x80,0x7b,0xc6,0xdd,0xe3,0xd0,0x9c,0x9e,0x13,0x97,0x4e,0xa0,0x56,0x5d,0xcb, + 0xdb,0x2e,0xd8,0x2d,0xf8,0xaa,0x98,0xf0,0x58,0x6d,0x34,0xf4,0x26,0x3d,0xb2,0xaa, + 0xb3,0xcc,0x36,0x5d,0x19,0x30,0x88,0xf3,0x8d,0xb3,0x3a,0x94,0xd3,0x49,0xe2,0x44, + 0xac,0xa9,0x5f,0xd2,0x54,0x42,0x94,0x79,0x3d,0x10,0x5f,0x9e,0xfa,0x12,0x29,0x45, + 0xe6,0x9a,0x49,0x21,0xee,0x21,0x78,0xe3,0xfa,0x37,0xac,0xf6,0x75,0x9e,0xad,0x3c, + 0x4b,0xa4,0xc8,0x1a,0xe4,0x16,0xe4,0x90,0x42,0x2b,0x5,0xd,0x5,0xd8,0x72,0x6e, + 0xcb,0x80,0x86,0x94,0x61,0x18,0x3c,0x30,0xe9,0x81,0x61,0x2d,0x8c,0x76,0x79,0x4, + 0x1e,0x1f,0xa1,0xee,0xa1,0x7f,0xf8,0xa4,0xbe,0x23,0xc5,0x47,0xf0,0x75,0xda,0xd7, + 0xbc,0xd2,0xe6,0x0,0xb0,0x62,0xee,0xa,0x8c,0xf6,0x1b,0xed,0xb0,0xbe,0x6c,0xcf, + 0xda,0x4e,0x34,0x60,0x46,0x7a,0x45,0x22,0xc2,0x2b,0xc2,0x2e,0xd7,0xdc,0x7a,0x7e, + 0x2b,0x91,0x5b,0x4a,0x29,0x57,0x62,0xf9,0x9c,0xe5,0x70,0x77,0x72,0xdc,0x24,0x43, + 0xa3,0xd7,0xe0,0x87,0xb3,0x3f,0x10,0x45,0xff,0xcd,0x8a,0x9a,0x75,0xc5,0x6a,0xe9, + 0xd8,0x13,0xab,0xbf,0x81,0xce,0xa8,0xb3,0xa8,0xd4,0x27,0x10,0x8,0x30,0x26,0x70, + 0x8c,0xd5,0xb3,0x59,0xa9,0x50,0x8a,0x8,0xcf,0x8,0xa2,0x1b,0x59,0xa3,0xae,0x19, + 0x74,0x85,0x39,0xa0,0x5b,0xee,0xe3,0xf2,0x68,0x29,0x1,0x23,0xc0,0xbd,0x13,0xee, + 0x45,0x52,0xa0,0xf5,0x4b,0x46,0xd2,0x88,0xae,0xa4,0x80,0x24,0xbb,0xd7,0xae,0x66, + 0x39,0x16,0x5b,0xce,0x6d,0xb1,0x58,0xed,0x5d,0x8e,0xb7,0xc2,0x7b,0xd8,0xc7,0x84, + 0xf3,0x45,0xdc,0x5c,0xce,0x50,0x48,0xb1,0xc,0x67,0x1a,0x3b,0x1a,0xf1,0xef,0xe3, + 0xff,0xe6,0xcd,0x47,0x0,0xba,0x3,0x30,0x6e,0x4d,0xbc,0xd5,0x61,0xab,0x4c,0x75, + 0x97,0x1a,0x3b,0xb3,0x76,0x12,0xb5,0x9d,0x12,0x36,0xc5,0x2e,0xef,0x41,0x7d,0x7b, + 0x3d,0xbe,0x3c,0xfd,0x25,0x51,0xd4,0xe2,0xb4,0xf0,0x69,0x98,0x15,0x39,0xcb,0xe6, + 0x6b,0xe,0xc4,0x89,0x4b,0x27,0x50,0xde,0x52,0xce,0xdb,0x4e,0x28,0x10,0x62,0x62, + 0xc8,0x44,0x97,0x47,0xf7,0xd2,0x0,0x0,0x20,0x0,0x49,0x44,0x41,0x54,0x87,0xf6, + 0x65,0xa8,0xb0,0xda,0x68,0xa8,0xbb,0xd4,0xb8,0x58,0x77,0xd1,0xfc,0x24,0x8c,0x60, + 0x50,0x9b,0xd4,0xc,0xc3,0x60,0x94,0xcf,0x28,0xc8,0xc5,0x72,0xde,0xb6,0x95,0xad, + 0x95,0x83,0x2e,0xc9,0xa8,0xea,0x52,0x61,0xd5,0x81,0x55,0x68,0xea,0x30,0xd7,0x4a, + 0x1a,0x1f,0x3c,0x1e,0x4b,0xa6,0x2e,0xb1,0xfa,0x61,0xbe,0xd2,0x49,0x7d,0x85,0xd, + 0x85,0x44,0x33,0xad,0x4,0xbf,0x4,0x24,0xfa,0x5b,0x17,0x9c,0x30,0xd4,0x58,0xbb, + 0x7a,0xb4,0x46,0xb2,0xfa,0x6a,0xe4,0xbf,0xe7,0xff,0x3b,0x60,0x3e,0x4e,0xf,0x4a, + 0xb9,0x12,0x2b,0xe6,0xae,0x80,0x4c,0xec,0x98,0x48,0x1d,0x8e,0xe3,0xb0,0xe9,0xec, + 0x26,0x22,0xfd,0x31,0xa1,0x40,0x88,0x39,0xd1,0xb6,0x7,0x62,0x18,0x4c,0x6,0xac, + 0x3f,0xbd,0x9e,0x48,0x72,0x46,0x29,0x57,0x62,0xd9,0xac,0x65,0x44,0x63,0xcb,0x60, + 0xd1,0xe8,0x35,0xd8,0x9e,0xb9,0x9d,0x37,0x3,0x1d,0xe8,0xf6,0x68,0xf4,0x57,0x98, + 0x6e,0xa4,0x61,0xb5,0xd1,0xc8,0xae,0xc9,0xb6,0xd8,0x7c,0xf2,0x77,0xf5,0x1f,0xb4, + 0xaf,0x2e,0xd2,0x2b,0x92,0xc8,0x7d,0xa2,0x35,0x68,0x51,0xd4,0xc8,0x5f,0x1d,0xef, + 0x72,0x7a,0x8a,0xfb,0xfc,0x56,0xf8,0x9b,0xd9,0x12,0xd2,0xc3,0xc9,0x3,0xcb,0xe7, + 0x2c,0x27,0xda,0x88,0xbf,0x9c,0xec,0x9a,0x6c,0x74,0x19,0xf9,0x2b,0x7f,0x29,0xa4, + 0xa,0xc4,0xfa,0xc6,0x5a,0x7d,0xfe,0x81,0xe0,0x38,0xe,0x29,0x85,0x29,0xa8,0x54, + 0xf1,0xcb,0x15,0x5c,0x1b,0x73,0xad,0xc3,0xa5,0x4b,0x6c,0xc5,0x1a,0xf9,0x10,0x0, + 0x43,0x56,0x5b,0x65,0x38,0xa2,0xd2,0xa8,0xb0,0xee,0xc4,0x3a,0xa2,0xea,0x70,0x33, + 0x23,0x66,0xe2,0x9a,0x48,0xc7,0xad,0x32,0xab,0xd5,0xd5,0xd8,0x99,0xb5,0x93,0xa8, + 0x8e,0x4c,0xa4,0x57,0xa4,0x5d,0x5c,0xb4,0x97,0x9a,0x2f,0x61,0xeb,0xf9,0xad,0xbc, + 0x6e,0x39,0x6,0xdd,0xda,0x71,0x8e,0x56,0x92,0x2d,0x6e,0x2a,0xc6,0xa1,0x42,0xfe, + 0x50,0x63,0x0,0x88,0xf1,0x89,0x19,0xb6,0xc1,0x28,0xd6,0x62,0xb5,0xd1,0xe8,0x2b, + 0xbc,0x33,0x39,0x28,0x79,0xd0,0xbe,0xba,0x70,0xcf,0x70,0xe2,0x81,0x8d,0x44,0xc, + 0xec,0x72,0x8a,0x9a,0x8a,0xf0,0xd9,0xf1,0xcf,0x2c,0x6,0xa7,0x9b,0x13,0x6e,0xc6, + 0xb5,0x31,0xd7,0xe,0x2a,0x9a,0x23,0xbd,0x22,0x9d,0xe8,0x65,0x89,0xf1,0x89,0x81, + 0x8b,0xcc,0xc5,0xea,0xf3,0xf,0x84,0x89,0x33,0x61,0xc7,0x85,0x1d,0xbc,0xcb,0x73, + 0xa1,0x40,0x88,0xb9,0xa3,0xe6,0xda,0xf5,0xda,0x8e,0xc0,0x9a,0xf2,0x98,0x0,0x6, + 0x65,0xe4,0xaf,0x6,0x38,0x8e,0xc3,0xc6,0x33,0x1b,0x7,0xd4,0x15,0xeb,0x41,0x24, + 0x14,0xe1,0xb1,0xe9,0x8f,0x39,0xb4,0xfe,0xf4,0xe1,0xa2,0xc3,0xc4,0xef,0xe3,0xf8, + 0xa0,0xf1,0x70,0x91,0xda,0xfe,0x1e,0x6c,0xcf,0xdc,0x4e,0xa4,0xc0,0x20,0x15,0x4b, + 0x71,0xcf,0xb8,0x7b,0x1c,0x3e,0x61,0xda,0x72,0x6e,0xb,0x91,0x7b,0x95,0x61,0x18, + 0xc4,0xfb,0xc7,0x8f,0xf8,0xa4,0xbe,0x1e,0xac,0x1a,0xe9,0xbb,0xc,0x5d,0xc8,0xac, + 0xca,0x34,0x3b,0xc6,0x80,0xc1,0xe4,0xd0,0xc9,0x83,0xee,0x80,0x5c,0x2c,0x27,0x8e, + 0xaa,0xc8,0xac,0xce,0xb4,0xaa,0x80,0x7b,0xa7,0xbe,0x13,0xef,0x1d,0x7a,0xcf,0x62, + 0x39,0x1b,0xef,0x17,0x8f,0x65,0xb3,0x96,0xd,0xca,0xc7,0xaa,0x33,0xea,0x88,0x5d, + 0x53,0x89,0x1,0x89,0x70,0x16,0xdb,0xf7,0xc5,0xcd,0xab,0xcb,0xb3,0xf8,0xd,0xfa, + 0x62,0x4c,0xc0,0x98,0x11,0xe1,0xff,0xb7,0xe6,0xf7,0x4,0x60,0x97,0xc1,0x67,0x24, + 0x52,0xd2,0x5c,0x42,0x14,0xda,0xa,0x0,0xd7,0xc5,0x5c,0x67,0x75,0xa2,0xad,0x35, + 0xb4,0x76,0xb5,0x62,0xdd,0xc9,0x75,0x44,0xfb,0xa,0x12,0x91,0x4,0x13,0x43,0x27, + 0xda,0xec,0x26,0x2b,0x69,0x2a,0xc1,0x8e,0xac,0x1d,0x44,0x6d,0xc7,0x7,0x8f,0x77, + 0xf8,0x5e,0x5e,0x6e,0x5d,0x2e,0xf6,0xe6,0xf2,0xe7,0x66,0x0,0x80,0x58,0x20,0xc6, + 0xd4,0xb0,0xa9,0x57,0x4d,0x42,0xaa,0x55,0x46,0xa3,0xb6,0xad,0xd6,0x22,0x37,0xc1, + 0x59,0xea,0x6c,0x73,0x31,0x1c,0xbe,0x9a,0x15,0xbf,0xbf,0x3e,0x49,0x2d,0xee,0x1e, + 0x52,0xa,0x53,0xf0,0x4b,0xee,0x2f,0x66,0x3,0x93,0x58,0x28,0xc6,0xe3,0xd3,0x1f, + 0x47,0xa8,0xe7,0xe0,0xc2,0x60,0x9b,0x3a,0x9b,0x88,0x7c,0xaa,0x22,0x61,0x77,0xa1, + 0xa9,0xfe,0x6a,0x2b,0xf,0x96,0xfd,0xf9,0xfb,0x89,0x42,0x8f,0xc7,0x87,0x8c,0xc, + 0x25,0x4d,0x6b,0x35,0x90,0x1c,0xe5,0xa3,0x1f,0xee,0xa4,0x14,0xa6,0xf0,0xca,0x9d, + 0x3,0xdd,0xf9,0x10,0xb7,0x25,0xdd,0xe6,0xb0,0x32,0xb8,0x1c,0xc7,0x61,0x77,0xf6, + 0x6e,0x62,0xe9,0x17,0x17,0xa9,0x8b,0xcd,0x95,0x37,0x59,0x8e,0xc5,0x81,0xfc,0x3, + 0x44,0x15,0xf1,0x84,0x2,0x21,0xee,0x4e,0xbe,0xdb,0xa1,0x11,0x76,0x26,0xd6,0x84, + 0xdd,0xd9,0xbb,0x89,0x56,0x7d,0x40,0xf7,0x33,0xee,0x48,0x23,0x3e,0xd4,0x58,0x65, + 0x34,0x4a,0x9b,0x4b,0x2d,0x6e,0x54,0x80,0x32,0xc0,0xe6,0x3c,0x84,0xe4,0xa0,0x64, + 0xa2,0x8,0xf,0x8d,0x5e,0x43,0x94,0x85,0xd,0x74,0x27,0xdc,0xac,0x3a,0xb0,0xca, + 0xc2,0x2d,0x75,0x6d,0xcc,0xb5,0xb8,0x77,0xc2,0xbd,0x83,0xce,0xca,0xac,0x6d,0xab, + 0xc5,0xa5,0x26,0xfe,0x84,0x34,0x17,0xa9,0x8b,0xd5,0x19,0xf2,0x7c,0xb4,0x68,0x5a, + 0x70,0xac,0xe4,0x18,0x6f,0x3b,0xa9,0x48,0x8a,0xb1,0x81,0x63,0x47,0x84,0xa8,0x9f, + 0xb5,0x86,0xcd,0xde,0x91,0x68,0x23,0x81,0xe,0x5d,0x7,0xd6,0xa7,0xae,0x27,0xa, + 0xb1,0x1d,0xe5,0x33,0xa,0xb,0xe3,0x1c,0x97,0x97,0x53,0xd3,0x56,0x83,0x75,0x27, + 0xd7,0x11,0xef,0x45,0xf9,0xbb,0xfa,0xdb,0x1c,0x8c,0xd1,0xa1,0xeb,0xc0,0xa6,0x8c, + 0x4d,0x44,0x11,0x63,0x71,0xbe,0x71,0x98,0x11,0x39,0xc3,0xa6,0xeb,0xf1,0x51,0xa3, + 0xae,0xc1,0x57,0xa9,0x5f,0x11,0xad,0xb4,0x80,0x6e,0xe5,0xb,0x47,0x86,0xfd,0xe, + 0x35,0x56,0x19,0x8d,0xc2,0x86,0x42,0x8b,0x92,0x9c,0x7e,0x2e,0x7e,0x8,0x70,0xb5, + 0xcd,0xd,0x12,0xe4,0x16,0x4,0x37,0x27,0x7e,0x5f,0x35,0xe9,0x66,0xb8,0x89,0x35, + 0xe1,0xb3,0x13,0x9f,0x59,0x48,0xaa,0x87,0xb8,0x87,0x60,0xd9,0xac,0x65,0x36,0xc5, + 0x4a,0x17,0x35,0x16,0x41,0xad,0x1d,0x38,0xb,0x17,0xe8,0x36,0x1a,0xf6,0xce,0x4, + 0xaf,0x54,0x55,0x12,0x19,0x2c,0xa5,0x4c,0x39,0x62,0x4a,0xa1,0x5a,0xfb,0x32,0xd9, + 0x9a,0xe0,0x39,0x12,0x39,0x5c,0x74,0x18,0x55,0x2a,0xfe,0x59,0x36,0xc3,0x30,0xb8, + 0x35,0xe9,0x56,0x87,0xed,0x65,0xb0,0x1c,0x8b,0x1d,0x99,0x3b,0x88,0x92,0xa,0x7b, + 0x98,0x1a,0x36,0xd5,0xe6,0xc9,0xcb,0xf9,0xaa,0xf3,0xc8,0x6f,0xc8,0x27,0x6a,0x3b, + 0x3d,0x62,0xba,0x43,0xf2,0xa2,0x7a,0x30,0xb2,0x46,0x7c,0x77,0xe6,0x3b,0x34,0x77, + 0x92,0x7b,0x3c,0xa6,0x84,0x3b,0xb6,0x2c,0xc2,0x50,0x63,0xd5,0xe8,0xd9,0xd7,0x6, + 0xf0,0x68,0xbf,0xd1,0x36,0x3f,0xa4,0x1e,0x4e,0x1e,0x8,0x76,0xe3,0xd7,0x13,0xd2, + 0x9b,0xf4,0x28,0x6c,0x28,0xe4,0xb5,0xf0,0x27,0x2e,0x9d,0xc0,0xc6,0x33,0x1b,0x2d, + 0x66,0x66,0x8f,0x4c,0x7d,0xc4,0xe6,0x58,0xe9,0xb4,0xb2,0x34,0x22,0x3f,0x7c,0xb8, + 0x67,0xb8,0xdd,0x95,0x6d,0x8b,0x1a,0x8b,0x50,0xdb,0xc6,0x9f,0x48,0xe5,0x2a,0x73, + 0x45,0x84,0xa7,0x7d,0x12,0xa9,0x1c,0x8d,0x9f,0xab,0x75,0xd2,0x33,0x7c,0xf5,0x97, + 0xaf,0x36,0x34,0x7a,0xd,0x76,0xe7,0xec,0x46,0x97,0x81,0x3f,0x5a,0xcf,0xcf,0xc5, + 0xf,0xd7,0xc5,0x5c,0xe7,0xb0,0xbe,0x14,0x34,0x14,0xe0,0x9b,0xb4,0x6f,0x88,0xd, + 0xb7,0x80,0x11,0xd8,0xbc,0xb7,0x60,0x62,0x4d,0xd8,0x96,0xb9,0x8d,0x68,0x95,0x5, + 0x0,0x77,0x8e,0xbd,0xd3,0xa1,0xab,0xd1,0x9c,0xda,0x1c,0x6c,0x3b,0xbf,0x8d,0xb8, + 0xbd,0x5c,0x2c,0xb7,0x8b,0x66,0xde,0x70,0x82,0xd8,0x68,0x98,0x58,0x13,0xce,0x54, + 0x9c,0xb1,0x38,0x4e,0x52,0xac,0x88,0xf,0x37,0xb9,0x1b,0x71,0xbd,0xe7,0xa2,0xa6, + 0xa2,0x1,0x75,0xf3,0x7b,0xea,0x7d,0x5f,0xfe,0x90,0x4d,0xc,0x99,0x88,0x7,0x27, + 0x3e,0x68,0x93,0xaf,0xd3,0xc4,0x9a,0x88,0x95,0x6d,0xed,0x71,0x5f,0x2e,0xe7,0x4c, + 0xc5,0x19,0xa2,0x17,0xd6,0xc7,0xc5,0x67,0xc4,0x2c,0x87,0xad,0xdd,0xac,0xd7,0x18, + 0xc8,0xc5,0xd,0xaf,0x6,0xaa,0xd5,0xd5,0x38,0x5e,0x72,0x9c,0xa8,0xed,0x8c,0x88, + 0x19,0xe,0xab,0x9b,0x6e,0x30,0x19,0xf0,0xe9,0xb1,0x4f,0x89,0xa2,0x97,0x7a,0x8, + 0x72,0xb,0xb2,0x79,0xc5,0x5b,0xda,0x5c,0x4a,0xa4,0xeb,0x4,0x0,0x51,0xde,0x51, + 0xe,0xcd,0x7e,0x37,0x71,0x26,0xac,0x3b,0xb9,0x8e,0xa8,0x3a,0x5f,0xf,0x41,0x6e, + 0x41,0x57,0x4d,0x7e,0x46,0xf,0xc4,0x46,0xa3,0xaa,0xb5,0xca,0xa2,0x2a,0x95,0x80, + 0x11,0xd8,0xbc,0xc9,0x5,0xfc,0xbf,0xdc,0xb5,0x67,0x18,0x91,0x1f,0xf6,0x52,0xd3, + 0xa5,0x1,0x7,0x8e,0xd,0xe9,0x1b,0x2c,0x6,0x76,0x77,0x27,0x77,0x3c,0x37,0xfb, + 0x39,0xb8,0xca,0x6d,0xb,0x79,0xab,0x6c,0xad,0x24,0xaa,0xcc,0x5,0x58,0x2f,0x13, + 0x4f,0x2,0x69,0x88,0x63,0x94,0x57,0xd4,0x88,0x91,0x2b,0xb0,0x46,0x24,0x12,0xb0, + 0x3e,0x19,0x70,0xa4,0x73,0xba,0xf4,0x34,0xaf,0xbe,0x18,0xd0,0x1d,0xe0,0x31,0x3b, + 0x7a,0xb6,0xc3,0x36,0xc0,0xd3,0xcb,0xd3,0xb1,0x33,0x6b,0xa7,0x55,0xee,0xc1,0x58, + 0xdf,0x58,0x9b,0x2b,0x2c,0xe6,0xd4,0xe5,0x10,0xd7,0x8f,0x9f,0x37,0x6a,0x9e,0xdd, + 0x8b,0x4b,0xfd,0x9e,0x8c,0xf2,0xc,0xec,0xc9,0xd9,0x3,0x8e,0xe3,0xc0,0x80,0x21, + 0xa,0xff,0xe,0x76,0xbf,0x3a,0xf4,0xa6,0x7e,0xf,0xf1,0xc8,0xd2,0x57,0xd1,0xa5, + 0x28,0xef,0x28,0xbb,0xb8,0x60,0x7a,0x74,0xe6,0x5,0x2,0xfe,0xee,0x54,0xa8,0x2a, + 0xfa,0xcc,0xc,0xef,0xa9,0xe0,0xf5,0xe5,0xe9,0x2f,0x2d,0x56,0x19,0xf7,0x8c,0xbb, + 0x7,0xb,0x62,0x17,0xd8,0xbc,0x39,0x78,0xbe,0xea,0x3c,0x51,0xf6,0xa7,0xbf,0xab, + 0x3f,0x71,0x5,0x43,0x52,0x34,0x7a,0xd,0x71,0xd9,0x5b,0x47,0x8,0x24,0x3a,0x8a, + 0x48,0xaf,0x48,0x38,0x89,0xc9,0x7,0x3a,0x92,0x8,0x9a,0xab,0x5,0x83,0xc9,0x80, + 0x1f,0xb3,0x7f,0x24,0x6a,0xab,0x90,0x2a,0xb0,0x20,0x76,0x81,0x43,0xfa,0x51,0xd5, + 0x5a,0x85,0xbf,0xef,0xfb,0x3b,0xb4,0x46,0x2d,0x84,0x2,0x21,0xa6,0x86,0x4f,0xe5, + 0x4d,0xc8,0xed,0x51,0x89,0x50,0xca,0x95,0x36,0x5d,0x7b,0x7f,0xde,0x7e,0xa2,0x4d, + 0x77,0x57,0x99,0x2b,0xae,0x89,0xbc,0xc6,0x61,0x93,0xa5,0xc6,0x8e,0x46,0xbc,0x73, + 0xf0,0x9d,0xde,0xf7,0x7f,0x7a,0xc4,0x74,0xa2,0x9,0xcf,0xa4,0xd0,0x49,0xc3,0x5a, + 0xfb,0x6d,0x30,0x10,0xdd,0x61,0x96,0x63,0x91,0x59,0x95,0x69,0x61,0x34,0xe2,0xfd, + 0xe2,0xed,0xa6,0x9e,0x19,0xe7,0x1b,0x47,0x14,0xd1,0xc4,0x72,0xac,0x85,0x8c,0x9, + 0x0,0x34,0x77,0x36,0x63,0xed,0xd1,0xb5,0x68,0xd7,0x9a,0x2b,0x5f,0x8e,0xf2,0x19, + 0x85,0x87,0xa7,0x3c,0x6c,0x73,0x8,0x5e,0xcf,0x75,0x49,0x1e,0xe0,0x30,0xcf,0x30, + 0xbb,0x17,0xbb,0xa9,0x54,0x55,0x42,0x6f,0x24,0x4b,0x84,0x1b,0x49,0xf5,0xb3,0xdd, + 0x64,0x6e,0x56,0xcd,0xc4,0xac,0x55,0xc5,0x1d,0xc9,0x94,0xb5,0x94,0x11,0x5,0x3e, + 0x0,0xdd,0x11,0x88,0x9e,0xce,0xf6,0xcf,0x38,0x66,0x39,0x16,0x5f,0xa7,0x7e,0x8d, + 0xcc,0xea,0xee,0xdc,0xa0,0x40,0x65,0x20,0xa6,0x86,0x4d,0xe5,0x2d,0x6b,0xda,0x63, + 0x5c,0x6c,0xc1,0xc4,0x9a,0x70,0xe2,0xd2,0x9,0xa2,0xb6,0xde,0xa,0x6f,0x8c,0xf2, + 0x71,0x4c,0x9,0x2,0x8e,0xe3,0xb0,0xeb,0xc2,0xae,0x5e,0xf9,0x16,0x99,0x58,0x86, + 0xdb,0xc7,0xdc,0x4e,0x34,0x81,0x9c,0x12,0x7a,0x75,0x6d,0x82,0x3,0x84,0x46,0xa3, + 0xb5,0xab,0xd5,0x22,0x7a,0xa1,0xa7,0xec,0xa6,0xbd,0x8c,0xc6,0x28,0x9f,0x51,0xc4, + 0x4b,0xeb,0x73,0x55,0xe6,0x55,0x3,0x39,0x8e,0xc3,0xc6,0xf4,0x8d,0x16,0x52,0x21, + 0x72,0xb1,0x1c,0x2b,0xe6,0xac,0xb0,0xcb,0xa6,0x70,0x87,0xae,0x3,0x39,0xb5,0x39, + 0x44,0xcb,0xf3,0x51,0xde,0xa3,0xac,0x96,0x89,0xe7,0xa3,0x5c,0x55,0x4e,0x1c,0xe2, + 0x37,0x92,0x8c,0x86,0x97,0xc2,0xcb,0x2a,0x3f,0x74,0x5e,0x7d,0x9e,0xd5,0x9,0x81, + 0xc3,0x85,0xfa,0xf6,0x7a,0xa4,0x14,0xa6,0xe0,0x60,0xfe,0x41,0x1c,0x2b,0x39,0xc6, + 0x1b,0x85,0x77,0xae,0xea,0x1c,0xea,0x3b,0xf8,0x5d,0x53,0xc,0x18,0x87,0xac,0x32, + 0x38,0x70,0x38,0x5a,0x7c,0xb4,0xb7,0x94,0xb0,0x58,0x28,0xc6,0x93,0x33,0x9e,0x44, + 0xa7,0xbe,0x93,0x37,0x20,0x41,0x29,0x53,0xda,0x1c,0x74,0x92,0x5f,0x9f,0x4f,0xe4, + 0x9a,0x3,0xba,0x3,0x4f,0xec,0xbd,0xba,0xef,0x21,0xb7,0x2e,0x17,0x6b,0x8f,0xae, + 0xed,0x55,0x2f,0x58,0x18,0xb7,0x10,0xd1,0x3e,0xd1,0x68,0xe9,0x1c,0x58,0x40,0x55, + 0x29,0x57,0x3a,0xb4,0x8e,0xc7,0x95,0x82,0xc8,0x68,0x34,0x76,0x34,0xa2,0xb4,0xb9, + 0xd4,0xec,0x98,0x42,0xaa,0x40,0xb4,0x4f,0xb4,0xdd,0xb2,0x1c,0x25,0x42,0x9,0xb1, + 0x4e,0x53,0x5e,0x5d,0x9e,0x59,0xcc,0x76,0x46,0x65,0x6,0xbe,0x4d,0xff,0xd6,0xac, + 0xd,0x3,0x6,0xf3,0x46,0xcd,0xc3,0x2d,0x9,0xb7,0xd8,0xa5,0x8f,0xed,0xba,0x76, + 0xe4,0xd7,0xf3,0x87,0xfd,0x9,0x5,0x42,0x24,0x6,0x24,0xda,0x3d,0x82,0xa3,0xa1, + 0xbd,0x81,0x38,0x82,0xc4,0x51,0x7e,0x6d,0x47,0xe0,0x24,0x71,0x42,0x72,0x50,0x32, + 0xf1,0x4a,0xb0,0xa6,0xb5,0xc6,0xaa,0x4,0xcf,0xe1,0x82,0xc1,0x64,0xc0,0x9a,0x23, + 0x6b,0xf0,0xe8,0x96,0x47,0xf1,0xd8,0x7f,0x1f,0xc3,0xfb,0x87,0xde,0x1f,0xb0,0x62, + 0xa1,0x89,0x35,0x21,0xab,0x3a,0x8b,0x28,0x5a,0xcc,0xdd,0xc9,0xdd,0x21,0x3a,0x4b, + 0xa5,0xcd,0xa5,0x58,0x75,0x60,0x15,0x34,0x7a,0x4d,0xef,0xfb,0x34,0x6f,0xd4,0x3c, + 0xe4,0xd4,0xe4,0xf0,0x7e,0x76,0x4a,0xd8,0x14,0x9b,0xf7,0x17,0xce,0x54,0x9c,0x21, + 0x7e,0xe6,0x27,0x85,0x4c,0x72,0x48,0x42,0x9f,0x5a,0xab,0xc6,0x3f,0x53,0xfe,0xd9, + 0x5b,0x83,0x3c,0xc2,0x33,0x2,0xcf,0xcc,0x7c,0x6,0x25,0x8d,0x25,0x50,0x75,0xd, + 0x2c,0x21,0x32,0x2e,0x68,0xdc,0x55,0x99,0x8c,0x4a,0x64,0x34,0xaa,0x5a,0xab,0x50, + 0xdd,0x6a,0x9e,0xd4,0xe7,0x2a,0x73,0xb5,0x7a,0x13,0x93,0xf,0xd2,0xaa,0x56,0xd, + 0x1d,0xd,0xbd,0xa1,0xa7,0x5a,0x83,0x16,0x1f,0xa6,0x7c,0x68,0x21,0xe0,0x17,0xe8, + 0x16,0x88,0xe7,0x66,0x3f,0x67,0xb7,0x1f,0xad,0x56,0x5d,0x4b,0x14,0x35,0x21,0x14, + 0x8,0x1d,0xb2,0x9,0xde,0xa2,0x69,0xe1,0x75,0x9,0xf4,0x30,0x92,0x1e,0x54,0x6, + 0xc,0x66,0x47,0xcd,0x26,0x5e,0xb1,0xaa,0xba,0x54,0xc4,0x2e,0x9b,0xe1,0x44,0x76, + 0x6d,0x77,0x95,0x45,0x95,0x46,0x85,0xd6,0xae,0x56,0x84,0x79,0x86,0xd,0xb8,0x22, + 0xd4,0x9b,0xf4,0x38,0x57,0x79,0xae,0xdf,0xbf,0xff,0x9e,0x20,0xb7,0x20,0xa2,0x90, + 0x75,0x6b,0xd0,0x1b,0xf5,0xf8,0xf8,0xc8,0xc7,0x38,0x5b,0xd9,0x5d,0x2,0x40,0x21, + 0x53,0xe0,0x85,0x6b,0x5f,0x80,0x48,0x20,0x42,0x6e,0x5d,0xee,0x80,0x9f,0x65,0xc0, + 0x60,0x56,0x94,0x6d,0x92,0xe4,0x2c,0xc7,0x12,0xaf,0xec,0x1,0x60,0x6c,0x90,0xfd, + 0x67,0xf4,0x1c,0x38,0x6c,0xcf,0xdc,0x8e,0x5f,0x72,0x7f,0xe9,0xed,0xc7,0xa3,0x53, + 0x1f,0x45,0x42,0x40,0x2,0xb2,0x6b,0xb3,0x79,0x93,0xd,0x27,0x86,0x4c,0x1c,0x11, + 0x9,0xb6,0xd6,0x42,0x64,0x34,0x52,0xcb,0x52,0x2d,0x5c,0x23,0x9e,0xce,0x9e,0x76, + 0xdf,0x70,0x4d,0xa,0x48,0x22,0xda,0xc8,0x52,0x69,0x54,0x28,0x6b,0x29,0x3,0xcb, + 0xb1,0xd8,0x7c,0x6e,0x33,0xe,0x15,0x1e,0x32,0x73,0x4b,0x31,0x60,0xf0,0xf4,0xcc, + 0xa7,0xed,0xba,0x34,0x4c,0x2b,0x4f,0x23,0x9a,0xf5,0xb8,0x48,0x5d,0x1c,0x12,0xf6, + 0xd7,0xae,0x6b,0x27,0x7e,0x81,0x46,0x5a,0xd,0xe2,0x4,0xff,0x4,0xe2,0x7b,0xd6, + 0xdc,0xd9,0x8c,0x73,0x55,0xe7,0x46,0x94,0x8b,0xaa,0x45,0xd3,0x82,0xd5,0x7,0x57, + 0x9b,0xf9,0xc0,0x6f,0x4e,0xb8,0x79,0xc0,0x67,0xbd,0xcb,0xd0,0xc5,0x3b,0x38,0xf7, + 0x10,0xe2,0x1e,0x2,0x5f,0x57,0xfb,0xb9,0x24,0x8d,0xac,0x11,0x5f,0xa5,0x7e,0xd5, + 0xab,0xf5,0x24,0x15,0x49,0xb1,0x6c,0xd6,0x32,0x8c,0xd,0x18,0x8b,0xec,0x9a,0x6c, + 0xde,0x8,0x36,0x1f,0x17,0x1f,0x9b,0xcb,0x9a,0xb6,0x69,0xdb,0x88,0xa3,0xa6,0x14, + 0x52,0x5,0xa2,0xbc,0xa3,0x6c,0xba,0x5e,0x5f,0x1c,0x2f,0x39,0x8e,0xb5,0x47,0xd6, + 0xc2,0xc4,0x9a,0xc0,0x80,0xc1,0x35,0x51,0xd7,0xe0,0x81,0x89,0xf,0x74,0x87,0xde, + 0xf3,0x84,0x1,0xbb,0xca,0x5c,0x31,0x26,0x70,0xcc,0x88,0x89,0x62,0xb4,0x6,0xde, + 0x6f,0xc4,0x81,0x43,0x5a,0x79,0x9a,0xc5,0xf1,0x68,0xef,0x68,0xbb,0x6b,0x1b,0x5, + 0xb9,0x5,0x11,0xa9,0xc2,0xaa,0xb5,0x6a,0x54,0xaa,0x2a,0x51,0xd8,0x50,0x88,0x2f, + 0x4e,0x7e,0x61,0x31,0x98,0x27,0x4,0x24,0xe0,0xfe,0x89,0xf7,0xdb,0x75,0xb9,0xda, + 0x33,0xe3,0xe2,0x23,0xde,0x2f,0xde,0x21,0x61,0x7f,0x3a,0xa3,0x8e,0x78,0xa0,0x24, + 0xdd,0xfb,0xb0,0x7,0xe5,0x2d,0xe5,0xbc,0x75,0xaa,0xf9,0x10,0xa,0x84,0xb8,0x39, + 0xe1,0x66,0xa2,0xe8,0x36,0x23,0x6b,0x44,0x6a,0x59,0x2a,0x91,0xa4,0xc4,0x70,0x61, + 0x4f,0xce,0x1e,0xb3,0xd,0x5d,0x1f,0x85,0xf,0x92,0x3,0x93,0x7,0xfc,0x4c,0x55, + 0x6b,0x95,0x85,0xfa,0x42,0x7f,0x44,0x79,0x47,0xd9,0xb5,0x9c,0xeb,0x85,0xea,0xb, + 0x58,0x73,0x64,0x4d,0xaf,0xfb,0x6c,0x4a,0xd8,0x14,0x3c,0x30,0xf1,0x1,0x30,0xc, + 0xd3,0xe7,0x58,0x70,0x39,0x41,0x6e,0x41,0x36,0xef,0x2f,0xb4,0x6b,0xdb,0x89,0xab, + 0x3a,0x6,0xbb,0x5,0xdb,0x3d,0x42,0x49,0xa3,0xd7,0xe0,0xed,0x7d,0x6f,0xf7,0x7a, + 0x17,0x7c,0x5c,0x7c,0xb0,0x7c,0xce,0x72,0x38,0x4b,0x9d,0xd1,0xa9,0xef,0xe4,0x75, + 0x55,0x7b,0x38,0x79,0xd8,0x5d,0x11,0x62,0xb8,0xc0,0x6b,0x34,0xaa,0x5b,0xab,0x51, + 0xd8,0x60,0x29,0x94,0xc6,0xf7,0xd0,0xf,0x86,0x40,0xb7,0x40,0xf8,0xb9,0xf0,0x67, + 0x8,0x1b,0x4c,0x6,0xa4,0x95,0xa7,0xe1,0xad,0x7d,0x6f,0x59,0x48,0x1a,0x78,0x2b, + 0xbc,0xf1,0xd6,0xc2,0xb7,0xec,0xfa,0x10,0x35,0x75,0x36,0x11,0xed,0x67,0x0,0xdd, + 0xd5,0xc2,0x1c,0x81,0xb5,0xea,0xbe,0x43,0x41,0x69,0x73,0x29,0x1e,0xd9,0xfc,0x8, + 0x6e,0xfc,0xcf,0x8d,0xf8,0xad,0xe0,0x37,0x9b,0x66,0xff,0x37,0x8c,0xbe,0x1,0xd1, + 0x3e,0x64,0x89,0x60,0x87,0xa,0xe,0xa1,0xb6,0x9d,0x3f,0x33,0x7e,0x38,0x50,0xde, + 0x52,0x8e,0x7f,0x1c,0xf8,0x87,0x59,0x46,0xf7,0xbc,0x98,0x79,0xbc,0xa1,0xa8,0x7d, + 0x45,0x8,0xf6,0x47,0xbc,0x1f,0x99,0xe0,0x27,0x9,0x85,0xd,0x85,0x78,0x76,0xe7, + 0xb3,0x68,0xec,0x68,0x4,0xd0,0x1d,0x54,0xf1,0xde,0x2d,0xef,0xc1,0xc7,0xc5,0x7, + 0x1a,0xbd,0x86,0xc8,0x68,0x8c,0x9,0x1c,0xc3,0x1b,0x8c,0xd1,0x65,0xe8,0xc2,0xce, + 0xac,0x9d,0xa8,0x54,0x55,0xf6,0x59,0x2a,0xb5,0x5d,0xd7,0x6e,0x51,0x34,0xad,0x3f, + 0x2,0x95,0x81,0x76,0x9d,0xc0,0xb6,0xeb,0xda,0xf1,0xea,0x2f,0xaf,0xf6,0xe6,0x7b, + 0x89,0x4,0x22,0x3c,0x37,0xfb,0xb9,0xde,0x2a,0x80,0xe7,0x2a,0xcf,0xf1,0x96,0x7a, + 0xe,0xf3,0x8,0x43,0xb8,0xe7,0xc0,0x49,0x7d,0x2c,0xc7,0x62,0x7f,0xfe,0x7e,0x5c, + 0xa8,0xb9,0x40,0xbc,0x77,0x33,0x1c,0xe0,0x35,0x1a,0x99,0xd5,0x99,0x16,0x33,0x1e, + 0x6,0x8c,0xdd,0x8b,0xb,0x1,0x80,0xaf,0xc2,0x17,0x3e,0xa,0x1f,0xa2,0xb6,0x3f, + 0x65,0xff,0x84,0x83,0x5,0x7,0x2d,0xfa,0x75,0xfb,0x98,0xdb,0x6d,0xe,0xf5,0xbb, + 0x9c,0x4b,0xcd,0x97,0x78,0x37,0xbd,0x80,0xee,0x65,0x3c,0xa9,0x62,0xaf,0xb5,0x48, + 0x44,0x12,0xe2,0xd,0x7d,0x6b,0x4b,0xa8,0xe,0x86,0x4e,0x7d,0x27,0xde,0x39,0xf0, + 0xe,0x32,0xab,0x33,0x91,0x5b,0x9b,0x8b,0xe5,0x3f,0x2e,0x27,0xce,0x5c,0xee,0x8b, + 0x70,0xcf,0x70,0x5c,0x1f,0x77,0x3d,0xf1,0xb5,0x77,0x67,0xef,0x1e,0xf6,0x2e,0xaa, + 0x76,0x5d,0x3b,0x3e,0x38,0xfc,0x81,0x59,0x75,0x3b,0x99,0x48,0x86,0xa9,0x61,0x53, + 0x79,0xd5,0x8f,0xad,0xc9,0x3a,0xe,0x76,0xb7,0xcf,0x7e,0x86,0x46,0xaf,0xc1,0xeb, + 0x7b,0x5f,0x47,0x5e,0x7d,0xb7,0x28,0xa8,0xb3,0xc4,0x19,0xcb,0xe7,0x2c,0xef,0xcd, + 0xea,0x2e,0x6d,0x2e,0xed,0x35,0x26,0x3,0x31,0x33,0x72,0xe6,0x80,0x7f,0xe7,0x38, + 0xe,0x87,0xa,0xe,0xe1,0xc5,0xdd,0x2f,0xe2,0x2f,0x1b,0xfe,0x82,0x5d,0x59,0xbb, + 0x2c,0x56,0x8e,0x3a,0xa3,0xe,0xed,0xba,0xf6,0x7e,0xce,0x60,0x8e,0x8f,0x8b,0x8f, + 0xdd,0x56,0x5a,0x26,0xce,0x84,0xcd,0x67,0x37,0x63,0xeb,0xf9,0xad,0x0,0xba,0x73, + 0xc8,0xe6,0xc7,0xce,0xc7,0x9d,0x63,0xef,0xec,0x6d,0x43,0xa2,0xa,0x31,0x29,0x94, + 0x7f,0x63,0x3e,0xbf,0x3e,0x1f,0x6f,0xfe,0xfa,0x26,0xee,0xdf,0x78,0x3f,0x3e,0x3a, + 0xf2,0x11,0x6f,0xf9,0xe6,0xe1,0xc2,0x80,0x46,0xa3,0x47,0x3a,0xe4,0xf2,0xc,0x6c, + 0x17,0x99,0x8b,0x43,0x44,0xc1,0x5c,0x64,0x2e,0x8,0xf7,0x22,0x4b,0xb9,0x6f,0xd3, + 0xb6,0x59,0xb8,0x61,0xa2,0xbc,0xa3,0xb0,0xec,0x9a,0x65,0x76,0x77,0xf,0x15,0x36, + 0x14,0xf2,0x86,0xd7,0x1,0xdd,0xda,0x3f,0xa1,0xee,0x8e,0x49,0xac,0x73,0x12,0x3b, + 0x11,0x27,0x27,0xd6,0xb4,0x39,0x36,0x97,0xa1,0xcb,0xd0,0x85,0x8f,0xe,0x7f,0x84, + 0x9f,0x72,0x7e,0xea,0x9d,0x21,0x39,0x49,0x9c,0x88,0x57,0xa,0x7d,0x21,0x12,0x88, + 0xf0,0xf0,0xe4,0x87,0x89,0x73,0xd,0x76,0x64,0xed,0x40,0x95,0x7a,0x78,0x27,0xfa, + 0x6d,0xcf,0xdc,0x8e,0xed,0xe7,0xb7,0x9b,0x19,0x37,0x2f,0x85,0x17,0xa6,0x85,0x4f, + 0xe3,0xfd,0x2d,0x7b,0xa2,0x75,0x48,0xb0,0x56,0xbf,0xab,0x2f,0x3a,0x74,0x1d,0x58, + 0x7d,0x68,0x35,0xf6,0xe7,0xef,0xef,0xfd,0x4d,0xef,0x18,0x7b,0x7,0x1e,0x98,0xf8, + 0x40,0xaf,0x5f,0x3e,0xaf,0x3e,0x8f,0xd7,0x68,0x38,0x49,0x9c,0x78,0x73,0x13,0xd4, + 0x5a,0x35,0xd6,0x1e,0x5d,0x8b,0xa6,0xce,0x26,0xe4,0xd4,0xe6,0x60,0x67,0xd6,0x4e, + 0x8b,0x62,0x5c,0x7a,0x93,0x9e,0x48,0x6f,0xb,0xe8,0xde,0x3f,0x10,0x9,0x6d,0x8f, + 0x56,0x64,0x39,0x16,0xbf,0x15,0xfc,0x66,0x96,0xc4,0x17,0xe6,0x11,0x86,0x37,0x17, + 0xbe,0xd9,0xfb,0x5c,0x6a,0xd,0xda,0xde,0x9c,0x95,0xfe,0x60,0x18,0x6,0xd3,0x23, + 0xa6,0xf3,0x5e,0xef,0xf3,0x93,0x9f,0xa3,0xa0,0xa1,0x0,0x15,0xaa,0xa,0x6c,0x3d, + 0xb7,0x15,0x2d,0x1a,0xfe,0x31,0x66,0x38,0x30,0xa0,0xd1,0x68,0xd3,0xb6,0xe1,0x4c, + 0xf9,0x19,0x8b,0x19,0x5d,0x90,0x5b,0x90,0xc3,0xaa,0x62,0x8d,0x9,0x18,0x9c,0x2c, + 0x89,0x42,0xaa,0xc0,0x8a,0x39,0x2b,0xec,0x9e,0xa3,0x60,0x62,0x4d,0xb8,0x50,0x7d, + 0x81,0xa8,0xc2,0x5c,0x80,0x32,0xc0,0x61,0x92,0x1,0xde,0xa,0x6f,0xe2,0x3d,0x9a, + 0x92,0x46,0xb2,0x5a,0x7,0x83,0x41,0x6f,0xd2,0x63,0x43,0xfa,0x6,0x7c,0x7e,0xe2, + 0xf3,0xde,0xd9,0xa1,0x8b,0xcc,0x5,0xcf,0xcf,0x7b,0x1e,0xfe,0xae,0xb6,0xd5,0xef, + 0xe,0x76,0xf,0xc6,0x53,0x33,0x9e,0x22,0xaa,0x41,0x92,0x5b,0x9b,0x8b,0xed,0x99, + 0xdb,0x6d,0xba,0x9e,0xa3,0xe0,0x38,0xe,0xe9,0x15,0xe9,0xf8,0xe8,0xf0,0x47,0x16, + 0x6e,0x8c,0x78,0xff,0x78,0x84,0x79,0x86,0xf1,0x9e,0xa3,0x55,0x43,0x2e,0x97,0xe2, + 0x2a,0xb3,0x4d,0x1e,0x47,0x6f,0xd2,0x63,0xdd,0xc9,0x75,0x58,0x7f,0x7a,0x3d,0x80, + 0xee,0x41,0x6f,0x46,0xc4,0xc,0xac,0x9c,0xbb,0xb2,0x37,0x12,0x8f,0xe5,0x58,0x64, + 0x56,0x67,0xf2,0xe,0xe4,0xe3,0x82,0xc6,0xd,0xe8,0x7a,0x33,0xb2,0x46,0x7c,0x97, + 0xfe,0x5d,0x6f,0x21,0x33,0xb1,0x50,0x8c,0x87,0xa6,0x3c,0x64,0xe1,0x4e,0xe6,0x38, + 0x8e,0xd8,0x65,0x23,0x13,0xcb,0xec,0xb2,0xe1,0x9c,0x56,0x96,0x86,0x17,0x77,0xbf, + 0xd8,0xbb,0x47,0xe7,0xee,0xe4,0x8e,0xd7,0x16,0xbc,0x66,0xa6,0x9f,0x55,0xa3,0xae, + 0xe1,0x55,0x1c,0xe,0x52,0xe,0xac,0x37,0xc5,0x71,0xdd,0xea,0x15,0x3d,0x13,0xa, + 0x86,0x61,0x70,0x67,0xf2,0x9d,0xe,0x9b,0x70,0xda,0x9b,0x1,0xef,0x74,0x63,0x47, + 0x23,0x2e,0xd4,0x5c,0xb0,0x38,0xee,0xef,0xea,0xef,0xb0,0x5c,0x80,0xc1,0xc6,0x9b, + 0xcf,0x8e,0x9a,0x8d,0x5b,0x12,0x6f,0xb1,0x7b,0xb4,0x82,0x91,0x35,0xe2,0x7c,0x35, + 0x59,0xa5,0xbe,0x8,0xaf,0x8,0xb8,0xcb,0x1d,0x23,0x14,0xe8,0xaf,0xf4,0x27,0xce, + 0xfd,0xc8,0xad,0xcb,0x75,0x88,0x84,0x38,0xcb,0xb1,0xd8,0x75,0x61,0x17,0xde,0xfb, + 0xed,0x3d,0xb3,0xc1,0xe3,0xae,0xe4,0xbb,0xec,0x92,0x5c,0x26,0x60,0x4,0xb8,0x77, + 0xc2,0xbd,0x44,0xf5,0x17,0x8c,0xac,0x11,0xeb,0x4f,0xaf,0x27,0xaa,0x95,0x3e,0xd4, + 0x34,0x75,0x36,0xe1,0x8d,0xbd,0x6f,0x58,0x84,0xa9,0x3,0xdd,0x55,0xf5,0x48,0xa2, + 0xdb,0xac,0xa9,0x9d,0x6e,0x4b,0x4e,0x90,0x91,0x35,0x62,0x7b,0xe6,0x76,0xac,0x3d, + 0xba,0xb6,0xf7,0x37,0xf5,0x75,0xf1,0xc5,0xdb,0x37,0xbc,0x6d,0xe6,0x4d,0x30,0xb2, + 0x46,0x22,0xe1,0xc0,0x49,0xa1,0x93,0x6,0x34,0xfa,0xd9,0x35,0xd9,0xf8,0x3a,0xf5, + 0xeb,0xde,0xe7,0x73,0x6a,0xd8,0x54,0x4c,0xd,0xb3,0x74,0x27,0x33,0xc,0x43,0x1c, + 0x5,0xc8,0x30,0x8c,0xcd,0x12,0x41,0x79,0x75,0x79,0xf8,0xdb,0x9e,0xbf,0x99,0x45, + 0x6c,0x3d,0x35,0xe3,0x29,0x2c,0x1c,0x6d,0x5e,0x9b,0xa4,0x5a,0x5d,0xcd,0xbb,0x92, + 0x1f,0xed,0x3f,0x7a,0x40,0xc3,0x59,0xdf,0x5e,0x8f,0x7f,0xa6,0xfc,0xb3,0x77,0x42, + 0x11,0xee,0x19,0x8e,0x3b,0xc7,0xde,0x39,0x62,0x2a,0xfb,0xd,0x38,0xc2,0xfe,0x56, + 0xf4,0x5b,0x9f,0x9b,0xaa,0x1,0xca,0x0,0x87,0x19,0x8d,0x28,0xef,0x28,0xab,0x57, + 0x31,0x21,0xee,0x21,0xf8,0xdb,0xfc,0xbf,0x41,0x2e,0x96,0xdb,0xbd,0x3f,0x6d,0xda, + 0x36,0x5c,0xa8,0xb6,0x34,0x9c,0x7d,0x31,0x25,0x6c,0x8a,0xc3,0x7e,0xf8,0x58,0xdf, + 0x58,0xe2,0x98,0xef,0xca,0xd6,0xca,0x3e,0x83,0x17,0x6c,0x41,0x6f,0xd2,0x63,0x7b, + 0xe6,0x76,0xfc,0x75,0xe7,0x5f,0xcd,0xf6,0x4c,0x92,0x83,0x92,0xf1,0xc6,0xf5,0x6f, + 0xd8,0x2d,0xf0,0xc0,0xd7,0xc5,0x17,0xab,0x6e,0x5a,0x45,0x14,0x10,0x51,0xab,0xae, + 0xc5,0x6b,0x7b,0x5f,0x1b,0x56,0x22,0x86,0x4d,0x9d,0x4d,0x58,0xf9,0xe3,0xca,0x6e, + 0x9,0xfd,0xcb,0x36,0x78,0xbd,0x15,0xde,0x44,0x6e,0xb,0x0,0x44,0x3a,0x6c,0x3d, + 0x74,0xe9,0xc9,0xdc,0x38,0x97,0x63,0x30,0x19,0xb0,0x29,0x63,0x13,0x5e,0xf8,0xe9, + 0x85,0xde,0x7d,0x4b,0x1f,0x85,0xf,0x3e,0xba,0xf5,0x23,0x8b,0xbc,0x87,0xb6,0xae, + 0x36,0xde,0xc9,0x53,0x4f,0x16,0x78,0x7f,0x83,0x7d,0xa7,0xbe,0x13,0xaf,0xfe,0xf2, + 0x6a,0xaf,0x52,0xae,0x87,0x93,0x7,0x96,0x5d,0xb3,0xac,0xcf,0xb1,0x44,0x2c,0x14, + 0x13,0xe7,0x1b,0x75,0xe8,0x3a,0x6c,0x8a,0x18,0xbc,0x58,0x77,0x11,0x8f,0x6c,0x7e, + 0xa4,0xf7,0x3d,0x17,0x9,0x44,0xb8,0x7d,0xec,0xed,0xdd,0x79,0x5e,0x97,0x6d,0xb0, + 0x5f,0xac,0xbb,0x38,0x60,0xb4,0xa0,0x80,0x11,0x20,0x39,0x30,0xb9,0xdf,0xb2,0xc4, + 0x46,0xd6,0x88,0x7f,0x1d,0xfb,0x57,0x6f,0x34,0x9d,0x44,0x24,0xc1,0x93,0xd3,0x9f, + 0x1c,0x51,0x7a,0x71,0xfd,0x3e,0x99,0x6,0x93,0x1,0x87,0xb,0xf,0x5b,0x1c,0x67, + 0x18,0x6,0x3e,0xa,0x1f,0x87,0x25,0xad,0x48,0x45,0x52,0x44,0x7b,0x91,0xfb,0xc6, + 0x45,0x2,0x11,0x1e,0x9e,0xf2,0xb0,0xc3,0x8a,0xe,0xe5,0xd4,0xe6,0x10,0xb9,0xa6, + 0x18,0x30,0x48,0xe,0xb2,0x7f,0x44,0x59,0xf,0x1,0xae,0x1,0xc4,0xae,0xb7,0xa6, + 0x8e,0x26,0xa4,0x95,0x5b,0xe,0x5a,0x83,0xc5,0xc4,0x9a,0xb0,0xe5,0xdc,0x16,0xbc, + 0xf6,0xcb,0x6b,0x66,0x2b,0x8c,0x70,0x8f,0x70,0xbc,0x7d,0xc3,0xdb,0x76,0x77,0x55, + 0x8e,0xb,0x1a,0x87,0x67,0x67,0x3f,0xcb,0x3b,0x9,0xe0,0xc0,0x61,0x7f,0xfe,0x7e, + 0x7c,0x9d,0xfa,0xf5,0xb0,0x88,0x3e,0xd1,0x1a,0xb4,0x78,0xe7,0xc0,0x3b,0xd8,0x9f, + 0xbf,0xbf,0xcf,0x7b,0x9f,0x1c,0x94,0x4c,0xfc,0x1b,0x5a,0xe3,0x72,0x22,0x91,0x1a, + 0xb9,0x1c,0x23,0x6b,0xc4,0x96,0x73,0x5b,0xb0,0xea,0xc0,0xaa,0xde,0x89,0xa1,0x48, + 0x28,0xc2,0x4b,0xf3,0x5f,0xc2,0xbc,0x51,0xf3,0x2c,0xda,0xe7,0xd4,0xe6,0xf0,0x6a, + 0x9f,0x79,0x38,0x7b,0x20,0xce,0x37,0xae,0xcf,0xbf,0x19,0x4c,0x6,0x7c,0x9b,0xf6, + 0x6d,0xaf,0x7e,0x13,0x0,0xcc,0x1d,0x35,0x17,0x33,0x22,0xfa,0xae,0xb2,0x27,0x15, + 0x49,0x89,0x9f,0xab,0xda,0xb6,0x5a,0xab,0x56,0x66,0xbf,0xe7,0x42,0xcd,0x5,0xac, + 0xfc,0x71,0x65,0xb7,0x3c,0xcd,0xff,0xff,0x66,0x33,0x22,0x66,0xe0,0x8d,0x5,0x6f, + 0xf4,0xb9,0x82,0xe3,0x53,0x9a,0x96,0x89,0x65,0x48,0xc,0x48,0xec,0x73,0xf2,0xd8, + 0x13,0x0,0xb0,0xf9,0xec,0xe6,0x5e,0x97,0x7f,0xa2,0x7f,0x22,0xee,0x4c,0xbe,0x73, + 0x44,0xe5,0x73,0xf4,0xdb,0xd3,0xbc,0xfa,0xbc,0xde,0x28,0x8a,0xdf,0x23,0x12,0x88, + 0x10,0xa0,0xc,0x70,0x58,0x39,0x49,0x89,0x50,0x62,0x55,0x4,0xd2,0xf8,0xe0,0xf1, + 0x78,0x6c,0xda,0x63,0xe,0x33,0x62,0xa7,0x4a,0x4f,0x11,0xb5,0xf3,0x57,0xfa,0x3b, + 0xd4,0x27,0x29,0x14,0x8,0x89,0x5d,0x40,0x3a,0xa3,0xe,0x9b,0x32,0x36,0x59,0x88, + 0x37,0xe,0x86,0x36,0x6d,0x1b,0x3e,0x3e,0xfa,0x31,0x56,0xfe,0xb8,0xd2,0x2c,0x6e, + 0x5e,0x29,0x57,0xe2,0x9d,0x9b,0xdf,0x21,0x9e,0x39,0x5b,0x83,0x58,0x28,0xc6,0x92, + 0xa9,0x4b,0xf0,0xd0,0xe4,0x87,0x78,0xf7,0x37,0xb4,0x6,0x2d,0xd6,0x1c,0x59,0x83, + 0xef,0xd2,0xbf,0xbb,0xa2,0xb9,0x1b,0xcd,0x9d,0xcd,0x78,0x7d,0xef,0xeb,0xf8,0x26, + 0xed,0x9b,0x3e,0x7,0x30,0xa1,0x40,0x88,0x99,0x91,0x33,0x89,0xe4,0xb4,0x1,0x58, + 0x15,0x68,0x92,0x5d,0x93,0x4d,0xdc,0x16,0xe8,0x9e,0xf1,0x7f,0x71,0xf2,0xb,0xac, + 0xf8,0x71,0x45,0xef,0xc6,0xb6,0x93,0xc4,0x9,0x2b,0xe6,0xac,0xc0,0xe2,0xc9,0x8b, + 0xfb,0xbc,0xe7,0x24,0x79,0x4a,0x41,0x6e,0x41,0xfd,0xd6,0xf3,0xf8,0xf5,0xe2,0xaf, + 0xf8,0xf0,0xf0,0x87,0xbd,0x6e,0xa9,0x50,0xf7,0x50,0xac,0x9c,0xbb,0xb2,0xdf,0xa0, + 0x15,0x85,0x44,0x1,0x2f,0x67,0x2f,0xa2,0xef,0x93,0x53,0x93,0x43,0x1c,0x69,0xd5, + 0x83,0x89,0x33,0xe1,0x74,0xd9,0x69,0xdc,0xbf,0xf1,0x7e,0x9c,0x2e,0x3b,0xd,0xa0, + 0x7b,0xe2,0x37,0x36,0x70,0x2c,0xd6,0xde,0xbe,0xb6,0xdf,0x88,0x34,0xbe,0xd5,0x96, + 0x5c,0x2c,0xef,0xb7,0xcc,0x73,0x6e,0x5d,0x2e,0x5e,0xf9,0xe5,0x95,0xde,0x95,0xb1, + 0x97,0xb3,0x17,0x5e,0x5d,0xf0,0x2a,0x94,0x32,0xdb,0x94,0x80,0x87,0x9a,0x3e,0x8d, + 0x6,0x7,0xe,0xa9,0x65,0xa9,0x7d,0x8a,0x85,0x9,0x5,0x42,0xbb,0x57,0xa4,0xfb, + 0x3d,0x22,0x81,0x8,0x31,0x3e,0x31,0x44,0x96,0xd7,0x5b,0xe1,0x8d,0x95,0x73,0x57, + 0x3a,0xc4,0x2d,0x5,0x74,0x17,0xfc,0xe9,0x6b,0x4f,0xa7,0x2f,0x12,0xfc,0x13,0x1c, + 0x2e,0x19,0x30,0x77,0xd4,0x5c,0xe2,0x19,0xe8,0xf9,0xaa,0xf3,0xd8,0x99,0xb5,0x73, + 0xd0,0x33,0x70,0x96,0x63,0x51,0xd6,0x52,0x86,0xe7,0x7f,0x7a,0x1e,0x1f,0xa6,0x7c, + 0x68,0x36,0x20,0xbb,0xc9,0xdd,0xf0,0xea,0x75,0xaf,0xf6,0x39,0x23,0xb5,0x17,0x42, + 0x81,0x10,0x2b,0xe7,0xad,0xc4,0xa3,0x53,0x1e,0xe5,0xf5,0xd9,0x77,0xe8,0x3a,0xf0, + 0xd6,0xfe,0xb7,0xb0,0xe1,0xcc,0x6,0xe2,0x88,0x1b,0x7b,0xc1,0x71,0x1c,0x6a,0xd4, + 0x35,0x58,0xf1,0xe3,0xa,0x6c,0x38,0xb3,0xa1,0xdf,0x76,0x72,0xb1,0x1c,0x73,0xa2, + 0xe6,0x10,0x9f,0xb7,0xbf,0x19,0x7b,0x5f,0x1c,0x2d,0x3e,0x4a,0xb4,0x1a,0xe6,0x38, + 0xe,0x8d,0x1d,0x8d,0x78,0x75,0xcf,0xab,0x78,0xf7,0xe0,0xbb,0xbd,0xbf,0xa9,0x54, + 0x24,0xc5,0x13,0xd3,0x9f,0xc0,0x33,0x33,0x9f,0xe9,0x73,0x32,0xc8,0x71,0x1c,0xa, + 0x1b,0xf9,0xdd,0x9d,0x91,0x9e,0x91,0x16,0x33,0x6c,0x8e,0xe3,0x90,0x55,0x9d,0x85, + 0xb7,0xf7,0xbf,0xdd,0xeb,0xd6,0x94,0x89,0x65,0x58,0x7a,0xcd,0xd2,0x1,0x65,0x88, + 0x94,0x72,0x25,0xfc,0x95,0x64,0x81,0x15,0x15,0xaa,0xa,0xa4,0x97,0xa7,0x13,0xb5, + 0x5,0xba,0x43,0x8b,0x7f,0xc8,0xf8,0x1,0x8f,0x6d,0x79,0xcc,0xac,0xa8,0x54,0x52, + 0x60,0x52,0xb7,0xc1,0xe8,0x47,0x92,0x45,0x6b,0xd0,0xf2,0xaa,0x2c,0x3b,0x4b,0x9c, + 0xfb,0xc,0x8,0xa9,0x6a,0xad,0xc2,0x1b,0x7b,0xdf,0xe8,0x95,0xc0,0x61,0x18,0x6, + 0x8f,0x4e,0x7d,0xb4,0xcf,0xfd,0x9c,0xe1,0x4e,0x9f,0x23,0xb3,0xd1,0x64,0xc4,0xae, + 0xb,0x96,0xb1,0xd3,0x40,0xb7,0x44,0x5,0xe9,0x6c,0x69,0x30,0x30,0xc,0x83,0x70, + 0xaf,0x70,0xa2,0x12,0xb2,0x77,0x25,0xdf,0xc5,0x1b,0x13,0x6e,0xb,0xa4,0x35,0xb9, + 0x81,0xee,0xc2,0x47,0x8e,0x2c,0x33,0x9,0x0,0x63,0x3,0xc7,0x12,0x97,0x8e,0x34, + 0xb2,0x46,0x7c,0x90,0xf2,0x1,0xe,0x17,0x59,0xba,0x18,0xf9,0xd0,0x9b,0xf4,0xd8, + 0x93,0xbb,0x7,0xf7,0x6d,0xb8,0xf,0xdb,0x32,0xb7,0x99,0xd,0xc4,0xce,0x12,0x67, + 0xac,0x98,0xbb,0x2,0xf,0x4d,0x7e,0xc8,0xe1,0x46,0xd2,0x5d,0xee,0x8e,0xd7,0xaf, + 0x7f,0x1d,0x7f,0x99,0xf0,0x17,0xde,0xe4,0x2d,0x75,0x97,0x1a,0x6f,0xfe,0xfa,0x26, + 0xde,0xfc,0xf5,0x4d,0xe2,0x4c,0x6a,0x7b,0x70,0xb2,0xf4,0x24,0x1e,0xdc,0xf4,0x20, + 0x76,0xe7,0xec,0x1e,0xd0,0x45,0x12,0xe1,0x19,0x81,0x38,0x3f,0x72,0x43,0x30,0x2e, + 0x68,0x1c,0xf1,0xfd,0x3d,0x79,0xe9,0x24,0xd1,0xbe,0xdb,0xe9,0xb2,0xd3,0x78,0x64, + 0xf3,0x23,0xd8,0x70,0x66,0x43,0xaf,0x4b,0x4a,0x2a,0x92,0xe2,0xb1,0x69,0x8f,0x61, + 0xe5,0xdc,0x95,0xfd,0xba,0x83,0x34,0x6,0x8d,0x59,0xae,0x49,0x7f,0xf4,0xf5,0xf9, + 0xe2,0xa6,0x62,0x3c,0xb7,0xeb,0x39,0xb3,0x5a,0x30,0xb,0x62,0x17,0xe0,0xbe,0x9, + 0xf7,0xd,0xf8,0xbe,0xb8,0xca,0x5c,0x11,0xe3,0x13,0x43,0xe4,0xd1,0x60,0x39,0x16, + 0xeb,0x4e,0xae,0x23,0x52,0xc4,0xad,0x54,0x55,0xe2,0xe5,0x3d,0x2f,0xe3,0x85,0xdd, + 0x2f,0x98,0xd5,0x66,0x89,0xf7,0x8f,0xc7,0x9a,0xdb,0xd6,0x20,0x29,0x20,0xa9,0xdf, + 0x7d,0xc9,0xfa,0x8e,0x7a,0xde,0xd5,0xac,0xab,0xcc,0xd5,0xe2,0x7b,0xa9,0xb5,0x6a, + 0xbc,0xf0,0xd3,0xb,0x38,0x5a,0x7c,0xb4,0xf7,0xd8,0xd4,0xb0,0xa9,0x78,0x66,0xd6, + 0x33,0xe,0x2d,0x1a,0xe5,0x28,0xfa,0x34,0x1a,0x87,0x8b,0xe,0xe3,0x4c,0xb9,0x65, + 0x69,0xd7,0x1e,0x1c,0xbd,0xcb,0x1f,0xe1,0x11,0xc1,0xbb,0x64,0x8b,0xf6,0x8e,0xc6, + 0xb3,0xb3,0x9f,0x75,0xe8,0x4d,0x4f,0x2b,0x4f,0x23,0xd6,0xbf,0x71,0x73,0x72,0x73, + 0xf8,0x7d,0x71,0x77,0x72,0xc7,0xe3,0xd3,0x1f,0x27,0x1e,0x4c,0xaa,0xd5,0xd5,0x78, + 0x62,0xeb,0x13,0xd8,0x7c,0x6e,0x33,0x9a,0x3b,0xf9,0x95,0x61,0x55,0x1a,0x15,0x8e, + 0x97,0x1c,0xc7,0x7d,0x1b,0xee,0xc3,0x53,0x5b,0x9f,0x42,0x6e,0x5d,0xae,0x59,0xb8, + 0xb5,0xa7,0xb3,0x27,0x56,0xdf,0xb2,0x1a,0x4b,0xa6,0x2e,0x71,0x88,0xa2,0x68,0x5f, + 0x48,0x45,0x52,0xac,0xbe,0x79,0x35,0x56,0xdd,0xb4,0x8a,0x77,0x85,0xdb,0xa1,0xeb, + 0xc0,0x57,0xa9,0x5f,0xe1,0xcf,0xdf,0xfc,0x19,0xbf,0xe6,0xfd,0xea,0xb0,0x55,0x87, + 0x89,0x35,0xe1,0x52,0xd3,0x25,0xbc,0xb2,0xe7,0x15,0x2c,0xde,0xb4,0x18,0x19,0x15, + 0x19,0xbc,0x89,0x86,0x37,0x25,0xdc,0x64,0x95,0xdf,0xda,0x5b,0xe1,0x8d,0x29,0x61, + 0x64,0xb5,0x18,0x6a,0xd4,0x35,0x78,0x6d,0xef,0x6b,0xbd,0x7a,0x6c,0xbf,0x47,0x6b, + 0xd0,0x22,0xbb,0x26,0x1b,0x2f,0xec,0x7e,0x1,0xf7,0x7f,0x7f,0x3f,0x4e,0x94,0x9c, + 0xe8,0x6d,0xa3,0x94,0x29,0xf1,0xfc,0xdc,0xe7,0xf1,0xf2,0x75,0x2f,0xf,0xb8,0x5a, + 0xd7,0xe8,0x35,0x3,0x2a,0xf2,0xf6,0x50,0xd2,0x5c,0xd2,0x3b,0xa8,0x9a,0x58,0x13, + 0x8e,0x16,0x1f,0xc5,0xa3,0x9b,0x1f,0x45,0x56,0xd5,0xff,0xf6,0x1,0xa6,0x87,0x4f, + 0xc7,0xeb,0xb,0x5e,0xe7,0x7d,0x6f,0x5,0x8c,0x0,0xf3,0x63,0xe6,0x13,0x3f,0x67, + 0x67,0x2a,0xce,0xe0,0xc5,0xdd,0x2f,0xa2,0x42,0x55,0x61,0xf1,0x5b,0x18,0x4c,0x6, + 0x94,0xb6,0x94,0x62,0xed,0xd1,0xb5,0x58,0xb4,0x7e,0x11,0x36,0x9e,0xd9,0xd8,0xab, + 0x1e,0x2c,0x60,0x4,0x98,0x18,0x3a,0x11,0xdf,0xdd,0xfb,0x1d,0xaf,0x56,0x9d,0xba, + 0x4b,0xcd,0xfb,0x3b,0xab,0x34,0x2a,0xb3,0x24,0xbd,0xec,0x9a,0x6c,0x3c,0xbe,0xe5, + 0xf1,0xee,0xfc,0x97,0xff,0x17,0x1c,0x1d,0x1b,0x34,0x16,0xef,0xdd,0xf2,0xde,0x88, + 0x2d,0xce,0x64,0x61,0xea,0x2b,0x54,0x15,0x58,0x73,0x64,0x4d,0xbf,0x8a,0xaa,0x6, + 0x93,0x1,0xa5,0xcd,0xa5,0xfd,0x6e,0x60,0xd9,0x83,0x60,0xf7,0xe0,0x7e,0xa3,0xf, + 0x80,0xee,0xd9,0xee,0xb2,0x59,0xcb,0xe0,0xe9,0x64,0xff,0xa2,0x33,0x3d,0xe8,0x8c, + 0x3a,0x6c,0x48,0xdf,0x40,0x1c,0x95,0xd1,0xa6,0x6d,0xeb,0x7e,0xa0,0x1c,0x1c,0x35, + 0x37,0x27,0x7a,0xe,0xe6,0xc7,0xcc,0xc7,0xde,0x8b,0x7b,0x89,0xda,0x37,0x77,0x36, + 0x63,0xe5,0x8f,0x2b,0x31,0x25,0x74,0xa,0x16,0x25,0x2d,0xc2,0xac,0xc8,0x59,0x8, + 0x72,0xb,0xea,0x1d,0xc0,0xc,0x26,0x3,0x4a,0x9a,0x4a,0x70,0xbc,0xe4,0x38,0xe, + 0x16,0x1c,0xc4,0xd9,0xca,0xb3,0x7d,0x46,0x23,0x5,0x28,0x3,0xf0,0xda,0x82,0xd7, + 0xf0,0xe7,0xe4,0x3f,0xf,0xf9,0xa6,0x9d,0x5c,0x2c,0xc7,0x83,0x93,0x1e,0x84,0xbf, + 0xd2,0x1f,0x7f,0xdf,0xf7,0x77,0x14,0xd4,0x17,0xf4,0xdb,0xd6,0xc4,0x76,0xfb,0xaa, + 0x2f,0xd6,0x5d,0xc4,0xd,0xf1,0x37,0xe0,0xc1,0x49,0xf,0x62,0x62,0xc8,0x44,0xbb, + 0xf4,0x99,0xe3,0x38,0x34,0x77,0x36,0xe3,0x9b,0xb4,0x6f,0xb0,0x3b,0x67,0x37,0x72, + 0x6a,0xf9,0x25,0xc2,0x81,0x6e,0x57,0x8b,0xb5,0xc5,0x78,0xa4,0x22,0x29,0x16,0xc6, + 0x2d,0x24,0xd2,0xd9,0xea,0xd1,0x87,0x7b,0xf0,0xfb,0x7,0xb1,0x28,0x71,0x11,0x92, + 0x83,0x92,0xc1,0x80,0x41,0x85,0xaa,0x2,0x47,0x8a,0x8f,0xe0,0x6c,0xe5,0x59,0x8b, + 0xda,0xde,0x72,0xb1,0x1c,0x6f,0x2e,0x7c,0x13,0x77,0x8d,0xbb,0x8b,0x77,0x15,0xc7, + 0x72,0x2c,0x91,0x9b,0xf3,0x74,0xe9,0x69,0x7c,0x7a,0xfc,0x53,0x24,0x5,0x24,0x21, + 0xb5,0x2c,0x15,0x9b,0x32,0x36,0xf5,0xaa,0x51,0x3,0xdd,0x93,0x8e,0x55,0x37,0xad, + 0x42,0x84,0x17,0x59,0x7d,0x9b,0xc9,0xa1,0x93,0x11,0xe8,0x16,0x88,0xf2,0x96,0x72, + 0xde,0xb6,0x26,0xd6,0x84,0x9f,0xb2,0x7f,0x42,0xa5,0xaa,0x12,0xf3,0x63,0xe7,0x63, + 0x5c,0xd0,0x38,0x48,0x45,0x52,0xd4,0xa8,0x6b,0x90,0x5a,0x96,0x8a,0xb3,0x55,0x67, + 0x71,0xb1,0xf6,0xa2,0x45,0x80,0xc2,0xb5,0x31,0xd7,0xe2,0xed,0x1b,0xdf,0x26,0x52, + 0xec,0x66,0x59,0xfe,0x30,0xf6,0xc6,0x8e,0x46,0xbc,0x7b,0xf0,0x5d,0xcc,0x8f,0x9d, + 0x8f,0xbc,0xba,0x3c,0x6c,0x3c,0xb3,0x11,0x85,0x8d,0x85,0xbd,0xc6,0xc6,0xcb,0xd9, + 0xb,0x7f,0xbf,0xfe,0xef,0xe,0x91,0xb2,0x1f,0x2a,0x18,0xee,0xff,0xbf,0x8d,0x91, + 0x35,0x22,0xbb,0x26,0x1b,0x2f,0xee,0x7e,0x11,0x67,0x2a,0xfa,0x5f,0x65,0x0,0xc0, + 0x84,0x90,0x9,0xf8,0xe2,0xae,0x2f,0xec,0x52,0xdc,0xa8,0x3f,0x1e,0xda,0xf4,0x50, + 0xbf,0xa5,0x2e,0xef,0x1e,0x77,0x37,0xd6,0xfe,0x69,0x2d,0x51,0x12,0xd8,0x60,0xa8, + 0x6d,0xab,0xc5,0x7b,0x87,0xde,0xc3,0xc6,0x33,0x1b,0x89,0xf3,0x1d,0xc2,0x3c,0xc2, + 0xf0,0xdf,0x87,0xfe,0x3b,0x24,0x22,0x65,0xe5,0xaa,0x72,0x3c,0xf1,0xdf,0x27,0xcc, + 0x22,0x51,0xac,0x41,0x26,0x96,0xc1,0x4d,0xe6,0x6,0x16,0x2c,0x5a,0xbb,0x5a,0x7, + 0x8c,0x8a,0x11,0xb,0xc5,0x98,0x1a,0x36,0x15,0x1f,0xdc,0xfa,0x81,0xc3,0x22,0xd4, + 0xac,0x41,0xad,0x55,0xe3,0xcb,0x53,0x5f,0x62,0xfd,0xe9,0xf5,0x44,0xee,0x8,0xa1, + 0x40,0x88,0x44,0xff,0x44,0xdc,0x96,0x74,0x1b,0x92,0x83,0x92,0x11,0xed,0x1d,0x4d, + 0x9c,0x28,0xc9,0x71,0x1c,0x9a,0x35,0xcd,0xa8,0x50,0x55,0x20,0xb7,0x36,0x17,0x7, + 0xf2,0xf,0x20,0xa5,0x28,0x85,0x68,0xd6,0xfd,0x7b,0xae,0x8d,0xb9,0x16,0x9f,0xff, + 0xf9,0x73,0xe2,0x8d,0xdd,0x1e,0x1a,0xda,0x1b,0x70,0xcf,0x86,0x7b,0x88,0x25,0xd2, + 0x49,0x49,0xe,0x4a,0xc6,0x9b,0xd7,0xbf,0x49,0x2c,0x5f,0xde,0xda,0xd5,0x8a,0x7, + 0xbe,0x7f,0xc0,0x26,0x99,0x98,0x48,0xaf,0x48,0xac,0xfd,0xd3,0x5a,0xab,0x3,0x27, + 0xbe,0x3c,0xfd,0x25,0x5e,0xfb,0xe5,0xb5,0x41,0x47,0x47,0xf5,0x87,0xab,0xcc,0x15, + 0x8b,0x27,0x2d,0xc6,0xcb,0xd7,0xbd,0x4c,0xec,0xad,0x28,0x6d,0x2e,0xc5,0xf4,0x8f, + 0xa7,0xf,0x7a,0x5,0x1b,0xe6,0x11,0x86,0xb5,0xb7,0xaf,0xc5,0xcc,0xc8,0x99,0xe, + 0xb,0x24,0x1a,0xa,0x98,0xfc,0xfa,0x7c,0x2e,0xb7,0x2e,0x17,0x29,0x85,0x29,0x38, + 0x56,0x7c,0xc,0x55,0xea,0x2a,0xde,0x25,0x98,0x80,0x11,0x60,0x52,0xe8,0x24,0x3c, + 0x3e,0xfd,0x71,0x4c,0xe,0x9d,0xc,0x27,0xb1,0x93,0x45,0x1a,0xbf,0x48,0x20,0xb2, + 0xc9,0x75,0xf4,0x41,0xca,0x7,0x58,0x75,0x60,0x95,0xc5,0xf1,0x40,0x65,0x20,0xb6, + 0x2c,0xde,0x62,0x93,0xa5,0x36,0x98,0xc,0xd0,0x18,0x34,0x30,0x98,0xc,0x30,0x98, + 0xc,0x68,0xd3,0xb6,0xa1,0xaa,0xb5,0xa,0x35,0xea,0x1a,0x14,0x35,0x16,0xe1,0xc4, + 0xa5,0x13,0xc8,0xad,0xcd,0x25,0xda,0x5c,0xfc,0x3d,0x89,0x1,0x89,0x98,0x15,0x39, + 0xb,0x71,0xbe,0x71,0xf0,0x73,0xf5,0x83,0xbf,0xab,0x3f,0xdc,0xe4,0x6e,0x10,0xb, + 0xc5,0x10,0xb,0xc5,0x90,0x8,0x25,0x76,0xcb,0x6f,0xc9,0xa8,0xcc,0xc0,0xb2,0xed, + 0xcb,0x90,0xdf,0x90,0xef,0x10,0xd,0x26,0x86,0x61,0xe0,0xe9,0xe4,0x89,0x87,0xa7, + 0x3c,0x8c,0x87,0xa6,0x3c,0x44,0x94,0x37,0x31,0x54,0x18,0x59,0x23,0xce,0x54,0x9c, + 0xc1,0xf,0x19,0x3f,0xe0,0x97,0x8b,0xbf,0x40,0xdd,0xa5,0xe6,0x35,0xee,0x2,0x46, + 0x0,0xf,0x27,0xf,0xf8,0xbb,0xfa,0x23,0x40,0x19,0x80,0x70,0xcf,0x70,0x4,0xbb, + 0x7,0xc3,0xd3,0xc9,0x13,0x4e,0x52,0x27,0x88,0x5,0x62,0xe8,0x8c,0x3a,0x74,0x19, + 0xba,0xd0,0xa2,0x69,0x41,0x75,0x6b,0x35,0xca,0x5b,0xca,0x51,0xa5,0xae,0x42,0x53, + 0x47,0x13,0x1a,0x3a,0x1a,0xac,0x8a,0xce,0x92,0x8,0x25,0xf0,0x73,0xf5,0xc3,0xcd, + 0x9,0x37,0xe3,0xc1,0x49,0xf,0x22,0xd2,0x2b,0x72,0x50,0xab,0x9d,0x9d,0x59,0x3b, + 0xb1,0x74,0xc7,0x52,0xab,0xd,0x55,0x5f,0x38,0x49,0x9c,0x30,0x7f,0xd4,0x7c,0xbc, + 0x76,0xfd,0x6b,0x88,0xf0,0x8c,0x20,0x76,0xa7,0x9a,0x58,0x13,0x9e,0xd8,0xfa,0xc4, + 0xa0,0x32,0xf0,0x19,0x86,0x41,0xa4,0x67,0x24,0x3e,0xb8,0xf5,0x3,0xcc,0x8c,0x9c, + 0x69,0xf5,0x3d,0xa8,0x6f,0xaf,0xc7,0x13,0xff,0x7d,0x2,0x47,0x8a,0x8f,0x58,0x7d, + 0xed,0xbe,0x10,0x32,0x42,0x44,0x7a,0x47,0xe2,0xa5,0x6b,0x5f,0xc2,0x82,0xd8,0x5, + 0x56,0xbd,0x8f,0x5a,0x83,0x16,0xf1,0xef,0xc6,0x5b,0x2d,0xf7,0xc1,0x80,0x41,0x8c, + 0x6f,0xc,0xde,0xbe,0xf1,0x6d,0xcc,0x8d,0x9e,0x3b,0xa2,0xc2,0x6b,0xfb,0x82,0x71, + 0x7f,0xc9,0x9d,0xb3,0x65,0xd0,0xf1,0x72,0xf6,0x42,0xb8,0x67,0x38,0xbc,0x15,0xde, + 0x66,0xf,0xe1,0x75,0xb1,0xd7,0xe1,0xfe,0x9,0xf7,0xf,0xda,0xcf,0x7f,0xb0,0xe0, + 0x20,0xfe,0xfc,0xcd,0x9f,0xcd,0x8e,0x49,0x44,0x12,0xbc,0x71,0xfd,0x1b,0x78,0x7c, + 0xda,0xe3,0x83,0xf6,0xa9,0x73,0x1c,0x87,0xad,0x99,0x5b,0xf1,0x4d,0xea,0x37,0x68, + 0xe8,0x68,0x40,0x43,0x7b,0x83,0x43,0x55,0x61,0xe5,0x62,0x39,0x3c,0x9c,0x3c,0xe0, + 0xeb,0xe2,0x8b,0x6b,0xa2,0xae,0xc1,0xeb,0xd7,0xbf,0x6e,0xb7,0x73,0xe7,0xd7,0xe7, + 0xe3,0xe5,0x3d,0x2f,0xe3,0x68,0xf1,0x51,0xbb,0x66,0x80,0x2b,0xa4,0xa,0x2c,0x8c, + 0x5b,0x88,0xa7,0x66,0x3e,0x45,0x5c,0xe3,0xe4,0x4a,0xc0,0x71,0x1c,0xb2,0x6b,0xb3, + 0xb1,0xed,0xfc,0x36,0xec,0xbd,0xb8,0xb7,0x4f,0x9f,0xfe,0x50,0xa3,0x90,0x2a,0x30, + 0x39,0x74,0x32,0xae,0x8f,0xbb,0x1e,0x37,0xc6,0xdf,0x68,0xb3,0xb4,0x8a,0xd6,0xa8, + 0xc5,0xa7,0xc7,0x3e,0xc5,0x3f,0x7f,0xfb,0xa7,0xd5,0x93,0x98,0x1e,0x18,0x86,0x41, + 0x9c,0x6f,0x1c,0x96,0xce,0x5c,0x8a,0xdb,0xc6,0xdc,0x36,0xa8,0xc9,0xdc,0xf6,0xcc, + 0xed,0x58,0xb2,0x65,0x89,0x55,0x9f,0x11,0x30,0x2,0xcc,0x1d,0x35,0x17,0x6f,0xdf, + 0xf0,0x36,0x62,0x7c,0xc9,0x36,0xb5,0xfb,0x22,0xb7,0x36,0x17,0xf,0x7c,0xff,0x0, + 0x2e,0x35,0xdb,0x56,0x7c,0xcb,0xc3,0xc9,0x3,0x77,0x26,0xdf,0x89,0xa7,0x67,0x3c, + 0x3d,0x68,0x91,0xc7,0xc5,0x9b,0x16,0xe3,0xa7,0xec,0x9f,0x88,0xdb,0x8b,0x4,0x22, + 0xcc,0x8a,0x9a,0x85,0xf7,0x6e,0x7e,0xcf,0x21,0x35,0x3f,0xae,0x4,0x22,0x5b,0x67, + 0xa9,0x4d,0x9d,0x4d,0x16,0x91,0x15,0xc,0x98,0xee,0x50,0x32,0x1b,0x56,0x60,0xa1, + 0x1e,0xa1,0x50,0xca,0x95,0x66,0xd9,0x97,0x93,0x42,0x26,0xe1,0xfe,0x9,0xb6,0xd5, + 0xc9,0x30,0xb2,0x46,0x1c,0xc8,0x3f,0x40,0x24,0xf1,0x6c,0xf,0xba,0xc,0x5d,0xa8, + 0x56,0x57,0xa3,0x5a,0x5d,0x8d,0x49,0xa1,0x93,0xec,0x7a,0xee,0x58,0xdf,0x58,0xac, + 0xfb,0xf3,0x3a,0x6c,0xcd,0xdc,0x8a,0xaf,0x53,0xbf,0x46,0xa5,0xaa,0x72,0xd0,0x99, + 0xb1,0x62,0xa1,0x18,0x81,0xca,0x40,0x4c,0xa,0x9d,0x84,0x25,0xd3,0x96,0x20,0xce, + 0x37,0x6e,0xd8,0x6f,0xd4,0x31,0xc,0x83,0xa4,0x80,0x24,0xc4,0xfa,0xc6,0xe2,0xc9, + 0x19,0x4f,0xe2,0x5c,0xd5,0x39,0xec,0xcd,0xdd,0x8b,0x33,0x15,0x67,0xd0,0xac,0x69, + 0x26,0x5a,0x81,0xd8,0x8a,0x42,0xa2,0x80,0xa7,0xc2,0x13,0xe1,0x1e,0xe1,0x98,0x15, + 0x35,0xb,0xd7,0xc7,0x5d,0x8f,0x0,0xd7,0x0,0xb8,0xca,0x5d,0xed,0xe2,0x82,0x90, + 0x89,0x64,0x78,0x7a,0xe6,0xd3,0xe0,0xc0,0x61,0xfd,0xa9,0xf5,0xc4,0x35,0x26,0x80, + 0xee,0xdf,0x34,0xda,0x3b,0x1a,0xb7,0x26,0xde,0x8a,0x7b,0x27,0xdc,0xb,0x3f,0x57, + 0xbf,0x41,0x4f,0x0,0x16,0xc4,0x2e,0xc0,0xc4,0x90,0x89,0x38,0x5b,0x79,0x96,0xf7, + 0x9e,0xa,0x5,0x42,0x4,0x2a,0x3,0xb1,0x64,0xea,0x12,0xdc,0x35,0xee,0x2e,0x9b, + 0x43,0xf4,0x47,0xfb,0x8d,0xc6,0x17,0x77,0x7d,0x81,0xd7,0xf6,0xbe,0x86,0xb3,0x95, + 0x67,0xad,0x5a,0xf1,0x9,0x18,0x1,0x2,0x94,0x1,0x98,0x12,0x36,0x5,0xcf,0xcc, + 0x7c,0x6,0x31,0xbe,0x31,0x36,0xc9,0xa8,0xdf,0x37,0xf1,0x3e,0x9c,0x2a,0x3d,0xc5, + 0x2b,0xdc,0x28,0x12,0x88,0x10,0xe4,0x1e,0x84,0x27,0xa7,0x3f,0x89,0xdb,0xc7,0xdc, + 0x4e,0x2c,0xc4,0x39,0x12,0x60,0xdc,0x5e,0x74,0xb3,0xbb,0x6f,0x43,0x2e,0x96,0xe3, + 0xf3,0x3f,0x7f,0x8e,0x45,0x89,0x8b,0x6,0x7d,0x8e,0xba,0xb6,0x3a,0xdc,0xf5,0xed, + 0x5d,0xbd,0x79,0x12,0x1e,0x4e,0x1e,0xf8,0xf2,0xee,0x2f,0x31,0x77,0xd4,0x5c,0x9b, + 0xfa,0xd6,0x65,0xe8,0xc2,0xdc,0x4f,0xe7,0x12,0xd7,0xc7,0xb0,0x27,0x9f,0xde,0xf1, + 0x29,0xee,0x9d,0x70,0xaf,0x43,0xce,0x5d,0xd0,0x50,0x80,0x83,0xf9,0x7,0xb1,0x2b, + 0x7b,0x17,0xb2,0x6b,0xf8,0x4b,0x51,0x2,0xdd,0xc6,0xdd,0x5b,0xe1,0x8d,0xa9,0xe1, + 0x53,0x31,0x33,0x72,0x26,0x66,0x44,0xcc,0x40,0x94,0x57,0xd4,0x90,0x45,0x46,0x39, + 0x8a,0xf2,0x96,0x72,0x14,0x37,0x15,0x23,0xbf,0x3e,0x1f,0x99,0xd5,0x99,0xb8,0x50, + 0x7d,0x1,0x65,0xaa,0x32,0xde,0x8c,0x66,0x12,0xc4,0x42,0x31,0xc2,0x3d,0xc3,0x11, + 0xed,0x1d,0x8d,0x31,0x1,0x63,0x10,0xe3,0x13,0x83,0x18,0xdf,0x18,0x44,0x7a,0x46, + 0xda,0x45,0x69,0xb5,0x3f,0xf4,0x26,0x3d,0x52,0xcb,0x52,0xb1,0xe6,0xf0,0x1a,0x9c, + 0x2a,0x3b,0x35,0xe0,0x77,0x91,0x89,0x65,0x98,0x1e,0x3e,0x1d,0xd7,0xc5,0x5e,0x87, + 0x1b,0x46,0xdf,0x80,0x40,0x65,0xa0,0x5d,0x22,0xfb,0x2e,0xd4,0x5c,0xc0,0x2b,0x7b, + 0x5e,0x31,0x2b,0x28,0xf5,0x7b,0x18,0x86,0x41,0x90,0x5b,0x10,0xee,0x19,0x77,0xf, + 0x6e,0x4e,0xb8,0xd9,0xee,0x9b,0xbd,0xd5,0xea,0x6a,0x6c,0x3e,0xbb,0x19,0xdf,0xa5, + 0x7f,0x67,0x16,0x2e,0xdb,0x17,0x62,0xa1,0x18,0xc9,0x41,0xc9,0xb8,0x76,0xd4,0xb5, + 0xb8,0x2e,0xf6,0x3a,0xc4,0xfb,0xc5,0xdb,0xe5,0xf7,0xd1,0x19,0x75,0xd8,0x70,0x66, + 0x3,0x5e,0xdf,0xfb,0x7a,0x9f,0xf5,0xdb,0x19,0x86,0x41,0x94,0x57,0x14,0xee,0x18, + 0x7b,0x7,0x6e,0x4d,0xba,0x15,0xd1,0x5e,0xd1,0x23,0x46,0x53,0x8a,0x14,0xe6,0xbe, + 0x8d,0xf7,0xd9,0xdd,0x68,0x28,0x65,0x4a,0x2c,0x9d,0xb5,0x14,0x31,0x3e,0x31,0x83, + 0x3e,0x47,0x97,0xa1,0xb,0x5f,0x9c,0xfa,0x2,0x67,0x2b,0xcf,0x82,0x1,0x83,0xe9, + 0xe1,0xd3,0xf1,0xd0,0x94,0x87,0x6c,0xd6,0xcd,0xd7,0xe8,0x35,0x78,0x66,0xfb,0x33, + 0x30,0xb0,0x43,0x9b,0x3d,0x2c,0x15,0x4a,0xb1,0x62,0xee,0xa,0xab,0x92,0xb6,0xac, + 0x85,0xe3,0x38,0xe8,0x4d,0x7a,0x34,0x74,0x34,0x20,0xb3,0x2a,0x13,0x79,0xf5,0x79, + 0xa8,0x6d,0xab,0x85,0xba,0x4b,0xd,0x13,0x67,0x82,0x44,0x28,0x81,0x52,0xa6,0x84, + 0x8f,0x8b,0xf,0xa2,0xbc,0xa2,0x10,0xe3,0x1b,0x83,0x70,0x8f,0x70,0x88,0x85,0x62, + 0x88,0x84,0xa2,0x11,0xbd,0x39,0xd7,0x17,0x1c,0xc7,0xc1,0xc8,0x1a,0x61,0x62,0x4d, + 0xd0,0x19,0x75,0x68,0xec,0x6c,0x44,0x69,0x73,0x29,0xaa,0x5a,0xab,0x50,0xdf,0x5e, + 0xf,0x8d,0x5e,0x83,0x2e,0x43,0x17,0x34,0x7a,0xd,0xb4,0x6,0x2d,0xc,0xac,0x1, + 0x2,0x46,0x0,0x89,0x50,0x2,0xb9,0x58,0xe,0x85,0x54,0x1,0x77,0x27,0x77,0x78, + 0x39,0x7b,0xc1,0xcf,0xd5,0xf,0x21,0xee,0x21,0xf0,0x77,0xf5,0x87,0x5c,0x2c,0x87, + 0x50,0x20,0x84,0x50,0x20,0x1c,0x72,0xd7,0x9d,0xde,0xa8,0x47,0x45,0x6b,0x5,0x8e, + 0x97,0x1c,0x47,0x7e,0x7d,0x3e,0x9a,0x3a,0x9b,0xc0,0x72,0x2c,0x5c,0xa4,0x2e,0x8, + 0x75,0xf,0x45,0xbc,0x7f,0x3c,0xc6,0x5,0x8d,0x83,0x9b,0x93,0x1b,0xc4,0x2,0xb1, + 0xdd,0x7,0xac,0x4e,0x7d,0x27,0x52,0xcb,0x52,0x71,0xac,0xf8,0x18,0x6a,0xd4,0x35, + 0x60,0xc1,0x42,0x29,0x53,0x22,0xca,0x3b,0xa,0x13,0x43,0x26,0x62,0xb4,0xdf,0x68, + 0xc8,0xc5,0x72,0x87,0xdd,0x17,0x96,0x63,0xd1,0xa1,0xeb,0x40,0x6e,0x5d,0x2e,0x52, + 0x4b,0x53,0x51,0xae,0x2a,0x47,0x9b,0xb6,0xd,0x22,0x81,0x8,0xae,0x32,0x57,0xf8, + 0x2b,0xfd,0x11,0xe7,0x1b,0x87,0xb1,0x81,0x63,0xe1,0xe9,0xec,0x9,0xb1,0x50,0x6c, + 0xf7,0xbe,0x98,0x58,0x13,0xa,0x1b,0xa,0xb1,0x27,0x77,0x4f,0x6f,0x11,0x38,0x37, + 0xb9,0x1b,0x62,0x7d,0x63,0x31,0x3e,0x78,0x3c,0x62,0x7d,0x63,0x21,0x15,0xc0,0x66, + 0x63,0x1,0x0,0x0,0x20,0x0,0x49,0x44,0x41,0x54,0x49,0x87,0xad,0x5b,0xd7,0x56, + 0x18,0x9b,0x36,0x34,0x28,0x14,0xa,0x85,0xf2,0x87,0xe2,0xea,0x34,0x85,0x14,0xa, + 0x85,0x42,0x71,0x8,0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14, + 0xa,0x85,0x42,0xc,0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85, + 0x42,0xa1,0x10,0x43,0x8d,0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1, + 0x50,0x28,0xc4,0x50,0xa3,0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28, + 0x14,0xa,0x31,0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa, + 0x85,0x42,0xc,0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42, + 0xa1,0x10,0x43,0x8d,0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50, + 0x28,0xc4,0x50,0xa3,0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14, + 0xa,0x31,0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85, + 0x42,0xc,0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1, + 0x10,0x43,0x8d,0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28, + 0xc4,0x50,0xa3,0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa, + 0x31,0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42, + 0xc,0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1,0x10, + 0x43,0x8d,0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28,0xc4, + 0x50,0xa3,0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa,0x31, + 0xd4,0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42,0xc, + 0x35,0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1,0x10,0x43, + 0x8d,0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28,0xc4,0x50, + 0xa3,0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa,0x31,0xd4, + 0x68,0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42,0xc,0x35, + 0x1a,0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1,0x10,0x43,0x8d, + 0x6,0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28,0xc4,0x50,0xa3, + 0x41,0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa,0x31,0xd4,0x68, + 0x50,0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42,0xc,0x35,0x1a, + 0x14,0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1,0x10,0x43,0x8d,0x6, + 0x85,0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28,0xc4,0x50,0xa3,0x41, + 0xa1,0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa,0x31,0xd4,0x68,0x50, + 0x28,0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42,0xc,0x35,0x1a,0x14, + 0xa,0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1,0x10,0x43,0x8d,0x6,0x85, + 0x42,0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28,0xc4,0x50,0xa3,0x41,0xa1, + 0x50,0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa,0x31,0xd4,0x68,0x50,0x28, + 0x14,0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42,0xc,0x35,0x1a,0x14,0xa, + 0x85,0x42,0x21,0x86,0x1a,0xd,0xa,0x85,0x42,0xa1,0x10,0x43,0x8d,0x6,0x85,0x42, + 0xa1,0x50,0x88,0xa1,0x46,0x83,0x42,0xa1,0x50,0x28,0xc4,0x50,0xa3,0x41,0xa1,0x50, + 0x28,0x14,0x62,0xa8,0xd1,0xa0,0x50,0x28,0x14,0xa,0x31,0xd4,0x68,0x50,0x28,0x14, + 0xa,0x85,0x18,0x6a,0x34,0x28,0x14,0xa,0x85,0x42,0xc,0x35,0x1a,0x14,0xa,0x85, + 0x42,0x21,0x46,0xf8,0xe6,0x9b,0x6f,0xbe,0x79,0xa5,0x3b,0x61,0x2d,0x7,0xf2,0xf, + 0x60,0x77,0xce,0x6e,0xf8,0xb9,0xf8,0xc1,0xdd,0xc9,0xfd,0x4a,0x77,0xc7,0x2,0x13, + 0x6b,0x42,0x4a,0x61,0xa,0x76,0x65,0xef,0x42,0x90,0x5b,0x10,0x94,0x72,0xe5,0x95, + 0xee,0x92,0x5,0x35,0xea,0x1a,0xec,0xbc,0xb0,0x13,0xf9,0xf5,0xf9,0x88,0xf4,0x8a, + 0x84,0x58,0x28,0xbe,0xd2,0x5d,0xfa,0x43,0xa0,0x37,0xea,0x91,0x5a,0x96,0x8a,0xa3, + 0xc5,0x47,0xa1,0x94,0x2b,0xe1,0x26,0x77,0xb3,0xe9,0x7c,0xd9,0xb5,0xd9,0xd8,0x91, + 0xb5,0x3,0xed,0xda,0x76,0x84,0x7b,0x86,0xdb,0xa9,0x97,0xe4,0xb0,0x1c,0x8b,0x63, + 0x25,0xc7,0xb0,0x33,0x6b,0x27,0xbc,0x14,0x5e,0xf0,0x74,0xf6,0x1c,0xd2,0xeb,0x1b, + 0x4c,0x6,0xa4,0x97,0xa7,0xe3,0x48,0xf1,0x11,0x38,0x49,0x9c,0x20,0x15,0x49,0x71, + 0xfc,0xd2,0x71,0x9c,0x28,0x39,0x81,0x60,0xf7,0x60,0xc8,0xc5,0x72,0xbb,0x5e,0xef, + 0xc7,0xb,0x3f,0x62,0x7f,0xfe,0x7e,0x84,0x78,0x84,0xc0,0x45,0xea,0x62,0xd7,0x73, + 0xf,0x27,0x4c,0xac,0x9,0x8d,0x1d,0x8d,0x68,0xd1,0xb4,0x58,0x8c,0x5f,0x7d,0xae, + 0x34,0x38,0x70,0xc8,0xaa,0xce,0xc2,0x9a,0x23,0x6b,0xf0,0xe9,0xb1,0x4f,0xf1,0xc5, + 0xc9,0x2f,0xf0,0xfc,0x4f,0xcf,0x63,0x47,0xd6,0xe,0x70,0xe0,0x1c,0xda,0xd9,0xbf, + 0xef,0xfb,0x3b,0x56,0x1d,0x58,0x5,0x13,0x67,0xea,0xb7,0x8d,0xbf,0xab,0x3f,0x36, + 0x9f,0xdd,0xc,0x67,0xa9,0x73,0xbf,0x6d,0xc,0x26,0x83,0xd9,0xff,0x4d,0xac,0x9, + 0x17,0x6a,0x2e,0x20,0xbd,0x3c,0x1d,0xe9,0xe5,0xe9,0xe8,0xd4,0x77,0x9a,0xfd,0x3d, + 0xb7,0x36,0x17,0xe9,0xe5,0xe9,0x38,0x57,0x75,0xe,0x7a,0x93,0xbe,0xf7,0x78,0x5d, + 0x5b,0x1d,0x52,0xcb,0x52,0x91,0x5a,0x96,0xa,0x95,0x46,0xd5,0x7b,0xbc,0x4d,0xdb, + 0x86,0x33,0x15,0x67,0x90,0x56,0x96,0x86,0xfc,0xfa,0x7c,0xb0,0x1c,0xdb,0xfb,0x37, + 0xa1,0x40,0x88,0x60,0xf7,0x60,0x6c,0xcb,0xdc,0x6,0x91,0x40,0x44,0xfc,0xdd,0xf5, + 0x46,0x3d,0x3e,0x39,0xf6,0x9,0x62,0x57,0xc5,0xe2,0xd3,0xe3,0x9f,0xe2,0xeb,0xd4, + 0xaf,0xf1,0xda,0xde,0xd7,0xf0,0xcc,0xf6,0x67,0x88,0xcf,0x41,0x8a,0xb7,0xc2,0x1b, + 0x55,0xad,0x55,0x38,0x5f,0x75,0x7e,0x44,0x1b,0xc,0x23,0x6b,0x34,0xbb,0xf7,0x8e, + 0x42,0xd5,0xa5,0xc2,0x7,0x29,0x1f,0x20,0xfe,0xdd,0x78,0xec,0xce,0xd9,0x8d,0x16, + 0x4d,0xb,0x56,0x1f,0x5a,0x8d,0xbf,0x6c,0xf8,0xb,0xbe,0x4e,0xfd,0x1a,0x3a,0xa3, + 0x8e,0xe8,0x3c,0x62,0xa1,0x18,0x72,0x89,0x1c,0xdf,0xa4,0x7d,0x63,0xf1,0xc,0xe, + 0x86,0x68,0xaf,0x68,0xec,0xcf,0xdb,0x8f,0x96,0xae,0x16,0xab,0x3f,0xdb,0xa9,0xef, + 0xc4,0xae,0xb,0xbb,0xf0,0xee,0xc1,0x77,0xf1,0xc5,0xc9,0x2f,0xf0,0xc9,0xb1,0x4f, + 0xb0,0x7c,0xd7,0x72,0x94,0x34,0x95,0x10,0x9f,0x43,0xc0,0x8,0x10,0xe9,0x15,0x89, + 0x6d,0x99,0xdb,0x2c,0xc6,0x6,0x75,0x97,0x1a,0x9f,0x9f,0xfc,0x1c,0x49,0xef,0x25, + 0x61,0xcb,0xb9,0x2d,0x68,0xd7,0xb5,0xa3,0x5a,0x5d,0x8d,0xe7,0x76,0x3e,0x87,0x85, + 0xeb,0x16,0x62,0xef,0xc5,0xbd,0x56,0xf7,0xf9,0x42,0xcd,0x5,0xdc,0xf2,0x9f,0x5b, + 0x70,0xa9,0xf9,0x12,0x0,0x40,0x24,0x10,0xc1,0x59,0xea,0x8c,0x6f,0xd3,0xbf,0x45, + 0x87,0xae,0x3,0x4e,0x12,0x27,0xe8,0x4d,0x7a,0x6c,0x3a,0xbb,0xc9,0xec,0x3d,0xe6, + 0x38,0xe,0xeb,0x53,0xd7,0x63,0xca,0x47,0x53,0xf0,0xfa,0xde,0xd7,0xf1,0xe1,0xe1, + 0xf,0xf1,0xd8,0x96,0xc7,0x70,0xb1,0xee,0x62,0x6f,0x9b,0xa5,0xdb,0x97,0x62,0xdd, + 0xc9,0x75,0xe0,0xb8,0xfe,0xc7,0x38,0x4f,0x67,0x4f,0x6c,0x3d,0xbf,0x15,0x4a,0x59, + 0xdf,0x13,0x41,0x8e,0xe3,0x60,0x64,0x8d,0x3,0x7e,0x87,0x9e,0x67,0x67,0xd2,0x87, + 0x93,0xf0,0x41,0xca,0x7,0x78,0x6b,0xdf,0x5b,0x78,0xe9,0xe7,0x97,0x50,0xd7,0x56, + 0x67,0xcd,0xad,0x70,0x28,0x45,0x8d,0x45,0x78,0x66,0xfb,0x33,0xd8,0x91,0xb5,0xc3, + 0xe2,0x6f,0x7d,0x1a,0x8d,0xe2,0xc6,0x62,0xbc,0xfa,0xcb,0xab,0x88,0xf7,0x8b,0xc7, + 0x53,0x33,0x9f,0xc2,0xe3,0xd3,0x1f,0xc7,0xc3,0x53,0x1e,0x46,0x51,0x63,0x11,0x18, + 0x30,0xe,0xed,0xec,0xf5,0x71,0xd7,0xe3,0xa6,0xf8,0x9b,0x20,0x60,0xfa,0xf6,0x9c, + 0x71,0xe0,0x60,0x60,0xd,0x50,0xca,0x95,0x7d,0xfe,0x70,0x6,0x93,0x1,0x3b,0x2f, + 0xec,0x44,0x55,0x6b,0x55,0xef,0x31,0x96,0x63,0xb1,0xf5,0xfc,0x56,0x6c,0x3e,0xbb, + 0x19,0x2c,0xc7,0xe2,0x97,0xdc,0x5f,0xb0,0xee,0xe4,0xba,0xde,0xbf,0xed,0xcb,0xdb, + 0x87,0x6f,0xd3,0xbf,0x85,0xd6,0xa8,0xc5,0xd7,0xa9,0x5f,0xe3,0xb7,0x82,0xdf,0x0, + 0x0,0x85,0xd,0x85,0x78,0x7b,0xff,0xdb,0xd0,0x18,0x34,0x38,0x5f,0x75,0x1e,0x1f, + 0x1f,0xf9,0x18,0x3a,0xa3,0xe,0x7a,0x93,0x1e,0xff,0xd8,0xff,0xf,0x5c,0xac,0xbb, + 0x8,0x23,0x6b,0xc4,0xbf,0x8e,0xfd,0xb,0xa5,0xcd,0xa5,0x66,0xfd,0xd0,0x1b,0xf5, + 0xf0,0x55,0xf8,0xc2,0x59,0xd2,0xbf,0x61,0xbb,0x1c,0x89,0x48,0x82,0x89,0x21,0x13, + 0xe1,0x2a,0x73,0xc5,0xe3,0xd3,0xba,0xef,0xf9,0x8a,0x39,0x2b,0x30,0x6f,0xd4,0x3c, + 0xe2,0x73,0x90,0x22,0x12,0x88,0x50,0xd7,0x5e,0x87,0xd1,0x7e,0xa3,0xad,0x32,0x6c, + 0xd6,0xe2,0xc8,0x49,0x46,0x6b,0x57,0x2b,0xb6,0x9c,0xdb,0x2,0x8d,0x5e,0xe3,0xb0, + 0x6b,0xf4,0xe0,0x2e,0x77,0x47,0x84,0x67,0x4,0x62,0x7c,0x62,0xb0,0x30,0x6e,0x21, + 0xaa,0x5a,0xab,0xe0,0x2a,0x75,0xc5,0xfb,0xb7,0xbc,0x8f,0x87,0xa7,0x3c,0xc,0xa9, + 0x48,0x4a,0x74,0x1e,0x86,0x61,0x50,0xd7,0x56,0x7,0x77,0x27,0x77,0x4,0xbb,0x5, + 0xdb,0xdc,0x2f,0x89,0x50,0x82,0x4e,0x7d,0x27,0x42,0xdd,0x43,0xad,0xfa,0x9c,0x89, + 0x35,0x61,0xfd,0xe9,0xf5,0x48,0x29,0x4c,0xc1,0x23,0x53,0x1f,0xc1,0xe3,0xd3,0x1f, + 0xc7,0xd2,0x59,0x4b,0x11,0xe9,0x15,0x9,0xb5,0x56,0x6d,0xd5,0xb9,0xc,0x26,0x3, + 0xdc,0xe4,0x6e,0x70,0x93,0x99,0xaf,0x9a,0x94,0x72,0x25,0x22,0x3d,0x23,0x11,0xe9, + 0x19,0x89,0x1b,0x46,0xdf,0x0,0x17,0xa9,0xb,0x2,0x95,0x81,0xf0,0x73,0xf5,0xc3, + 0x84,0xe0,0x9,0xb8,0x3e,0xee,0x7a,0xab,0xae,0xd3,0x65,0xe8,0x42,0x66,0x75,0x26, + 0x1a,0x3b,0x1b,0xa1,0xee,0xea,0xee,0x23,0xc3,0x30,0x68,0xec,0x68,0x84,0x42,0xa2, + 0x40,0xb8,0x67,0x38,0x4,0x8c,0x0,0x95,0xaa,0x4a,0x44,0x7a,0x45,0x9a,0xad,0xe2, + 0x18,0x86,0xc1,0xb8,0xc0,0x71,0x70,0x91,0xba,0x60,0xd9,0x35,0xcb,0xf0,0xec,0xac, + 0x67,0xa1,0x90,0x2a,0xf0,0x4d,0xda,0x37,0xbd,0x6d,0xee,0x18,0x7b,0x7,0x66,0x47, + 0xcf,0x6,0xc3,0xf4,0x3f,0xc6,0x75,0x19,0xba,0xe0,0xe7,0xea,0xd7,0xe7,0x7b,0xad, + 0x37,0xea,0xb1,0x3d,0x6b,0x3b,0xef,0xe0,0xef,0xe1,0xe4,0x81,0x51,0xde,0xa3,0x10, + 0xed,0x1d,0x8d,0x27,0x67,0x3c,0x89,0xe7,0xe7,0x3d,0x8f,0x8c,0x8a,0xc,0x1c,0x29, + 0x3e,0x62,0xd5,0xfd,0x70,0x24,0x1,0xca,0x0,0x88,0x5,0x62,0x8c,0xb,0x1a,0x67, + 0xf1,0x37,0x8b,0xd1,0xa2,0x53,0xdf,0x89,0x77,0xe,0xbe,0x83,0x29,0x61,0x53,0x30, + 0x6f,0xd4,0xbc,0xde,0xc1,0x3b,0xd6,0x27,0x16,0x4e,0xe3,0x9d,0xc0,0x81,0x43,0x45, + 0x4b,0x5,0x72,0x6a,0x73,0xc0,0x80,0x41,0xb0,0x7b,0x30,0xe2,0xfd,0xe3,0xd1,0xd4, + 0xd9,0x84,0xcc,0xaa,0x4c,0xb8,0xc8,0x5c,0x10,0xe5,0x15,0x85,0x93,0xa5,0x27,0x21, + 0x16,0x88,0x71,0x4d,0xd4,0x35,0x68,0xee,0x6c,0x46,0x51,0x63,0x11,0x12,0x3,0x12, + 0xe1,0xeb,0xe2,0x8b,0x8c,0x8a,0xc,0x18,0x4c,0x6,0x48,0xc5,0x52,0xa8,0xbb,0xd4, + 0xf0,0x77,0xf5,0x47,0x6e,0x5d,0x2e,0x3c,0x9d,0x3d,0x51,0xdb,0x56,0x8b,0x85,0x71, + 0xb,0xc1,0x80,0x41,0x73,0x67,0x33,0xd2,0xca,0xd3,0xc0,0x72,0x2c,0x64,0x22,0x19, + 0xba,0xc,0x5d,0x18,0x13,0x38,0x6,0x39,0xb5,0x39,0x48,0xf0,0x4b,0x40,0xbb,0xae, + 0x1d,0x7,0xb,0xe,0x42,0x26,0x92,0x61,0x56,0xe4,0x2c,0x34,0x76,0x36,0x62,0x5f, + 0xde,0x3e,0xfc,0xeb,0xe8,0xbf,0xf0,0xce,0x4d,0xef,0x40,0x21,0x55,0xc0,0x5b,0xe1, + 0xd,0xad,0x41,0x8b,0x72,0x55,0x39,0x9e,0x9c,0xf1,0x24,0x42,0xdc,0x43,0x50,0xd4, + 0x58,0x84,0x6f,0xd3,0xbe,0xc5,0x8a,0x39,0x2b,0x90,0x5f,0x9f,0x8f,0x37,0x7e,0x7d, + 0x3,0x9b,0x1f,0xdc,0x8c,0x70,0xcf,0x70,0xa4,0x95,0xa5,0x61,0xd7,0x85,0x5d,0x58, + 0x10,0xb7,0x0,0x6f,0xfc,0xfa,0x6,0xa6,0x47,0x4c,0xc7,0xdc,0xe8,0xb9,0xf0,0x77, + 0xf1,0xc7,0x5d,0xdf,0xde,0x85,0xa7,0x67,0x3d,0x8d,0x9d,0x59,0x3b,0x61,0x60,0xd, + 0xb8,0x7b,0xdc,0xdd,0x90,0x8a,0xa4,0x8,0x76,0xf,0x86,0xaf,0x8b,0xaf,0xd9,0x7d, + 0xcc,0xa8,0xcc,0x40,0x82,0x7f,0x2,0x3a,0xf5,0x9d,0x38,0x54,0x78,0x8,0xae,0x32, + 0x57,0x8c,0x9,0x18,0x83,0xfc,0xfa,0x7c,0xb8,0x39,0xb9,0x21,0x29,0x20,0x9,0x75, + 0x6d,0x75,0x38,0x5b,0x75,0x16,0x37,0x8e,0xbe,0xb1,0xf7,0x73,0x39,0xb5,0x39,0x48, + 0xc,0x48,0x84,0x50,0x20,0x84,0x89,0x33,0xc1,0xc8,0x1a,0xb1,0x28,0x71,0x11,0xc, + 0x26,0x3,0x52,0xcb,0x52,0xd1,0xa1,0xeb,0x0,0xc3,0x30,0x98,0x1c,0x3a,0x19,0xee, + 0x4e,0xee,0xa8,0x50,0x55,0xa0,0xa8,0xb1,0x8,0xfe,0xae,0xfe,0xa8,0x6b,0xaf,0x83, + 0x97,0xb3,0x17,0xdc,0xe4,0x6e,0xc8,0xaa,0xce,0x42,0xa8,0x47,0x28,0x92,0x2,0x92, + 0xc0,0x72,0x2c,0x72,0x6a,0x73,0x50,0xd5,0x5a,0x5,0xb1,0x50,0x8c,0x19,0x11,0x33, + 0xd0,0xa1,0xeb,0x40,0xa5,0xaa,0x12,0x8f,0x4f,0x7b,0x1c,0xd9,0x35,0xd9,0xc8,0xac, + 0xce,0xc4,0x9c,0xe8,0x39,0x8,0x74,0xb,0xc4,0xf9,0xaa,0xf3,0xa8,0x6e,0xad,0x46, + 0xa0,0x32,0x10,0xc9,0x41,0xc9,0x60,0x18,0x6,0x29,0x85,0x29,0x88,0xf3,0x8b,0x43, + 0x8d,0xba,0x6,0x75,0x6d,0x75,0x18,0x1f,0x3c,0x1e,0x35,0xea,0x1a,0xe4,0xd6,0xe5, + 0x62,0x6e,0xf4,0x5c,0x4,0xba,0x5,0x42,0xa5,0x51,0x21,0xbd,0x3c,0x1d,0x46,0xd6, + 0x8,0x89,0x48,0x2,0xad,0x41,0x8b,0x4,0xff,0x4,0x88,0x85,0x62,0x9c,0xaf,0x3a, + 0x8f,0x60,0xf7,0x60,0x8c,0xd,0x1c,0x8b,0xe2,0xc6,0x62,0x1c,0x2d,0x39,0xa,0x96, + 0x65,0xc1,0x30,0xc,0x26,0x84,0x4c,0x40,0x52,0x40,0x12,0xca,0x5b,0xca,0x51,0xdc, + 0x54,0xc,0x8d,0x5e,0x83,0x99,0x91,0x33,0x51,0xdf,0x56,0x8f,0xa2,0xa6,0x22,0x24, + 0xfa,0x27,0x82,0xe5,0x58,0xa4,0x96,0xa5,0x62,0x4c,0xe0,0x18,0x24,0xf8,0x27,0x20, + 0xbd,0x3c,0x1d,0x1b,0x33,0x36,0xa2,0xa5,0xb3,0x5,0xfe,0xae,0xfe,0xf0,0x73,0xf5, + 0x43,0xad,0xba,0x16,0x91,0x5e,0x91,0x38,0x57,0x75,0xe,0x41,0x6e,0x41,0x68,0xd5, + 0xb4,0x82,0xe5,0x58,0x5c,0x17,0x7b,0x1d,0x84,0x2,0x21,0xb2,0x6b,0xb2,0x21,0x60, + 0x4,0x10,0x9,0x45,0x28,0x68,0x28,0x40,0xbc,0x5f,0x3c,0x0,0xe0,0x74,0xd9,0x69, + 0x24,0x5,0x24,0x21,0xc2,0x33,0x2,0x47,0x8b,0x8f,0x42,0x2c,0x14,0x63,0xee,0xa8, + 0xb9,0x16,0xc6,0x34,0xad,0x3c,0xd,0xe3,0x83,0xc7,0xe3,0x58,0xc9,0x31,0xa8,0xb5, + 0x6a,0x3c,0x31,0xe3,0x89,0xde,0xf7,0x83,0xe5,0x58,0x5c,0x6a,0xba,0x84,0xc2,0xc6, + 0x42,0x98,0x58,0x13,0xda,0x75,0xed,0x58,0x18,0xb7,0x10,0x35,0x6d,0x35,0xa8,0x55, + 0xd7,0x22,0xdc,0x33,0x1c,0xe7,0xab,0xce,0x63,0xee,0xa8,0xb9,0xc8,0xa8,0xcc,0x40, + 0x9c,0x6f,0x1c,0x5c,0x65,0xae,0xf8,0xbf,0x76,0xee,0x3c,0xba,0xad,0xf2,0x4c,0xfc, + 0xf8,0x57,0xbb,0x2c,0xc9,0xb2,0x2c,0x4b,0xb6,0x65,0x3b,0xb6,0x65,0xcb,0x6b,0x9c, + 0x7d,0xc1,0x59,0x48,0xc8,0x42,0x52,0xb2,0xb4,0x94,0xad,0x94,0xd3,0xbd,0x53,0xa6, + 0xed,0x50,0x7a,0x68,0x29,0x30,0xd3,0x96,0x72,0xe8,0x4a,0x29,0x2d,0x5b,0x59,0xb, + 0xb4,0x1d,0x5a,0x96,0x40,0x9,0x21,0xc1,0x9,0x34,0x49,0x63,0x42,0xe2,0xc4,0x49, + 0xbc,0xc5,0xfb,0xbe,0xca,0x96,0x2c,0xcb,0x8b,0xf6,0xed,0xfe,0xfe,0xd0,0xc9,0xed, + 0xf8,0x97,0x94,0xc9,0x74,0x38,0x67,0xe8,0xcc,0xfd,0xfc,0x97,0xe8,0x5e,0xdd,0xf7, + 0x2e,0x7a,0x9f,0xf7,0x7d,0xde,0xe7,0xda,0x1f,0xf1,0xd3,0x30,0xd2,0xc0,0x6c,0x68, + 0x96,0x4d,0x25,0x9b,0x8,0xc7,0xc2,0x9c,0x77,0x9e,0x47,0x2e,0x93,0xa3,0x53,0xeb, + 0x18,0x99,0x1e,0x21,0x33,0x35,0x93,0xd1,0xe9,0x51,0xaa,0x6c,0x55,0x94,0x58,0x4b, + 0x8,0xc7,0xc2,0xd4,0xf6,0xd4,0xb2,0xb6,0x68,0x2d,0xa3,0x33,0xa3,0xe8,0x54,0x3a, + 0x72,0x8c,0x39,0x1c,0xed,0x3e,0x8a,0xc7,0xef,0xe1,0xea,0xf2,0xab,0x49,0xd3,0xa6, + 0x91,0x10,0x12,0x9c,0x1d,0x3e,0x8b,0xdb,0xe7,0x46,0xab,0xd2,0xb2,0xbe,0x68,0x3d, + 0x6a,0x85,0x1a,0x48,0x8e,0x24,0x7f,0x77,0xfa,0x77,0xbc,0xf8,0xd9,0x17,0xc9,0x34, + 0x64,0x8a,0xe7,0x78,0xd3,0xb2,0x9b,0x50,0x2b,0xd5,0xb8,0x7d,0x6e,0x1a,0x47,0x1b, + 0xd1,0xab,0xf5,0x38,0xac,0xe,0x4e,0xf6,0x9f,0x44,0xa7,0xd6,0xb1,0xd6,0xbe,0x96, + 0xf3,0xce,0xf3,0xc,0x7b,0x87,0xd9,0x5c,0xba,0x19,0xb3,0xce,0xcc,0xd9,0xe1,0xb3, + 0x94,0x65,0x96,0x11,0x17,0xe2,0xbc,0xd1,0xfc,0x6,0x29,0xaa,0x14,0x36,0x3a,0x36, + 0x92,0xa2,0x4a,0xa1,0x7e,0xa8,0x9e,0x4a,0x5b,0x25,0x3a,0xb5,0xe,0x48,0x6,0x98, + 0xf6,0xf1,0xf6,0xf,0x1c,0x18,0xfe,0x2d,0x1d,0x13,0x1d,0x64,0xa5,0x66,0x61,0xd1, + 0x5b,0x98,0xe,0x4e,0x3,0xc9,0x91,0x7d,0xe3,0x48,0xa3,0x18,0x24,0x62,0x89,0x18, + 0xa7,0x7,0x4f,0xb3,0xa6,0x70,0xd,0x5a,0xa5,0x76,0xde,0xfe,0xbd,0x9e,0x5e,0x4c, + 0x3a,0x13,0x16,0xbd,0x85,0x50,0x34,0x84,0x2f,0xe2,0xc3,0x66,0xb4,0x11,0x4f,0xc4, + 0xa9,0xed,0xad,0xc5,0x13,0xf0,0x88,0x9d,0xe4,0xc4,0xdc,0x4,0xa7,0x7,0x4f,0x23, + 0x93,0xc9,0xd0,0xa9,0x74,0xf8,0x23,0x7e,0x56,0xe5,0xaf,0xa2,0x69,0xb4,0x89,0xe5, + 0x79,0xcb,0x71,0xfb,0xdc,0x1c,0xef,0x3b,0x4e,0x86,0x3e,0x83,0x75,0xf6,0x75,0xc, + 0x4f,0xf,0xb3,0xb7,0x65,0x2f,0xaf,0x9c,0x7b,0x85,0xef,0x6d,0xfb,0x1e,0x5a,0x95, + 0x96,0xc1,0xa9,0x41,0xc6,0x66,0xc6,0x58,0x53,0xb8,0x6,0x8b,0xc1,0x22,0xb6,0x43, + 0x10,0x4,0xea,0x87,0xea,0x59,0x9c,0xb3,0x18,0xbd,0x5a,0x8f,0x37,0xe0,0x25,0x96, + 0x88,0x89,0x3,0x8f,0x58,0x22,0xc6,0xb9,0x91,0x73,0xb8,0xe7,0xdc,0x18,0x34,0x6, + 0xd6,0xd9,0xd7,0x31,0x17,0x9e,0xa3,0x6e,0xa0,0xe,0x9d,0x5a,0xc7,0x46,0xc7,0x46, + 0x0,0x46,0x67,0x46,0xe9,0x98,0xe8,0xc0,0x1b,0xf0,0xb2,0xa1,0x78,0x3,0x71,0x21, + 0x4e,0xc7,0x44,0x7,0xe9,0xba,0x74,0x7c,0x61,0x1f,0xa1,0x68,0x8,0x8d,0x52,0x43, + 0x30,0x1a,0xe4,0xca,0xe2,0x2b,0x19,0xf6,0xe,0xe3,0xd,0x7a,0xb9,0xa2,0xe0,0xa, + 0x26,0xfd,0x93,0xb4,0x8d,0xb7,0xe1,0xf6,0xb9,0x59,0x9a,0xbb,0x94,0x62,0x4b,0x31, + 0xd1,0x78,0x94,0x56,0x67,0x2b,0xce,0x59,0x27,0x13,0x73,0x13,0xc,0x4c,0xd,0x50, + 0x65,0xab,0xba,0xe8,0x3e,0x5c,0x74,0xd7,0xfa,0x3d,0xfd,0xb4,0x8c,0xb5,0x88,0x3f, + 0xb4,0xb,0x64,0x32,0x19,0x5,0xe9,0x5,0x34,0x8c,0x34,0x70,0xf7,0xbe,0xbb,0xd1, + 0xaa,0xb4,0x14,0x64,0x14,0x70,0x6f,0xcd,0xbd,0xb4,0x3a,0x5b,0xd1,0xab,0xf5,0x1c, + 0x6c,0x3f,0xc8,0xbe,0x96,0x7d,0x1c,0xeb,0x39,0x46,0x96,0x21,0x8b,0x7f,0xdb,0xff, + 0x6f,0x34,0x8f,0x35,0x33,0x13,0x9a,0xe1,0x99,0x13,0xcf,0xd0,0xe2,0x6c,0x21,0x9e, + 0x88,0xf3,0x5c,0xdd,0x73,0xbc,0xdb,0xf9,0x2e,0x7b,0x1a,0xf6,0xf0,0xe4,0xf1,0x27, + 0xd9,0xdb,0xb2,0x97,0xd7,0x1a,0x5f,0xc3,0xa8,0x35,0xf2,0x5a,0xe3,0x6b,0x28,0x15, + 0x4a,0xa6,0x83,0xd3,0xfc,0xdb,0xfe,0x7f,0xc3,0xed,0x73,0x63,0x37,0xdb,0xb9,0xfd, + 0xf5,0xdb,0x19,0xf6,0xe,0x8b,0x1d,0x62,0x61,0x46,0x21,0x67,0x86,0xce,0x10,0x8a, + 0x86,0xf8,0xd9,0x9f,0x7f,0x86,0x27,0xe0,0xc1,0xa8,0x31,0x12,0x8e,0x85,0x29,0xcb, + 0x2a,0xa3,0x3c,0xab,0x5c,0x1c,0xd,0xe8,0xd4,0x3a,0xbe,0xb1,0xe1,0x1b,0x2c,0x30, + 0x2d,0xc0,0x17,0xf6,0x71,0xbc,0xef,0x38,0xeb,0x8a,0xd6,0x1,0x70,0xa8,0xfd,0x10, + 0x16,0xbd,0x5,0x7b,0x86,0x9d,0x44,0x22,0xc1,0x5c,0x78,0x8e,0x68,0x22,0x4a,0xcb, + 0x58,0xb,0xfd,0x9e,0x7e,0xd6,0xdb,0xd7,0x3,0x30,0x1d,0x9a,0x26,0x96,0x88,0xe1, + 0x9e,0x73,0xb3,0xbf,0x75,0x3f,0x39,0xc6,0x1c,0x7e,0x50,0xf3,0x3,0xee,0x7a,0xf3, + 0x2e,0x64,0xc8,0x2e,0x1a,0x69,0x9e,0x77,0x9e,0xc7,0xac,0x33,0x73,0x6e,0xe4,0x1c, + 0xe9,0xba,0x74,0xee,0xd9,0x77,0xf,0x8d,0xa3,0x8d,0x1c,0xee,0x3a,0xcc,0x9e,0xc6, + 0x3d,0x0,0x9c,0x1d,0x3e,0xcb,0xf3,0x75,0xcf,0xcf,0xdb,0xef,0xec,0xf0,0x59,0xb2, + 0x52,0xb3,0xe8,0x76,0x77,0x73,0xbc,0xf7,0x38,0x7,0xdb,0xf,0x12,0x8c,0x6,0x79, + 0xe0,0xf0,0x3,0x1c,0xe9,0x3e,0x82,0x3d,0xc3,0x4e,0xfb,0x44,0x3b,0xf,0x1e,0x79, + 0x10,0x80,0xba,0xc1,0x3a,0x7e,0x74,0xe8,0x47,0xbc,0xd3,0xf1,0xe,0xaf,0x36,0xbc, + 0x4a,0xe3,0x48,0x23,0xcf,0x9c,0x78,0x6,0xab,0xc1,0xca,0x9b,0x2d,0x6f,0x12,0x89, + 0x47,0x78,0xf9,0xdc,0xcb,0x1c,0xe9,0x4a,0xee,0xfb,0xc2,0xa9,0x17,0x68,0x1b,0x6f, + 0x63,0x74,0x7a,0x94,0x60,0x34,0x88,0x2f,0xec,0x63,0x2a,0x30,0xc5,0xdb,0x6d,0x6f, + 0x73,0xb0,0xfd,0x20,0x32,0x64,0xe8,0xd5,0x7a,0x9e,0x38,0xfe,0x4,0xad,0xe3,0xad, + 0xc8,0x64,0x32,0x26,0xfd,0x93,0x3c,0x74,0xf4,0x21,0xe6,0xc2,0x73,0xf8,0x23,0x7e, + 0x9e,0x38,0xfe,0x4,0xb5,0xbd,0xb5,0xf8,0x22,0x3e,0xde,0x3a,0xff,0x16,0x87,0x3a, + 0xe,0x11,0x88,0x4,0xf8,0x41,0xcd,0xf,0xe8,0xf3,0xf4,0x51,0x6c,0x29,0xe6,0xee, + 0x7d,0x77,0xd3,0x3e,0xd1,0x8e,0x51,0x6b,0xe4,0xe9,0x13,0x4f,0x63,0x35,0x58,0xd9, + 0xd7,0xb2,0x8f,0x68,0x3c,0x4a,0x6d,0x6f,0x2d,0x3a,0x95,0xe,0xad,0x4a,0x4b,0xcb, + 0x58,0xb,0xa9,0x9a,0x54,0xe,0x77,0x1d,0xe6,0xf5,0xa6,0xd7,0xb1,0x9b,0x93,0x6d, + 0x3c,0xd0,0x7a,0x80,0x4,0x9,0x1e,0xab,0x7d,0x8c,0xfa,0xa1,0x7a,0xfa,0x3d,0xfd, + 0x34,0x8e,0x36,0xf2,0xfb,0xd3,0xbf,0x7,0x92,0x69,0x82,0x61,0xef,0x30,0x1f,0xab, + 0xfc,0x18,0xd9,0xc6,0x6c,0xde,0xe9,0x78,0x87,0x7,0xe,0x3f,0x40,0x4d,0x5b,0xd, + 0x7b,0x1a,0xf6,0x10,0x8c,0x6,0x39,0xd4,0x71,0x88,0xbd,0x2d,0x7b,0x91,0xcb,0xe4, + 0x4,0x22,0x1,0x1e,0x39,0xf6,0x8,0xc3,0xd3,0xc3,0x28,0xe5,0x4a,0x1e,0xaf,0x7d, + 0x9c,0x93,0x3,0x27,0xe9,0x9f,0xea,0xe7,0xdc,0xf0,0x39,0x9e,0x3d,0xf1,0x2c,0x3, + 0x53,0x3,0x4,0xa3,0x41,0xbe,0x77,0xe0,0x7b,0x4,0x23,0xc1,0x79,0xf7,0x25,0x21, + 0x24,0x68,0x1b,0x6f,0xa3,0x6d,0xbc,0xd,0xe7,0xac,0x93,0x9d,0x95,0x3b,0xc5,0x4e, + 0x2f,0x9e,0x88,0xf3,0xd2,0xd9,0x97,0x78,0xfa,0xc4,0xd3,0x14,0x9a,0xb,0x91,0xcb, + 0xe4,0xfc,0xf1,0xcc,0x1f,0x99,0xf4,0x4f,0x52,0xd3,0x56,0xc3,0x83,0x47,0x1e,0xe4, + 0x40,0xeb,0x1,0x5e,0x6b,0x7c,0x8d,0x91,0xe9,0x11,0xda,0xc6,0xdb,0xa8,0x2e,0xac, + 0x6,0xe0,0xcf,0x9d,0x7f,0x66,0x74,0x66,0x94,0xa6,0xd1,0x26,0x46,0x67,0x46,0xe9, + 0xf3,0xf4,0xf1,0xd4,0xfb,0x4f,0xf1,0xf2,0xb9,0x97,0xd9,0xd3,0xb0,0x87,0xa3,0xdd, + 0x47,0xd1,0x28,0x34,0xfc,0xfc,0xf0,0xcf,0x19,0xf2,0xe,0x1,0xd0,0xe9,0xea,0xe4, + 0xa9,0x13,0x4f,0x11,0x8e,0x85,0x69,0x1a,0x6d,0xc2,0x62,0xb0,0xd0,0xe1,0xea,0x0, + 0xe0,0xe9,0x13,0x4f,0xd3,0xea,0x6c,0x25,0x18,0xd,0xf2,0xe4,0xf1,0x27,0x19,0x9b, + 0x19,0x23,0x3d,0x25,0x9d,0x6f,0xbf,0xf1,0x6d,0x9c,0x33,0x4e,0xf1,0x7c,0xe,0xb4, + 0x1d,0xa0,0x34,0xb3,0x94,0x5c,0x53,0xee,0xbc,0xf3,0xb4,0x1a,0xac,0xa4,0x69,0xd3, + 0xd0,0xab,0xf5,0xd4,0xb4,0xd5,0xf0,0x76,0xdb,0xdb,0x9c,0xec,0x3f,0x49,0x24,0x1e, + 0xe1,0x67,0xef,0xfe,0x8c,0x86,0x91,0x6,0x34,0xa,0xd,0xbf,0x3c,0xfa,0x4b,0x1a, + 0x46,0x1a,0x0,0x68,0x1a,0x6b,0xc2,0x6a,0xb0,0x72,0x76,0xf8,0x2c,0xe9,0xba,0x74, + 0x7e,0x50,0xf3,0x3,0xce,0x3b,0xcf,0x13,0x4f,0xc4,0xc5,0xbe,0xa1,0x6f,0xb2,0x8f, + 0x2e,0x57,0x17,0xf5,0x43,0xf5,0xe2,0xc,0xf7,0xbf,0x22,0x14,0xd,0x71,0x6a,0xf0, + 0x14,0x6b,0xb,0xd7,0x92,0x96,0x92,0x26,0xce,0x34,0x82,0xd1,0x20,0x2d,0xce,0x16, + 0xae,0x28,0xb8,0x2,0x48,0xa6,0x93,0xc7,0x66,0xc6,0x58,0x91,0xbf,0x62,0xde,0xfe, + 0x2,0x2,0xad,0xce,0x56,0xac,0x6,0x2b,0xcd,0x63,0xcd,0xbc,0x70,0xea,0x5,0x64, + 0xc8,0xb8,0x75,0xed,0xad,0xc8,0x64,0x32,0x8c,0x5a,0x23,0xaf,0x37,0xbe,0x8e,0x42, + 0xa1,0xc0,0x39,0xeb,0xe4,0xce,0xbd,0x77,0x92,0x10,0x12,0x98,0x52,0x4c,0xfc,0xcb, + 0x6b,0xff,0x82,0x3f,0xe2,0x27,0x55,0x9b,0x4a,0xb3,0xb3,0x99,0x3c,0x53,0x5e,0xb2, + 0x53,0xf7,0xb9,0x79,0xe8,0xc8,0x43,0x4,0xa2,0x1,0x4c,0x29,0x26,0x66,0x82,0x33, + 0x2c,0xcb,0x5b,0x46,0x79,0x56,0x39,0xfd,0x9e,0x7e,0xde,0xef,0x7f,0x1f,0x97,0xcf, + 0x45,0xd3,0x58,0xd3,0xbc,0xb6,0xcc,0x86,0x66,0xe9,0x71,0xf7,0x60,0xd6,0x99,0xa9, + 0x1f,0xaa,0xe7,0xe1,0x63,0xf,0xb3,0xa5,0x74,0xb,0x5b,0x4a,0xb7,0x88,0xbf,0x2f, + 0xd7,0x9c,0xb,0x9d,0x5a,0xc7,0x1d,0x6f,0xdc,0x81,0xdb,0xef,0xe6,0xc9,0xf7,0x9f, + 0x24,0x5d,0x97,0xce,0xa1,0x8e,0x43,0x84,0x62,0x21,0xb1,0xef,0xc8,0x4d,0xcb,0xe5, + 0xed,0xb6,0xb7,0xf9,0x7d,0xfd,0xef,0x69,0x1a,0x6d,0xe2,0xc1,0xc3,0xf,0xb2,0xff, + 0xfc,0x7e,0x5e,0x6d,0x78,0x95,0x96,0xb1,0x16,0xc6,0x67,0xc7,0x79,0xf1,0xcc,0x8b, + 0x44,0xe3,0x51,0xde,0xe9,0x7c,0x87,0xdf,0x9e,0xfa,0x2d,0x63,0x33,0x63,0x3c,0xfc, + 0x97,0x87,0xd1,0xab,0xf5,0x34,0x8f,0x36,0xf3,0xe0,0xe1,0x7,0x89,0xc4,0x23,0x3c, + 0x5a,0xfb,0x28,0x7,0xda,0xe,0x50,0x6c,0x29,0x46,0x21,0x57,0x90,0x6b,0xca,0x25, + 0x45,0x7d,0xf1,0x9a,0xd0,0x45,0x41,0xc3,0xe3,0xf7,0x30,0x15,0x98,0xa2,0x22,0xab, + 0xe2,0xa2,0x8d,0xa7,0x83,0xd3,0x3c,0x78,0xf8,0x41,0xae,0x28,0xbc,0x82,0xab,0x1c, + 0x57,0x51,0x99,0x55,0xc9,0xe0,0xd4,0x20,0xfd,0x9e,0x7e,0x34,0x4a,0xd,0x63,0x33, + 0x63,0x44,0xe2,0x11,0xb6,0x94,0x6e,0xa1,0xba,0xb0,0x9a,0x58,0x22,0x46,0x24,0x1e, + 0x61,0x71,0xce,0x62,0x1c,0x16,0x7,0xde,0x80,0x97,0x49,0xff,0x24,0x0,0xb7,0x6f, + 0xbc,0x9d,0x9c,0xb4,0x1c,0x52,0x54,0x29,0xdc,0x76,0xe5,0x6d,0xbc,0xf4,0xf9,0x97, + 0x50,0x2b,0xd4,0x58,0xf4,0x16,0xc,0x6a,0x3,0xae,0x39,0x17,0x47,0xba,0x8e,0x70, + 0x4d,0xe5,0x35,0x14,0x66,0x14,0xe2,0x8f,0xf8,0x59,0xbe,0x60,0x39,0x3a,0xb5,0x8e, + 0xf6,0x89,0x76,0x66,0x42,0x33,0x6c,0x70,0x6c,0x40,0x21,0x57,0x60,0xd1,0x5b,0xd0, + 0xa9,0x75,0xa4,0x6a,0x53,0x19,0xf2,0xe,0xb1,0xb1,0x78,0x23,0xc5,0x96,0x62,0x71, + 0x74,0x3,0xa0,0x57,0xeb,0x99,0xe,0x4e,0xf3,0xd4,0xfb,0x4f,0x91,0x9b,0x96,0xcb, + 0x37,0x37,0x7e,0x13,0x80,0xa3,0x3d,0x47,0x59,0x5f,0xbc,0x1e,0x19,0x32,0xc2,0xb1, + 0x30,0x3,0x53,0x3,0xd8,0xcd,0x76,0x4e,0xf4,0x9f,0x20,0x2b,0x35,0x8b,0xc2,0x8c, + 0x42,0x20,0xf9,0x43,0xcd,0x35,0xe5,0x32,0xe9,0x9f,0xa4,0xd3,0xd5,0x49,0x69,0x66, + 0x29,0x77,0x6f,0xb9,0x9b,0xa9,0xc0,0x14,0xcf,0xd5,0x3d,0x37,0xef,0x3a,0xf9,0xc2, + 0x3e,0x3a,0x5d,0x9d,0xc4,0x12,0x31,0x36,0x97,0x6e,0x66,0x55,0xfe,0x2a,0x82,0xd1, + 0x20,0x56,0x83,0x95,0x35,0xf6,0x35,0xcc,0x4,0x92,0xf,0x7c,0xaf,0xa7,0x97,0xcf, + 0xae,0xfc,0xac,0xb8,0x5f,0x2c,0x11,0xa3,0xd3,0xd5,0xc9,0x6c,0x68,0x96,0x3,0xad, + 0x7,0x78,0xa5,0xe1,0x15,0x74,0x6a,0x1d,0xef,0xf7,0xbf,0xcf,0xde,0xe6,0xbd,0xdc, + 0xba,0xf6,0x56,0xca,0xb3,0xca,0xb1,0x19,0x6d,0x1c,0xeb,0x39,0x6,0x40,0x75,0x41, + 0x35,0x82,0x20,0xb0,0x32,0x7f,0x25,0x4f,0xdd,0xf4,0x14,0x37,0x2e,0xbb,0x91,0x2e, + 0x57,0x17,0xa,0xb9,0x82,0xbb,0xb6,0xdc,0x85,0xdb,0xe7,0xe6,0x77,0xa7,0x7f,0xc7, + 0xce,0x85,0x3b,0xa9,0xc8,0xaa,0xe0,0xfe,0x1d,0xf7,0xb3,0x30,0x7b,0x21,0x83,0xde, + 0x41,0xe2,0x89,0x38,0x4a,0xb9,0x92,0x85,0xb6,0x85,0x4,0x22,0x1,0xa,0xcd,0x85, + 0xe2,0xf,0x34,0x14,0xd,0xb1,0xba,0x60,0x35,0x0,0x35,0x6d,0x35,0x98,0x75,0x66, + 0x16,0x98,0x16,0xe0,0xf1,0x7b,0x8,0xc5,0x42,0xe4,0x99,0xf2,0xa8,0xcc,0xaa,0x24, + 0x1c,0xb,0x53,0x6c,0x29,0x66,0x36,0x34,0x4b,0x4d,0x5b,0xd,0xdb,0xca,0xb7,0x61, + 0xcf,0xb0,0x13,0x8c,0x6,0x59,0x9a,0xbb,0x14,0xbd,0x5a,0x4f,0xb7,0xab,0x1b,0x99, + 0x4c,0xc6,0x5d,0x5b,0xef,0x42,0xa5,0x50,0x71,0x75,0xd9,0xd5,0xec,0x5c,0xb8,0x93, + 0x58,0x22,0xc6,0x9d,0x5b,0xee,0xc4,0x94,0x62,0xe2,0x89,0xe3,0x4f,0xb0,0xad,0x7c, + 0x1b,0xd3,0xa1,0x69,0xf1,0x3b,0xa3,0xb1,0x28,0x33,0xc1,0x19,0xc,0x1a,0x3,0xd5, + 0x85,0xd5,0x4,0xa3,0x41,0x8a,0x2c,0x45,0xf3,0xae,0xf3,0x35,0xe5,0xd7,0xb0,0x30, + 0x7b,0x21,0xcb,0x72,0x97,0x21,0x97,0xc9,0xd9,0x51,0xb9,0x83,0x97,0xbf,0xf0,0x32, + 0xab,0xf2,0x57,0xd1,0xe7,0xe9,0xe3,0x2a,0x47,0x32,0xdd,0xd0,0xe5,0xee,0x12,0x3b, + 0x17,0x99,0x2c,0x39,0x8b,0xd5,0xa9,0x75,0x6c,0x2e,0xd9,0x4c,0x20,0x1a,0x40,0xaf, + 0xd1,0x53,0x6c,0x29,0xc6,0x6a,0xb0,0xa2,0x55,0x69,0x2f,0x4a,0x51,0xb8,0xe6,0x5c, + 0xe2,0xe8,0xad,0x6e,0xa0,0x6e,0xde,0x3a,0xca,0x7b,0xbd,0xef,0xf1,0xd2,0xb9,0x97, + 0xf8,0xfa,0xfa,0xaf,0x53,0x99,0x5d,0x49,0xd3,0x58,0x13,0x4b,0xf3,0x96,0x62,0xcf, + 0xb0,0x53,0x91,0x55,0x81,0x42,0xae,0xe0,0xc6,0xa5,0x37,0xf2,0xf2,0x17,0x5e,0xc6, + 0x94,0x62,0x62,0xc0,0x33,0xc0,0xb2,0xdc,0x65,0x0,0xb8,0x7d,0x6e,0x5a,0x9d,0xad, + 0x7c,0x6b,0xd3,0xb7,0x28,0xca,0x28,0x62,0x79,0xde,0x72,0xb4,0x4a,0x2d,0x56,0x83, + 0x95,0x1f,0xef,0xfa,0x31,0xf,0x5d,0xfb,0x10,0x9e,0x80,0x7,0x53,0x8a,0x89,0xf2, + 0xac,0x72,0x0,0xf6,0xb6,0xec,0xa5,0xd4,0x5a,0x8a,0x41,0x6d,0xa0,0x69,0xb4,0x9, + 0xa5,0x5c,0x49,0x91,0xa5,0x8,0xab,0xc1,0x8a,0x5c,0x26,0x27,0x2b,0x35,0x8b,0x23, + 0x5d,0x47,0x38,0x39,0x70,0x92,0x1d,0x95,0x3b,0xe8,0x72,0x77,0x51,0x68,0x2e,0xc4, + 0xa0,0x31,0x88,0x6d,0xee,0x98,0xe8,0x20,0x3b,0x35,0x5b,0x5c,0xcc,0x1d,0xf4,0xe, + 0xf2,0x66,0xcb,0x9b,0xbc,0xd9,0xf2,0x26,0xe3,0x73,0xe3,0x68,0x94,0x1a,0xfa,0x3d, + 0xfd,0xc4,0x13,0x71,0xb6,0x95,0x6f,0x43,0xad,0x50,0xa3,0x52,0xa8,0xc8,0x49,0xcb, + 0xc1,0x9e,0x61,0x47,0xa9,0x50,0xa2,0x51,0x6a,0x8,0x44,0x2,0xb4,0x8f,0xb7,0x93, + 0x10,0x12,0x6c,0x28,0xde,0xc0,0xca,0x5,0x2b,0x89,0xc6,0xa3,0x44,0x62,0x11,0x5c, + 0x3e,0x17,0x2e,0x9f,0xb,0x6f,0xc0,0xcb,0x81,0xb6,0x3,0x1c,0x68,0x3b,0xc0,0xab, + 0xd,0xaf,0x32,0x15,0x98,0xc2,0x61,0x75,0xcc,0xbb,0xbe,0x81,0x48,0x80,0x49,0xff, + 0x24,0x1e,0xbf,0x87,0x48,0x2c,0xc2,0xff,0xef,0x48,0xf7,0x11,0xfa,0x3c,0x7d,0xec, + 0x6f,0xdd,0xcf,0x54,0x60,0x8a,0x89,0xb9,0x9,0xf1,0x19,0xe8,0x72,0x75,0xb1,0x2c, + 0x6f,0x99,0x78,0x1e,0xfe,0x88,0x9f,0xca,0xac,0xf9,0x41,0x49,0x10,0x4,0xce,0xd, + 0x9f,0x3,0x1,0x5e,0x3e,0xf7,0x32,0x35,0x6d,0x35,0x7c,0x7b,0xd3,0xb7,0xc9,0x4d, + 0xcb,0x45,0x2e,0x93,0x13,0x89,0x47,0xc8,0x4d,0xcb,0x45,0xa7,0xd2,0xd1,0x3b,0xd9, + 0xcb,0xa9,0xc1,0x53,0xec,0xae,0xda,0x4d,0x6e,0x5a,0x2e,0x81,0x48,0x80,0xd5,0xf9, + 0xab,0x51,0x2b,0xd4,0xf4,0xb8,0x7b,0xf0,0x6,0xbc,0x6c,0x2e,0xd9,0x4c,0x42,0x48, + 0x60,0x4b,0xb3,0xa1,0x52,0xa8,0xc4,0xfb,0xba,0xb9,0x64,0x33,0xc5,0x96,0x62,0x42, + 0xb1,0x10,0xf5,0x83,0xf5,0x7c,0x6a,0xd9,0xa7,0xc4,0x99,0xc1,0x5,0x6e,0x9f,0x9b, + 0x41,0xef,0x20,0x1e,0xbf,0x87,0xdf,0x9e,0xfa,0x2d,0xc3,0xde,0x61,0x6e,0xdf,0x70, + 0x3b,0x46,0xad,0x91,0x83,0xed,0x7,0xc5,0x41,0x7b,0xa7,0xab,0x93,0xe2,0x8c,0x62, + 0xd4,0xa,0x35,0x23,0xd3,0x23,0x4c,0xfa,0x27,0xb9,0x77,0xfb,0xbd,0x84,0xa3,0x61, + 0x1e,0x39,0xf6,0x88,0xf8,0xbd,0x13,0x73,0x13,0x2c,0xcc,0x5e,0x98,0xc,0x9c,0x32, + 0xa8,0xc8,0xae,0xe0,0xd1,0xeb,0x1f,0xe5,0x8e,0x4d,0x77,0x30,0x3e,0x37,0x4e,0xa1, + 0xb9,0x10,0xbd,0x5a,0xcf,0x6c,0x68,0x16,0x87,0xd5,0xc1,0xcf,0xf,0xff,0x9c,0x25, + 0x39,0x4b,0x58,0x60,0x5a,0x90,0x9c,0xc9,0xe7,0x2c,0x62,0x5f,0xcb,0x3e,0xea,0x6, + 0xea,0xb8,0x75,0xed,0xad,0x94,0x66,0x96,0x72,0xde,0x79,0x9e,0x15,0x79,0x2b,0x2e, + 0x9a,0xad,0xc1,0x25,0x82,0x86,0x42,0xae,0x40,0x29,0x57,0x8a,0xd3,0xd8,0xb,0x66, + 0x43,0xb3,0x74,0x4c,0x74,0xd0,0x33,0xd9,0xc3,0xce,0xca,0x9d,0x28,0xe4,0xa,0xfa, + 0x3c,0x7d,0x8,0x82,0x80,0x59,0x6f,0x66,0x64,0x7a,0x4,0x8f,0xdf,0xc3,0x35,0x15, + 0xd7,0x60,0xd2,0x99,0x68,0x1b,0x6f,0xc3,0xaa,0xb7,0x92,0x9f,0x9e,0xf,0x40,0x76, + 0x5a,0x36,0xbe,0xb0,0x8f,0xba,0x81,0x3a,0x76,0x2e,0xdc,0x89,0x5e,0xad,0xe7,0xf4, + 0xe0,0x69,0xb6,0x94,0x6d,0x11,0x17,0xb4,0xdb,0xc7,0xdb,0xc5,0xa9,0xb2,0x49,0x67, + 0x62,0x49,0xee,0x12,0xde,0x6c,0x7e,0x93,0x7,0xfe,0xfc,0x0,0x9b,0x4a,0x36,0x61, + 0xcf,0xb0,0xd3,0xef,0xe9,0xc7,0x1f,0xf6,0xb3,0xb9,0x64,0x33,0x5a,0xa5,0x96,0xda, + 0xde,0xda,0xe4,0x3a,0x80,0xc6,0x48,0x2c,0x11,0xa3,0xd5,0xd9,0xca,0x42,0xdb,0xc2, + 0x79,0x6d,0xbf,0x30,0xe2,0x79,0xf1,0xcc,0x8b,0x5c,0x55,0x72,0x15,0xf7,0x5c,0x7d, + 0x8f,0x58,0xe5,0x31,0x3a,0x33,0x8a,0xc3,0xe2,0x10,0x1f,0xc0,0xf3,0xce,0xf3,0x6c, + 0x74,0x6c,0x64,0x64,0x7a,0x44,0x1c,0x75,0x25,0x84,0x4,0x27,0xfb,0x4f,0x26,0x3b, + 0x68,0x4,0xc2,0xb1,0x30,0xd7,0x54,0x5e,0x83,0x29,0xc5,0x44,0x49,0x66,0x9,0x3, + 0x53,0x3,0xf3,0x8e,0xd7,0xef,0xe9,0x27,0x14,0xd,0xb1,0x6b,0xe1,0x2e,0x74,0x2a, + 0x1d,0xa7,0x6,0x4f,0x51,0x9a,0x59,0x4a,0x9e,0x29,0xf,0xab,0xc1,0x4a,0x20,0x1a, + 0x60,0x64,0x7a,0x84,0x60,0x34,0xc8,0xf6,0x8a,0xed,0xf3,0xf6,0x53,0xc8,0x15,0x7c, + 0x6d,0xdd,0xd7,0xf8,0xd6,0xa6,0x6f,0x71,0xef,0xf6,0x7b,0xa9,0x2e,0xa8,0x66,0xff, + 0xf9,0xfd,0xac,0xb3,0xaf,0xc3,0xa2,0xb7,0x88,0xa9,0xa6,0xb,0xf9,0xf0,0x21,0xef, + 0x10,0x71,0x21,0xce,0xca,0x5,0x2b,0x1,0x48,0x51,0xa5,0x70,0xed,0xe2,0x6b,0xf9, + 0xe9,0xbb,0x3f,0x25,0x1c,0xb,0x53,0xd3,0x56,0x83,0xcd,0x68,0x23,0xcf,0x94,0x7, + 0x80,0xc3,0xe2,0x40,0xab,0xd2,0xd2,0x38,0xda,0x48,0x9e,0x29,0x8f,0x65,0x79,0xcb, + 0xf0,0xf8,0x3d,0x8c,0xcf,0x8d,0xb3,0x24,0x77,0x9,0x90,0x9c,0x25,0x19,0x34,0x6, + 0x1c,0x16,0x7,0xce,0x59,0x27,0xaf,0x36,0xbc,0x4a,0x75,0x61,0x35,0x6a,0x85,0x9a, + 0x73,0xc3,0xe7,0x28,0xcd,0x2c,0x65,0x55,0xfe,0x2a,0x6,0xbc,0x3,0xb8,0x7d,0x6e, + 0xaa,0xb,0xab,0xd1,0xa9,0x75,0xac,0xcc,0x5f,0xc9,0x81,0xd6,0x3,0x3c,0x78,0xf8, + 0x41,0x56,0xe4,0xad,0xa0,0x32,0xbb,0x12,0xad,0x4a,0xcb,0xf5,0x4b,0xaf,0xe7,0x67, + 0xef,0xfe,0x4c,0x1c,0xbd,0xa7,0xa8,0x53,0xd8,0xdb,0xb2,0x97,0x6d,0xe5,0xdb,0xc8, + 0x4e,0xcd,0xe6,0xad,0xf3,0x6f,0xe1,0xb,0xf9,0x68,0x18,0x69,0xe0,0xec,0xf0,0x59, + 0x1e,0xb9,0xfe,0x11,0xaa,0xb,0xab,0x69,0x71,0xb6,0x90,0xaa,0x4d,0x65,0x4b,0xe9, + 0x16,0x42,0xb1,0x10,0x4d,0xa3,0x4d,0x6c,0x70,0x6c,0x10,0xaf,0x95,0x4e,0xad,0x23, + 0xc3,0x90,0x41,0x42,0x48,0x70,0x7a,0xe8,0x34,0x55,0xb6,0x2a,0xf2,0xcd,0xc9,0xe7, + 0xcd,0x1b,0xf0,0x32,0xe0,0x19,0x60,0x65,0xfe,0x4a,0x12,0x42,0x82,0x3d,0x8d,0x7b, + 0xb0,0x19,0x6d,0xa4,0xeb,0xd2,0x39,0x37,0x9c,0x4c,0x5f,0x6d,0x72,0x6c,0x22,0x9e, + 0x88,0xd3,0x32,0xd6,0xc2,0x8e,0x8a,0x1d,0xa4,0xa8,0x52,0x68,0x9f,0x68,0xa7,0x34, + 0xb3,0xf4,0xa2,0xe2,0x80,0xd6,0xf1,0x56,0x52,0xb5,0xa9,0xfc,0x70,0xe7,0xf,0xa9, + 0x1f,0xaa,0xa7,0xb6,0xb7,0x16,0x80,0x99,0xd0,0xc,0xcf,0x9e,0x7c,0x96,0xeb,0x16, + 0x5f,0x47,0xa1,0xb9,0x90,0x56,0x67,0x2b,0xef,0x74,0xbc,0xc3,0xaa,0xfc,0x55,0xc8, + 0x90,0x25,0x67,0xb5,0xf6,0x75,0x64,0x1b,0xb3,0xc5,0x76,0x9b,0x75,0x66,0xb1,0x22, + 0x65,0x6b,0xd9,0x56,0x3a,0x5d,0x9d,0x1c,0xea,0x38,0x84,0x5c,0x26,0x27,0x14,0xb, + 0xd1,0x3e,0xd1,0x2e,0xae,0x63,0x5d,0x78,0xf6,0x1c,0x16,0x7,0x36,0xa3,0x8d,0xe, + 0x57,0x7,0x47,0xbb,0x8e,0xb2,0xba,0x60,0x35,0x81,0x68,0x80,0x4e,0x57,0x27,0xab, + 0xf2,0x57,0x51,0x90,0x5e,0x40,0xf3,0x58,0x33,0xa6,0x14,0x13,0xf6,0xc,0x3b,0xaf, + 0x37,0xbd,0x4e,0x86,0x3e,0x83,0xe7,0xeb,0x9e,0x47,0xab,0xd4,0xf2,0xdc,0x2d,0xcf, + 0x61,0xd6,0x9b,0xc5,0xf3,0x49,0x51,0xa5,0x10,0x4f,0xc4,0xc5,0xe0,0x67,0x33,0xda, + 0xe8,0xf7,0x24,0x67,0x5d,0x19,0xba,0xc,0xfa,0x3c,0x7d,0xcc,0x85,0xe7,0xb8,0x6e, + 0xc9,0x75,0xa8,0x15,0x6a,0x8e,0xf5,0x1c,0x63,0x73,0xe9,0x66,0xa,0xd2,0xb,0x92, + 0xd7,0x5e,0xa5,0x23,0x27,0x2d,0x87,0xe1,0xe9,0x61,0xbc,0x1,0x2f,0xbb,0xab,0x76, + 0x63,0xd4,0x1a,0xc5,0xd4,0x60,0x91,0xa5,0x48,0x5c,0xe7,0xbb,0x7b,0xeb,0xdd,0xdc, + 0x71,0xd5,0x1d,0xdc,0x71,0xd5,0x1d,0xac,0xb5,0xaf,0xa5,0x3c,0xb3,0xfc,0xa2,0x99, + 0xf9,0x9f,0x9a,0xff,0xc4,0xbf,0xbe,0xf5,0xaf,0xdc,0x7f,0xf0,0x7e,0x71,0x91,0xfb, + 0x82,0xb9,0xf0,0x1c,0xbd,0xee,0x5e,0xbe,0xbe,0xfe,0xeb,0x6c,0xaf,0xd8,0xce,0x86, + 0xe2,0xd,0xe2,0x9a,0xe5,0x90,0x77,0x8,0xbd,0x46,0x2f,0xfe,0x9e,0xdb,0x9c,0x6d, + 0x38,0xac,0xe,0xd4,0xca,0xf9,0xfd,0x57,0x24,0x16,0x61,0x68,0x7a,0x88,0xaf,0xac, + 0xfd,0xa,0xf7,0xef,0xb8,0x9f,0x40,0x34,0xc0,0x99,0xe1,0x33,0x40,0x32,0xa0,0x34, + 0x8c,0x34,0x88,0xcf,0x4e,0x4e,0x5a,0xe,0xa5,0xd6,0x52,0x5e,0x69,0x78,0x85,0xc7, + 0x6a,0x1f,0x63,0xd7,0xc2,0x5d,0x58,0xc,0x16,0x3a,0x5d,0x9d,0x0,0x6c,0x2a,0xd9, + 0x84,0x5c,0x26,0xe7,0x44,0xff,0x9,0xaa,0xb,0xaa,0xd1,0x28,0x35,0x44,0xe3,0x51, + 0x7a,0x26,0x7b,0x28,0xc9,0x2c,0x1,0x60,0x61,0xf6,0x42,0x52,0xd4,0x29,0xfc,0xbe, + 0xfe,0xf7,0x28,0x64,0x8a,0x79,0x6d,0x71,0xce,0x3a,0x91,0x21,0xe3,0x3b,0x5b,0xbe, + 0xc3,0x77,0xb7,0x7d,0x97,0xe3,0xbd,0xc7,0x71,0xfb,0xdc,0x0,0xec,0x69,0xd8,0x83, + 0x29,0xc5,0xc4,0xf3,0x75,0xcf,0x63,0x31,0x58,0x78,0xe6,0xe6,0x67,0x30,0xeb,0xcd, + 0x7c,0xb9,0xfa,0xcb,0x3c,0x5e,0xfb,0x38,0xbd,0x93,0xbd,0x9c,0x1e,0x3a,0x4d,0xbf, + 0xa7,0x9f,0xc1,0xa9,0x41,0x8e,0x76,0x1f,0xe5,0x27,0xbb,0x7e,0xc2,0xb6,0xf2,0x6d, + 0xb8,0x7c,0x2e,0xa6,0x3,0xd3,0xac,0x29,0x5c,0x3,0x24,0x7,0xa1,0x8d,0xa3,0x8d, + 0x2c,0xb2,0x2d,0xc2,0x17,0xf6,0xe1,0xb,0xfb,0x58,0x9a,0xbb,0x94,0xf7,0x7a,0xdf, + 0x23,0x1c,0xf,0xb3,0xa7,0x71,0xf,0xdf,0xd8,0xf0,0xd,0x76,0x57,0xed,0xe6,0x85, + 0x53,0x2f,0xf0,0xb9,0x55,0x9f,0xc3,0x62,0xb0,0xd0,0x3a,0xde,0xca,0x89,0xfe,0x13, + 0x2c,0xc9,0x5d,0x72,0xc9,0x14,0xe2,0x45,0xff,0x93,0x9b,0x96,0x4b,0x9e,0x29,0x8f, + 0x4e,0x77,0xa7,0xf8,0x7f,0x33,0xa1,0x19,0xe,0x75,0x1c,0xc2,0x17,0xf6,0x11,0x4f, + 0xc4,0x29,0x34,0x17,0x92,0x10,0x12,0x1c,0xea,0x38,0x44,0x91,0xa5,0x88,0xca,0xec, + 0x4a,0x86,0xa6,0x86,0x50,0x2b,0xd5,0xac,0xb5,0xaf,0x25,0x16,0x8f,0xf1,0x5a,0xd3, + 0x6b,0x6c,0x29,0xdb,0x22,0x6,0xd,0x8b,0xde,0x82,0x73,0xc6,0x49,0xa7,0xab,0x93, + 0xab,0x1c,0x57,0x31,0x3c,0x3d,0x8c,0xc7,0xef,0x61,0x75,0xfe,0x6a,0x71,0x71,0xbd, + 0x6e,0xb0,0xe,0x7b,0x86,0x9d,0x91,0xe9,0x11,0x14,0x32,0x5,0xa6,0x14,0x53,0x32, + 0xe7,0xbd,0x60,0x25,0xf,0x7c,0xfc,0x1,0x31,0x6d,0x63,0x35,0x58,0x59,0x9e,0xb7, + 0x1c,0x8f,0xdf,0x43,0xdf,0x64,0x1f,0xc5,0xd6,0xe4,0xe2,0xdd,0xc0,0xd4,0x0,0x71, + 0x21,0x8e,0xcd,0x68,0x9b,0xf7,0xe0,0xd5,0xd,0xd4,0x71,0xb4,0xfb,0x28,0x9f,0x5d, + 0xf5,0x59,0x56,0x2e,0x58,0x49,0x38,0x1a,0x16,0x47,0x33,0xa9,0xea,0x54,0x31,0x9a, + 0x9e,0x1d,0x3e,0x4b,0x8e,0x31,0x87,0x2a,0x5b,0x15,0x5a,0x95,0x16,0xbd,0x5a,0x8f, + 0x4c,0x26,0x63,0xc8,0x3b,0xc4,0xe0,0xd4,0x20,0x3b,0x17,0xee,0x24,0x45,0x99,0x82, + 0x41,0x6d,0x40,0x25,0x57,0x11,0x89,0x47,0x18,0xf1,0x8e,0xb0,0xc8,0xb6,0x68,0xde, + 0x35,0xec,0x9f,0xea,0x47,0xaf,0xd6,0x53,0x9e,0x55,0x4e,0x28,0x1a,0x62,0x5f,0xcb, + 0x3e,0x6e,0x5c,0x7a,0xa3,0xb8,0xde,0x10,0x88,0x4,0xd8,0xdb,0xb2,0x97,0x1b,0x97, + 0xde,0x38,0xaf,0x24,0xb0,0xcb,0xd5,0x45,0x8a,0x2a,0x85,0x5,0xe9,0xc9,0x80,0x90, + 0x6d,0xcc,0x26,0x27,0x2d,0x7,0x8f,0xdf,0x43,0x61,0x46,0x21,0x4a,0x85,0x92,0x50, + 0x34,0xc4,0xbb,0x9d,0xef,0xf2,0xc9,0xc5,0x9f,0x4,0x92,0x6b,0x27,0xab,0xf2,0x57, + 0xa1,0x56,0xaa,0xc5,0xa0,0xb9,0xbd,0x7c,0x3b,0x46,0xad,0x11,0x97,0xcf,0xc5,0xc8, + 0xf4,0x88,0x58,0x8a,0x18,0x8d,0x47,0x39,0x37,0x72,0xe,0x80,0x96,0xb1,0x16,0x76, + 0x2d,0xdc,0x85,0x42,0xae,0xa0,0xd5,0xd9,0x8a,0xc3,0xe2,0xc0,0xe5,0x73,0x25,0x4b, + 0x18,0x87,0x92,0x39,0x61,0x99,0x4c,0xc6,0xb1,0xee,0x63,0x8c,0xcf,0x8d,0xb3,0x28, + 0x67,0x11,0x83,0x53,0x83,0x34,0x8e,0x36,0x72,0xc3,0x92,0x1b,0x50,0x29,0x54,0x34, + 0x8d,0x36,0xb1,0xd0,0xb6,0x10,0xe7,0xac,0x93,0x48,0x3c,0x82,0x29,0xc5,0x84,0x42, + 0xae,0xa0,0x2a,0xa7,0x8a,0x7,0x3e,0xf1,0x0,0x36,0xa3,0x8d,0xf3,0xce,0xf3,0x6c, + 0x2e,0xd9,0x4c,0x86,0x3e,0x83,0xf1,0xb9,0x71,0xe2,0x89,0x38,0xbf,0xae,0xfd,0x35, + 0x45,0x19,0x45,0xe4,0xa6,0xe5,0x32,0x3a,0x33,0x4a,0x4d,0x7b,0xd,0xa9,0xda,0x54, + 0x3e,0x5e,0xf5,0x71,0x6e,0x5d,0x73,0x2b,0x73,0xa1,0x39,0x64,0x32,0x19,0xa7,0x6, + 0x4f,0x71,0xfd,0x92,0xeb,0xd1,0x28,0x35,0x74,0xb9,0xba,0x48,0xd7,0xa5,0x8b,0xeb, + 0x5,0x4d,0xa3,0x4d,0x54,0xd9,0xaa,0x18,0x9d,0x1e,0x65,0x62,0x6e,0x82,0xa6,0xd1, + 0x26,0x36,0x3a,0x36,0x8a,0xf,0x79,0xc3,0x68,0x3,0x76,0x8b,0x9d,0xc,0x7d,0x6, + 0x8d,0x23,0x8d,0x74,0x4e,0x74,0xb2,0xc6,0xbe,0x86,0xbe,0xc9,0x3e,0x4e,0xe,0x9c, + 0x64,0x6b,0xd9,0x56,0xd2,0x52,0xd2,0xe8,0x98,0xe8,0x20,0xd3,0x90,0x29,0xe,0x34, + 0x2e,0xac,0xf,0x79,0xfc,0x9e,0x79,0xf7,0xb4,0xd3,0xd5,0x49,0xa6,0x21,0x93,0x8a, + 0xec,0xa,0x76,0x2f,0xdc,0xcd,0xe3,0xb5,0x8f,0x13,0x8c,0x6,0xf1,0x6,0xbc,0xe2, + 0xb1,0x23,0xf1,0x8,0xfb,0x5b,0xf7,0x93,0x48,0x24,0xc8,0x4a,0xcd,0x62,0xd0,0x3b, + 0x48,0xeb,0x78,0x2b,0x9b,0x4a,0x36,0x89,0x33,0x97,0xb,0xb9,0xec,0xfe,0xa9,0x7e, + 0x7a,0x27,0x7b,0xd1,0x2a,0xb5,0xfc,0xd3,0x9a,0x7f,0xa2,0x6e,0xa0,0x8e,0x58,0x22, + 0xc6,0x79,0xe7,0x79,0x71,0xd1,0x1d,0x92,0x1d,0x66,0xcb,0x58,0xb,0x57,0x16,0x5f, + 0x89,0x20,0x8,0xbc,0xd3,0xfe,0xe,0xd1,0x78,0x94,0x3c,0x53,0x1e,0xbd,0x93,0xbd, + 0x38,0x67,0x9c,0xec,0x58,0xb8,0x83,0x84,0x90,0xa0,0x71,0xa4,0x91,0xc5,0x39,0x8b, + 0x19,0x9b,0x19,0x63,0x78,0x7a,0x18,0xbb,0xd9,0xce,0x97,0xaa,0xbf,0xc4,0xee,0x45, + 0xbb,0xc5,0x8e,0xea,0x82,0x35,0x85,0x6b,0xe8,0xf3,0xf4,0x31,0x15,0x48,0x56,0x5d, + 0xc9,0x65,0x72,0x7a,0x26,0x7b,0x58,0x96,0xb7,0xc,0x95,0x42,0x45,0xeb,0x78,0x2b, + 0x39,0x69,0x39,0x2c,0xcd,0x5d,0xca,0xa4,0x7f,0x92,0x9e,0xc9,0x1e,0x3e,0xb1,0xe8, + 0x13,0x28,0xe4,0xa,0x6,0xbd,0x83,0x28,0x15,0x4a,0xa2,0xf1,0x28,0xc3,0xde,0x61, + 0x64,0x32,0x19,0x8b,0x6c,0x8b,0x8,0xc7,0xc2,0xbc,0xdd,0xfa,0x36,0xbb,0x2a,0x77, + 0x91,0x9d,0x9a,0xcd,0xc0,0xd4,0x0,0x46,0xad,0x71,0x5e,0x19,0x6e,0xf3,0x58,0xf3, + 0x25,0x53,0x53,0x9f,0x59,0xf9,0x19,0x9e,0xbd,0xf9,0x59,0x1e,0xb9,0xfe,0x11,0x71, + 0x46,0x75,0xc1,0xa9,0x81,0x53,0xe4,0x9b,0xf3,0x29,0x34,0x17,0x62,0xd6,0x99,0xb1, + 0x67,0xd8,0x19,0x9b,0x1d,0x4b,0x5e,0xcf,0xe1,0x7a,0x2a,0xb2,0x2a,0x18,0x99,0x19, + 0x21,0x1a,0x8f,0x52,0x3f,0x54,0xcf,0xf2,0xbc,0xe5,0x74,0xba,0x3a,0xe7,0x55,0x60, + 0xf6,0x4e,0xf6,0x62,0x4a,0x31,0x61,0x31,0x58,0x50,0xca,0x95,0x18,0x34,0x6,0xb1, + 0x80,0x22,0x9a,0x88,0x72,0x66,0xe8,0xc,0xf9,0xa6,0x7c,0x26,0xe6,0x26,0xc4,0x99, + 0x83,0x20,0x8,0x5c,0x5d,0x76,0x35,0xf7,0xef,0xb8,0x1f,0xa3,0xd6,0x48,0xcb,0x58, + 0xb,0xe5,0x99,0xe5,0x94,0x65,0x96,0x31,0x3e,0x3b,0x8e,0xc7,0xef,0x21,0x33,0x35, + 0x93,0x40,0x24,0x40,0xb7,0xbb,0x1b,0xbd,0x46,0x8f,0x41,0x6d,0xe0,0xdc,0xf0,0x39, + 0x66,0x43,0xb3,0xdc,0xb9,0xf9,0x4e,0x4e,0xd,0x9c,0xba,0xa8,0xb2,0xae,0x63,0xa2, + 0x83,0xb2,0xac,0x32,0xe4,0x72,0x39,0x1a,0xa5,0x6,0x85,0x5c,0x21,0x56,0x7a,0x8d, + 0xcc,0x8c,0x50,0x62,0x2d,0xe1,0xcb,0xd5,0x5f,0x66,0x7b,0xf9,0x76,0x5c,0x3e,0x17, + 0x5d,0xae,0x2e,0x1c,0x56,0x7,0xeb,0x8a,0xd6,0xd1,0xe9,0xea,0x64,0xd2,0x37,0x89, + 0x42,0xae,0xe0,0x63,0x15,0x1f,0xe3,0xab,0xeb,0xbe,0x4a,0x2c,0x11,0x43,0x2e,0x97, + 0x73,0x6e,0xe4,0x1c,0xe5,0x59,0xe5,0x62,0x1,0xc0,0xc4,0xdc,0x4,0xae,0x39,0x17, + 0x15,0xd9,0x15,0x74,0x4c,0x74,0x50,0x5d,0x58,0x8d,0x56,0xa5,0x65,0x2e,0x3c,0xc7, + 0xe6,0x92,0xcd,0x7c,0x6d,0xfd,0xd7,0x30,0xa5,0x98,0x70,0xce,0x3a,0xe9,0x76,0x77, + 0xb3,0xc6,0xbe,0x86,0x50,0x34,0xc4,0x91,0xae,0x23,0x68,0x94,0x1a,0x4c,0x29,0x26, + 0x66,0x43,0xb3,0x17,0xdd,0xab,0x8b,0x16,0xc2,0xed,0x19,0x76,0xbe,0xbf,0xfd,0xfb, + 0xbc,0x70,0xea,0x5,0x76,0x54,0xec,0x40,0xad,0x54,0xf3,0x5e,0xef,0x7b,0x38,0x2c, + 0xe,0xaa,0x6c,0x55,0x54,0x17,0x56,0xf3,0x56,0xeb,0x5b,0xc4,0x13,0x71,0xea,0x7, + 0xeb,0x79,0x60,0xf7,0x3,0x98,0x75,0x66,0xda,0x27,0xda,0x81,0x64,0xc7,0xdb,0xe9, + 0xea,0xc4,0x1f,0xf1,0x73,0xff,0x8e,0xfb,0xc5,0xc5,0x44,0xb3,0xce,0xcc,0xc3,0x7f, + 0x79,0x98,0x57,0xbf,0xf8,0x2a,0x6,0x8d,0x81,0xc3,0x5d,0x87,0x91,0xcb,0xe5,0x94, + 0x66,0x96,0x8a,0xc7,0x6e,0x75,0xb6,0x92,0x95,0x9a,0x85,0x59,0x67,0x66,0x7c,0x6e, + 0x9c,0xf1,0xd9,0x71,0x8e,0x74,0x1f,0xa1,0x3c,0xb3,0x9c,0x5,0xe9,0xb,0xc4,0xe3, + 0xac,0x2f,0x5e,0x8f,0x4e,0xad,0xa3,0xdf,0xd3,0x2f,0x4e,0x67,0x5,0x41,0xa0,0xcb, + 0x95,0x5c,0x84,0x3c,0x35,0x70,0x8a,0x9b,0x96,0xdf,0x4,0x40,0xcf,0x64,0xf,0xf7, + 0xbc,0x75,0xf,0x95,0xd9,0x95,0xdc,0x7f,0xf0,0x7e,0xe2,0x89,0x38,0x7a,0x8d,0x9e, + 0xbb,0xb6,0xdc,0x85,0x5a,0xa9,0xe6,0xb,0x57,0x7c,0x81,0xd3,0x83,0xa7,0xd1,0x28, + 0x35,0xd4,0xb4,0xd7,0xf0,0xe3,0x5d,0x3f,0x26,0x43,0x9f,0xc1,0xd,0x4b,0x6f,0xe0, + 0x17,0x47,0x7e,0xc1,0xa1,0x8e,0x43,0xd4,0xd,0xd4,0xf1,0xe9,0x15,0x9f,0xa6,0xba, + 0xb0,0x9a,0xa9,0xc0,0x14,0x5b,0xcb,0xb6,0xf2,0xd2,0xb9,0x64,0x3a,0x2d,0x21,0x24, + 0xf8,0xfc,0xea,0xcf,0x8b,0xe7,0x90,0x10,0x12,0x4c,0xcc,0x4e,0xa0,0x55,0x69,0x39, + 0xd6,0x7b,0x8c,0xa1,0xa9,0x21,0x8a,0x2d,0xc5,0x7c,0x7a,0xc5,0xa7,0xc5,0xdc,0xe9, + 0x85,0x3c,0xf3,0x85,0x74,0x10,0x24,0x47,0xa0,0x35,0xed,0x35,0x28,0xe5,0x4a,0x5c, + 0x3e,0x17,0xa9,0xda,0x54,0xf1,0x47,0x7e,0xd3,0xb2,0x9b,0x38,0xda,0x7d,0x94,0xa3, + 0xdd,0x47,0x39,0xd6,0x7d,0x8c,0x5b,0x56,0xdc,0xc2,0xc7,0x17,0x7d,0x3c,0x59,0x23, + 0xdf,0x53,0xcb,0x2d,0x2b,0x6e,0x41,0x2e,0x93,0x13,0x8e,0x85,0x79,0xb4,0xf6,0x51, + 0x36,0x14,0x6f,0xa0,0xca,0x56,0x45,0xa6,0x21,0x93,0x2b,0x8b,0xaf,0xe4,0x27,0xef, + 0xfe,0x84,0x17,0xeb,0x5f,0x24,0x2e,0xc4,0xd9,0x5a,0xba,0x95,0x60,0x34,0x48,0x20, + 0x1a,0x60,0x71,0xee,0xe2,0xe4,0x75,0x1f,0x6f,0x25,0x45,0x95,0x82,0xc7,0xef,0x41, + 0x91,0xa5,0x48,0x2e,0x9c,0x2a,0xb5,0x1c,0x68,0x3d,0x40,0xae,0x29,0x97,0x44,0x22, + 0xc1,0xc4,0xdc,0x4,0x5a,0x65,0x32,0x6d,0x73,0x61,0x1,0xf9,0xdc,0xf0,0x39,0x8c, + 0x5a,0x23,0x3,0x53,0x3,0x94,0x65,0x96,0x31,0x36,0x33,0x86,0x27,0xe0,0xa1,0x22, + 0xab,0x2,0x9b,0xd1,0x86,0x29,0xc5,0xc4,0xaf,0xdf,0xfb,0x35,0x6b,0xec,0x6b,0xa8, + 0xcc,0xae,0xc4,0x6a,0xb0,0xf2,0xc0,0x9f,0x93,0xc1,0xff,0xe1,0xbf,0x3c,0xcc,0xaf, + 0xdf,0xfb,0x35,0x46,0xad,0x91,0x1b,0x97,0xde,0xc8,0x53,0xef,0x3f,0xc5,0xab,0xd, + 0xaf,0xa2,0x57,0xeb,0xa9,0xc8,0xae,0x20,0x18,0x9,0x32,0x3e,0x3b,0xce,0xad,0x6b, + 0x6f,0x4d,0x1e,0x6b,0xe4,0x9c,0x98,0x1b,0xaf,0xca,0xae,0xe2,0xbc,0xf3,0x3c,0x39, + 0x69,0x39,0x74,0xbb,0xbb,0x29,0x30,0x17,0xd0,0xe5,0xea,0x62,0xc5,0x82,0xbf,0xe6, + 0xb1,0x5d,0x73,0x2e,0xe2,0x89,0x38,0xef,0xf5,0xbe,0x47,0xa1,0xb9,0x90,0x48,0x3c, + 0x42,0x24,0x16,0xa1,0x67,0xb2,0x87,0xf1,0xd9,0x71,0xbe,0x78,0xc5,0x17,0x91,0xcb, + 0xe4,0x1c,0xed,0x3e,0xca,0x55,0x25,0x57,0x89,0x1d,0xdb,0xa4,0x6f,0x12,0xb3,0xde, + 0x3c,0xaf,0xf2,0xa6,0x79,0xac,0x99,0xa3,0x5d,0x47,0xc9,0x35,0xe5,0x32,0xe5,0x9f, + 0xe2,0xab,0xeb,0xbf,0xca,0xd8,0xcc,0x18,0xdf,0xdd,0xff,0x5d,0x6e,0x5e,0x7e,0x33, + 0x56,0x83,0x95,0x43,0x1d,0x87,0x30,0xa5,0x98,0xa8,0xcc,0xae,0x64,0x7f,0xeb,0x7e, + 0x31,0x40,0x8e,0xcd,0x8c,0x89,0xa9,0x93,0xb,0xcf,0xa3,0x46,0xa9,0x61,0x36,0x98, + 0xcc,0x6b,0xd7,0xf6,0xd6,0xb2,0xd1,0xb1,0x91,0xd5,0x5,0xab,0x51,0xc8,0x14,0x1c, + 0xe9,0x3a,0x42,0x59,0x56,0x99,0x58,0x58,0x11,0x8d,0x45,0x99,0x9,0xcd,0xe0,0x9c, + 0x75,0xf2,0x56,0xeb,0x5b,0x14,0x5b,0x8b,0x41,0x86,0x38,0x18,0x28,0x30,0x17,0x60, + 0x35,0x58,0x89,0x27,0xe2,0x74,0xba,0x3a,0x59,0x57,0xb4,0xe,0x5f,0xd8,0xc7,0xf6, + 0xf2,0xed,0x1c,0xed,0x3e,0x4a,0x91,0xa5,0x8,0x8f,0xcf,0xc3,0xce,0xaa,0xbf,0x16, + 0x5b,0x0,0x5c,0xbf,0xf4,0x7a,0x5a,0xc6,0x5a,0x78,0xbe,0xee,0x79,0xd6,0x15,0xad, + 0x63,0x36,0x38,0x2b,0xce,0x1a,0x63,0x89,0x18,0x4d,0xa3,0x4d,0x6c,0x2d,0xdd,0x8a, + 0x4a,0xa1,0xa2,0xdf,0xd3,0x8f,0x41,0x6d,0xa0,0x2c,0xb9,0xd0,0xaf,0xb7,0x0,0x0, + 0xf,0x23,0x49,0x44,0x41,0x54,0xb3,0xc,0x40,0xc,0xa8,0xa,0x59,0x32,0xff,0x9f, + 0xaa,0x49,0xe5,0x58,0xcf,0x31,0x9c,0xb3,0x4e,0xac,0x6,0x2b,0x5f,0xb8,0xe2,0xb, + 0xf4,0x4e,0xf6,0x72,0xa8,0xfd,0x10,0x66,0xbd,0x99,0x49,0xdf,0x24,0xa6,0x14,0x13, + 0x9d,0xae,0x4e,0xde,0xe9,0x78,0x87,0xcf,0xac,0xfc,0xc,0xbe,0xb0,0x6f,0x5e,0xba, + 0xec,0x6f,0x79,0xb7,0xf3,0x5d,0x9e,0x78,0xef,0x9,0x1e,0xfa,0xe4,0x43,0x40,0xb2, + 0x50,0xc7,0xe3,0xf3,0xd0,0x3e,0xde,0xce,0xb0,0x77,0x98,0x1e,0x77,0xf,0x91,0x58, + 0x84,0xe9,0xc0,0x34,0x2a,0x85,0x8a,0x3e,0x4f,0x1f,0x85,0x19,0x85,0x84,0xa2,0x21, + 0x71,0x84,0x3f,0x36,0x33,0xc6,0xcb,0xe7,0x5e,0x46,0xa7,0xd2,0xe1,0xb,0xfb,0x0, + 0xa8,0xcc,0xae,0x14,0x53,0x50,0x6,0x8d,0x81,0x1e,0x77,0x4f,0x72,0x5d,0x54,0x6b, + 0xa4,0x73,0xa2,0x13,0xb7,0xdf,0xcd,0xa1,0x8e,0x43,0x54,0x66,0x55,0x92,0x9f,0x9e, + 0x8f,0x51,0x6b,0xa4,0xd9,0xd9,0xcc,0xd5,0xe5,0x57,0xa3,0x55,0x69,0x19,0x9e,0x1e, + 0x26,0x10,0x9,0xe0,0xb,0xfb,0x90,0xcb,0xe4,0xb4,0x38,0x5b,0x50,0xca,0x95,0x9c, + 0x19,0x3a,0x43,0x66,0x6a,0x26,0x4f,0x9f,0x78,0x9a,0xeb,0x97,0x5c,0xcf,0xfa,0xe2, + 0xf5,0x68,0x54,0xc9,0x59,0x55,0x5c,0x88,0xd3,0x37,0xd9,0xc7,0x81,0xb6,0x3,0xe4, + 0xa7,0xe7,0x33,0xe5,0x9f,0x42,0xad,0x54,0x53,0x92,0x59,0xc2,0xe1,0xae,0xc3,0x2c, + 0x48,0x5f,0xc0,0xf6,0xf2,0xed,0xbc,0xdb,0xf1,0xae,0x38,0x70,0xd9,0x55,0xb5,0x8b, + 0x27,0x8f,0x3f,0x89,0x5e,0xad,0xc7,0x66,0xb4,0x89,0xfd,0xa5,0x5e,0xad,0xe7,0xc5, + 0xfa,0x17,0xb1,0xa5,0xd9,0x92,0xcf,0x8a,0x0,0x47,0xba,0x8e,0xb0,0xba,0x60,0xb5, + 0x98,0x96,0xf7,0x85,0x7d,0x4,0x22,0x1,0x1a,0x47,0x1a,0xc9,0x36,0x66,0xb3,0xbb, + 0x6a,0x37,0xa3,0xd3,0xa3,0x2c,0xc9,0x5d,0xc2,0x6f,0x4e,0xfe,0x86,0x2a,0x5b,0x15, + 0x4a,0xb9,0x92,0xf2,0xac,0x72,0xb2,0x52,0xb3,0x78,0xa3,0xe9,0xd,0x52,0xb5,0xa9, + 0x14,0x5b,0x8a,0x81,0x64,0x0,0xfb,0x8f,0xcf,0xee,0x5,0x32,0xe1,0x12,0x45,0xc9, + 0x82,0x20,0x30,0xe8,0x1d,0x14,0x2f,0x30,0x24,0x83,0x89,0x5e,0xad,0x67,0x7c,0x76, + 0x5c,0xcc,0x27,0x66,0xa5,0x66,0x91,0x65,0xcc,0x42,0x10,0x4,0xbe,0xf9,0xfa,0x37, + 0xb1,0x18,0x2c,0x5c,0xbf,0xe4,0x7a,0x4,0x41,0xa0,0xd0,0x5c,0x48,0xaa,0xf6,0xaf, + 0x2f,0xbf,0xbc,0xdd,0xf6,0x36,0xcd,0x63,0xcd,0xdc,0xb9,0xf9,0x4e,0x94,0x72,0x25, + 0xa7,0x6,0x4f,0xe1,0xd,0x78,0xe7,0x95,0xdd,0x35,0x8d,0x36,0x91,0xa1,0xcf,0x20, + 0x16,0x8f,0xf1,0xf0,0xb1,0x87,0xb9,0x61,0xe9,0xd,0x98,0x52,0x4c,0x9c,0x1c,0x38, + 0xc9,0xf3,0x75,0xcf,0xf3,0xfc,0x2d,0xc9,0xa9,0xf6,0x85,0xaa,0xa8,0x40,0x24,0x40, + 0xfb,0x44,0x3b,0xb9,0xa6,0x5c,0xb2,0x53,0xb3,0xf1,0x6,0xbc,0x74,0xbb,0xbb,0x29, + 0xb2,0x14,0x61,0xd1,0x27,0xab,0x15,0xa6,0x2,0x53,0xb4,0x8f,0xb7,0xcf,0xab,0x9d, + 0xce,0x49,0xcb,0xc1,0x61,0x75,0x20,0x43,0x46,0x30,0x1a,0x14,0xeb,0xd2,0x8d,0x5a, + 0xa3,0x38,0x33,0x82,0xe4,0xf,0x3c,0x18,0x9,0xa2,0x52,0xa8,0x28,0xca,0x28,0x12, + 0xa7,0xbc,0x1e,0xbf,0x87,0xe1,0xe9,0x61,0xe4,0x32,0x39,0xb9,0x69,0xb9,0xf3,0x46, + 0x52,0x2,0x2,0x13,0xb3,0x13,0xf8,0x23,0x7e,0x2,0x91,0x0,0x1a,0xa5,0x86,0x7c, + 0x73,0xbe,0x38,0x9b,0x19,0x9b,0x19,0xe3,0x87,0x87,0x7e,0xc8,0xf,0x77,0xfe,0x50, + 0x6c,0x23,0x20,0x56,0x2b,0xc8,0x90,0x91,0x67,0xca,0x23,0x27,0x2d,0x47,0xfc,0x2c, + 0x12,0x8f,0xd0,0xe3,0xee,0x21,0x2e,0xc4,0x91,0x23,0xa7,0xc4,0x5a,0x92,0xac,0x4e, + 0x8a,0x85,0x78,0xad,0xe1,0x35,0x36,0x95,0x6e,0x22,0x37,0x2d,0x17,0x41,0x10,0x18, + 0x99,0x1e,0x61,0x2a,0x30,0x85,0xd5,0x60,0x15,0x2b,0x43,0x1a,0xc7,0x1a,0x49,0x24, + 0x12,0x14,0x98,0xb,0xc8,0x34,0x64,0x12,0x4d,0x44,0xe9,0x76,0x77,0x27,0xbf,0x47, + 0xa1,0x66,0xd8,0x3b,0x8c,0xdb,0xef,0x66,0x91,0x6d,0x11,0x2a,0x85,0x8a,0x9e,0xc9, + 0x1e,0x3c,0x7e,0xf,0xe,0x8b,0x3,0x9d,0x5a,0x27,0x76,0xd0,0x69,0xda,0x34,0x46, + 0xa6,0x47,0x70,0x58,0x1d,0x28,0xe5,0x4a,0x7a,0xdc,0x3d,0xcc,0x86,0x67,0xc9,0xd0, + 0x65,0xf0,0xf0,0x5f,0x1e,0xe6,0xda,0xc5,0xd7,0x62,0x31,0x58,0xa8,0x1f,0xaa,0xe7, + 0x99,0xf7,0x9f,0xe1,0xf1,0x1b,0x1e,0x27,0x33,0x35,0x93,0x49,0xff,0x24,0x99,0x86, + 0x4c,0xb2,0x52,0xb3,0xe8,0x99,0xec,0xa1,0x34,0xb3,0x94,0x49,0xdf,0x24,0xfd,0x9e, + 0x7e,0x52,0xb5,0xa9,0x94,0x5a,0x93,0x39,0xd4,0x40,0x24,0x40,0xae,0x29,0x39,0xd3, + 0x8d,0xc5,0x63,0xf4,0x4c,0xf6,0x50,0x6c,0x29,0x16,0xd7,0xcb,0x46,0x67,0x46,0xa9, + 0xcc,0xae,0x44,0xaf,0xd6,0xd3,0xe9,0xea,0x24,0x18,0xd,0x52,0x65,0xab,0x62,0x62, + 0x6e,0x82,0xa3,0x5d,0x47,0xb9,0x61,0xe9,0xd,0x68,0x55,0x5a,0xf1,0x1e,0x75,0xba, + 0x3a,0xc9,0x49,0xcb,0xa1,0x20,0xbd,0x80,0xd6,0xf1,0x56,0x0,0x8a,0x2d,0xc5,0xc, + 0x4c,0xd,0xe0,0xb0,0x38,0xc4,0x4e,0xc6,0xa8,0x31,0x8a,0xd5,0x2d,0x9d,0xae,0x4e, + 0xd4,0xa,0x35,0x85,0xe6,0x42,0x71,0x76,0x30,0xe4,0x1d,0x62,0x64,0x7a,0x4,0xad, + 0x4a,0x8b,0xc3,0xe2,0xc0,0xa8,0x35,0xe2,0xf6,0xb9,0xe9,0xf7,0xf4,0x53,0x60,0x2e, + 0xc0,0x1b,0xf0,0xe2,0xb,0xfb,0xc4,0x3c,0x7d,0xb7,0xbb,0x1b,0x7b,0x86,0x1d,0x6f, + 0xc0,0xcb,0xd9,0xe1,0xb3,0xdc,0xb4,0xec,0x26,0x71,0x6,0xd4,0xed,0xee,0x26,0x10, + 0x9,0xb0,0xd0,0xb6,0x90,0x58,0x3c,0x46,0xdb,0x44,0x1b,0x3a,0x95,0xe,0x7b,0x86, + 0x1d,0x85,0x5c,0xc1,0xa1,0xf6,0x43,0xe4,0xa6,0xe5,0xb2,0x34,0x6f,0x29,0x90,0x4c, + 0x31,0x74,0xb9,0xba,0x8,0x45,0x43,0x38,0xac,0x8e,0xe4,0xe0,0xc8,0xdd,0x85,0x3d, + 0xc3,0x8e,0xc,0x19,0xde,0xa0,0x97,0xe2,0x8c,0x62,0x4,0x4,0xda,0xc7,0xdb,0x51, + 0x2a,0x94,0x94,0x5a,0x4b,0x99,0xb,0xcf,0xd1,0x3e,0xd1,0x8e,0x52,0xae,0xa4,0xd0, + 0x5c,0x78,0xc9,0x97,0xee,0x2,0x91,0x0,0x3,0x53,0x3,0x8,0x82,0x80,0x4c,0x26, + 0x43,0xa5,0x50,0xe1,0xb0,0x38,0x10,0x10,0xe8,0x9b,0xec,0xc3,0x62,0x48,0xce,0x8c, + 0x2f,0xac,0x45,0x96,0x58,0x4b,0xc4,0x67,0xd5,0xed,0x73,0x53,0x96,0x59,0xc6,0x54, + 0x60,0xa,0x7f,0xc4,0x8f,0x3f,0xec,0x47,0xa5,0x54,0x51,0x90,0x5e,0x40,0x8a,0x2a, + 0x5,0xe7,0xac,0x53,0x5c,0xeb,0x74,0x58,0x1c,0xe8,0x35,0x7a,0x46,0xa7,0x47,0x19, + 0xf4,0xe,0x92,0xa1,0xcb,0xa0,0xd8,0x52,0x2c,0xde,0xab,0xf,0xd2,0xea,0x6c,0x65, + 0x26,0x34,0x83,0xc3,0xe2,0x20,0x33,0x35,0x93,0x50,0x2c,0x44,0x97,0xab,0x8b,0xd9, + 0xd0,0x2c,0x65,0x99,0x65,0xcc,0x85,0xe7,0x98,0xd,0xcd,0x52,0x99,0x5d,0x89,0x5a, + 0xa1,0xa6,0x79,0xac,0x19,0x95,0x42,0x45,0x79,0x56,0xb9,0x38,0xe8,0xf2,0xf8,0x3d, + 0xf4,0x79,0xfa,0x88,0x27,0xe2,0x14,0x98,0xb,0x92,0x95,0x86,0xb3,0xe3,0xc,0x4c, + 0xd,0x50,0x91,0x55,0x81,0x41,0x63,0xa0,0x79,0xac,0x99,0x9c,0xb4,0x1c,0xbc,0x1, + 0x2f,0x4f,0x1e,0x7f,0x92,0x5b,0x56,0xdc,0x42,0x8a,0x3a,0x85,0x83,0xed,0x7,0x39, + 0xd0,0x7a,0x80,0x97,0x3e,0xff,0x12,0xfe,0x88,0x1f,0xab,0xc1,0x8a,0x29,0xc5,0xc4, + 0x5c,0x78,0x8e,0x4e,0x57,0x27,0x85,0xe6,0x42,0x2c,0x7a,0xb,0x6e,0x9f,0x9b,0x3e, + 0x4f,0x1f,0x65,0x99,0x65,0xe2,0xf3,0x9,0x7f,0xed,0x37,0x21,0x39,0xa0,0x1c,0x9f, + 0x1d,0x4f,0x5e,0x17,0x95,0x26,0xb9,0x2e,0xa5,0x31,0xd0,0x3b,0xd9,0x8b,0x2f,0xec, + 0xa3,0x3c,0xab,0x9c,0x70,0x2c,0x4c,0xa7,0xab,0x33,0xb9,0x4e,0x95,0x51,0x44,0xba, + 0x2e,0x9d,0x49,0xff,0x24,0xc3,0xde,0x61,0xcc,0x3a,0x33,0xb9,0xa6,0xe4,0x1a,0x4c, + 0x97,0xab,0x8b,0xa9,0xc0,0x14,0xd9,0xa9,0xd9,0xe4,0x9b,0xf3,0x89,0x27,0xe2,0xec, + 0x6d,0xde,0xcb,0xaa,0x82,0x55,0xe2,0x2c,0x35,0x1c,0xb,0xd3,0x3e,0xd1,0x2e,0xde, + 0x3,0x95,0x42,0x85,0x20,0x8,0xe2,0xf3,0x9c,0xae,0x4b,0xc7,0x61,0x75,0x88,0xdf, + 0xe7,0x8f,0xf8,0x29,0xb1,0x96,0x24,0xff,0xed,0xee,0xc2,0x6e,0xb6,0x5f,0xfa,0x65, + 0x4d,0xe1,0x43,0x10,0x89,0x45,0x84,0x2d,0x8f,0x6f,0x11,0xea,0x7,0xeb,0x2f,0xfa, + 0xec,0x68,0xf7,0x51,0xa1,0x6e,0xa0,0x4e,0x78,0xee,0xe4,0x73,0x82,0x6b,0xce,0x75, + 0x59,0xdf,0x57,0xd3,0x56,0x23,0x6c,0x78,0x64,0x83,0x30,0xe2,0x1d,0x11,0x4,0x41, + 0x10,0xdc,0x3e,0xb7,0xb0,0xe8,0x67,0x8b,0x84,0xa6,0xd1,0xa6,0xf,0xa3,0xb9,0xff, + 0x23,0xfa,0x3c,0x7d,0xc2,0xbe,0x96,0x7d,0xc2,0x5b,0xe7,0xdf,0xba,0xe4,0x75,0xfa, + 0x47,0x56,0xdb,0x53,0x2b,0x5c,0xf1,0xd0,0x15,0xc2,0xa0,0x67,0x50,0x10,0x4,0x41, + 0x98,0xe,0x4c,0xb,0xab,0x7e,0xb1,0x4a,0x78,0xbf,0xef,0xfd,0xff,0xe1,0x96,0x49, + 0x24,0xff,0x35,0x2f,0x9d,0x7d,0x49,0xf8,0xd8,0x93,0x1f,0x13,0xfb,0xaa,0xb6,0xf1, + 0x36,0x61,0xd9,0xcf,0x97,0x9,0xc3,0xde,0xe1,0xff,0xe1,0x96,0x7d,0x74,0x5c,0x72, + 0xa6,0xf1,0x5f,0x35,0x17,0x9e,0xe3,0x9b,0xaf,0x7f,0x93,0x1f,0xed,0xfa,0x11,0x39, + 0xc6,0x9c,0x79,0x9f,0xfd,0xe6,0xe4,0x6f,0x68,0x1e,0x6b,0xe6,0x6b,0xeb,0xbf,0x76, + 0xc9,0x8a,0xac,0x4b,0x9,0x44,0x2,0xfc,0xa9,0xe9,0x4f,0xf4,0x4c,0xf6,0x90,0x93, + 0x96,0x43,0x20,0x12,0x60,0x71,0xce,0x62,0xae,0x2c,0xbe,0xf2,0x1f,0xf6,0xed,0xe5, + 0x86,0x91,0x6,0x1e,0xab,0x7d,0x8c,0x1b,0x96,0xde,0xc0,0xd6,0xb2,0xad,0x17,0x15, + 0x1a,0xfc,0x23,0xb,0x46,0x83,0xec,0x3f,0xbf,0x3f,0x39,0x23,0x31,0xe5,0x10,0x8a, + 0x86,0x28,0xcb,0x2c,0x63,0x53,0xc9,0xa6,0xcb,0x7e,0xe9,0x4d,0x22,0xf9,0x28,0xf0, + 0x85,0x7d,0xfc,0xe1,0xcc,0x1f,0x98,0x98,0x9b,0x20,0x27,0x2d,0x7,0x7f,0xc4,0xcf, + 0xca,0x5,0x2b,0xa9,0x2e,0xac,0x9e,0xf7,0xa,0xc2,0xff,0x65,0x1f,0x4a,0xd0,0x88, + 0x27,0xe2,0x44,0xe2,0x91,0xf,0xfd,0xef,0xbc,0x48,0x24,0x12,0x89,0xe4,0xa3,0xe5, + 0x43,0x9,0x1a,0x12,0x89,0x44,0x22,0xf9,0xbf,0x41,0xfa,0xd3,0xe8,0x12,0x89,0x44, + 0x22,0xb9,0x6c,0x52,0xd0,0x90,0x48,0x24,0x12,0xc9,0x65,0x93,0x82,0x86,0x44,0x22, + 0x91,0x48,0x2e,0x9b,0x14,0x34,0x24,0x12,0x89,0x44,0x72,0xd9,0xa4,0xa0,0x21,0x91, + 0x48,0x24,0x92,0xcb,0x26,0x5,0xd,0x89,0x44,0x22,0x91,0x5c,0x36,0x29,0x68,0x48, + 0x24,0x12,0x89,0xe4,0xb2,0x49,0x41,0x43,0x22,0x91,0x48,0x24,0x97,0x4d,0xa,0x1a, + 0x12,0x89,0x44,0x22,0xb9,0x6c,0x52,0xd0,0x90,0x48,0x24,0x12,0xc9,0x65,0x93,0x82, + 0x86,0x44,0x22,0x91,0x48,0x2e,0x9b,0x14,0x34,0x24,0x12,0x89,0x44,0x72,0xd9,0xa4, + 0xa0,0x21,0x91,0x48,0x24,0x92,0xcb,0x26,0x5,0xd,0x89,0x44,0x22,0x91,0x5c,0x36, + 0x29,0x68,0x48,0x24,0x12,0x89,0xe4,0xb2,0x49,0x41,0x43,0x22,0x91,0x48,0x24,0x97, + 0x4d,0xa,0x1a,0x12,0x89,0x44,0x22,0xb9,0x6c,0x52,0xd0,0x90,0x48,0x24,0x12,0xc9, + 0x65,0x93,0x82,0x86,0x44,0x22,0x91,0x48,0x2e,0x9b,0xf2,0x83,0x3e,0x7c,0xa3,0xf9, + 0xd,0xf6,0x34,0xec,0x61,0x47,0xe5,0xe,0x3e,0xb1,0xe8,0x13,0xa4,0x6a,0x53,0xf9, + 0x4b,0xcf,0x5f,0xd8,0xd3,0xb0,0x87,0xab,0xcb,0xaf,0xe6,0xda,0x45,0xd7,0xfe,0x5d, + 0x7,0x7d,0xad,0xf1,0x35,0xa6,0x83,0xd3,0x7c,0xa9,0xfa,0x4b,0xc8,0x65,0xff,0xfd, + 0xb8,0x15,0x8a,0x86,0x8,0xc7,0xc2,0x68,0x94,0x1a,0xb4,0x2a,0xed,0xdf,0xdc,0xce, + 0x1f,0xf1,0x13,0x4b,0xc4,0x90,0x21,0xc3,0xa0,0x31,0xcc,0x3b,0x76,0xb7,0xbb,0x9b, + 0x67,0x4f,0x3c,0x8b,0x3f,0xe2,0xa7,0x2a,0xa7,0x8a,0x99,0xc0,0xc,0xeb,0x8a,0xd6, + 0xb1,0xd6,0xbe,0x16,0x85,0x5c,0xf1,0x37,0xbf,0x53,0x10,0x4,0x64,0x32,0xd9,0x7f, + 0xfb,0x1c,0x24,0x12,0x89,0xe4,0x1f,0xc1,0x7,0xf6,0xd8,0xeb,0x8b,0xd6,0x33,0x36, + 0x3b,0xc6,0xba,0xa2,0x75,0xa4,0x6a,0x53,0x1,0xc8,0x34,0x64,0xe2,0xb0,0x3a,0xd8, + 0x59,0xb9,0xf3,0xef,0x3f,0xa8,0x4c,0x8e,0x59,0x6f,0xfe,0xbb,0xf7,0xff,0x8f,0xe2, + 0x89,0x38,0x27,0x7,0x4e,0xf2,0xc5,0x3f,0x7e,0x91,0x7d,0xe7,0xf7,0xfd,0xcd,0xed, + 0xda,0x27,0xda,0xb9,0xaf,0xe6,0x3e,0x5e,0x6f,0x7c,0x9d,0x7b,0xde,0xba,0x87,0xf7, + 0xfb,0xde,0x9f,0xf7,0x79,0x89,0xb5,0x84,0x68,0x22,0x4a,0xb6,0x31,0x9b,0x7f,0x5e, + 0xfb,0xcf,0x5c,0xbf,0xf4,0x7a,0xee,0xda,0x77,0x17,0x6d,0xe3,0x6d,0x7f,0xf3,0x3b, + 0x7d,0x61,0x1f,0xef,0xf5,0xbd,0x47,0x28,0x16,0xfa,0x50,0xce,0x45,0x22,0x91,0x48, + 0x3e,0xea,0x3e,0x70,0xa6,0xa1,0x51,0x6a,0xb0,0xe8,0x2d,0xb8,0x7d,0x6e,0xec,0x19, + 0x76,0xc2,0xb1,0x30,0x87,0x3a,0xe,0xf1,0xe9,0xe5,0x9f,0x46,0xa5,0x50,0xe1,0xb, + 0xfb,0x98,0xa,0x4c,0x11,0x8a,0x86,0xc8,0x33,0xe5,0x11,0x8c,0x6,0x99,0xe,0x4e, + 0x93,0xaa,0x49,0x25,0x9a,0x88,0x22,0x43,0x86,0x29,0xc5,0xc4,0xf8,0xdc,0x38,0x29, + 0xaa,0x14,0x6c,0x46,0x1b,0x63,0x33,0x63,0x94,0x66,0x96,0x62,0xcf,0xb0,0x23,0x97, + 0xc9,0x49,0x8,0x9,0xc6,0x67,0xc7,0x9,0xc7,0xc2,0x0,0x64,0x1b,0xb3,0x49,0x51, + 0xa5,0x30,0x1d,0x9c,0xc6,0xe3,0xf7,0x90,0xae,0x4b,0x47,0xa5,0x50,0x31,0x32,0x3d, + 0x42,0xba,0x2e,0x9d,0xec,0xd4,0xec,0x79,0x6d,0x54,0xc8,0x15,0xac,0x5c,0xb0,0x12, + 0x99,0x4c,0x46,0x61,0x46,0xe1,0x25,0xcf,0x63,0x62,0x6e,0x82,0x7b,0xf,0xdc,0xcb, + 0x97,0xaa,0xbf,0xc4,0xb6,0xf2,0x6d,0xcc,0x85,0xe6,0xf8,0xc3,0x99,0x3f,0x70,0x65, + 0xf1,0x95,0xe2,0x36,0xbe,0xb0,0x8f,0xa1,0xa9,0x21,0xd6,0xd9,0xd7,0x21,0x97,0xc9, + 0x31,0xa5,0x98,0x8,0x46,0x83,0xf8,0x23,0x7e,0x0,0xa6,0x2,0x53,0xcc,0x86,0x66, + 0x49,0x8,0x9,0xf2,0xd2,0xf2,0x98,0xf4,0x4f,0xf2,0xc7,0xb3,0x7f,0xc4,0x39,0xeb, + 0xc4,0x6e,0xb6,0x93,0x97,0x9e,0x47,0x28,0x1a,0xc2,0x35,0xe7,0x42,0x40,0x20,0x10, + 0x9,0x60,0x33,0xda,0x48,0xd7,0xa5,0xff,0x77,0xee,0x8f,0x44,0x22,0x91,0x7c,0xa4, + 0x7c,0x60,0xd0,0x50,0x2b,0xd4,0x64,0x1a,0x32,0x19,0x9d,0x19,0x5,0xa0,0x69,0xb4, + 0x89,0xfc,0xf4,0x7c,0xb2,0x8d,0xd9,0x8c,0xcf,0x8e,0xf3,0xc7,0xb3,0x7f,0xa4,0x2c, + 0xb3,0x8c,0x17,0xcf,0xbc,0xc8,0x96,0xd2,0x2d,0xac,0xcc,0x5f,0xc9,0x3,0x7f,0x7e, + 0x80,0xca,0xec,0x4a,0x3a,0x5d,0x9d,0x94,0x5a,0x4b,0xc9,0x4c,0xcd,0x24,0x55,0x93, + 0xca,0xa9,0xc1,0x53,0xfc,0xe2,0xda,0x5f,0xd0,0x31,0xd1,0xc1,0x4f,0xff,0xfc,0x53, + 0x5e,0xfa,0xdc,0x4b,0x68,0x55,0x5a,0xe,0xb6,0x1d,0xe4,0x50,0xc7,0x21,0x36,0x95, + 0x6c,0xe2,0xbc,0xf3,0x3c,0x6,0x8d,0x81,0x3b,0xae,0xba,0x83,0xc1,0xa9,0x41,0xee, + 0x7d,0xfb,0x5e,0xae,0x5b,0x72,0x1d,0xe9,0xba,0x74,0xde,0x69,0x7f,0x87,0x84,0x90, + 0xe0,0x89,0x9b,0x9e,0xb8,0xa8,0x9d,0xce,0x59,0x27,0x89,0x44,0x82,0x12,0x4b,0xc9, + 0x25,0xcf,0xe3,0x78,0xdf,0x71,0x46,0xa6,0x47,0xd8,0xe8,0xd8,0x98,0xc,0x54,0x24, + 0x70,0xf9,0x5c,0xf3,0xb6,0x19,0x9d,0x19,0x65,0x26,0x34,0x43,0x79,0x56,0x39,0xce, + 0x59,0x27,0x8f,0xd7,0x3e,0xce,0x86,0xe2,0xd,0x94,0x65,0x96,0xd1,0x38,0xda,0x48, + 0x6d,0x6f,0x2d,0xe,0x8b,0x83,0x5f,0xfd,0xe5,0x57,0x7c,0x7f,0xdb,0xf7,0x89,0xb, + 0x71,0x6a,0xda,0x6b,0xd8,0x52,0xba,0x85,0x41,0xef,0x20,0x7a,0x8d,0x9e,0xc7,0x6a, + 0x1f,0xc3,0xaa,0xb7,0xb2,0xc0,0xbc,0x80,0x5f,0x1d,0xfd,0x15,0xdf,0xd9,0xf2,0x1d, + 0xae,0xa9,0xb8,0xe6,0xef,0xbd,0x37,0x12,0x89,0x44,0xf2,0x91,0xf3,0x81,0xe9,0x29, + 0xb5,0x52,0x4d,0x66,0x6a,0x26,0x83,0xde,0x41,0x12,0x42,0x82,0xfa,0xa1,0x7a,0xd6, + 0xd9,0xd7,0x11,0x8c,0x6,0xf9,0xe9,0xbb,0x3f,0xa5,0xd8,0x52,0xcc,0xf2,0x5,0xcb, + 0x89,0x25,0x62,0x28,0xe5,0x4a,0xa,0xd2,0xb,0x98,0xe,0x4c,0x93,0x67,0xca,0xe3, + 0xc9,0x1b,0x9f,0xe4,0xf6,0x8d,0xb7,0x53,0x37,0x50,0xc7,0xe2,0x9c,0xc5,0x7c,0x7f, + 0xfb,0xf7,0x51,0x29,0x54,0x14,0x59,0x8a,0xc8,0x31,0xe6,0x90,0x61,0xc8,0xa0,0xd3, + 0xd5,0xc9,0x7d,0x35,0xf7,0xf1,0xb9,0x55,0x9f,0xe3,0xda,0xc5,0xd7,0xb2,0x62,0xc1, + 0xa,0xfe,0xbd,0xfe,0xdf,0x1,0x30,0xeb,0xcc,0x78,0x83,0x5e,0x12,0x42,0x82,0xd, + 0xc5,0x1b,0xb0,0xa5,0xd9,0x30,0xa6,0x18,0x2f,0xd9,0xce,0xee,0xc9,0x6e,0x2c,0x6, + 0xb,0x26,0x9d,0xe9,0x92,0x9f,0xd7,0xb4,0xd5,0xb0,0xbe,0x78,0x3d,0x1a,0xa5,0x86, + 0x78,0x22,0x4e,0xdf,0x64,0x1f,0x79,0xa6,0xbc,0x79,0xdb,0xc,0x78,0x6,0x70,0xce, + 0x3a,0x79,0xe4,0xd8,0x23,0xdc,0xf6,0xda,0x6d,0x78,0x83,0x5e,0xee,0xd9,0x7a,0xf, + 0xb1,0x44,0x8c,0x1f,0xbf,0xf3,0x63,0x36,0x97,0x6c,0xa6,0xd8,0x52,0x4c,0x2c,0x1e, + 0x43,0x2e,0x97,0x93,0x9f,0x9e,0x8f,0x56,0xa9,0xe5,0xf3,0xab,0x3e,0x4f,0x95,0xad, + 0x8a,0xbb,0xde,0xbc,0x8b,0xdc,0xb4,0x5c,0xbe,0xb2,0xf6,0x2b,0x2c,0x30,0x2d,0x20, + 0x45,0x95,0xc2,0x8a,0xbc,0x15,0x7f,0xcf,0x3d,0x91,0x48,0x24,0x92,0x8f,0xac,0xf, + 0xc,0x1a,0x72,0x99,0x1c,0xab,0xc1,0xca,0xf8,0xec,0x38,0x67,0x87,0xcf,0x92,0x9f, + 0x9e,0x4f,0x96,0x31,0x8b,0x96,0xb1,0x16,0x5a,0x9c,0x2d,0xcc,0x85,0xe7,0xf8,0xed, + 0xa9,0xdf,0xb2,0xbb,0x6a,0x37,0x37,0x2d,0xbb,0x89,0x99,0xd0,0xc,0x23,0x33,0x23, + 0xac,0x2f,0x5a,0x4f,0xaa,0x36,0x95,0xb4,0x94,0x34,0xd6,0xda,0xd7,0xf2,0xe0,0x91, + 0x7,0x51,0xc8,0x15,0xc8,0x90,0x31,0xe4,0x1d,0x42,0xaf,0xd1,0x23,0x43,0xc6,0xc1, + 0xb6,0x83,0xd8,0x33,0xec,0x94,0x66,0x96,0x22,0x43,0xc6,0xe8,0xcc,0x28,0x1a,0x85, + 0x6,0x80,0xe1,0xe9,0x61,0x66,0x82,0x33,0x5c,0x59,0x74,0x25,0x46,0xad,0x91,0x13, + 0xfd,0x27,0xd8,0x58,0xbc,0xf1,0xa2,0x36,0xa,0x82,0x40,0xdf,0x64,0x1f,0x25,0xd6, + 0x12,0x64,0x5c,0x7a,0x41,0xba,0xd7,0xd3,0x4b,0x89,0xb5,0x4,0x85,0x5c,0x41,0x34, + 0x11,0xa5,0xc5,0xd9,0xc2,0xaa,0xfc,0x55,0xf3,0xb6,0xe9,0x99,0xec,0xa1,0x3c,0xab, + 0x9c,0xa7,0x3f,0xf5,0x34,0xbf,0xfc,0xe4,0x2f,0x99,0xf4,0x4d,0xf2,0x4a,0xc3,0x2b, + 0x1c,0xee,0x3a,0x4c,0x38,0x16,0xe6,0xcc,0xd0,0x19,0x5e,0x6d,0x78,0x95,0xef,0x6e, + 0xfb,0x2e,0xab,0xf3,0x57,0x33,0xe0,0x19,0x40,0xa9,0x50,0x62,0x4b,0xb3,0xf1,0x7e, + 0xdf,0xfb,0xf4,0x4f,0xf5,0x73,0xe3,0xd2,0x1b,0x91,0xcb,0xe4,0xec,0x6d,0xde,0x8b, + 0x51,0x6b,0xc4,0x9a,0x6a,0xfd,0x7b,0xef,0x8b,0x44,0x22,0x91,0x7c,0x24,0xfd,0xa7, + 0xa5,0x4b,0x39,0x69,0x39,0xb4,0x4f,0xb4,0x73,0xb2,0xff,0x24,0xd7,0x54,0x5e,0x83, + 0xc,0x19,0xfd,0x9e,0x7e,0x22,0xf1,0x8,0x1b,0x8a,0x37,0x70,0xcf,0xd6,0x7b,0xd8, + 0x50,0xbc,0x1,0x9d,0x5a,0xc7,0xe9,0xc1,0xd3,0x2c,0xb2,0x2d,0xc2,0x66,0xb4,0x1, + 0x30,0x36,0x33,0xc6,0xcd,0xcb,0x6f,0x46,0xad,0x50,0xd3,0x39,0xd1,0x9,0xc0,0x89, + 0xfe,0x13,0x94,0x58,0x4a,0xf0,0xf8,0x3d,0x74,0xb9,0xbb,0xa8,0xc8,0xae,0xc0,0xa0, + 0x31,0x10,0x4f,0xc4,0x79,0xb3,0xe5,0x4d,0xae,0x5b,0x72,0x1d,0x0,0xb5,0xbd,0xb5, + 0xec,0x5a,0xb8,0x8b,0xc2,0x8c,0x42,0xc6,0x66,0xc6,0x98,0xb,0xcf,0x91,0x93,0x96, + 0x43,0x20,0x12,0x98,0xd7,0xbe,0x68,0x22,0x4a,0xf3,0x58,0x33,0x2b,0x16,0xcc,0x1f, + 0xd5,0xcf,0x84,0x66,0x88,0x25,0x62,0x0,0x28,0xe5,0x4a,0xd2,0xb4,0x69,0x0,0x74, + 0xba,0x3a,0x89,0xc4,0x92,0x6d,0xff,0x8f,0x4e,0xd,0x9e,0x62,0x43,0xf1,0x6,0xe4, + 0x32,0x39,0x79,0x69,0x79,0x2c,0x30,0x2d,0xa0,0xcb,0xd5,0x45,0xf3,0x58,0x33,0xe9, + 0x29,0xe9,0xec,0xae,0xda,0xcd,0xf7,0xb6,0x7f,0xf,0x87,0xd5,0x81,0x5a,0xa9,0xe6, + 0xcc,0xf0,0x19,0x96,0xe4,0x2c,0xc1,0x1b,0xf0,0xb2,0xa7,0x71,0xf,0x5b,0x4a,0xb6, + 0x60,0xd0,0x18,0x38,0x3b,0x7c,0x96,0xda,0xde,0x5a,0xae,0x2c,0xbe,0x92,0x29,0xff, + 0x14,0x2,0xc2,0xdf,0x73,0x5f,0x24,0x12,0x89,0xe4,0x23,0xe9,0x3f,0xd,0x1a,0x59, + 0xa9,0x59,0x8c,0xcf,0x8c,0x53,0x99,0x5d,0x89,0x52,0x9e,0x5c,0x2,0xb1,0xa5,0xd9, + 0xd0,0x28,0x34,0xf4,0x4d,0xf6,0x51,0x37,0x50,0x47,0xc3,0x48,0x3,0x2,0x42,0x32, + 0x15,0x95,0xbb,0x18,0x9d,0x5a,0x7,0xc0,0xa3,0xc7,0x1e,0xe5,0xcc,0xf0,0x19,0x16, + 0xe7,0x2e,0xc6,0xa8,0x4d,0xa6,0x96,0x1a,0x46,0x1a,0x8,0x44,0x3,0xc4,0x13,0x71, + 0x56,0x17,0xac,0x66,0x2e,0x34,0xc7,0xe8,0xcc,0x28,0xaf,0x37,0xbd,0x4e,0x86,0x2e, + 0x83,0x9b,0x97,0xdf,0x4c,0x2c,0x11,0xa3,0x7d,0xa2,0x9d,0xf5,0xc5,0xeb,0x51,0xca, + 0x95,0x9c,0x1a,0x3c,0x85,0x55,0x6f,0xa5,0xc3,0xd5,0x31,0xaf,0xfc,0x35,0x12,0x8f, + 0xe0,0x9a,0x73,0x31,0xec,0x1d,0xc6,0xa0,0x36,0x88,0x55,0x4c,0x81,0x48,0x80,0x5b, + 0x7e,0x77,0xb,0xed,0x13,0xed,0x0,0x6c,0x2e,0xd9,0xcc,0xc0,0xd4,0x0,0x83,0x53, + 0x83,0xbc,0x74,0xf6,0x25,0x6e,0xdb,0x70,0x9b,0x98,0x9e,0x8a,0x27,0xe2,0x78,0xfc, + 0x1e,0x9a,0x46,0x9b,0xc8,0x36,0x66,0xe3,0xf2,0xb9,0xa8,0x1b,0xac,0xa3,0xdd,0xd5, + 0xce,0xa7,0x96,0x7f,0x8a,0x12,0x6b,0x9,0xde,0x80,0x97,0x91,0xe9,0x11,0xe,0xb6, + 0x1d,0xc4,0x39,0xeb,0x14,0xcf,0x23,0x43,0x9f,0x91,0x3c,0x77,0x41,0xc0,0x1f,0xf5, + 0x73,0x72,0xe0,0x24,0xde,0x40,0x32,0xa5,0xa6,0x55,0x6a,0x19,0x98,0x1a,0xf8,0x9b, + 0xb3,0x1f,0x89,0x44,0x22,0xf9,0x47,0xa4,0xb8,0xef,0xbe,0xfb,0xee,0xfb,0xa0,0xd, + 0xb4,0x2a,0x2d,0xb6,0x34,0x1b,0x5b,0xcb,0xb6,0xa2,0x52,0xa8,0x0,0xc8,0x35,0xe5, + 0x92,0x69,0xc8,0xa4,0xc3,0xd5,0x41,0x86,0x3e,0x83,0xcd,0xa5,0x9b,0x89,0x27,0xe2, + 0x9c,0x77,0x9e,0x67,0x6b,0xe9,0x56,0x72,0x4d,0xb9,0x40,0x32,0xe0,0xf4,0x4e,0xf6, + 0xb2,0x24,0x67,0x9,0x55,0xb6,0x2a,0x14,0x72,0x5,0xa,0x99,0x82,0x2a,0x5b,0x15, + 0x15,0xd9,0x15,0x54,0x64,0x57,0x20,0x20,0x30,0x38,0x35,0x88,0x4c,0x26,0xe3,0xb6, + 0xd,0xb7,0x91,0x99,0x9a,0x49,0x28,0x1a,0x22,0x45,0x95,0xc2,0xba,0xa2,0x75,0x68, + 0x55,0xda,0xe4,0x7e,0xa,0x5,0x5b,0xcb,0xb6,0xce,0xab,0x46,0x9a,0xa,0x4c,0xd1, + 0x3c,0xd6,0x8c,0x29,0xc5,0x84,0x4e,0xad,0xc3,0xa0,0x31,0x88,0x33,0x8a,0x48,0x3c, + 0xc2,0xf2,0x5,0xcb,0xd1,0xab,0xf5,0x2c,0xcd,0x5d,0xca,0x6c,0x68,0x96,0x91,0xe9, + 0x11,0x96,0xe7,0x2d,0x67,0xe7,0xc2,0x9d,0xe2,0x3b,0x1a,0xc1,0x68,0x90,0xfa,0xa1, + 0x7a,0x2c,0x6,0xb,0x2a,0xb9,0xa,0x8f,0xdf,0x83,0xdb,0xe7,0xe6,0x73,0xab,0x3e, + 0xc7,0xca,0x5,0x2b,0x29,0xcf,0x2a,0x27,0x41,0x82,0x81,0xa9,0x1,0xca,0x32,0xcb, + 0x58,0x99,0x9f,0xac,0xd4,0x52,0xca,0x95,0x18,0x34,0x6,0xae,0x2e,0xbf,0x9a,0x8a, + 0xec,0xa,0xdc,0x3e,0x37,0x85,0xe6,0x42,0xaa,0xed,0xd5,0x68,0x94,0x1a,0x6c,0x69, + 0x36,0xd6,0xd9,0xd7,0x49,0xef,0x70,0x48,0x24,0x92,0xff,0x55,0x64,0x82,0x20,0x7c, + 0x28,0xf9,0x13,0x41,0x10,0x8,0xc7,0xc2,0xa8,0x95,0xea,0xf,0xe5,0x85,0x3d,0x89, + 0x44,0x22,0x91,0x7c,0xf4,0x7c,0x68,0x41,0x43,0x22,0x91,0x48,0x24,0xff,0xfb,0x49, + 0x53,0x2,0x89,0x44,0x22,0x91,0x5c,0x36,0x29,0x68,0x48,0x24,0x12,0x89,0xe4,0xb2, + 0x49,0x41,0x43,0x22,0x91,0x48,0x24,0x97,0x4d,0xa,0x1a,0x12,0x89,0x44,0x22,0xb9, + 0x6c,0x52,0xd0,0x90,0x48,0x24,0x12,0xc9,0x65,0x93,0x82,0x86,0x44,0x22,0x91,0x48, + 0x2e,0x9b,0x14,0x34,0x24,0x12,0x89,0x44,0x72,0xd9,0xa4,0xa0,0x21,0x91,0x48,0x24, + 0x92,0xcb,0x26,0x5,0xd,0x89,0x44,0x22,0x91,0x5c,0x36,0x29,0x68,0x48,0x24,0x12, + 0x89,0xe4,0xb2,0xfd,0x3f,0x8,0x3c,0xf3,0x9e,0xc3,0x6d,0x39,0x4b,0x0,0x0,0x0, + 0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/line.png + 0x0,0x0,0x0,0x7f, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x34,0x49,0x44,0x41,0x54,0x48,0xc7,0x63,0x60,0x18,0xe4, + 0xe0,0xff,0x90,0x31,0xf8,0x3f,0x16,0x4c,0x75,0xc3,0x69,0x12,0x4,0xff,0x7,0x7d, + 0x84,0x8d,0x1a,0x3a,0x6a,0xe8,0x60,0x36,0xf4,0x3f,0xad,0x5c,0x4a,0xb3,0x82,0x84, + 0x26,0xa5,0xd4,0xd0,0x2a,0xb0,0x87,0xe,0x0,0x0,0x92,0xdb,0x1e,0xe2,0x74,0x4c, + 0xbf,0xf2,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/gotocell.png + 0x0,0x0,0x3,0xb, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x9d,0x49,0x44,0x41,0x54,0x48,0xc7,0xbd, + 0xd5,0xdf,0x4b,0x93,0x51,0x0,0xc6,0xf1,0xb7,0x75,0x3c,0xd9,0xdb,0x6c,0xb5,0x5a, + 0xac,0x21,0x41,0x86,0x68,0x94,0xb5,0x51,0xd1,0x92,0x6e,0x42,0x9,0xaa,0x2d,0x64, + 0xe4,0x22,0x8,0x56,0x52,0x54,0x44,0x28,0xc3,0x46,0xf3,0xc2,0x8b,0x2e,0x92,0xd, + 0xba,0x31,0x72,0x86,0x65,0x18,0x21,0x91,0x50,0x66,0x49,0x9a,0xa6,0x2d,0x4d,0x5, + 0x21,0x21,0x92,0xea,0xca,0xb,0x2f,0xea,0xa2,0x8b,0xfe,0x83,0xa7,0xe7,0x7d,0x39, + 0xa6,0xc4,0x19,0x69,0x58,0x83,0xf,0x63,0xbf,0xbe,0xe7,0x3d,0xe7,0x3d,0xef,0x3b, + 0x3,0x80,0xf1,0x2f,0x18,0xff,0x2d,0xcc,0x47,0x84,0x6,0xac,0xe7,0xe5,0xe,0xf, + 0x88,0xab,0x2,0xc6,0x4e,0xc3,0x7a,0x91,0xa1,0xad,0xb4,0x62,0x39,0xc2,0x90,0xd7, + 0x25,0x2,0xed,0x1,0x88,0x5a,0xe,0xe0,0xb3,0x7,0x48,0xd1,0xca,0xa5,0xc,0xa0, + 0xf,0xa7,0x24,0x66,0x7e,0xcc,0xa0,0x61,0xac,0x1,0xde,0x76,0x2f,0x8c,0x1a,0x3b, + 0x3e,0x45,0x17,0xc8,0xf1,0xf7,0xe1,0x9b,0x12,0x93,0xdf,0x26,0xd1,0x3d,0xd3,0x8d, + 0xf4,0x87,0x34,0x82,0xfd,0x41,0x88,0x36,0x1e,0x7d,0xc8,0x1e,0xe0,0x3e,0xed,0xfb, + 0xd3,0x0,0xfa,0xf0,0x2d,0x69,0x47,0x9b,0xa7,0x9b,0x11,0x7f,0x1f,0x47,0x64,0x3c, + 0x2,0x7f,0xd6,0xf,0xd7,0x90,0xb,0x22,0xcd,0x1,0xca,0xec,0x1,0xd2,0xe4,0xc9, + 0xb5,0x3c,0xfa,0x70,0x46,0xce,0x47,0x27,0x22,0x8,0xbe,0xb,0xa2,0x68,0xa4,0x8, + 0x9e,0xac,0x7,0x66,0xd6,0x84,0xcc,0x4a,0x18,0x49,0x63,0x6e,0xfd,0x93,0xd6,0xfa, + 0x2f,0x2e,0x7c,0x57,0xfe,0x3a,0xd2,0x85,0x51,0xe7,0x6b,0x27,0xe4,0xb,0x9,0xf1, + 0x58,0x40,0xc,0xb,0xc8,0x51,0xe,0x70,0xd6,0x8e,0xf,0xd3,0xc9,0x85,0xcb,0xa3, + 0xf,0x77,0x48,0x7d,0xb4,0x57,0x45,0x5b,0x5,0x1c,0x37,0x1c,0xb6,0xfc,0x9,0xbe, + 0xf7,0x86,0xcb,0x53,0x61,0xf,0x70,0x94,0xf2,0xac,0xe5,0xd1,0x87,0x3b,0x25,0x82, + 0xa3,0x8c,0xbe,0xcd,0x11,0x6d,0x62,0xb4,0xde,0x1,0x79,0x5e,0xc0,0x5b,0xe7,0x45, + 0xec,0x63,0xc,0x55,0x2f,0xab,0x60,0x16,0x9a,0x50,0xfb,0x7e,0x95,0x3e,0xdc,0x25, + 0x51,0x94,0x55,0xd1,0xc1,0x5,0xd3,0x57,0x51,0x51,0x2f,0xb0,0xa1,0xce,0x8d,0x50, + 0x6f,0x8,0x8d,0xb3,0x8d,0x8,0x44,0x3,0xd6,0xf,0x47,0xe9,0x12,0x6d,0x21,0xa7, + 0x3e,0xdc,0x2d,0xe1,0x19,0x66,0x74,0x80,0xd1,0xe7,0x8c,0x3e,0x9a,0x8f,0xba,0xeb, + 0xdd,0xa8,0x7c,0x56,0x89,0xe4,0xd7,0x24,0xc2,0xa9,0xb0,0xf5,0x83,0xef,0xd4,0x45, + 0x27,0xe8,0x20,0x6d,0xa3,0xb5,0xfa,0x30,0xa7,0xed,0xec,0x63,0xb4,0x87,0xd1,0x4e, + 0x46,0x33,0x2,0xee,0xa6,0x75,0xf0,0xb7,0xf9,0x11,0x9f,0x8d,0x23,0xda,0x1a,0x85, + 0xab,0xd0,0x65,0x7d,0xb9,0x8f,0x2e,0x53,0x35,0x55,0x50,0x19,0x6d,0x26,0x53,0x1f, + 0xee,0x97,0x90,0x4f,0x19,0x7d,0x28,0x50,0xd0,0x52,0x80,0xd2,0xdb,0xa5,0xa8,0x99, + 0xaa,0x41,0xed,0x58,0x2d,0x8a,0x2b,0x8b,0xad,0x2f,0x8d,0xd0,0x35,0x3a,0x45,0x47, + 0x68,0x3f,0x15,0xd3,0x26,0x5a,0x43,0x42,0x1f,0x1e,0x92,0x30,0x1f,0x98,0x28,0xb9, + 0x57,0x82,0xea,0x6c,0x35,0x12,0x9f,0x12,0x28,0xbf,0x58,0x6e,0x7d,0xf8,0x99,0xee, + 0xd0,0x69,0x3a,0xae,0xa6,0xbe,0x9d,0x7c,0xf6,0xf4,0xd,0x43,0xce,0x6d,0x39,0x7d, + 0x78,0x5c,0x22,0xfc,0x2a,0x8c,0xc4,0x97,0x4,0x42,0x4d,0xa1,0xb9,0x69,0x3f,0xa1, + 0x33,0xea,0xb6,0x7a,0x88,0x76,0xab,0x13,0xb5,0x9e,0xf2,0x7f,0xbf,0x48,0xf4,0xe1, + 0x69,0x89,0x58,0x47,0xc,0xbe,0x80,0xcf,0x7a,0xa3,0x87,0xae,0x50,0x94,0xe,0xd3, + 0x5e,0x75,0x82,0x36,0xda,0x6b,0x69,0x4d,0x5b,0x73,0x59,0xeb,0xc2,0x2d,0xae,0xa8, + 0x7d,0x84,0x9d,0x74,0x4e,0x4d,0xd9,0xda,0xf8,0x7,0xa8,0x84,0xbc,0xf6,0x76,0x52, + 0x17,0xc2,0x92,0xfe,0x9a,0xf8,0x38,0xa6,0xce,0xee,0x2e,0xda,0x43,0x3b,0xa8,0x90, + 0x5c,0xf6,0xe6,0x5f,0xc4,0xad,0x33,0x57,0x38,0x4f,0x9d,0xc,0xaf,0xe2,0xa6,0xd5, + 0xba,0x9b,0x4d,0x2e,0x3f,0x1,0xa0,0x16,0xc7,0x6f,0x31,0x3c,0x62,0xee,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/rightarrow.png + 0x0,0x0,0x2,0x9b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x2d,0x49,0x44,0x41,0x54,0x48,0xc7,0xdd, + 0x94,0xbf,0x6b,0x53,0x51,0x14,0xc7,0x3f,0xdf,0xfb,0x5e,0xda,0x94,0xda,0xe8,0xa2, + 0xd4,0x82,0x28,0x16,0x14,0x41,0xc1,0x2e,0x82,0xa8,0x43,0xab,0x58,0x7,0xf1,0xe7, + 0xe0,0x22,0x88,0x7f,0x81,0xb8,0x88,0xe0,0xaa,0xa3,0xab,0x50,0x44,0x8b,0xe0,0x20, + 0xed,0x10,0x41,0x4b,0xa4,0xe8,0xa2,0x6e,0x52,0x8a,0x5d,0x1c,0x74,0x50,0x14,0x52, + 0x8d,0x25,0xa0,0x49,0x4d,0x6b,0x93,0xe3,0xf0,0x6e,0xd3,0x97,0xbe,0x24,0xd5,0xa1, + 0x8b,0x17,0xbe,0xdc,0xf7,0xe0,0xbc,0xcf,0x3d,0xe7,0x7b,0xcf,0x3b,0x32,0x33,0xd6, + 0x63,0x39,0xd6,0x69,0xfd,0xc7,0x60,0x49,0xc7,0x25,0x65,0x25,0xd,0x4b,0x72,0x92, + 0xd4,0xf6,0x3,0x33,0xfb,0x2b,0x1,0xd9,0x4b,0x57,0x76,0xd8,0x86,0x8d,0x18,0x70, + 0x12,0xe8,0x0,0xd4,0x2a,0xfe,0x5f,0xac,0x38,0x33,0x70,0x70,0xb,0x83,0x67,0x45, + 0xaa,0x83,0x27,0xc0,0x1,0x20,0xd5,0x2a,0x73,0xb7,0xaa,0xdc,0x3b,0x92,0xac,0x99, + 0x0,0x42,0x41,0xff,0x5e,0x38,0x7a,0x4e,0xa4,0xbb,0x78,0x5,0x5c,0x68,0x5,0x57, + 0xbc,0x8f,0x25,0xd9,0xc8,0xd8,0x30,0xf3,0x95,0x39,0x14,0x80,0x0,0x9,0x9c,0x3, + 0xb9,0x80,0xca,0x62,0x91,0xe2,0x8f,0xf7,0x38,0x89,0xf,0xef,0x8c,0xec,0x3d,0xe3, + 0x57,0x99,0xc3,0xc0,0x1b,0xe0,0xb7,0xc5,0x60,0xe1,0xea,0x93,0x2a,0x95,0x39,0xf2, + 0x85,0xa9,0x18,0x10,0x9c,0xa2,0x5d,0x82,0xc0,0x81,0x9c,0xd1,0xbf,0x1b,0x86,0x4e, + 0x8b,0xdc,0x23,0x7b,0x5d,0xab,0x71,0x11,0x18,0x97,0x54,0x87,0x27,0x3c,0x76,0x2e, + 0x2a,0x39,0x14,0x84,0xe,0x52,0x1e,0x56,0x7f,0x77,0x90,0x2,0xba,0x3a,0xe1,0xc8, + 0x31,0x71,0xf9,0xaa,0xc8,0x6c,0xe2,0x21,0x70,0x2a,0x6e,0x4b,0x2,0x1c,0x28,0x52, + 0xe8,0x61,0x41,0x7c,0x77,0x10,0xb0,0x72,0x40,0x28,0x63,0xcf,0x3e,0x38,0x71,0x5e, + 0x74,0xa6,0x19,0x7,0x36,0x13,0x85,0x24,0xad,0x8,0xfc,0x25,0x39,0x2f,0xc5,0xe4, + 0x7c,0x45,0xce,0xdb,0x22,0x7,0xe5,0x32,0xf4,0xf6,0x2,0x91,0xbb,0xdd,0x1e,0xb1, + 0x14,0x36,0xcb,0x38,0xf4,0xde,0x6,0x5a,0x1,0x2c,0x7b,0xee,0x62,0x9e,0x97,0x4a, + 0x30,0x37,0xb,0x2f,0x27,0x8d,0x85,0x5,0x1e,0x3,0xf3,0x44,0x77,0x9e,0xcc,0xd8, + 0x79,0x2b,0xea,0x19,0x7b,0xd0,0x32,0x14,0xff,0x5c,0x2a,0x41,0x21,0xf,0xcf,0x27, + 0x8c,0x99,0x69,0x72,0xc0,0x6d,0x60,0x11,0xa8,0x35,0xb7,0x42,0x46,0x28,0x6b,0x84, + 0x2a,0x99,0xe9,0xf7,0x3c,0xbc,0x98,0x80,0x99,0x69,0x9e,0x1,0xb7,0x80,0xcf,0x3e, + 0xe3,0x6a,0x53,0xf0,0xb7,0xaf,0x53,0x7c,0xfa,0xd8,0xd8,0x62,0xce,0x41,0x5f,0x1f, + 0x64,0x32,0x50,0xfe,0x9,0x85,0x59,0x98,0x9c,0x80,0xb7,0x11,0xf4,0x26,0xf0,0x5, + 0x28,0x2,0x15,0x33,0xab,0x26,0x66,0x5,0x30,0xe2,0xaf,0xa1,0xa9,0xee,0x8e,0x62, + 0xd7,0x6f,0x60,0xfb,0x7,0x30,0x20,0x7,0x1c,0x2,0xb6,0x3,0x3d,0x40,0xd8,0xc0, + 0x5a,0x5,0xe,0x7d,0xd0,0x56,0x60,0x27,0xb0,0x2b,0x26,0xbb,0xff,0xa0,0xe,0x7d, + 0xda,0xe,0xda,0xc,0x2c,0xf,0x4f,0xfb,0xd6,0xe9,0x89,0x69,0x74,0x70,0x8,0x3, + 0xc6,0x80,0x81,0x76,0xd0,0x4,0x78,0x8d,0xb1,0xd9,0xd,0x5c,0x3,0xb6,0xf9,0x1f, + 0xa1,0x25,0xd4,0xcc,0x1a,0x87,0xd0,0x1a,0x83,0xde,0xf9,0x6a,0x2,0xdf,0x52,0x55, + 0x33,0x5b,0x6a,0x15,0xff,0x7,0xeb,0xb2,0x41,0x22,0xd1,0xb9,0xdc,0x7,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/frontview.png + 0x0,0x0,0x1,0xa7, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x6e,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xd1,0x91,0xc3,0x20, + 0xc,0x44,0x17,0x4f,0x9a,0x39,0x15,0xe4,0x22,0xae,0xa,0x55,0x91,0x22,0xa8,0xc2, + 0x55,0xe0,0x6e,0xcc,0x7d,0x18,0xf9,0x30,0xd8,0x20,0xd9,0xb9,0x64,0xe6,0xf6,0x27, + 0xe,0x63,0xd8,0x87,0x40,0x8a,0xe2,0x62,0x8c,0x11,0x1f,0xd4,0x3,0x0,0xe6,0x79, + 0x36,0x4d,0x22,0xf2,0xbb,0xef,0x21,0x8c,0x97,0xcc,0x89,0x8,0x83,0x7d,0x92,0x57, + 0x8d,0xf5,0x34,0x4d,0x13,0x0,0xd8,0x0,0xc4,0x28,0xdf,0xb1,0x3c,0x5f,0x81,0x30, + 0x1,0x1c,0x99,0xbf,0x2,0x42,0x5,0xd0,0x32,0xbf,0xb,0xd1,0x5,0xd0,0x98,0xd7, + 0x10,0xdf,0x6a,0x80,0x87,0x76,0x51,0xad,0xd6,0xf7,0xf5,0x73,0xba,0x0,0x22,0xf2, + 0xb4,0x1f,0x60,0x19,0x67,0xb5,0x59,0x18,0xc3,0x35,0x0,0x31,0xcf,0x17,0xb0,0x1c, + 0x4d,0x5,0x9f,0xa9,0x7f,0x7,0x3c,0x1d,0x92,0x6b,0xd5,0x9b,0xdf,0x8c,0x80,0x90, + 0x97,0x9f,0x0,0xd4,0x47,0xd0,0x83,0xef,0x5f,0xc2,0xb4,0x40,0xb9,0x13,0xcd,0x11, + 0xb4,0x42,0x2f,0x32,0x97,0xe2,0x57,0xeb,0xff,0x2,0x2c,0xcb,0xf2,0x59,0x80,0x61, + 0xd0,0x2d,0xad,0x2e,0x44,0x91,0x1,0xf0,0xef,0xa5,0xda,0xba,0x18,0x62,0x38,0x3e, + 0x9f,0xd7,0xbb,0x88,0xea,0x42,0x14,0x42,0xca,0x86,0xec,0xc7,0x26,0x4a,0x2e,0x32, + 0x1f,0x66,0x83,0x64,0x4e,0xab,0x16,0x98,0xa,0x51,0x69,0x3e,0x87,0x3a,0x2d,0x5b, + 0xf3,0x8f,0x54,0x45,0xe0,0x28,0xbf,0xb7,0x30,0x72,0x32,0x67,0xac,0x61,0xf7,0xb4, + 0x1e,0x5,0x73,0x7a,0x8f,0x2b,0x83,0x5b,0x85,0xa8,0xb5,0xf3,0x6d,0x59,0x4e,0x61, + 0xce,0xde,0x29,0x8f,0xa3,0x55,0xb4,0xd4,0xfd,0x40,0x6e,0x7e,0x8,0x9b,0x47,0xcc, + 0xd0,0x94,0x34,0x1,0xb4,0xe6,0x77,0x20,0x4e,0x1,0xb4,0xe6,0xe5,0xb8,0x15,0xa2, + 0x7b,0x4,0x9a,0x9d,0x97,0xb2,0x40,0x34,0x1,0x22,0x18,0xe,0xc,0x22,0x6f,0x6e, + 0x36,0xb5,0xad,0xdc,0x69,0x16,0x88,0xb9,0x55,0x56,0xd0,0xa,0x20,0x84,0x11,0x5f, + 0x44,0xfb,0x54,0xfb,0x43,0x55,0x0,0x62,0x7e,0x55,0xd6,0x2e,0x7a,0x3,0x90,0xff, + 0x6a,0xd3,0xf3,0x9,0xa4,0xe7,0x77,0xc8,0xc5,0x18,0xa3,0x73,0xee,0x6d,0x86,0xa5, + 0x7e,0x0,0x6e,0x71,0xcb,0xd1,0x36,0x96,0x2f,0xf6,0x0,0x0,0x0,0x0,0x49,0x45, + 0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/topview.png + 0x0,0x0,0x1,0x90, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x57,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xeb,0x8d,0xc3,0x20, + 0x10,0x84,0x7,0x2b,0xd5,0x50,0x90,0x8b,0x70,0x15,0x5b,0xf,0x55,0x50,0x5,0xee, + 0xc6,0x7b,0x3f,0x2e,0x1b,0x61,0xcc,0x63,0x97,0x58,0x67,0xe9,0x46,0xb2,0x94,0x60, + 0x96,0xf9,0x20,0x30,0xb1,0x1d,0x33,0x33,0x1e,0xd4,0xb,0x0,0xf6,0x7d,0x37,0x15, + 0x79,0x1f,0x4e,0xdf,0x19,0x84,0x3d,0x25,0xb3,0xb9,0xf7,0x1e,0x8b,0xbd,0x28,0x8c, + 0x3b,0x29,0x14,0x63,0x4,0x0,0x1b,0x80,0x98,0xa7,0xb4,0x7e,0xda,0xe4,0xf3,0x2c, + 0x98,0x1a,0xa0,0x66,0xde,0xea,0x73,0x3b,0x80,0xc6,0x7c,0x76,0x25,0x86,0x0,0x1a, + 0xf3,0x2b,0xc4,0xa6,0x6,0x78,0x69,0x7,0x2d,0xc5,0x20,0x38,0x50,0xb5,0xdd,0x72, + 0x22,0x86,0x0,0x22,0x1f,0xfc,0xb9,0x81,0x0,0x26,0x82,0xb,0x4,0x7e,0xdf,0x67, + 0x2,0x1c,0x1,0x28,0xfb,0xbe,0x95,0xd6,0x2b,0x98,0xa,0x40,0xcc,0xf3,0x1,0xbc, + 0xf,0x70,0xf8,0x85,0x0,0x0,0x26,0x60,0x4f,0x9,0xb5,0xb9,0x5f,0xe0,0x33,0x8d, + 0xf7,0x40,0xf0,0x55,0x72,0x91,0x2c,0x77,0x6b,0xd9,0x47,0xf5,0x8e,0x99,0xb9,0x95, + 0x84,0x3d,0x72,0xad,0xc4,0xbc,0x4,0x89,0x31,0x62,0xdb,0x36,0xc5,0x26,0x6c,0xc, + 0xa0,0xca,0x5,0xc5,0x4,0xcc,0x51,0x7c,0xb7,0xfe,0x2f,0xc0,0x71,0x1c,0xcf,0x2, + 0x2c,0x8b,0x6e,0x68,0x75,0x10,0x1,0xc5,0xa6,0x22,0x69,0x23,0x7d,0xcd,0x2c,0x40, + 0x7e,0x2,0x5a,0x7f,0x36,0xb5,0xd3,0x20,0x75,0xbd,0x2c,0x30,0x5,0x51,0x6e,0x9e, + 0xd2,0x7a,0x32,0x6d,0x81,0x99,0x83,0x28,0x3f,0xdf,0x77,0x6,0x51,0x29,0x55,0x10, + 0xb5,0x66,0x5e,0x53,0xaf,0x4f,0x2f,0xb4,0xd4,0xcf,0x3,0x3d,0xf3,0xf2,0x9e,0xe5, + 0xa1,0xa4,0xb,0xa0,0x35,0xff,0x6,0xa2,0x9,0x60,0x35,0x9f,0x85,0x18,0xfe,0x4, + 0x16,0xf3,0x19,0x8,0xd5,0x1e,0x90,0x6b,0x16,0xa2,0x27,0x53,0x12,0x6a,0x64,0x5, + 0xbd,0x0,0xcc,0x2c,0xf9,0x37,0xba,0x7d,0x5,0xac,0x13,0xf8,0x0,0xc8,0xbb,0xda, + 0x5f,0xcb,0x31,0x33,0x3b,0xe7,0x1e,0x31,0x7,0x80,0x1f,0x7e,0x31,0xc9,0xb8,0xa5, + 0x1d,0x85,0xc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/bringtofront.png + 0x0,0x0,0x1,0x25, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0xda,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0x94,0x41,0xe, + 0x82,0x30,0x10,0x45,0x1f,0x46,0x38,0x83,0x77,0xf0,0xfe,0x87,0xf0,0x1a,0x5e,0x40, + 0xb1,0xa5,0x74,0xa6,0x1a,0x5c,0xb4,0x4,0x8c,0xa2,0x11,0xca,0xc2,0xc4,0x49,0xd8, + 0xd0,0xe4,0xe5,0xf5,0xf7,0x67,0x8a,0xb2,0x2c,0x3b,0x16,0x4c,0x8,0xa1,0x78,0xf5, + 0x7f,0xb,0xa0,0xaa,0xb3,0xa0,0x55,0x55,0x4d,0x9e,0x6d,0x58,0x69,0xfe,0xe0,0x1f, + 0x6,0x6f,0x33,0x30,0xba,0x55,0xc0,0xdd,0xed,0xa,0x37,0xf,0xa1,0x5,0x75,0x20, + 0x96,0x62,0xb7,0xcf,0x60,0x1c,0x5c,0x82,0x36,0xa0,0x16,0xc4,0x66,0x8a,0x42,0xed, + 0x0,0xf5,0x16,0xe4,0x92,0x9,0x2c,0x97,0x68,0x29,0x26,0x7e,0x9a,0xcb,0xd8,0xd7, + 0xe0,0xcd,0x8,0xdc,0x64,0x2,0xbb,0xf3,0x60,0xaa,0x39,0xc1,0xed,0x39,0x41,0xfb, + 0xac,0xcd,0x0,0x7e,0xb7,0xfe,0x3e,0x67,0x5c,0xc7,0x8c,0x43,0x93,0xe2,0x48,0x19, + 0x4f,0x2d,0xea,0x57,0x95,0xed,0x8e,0x87,0x21,0x4b,0x49,0x96,0xbe,0x8e,0xa6,0x92, + 0x1a,0x31,0xeb,0xf1,0xfc,0x29,0x56,0xaa,0xef,0x6b,0xb0,0x20,0xc9,0x54,0x47,0xf, + 0xf8,0x35,0xb8,0x4d,0xd7,0x56,0x3,0xe2,0x20,0x98,0xc7,0xaa,0xf5,0xb7,0x98,0x5, + 0xd6,0xde,0xd4,0x3e,0xf7,0x57,0x1a,0xb8,0x3a,0x0,0x8a,0xa5,0xcb,0x66,0x6a,0xee, + 0x91,0x61,0xa9,0x66,0xc0,0xf,0xb5,0x5d,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/panview.png + 0x0,0x0,0x1,0x3e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x5,0x49,0x44,0x41,0x54,0x58,0x85,0xed,0x97,0xc1,0x11,0x83,0x20, + 0x10,0x45,0x3f,0x99,0x34,0x23,0x5d,0xa4,0x89,0x14,0xb1,0x5,0xd1,0x4e,0xa8,0x2, + 0xca,0xd9,0x1c,0x32,0x1a,0x9c,0x0,0xba,0xbb,0x62,0x2e,0xfe,0x8b,0x7,0x7,0xfe, + 0x13,0xfe,0xb2,0xe2,0x98,0x99,0xf1,0x47,0xdd,0x1,0x20,0xe7,0xac,0x1a,0xec,0x3d, + 0x21,0xa5,0xa0,0x36,0xf7,0xde,0xe3,0xa6,0x1f,0x4c,0xab,0xa7,0x54,0x31,0x46,0x0, + 0xd0,0x1,0x94,0x5f,0x9e,0x52,0x50,0x43,0xa8,0x0,0x6a,0xcb,0x6e,0x81,0x10,0x1, + 0xf4,0xf6,0x5c,0xb,0x21,0x2,0xd8,0xa,0x9c,0x26,0x90,0xea,0x10,0x1e,0xa5,0xb, + 0xa0,0x9,0xb0,0x27,0x50,0xcc,0xaf,0x31,0x0,0xd6,0x13,0xae,0x36,0xdf,0x6e,0x80, + 0xa3,0xcd,0x81,0x7e,0x89,0xae,0x0,0x46,0x98,0x6f,0x41,0x2c,0x0,0x23,0xcd,0x7b, + 0x10,0x8e,0x99,0xd9,0xb9,0x47,0x73,0x90,0x35,0x68,0xad,0xb9,0x43,0x78,0x82,0x88, + 0x3e,0x0,0x39,0x67,0xd5,0xa,0x4c,0xd3,0x24,0x6e,0xe5,0xb3,0x4f,0x8c,0x11,0x44, + 0xf4,0xdd,0x2,0x6b,0x57,0x93,0x98,0x97,0x5a,0x85,0x70,0x24,0x44,0x6b,0x85,0x7f, + 0xca,0x50,0x2,0xd1,0xcb,0xce,0x1e,0xf3,0x2a,0x80,0x14,0x62,0x8f,0x7a,0xd9,0x6a, + 0x1e,0xc5,0xa3,0x4b,0x72,0x13,0xe0,0x2c,0x5d,0x0,0xe2,0x7f,0x42,0xcb,0x7b,0x33, + 0x40,0xaf,0x3a,0xb4,0xbd,0x44,0xbc,0x5,0x35,0x8,0x4b,0x23,0x53,0x65,0xa0,0x84, + 0xb0,0x76,0x51,0x75,0x8,0xcb,0x9b,0x91,0x45,0x4b,0x37,0x9c,0xef,0x6a,0x67,0x6a, + 0x69,0xc7,0xce,0xb9,0xd3,0xcd,0x67,0xbd,0x1,0xea,0x17,0x9a,0x79,0x14,0x14,0x12, + 0xbe,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/rotate.png + 0x0,0x0,0x1,0xb2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x79,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xed,0x8d,0xc3,0x20, + 0xc,0x86,0x5f,0xa2,0x2e,0x13,0xeb,0xe6,0xc9,0x10,0x37,0x5,0xf3,0x30,0x45,0x87, + 0x38,0x39,0xdb,0x94,0xfb,0x91,0xc2,0x39,0x9,0x1f,0x36,0x4d,0xaf,0x96,0x22,0x91, + 0xf0,0xf1,0x3e,0x18,0x3,0x8e,0x8b,0x31,0x46,0x7c,0xd0,0x6e,0x0,0xb0,0xae,0xab, + 0xa9,0x13,0x51,0xd8,0xbd,0x33,0x2f,0x43,0xe2,0x44,0x84,0xc9,0xde,0x29,0xa8,0xbe, + 0xf5,0xec,0x7e,0xbf,0x3,0x80,0xd,0x20,0x9,0xc9,0x19,0xa7,0xf2,0x8,0x84,0x9, + 0xa0,0x24,0x7e,0x5,0x84,0xa,0xa0,0x25,0xfe,0x2a,0x44,0x17,0x40,0x23,0x7e,0x86, + 0xf8,0x56,0x3,0xdc,0xb4,0x83,0x6a,0x6d,0x6b,0xaf,0xef,0xd3,0xf4,0xc0,0x4c,0x64, + 0x12,0x1f,0xb1,0xae,0x7,0x4a,0x46,0x81,0x0,0x9f,0xca,0x5b,0x81,0x17,0x7e,0x3f, + 0x0,0x5,0xca,0x62,0xc7,0xd8,0x90,0x75,0x6f,0x1,0xa0,0x40,0xcd,0xc1,0x53,0x5d, + 0xaf,0xdd,0xd1,0x74,0xdb,0xd0,0x30,0x28,0x2f,0x9c,0xbd,0x71,0x9,0x80,0x75,0x46, + 0x9,0x42,0x1b,0xc0,0xe6,0xbb,0x40,0x63,0x33,0x11,0x9c,0xd7,0xed,0xa2,0x6e,0xc, + 0x44,0xf,0xc0,0xef,0x7,0x5a,0xb9,0xee,0x91,0x99,0x8,0x2b,0x33,0x7e,0x1e,0xf, + 0x38,0x7c,0x21,0x3e,0xdf,0x87,0x0,0x9c,0xb7,0x45,0xf5,0x2c,0xc4,0xa6,0x69,0xca, + 0xb0,0x73,0x3,0x62,0x68,0x9,0xe4,0x79,0x9f,0xca,0x2d,0x91,0x4,0x71,0x9,0x40, + 0x2d,0x1f,0x68,0xb9,0xb9,0x5,0x31,0x94,0xf,0x0,0xdb,0x1,0x24,0xef,0x9,0xcd, + 0x2d,0x58,0x82,0x3c,0x1,0x10,0x85,0xbf,0x53,0x4e,0xec,0xe9,0xa3,0x78,0xa9,0xbc, + 0x5b,0x1a,0xe5,0xf6,0x35,0xe5,0x3,0x47,0xc1,0x1e,0x84,0xfc,0x56,0xf3,0x50,0x1f, + 0xc0,0xfb,0xed,0xa9,0x88,0x17,0x21,0xc,0x87,0x57,0x13,0x20,0x53,0xb,0x88,0x96, + 0x31,0x2f,0xb9,0xad,0x36,0x33,0xaa,0x2,0x9c,0x2,0xee,0x19,0xf,0xb5,0x73,0x3e, + 0xd5,0xc9,0x99,0x6b,0x20,0x4c,0x19,0x91,0xbc,0xf1,0x4e,0xed,0x84,0x30,0xf3,0x92, + 0xc5,0x7b,0x10,0x5d,0x80,0x52,0x0,0x6a,0xd6,0x57,0x42,0xbc,0x4,0x60,0x35,0x6b, + 0x56,0x7c,0x2,0x18,0xfd,0xcd,0x1a,0xb5,0xcb,0x3d,0x60,0x9d,0x40,0x6,0x48,0xff, + 0x6a,0xff,0x6d,0x2e,0xc6,0x18,0x9d,0x73,0x1f,0x11,0x7,0x80,0x5f,0x7c,0x8e,0xd0, + 0xbd,0x3f,0xb0,0x8c,0xa7,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/bottomview.png + 0x0,0x0,0x1,0x91, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x58,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xfd,0x8d,0x83,0x30, + 0xc,0xc5,0x5f,0x50,0x97,0x39,0xf,0xc4,0x10,0x37,0x45,0xa6,0xe8,0x10,0x99,0x82, + 0x29,0x92,0x6d,0x70,0xff,0xe0,0x8c,0x2,0xe4,0xc3,0xe,0x48,0x95,0xee,0x49,0x55, + 0x4b,0x5a,0xfb,0xfd,0x12,0x27,0x2e,0x38,0x66,0x66,0x7c,0x51,0x2f,0x0,0x48,0x29, + 0x99,0x82,0x88,0xc2,0xe1,0x3a,0xc6,0x79,0xc8,0x9c,0x88,0x30,0xd9,0x83,0x82,0x6a, + 0xac,0xa7,0x65,0x59,0x0,0xc0,0x6,0x20,0x46,0xf9,0x8c,0xe5,0xf3,0x8,0x84,0x9, + 0xa0,0x64,0xfe,0x4,0x84,0xa,0xa0,0x65,0x7e,0x17,0xa2,0xb,0xa0,0x31,0xbf,0x42, + 0xfc,0xaa,0x1,0x5e,0xda,0xa4,0x5a,0x6d,0xbf,0xd7,0xc7,0x74,0x1,0x44,0x14,0xe8, + 0x38,0xe0,0x65,0xdc,0xab,0xcd,0xe2,0x1c,0xc7,0x0,0xc4,0x3c,0x4f,0x60,0x29,0xcd, + 0x5,0x3e,0x53,0x7f,0xf,0x4,0x2a,0x92,0x6b,0xd5,0x8b,0x6f,0xae,0x80,0x90,0x9f, + 0xdf,0x1,0xa8,0x4b,0xd0,0x83,0xef,0x6f,0xc2,0xbf,0x4,0xe7,0x99,0x68,0x4a,0xd0, + 0x5a,0x7a,0x91,0xb9,0x15,0x3f,0xad,0xff,0xb,0xb0,0xae,0xeb,0x77,0x1,0xa6,0x49, + 0x97,0x5a,0xdd,0x88,0x80,0xb1,0x53,0xd0,0xdb,0x88,0xea,0x46,0xb4,0x9f,0x86,0xca, + 0x9f,0x4d,0xe9,0x34,0x48,0x5c,0xab,0x17,0x98,0x1a,0x51,0x6e,0x1e,0xe3,0x7c,0x30, + 0xad,0x81,0x99,0x1b,0x51,0xe9,0x7c,0xef,0xcb,0xe8,0xf3,0xc4,0xdb,0x5,0x3,0x70, + 0xfe,0x38,0x96,0xeb,0x56,0x23,0xaa,0xcd,0x5c,0xf4,0x43,0x1b,0x18,0x7b,0xc0,0x65, + 0x74,0xe7,0x72,0xb4,0x9a,0x96,0xfa,0x7e,0xa0,0x64,0x9e,0xe2,0x6,0x98,0x62,0x4, + 0x67,0x0,0x96,0x9b,0x92,0x26,0x80,0xc6,0x5c,0x34,0xa,0x51,0x5,0xb0,0x98,0xdf, + 0x81,0xe8,0x96,0xe0,0x5c,0xb7,0x9a,0x79,0xfe,0xbd,0xe6,0x74,0xa8,0x1,0x88,0xc2, + 0xfe,0xb2,0x48,0x7b,0x2b,0x67,0xea,0x84,0x1a,0x59,0x41,0x2f,0x0,0xa3,0x8f,0x59, + 0xa3,0x7a,0x7c,0x5,0xac,0x13,0xd8,0x1,0xe4,0x59,0xcd,0xaa,0xe5,0xfd,0x6,0x6, + 0x63,0x1,0xc0,0x31,0x33,0x3b,0xe7,0x86,0x13,0xdc,0xd5,0x7,0x6b,0x1c,0xc0,0xfc, + 0x74,0x7,0x1b,0xfe,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + + // /home/grosse/Workarea/mccwb/src/QMcCad/images/decompose.png + 0x0,0x0,0x4,0x28, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xd6,0x0,0xd6,0x0,0xd6,0x19,0x42, + 0xf,0xe5,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x1c,0x9,0x1c,0x33,0x8b,0x80,0x7d,0xc1,0x0,0x0,0x3,0xb5,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0xdf,0x2b,0xbb,0x51,0x1c,0xc7,0xdf,0xcf,0xcc,0x33, + 0x4c,0xe2,0x59,0xa2,0xb5,0x1b,0x33,0x6b,0x9b,0x1f,0x37,0x94,0x9a,0x89,0x22,0x19, + 0x9a,0xb,0x25,0x2e,0xd4,0xf2,0x7,0x90,0x92,0x5a,0xa,0xa1,0x2c,0x97,0xae,0xb5, + 0x72,0x83,0x8b,0x15,0x8a,0xb,0x51,0x9b,0x94,0xb,0x72,0xe1,0xe6,0xc1,0x94,0x2b, + 0x66,0x7e,0xc,0x13,0xb6,0x87,0x6c,0xdf,0x8b,0x6f,0xdf,0x8b,0x6f,0x3b,0x8f,0x7d, + 0xe7,0x3b,0x3c,0xc7,0xb9,0x7c,0x7f,0xce,0x39,0xcf,0xf3,0x7a,0xce,0xe7,0x9c,0xe7, + 0x73,0x3e,0xe7,0x30,0x3c,0xcf,0xc7,0xf0,0x3,0x8a,0xec,0x27,0x40,0x78,0xbd,0x5e, + 0xc8,0x13,0x55,0x32,0x99,0x4c,0xc9,0x7d,0x19,0x99,0xc,0x2c,0xcb,0x82,0x65,0x59, + 0x64,0x65,0x65,0x81,0xe3,0x38,0xa8,0x54,0x2a,0xa8,0xd5,0x6a,0x14,0x15,0x15,0x41, + 0xa7,0xd3,0xa1,0xac,0xac,0xc,0x39,0x39,0x39,0x29,0x85,0x91,0xa7,0xfa,0xeb,0x44, + 0xa3,0x51,0x44,0x22,0x11,0x44,0x22,0x11,0x3c,0x3c,0x3c,0x20,0x10,0x8,0xc4,0xd5, + 0x61,0x18,0x6,0x25,0x25,0x25,0xb0,0x58,0x2c,0xb0,0x5a,0xad,0x28,0x2d,0x2d,0xfd, + 0xef,0xe7,0x32,0x89,0xe6,0x48,0xb2,0x23,0xf2,0x91,0xa2,0xd5,0x6a,0x61,0xb7,0xdb, + 0x61,0xb3,0xd9,0xc0,0xb2,0xec,0x87,0x5c,0x4b,0x12,0x73,0xe4,0xf4,0xf4,0x14,0x23, + 0x23,0x23,0x68,0x69,0x69,0xc1,0xe6,0xe6,0xe6,0xd7,0xb9,0x56,0x61,0x61,0x21,0xaa, + 0xab,0xab,0xdf,0x75,0x2f,0x41,0x10,0xf0,0xfc,0xfc,0x8c,0x60,0x30,0x88,0xcb,0xcb, + 0x4b,0xdc,0xde,0xde,0x26,0xec,0xd7,0xef,0xf7,0xa3,0xaf,0xaf,0xf,0xad,0xad,0xad, + 0x18,0x1f,0x1f,0x47,0x66,0x66,0xe6,0xe7,0x82,0x98,0x4c,0x26,0x4c,0x4d,0x4d,0x25, + 0xd5,0xe6,0xee,0xee,0xe,0x87,0x87,0x87,0xd8,0xdb,0xdb,0x83,0xd7,0xeb,0xc5,0xf1, + 0xf1,0xb1,0x68,0xdd,0xb5,0xb5,0x35,0x9c,0x9c,0x9c,0xc0,0xe5,0x72,0x81,0xe3,0x38, + 0x69,0x2d,0xbf,0x79,0x79,0x79,0x30,0x9b,0xcd,0xe8,0xef,0xef,0xc7,0xd2,0xd2,0x12, + 0x96,0x97,0x97,0x61,0xb3,0xd9,0x20,0x93,0x91,0x5f,0xc1,0xe7,0xf3,0xa1,0xb7,0xb7, + 0x17,0xa1,0x50,0x48,0xda,0xff,0x11,0xbd,0x5e,0xf,0xa7,0xd3,0x9,0xb7,0xdb,0xd, + 0xa3,0xd1,0x28,0xa,0xe3,0x70,0x38,0x10,0x8b,0xc5,0xa4,0xb,0xf2,0xa7,0x18,0xc, + 0x6,0xcc,0xcf,0xcf,0xc3,0x6a,0xb5,0x8a,0xae,0x48,0x8b,0x8b,0x8b,0x74,0xfc,0xd9, + 0x15,0xa,0x5,0xa6,0xa7,0xa7,0xd1,0xd0,0xd0,0x40,0xb4,0xcf,0xcc,0xcc,0x24,0x74, + 0x31,0xc9,0x84,0x28,0x69,0x69,0x69,0x70,0x3a,0x9d,0xd0,0x68,0x34,0x71,0xb6,0x50, + 0x28,0x84,0xb9,0xb9,0x39,0x7a,0x62,0x2d,0xa5,0x52,0x89,0xd1,0xd1,0x51,0xa2,0xcd, + 0xed,0x76,0xe3,0xf5,0xf5,0x95,0x9e,0xa0,0xb1,0xa6,0xa6,0x6,0x95,0x95,0x95,0x71, + 0xfa,0xcd,0xcd,0xd,0xb6,0xb7,0xb7,0xe9,0x8a,0x7e,0xbb,0xba,0xba,0x88,0xba,0xc7, + 0xe3,0xa1,0xb,0xa4,0xb1,0xb1,0x11,0xa,0x85,0x22,0x4e,0xdf,0xd9,0xd9,0xa1,0xb, + 0x44,0xa1,0x50,0xa0,0xaa,0xaa,0x2a,0x4e,0xbf,0xb8,0xb8,0x10,0xd,0x75,0x24,0xbb, + 0xb1,0xaa,0xa8,0xa8,0x20,0xea,0x3c,0xcf,0xd3,0x5,0x62,0x30,0x18,0x88,0xfa,0xd9, + 0xd9,0x19,0x5d,0x20,0x6a,0xb5,0x9a,0xa8,0x5f,0x5d,0x5d,0xd1,0x5,0x92,0x9f,0x9f, + 0x4f,0xd4,0x83,0xc1,0x20,0x5d,0x20,0x4a,0xa5,0x92,0xa8,0xb,0x82,0x40,0x17,0x48, + 0x46,0x46,0x6,0x51,0x8f,0x44,0x22,0x74,0x81,0x44,0xa3,0x51,0x72,0x92,0x81,0x61, + 0xe8,0x2,0x79,0x79,0x79,0x11,0xfd,0xc7,0x50,0x5,0xf2,0xf8,0xf8,0x98,0x94,0xcb, + 0x49,0x16,0x44,0x6c,0x99,0x55,0xa9,0x54,0x74,0x81,0x9c,0x9f,0x9f,0x8b,0x66,0x70, + 0xa8,0x2,0x11,0xcb,0xb2,0x90,0x36,0x5e,0x92,0x6,0x39,0x38,0x38,0x20,0xea,0x62, + 0x89,0xa,0x49,0x82,0x84,0xc3,0x61,0xec,0xef,0xef,0x13,0x47,0x23,0x37,0x37,0x97, + 0x1e,0x90,0x8d,0x8d,0xd,0xe2,0xb6,0xd6,0x62,0xb1,0xd0,0xb5,0x1f,0x59,0x58,0x58, + 0x20,0xea,0xf5,0xf5,0xf5,0xf4,0x80,0x6c,0x6d,0x6d,0x11,0xe7,0x47,0x41,0x41,0x1, + 0xcc,0x66,0x33,0x1d,0x20,0x4f,0x4f,0x4f,0x98,0x98,0x98,0x20,0xda,0x3a,0x3b,0x3b, + 0x21,0x97,0xcb,0xa5,0xf,0xf2,0xf6,0xf6,0x86,0xa1,0xa1,0x21,0xf8,0xfd,0xfe,0x38, + 0x1b,0xc7,0x71,0xe8,0xe9,0xe9,0x79,0xb7,0xbd,0x24,0x40,0x4,0x41,0xc0,0xe0,0xe0, + 0xa0,0x68,0x96,0x64,0x60,0x60,0x0,0xd9,0xd9,0xd9,0xd2,0x6,0xe1,0x79,0x1e,0xdd, + 0xdd,0xdd,0x58,0x5f,0x5f,0x27,0xda,0x9b,0x9a,0x9a,0xd0,0xd1,0xd1,0x91,0xb0,0x1f, + 0xf9,0x77,0x1,0xf8,0x7c,0x3e,0xb8,0x5c,0x2e,0xac,0xae,0xae,0x8a,0x86,0xec,0x46, + 0xa3,0x11,0x93,0x93,0x93,0xff,0xd4,0xdf,0x97,0x81,0xdc,0xdf,0xdf,0xe3,0xe8,0xe8, + 0x8,0xbb,0xbb,0xbb,0xf0,0x78,0x3c,0xef,0x1e,0xf4,0x0,0xbf,0xf,0x93,0x66,0x67, + 0x67,0x13,0xba,0xd4,0x7f,0x81,0xf0,0x3c,0xf,0x87,0xc3,0x21,0x6a,0x8f,0xc5,0x62, + 0x10,0x4,0x1,0xe1,0x70,0x18,0xd7,0xd7,0xd7,0xff,0x7c,0xf4,0xf6,0xa7,0xb4,0xb7, + 0xb7,0x63,0x6c,0x6c,0x4c,0x74,0xef,0x91,0x32,0x90,0x40,0x20,0x80,0x95,0x95,0x95, + 0x94,0x8f,0x9a,0x46,0xa3,0xc1,0xf0,0xf0,0x30,0xea,0xea,0xea,0x92,0x6e,0x2b,0x97, + 0xc2,0xaa,0xa5,0xd3,0xe9,0x60,0xb7,0xdb,0xd1,0xd6,0xd6,0xf6,0xa1,0xe3,0xe9,0x6f, + 0x3,0x61,0x18,0x6,0x7a,0xbd,0x1e,0xb5,0xb5,0xb5,0x68,0x6e,0x6e,0x4e,0xc9,0x59, + 0xbe,0xfc,0x33,0x5e,0x32,0x3d,0x3d,0x1d,0x2c,0xcb,0x42,0xa9,0x54,0xfe,0x75,0x85, + 0x43,0xab,0xd5,0xa2,0xb8,0xb8,0x18,0xe5,0xe5,0xe5,0x5f,0x7f,0x85,0x43,0x2c,0xd7, + 0x2a,0xb5,0xf2,0x23,0x6e,0x7,0xfd,0x35,0x22,0x5e,0xaf,0x97,0x6a,0x90,0x1f,0x33, + 0x22,0xbf,0x0,0xcb,0xfd,0x3d,0xba,0x1b,0xa5,0x61,0xe6,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/openNew.png + 0x0,0x0,0x5,0x53, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x5,0x8,0x9,0x2f,0x7,0xbc,0x44,0x5,0x3c,0x0,0x0,0x4,0xe0,0x49,0x44, + 0x41,0x54,0x38,0xcb,0x95,0x95,0x5b,0x6c,0x14,0x55,0x1c,0xc6,0x7f,0x67,0x76,0xbb, + 0xbb,0x6d,0xb7,0xb7,0x5d,0xba,0xdb,0x2b,0x16,0xba,0x2b,0xdb,0x96,0xba,0x40,0xad, + 0x85,0x5a,0x2a,0x48,0x0,0x51,0x4,0x43,0x48,0x94,0xf8,0x80,0xc1,0x18,0xc3,0x8b, + 0x36,0xe1,0x9,0x9,0x89,0x3e,0xa8,0x3c,0xf1,0x66,0xaa,0x31,0x12,0x6a,0x51,0x34, + 0x80,0x1,0x4,0x49,0xb9,0x47,0x45,0xc,0x50,0x6c,0x4b,0xd3,0x42,0x5b,0x28,0x2d, + 0xbd,0x6d,0xb7,0xf4,0x46,0x28,0xdb,0xdd,0x39,0x73,0x7c,0x60,0xba,0xa9,0xd,0x2f, + 0x4e,0xf2,0xe5,0xe4,0x64,0x66,0x7e,0xdf,0xff,0xfc,0x67,0xce,0x77,0x84,0x52,0x8a, + 0xd9,0x97,0x10,0x42,0x3,0x2c,0x73,0x24,0xcc,0xdb,0x72,0x96,0xc,0x53,0xa,0x40, + 0xcd,0x5,0x29,0xa5,0xe2,0x32,0x1,0x61,0xe0,0x5b,0x20,0x1f,0x18,0x30,0x5f,0xbc, + 0x4,0x4,0x80,0xec,0x88,0xa,0xaa,0x88,0xa,0x2a,0x20,0x19,0x48,0x4,0xec,0xe6, + 0xdc,0x6a,0x16,0xa1,0xcd,0x14,0x22,0x4c,0x69,0xc0,0xed,0xfa,0xfa,0x7a,0xb5,0x6b, + 0xd7,0x2e,0x15,0x28,0xe,0x18,0x75,0x87,0xea,0x54,0x6b,0x6b,0xab,0xaa,0x5e,0x5f, + 0x15,0x5,0x1e,0x2,0x9f,0xcd,0x2,0x7b,0x1,0x37,0x90,0x61,0xce,0x9d,0xa6,0x91, + 0xd,0xb0,0xa,0xd3,0x69,0xc6,0x25,0x72,0xe2,0xf8,0x71,0x72,0x72,0x73,0x89,0x46, + 0xa3,0xd4,0xd6,0xd6,0x92,0x9e,0x9e,0x4e,0x62,0x72,0x22,0xb,0x2,0x5,0x34,0x9c, + 0x6b,0xe0,0xe7,0x1f,0x7a,0x70,0x88,0xe6,0x5f,0x22,0x2a,0xb8,0xc5,0x21,0x9a,0xff, + 0x2,0x1c,0x11,0x15,0x5c,0xe6,0x10,0xcd,0xd9,0x40,0x6c,0x46,0x1a,0x90,0x0,0xac, + 0x0,0x32,0x0,0xc2,0xa1,0x10,0xa3,0xe1,0x30,0x9a,0x10,0xd4,0xd4,0xd4,0x50,0x55, + 0x55,0x85,0x86,0xc6,0xc5,0xd3,0x97,0x78,0x63,0xcd,0x46,0x0,0xb2,0xf3,0xb3,0xb7, + 0x0,0xd4,0x1d,0xa9,0xab,0xac,0xd9,0xf3,0xf1,0x32,0xb3,0xab,0xc7,0x80,0xea,0x99, + 0xca,0x2d,0xc0,0x37,0xc0,0x7e,0xe0,0x2d,0xc0,0xbd,0xa8,0xa0,0x80,0xfe,0x7b,0xf7, + 0x50,0x52,0x62,0xb5,0xd9,0xf0,0x78,0xbd,0x2c,0x2e,0x2d,0xa5,0xa8,0xb8,0x88,0x8b, + 0x17,0x2e,0xb2,0x61,0x63,0x1f,0x4a,0xbc,0x8f,0x62,0x7,0x1b,0xd6,0x7d,0x4a,0xa6, + 0x7b,0x37,0x59,0x59,0xa7,0x68,0x6a,0x7b,0x31,0xbf,0xa3,0xad,0x73,0x2b,0x30,0x5, + 0xb4,0x5a,0x80,0x13,0x27,0xaf,0x1e,0xd7,0xa,0x8b,0xa,0xdd,0x9d,0xed,0x5d,0x44, + 0x23,0xd1,0xe9,0x6b,0x97,0x2f,0x5b,0x26,0x46,0x46,0xc4,0xf4,0xd4,0x14,0x0,0x9, + 0x76,0x3b,0xa9,0xa9,0xa9,0x94,0x97,0x97,0xe3,0xc9,0x39,0x49,0xfd,0x77,0x76,0xae, + 0x37,0xde,0x60,0xf3,0xe6,0x61,0x7a,0x86,0xd7,0x91,0xe7,0x3d,0x83,0xcf,0xbf,0x8f, + 0xe5,0xdb,0x2a,0xb4,0x5f,0xf,0x9e,0x5a,0x1,0x1c,0xb0,0x2,0x11,0x47,0x62,0xa2, + 0xe3,0x9d,0xed,0x6f,0x93,0xe1,0xce,0xa0,0xe1,0xe4,0x59,0xbb,0x1a,0x73,0x19,0x4f, + 0x94,0x12,0x47,0xf,0x1f,0x26,0x10,0x8,0x50,0x5a,0x56,0x46,0x61,0x71,0x31,0x59, + 0x79,0x79,0x0,0xec,0xfc,0x70,0x27,0x9d,0x5d,0x9d,0xec,0xf9,0x24,0x8b,0xcf,0xbf, + 0xf8,0x8,0x80,0xd0,0xd4,0x10,0xcb,0xaa,0x97,0x62,0x7e,0xbc,0x24,0xb,0x70,0x26, + 0x29,0x35,0xe9,0x83,0x8a,0xaa,0x97,0x84,0x2f,0xe0,0x63,0xe5,0x9a,0x95,0x64,0xe7, + 0x79,0x45,0xe8,0xd1,0x28,0x22,0x25,0x99,0x91,0xc1,0x30,0x4d,0xd7,0xae,0x31,0x19, + 0xe,0x13,0x9d,0x9e,0x66,0x78,0x60,0x13,0x9,0x36,0x1b,0x5e,0xaf,0x97,0x17,0x16, + 0x7,0xe9,0xba,0xb3,0x9a,0xdd,0x7b,0xef,0xd1,0x71,0xb7,0x83,0x25,0xd5,0x41,0xe, + 0x7c,0x79,0x10,0xa0,0xde,0x2,0x24,0x34,0x5e,0x69,0xc,0xfa,0x4a,0x7c,0xb,0x17, + 0x14,0x16,0x20,0x84,0x46,0x5e,0x41,0x3e,0xcb,0xab,0x2a,0x48,0xcf,0x48,0xe3,0xc1, + 0xf0,0x30,0xb9,0xbe,0x5,0x3c,0x1c,0x1d,0xe5,0xef,0x8b,0x97,0x19,0xd,0x85,0x90, + 0xb1,0x18,0x9a,0x10,0x24,0xd8,0x6c,0x24,0x39,0x9d,0x54,0x57,0x56,0xd3,0x37,0xde, + 0x4b,0xae,0x3f,0x87,0x43,0xfb,0x7f,0x4,0x38,0x64,0x1,0xec,0xc0,0xb4,0x54,0xc6, + 0xeb,0xab,0xd7,0xaf,0xb2,0xa0,0x14,0x86,0x94,0x18,0xd2,0x20,0x33,0xcb,0x43,0xe5, + 0x2b,0x2b,0x10,0x76,0x8d,0xf0,0xc4,0x18,0x31,0x9b,0x95,0x50,0xdf,0x20,0x4d,0x37, + 0x6e,0xf0,0x78,0x74,0x14,0xa1,0x69,0xa4,0xb9,0x5c,0xd8,0x1d,0xe,0x5a,0x6e,0xb7, + 0x30,0x6f,0xbe,0x9b,0xa3,0x5f,0x1f,0x8b,0x83,0x6d,0xc0,0xc0,0xc0,0x83,0x81,0x4d, + 0xbe,0x92,0x42,0x77,0x7e,0xc1,0x7c,0xa4,0x34,0x90,0x52,0x62,0x18,0x12,0x29,0x25, + 0x99,0x1e,0xf,0x4b,0xcb,0x97,0x90,0xbf,0x70,0x3e,0x3d,0x3,0x3,0x78,0x9f,0xcb, + 0x65,0x38,0x34,0x42,0x4b,0xe3,0x4d,0xfc,0x7e,0x3f,0xae,0xcc,0x4c,0x3a,0xee,0x76, + 0x90,0x38,0x2f,0x91,0x53,0xdf,0x9f,0x8e,0x83,0xad,0x80,0xa6,0xc7,0xf4,0x96,0x98, + 0x1e,0xdb,0xb6,0xfa,0xb5,0xd5,0x42,0xea,0x3a,0x52,0x1a,0xe8,0x52,0x22,0x75,0xe3, + 0xa9,0x81,0x6e,0xe0,0x4c,0x49,0xa6,0x6c,0x79,0x19,0x9,0xe,0x1b,0x43,0x63,0xa3, + 0x3c,0x96,0x31,0x22,0x8f,0x1e,0xe1,0xf7,0x2f,0xa2,0x7f,0x68,0x10,0xe9,0xd0,0x39, + 0x7f,0xf4,0x42,0xbc,0xc7,0x33,0x5b,0x7a,0xbc,0xbb,0xe3,0xfe,0xba,0xe2,0xa5,0x45, + 0x9e,0xec,0xdc,0x1c,0xa4,0xd4,0x91,0xba,0x8c,0x8f,0x4f,0xab,0x37,0x90,0xd2,0x20, + 0xc3,0x95,0x4e,0x49,0xb0,0x4,0xdf,0xa2,0x42,0x6,0xc3,0x23,0xd8,0xd,0xd,0xa9, + 0x14,0x93,0x72,0x82,0x3f,0x7f,0xbb,0x12,0x7,0x6b,0xb3,0xe0,0xa7,0xdb,0x9a,0xda, + 0x36,0xf4,0x74,0xf7,0xa4,0x65,0xe5,0x78,0x85,0x33,0xc5,0x89,0x94,0x12,0x69,0x18, + 0xf1,0xd1,0xd0,0x9f,0xb6,0xc7,0xd0,0x25,0x56,0x9b,0x95,0x9e,0xbe,0x5e,0x1e,0xf6, + 0x85,0xf1,0x66,0xe5,0xd2,0x3f,0xd6,0x4f,0xe3,0xe5,0xc6,0x38,0x98,0xd9,0xb1,0x38, + 0x39,0x3e,0x79,0xe4,0xce,0xad,0x3b,0xcd,0x7f,0x5c,0xf8,0xbd,0x72,0x7c,0x72,0x22, + 0xc9,0x6a,0xb1,0x8,0xb7,0xdb,0x85,0x94,0x6,0x86,0xae,0xa3,0xc7,0x2b,0x97,0x48, + 0x5d,0x62,0x73,0xd8,0xe8,0x1f,0xea,0xc7,0xeb,0xca,0xe6,0x6e,0x7f,0x17,0x6d,0xd7, + 0xdb,0xfe,0x3,0xc6,0x8c,0x47,0x65,0x66,0xec,0xe0,0x93,0xa9,0xc8,0x4f,0x6d,0xff, + 0xb4,0x19,0x2d,0x37,0x6f,0x79,0x7a,0x7b,0x7a,0xd3,0xdd,0xf3,0xdc,0x38,0x53,0x9c, + 0x48,0xdd,0x40,0x4a,0x1d,0x5d,0xd7,0x91,0x86,0xc4,0x9e,0x60,0xa3,0xa9,0xe9,0x16, + 0xbe,0xf9,0x3e,0x5a,0xda,0x9b,0xe9,0x6e,0xbf,0xf,0x50,0x2f,0x94,0x52,0x8,0x21, + 0x84,0x99,0xa5,0x56,0xf3,0x2f,0x71,0x98,0x11,0x98,0x64,0x6a,0x55,0x5a,0x7a,0xda, + 0xde,0x97,0xd7,0x56,0xa6,0x96,0x96,0x95,0xa,0x9f,0xbf,0x10,0x5d,0x7f,0x5a,0xb1, + 0xae,0xeb,0x4c,0x3d,0x7e,0xcc,0xd8,0xf0,0x38,0x67,0x1b,0x1a,0x68,0xbe,0x7a,0xb, + 0x60,0x9d,0x98,0x9,0xfe,0x59,0x70,0x8b,0x99,0x78,0xb6,0x67,0x98,0x6c,0x77,0x79, + 0x5c,0x5b,0x9f,0x2f,0xf1,0x67,0x57,0xaf,0xad,0x26,0x37,0x2f,0x7,0x29,0x25,0xb1, + 0x98,0xce,0xf9,0x33,0xe7,0x68,0x6f,0x6a,0xa7,0xaf,0x7b,0x0,0xe0,0x55,0x31,0xfb, + 0x44,0x31,0xe1,0x73,0xd,0x12,0xcc,0x4d,0x34,0x63,0x90,0x8,0xbc,0x97,0xe4,0x4c, + 0x7a,0x77,0x49,0x45,0x30,0xbd,0xa8,0x34,0x20,0xfc,0x8b,0xfc,0x84,0x42,0x21,0xbe, + 0xda,0x57,0x4b,0x34,0x12,0x5,0x58,0x29,0xe6,0x1e,0x55,0xb3,0xc,0x34,0x53,0x56, + 0x53,0x73,0xd,0x9c,0xc0,0x9b,0xc0,0xe,0xc0,0x63,0x3e,0x3,0x30,0x1,0xac,0x79, + 0x26,0xf8,0x7f,0x18,0xcc,0xc8,0x66,0xae,0xd0,0x0,0xa2,0xc0,0xd4,0xbf,0xce,0x54, + 0x3a,0x62,0x8e,0xb3,0x36,0x54,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42, + 0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/dzoom.png + 0x0,0x0,0x1,0xa8, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x6f,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xdb,0x75,0xc3,0x20, + 0xc,0x86,0x45,0x4f,0x67,0xc8,0xe,0xd6,0x12,0xb5,0x97,0xc8,0x10,0x99,0x82,0x29, + 0x32,0x44,0x97,0x30,0x5d,0x2,0xef,0x90,0x25,0x94,0x7,0x22,0x9b,0x8b,0x31,0x37, + 0xbb,0xe8,0x25,0x39,0x40,0xac,0xcf,0xbf,0x6e,0x44,0x10,0x11,0x41,0x47,0xfb,0x6, + 0x0,0x58,0x96,0xa5,0x8b,0x73,0x44,0x84,0xaf,0x96,0x7,0xc,0xc3,0x50,0xfd,0x5b, + 0xa5,0x14,0x0,0x7c,0x14,0xb8,0xc2,0xf0,0x17,0xd7,0xef,0xfa,0xae,0xa3,0xe7,0x9a, + 0x14,0x38,0xc3,0x92,0xa,0x20,0x3e,0x82,0x35,0xad,0x9f,0xd7,0x3,0x6c,0x8e,0x65, + 0x74,0x8f,0x68,0x76,0xd7,0x2d,0xd9,0x63,0xeb,0x7e,0x38,0x2,0x0,0xdf,0x31,0xd1, + 0x4f,0xf0,0x40,0x21,0xe4,0xe7,0xf3,0xf,0x0,0x64,0x93,0x22,0xe,0x80,0x71,0x1e, + 0x77,0xcc,0xc6,0x7b,0xc,0x80,0xf8,0xa8,0x86,0xf0,0x14,0x48,0x3b,0xf7,0x41,0xc, + 0x84,0x31,0x5b,0xde,0xe2,0x2a,0xd8,0xe2,0x9a,0xe7,0xdc,0x86,0x60,0x15,0x6a,0xac, + 0x7b,0x19,0x5a,0x0,0xb2,0xf8,0xed,0xd9,0x5a,0x54,0xb8,0xac,0x13,0x1e,0xc5,0xdd, + 0xb6,0xee,0x21,0x38,0x5d,0x81,0x9c,0x1,0x65,0x4f,0xdf,0xd3,0x1,0x4a,0x47,0xbb, + 0x93,0x84,0x76,0x4d,0x97,0x58,0x4b,0x47,0xec,0x9e,0x3,0x2b,0x0,0xd3,0x97,0xaa, + 0xc0,0x6f,0xaf,0xd4,0x9c,0x3c,0x7b,0x8,0x60,0x4c,0x16,0x41,0xd8,0xe7,0xc6,0x71, + 0x82,0xd7,0xab,0xfc,0x86,0xe4,0x24,0xa1,0xd6,0xcf,0xb5,0x99,0xf0,0xc4,0xdb,0x9f, + 0x86,0xec,0x58,0x3a,0xeb,0xe3,0x38,0x81,0x52,0x33,0xdc,0x6e,0xf9,0x89,0x18,0x54, + 0x1,0x87,0xc2,0x7,0x71,0x8d,0xd7,0x58,0xf6,0xa9,0x1a,0x22,0x5a,0x86,0x3e,0xc8, + 0xde,0xde,0x30,0x98,0xb2,0x43,0x9c,0xab,0x21,0x92,0x7d,0x20,0xa7,0xb4,0xb4,0xae, + 0x87,0x8,0x6f,0x44,0x91,0x6b,0x95,0xe3,0x70,0xa7,0xcf,0xd7,0x42,0x9c,0xda,0x7, + 0xb4,0x5e,0x60,0xcb,0x8b,0xd,0xe2,0xa8,0x3a,0x4e,0x6f,0x44,0xa5,0x10,0x61,0x15, + 0x64,0x8e,0xd1,0x14,0x44,0x6e,0x38,0x9a,0x86,0xd1,0xd1,0xe0,0x31,0x4a,0xf8,0x9, + 0x1c,0x9e,0x5f,0x1,0xf8,0xbf,0xda,0x7f,0x9b,0x20,0x22,0x12,0x42,0x74,0x71,0xe, + 0x0,0xf0,0x6,0x38,0x1b,0xb2,0x58,0x24,0xcf,0x84,0x99,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/convert.png + 0x0,0x0,0x5,0x28, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xd6,0x0,0xd6,0x0,0xd6,0x19,0x42, + 0xf,0xe5,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x1c,0x9,0x1d,0x1c,0x39,0x4a,0x71,0xd9,0x0,0x0,0x4,0xb5,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0x49,0x48,0x72,0x5d,0x18,0xc7,0xff,0xb7,0x3e,0xb, + 0x6d,0x22,0x1a,0x24,0x42,0xa5,0x81,0x2c,0x68,0x30,0x2a,0x72,0x51,0xb8,0x4c,0x88, + 0xc4,0x45,0x2d,0x8d,0x90,0xa0,0x61,0x11,0x51,0x54,0xbb,0x16,0x16,0x46,0xe5,0xa6, + 0x68,0xd3,0xb0,0xa8,0x68,0x11,0x64,0x34,0x10,0x52,0x21,0x16,0xad,0x2a,0x83,0x86, + 0x85,0xd2,0x22,0xc2,0xc,0x29,0xcd,0x28,0xa5,0xb2,0xd2,0x7c,0x77,0x1f,0xef,0xfb, + 0xdd,0x1b,0x39,0x5c,0x79,0xbd,0xdf,0xb3,0xfc,0x9f,0x41,0x7f,0x67,0x78,0xce,0x73, + 0xce,0x73,0x9,0x93,0xc9,0xe4,0xc7,0xff,0xc0,0xfe,0xa1,0xbb,0xc3,0xf7,0xf7,0x77, + 0x98,0xcd,0x66,0x58,0x2c,0x16,0xd8,0x6c,0x36,0x3c,0x3f,0x3f,0xc3,0xe3,0xf1,0xc0, + 0xe7,0xf3,0x21,0x2e,0x2e,0xe,0x49,0x49,0x49,0xc8,0xc8,0xc8,0x0,0x9f,0xcf,0x47, + 0x41,0x41,0x1,0xb8,0x5c,0x6e,0xd8,0xbf,0xb9,0xbf,0xbf,0x4f,0xf,0x88,0xd5,0x6a, + 0xc5,0xce,0xce,0xe,0xf4,0x7a,0x3d,0x4c,0x26,0x13,0xbc,0x5e,0x6f,0xc0,0x6d,0xb3, + 0xb2,0xb2,0x20,0x16,0x8b,0x51,0x5f,0x5f,0xf,0xb1,0x58,0x8c,0x98,0x98,0x98,0x90, + 0xfe,0x3,0x11,0xce,0xd2,0x3a,0x3f,0x3f,0xc7,0xcc,0xcc,0xc,0xf6,0xf6,0xf6,0x68, + 0x99,0x4d,0x2e,0x97,0xb,0x99,0x4c,0x6,0x85,0x42,0x81,0xf4,0xf4,0xf4,0xa0,0x66, + 0x24,0x24,0x10,0xa7,0xd3,0x89,0xf1,0xf1,0x71,0x6c,0x6e,0x6e,0x46,0x64,0xbd,0x73, + 0x38,0x1c,0x28,0x95,0x4a,0xb4,0xb4,0xb4,0x80,0xc3,0xe1,0x44,0x6,0xe4,0xe4,0xe4, + 0x4,0x3d,0x3d,0x3d,0x78,0x78,0x78,0x88,0xf8,0x6,0x4e,0x4f,0x4f,0xc7,0xc1,0xc1, + 0x1,0xfd,0x7b,0x44,0xa7,0xd3,0x61,0x60,0x60,0x0,0x3e,0x9f,0xef,0xdb,0x3a,0xd9, + 0xd9,0xd9,0x90,0x48,0x24,0x10,0x89,0x44,0xc8,0xc9,0xc9,0x41,0x56,0x56,0x16,0x38, + 0x1c,0xe,0x58,0x2c,0x16,0x5e,0x5f,0x5f,0xf1,0xf4,0xf4,0x84,0x9b,0x9b,0x1b,0x98, + 0xcd,0x66,0x18,0x8d,0x46,0x1c,0x1e,0x1e,0xe2,0xf3,0xf3,0x93,0xb2,0xaf,0x60,0x6, + 0x2b,0xe0,0x19,0xd1,0xe9,0x74,0xe8,0xef,0xef,0xc7,0xd7,0xd7,0x17,0x65,0xb9,0x44, + 0x22,0x41,0x6b,0x6b,0x2b,0x2a,0x2a,0x2a,0x82,0x1a,0x75,0xb7,0xdb,0x8d,0xed,0xed, + 0x6d,0xcc,0xcf,0xcf,0xe3,0xfa,0xfa,0x9a,0x54,0x6e,0x32,0x99,0xe8,0x5b,0x5a,0xe7, + 0xe7,0xe7,0x68,0x6e,0x6e,0xa6,0x1c,0x39,0x2e,0x97,0x8b,0xa1,0xa1,0x21,0xd4,0xd4, + 0xd4,0x84,0xb5,0x8c,0xfc,0x7e,0x3f,0xb6,0xb6,0xb6,0xa0,0xd1,0x68,0xe0,0x70,0x38, + 0x82,0x6,0x89,0x9,0x64,0xc4,0xba,0xbb,0xbb,0x29,0x21,0x8a,0x8b,0x8b,0xb1,0xb2, + 0xb2,0x12,0x36,0x4,0x0,0x10,0x4,0x81,0x86,0x86,0x6,0xe8,0x74,0x3a,0xc8,0xe5, + 0xf2,0xa0,0xdb,0xff,0x8,0x32,0x36,0x36,0x86,0xfb,0xfb,0x7b,0x92,0x2e,0x14,0xa, + 0x31,0x37,0x37,0x17,0x94,0x9b,0xc,0xc4,0x12,0x12,0x12,0xa0,0x56,0xab,0xa1,0x56, + 0xab,0xc1,0x62,0xb1,0xe8,0x39,0xd9,0x2f,0x2f,0x2f,0xb1,0xba,0xba,0x4a,0xd2,0x13, + 0x13,0x13,0x31,0x39,0x39,0x89,0xe4,0xe4,0xe4,0x88,0x79,0x2c,0xb9,0x5c,0x8e,0xec, + 0xec,0x6c,0x7a,0x66,0x64,0x6a,0x6a,0x8a,0x52,0xef,0xed,0xed,0x5,0x8f,0xc7,0x8b, + 0xb8,0xfb,0xad,0xaa,0xaa,0xa,0x1f,0xc4,0x66,0xb3,0xc1,0x60,0x30,0x90,0xf4,0xbc, + 0xbc,0x3c,0x34,0x35,0x35,0x45,0x5d,0xd0,0xf8,0x2d,0xc8,0xda,0xda,0x1a,0xfc,0x7e, + 0xb2,0x43,0x53,0x2a,0x95,0x21,0xc7,0x43,0x7f,0x5,0x44,0xaf,0xd7,0x93,0x34,0x36, + 0x9b,0xd,0xa9,0x54,0x1a,0x95,0x61,0x3c,0x25,0x88,0xdd,0x6e,0xc7,0xe5,0xe5,0x25, + 0x49,0xaf,0xad,0xad,0x5,0x9b,0xcd,0x66,0xe,0xc8,0xe9,0xe9,0x29,0x65,0xe5,0xea, + 0xea,0xea,0xa8,0xbd,0x58,0x51,0x82,0x98,0xcd,0x66,0xca,0xca,0x22,0x91,0x88,0x59, + 0x20,0x57,0x57,0x57,0x94,0x27,0x6f,0x6e,0x6e,0x2e,0xb3,0x40,0xee,0xee,0xee,0x48, + 0x5a,0x46,0x46,0x6,0xe2,0xe3,0xe3,0x99,0x5,0x62,0xb7,0xdb,0x49,0x5a,0x5a,0x5a, + 0x5a,0x54,0x3f,0x3e,0x50,0x82,0xbc,0xbc,0xbc,0x90,0xb4,0x94,0x94,0x14,0xe6,0x81, + 0x7c,0x7c,0x7c,0x90,0xb4,0xb8,0xb8,0x38,0xe6,0x81,0x50,0xdd,0x0,0xa3,0xf1,0x34, + 0xff,0x11,0x84,0x6a,0x53,0x53,0xcd,0x12,0x23,0x41,0xde,0xde,0xde,0x98,0x7,0x42, + 0xe5,0xa1,0x9c,0x4e,0x27,0xf3,0x40,0xa8,0x9e,0x31,0xed,0x76,0x3b,0x65,0x34,0x1c, + 0xd5,0x20,0x7c,0x3e,0x9f,0xa4,0x79,0x3c,0x1e,0xd8,0x6c,0x36,0x66,0x81,0x14,0x16, + 0x16,0x22,0x98,0x18,0x2c,0x6a,0x41,0x4a,0x4a,0x4a,0x28,0x2b,0x1f,0x1f,0x1f,0x33, + 0xb,0xa4,0xa8,0xa8,0x8,0xa9,0xa9,0xa9,0x24,0x7d,0x7f,0x7f,0x9f,0x59,0x20,0x4, + 0x41,0xa0,0xb6,0xb6,0x96,0xa4,0xdf,0xde,0xde,0xe2,0xec,0xec,0x8c,0x39,0x20,0x0, + 0xbe,0x7d,0x24,0x5b,0x58,0x58,0x60,0x16,0x48,0x75,0x75,0x35,0x4,0x2,0x1,0x49, + 0xdf,0xdd,0xdd,0xd,0xe8,0x19,0x33,0x6a,0x40,0x8,0x82,0x40,0x5b,0x5b,0x1b,0x49, + 0xf7,0xfb,0xfd,0x50,0xa9,0x54,0x41,0x65,0xa5,0x42,0xb5,0xd7,0xd7,0xd7,0xf0,0x41, + 0x0,0xa0,0xa1,0xa1,0x1,0xf9,0xf9,0xf9,0x24,0xfd,0xe2,0xe2,0x2,0x1a,0x8d,0x26, + 0xa2,0x10,0xe,0x87,0x3,0xa,0x85,0x82,0x1e,0x90,0xd8,0xd8,0x58,0xc,0xf,0xf, + 0x53,0x46,0xbe,0x8b,0x8b,0x8b,0x98,0x9e,0x9e,0x8e,0x8,0xc4,0xd1,0xd1,0x11,0x1a, + 0x1b,0x1b,0x83,0x3a,0xb7,0x7e,0x8c,0xcd,0x4b,0x4b,0x4b,0xd1,0xd9,0xd9,0x49,0x59, + 0x36,0x31,0x31,0x81,0xc1,0xc1,0x41,0xbc,0xbf,0xbf,0xd3,0x2,0xe0,0x76,0xbb,0xa1, + 0x56,0xab,0xa1,0x54,0x2a,0xff,0x48,0x2d,0xd0,0x2,0x2,0x0,0x1d,0x1d,0x1d,0xa8, + 0xab,0xab,0xa3,0x2c,0xd3,0x6a,0xb5,0x90,0xc9,0x64,0xd0,0xeb,0xf5,0x21,0xc7,0x62, + 0x6e,0xb7,0x1b,0xb3,0xb3,0xb3,0x90,0x4a,0xa5,0x58,0x5a,0x5a,0xa,0xa9,0x9f,0x80, + 0x52,0x6f,0x4,0x41,0x60,0x74,0x74,0x14,0x9f,0x9f,0x9f,0x94,0xef,0xc1,0x56,0xab, + 0x15,0x5d,0x5d,0x5d,0x10,0x8,0x4,0x90,0xc9,0x64,0x90,0x48,0x24,0x10,0xa,0x85, + 0x88,0x8d,0x8d,0xfd,0xb6,0x4f,0xa7,0xd3,0x9,0xa3,0xd1,0x8,0xbd,0x5e,0xf,0x83, + 0xc1,0x0,0x8f,0xc7,0x13,0xd6,0x6c,0x6,0x95,0xc,0xf5,0x7a,0xbd,0x50,0xa9,0x54, + 0xd0,0x6a,0xb5,0x3f,0xd6,0x65,0xb3,0xd9,0xe0,0xf1,0x78,0x94,0x39,0x44,0x8b,0xc5, + 0x12,0xf0,0xd2,0xa1,0x35,0xf5,0xf6,0x5f,0xdb,0xd8,0xd8,0xc0,0xc8,0xc8,0x8,0x5c, + 0x2e,0x57,0xc4,0xbc,0x56,0x51,0x51,0x11,0xfa,0xfa,0xfa,0x20,0x16,0x8b,0x23,0x7, + 0x2,0x0,0x8f,0x8f,0x8f,0x98,0x98,0x98,0xc0,0xfa,0xfa,0xfa,0xb7,0x59,0xd9,0x50, + 0x4c,0x20,0x10,0xa0,0xbd,0xbd,0x1d,0x32,0x99,0xc,0x4,0x41,0x4,0xd4,0x26,0x2c, + 0x90,0xdf,0xfd,0xfd,0xf2,0xf2,0x32,0x74,0x3a,0x1d,0x2c,0x16,0x4b,0x48,0x7d,0x70, + 0x38,0x1c,0x48,0xa5,0x52,0xc8,0xe5,0x72,0x54,0x56,0x56,0x6,0xdd,0x9e,0x16,0x90, + 0xdf,0xed,0xea,0xea,0xa,0xa7,0xa7,0xa7,0xb8,0xb8,0xb8,0xf8,0xf7,0xa3,0x1a,0x97, + 0xcb,0x5,0x8f,0xc7,0x3,0xaf,0xd7,0x8b,0xf8,0xf8,0x78,0x24,0x25,0x25,0x21,0x33, + 0x33,0x13,0x7c,0x3e,0x1f,0x42,0xa1,0x10,0xe5,0xe5,0xe5,0x28,0x2b,0x2b,0xb,0xeb, + 0xb9,0x89,0x76,0x90,0xbf,0x65,0x7f,0x7c,0xf9,0x10,0xcd,0x77,0xd,0xda,0xe,0x44, + 0x26,0xd8,0x2f,0xf,0x92,0xfa,0x6,0x74,0x14,0x61,0xa9,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/print.png + 0x0,0x0,0x3,0xc, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x37,0x28,0xa7,0xbd,0x12,0xa1,0x0,0x0,0x2,0x99,0x49,0x44, + 0x41,0x54,0x78,0xda,0x8d,0x95,0x2f,0x5b,0xe3,0x40,0x10,0xc6,0x7f,0xbd,0xa7,0x62, + 0xd6,0x25,0xae,0x95,0x91,0xc5,0xb5,0xb2,0x12,0x5c,0x71,0xd4,0x81,0x2c,0xe,0xbe, + 0x1,0xfd,0x8,0x27,0x4f,0x82,0x4,0xd7,0x73,0xc5,0x81,0xc,0xae,0x38,0x2a,0x57, + 0xa6,0x2e,0x71,0x3b,0x6e,0x4f,0x6c,0x36,0xa4,0x7f,0xf2,0x1c,0x63,0x36,0x99,0x9d, + 0xbc,0xf3,0xce,0xbc,0x93,0xdd,0x1e,0x1d,0xb6,0x5e,0xaf,0xbd,0x88,0x90,0xa6,0xe9, + 0x9e,0x5f,0x55,0x1,0x70,0xce,0x1,0x50,0x55,0x15,0x49,0x92,0x70,0x71,0x71,0xd1, + 0x6b,0xc7,0xf5,0xbb,0x80,0x45,0x84,0xc9,0x64,0xd2,0x0,0x1d,0xee,0x45,0x2b,0xcb, + 0x12,0x6b,0xed,0x51,0x4c,0x27,0x30,0xc0,0x76,0xbb,0x3d,0x2,0x3b,0x4c,0xe4,0x9c, + 0xc3,0x18,0xf3,0x73,0xe0,0x53,0x0,0xaa,0x7a,0x94,0xe0,0x54,0x45,0x0,0xbf,0x4e, + 0x39,0xf3,0x3c,0xf7,0xaa,0xda,0x30,0x31,0xc6,0x60,0x8c,0xd9,0xeb,0x77,0xec,0xbf, + 0x88,0x1c,0xf5,0xb7,0x93,0xb1,0x73,0x8e,0x24,0x49,0x28,0xcb,0x12,0x11,0x69,0x84, + 0x6a,0xdb,0xa9,0xf2,0xff,0xcb,0x38,0x96,0x78,0x38,0x11,0x6d,0xd0,0x98,0xac,0xab, + 0x15,0xfd,0xae,0xf,0xdb,0x23,0x75,0xaa,0xa2,0xb8,0xb6,0x27,0xa4,0x6d,0xbd,0x53, + 0xce,0xd5,0x6a,0xe5,0xb3,0x2c,0x63,0x38,0x1c,0x76,0x82,0x47,0x21,0x3f,0x3e,0x3e, + 0xea,0x9e,0x27,0xcc,0xe7,0x97,0xbd,0x93,0x8c,0xdf,0xde,0xde,0xbc,0xb5,0x96,0xfc, + 0x3d,0x47,0x66,0x82,0x88,0x34,0x0,0x87,0x6b,0x64,0x5a,0x16,0x25,0x79,0x9e,0xb3, + 0xab,0x76,0xdc,0xdd,0xdd,0xf9,0xd9,0x6c,0xc6,0xe5,0xe5,0x65,0xaf,0xd7,0x6,0xdd, + 0x6e,0x2d,0x55,0xb1,0xc3,0x29,0x80,0xeb,0x14,0xc6,0x48,0x8a,0x20,0x60,0xc0,0x16, + 0x96,0xcd,0xe6,0x93,0xdd,0xae,0xc0,0x39,0xe5,0xec,0x2c,0x63,0xb1,0x58,0x84,0x56, + 0x44,0xa6,0xe7,0xd3,0x73,0x4c,0x9a,0xe2,0x9c,0x82,0x3a,0xf4,0xb8,0x7e,0x40,0xc8, + 0xf9,0xe0,0x9d,0x35,0x53,0x9d,0x92,0x7e,0xa5,0x3c,0xbd,0x3c,0x61,0xbf,0xc2,0xdf, + 0xe7,0xd4,0x91,0x8d,0xce,0x2,0xe8,0xe3,0xe3,0xb3,0x2f,0x8b,0xd2,0xff,0xc4,0xbe, + 0xfc,0x97,0x1f,0xf9,0x91,0x17,0x2f,0x7e,0xe4,0x47,0x7e,0xb3,0xd9,0xf8,0xdf,0xf, + 0x7f,0xfc,0x78,0x3c,0xf6,0x83,0x41,0xe6,0x93,0x24,0xf1,0xd9,0x20,0xf3,0xfd,0x6a, + 0x57,0x71,0x73,0x73,0xd5,0xa9,0xee,0xa1,0xa5,0xa4,0x9c,0x33,0x25,0x47,0x98,0x31, + 0x63,0x3c,0x1e,0x93,0xc8,0x90,0x52,0xb,0x9e,0x9e,0x5f,0xa8,0xaa,0x8a,0x74,0x90, + 0xd2,0x57,0xc0,0xda,0x22,0xcc,0xa3,0x2a,0x88,0x10,0x72,0x48,0xad,0x36,0x18,0x4c, + 0xe8,0xb8,0x3a,0x10,0xc3,0x9d,0x3e,0x70,0x85,0x65,0xa8,0x43,0x3e,0xd9,0x82,0x2a, + 0xe9,0x70,0x18,0xf6,0x6b,0x75,0xfa,0x65,0x51,0x60,0x45,0x42,0x3f,0x55,0x69,0x74, + 0x33,0x10,0x54,0xac,0x2b,0x31,0xa,0x4e,0x80,0xe0,0x13,0xc0,0xea,0xe,0x25,0x9c, + 0x21,0x76,0xbb,0x6d,0x34,0x31,0x71,0xdc,0xa2,0x43,0x23,0x20,0xda,0xc,0x85,0x43, + 0x43,0xe,0xb7,0x17,0xd9,0x4c,0x8e,0x44,0x4d,0xdb,0x3f,0x10,0x8e,0x3e,0x2,0x5a, + 0xb6,0x3e,0x70,0x35,0xd9,0x76,0xa0,0x2,0xe2,0x40,0xf,0x77,0xc,0xaa,0x25,0x75, + 0x9d,0xb1,0x36,0x26,0x93,0x29,0xbf,0xd0,0x16,0xcb,0x86,0xac,0xb,0xaf,0x5a,0xaf, + 0x7b,0xa0,0x26,0x86,0xd5,0xa0,0x35,0x60,0xdd,0xce,0xc1,0x60,0xc0,0x62,0x71,0x13, + 0x18,0x5b,0x6b,0xa3,0x54,0x20,0xa,0x95,0x0,0x55,0x50,0x4e,0x35,0xc0,0x48,0x64, + 0xa5,0xdf,0x60,0x7c,0xf7,0x1c,0x55,0x44,0x60,0xb9,0x5c,0x32,0x9f,0xcf,0x7b,0xfd, + 0x2c,0xcb,0x78,0x7f,0x7d,0xe7,0xef,0xeb,0x2b,0xce,0x29,0xe1,0xfc,0x11,0x64,0xff, + 0x2e,0xfa,0x7e,0x17,0xd9,0x2b,0x3b,0x8a,0x8e,0x8,0xcb,0xe5,0x92,0xfb,0xfb,0xfb, + 0xde,0xde,0x21,0xb4,0x5a,0xad,0xfc,0x6a,0xf5,0xca,0xae,0xbe,0xbf,0x1c,0xae,0x16, + 0x45,0x8f,0x6e,0x15,0x55,0x70,0xae,0xc,0xcf,0x95,0x32,0x99,0x4e,0xb8,0xbe,0xbe, + 0xe6,0xf6,0xf6,0xb6,0xc1,0xfb,0x7,0xd1,0xf6,0x9e,0xc,0x80,0x78,0x91,0x90,0x0, + 0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/sendtoback.png + 0x0,0x0,0x1,0x42, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0xf7,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0x94,0x5d,0x6e, + 0x83,0x30,0x10,0x6,0xc7,0x15,0x70,0x86,0xde,0xa1,0xf7,0x3f,0x57,0x94,0xd8,0x26, + 0xf6,0x6e,0x88,0xfb,0x80,0xcd,0x4f,0x2,0x55,0x70,0xd4,0x87,0x4a,0x5d,0x89,0x17, + 0x1b,0x46,0xf3,0x69,0x97,0x35,0x6d,0xdb,0x26,0xde,0x28,0x55,0x35,0x5b,0xe7,0xd, + 0x80,0x88,0x54,0x41,0xbb,0xae,0xdb,0xbd,0xfb,0xe0,0x97,0xea,0x1f,0xfc,0x87,0xc1, + 0xcd,0xab,0x2f,0x1a,0x63,0xf6,0xae,0xd2,0x5b,0x60,0x80,0x94,0x36,0x18,0xf7,0x1, + 0x86,0x0,0x7a,0x5,0xe9,0x21,0x3a,0xcc,0xe7,0xd7,0x31,0xf0,0x33,0x54,0x41,0xb, + 0xd4,0x83,0x38,0x88,0xee,0xb8,0xf1,0xaa,0x6,0x19,0x81,0xda,0xcf,0xd0,0xe0,0x20, + 0x5e,0x2a,0xc1,0xe9,0xe,0x43,0x9c,0xa3,0xab,0x1f,0x2d,0xa3,0x1d,0x1f,0xa9,0x31, + 0x4e,0x3,0xdc,0x2,0x48,0x89,0xee,0x41,0x1d,0x4,0xbb,0x0,0xfb,0xa,0xb0,0xe4, + 0xe8,0x93,0xe5,0x83,0xa9,0x54,0x83,0xf3,0x87,0x13,0xd0,0x2d,0xa0,0x2e,0xa7,0xb0, + 0x33,0xf8,0xa7,0xf5,0xb7,0xaa,0x70,0xc9,0x9d,0xb7,0x33,0xb8,0x4c,0x82,0xfa,0xf9, + 0xc,0x68,0xf6,0x16,0xf5,0xe6,0x8f,0x10,0xce,0xcf,0xd0,0x62,0x1a,0xf3,0x44,0x54, + 0x35,0x2f,0x9c,0xc6,0x91,0x9a,0x2c,0x1d,0xc4,0x6c,0x2a,0x8b,0x6,0x1e,0x6,0x5f, + 0xcf,0xd9,0xd4,0x42,0xec,0x41,0xed,0xba,0x81,0x25,0x45,0x15,0x58,0x8a,0xe9,0xc6, + 0x54,0x44,0xf,0xb7,0x7e,0xdc,0x2d,0x47,0xa6,0xf8,0x88,0xc3,0x37,0x88,0x41,0xdf, + 0x2d,0x45,0x65,0x21,0xa3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/shading.png + 0x0,0x0,0x1,0x34, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x0,0xfb,0x49,0x44,0x41,0x54,0x58,0x85,0xed,0x97,0xcd,0x11,0x84,0x20, + 0xc,0x85,0x1f,0x3b,0x36,0x63,0xa,0xb2,0x1e,0xea,0xa1,0xa,0xab,0x80,0x72,0xb2, + 0x27,0x58,0x76,0x5d,0x48,0x82,0x8e,0x5e,0x78,0x27,0x74,0x48,0xde,0x7,0xfe,0x24, + 0x38,0x66,0x66,0x3c,0xa8,0x5,0x0,0x52,0x4a,0xa6,0x20,0xa2,0xf0,0x75,0x1d,0xe3, + 0x36,0x64,0x4e,0x44,0x78,0xd9,0x83,0x82,0xea,0x9e,0xa4,0x7d,0xdf,0x1,0xc0,0x6, + 0x90,0x8d,0xea,0x15,0xe7,0xf1,0x8,0x84,0x9,0xe0,0x9f,0xf9,0x15,0x10,0x2a,0x80, + 0x9e,0xf9,0x59,0x8,0x11,0x40,0x63,0x7e,0x6,0x62,0xd1,0x26,0x5,0x80,0x75,0xa5, + 0x32,0xfe,0x7c,0xbc,0xfe,0x67,0x7e,0x54,0x9b,0xab,0x0,0x6a,0x53,0x8d,0xea,0xf9, + 0x29,0xc9,0x30,0xdd,0x47,0x60,0x35,0x1f,0x89,0x6f,0x2,0x9c,0x35,0xd7,0xe6,0x31, + 0xff,0x88,0xae,0xd6,0x4,0x98,0x0,0x13,0x60,0x2,0x1c,0x6a,0x41,0xae,0x64,0x77, + 0x75,0x8a,0xb7,0xec,0x0,0x51,0x68,0x96,0xe8,0x26,0x80,0xa6,0x92,0x69,0x24,0xe5, + 0xe9,0x96,0x63,0xe7,0x7c,0x19,0x33,0xfb,0xe6,0xbc,0x56,0x9c,0xa6,0x89,0x69,0x2, + 0xd4,0x5b,0x16,0xe3,0x86,0x94,0x2c,0xad,0x77,0x28,0x39,0x24,0x8,0xf1,0x1d,0x18, + 0xe9,0xf9,0xeb,0x18,0xa9,0x3d,0x53,0xf5,0x84,0xbd,0x97,0x48,0x3,0xd1,0x93,0xd8, + 0x92,0x59,0x65,0x5,0x3d,0x0,0x8c,0x1e,0xb3,0x46,0x75,0xf9,0xe,0x58,0x17,0x50, + 0x0,0xf2,0x59,0xed,0x6e,0x39,0x66,0x66,0xe7,0xdc,0x23,0xe6,0x0,0xf0,0x6,0xec, + 0xcc,0x60,0xe9,0x41,0x28,0x13,0x26,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/rightview.png + 0x0,0x0,0x1,0x9b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x62,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xfd,0x91,0x84,0x20, + 0xc,0xc5,0x1f,0xce,0x36,0x63,0xa,0xb2,0x8,0xaa,0xb0,0x1e,0xab,0xa0,0xa,0xec, + 0xc6,0xec,0x1f,0x77,0x78,0x7c,0x8,0x24,0xe8,0xde,0xbe,0x99,0x1d,0x95,0x35,0xbc, + 0x1f,0xc1,0x20,0x1a,0x66,0x66,0x7c,0x51,0x2f,0x0,0xd8,0xf7,0x5d,0x15,0x44,0xb4, + 0x25,0xd7,0xde,0x2f,0x43,0xe6,0x44,0x84,0x49,0x1f,0xb4,0x89,0xda,0x7a,0x72,0xce, + 0x1,0x80,0xe,0x20,0x18,0xc5,0x23,0xe,0xe7,0x23,0x10,0x2a,0x80,0x2b,0xf3,0x27, + 0x20,0x44,0x0,0x2d,0xf3,0xbb,0x10,0x5d,0x0,0x89,0x79,0x9,0x61,0xc5,0x0,0x2f, + 0x69,0xa7,0x52,0xfd,0xdc,0x2f,0x8f,0xe9,0x2,0x4,0xd1,0x46,0x69,0xc3,0x1a,0xda, + 0x57,0xb1,0x99,0x5f,0xfc,0x18,0x40,0x30,0x8f,0x3b,0xd0,0x4c,0x4d,0x1,0x1f,0xa9, + 0xff,0xc,0x6c,0x74,0x49,0x2e,0x55,0x2f,0xbe,0x99,0x81,0x40,0x9e,0x1f,0x1,0x88, + 0xa7,0x20,0x37,0x9f,0x89,0xb0,0xfb,0xbf,0xb6,0xfe,0x43,0xf8,0xdb,0x41,0x3e,0x12, + 0xc9,0x14,0xe4,0xa9,0xcf,0xcd,0x1,0xe5,0x4a,0x78,0x47,0xbc,0xa2,0x30,0x7,0x14, + 0x55,0x70,0x47,0x33,0x51,0x72,0x4,0x80,0x19,0x80,0xfd,0x24,0xc0,0x71,0x1c,0xe7, + 0xf9,0xee,0x7d,0x91,0x7e,0xe7,0x1c,0x60,0xed,0xe7,0xa6,0x60,0x9a,0xd2,0xae,0xcd, + 0x9a,0x66,0x20,0x48,0x95,0x81,0x91,0x2a,0x88,0x63,0xae,0x32,0x21,0x5e,0x88,0xce, + 0x6a,0xa8,0xbc,0x6c,0xae,0xaa,0x21,0xc4,0xc5,0xf1,0xea,0x2a,0xa8,0x99,0x7b,0xbf, + 0x24,0xa6,0x35,0xb0,0xde,0x42,0x64,0x98,0x99,0xe3,0x2d,0x59,0x5c,0xdf,0xad,0x25, + 0x54,0xaa,0x9a,0xb9,0x73,0xe,0xd6,0xda,0xf6,0x14,0xd4,0x46,0x7e,0xa5,0xd6,0x3d, + 0xad,0x45,0x4b,0xbc,0x1f,0x68,0x99,0xe7,0xff,0x69,0x36,0x25,0x4d,0x0,0xa9,0xf9, + 0x1d,0x88,0x2a,0x80,0xd6,0x7c,0x14,0xa2,0x3b,0x5,0x23,0x7b,0x7e,0xd,0x84,0xe8, + 0x19,0x8,0xbf,0x51,0x88,0x96,0x1e,0x7f,0x17,0x68,0x41,0xb,0x80,0xd1,0xcf,0xac, + 0x51,0x3d,0x9e,0x1,0xed,0x0,0x4e,0x80,0xf0,0xad,0xf6,0xdf,0x32,0xcc,0xcc,0xc6, + 0x98,0xaf,0x98,0x3,0xc0,0x1b,0x9f,0xf7,0xca,0x8d,0x15,0xaa,0x51,0x4e,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/select.png + 0x0,0x0,0x0,0x6d, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x0,0x0,0x0,0x0,0x3a,0x98,0xa0,0xbd, + 0x0,0x0,0x0,0x34,0x49,0x44,0x41,0x54,0x78,0xda,0x85,0xce,0xa1,0xd,0x0,0x30, + 0xc,0x3,0xc1,0xdf,0x7f,0xaa,0x8c,0x16,0x52,0x45,0x71,0x1e,0xd4,0xc0,0xe0,0x80, + 0x65,0xea,0x84,0xa9,0x0,0x4,0x8,0x10,0x20,0x40,0x80,0x80,0xcf,0xc6,0x79,0x9a, + 0xa3,0xfb,0xed,0x2,0x12,0x4a,0xf0,0xd2,0x7e,0x31,0x95,0x41,0x8a,0x2f,0xc4,0xb5, + 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/undo.png + 0x0,0x0,0x0,0xe4, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x36,0x1d,0xe8,0x15,0xe7,0xc3,0x0,0x0,0x0,0x71,0x49,0x44, + 0x41,0x54,0x78,0xda,0xed,0x93,0xc1,0xa,0xc0,0x20,0xc,0x43,0x9b,0x7e,0x77,0xd8, + 0x41,0xfa,0xdf,0xdd,0x41,0xc6,0x6,0xda,0x4d,0x9d,0x97,0x31,0x3,0x1e,0x94,0xf6, + 0x55,0xdb,0x28,0xb2,0xf4,0x59,0xa1,0x2f,0xdc,0xbc,0x7a,0x9a,0x44,0xb8,0x11,0x1, + 0xd8,0x5c,0x84,0xe8,0x1,0x96,0x3a,0xf3,0x51,0x26,0x13,0x31,0xf0,0xbe,0xf0,0xf5, + 0xe6,0x1,0x84,0x28,0xf7,0xad,0x6d,0xca,0xb1,0xfa,0xfc,0x74,0x62,0x64,0x78,0xda, + 0xda,0xb3,0xc9,0xe0,0xd6,0xa1,0x75,0x83,0xc7,0xe1,0xfa,0xc6,0xbf,0x35,0x57,0x4c, + 0x91,0x25,0xf3,0xc,0x3d,0xd6,0xf0,0xcf,0x9b,0xef,0x9e,0xa5,0x3f,0x69,0x7,0x62, + 0xac,0x28,0xb1,0x7,0x21,0xc,0x2f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/past.png + 0x0,0x0,0x1,0x44, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x38,0x11,0x7f,0x20,0x86,0x66,0x0,0x0,0x0,0xd1,0x49,0x44, + 0x41,0x54,0x78,0xda,0xcd,0x95,0x51,0xa,0xc3,0x20,0xc,0x86,0xff,0x14,0x4f,0x25, + 0xf4,0x64,0x4a,0x1f,0x4a,0x3c,0xd9,0xa0,0xd7,0xca,0x1e,0xda,0x6d,0xd6,0x26,0xa8, + 0x9d,0x83,0x5,0x24,0x45,0xe3,0x97,0xdf,0x98,0x22,0xf0,0x23,0xa3,0xca,0xba,0xdc, + 0xd8,0x73,0x9,0x12,0x95,0x9c,0xcd,0x12,0xb5,0xb,0xa4,0x56,0x68,0x2f,0xdc,0xbd, + 0xa0,0xbc,0x32,0x80,0x8,0x80,0x11,0x97,0xa8,0x82,0xf2,0x44,0x4a,0xbc,0xe4,0x70, + 0x2,0x20,0x65,0xd0,0xf6,0xd8,0xaa,0x35,0xf4,0xb3,0xd7,0xe0,0x6f,0xf0,0xb4,0xbb, + 0x7d,0x71,0xf7,0x3d,0x66,0xef,0x73,0xc7,0xc1,0x4e,0x41,0x7e,0xf6,0x8d,0x60,0x36, + 0xe1,0xae,0xcc,0x9c,0x1f,0xaf,0xcf,0x9f,0x6d,0xd2,0x33,0xdf,0xf1,0xd7,0x16,0x11, + 0x5e,0x6d,0x78,0x5c,0xb8,0xa3,0xde,0x9f,0xcb,0x73,0x75,0xc5,0x80,0x48,0xb0,0x9b, + 0x97,0x12,0x44,0xc2,0xd1,0x96,0xd1,0xae,0xb1,0x5,0x27,0x4a,0xca,0xf,0x14,0x4e, + 0xdf,0x44,0x10,0x20,0x52,0xb3,0xe2,0x9a,0x6a,0xd,0x3e,0x4c,0x71,0x9,0x1f,0xa2, + 0x58,0x4b,0xfa,0xb5,0x62,0x2d,0x21,0x51,0x1a,0x5b,0xe3,0x61,0x8a,0xad,0xb,0x2c, + 0x5f,0xa,0x63,0xb0,0xf4,0x1a,0xc0,0xd2,0xf0,0xcc,0xb0,0xe0,0x9f,0xec,0x9,0xe3, + 0x25,0xc1,0x98,0x31,0xe7,0x44,0x89,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/izoom.png + 0x0,0x0,0x1,0x9e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x65,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x95,0xdb,0x91,0x84,0x20, + 0x10,0x45,0x2f,0xd6,0xc4,0x60,0xe,0x74,0x12,0xab,0xe9,0x18,0x5,0x51,0x4c,0x3a, + 0xb2,0x49,0x40,0xe,0x26,0xd1,0xfb,0xe1,0x36,0x28,0xea,0x28,0xa8,0xe3,0xfd,0xb1, + 0xaa,0x85,0xea,0x43,0x3f,0x15,0x33,0x33,0x1e,0xd4,0xb,0x0,0xbc,0xf7,0x45,0x97, + 0xb5,0xd6,0xc5,0x77,0x1,0x80,0x88,0x50,0x15,0xdf,0x3e,0x29,0x6b,0x2d,0x0,0xdc, + 0xb,0x40,0x3,0x81,0x6,0xfa,0x78,0xe6,0xb1,0x8,0x88,0x5e,0x7b,0x7,0x88,0xba, + 0x85,0xcd,0xb9,0xf7,0xfd,0x0,0xd1,0xb1,0xd9,0xfc,0xc7,0xdc,0x5f,0xf,0x90,0x3a, + 0x66,0xfe,0x59,0x5c,0x52,0xca,0xfc,0x7f,0x7f,0x1,0x98,0x10,0x91,0xad,0x7c,0xa7, + 0x76,0x57,0xbb,0x75,0x80,0xd1,0xf9,0xb6,0x63,0x91,0xfc,0x13,0x0,0xa2,0xae,0x38, + 0x2d,0x49,0x4,0xf6,0x9d,0xa7,0x20,0x23,0xc4,0xa8,0xe9,0xcb,0x80,0xf8,0xf2,0xd4, + 0x3e,0x55,0xe8,0x82,0x98,0xd7,0x63,0xce,0xa7,0x10,0x12,0x85,0x12,0x3d,0xde,0x86, + 0x15,0x10,0x73,0x9f,0xfb,0x7a,0xd1,0x99,0x28,0x3c,0x1e,0x81,0xdd,0x41,0x74,0x46, + 0x9f,0x8a,0xef,0x36,0x0,0xad,0xf5,0xa1,0x73,0xb2,0x8c,0x2e,0x7,0xc8,0x5d,0xcf, + 0x15,0x20,0xb3,0xdd,0xcc,0x7a,0x3a,0x47,0xe9,0x44,0xcc,0x6,0x78,0x52,0x1,0x40, + 0xe8,0x73,0xa3,0x20,0xaf,0xb7,0xb6,0x6c,0x31,0x25,0x11,0x30,0x59,0x10,0xd3,0x73, + 0x4d,0xd3,0x62,0x18,0x8e,0x15,0xe0,0x54,0xb3,0x22,0x74,0xee,0x1d,0x86,0x89,0x6c, + 0xbc,0xf5,0x6d,0x28,0x8e,0xcd,0xcc,0xde,0x34,0x2d,0xac,0xed,0x51,0xd7,0xc7,0xb, + 0x71,0xd1,0x5,0x61,0xb5,0x26,0x20,0x73,0x89,0x4d,0xc2,0xde,0x16,0x43,0x6c,0xb6, + 0x61,0xa,0xb2,0xf6,0x4f,0xeb,0xb1,0xed,0x88,0xfa,0x62,0x88,0xdd,0x39,0x70,0xa4, + 0xb5,0x9c,0x2b,0x87,0xb8,0xac,0xd,0x9d,0xf3,0x88,0x29,0x89,0x10,0x7b,0x85,0x79, + 0xe9,0x1c,0x28,0x81,0xb8,0x7c,0x10,0xe5,0x42,0xdc,0x32,0x9,0x73,0x20,0x6e,0x1b, + 0xc5,0x6b,0x10,0x6b,0x5,0xa9,0x98,0x99,0xbd,0xf7,0x61,0x3d,0x7e,0x53,0x5d,0xd7, + 0x8d,0x0,0x4a,0xa9,0xaf,0x3b,0x17,0xfd,0x1,0x67,0x7,0xb3,0xa2,0xc3,0x43,0xbd, + 0x1f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/export.png + 0x0,0x0,0x2,0x75, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1, + 0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd8,0xa,0x10, + 0xe,0x4,0x2d,0x3,0x3d,0xcf,0xa7,0x0,0x0,0x1,0xf5,0x49,0x44,0x41,0x54,0x38, + 0xcb,0xb5,0x95,0xbd,0x6e,0x1a,0x41,0x10,0xc7,0x7f,0xb,0x44,0x81,0x38,0xf2,0xe1, + 0xc4,0x5,0x42,0x96,0x22,0xe5,0x9,0xac,0xe8,0x44,0x63,0x9,0x9a,0xd0,0x26,0x2d, + 0x1d,0x6f,0x85,0x78,0x8b,0xe4,0x15,0x28,0x4c,0x71,0xba,0x60,0x9,0x5d,0xe1,0x8a, + 0x82,0x50,0x50,0xd8,0xa,0x4a,0x9c,0xc3,0x70,0xbb,0x4c,0xa,0xee,0x4e,0x7c,0x2c, + 0xf6,0x11,0x25,0x23,0xfd,0x75,0xba,0xfd,0xf8,0xed,0xec,0xec,0xec,0xac,0x12,0x11, + 0xfe,0x87,0x15,0x76,0x1b,0x94,0x52,0xa,0xc8,0xc7,0x7d,0x79,0x20,0x67,0x99,0x27, + 0xc0,0xa,0xd0,0x80,0x11,0x11,0xf3,0x2c,0x18,0xc8,0x37,0x9b,0xcd,0x68,0xb1,0x58, + 0x60,0xcc,0xde,0x78,0xe6,0xf3,0x39,0x83,0xc1,0x80,0x46,0xa3,0xe1,0xf5,0x7a,0xbd, + 0x4f,0xc0,0x6f,0xa5,0xd4,0xa3,0x88,0xe8,0xed,0xa5,0x45,0xb6,0x4,0x14,0xeb,0xf5, + 0xba,0x68,0xad,0xad,0x1a,0xe,0x87,0x12,0x7b,0x2c,0xb5,0x5a,0xed,0x1b,0xf0,0xe, + 0x38,0x5,0xa,0x9b,0x1c,0xdb,0x36,0xf3,0xc6,0x18,0x8c,0x31,0x68,0xad,0xf7,0x94, + 0xec,0xa2,0xdb,0xed,0xe2,0x79,0xde,0x7,0xd7,0x75,0xbf,0x2,0x6f,0x80,0x57,0x4a, + 0xa9,0x34,0x2,0x36,0x70,0xe,0x20,0x81,0xef,0x6a,0xb5,0x5a,0x1,0x50,0x2a,0x95, + 0xe8,0x74,0x3a,0xf8,0xbe,0x7f,0xe9,0xba,0xee,0x17,0xe0,0xc,0x28,0x2a,0xa5,0xf2, + 0x87,0x62,0x4c,0x2,0xb6,0x65,0x8c,0xd6,0xeb,0x50,0xb6,0xdb,0xed,0xb4,0xcd,0xf7, + 0xfd,0x4b,0xe0,0x1c,0x78,0x4,0x96,0x80,0x39,0x8,0x8e,0xa2,0xc8,0xa,0x2e,0x97, + 0xcb,0xf4,0xfb,0xfd,0xf4,0x7f,0x3c,0x1e,0xd3,0x6a,0xb5,0x0,0xca,0xc0,0x3d,0xf0, + 0xb,0x58,0x1e,0x4,0x6b,0xad,0xd3,0x6d,0x57,0x2a,0xeb,0x61,0xd3,0xa9,0xc6,0x71, + 0x1c,0x1c,0xc7,0x49,0xc7,0x25,0x63,0x80,0x97,0xc0,0x8b,0x24,0x94,0xb9,0xa7,0xc0, + 0x89,0x12,0xab,0x54,0xa,0x7,0xf,0x33,0xce,0x79,0x15,0x6b,0x1d,0x63,0xa5,0xee, + 0x37,0xf6,0x7c,0xc7,0xf5,0x35,0x54,0xab,0xf6,0x5,0x2f,0x2e,0x8a,0x0,0x8c,0x46, + 0x3f,0x1,0x58,0x2e,0x97,0xd9,0x6e,0x5e,0x56,0x8b,0xa2,0x28,0x3d,0x64,0xe,0xa5, + 0x96,0xc8,0x5b,0x95,0x8,0xce,0x4f,0xaf,0xae,0x3e,0x73,0x7b,0x7b,0x47,0x10,0x4c, + 0x9,0x82,0xe9,0xde,0xa4,0x20,0x98,0x12,0x45,0x51,0xaa,0xa3,0x3c,0xd6,0x5a,0xef, + 0x4d,0xba,0xb9,0xf9,0x1e,0x7b,0xbb,0x9d,0x96,0x47,0x81,0x37,0xbd,0xf1,0xbc,0xd1, + 0x1e,0x70,0x37,0x24,0x7f,0x5,0x7e,0xca,0x36,0xb3,0x26,0x13,0x38,0xa9,0x15,0xff, + 0x14,0x3c,0x9b,0xcd,0x8,0xc3,0x90,0xc9,0x64,0xf2,0x2c,0x38,0xc,0x43,0x7b,0x87, + 0xa5,0x6c,0x9e,0x24,0x65,0xf1,0x48,0x7d,0x4,0xde,0x3,0x27,0x22,0x62,0xf5,0xd8, + 0x0,0xd5,0x58,0x67,0x40,0x29,0x43,0x5a,0xcf,0x81,0x1f,0xf1,0xd7,0x0,0xa8,0xdd, + 0x42,0x13,0xd7,0xd4,0x12,0xf0,0x3a,0xfe,0x66,0xb9,0x44,0x3a,0x86,0x3e,0x0,0x73, + 0x11,0xd1,0x36,0x70,0x96,0x37,0x6f,0xd7,0x56,0xb1,0xa7,0xc9,0x1b,0x28,0x7f,0x0, + 0xbd,0xd7,0x6c,0x3a,0xd9,0xe0,0x1b,0xba,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/draw.png + 0x0,0x0,0x1,0x64, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x2b,0x49,0x44,0x41,0x54,0x58,0x85,0xed,0x97,0xdd,0xad,0x83,0x30, + 0xc,0x85,0x4f,0x50,0x97,0x89,0x7,0xea,0x3c,0xcc,0xc3,0x14,0x4c,0x11,0x6f,0x83, + 0xef,0x43,0x65,0xe4,0x4b,0x21,0xb1,0x3,0x2d,0x2f,0x3d,0x52,0x24,0x12,0x41,0xce, + 0xe7,0xc4,0xf9,0x21,0x89,0x88,0xe0,0x46,0x3d,0x0,0x80,0x99,0x43,0x1f,0x11,0x4d, + 0xff,0xea,0xa5,0x3c,0xbb,0xcc,0x89,0x8,0x43,0xfc,0xa3,0xc9,0xd5,0xd6,0xd2,0x3c, + 0xcf,0x0,0x10,0x3,0x50,0x23,0x1b,0xb1,0x3e,0xf7,0x40,0x84,0x0,0xf6,0xcc,0xaf, + 0x80,0x70,0x1,0xd4,0xcc,0xcf,0x42,0x34,0x1,0x3c,0xe6,0x67,0x20,0x1e,0xde,0x4e, + 0xbd,0x8a,0xbe,0x1f,0x5e,0x5,0x57,0xeb,0x7,0xf0,0x3,0xb8,0x1d,0xa0,0xb9,0xc, + 0xf7,0x94,0x33,0x41,0xcf,0x50,0xe6,0xbe,0x83,0xa8,0x1b,0x20,0x67,0x2,0x73,0x59, + 0x37,0x1b,0x91,0x57,0x7d,0xab,0x65,0x59,0x30,0xc,0xed,0x1,0xe,0x4d,0x81,0x9a, + 0x5b,0x31,0x17,0xe4,0x4c,0xef,0x1d,0x3b,0xcc,0x43,0x0,0xd6,0xdc,0x6e,0xb5,0x44, + 0xd3,0x21,0xc4,0xa5,0x0,0xd6,0xd0,0xd3,0xf6,0x11,0x0,0x6b,0x54,0xca,0xb3,0xfb, + 0x26,0x54,0x5,0x20,0x9a,0x76,0x23,0x4a,0x69,0x84,0xc8,0xb8,0x9a,0x5b,0x10,0x91, + 0x11,0x29,0x8d,0x9f,0xbf,0xf,0x58,0x8,0xd5,0x36,0x31,0x8f,0xa6,0xe8,0x8,0xce, + 0x7d,0x1f,0x0,0x5e,0xd1,0x6a,0xc2,0x69,0x51,0x73,0x3b,0x2a,0x91,0x91,0xa8,0x2, + 0x6c,0xcd,0x55,0xcc,0x65,0x2d,0x56,0x3d,0x10,0x87,0x0,0x47,0xe6,0x2d,0x45,0x21, + 0x9a,0x53,0xd0,0x93,0xe9,0x11,0x8,0x57,0xe,0xd4,0x92,0xc8,0x3,0x51,0x53,0xd7, + 0x61,0x54,0x53,0x14,0xf4,0xd,0xe0,0x8a,0xcd,0xe5,0x14,0xc0,0x59,0x45,0x3,0x58, + 0x1,0xf4,0x5f,0xed,0xdb,0x4a,0x22,0x22,0x29,0xa5,0x5b,0xcc,0x1,0xe0,0xf,0xbd, + 0x70,0x9b,0xf3,0xfe,0xc3,0x2,0x5e,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/document.png + 0x0,0x0,0x2,0x39, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x12,0x0,0x0,0x0,0x12,0x8,0x6,0x0,0x0,0x0,0x56,0xce,0x8e,0x57, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, + 0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,0x2,0x6,0xb,0x2d,0xe,0x7, + 0x4e,0x83,0x31,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0, + 0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb, + 0xd,0x0,0x0,0xb,0xd,0x1,0xed,0x7,0xc0,0x2c,0x0,0x0,0x1,0xb6,0x49,0x44, + 0x41,0x54,0x38,0xcb,0x95,0x94,0xcd,0x4b,0xc2,0x70,0x1c,0xc6,0xa5,0x8e,0x41,0xd4, + 0xb1,0xff,0xa1,0x83,0xc7,0xe8,0xe8,0xa1,0xa0,0x63,0x14,0xf8,0x3f,0x88,0x20,0x4, + 0x11,0x74,0xf0,0x92,0x90,0x41,0x54,0x4,0x85,0x1e,0xa2,0x88,0x5e,0xa8,0xc8,0x22, + 0xa8,0x88,0x69,0x59,0x11,0x15,0x21,0x15,0x11,0xbd,0x88,0x9a,0x59,0xe6,0xda,0x24, + 0xb7,0x69,0x4b,0xcd,0xa7,0xdf,0x96,0x86,0xcd,0xe6,0xd6,0x17,0x3e,0x6c,0x83,0x2f, + 0x9f,0x3d,0x7b,0xe0,0x37,0x83,0x41,0x31,0x66,0xb3,0x19,0x5a,0x90,0xb5,0x7a,0x42, + 0xad,0xa1,0xda,0x48,0x8b,0xa1,0x50,0xa8,0x2,0x6a,0x6b,0x5d,0x96,0xb8,0x5c,0xae, + 0x92,0xac,0xa9,0xaa,0xac,0x24,0x52,0xe,0x4d,0xd3,0xb0,0x5a,0xad,0xf2,0xbd,0x2e, + 0x99,0x52,0xe4,0x76,0xbb,0x65,0xf2,0xf9,0x3c,0x6c,0x36,0x1b,0x2,0x81,0xc0,0x8f, + 0xcc,0x68,0x34,0xaa,0xcb,0xd4,0x12,0x49,0xe3,0x74,0x3a,0x65,0x99,0xc5,0x62,0x81, + 0xc9,0x64,0x2a,0x89,0x3a,0x8a,0x9d,0x7d,0x4f,0x67,0x6b,0x33,0x26,0x46,0x1c,0xb8, + 0x3c,0xf3,0xcb,0x57,0xe9,0x59,0x39,0x99,0x74,0x1a,0xd1,0xc8,0x77,0x5f,0x23,0xce, + 0x81,0x92,0xa8,0x9b,0xd0,0x58,0x1e,0xa6,0x8e,0xd0,0xa2,0xf6,0x69,0x12,0xb9,0x8f, + 0xc,0x84,0x37,0x6,0xf1,0xc8,0x2d,0x7c,0x9b,0x1e,0x55,0x51,0x8d,0x14,0x51,0x12, + 0x85,0xc3,0xe1,0x5f,0x49,0xa,0x85,0x2,0x72,0x62,0x1a,0xa2,0xc0,0x82,0x67,0x1f, + 0x91,0x8c,0x7,0x41,0xad,0x4e,0xaa,0x8a,0xaa,0x96,0x5d,0xe,0x13,0xbd,0xfa,0x9f, + 0xe8,0xf3,0x33,0x8f,0xac,0x28,0x40,0xe4,0x5f,0x91,0x4e,0xc6,0xc0,0xd3,0x41,0xa4, + 0x9e,0xaf,0xc0,0x84,0x4f,0x41,0x2d,0x8f,0xfe,0x2d,0xfa,0xab,0xec,0xac,0xc8,0x63, + 0x7c,0xd8,0x51,0x1,0x73,0xbf,0xf,0x6a,0x71,0x48,0x5f,0xd9,0xd9,0xc,0x7,0x91, + 0xa3,0x49,0x92,0x28,0xb8,0xc4,0x1d,0xde,0x62,0x97,0x48,0x46,0x4e,0xc0,0x4,0xfd, + 0x48,0x5c,0xef,0x80,0x9a,0x77,0x68,0x97,0x2d,0x89,0xde,0x53,0x9,0x8,0x6c,0x14, + 0xa3,0x83,0xfd,0x15,0xc4,0x2f,0xd6,0x40,0xcd,0xda,0xf5,0x75,0x24,0xb0,0xf,0xe0, + 0x5e,0x6e,0x48,0x92,0x73,0x24,0x43,0xc7,0x60,0xee,0x76,0x49,0x92,0x6d,0x59,0xf2, + 0x74,0xb6,0x0,0x6a,0xa6,0x4f,0x5b,0x74,0xe4,0xdf,0x94,0x39,0xf4,0xae,0xe0,0x60, + 0x7b,0x16,0xfb,0x1b,0x6e,0xec,0x79,0xc6,0xb0,0xbb,0x34,0x8,0xdf,0x9c,0x1d,0xde, + 0xe9,0x5e,0x50,0x53,0x3d,0xda,0x22,0x69,0x41,0x2f,0xaa,0xa2,0xe2,0xb9,0x69,0x23, + 0x74,0x15,0x97,0xb4,0x68,0xff,0x75,0xd6,0x94,0xa5,0x13,0x1a,0x8a,0x6f,0xd2,0x42, + 0xfe,0xc9,0x7d,0x1,0xf0,0x94,0x38,0xfd,0xac,0xef,0xa5,0x3b,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/scolor.png + 0x0,0x0,0x0,0x98, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0xf,0x4,0x3,0x0,0x0,0x0,0x1f,0x5d,0x52,0x1c, + 0x0,0x0,0x0,0x21,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x0,0xff,0xff,0x0,0xff, + 0x0,0xc4,0xc4,0xc4,0xff,0x0,0xff,0xff,0x0,0x0,0x84,0x0,0x0,0xff,0xff,0xff, + 0xff,0xff,0x0,0x0,0x84,0x84,0x0,0x0,0xff,0x89,0xd4,0x2d,0x82,0x0,0x0,0x0, + 0x32,0x49,0x44,0x41,0x54,0x78,0xda,0x63,0x30,0x86,0x2,0x6,0x3,0x6,0x30,0x0, + 0x32,0x42,0x3,0x3a,0x1a,0x5c,0x1c,0xb0,0x32,0xe0,0x6a,0x94,0x14,0x56,0x2d,0x10, + 0x14,0xc0,0xca,0x80,0xab,0x49,0x4b,0x98,0x39,0xa1,0xbc,0x0,0x2b,0x3,0xa6,0x6, + 0x66,0x3b,0x0,0x33,0xc2,0x1c,0x54,0x94,0x2f,0x87,0xdc,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/delete.png + 0x0,0x0,0x3,0x41, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0xd3,0x49,0x44,0x41,0x54,0x48,0xc7,0x7d, + 0x95,0x4b,0x68,0x53,0x41,0x14,0x86,0x6f,0xdb,0x24,0x8d,0x90,0x84,0x42,0xb0,0x75, + 0x51,0x50,0xe3,0xae,0xb5,0xb,0x25,0x1b,0xab,0x5d,0xf8,0xd8,0x55,0xeb,0x6b,0x61, + 0x97,0xd2,0x22,0x94,0x74,0xd5,0xee,0xdc,0xa8,0x20,0xa,0xae,0xbb,0x4a,0x41,0xa8, + 0xb8,0x12,0x45,0x54,0x74,0xa1,0xa0,0x58,0x15,0x1f,0xa0,0x1,0x6b,0x35,0xd2,0x2a, + 0x5a,0x6c,0x2b,0xa9,0x56,0xe9,0x4b,0xd3,0x3c,0x3c,0xfe,0xe7,0xe6,0x4c,0x66,0xee, + 0x24,0x6d,0xe0,0x63,0xee,0xcd,0xfc,0xf3,0xdf,0x99,0x73,0xe6,0xcc,0x38,0x44,0xe4, + 0x98,0xe0,0x57,0x7,0xf8,0xa1,0x1e,0xf8,0x41,0xad,0xad,0x31,0xb4,0xb5,0x86,0x36, + 0xc0,0x63,0xcb,0x7d,0x86,0xa8,0x46,0x8c,0x88,0xfa,0xfb,0x73,0x32,0x60,0x23,0x8, + 0x1,0x5f,0x15,0x53,0x9f,0xab,0x1d,0x18,0x50,0xda,0x46,0x10,0x16,0x8f,0x1a,0x53, + 0xe8,0x9a,0xfe,0x1b,0x1a,0xa2,0x62,0x77,0x37,0xe5,0x4b,0x62,0x66,0x33,0x88,0x70, + 0x7f,0x85,0x36,0x99,0xa4,0x62,0x4f,0xf,0x15,0x3,0x1,0xa5,0x8d,0x81,0x6,0xb7, + 0xdf,0x5c,0x7e,0x11,0xa6,0x85,0xde,0x5e,0xca,0xb7,0xb4,0x50,0x16,0xef,0xdf,0xb5, + 0xf9,0x56,0x65,0xae,0x4c,0x8b,0xc3,0xc3,0x54,0x48,0x24,0x28,0xdf,0xd6,0x46,0xcb, + 0x78,0x1f,0xd7,0xda,0x98,0xab,0x15,0x63,0x5a,0x4d,0x24,0x72,0xab,0x98,0x69,0xb6, + 0xb5,0x95,0xfe,0xe2,0xfd,0xf,0x58,0x0,0xd3,0xde,0x1,0x51,0x7e,0xce,0xc3,0x14, + 0xfa,0xb2,0x76,0x12,0x5c,0x6,0x67,0x1d,0xa7,0x20,0xda,0x26,0x65,0x1c,0xe4,0x3f, + 0x96,0xc0,0xa2,0xb4,0x8a,0x5f,0x5e,0x73,0xca,0xc1,0x34,0xb,0xd3,0x15,0x98,0x2e, + 0x89,0xe9,0x8,0x38,0xae,0x35,0xed,0xa0,0x59,0x19,0x7,0x24,0xf8,0xf4,0x19,0xcc, + 0x89,0xe1,0x6f,0x69,0x99,0xc5,0x78,0x9c,0x56,0x6,0x7,0x69,0xb9,0xaf,0x8f,0x16, + 0x60,0xca,0x7d,0x69,0x99,0xe9,0x31,0x6d,0xda,0x5,0x76,0xb8,0x5e,0x46,0x8c,0x43, + 0x92,0x28,0xfa,0x8,0x66,0x40,0x46,0x3e,0xc2,0xfc,0x88,0x46,0x69,0x1e,0xf1,0xfc, + 0x19,0x8b,0xb9,0xef,0xef,0x40,0x12,0x1c,0xd1,0xa6,0x98,0xb4,0xb3,0x4b,0x3c,0x42, + 0xf6,0xf6,0x89,0x48,0xa2,0x5c,0x73,0xe,0xc1,0x6c,0x15,0xde,0x8b,0xe9,0x61,0xaf, + 0x69,0xbb,0x91,0x64,0x9f,0xbd,0x37,0xfd,0xd2,0xc1,0x89,0xa2,0x19,0x2c,0xff,0x1b, + 0x66,0x3a,0x85,0x67,0x93,0x97,0xe0,0x82,0x36,0x3d,0x1,0x3a,0xca,0xbb,0x41,0xb6, + 0x65,0xb5,0x6a,0xf2,0xab,0xec,0x67,0x10,0xd3,0xaf,0x58,0xfe,0x27,0x3c,0x9b,0x70, + 0x18,0x6e,0x6a,0xe3,0x4e,0xb0,0x5d,0xc6,0xf8,0x2b,0x2a,0xcf,0xde,0xfc,0xf3,0xc8, + 0xfe,0x34,0x12,0x35,0x81,0x98,0xa6,0x25,0x51,0x8a,0xf,0x20,0x5,0x9e,0x68,0xf3, + 0xf5,0x8d,0x95,0xe9,0x1c,0x4c,0xa7,0xb0,0xa5,0xd2,0xc8,0xfe,0x98,0x18,0x3c,0x0, + 0xaf,0xc0,0x5b,0x30,0x26,0xed,0x1b,0x30,0x6a,0x17,0x86,0x1d,0xa,0x55,0xfb,0x19, + 0x98,0x7e,0x81,0xe9,0x38,0x4c,0x79,0x56,0xf7,0xc1,0x25,0x70,0x1a,0x5c,0x5,0xcf, + 0xc5,0x30,0x25,0x2d,0x7f,0xec,0x51,0x65,0x85,0xfa,0x3c,0x25,0x3d,0x8b,0xda,0x9f, + 0x84,0x69,0xa,0xa6,0x9c,0xa0,0xbb,0xe0,0x3c,0x38,0x60,0x14,0xc8,0x3d,0xf0,0xc, + 0xbc,0x90,0x24,0x72,0xfb,0x18,0x5c,0xf3,0x9e,0x2d,0xa1,0x72,0x49,0x4f,0xe0,0x94, + 0x4a,0xe3,0x40,0x79,0x8d,0x64,0xf1,0xc0,0xdb,0xe0,0x1c,0xd8,0xef,0xcd,0x7e,0xa7, + 0x32,0x67,0xb3,0xa7,0xf2,0x91,0x5b,0x32,0x81,0x84,0x2e,0xe9,0x46,0x4f,0x49,0x8f, + 0x6,0x83,0xf4,0x10,0xed,0x75,0x70,0x6,0xec,0xf3,0xee,0xd3,0xe,0x49,0x12,0x43, + 0x77,0x24,0x4c,0x37,0xc0,0x45,0x70,0x48,0x6b,0x77,0xdb,0x25,0xdd,0xc4,0x1d,0x57, + 0x24,0x9e,0x7b,0x2b,0x37,0xbf,0x3a,0x84,0xa2,0x6a,0x9f,0x8f,0x94,0xe,0x1e,0x3a, + 0xa8,0xb5,0x47,0x41,0xdc,0x3c,0x84,0xea,0x24,0xe8,0xdb,0x58,0x70,0x52,0x2f,0xa9, + 0x4b,0xca,0xd4,0x3e,0x36,0xcb,0x15,0x7a,0x4a,0x6b,0xd9,0x74,0x8f,0x78,0x44,0xec, + 0xad,0xd6,0xa0,0xcc,0x65,0x49,0x3b,0xc1,0x96,0x35,0xe,0xfa,0x88,0xf4,0x29,0x6d, + 0x5c,0xc6,0xea,0x83,0xde,0xba,0x9a,0x78,0xc0,0x26,0x37,0x4e,0xa5,0xf0,0x84,0xd7, + 0xb9,0x9a,0xc2,0xa2,0x69,0x96,0x31,0x91,0x8a,0xab,0xc9,0xba,0x4c,0xf9,0x72,0xdc, + 0x60,0x5f,0x90,0x6b,0x68,0x3,0xa2,0xad,0x37,0xb5,0xff,0x1,0x3d,0xa9,0x97,0x96, + 0x8a,0x42,0x62,0x69,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + + // /home/grosse/Workarea/mccwb/src/QMcCad/images/copy.png + 0x0,0x0,0x1,0x30, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x34,0x21,0xf5,0x4c,0xf9,0xc6,0x0,0x0,0x0,0xbd,0x49,0x44, + 0x41,0x54,0x78,0xda,0xd5,0x94,0x51,0xe,0x84,0x20,0xc,0x44,0x67,0x88,0xc7,0xf2, + 0xe,0x5e,0xc6,0x3f,0xb3,0x7e,0xb0,0x57,0xf3,0x5c,0xdb,0xfd,0x70,0x35,0xa4,0x14, + 0x10,0x70,0xb3,0xd9,0x26,0xc4,0x84,0xd6,0xd7,0x71,0x2c,0x0,0xff,0x16,0x4,0x20, + 0x17,0x6a,0xda,0xc0,0x22,0x36,0x9b,0x64,0x33,0x7c,0x30,0x20,0xc0,0xde,0xed,0x7c, + 0x92,0x94,0x5a,0xf8,0xa0,0x41,0x56,0xb4,0xc0,0x4f,0x2b,0x2c,0xc5,0xfb,0x9e,0x2f, + 0x20,0x56,0x66,0x4,0xd9,0xb1,0xff,0x58,0x9f,0xc9,0xfb,0xcf,0x8a,0xc3,0x85,0x1e, + 0xeb,0x15,0xda,0xa3,0x73,0x47,0x8c,0xe3,0x2,0xb,0x7e,0xc9,0xe3,0x5c,0x7e,0x9a, + 0x0,0x60,0xc1,0xb6,0x41,0x42,0x5b,0x92,0x53,0xa1,0x61,0xa9,0xa9,0x99,0x67,0x7, + 0xe0,0x15,0xc1,0xbb,0x15,0x93,0x4f,0xb5,0xe3,0x5,0x58,0xd9,0xa5,0x58,0xe4,0x91, + 0x6c,0xd4,0xad,0xb8,0xfa,0xe4,0x95,0x14,0x97,0x9a,0x7f,0x4d,0xb1,0x4b,0xcd,0xb0, + 0x9e,0xd7,0x5c,0x8d,0xae,0x3d,0x14,0x97,0xbe,0x51,0xba,0x3c,0x2e,0x5e,0x2a,0xad, + 0x1e,0xd7,0xbc,0x74,0x9b,0xe2,0xf8,0x10,0xfc,0x30,0xde,0x62,0xda,0x9a,0xba,0x70, + 0x84,0x8f,0x14,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/person.png + 0x0,0x0,0x0,0xdc, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x4b,0xd6,0xfb,0x6c, + 0x0,0x0,0x0,0x6,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x0,0x0,0x6e,0xa6, + 0x7,0x91,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff, + 0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x7f,0x49,0x44,0x41,0x54,0x78,0xda,0xcd,0x53, + 0x41,0xe,0xc0,0x20,0x8,0x6b,0x17,0xff,0xff,0xe5,0xee,0x40,0xb2,0x30,0x87,0xa2, + 0x9b,0x26,0xe3,0x86,0xb6,0x95,0x82,0x0,0xbb,0x43,0x92,0xa4,0x4f,0x7c,0x40,0xa6, + 0xf3,0x89,0x9f,0xaa,0x1c,0xdb,0x1b,0x31,0x62,0xa4,0x38,0x74,0x2a,0x57,0x7,0x49, + 0x0,0xb4,0x6b,0xf2,0x5d,0x99,0x20,0xb9,0xa0,0x17,0xec,0xd6,0x79,0x7b,0xb0,0x65, + 0xa4,0xf8,0xa4,0x6f,0x9e,0xd,0xb7,0xb,0x8c,0xfc,0x43,0x22,0xb6,0x17,0x8e,0xd9, + 0x46,0x38,0x24,0xe1,0xf9,0xd6,0x53,0x9f,0x32,0xfd,0x42,0x7e,0xbb,0xae,0xa1,0x84, + 0x87,0x13,0xfc,0x9,0x95,0x14,0x94,0x0,0x6,0x4b,0x6d,0xc2,0x26,0xac,0x46,0xe0, + 0x7a,0x47,0xf2,0x86,0x3f,0xc0,0x27,0xc4,0xf,0x9e,0x9e,0x78,0x71,0xdc,0x47,0x0, + 0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/fitall.png + 0x0,0x0,0x2,0x74, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0xf9,0x43, + 0xbb,0x7f,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x10,0xf,0x5,0x5,0x91,0x61,0x82,0x4a,0x0,0x0,0x2,0x1,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0xdb,0xd5,0x83,0x20,0xc,0x80,0x31,0xc7,0x65,0x64, + 0x20,0xd7,0x69,0xff,0x75,0x9c,0x82,0x29,0x70,0x1c,0xfb,0x84,0x7f,0x54,0x2e,0x49, + 0x0,0x45,0xf2,0xd4,0x9e,0x52,0xcc,0x47,0x8,0xb9,0xc8,0x60,0xad,0xdd,0x54,0x7, + 0x2,0x3d,0x40,0x18,0x63,0xfa,0x0,0xe9,0xc6,0x22,0x4a,0x29,0x35,0xe2,0x2f,0xd3, + 0x34,0x89,0x26,0x19,0xfe,0x86,0x22,0xca,0x6c,0x1f,0xbe,0xbb,0xae,0xeb,0x7a,0x5, + 0xc1,0x3f,0xa4,0x44,0x2f,0x7a,0xff,0x6c,0x67,0x1b,0x1e,0xa7,0x97,0xff,0x71,0x76, + 0x8e,0xce,0xe7,0x16,0x24,0x36,0x5f,0x68,0xe1,0xd9,0x5b,0x4b,0x2f,0x7a,0x87,0xb0, + 0xb3,0x4d,0x42,0x38,0xe5,0xad,0x9d,0xf,0x50,0x67,0xc1,0x73,0xe1,0x67,0x54,0xf1, + 0x11,0x2a,0xc0,0x19,0x2,0x5b,0x24,0x6,0xe3,0x3,0x2a,0xe,0x82,0x21,0x92,0x63, + 0x3d,0x10,0x1c,0x18,0xfc,0x1c,0x2a,0xc,0xdc,0x9,0x51,0x13,0x6,0x4a,0x42,0xa4, + 0x1c,0x5a,0x34,0x8e,0x8,0x3,0x25,0x21,0x6a,0x9,0x5,0x6,0x5a,0x87,0xa0,0xc2, + 0x0,0xe5,0xcf,0xad,0x48,0x4c,0x1f,0x48,0x5,0xbb,0x16,0xc5,0xa7,0x1f,0xbc,0xc5, + 0x1a,0x29,0xbd,0xe0,0x6d,0xd6,0x8,0xe9,0x9,0x35,0xad,0x81,0x53,0xd,0x49,0xda, + 0xc1,0xb1,0x4a,0x3a,0x8e,0x10,0x2,0x57,0x8,0x2,0xa7,0x1b,0xee,0x73,0x2d,0x8b, + 0x43,0x6e,0x94,0x8e,0x41,0x84,0x56,0x53,0xa,0x13,0x5b,0x54,0x38,0xd7,0x15,0xfb, + 0x79,0x5d,0x1,0x22,0x17,0x6,0xa7,0x36,0x76,0xb6,0x87,0x3a,0x8,0xee,0xb2,0x44, + 0xd,0x98,0xf8,0xa9,0x25,0x84,0x28,0x91,0x57,0xe5,0xc0,0x8c,0xa5,0x1c,0xbc,0x84, + 0xb2,0xd2,0x83,0x25,0x8,0x52,0x7a,0x5,0x4b,0x2f,0x86,0xdb,0x35,0x7a,0xf9,0x86, + 0xb7,0x16,0xb5,0x56,0x78,0x2c,0x10,0x6,0xb6,0x3e,0xe4,0x14,0x3e,0x54,0x7,0xf6, + 0xcd,0xc5,0x39,0x18,0x28,0xfe,0xb,0xb9,0x55,0x9c,0xe4,0x34,0x92,0x40,0xa4,0xb6, + 0x1e,0x94,0x28,0x49,0x39,0x30,0x52,0x8,0x56,0x64,0xdf,0x3e,0xdb,0x45,0x1,0xa9, + 0xe3,0x3b,0x98,0x73,0xae,0x55,0x32,0x8f,0xc3,0xd,0xbd,0xf1,0x96,0xaa,0xee,0xbb, + 0x54,0x2f,0xb,0xfa,0x6e,0x62,0x77,0x51,0x21,0xb6,0x5a,0x19,0xa6,0xf4,0x4,0xe, + 0x75,0xab,0xd6,0xa8,0x5e,0x21,0xde,0x59,0xb7,0x83,0x84,0xbe,0x35,0x6b,0x90,0xba, + 0x28,0xad,0xc0,0xa4,0x1a,0x86,0xa4,0x6,0xdd,0xd3,0x30,0x94,0xae,0x27,0x50,0xf7, + 0xe3,0x53,0x30,0xd4,0xd6,0x2d,0x70,0x9c,0x8b,0x2,0x43,0xcd,0xcd,0x28,0xe3,0x38, + 0xfd,0x67,0xe0,0x9e,0x14,0x29,0x18,0x4a,0xa2,0x49,0x29,0xa7,0xb9,0x4d,0x74,0x56, + 0x8a,0x42,0x7d,0xc7,0x17,0x83,0x49,0x41,0x9c,0xdf,0x51,0x66,0x95,0xba,0x5c,0x18, + 0xdf,0x3,0x1d,0xc,0x56,0x3a,0x6,0x41,0x7d,0x4b,0x5c,0xc,0x84,0x62,0x9d,0xbd, + 0xbb,0x88,0x2c,0x73,0x81,0xf2,0x58,0x34,0x27,0x10,0xf,0xf8,0x52,0x8d,0xf4,0xc2, + 0xc0,0x65,0x52,0xc2,0x5,0x2,0xc9,0xe5,0x0,0x9f,0xac,0xeb,0xaa,0x8c,0x31,0x47, + 0x90,0xb7,0x4a,0x57,0x97,0x6a,0x46,0x4c,0xd5,0x5d,0x61,0xf5,0x46,0xf9,0x1,0x14, + 0xf6,0x76,0x2f,0x58,0xb7,0x32,0x2e,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/wzoom.png + 0x0,0x0,0x1,0x8d, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x54,0x49,0x44,0x41,0x54,0x58,0x85,0xcd,0x97,0xdd,0x91,0x83,0x30, + 0xc,0x84,0xd7,0x37,0xd4,0x90,0x1e,0xac,0x26,0xe,0x9a,0x48,0x11,0xa9,0xc2,0xd7, + 0x44,0x8a,0x48,0x13,0xf8,0x9a,0x30,0x3d,0xa4,0x9,0xdd,0x83,0x4f,0x10,0xc,0xc, + 0xc8,0x40,0x9c,0x7d,0xc9,0x8c,0x7f,0xa2,0xf,0x59,0x5a,0x8f,0xd,0x33,0x33,0xa, + 0xaa,0x2,0x0,0x63,0x7e,0xde,0x1e,0x38,0x84,0x2b,0x88,0x28,0x2,0xc8,0x80,0x56, + 0xd6,0x5a,0x74,0x5d,0xa7,0xde,0x47,0xf4,0x80,0xf7,0x1e,0x0,0xf0,0xa5,0xde,0x7d, + 0xb0,0x8a,0x3,0x54,0x6b,0xb,0x88,0x6e,0x93,0xb1,0x10,0xee,0xe7,0x3,0xc,0x81, + 0xdd,0xe2,0x1c,0x73,0x7b,0x3c,0x40,0x1a,0x98,0xf9,0x7b,0xb2,0xc9,0x18,0xf7,0xff, + 0xfb,0xb,0xc0,0xed,0xca,0xc8,0x8,0x20,0x6,0x5f,0xe,0x2c,0x92,0x39,0x1,0x20, + 0xba,0x65,0x43,0x24,0x45,0xb8,0x1e,0x7c,0xe,0x64,0x8f,0x7a,0x80,0xe1,0x5c,0x75, + 0x7f,0x1a,0xd7,0xbb,0xd9,0x62,0x55,0x1,0x94,0xd2,0xb,0x80,0xcb,0x4e,0xe9,0x9e, + 0x2c,0x7c,0x52,0x6,0xca,0x68,0xd5,0x9,0xb5,0xb2,0xd6,0x96,0x5,0xd0,0xde,0x8e, + 0xa3,0x22,0x8c,0xc6,0xa2,0xd7,0x1e,0x47,0x2c,0x5e,0x3,0x3d,0x80,0xd0,0x6b,0xb3, + 0x20,0x5f,0xef,0x7d,0xde,0xc5,0x34,0x6b,0xc5,0x5b,0x21,0x5e,0xd7,0xd5,0x75,0x83, + 0xe7,0x53,0x57,0x80,0x40,0x52,0x84,0x21,0xdc,0x7b,0x33,0x91,0x1b,0x6f,0xfe,0x36, + 0x94,0xc0,0x6e,0x34,0x5e,0xd7,0xd,0xbc,0x6f,0x71,0xb9,0x6c,0x2f,0xc4,0x49,0x17, + 0xc8,0x51,0xa4,0x20,0x63,0xc9,0x98,0xa4,0xbd,0xc9,0x86,0x58,0x6c,0xc3,0x14,0x64, + 0x6e,0xce,0xda,0xd8,0x76,0x44,0x6d,0x36,0xc4,0xaa,0xf,0x6c,0x69,0xad,0x10,0xf2, + 0x21,0xe,0x6b,0xc3,0x10,0x3a,0xc,0x47,0x32,0x40,0xac,0x15,0xe6,0xa1,0x3e,0x90, + 0x3,0x71,0xb8,0x11,0x69,0x21,0x4e,0x71,0x42,0xd,0x44,0x5f,0x84,0x44,0x8f,0x13, + 0x50,0xea,0x4,0x62,0xfa,0x6,0xad,0x80,0xf8,0x2e,0x94,0xb7,0xda,0xbb,0x65,0x98, + 0x99,0x8d,0x31,0x45,0x82,0x3,0xc0,0x1f,0x67,0xc4,0x9b,0xa1,0x4b,0x7a,0x92,0x78, + 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/material.png + 0x0,0x0,0x1,0x25, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0xf,0x8,0x6,0x0,0x0,0x0,0xed,0x73,0x4f,0x2f, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8e,0x7c,0xfb,0x51,0x93, + 0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83, + 0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe8,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60, + 0x0,0x0,0x3a,0x97,0x0,0x0,0x17,0x6f,0x97,0xa9,0x99,0xd4,0x0,0x0,0x0,0xb0, + 0x49,0x44,0x41,0x54,0x78,0x9c,0x62,0xfc,0xff,0xff,0x3f,0x3,0x25,0x0,0x20,0x80, + 0x58,0xf0,0x4b,0x33,0xe2,0x30,0xfd,0x3f,0x23,0x8c,0x5,0x10,0x40,0x78,0xc,0x0, + 0x69,0x46,0x28,0xc4,0x25,0x7,0x10,0x40,0x4c,0xa4,0x6b,0x86,0xb9,0x0,0xe2,0x3a, + 0x80,0x0,0xc2,0x61,0x0,0xcc,0x10,0xc2,0xae,0x3,0x8,0x20,0x4c,0x2f,0x30,0x2, + 0x25,0xff,0xc3,0x6c,0xc0,0x61,0x8,0x48,0x2b,0x54,0x6,0x20,0x80,0xb0,0x87,0x1, + 0xd8,0x10,0xa8,0x42,0x2,0x0,0x20,0x80,0x58,0xc0,0x8a,0xf1,0xd9,0x42,0xc0,0x10, + 0x80,0x0,0xc2,0x13,0x6,0xc4,0x1,0x80,0x0,0x62,0x81,0xf8,0x17,0xd9,0x66,0xa8, + 0x8b,0x88,0xf4,0x2,0x40,0x0,0x61,0xf,0x3,0x58,0x20,0xe2,0x8a,0x7,0x24,0x83, + 0x1,0x2,0x8,0xd3,0x80,0xff,0x88,0x38,0xc6,0x99,0x16,0xfe,0x23,0xc2,0xd,0x20, + 0x80,0xf0,0x84,0x1,0x71,0x9,0x9,0x20,0x80,0x70,0x18,0x80,0xec,0xa,0x6c,0x0, + 0x91,0x90,0x0,0x2,0x8,0x4f,0x5e,0xc0,0x67,0x8,0xc2,0x75,0x0,0x1,0x6,0x0, + 0x8c,0x88,0x32,0x2d,0xb6,0x60,0x6,0x89,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/leftarrow.png + 0x0,0x0,0x2,0xb5, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x47,0x49,0x44,0x41,0x54,0x48,0xc7,0xdd, + 0x95,0xbd,0x6b,0x53,0x61,0x14,0xc6,0x7f,0xcf,0x7b,0x6f,0x62,0x62,0x5b,0x63,0x45, + 0x7,0x11,0x45,0xdb,0x4a,0xa3,0xd0,0xae,0x5d,0xba,0xe8,0x50,0x5d,0x4,0xab,0xc5, + 0xf,0xa8,0x5d,0xb4,0x9d,0x4,0x8b,0x8b,0xd0,0xc9,0x3f,0x43,0xc5,0x41,0xe8,0xa4, + 0x82,0x5,0x7,0x45,0x10,0x95,0x22,0x38,0x75,0xe8,0xe6,0x52,0x8b,0x83,0xa8,0x68, + 0x31,0x4d,0xdb,0x24,0xb4,0x37,0x39,0xe,0xb9,0xb9,0xbd,0x8d,0x31,0x29,0x42,0x17, + 0xf,0x3c,0xbc,0xe7,0x7e,0x3c,0xcf,0x39,0xef,0x79,0xcf,0x3d,0x57,0x66,0xc6,0x4e, + 0x98,0x63,0x87,0xec,0x3f,0x15,0x96,0x34,0x24,0x69,0x46,0xd2,0x19,0x49,0x4e,0x92, + 0x5a,0x92,0xcc,0xac,0x29,0x80,0xa1,0x4c,0x67,0xd2,0x2e,0x4e,0xb4,0x1b,0xf0,0x1c, + 0x48,0x1,0x5e,0x2b,0x9e,0x6b,0x91,0x69,0x7f,0x72,0x97,0x7b,0x75,0xe5,0x46,0x96, + 0x43,0xdd,0x5,0x80,0x73,0xc0,0x6e,0xc0,0xff,0xe7,0x52,0x48,0xba,0x90,0x6e,0xf3, + 0xe7,0x47,0xc6,0x7a,0xe9,0xca,0xa,0xdf,0x8f,0xda,0x72,0x9,0x28,0x49,0xb2,0x3a, + 0xdc,0x97,0xe4,0xd7,0xca,0xa4,0x46,0x7d,0x2c,0xa9,0xbf,0xad,0x23,0x31,0x3f,0x3e, + 0xd9,0xc7,0xd1,0xde,0xa,0xcb,0x6b,0x9f,0x29,0xad,0xe7,0x48,0xa7,0xf7,0xb2,0x3f, + 0xd3,0x8d,0x44,0x4,0x4,0x5f,0x7f,0xce,0x71,0x77,0xdc,0x0,0xf6,0x0,0x45,0x33, + 0xb,0xfc,0x6,0xa2,0xe7,0x9d,0xd3,0xcc,0xf0,0xd5,0x1e,0x8e,0xf4,0x4,0xfc,0xca, + 0x2f,0x50,0x2e,0x17,0xf0,0x1d,0x4,0xeb,0x39,0xbe,0x2f,0xcd,0x21,0x57,0xdd,0xaa, + 0x5c,0x15,0x5f,0x16,0x22,0x7a,0x3b,0xb0,0x1,0x6c,0x15,0x96,0x74,0x36,0xd3,0x99, + 0x9c,0xb9,0x7e,0xb3,0x8f,0xae,0xac,0xb1,0xbc,0xba,0x88,0xca,0x45,0x3c,0x7,0x4e, + 0x55,0x11,0xe7,0x40,0xc4,0x7c,0x81,0xbf,0x59,0xd0,0x34,0x90,0x27,0x7e,0x8,0x92, + 0x3a,0x52,0x29,0xef,0xe5,0xd8,0xc4,0x9,0x8e,0x1d,0x5f,0x27,0x97,0xfb,0x44,0xb9, + 0x52,0x88,0xc8,0x71,0x51,0x17,0x13,0x55,0x18,0x34,0x34,0xbf,0x76,0x6e,0xf1,0x8c, + 0x85,0x8c,0xec,0xc9,0xa,0xcb,0x2b,0x8b,0x58,0xb8,0xfd,0x78,0x3d,0x5d,0x3,0x51, + 0xb9,0x2d,0x19,0xff,0xd9,0x15,0x66,0x96,0x2f,0x15,0x2b,0xf,0x1e,0x4f,0x7f,0xa4, + 0xbc,0xb1,0x86,0xe7,0xc0,0x57,0x8,0x17,0x5b,0xeb,0xfc,0x84,0x3,0x4f,0xad,0xdb, + 0x6d,0x6a,0xf6,0xf5,0xc6,0xa3,0x17,0xcf,0xc,0x67,0x55,0x42,0x2d,0x40,0x22,0x26, + 0xe2,0xb9,0xf0,0x7e,0x2c,0x48,0xbd,0xd5,0x77,0x45,0xe,0xb8,0xfd,0x61,0x16,0xcf, + 0x73,0x76,0x6d,0xf8,0x52,0x95,0xe8,0x14,0x96,0x20,0xb6,0xfd,0xea,0xb5,0x70,0x5e, + 0xf5,0x9d,0xa6,0xc2,0x66,0x56,0x96,0xb4,0x2,0x4c,0xbe,0x7f,0x87,0x9c,0x18,0x1d, + 0xb9,0xc,0x5e,0x2,0x7e,0x7c,0x83,0xc2,0x2a,0x98,0x36,0x6b,0x5c,0x5b,0x8b,0x6b, + 0x91,0x44,0x0,0x54,0xfe,0x3a,0x2b,0xc2,0x80,0xfb,0x80,0xe9,0x53,0xa7,0xb1,0x7b, + 0xf,0xb1,0x3b,0x53,0x18,0x34,0xc5,0x53,0xe0,0x20,0x90,0x32,0xb3,0xc6,0xdf,0xbc, + 0x99,0x5,0x92,0xf2,0xc0,0xad,0xb7,0x6f,0xc0,0x39,0x46,0x7,0x6,0xa2,0xc7,0x83, + 0xc0,0xa,0x50,0x8a,0x51,0x2,0xa0,0x8,0xac,0x86,0x3e,0xad,0x26,0x5b,0x94,0xf9, + 0xe0,0x20,0x6,0x3c,0x1,0xba,0x80,0x3,0x40,0x47,0xc,0x6d,0xe1,0xd4,0xf3,0xa3, + 0x31,0xb1,0x8d,0xb1,0x59,0x13,0x9f,0x2,0xe,0x87,0xf3,0x20,0xd9,0x8a,0xa7,0xed, + 0xfc,0x4c,0x25,0xf9,0x80,0x17,0xb6,0x67,0x19,0x8,0xcc,0xac,0xd2,0x8c,0xf3,0x1b, + 0x9f,0xf3,0x34,0x4f,0x8f,0xf9,0xca,0x81,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/VG.png + 0x0,0x0,0x4,0x45, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xd6,0x0,0xd6,0x0,0xd6,0x19,0x42, + 0xf,0xe5,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x1c,0x9,0x17,0x13,0x53,0x1a,0x84,0xc2,0x0,0x0,0x3,0xd2,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0xdb,0x4e,0xfa,0x4a,0x14,0xc6,0x3f,0xb0,0x16,0x41, + 0x2d,0x1e,0x30,0x44,0xa3,0x21,0x12,0x8c,0x67,0x4c,0x88,0x26,0x24,0x34,0x4a,0x14, + 0x34,0x94,0x20,0xd1,0xf8,0x28,0xbe,0x83,0xf1,0x51,0xbc,0xf2,0x44,0xf1,0x4a,0xc5, + 0xa8,0xd7,0xc6,0x13,0x46,0x45,0x7d,0x0,0x95,0xa0,0xde,0xa9,0xf8,0xdf,0x57,0x3b, + 0xd9,0xff,0x3d,0x33,0xd8,0x96,0x69,0x25,0xce,0xe5,0xc7,0x2a,0xf4,0xd7,0x59,0x6b, + 0xbe,0xd5,0x15,0x6c,0xf9,0x7c,0xfe,0xf,0x7e,0xc1,0xb2,0xff,0x6,0x88,0x5c,0x2e, + 0x7,0xe1,0xbf,0x42,0x36,0x9b,0xc5,0xf2,0xf2,0x32,0x11,0xd8,0xdb,0xdb,0xb,0x55, + 0x55,0x2d,0xbb,0xb1,0xa5,0xa5,0x25,0xe4,0xf3,0x79,0x42,0x5f,0x5d,0x5d,0x45,0x2a, + 0x95,0xfa,0x7e,0x47,0x62,0xb1,0x18,0x24,0x49,0x22,0x82,0x1e,0x1e,0x1e,0x70,0x7a, + 0x7a,0x6a,0x9,0xc4,0xed,0xed,0x2d,0x15,0xa2,0xb1,0xb1,0x11,0xf1,0x78,0x5c,0x5b, + 0x6a,0x89,0xa2,0x8,0x45,0x51,0xa8,0x81,0x1b,0x1b,0x1b,0x96,0x80,0xac,0xaf,0xaf, + 0x53,0x75,0x45,0x51,0xd0,0xd0,0xd0,0xa0,0xbd,0x46,0x16,0x17,0x17,0xa9,0x81,0xd9, + 0x6c,0x16,0xef,0xef,0xef,0xa6,0x42,0x7c,0x7e,0x7e,0x22,0x93,0xc9,0x50,0x3f,0x63, + 0xdd,0x17,0x13,0x64,0x64,0x64,0x4,0x81,0x40,0x80,0x8,0x7c,0x7b,0x7b,0xc3,0xee, + 0xee,0xae,0xa9,0x20,0x47,0x47,0x47,0x78,0x7a,0x7a,0xa2,0xd6,0xe8,0xd8,0xd8,0x98, + 0xfe,0x53,0x8b,0x45,0x6f,0x76,0x7a,0xb1,0xd2,0x6a,0x61,0x61,0xc1,0xd8,0xf1,0x3b, + 0x3f,0x3f,0xf,0x41,0x10,0x8,0xfd,0xf8,0xf8,0x18,0x8f,0x8f,0x8f,0xa6,0x40,0x94, + 0x4a,0x25,0xe4,0x72,0x39,0xf2,0x6,0xed,0x76,0xa4,0xd3,0x69,0x63,0x20,0x6d,0x6d, + 0x6d,0x98,0x9a,0x9a,0x22,0xf4,0xaf,0xaf,0x2f,0x6c,0x6e,0x6e,0x9a,0x2,0xa2,0xaa, + 0x2a,0x3e,0x3e,0x3e,0x8,0x5d,0x96,0x65,0x74,0x74,0x74,0x18,0x37,0x44,0xd6,0x76, + 0x9a,0x5,0xc2,0x4a,0xdb,0xef,0x8a,0xfc,0x5b,0x90,0xc9,0xc9,0x49,0xb4,0xb7,0xb7, + 0x13,0xfa,0xdd,0xdd,0x1d,0xce,0xcf,0xcf,0xb9,0x7b,0xc7,0xe5,0xe5,0x25,0xa1,0xbb, + 0xdd,0x6e,0x44,0xa3,0xd1,0xea,0x40,0x4,0x41,0x60,0xba,0x28,0xab,0x28,0x79,0xef, + 0x46,0x2a,0x95,0x82,0x28,0x8a,0xd5,0xf7,0x5a,0xac,0x6d,0xdd,0xd9,0xd9,0xe1,0xe6, + 0x29,0xe5,0x72,0x19,0xdb,0xdb,0xdb,0x86,0x4f,0x2b,0x4d,0x20,0x81,0x40,0x0,0xa3, + 0xa3,0xa3,0x84,0xfe,0xf2,0xf2,0x82,0xbd,0xbd,0x3d,0x53,0xbd,0x63,0x60,0x60,0x0, + 0x83,0x83,0x83,0xfc,0xba,0x5f,0xd6,0x53,0xe1,0xe5,0x29,0xd5,0x78,0x87,0x2e,0x10, + 0x45,0x51,0xa8,0x79,0xca,0xc3,0x53,0x4a,0xa5,0x12,0xf6,0xf7,0xf7,0x9,0xbd,0xbe, + 0xbe,0x9e,0x59,0x9f,0x86,0x41,0x24,0x49,0x42,0x2c,0x16,0xd3,0x95,0xdb,0x5a,0x57, + 0x36,0x9b,0xa5,0x7a,0x47,0x34,0x1a,0x45,0x4b,0x4b,0xb,0xff,0x17,0x2b,0xb3,0x5a, + 0x96,0x6a,0xbd,0x43,0x37,0x48,0x38,0x1c,0x46,0x67,0x67,0x27,0xa1,0x17,0xa,0x5, + 0xea,0xf9,0xaf,0x65,0x15,0xa,0x5,0x5c,0x5c,0x5c,0x10,0xba,0xc7,0xe3,0x81,0x2c, + 0xcb,0xe6,0x80,0x54,0xea,0x77,0x8c,0x7a,0xa,0x6b,0x37,0xd2,0xe9,0x34,0xea,0xea, + 0xea,0xcc,0x7b,0x67,0x67,0x9d,0x22,0xaa,0xaa,0xea,0xf6,0x94,0x72,0xb9,0x8c,0xad, + 0xad,0x2d,0x2e,0xa7,0x95,0x6e,0x90,0x9e,0x9e,0x1e,0x8c,0x8f,0x8f,0x53,0x3d,0x85, + 0xd6,0xb5,0x1a,0xf1,0x8e,0x60,0x30,0x8,0xbf,0xdf,0x6f,0xfe,0x14,0x85,0x57,0xd1, + 0xf3,0x2c,0x72,0x43,0x20,0x73,0x73,0x73,0x70,0xb9,0x5c,0x84,0x7e,0x78,0x78,0x88, + 0xe7,0xe7,0x67,0x4d,0xdf,0xc1,0xea,0xa,0x1c,0xe,0x7,0x12,0x89,0x84,0x35,0x20, + 0x4e,0xa7,0x93,0xfa,0x63,0x7a,0x3c,0x85,0xe5,0x1d,0xf1,0x78,0x1c,0xcd,0xcd,0xcd, + 0xd6,0x80,0xf0,0x68,0x59,0x58,0x71,0x46,0x8b,0xdc,0x30,0x48,0x28,0x14,0x82,0xcf, + 0xe7,0x23,0xf4,0x9b,0x9b,0x1b,0xea,0x3c,0x4a,0xcb,0xbb,0x4c,0x57,0x57,0x17,0xc2, + 0xe1,0xb0,0xb5,0x20,0xd5,0xec,0x4a,0x25,0xef,0xb0,0xd9,0x6c,0xd6,0x83,0xa4,0xd3, + 0x69,0xd8,0xed,0xe4,0xa5,0x99,0x4c,0x86,0x9a,0xff,0x66,0x79,0x47,0xd5,0x20,0x5e, + 0xaf,0x17,0x91,0x48,0x84,0xda,0xcd,0x1e,0x1c,0x1c,0x50,0xaf,0x61,0x75,0xcb,0x13, + 0x13,0x13,0xe8,0xee,0xee,0xfe,0x19,0x90,0x4a,0x4f,0x91,0xd5,0xb2,0x98,0xe1,0x1d, + 0x5c,0x40,0xa6,0xa7,0xa7,0xe1,0x76,0xbb,0xa9,0x9e,0x52,0x2c,0x16,0xff,0xd2,0x5e, + 0x5f,0x5f,0xa9,0x53,0x4a,0x97,0xcb,0x85,0xd9,0xd9,0xd9,0x9f,0x5,0x11,0x45,0x11, + 0xc9,0x64,0x92,0xd0,0x69,0xf3,0x5b,0xd6,0xcc,0x2a,0x91,0x48,0xc0,0xe9,0x74,0xfe, + 0x2c,0x48,0xa5,0xb4,0xf8,0x7f,0x7a,0xb1,0x66,0x61,0x3c,0x8a,0x9c,0xb,0xc8,0xd0, + 0xd0,0x10,0xfa,0xfb,0xfb,0x9,0xfd,0xfa,0xfa,0x1a,0x57,0x57,0x57,0x0,0x80,0xfb, + 0xfb,0x7b,0x9c,0x9d,0x9d,0x11,0x31,0x3e,0x9f,0xf,0xa1,0x50,0xa8,0x36,0x40,0xb4, + 0x78,0xa,0xaf,0xe1,0x82,0xe9,0x20,0xa9,0x54,0x8a,0x3a,0xf0,0xfe,0xf7,0x3d,0x85, + 0xe6,0x1d,0x36,0x9b,0x4d,0xd3,0x60,0xda,0x52,0x90,0xd6,0xd6,0x56,0xea,0x58,0xb3, + 0x58,0x2c,0x62,0x65,0x65,0x85,0xea,0x1d,0x91,0x48,0x4,0x5e,0xaf,0xb7,0xb6,0x40, + 0x2a,0x15,0xfd,0xda,0xda,0x9a,0x25,0x69,0xc5,0xd,0x44,0x96,0x65,0x78,0x3c,0x1e, + 0x4d,0xb1,0x92,0x24,0x61,0x66,0x66,0xa6,0x36,0x41,0x4,0x41,0xd0,0x9c,0xf3,0xc9, + 0x64,0x52,0xf3,0x60,0xda,0x72,0x10,0x3d,0xe9,0xc2,0xab,0x25,0x31,0xd,0xc4,0xef, + 0xf7,0x23,0x18,0xc,0x56,0x8c,0xe9,0xeb,0xeb,0xc3,0xf0,0xf0,0x70,0x6d,0x83,0x68, + 0x79,0xda,0x66,0xed,0x6,0x77,0x10,0x45,0x51,0xe0,0x70,0x38,0x98,0x75,0xa4,0x77, + 0x30,0xad,0xab,0x4e,0x79,0x7e,0x59,0x53,0x53,0x13,0x4e,0x4e,0x4e,0xf0,0x13,0xeb, + 0x57,0xfc,0x3b,0xe8,0xaf,0x1d,0xd1,0x3b,0x2d,0xac,0xb5,0xf5,0x6b,0x76,0xe4,0x1f, + 0xae,0x64,0x83,0x40,0x68,0xbf,0x37,0xbc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/new.png + 0x0,0x0,0x2,0xe, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x1,0xa0,0x49,0x44,0x41,0x54,0x48,0xc7,0xb5, + 0xd5,0xcf,0x8b,0x1,0x61,0x18,0xc0,0xf1,0x11,0x49,0x66,0xed,0x75,0x73,0xb2,0x29, + 0x2e,0x6e,0x56,0x2e,0x8a,0xc3,0x72,0xd9,0xda,0x7f,0xf,0x57,0x39,0x50,0x2e,0xca, + 0x45,0xc9,0x41,0xf9,0xd1,0xa8,0x69,0x4a,0xe,0x1c,0x28,0x25,0x49,0x71,0x20,0xa2, + 0xd4,0xb3,0xcf,0xf3,0xf6,0x8e,0xb6,0x99,0x31,0xef,0xcc,0xd6,0x1e,0x3e,0xbd,0xa5, + 0xf7,0xf9,0x9a,0xde,0x78,0x47,0x2,0x0,0xe9,0x3f,0x98,0x3f,0x90,0x24,0xf,0xf2, + 0xa1,0x0,0x92,0x51,0xc8,0xc2,0xb,0xa,0x22,0x3f,0xf2,0x3a,0xd,0xfb,0xa,0x85, + 0x2,0x64,0xb3,0x59,0xc8,0x64,0x32,0x26,0xc9,0x64,0x92,0x36,0x41,0x2e,0x97,0x53, + 0x70,0x7d,0xe3,0x5f,0xe2,0x73,0x12,0xe,0x50,0xf4,0x7e,0xbf,0x5b,0x9a,0x4c,0x26, + 0x2c,0x4c,0xd2,0xe9,0xb4,0x8a,0x6b,0x4,0xbd,0x1a,0xe3,0x56,0x61,0x99,0x9e,0xec, + 0x76,0xbb,0xc1,0xf5,0x7a,0x35,0xd1,0x34,0x8d,0x45,0xcb,0xe5,0x32,0x5b,0x53,0xa9, + 0x94,0x86,0xeb,0xbb,0x31,0x6e,0x15,0xe,0x51,0xf8,0x72,0xb9,0xc0,0xf9,0x7c,0x36, + 0x51,0x55,0x95,0x5,0x2b,0x95,0xa,0x14,0x8b,0xc5,0xdf,0xf1,0x8,0x3f,0x16,0xaf, + 0x6d,0xf8,0x74,0x3a,0xc1,0xf1,0x78,0x34,0x51,0x14,0xe5,0x71,0x14,0x6,0x1f,0xfc, + 0xcc,0xfd,0xb6,0xe1,0xc3,0xe1,0x0,0xfb,0xfd,0xde,0x64,0x3e,0x9f,0xc3,0x70,0x38, + 0x7c,0xa8,0xd7,0xeb,0x7a,0xf8,0x93,0x1f,0x49,0xd0,0x36,0xbc,0xdb,0xed,0x60,0xbb, + 0xdd,0xa,0xf5,0xfb,0x7d,0x3d,0xfc,0x85,0x62,0x74,0x1c,0xb6,0xe1,0xcd,0x66,0x3, + 0xeb,0xf5,0x5a,0xa8,0xd7,0xeb,0xe9,0xe1,0x6f,0x14,0xa7,0x79,0xdb,0xf0,0x6a,0xb5, + 0x82,0xe5,0x72,0x29,0xd4,0xe9,0x74,0xdc,0x85,0x17,0x8b,0x5,0x3b,0x4f,0x91,0x76, + 0xbb,0xed,0x2e,0x3c,0x9b,0xcd,0x60,0x3a,0x9d,0xa,0xb5,0x5a,0x2d,0x77,0x61,0x1a, + 0xa2,0x3f,0x83,0x48,0xb3,0xd9,0x74,0x17,0xa6,0xa1,0xf1,0x78,0x2c,0xd4,0x68,0x34, + 0xdc,0x85,0x69,0x68,0x30,0x18,0x8,0xd5,0x6a,0x35,0x77,0xe1,0xd1,0x68,0xc4,0x7e, + 0x4a,0x22,0xd5,0x6a,0xd5,0x79,0x38,0x91,0x48,0x40,0xb7,0xdb,0x65,0xf7,0x81,0x48, + 0xa9,0x54,0x72,0x1c,0x96,0x9f,0xdc,0x5,0x22,0x79,0x14,0xa5,0xf9,0xa7,0xf7,0x31, + 0xa,0xf3,0x4b,0x25,0xcf,0x9f,0x44,0x24,0xcf,0xf7,0xd3,0x5c,0xe0,0xe9,0x1b,0x84, + 0xbf,0x7e,0xc2,0xfc,0x9,0xe2,0xe,0x44,0xf9,0xfe,0x90,0x7e,0x27,0xff,0xf5,0x9d, + 0x67,0x24,0xf3,0xfd,0x34,0xe7,0xa1,0xce,0xf,0xab,0x58,0x8,0xd0,0xc3,0x4c,0xf8, + 0xc6,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/find.png + 0x0,0x0,0x3,0x50, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0xe2,0x49,0x44,0x41,0x54,0x48,0xc7,0xbd, + 0x95,0x5d,0x48,0x93,0x51,0x18,0xc7,0x8f,0x5e,0x58,0x6a,0x9a,0x37,0x81,0x85,0x5e, + 0x78,0xe1,0x95,0x5d,0x4,0xc1,0x8a,0xc2,0xd7,0x61,0x50,0xe0,0x57,0x19,0x31,0x61, + 0x9,0xc2,0x86,0xe1,0x10,0x1c,0xc8,0x18,0xe2,0x45,0x49,0x5e,0x78,0x93,0x91,0xc3, + 0xb1,0x26,0x7e,0x80,0xc3,0xef,0x79,0x95,0xe0,0x84,0x4,0x15,0x9b,0x9a,0xaf,0x5f, + 0xe9,0x50,0xd8,0xc4,0x57,0x10,0x11,0xac,0x45,0x6b,0x63,0xb6,0x6,0xff,0xce,0x39, + 0xb8,0xe1,0xdc,0xb4,0x21,0xd4,0xb,0x3f,0x5e,0x78,0xcf,0x73,0x7e,0xe7,0x39,0xcf, + 0x73,0xe,0x2f,0x1,0x40,0xfe,0x5,0xe4,0xbf,0x8b,0xe9,0x83,0xbf,0x71,0x61,0x71, + 0x30,0x18,0x8c,0x20,0x10,0x8,0xe0,0xe0,0xe0,0x0,0xa3,0xa3,0xa3,0xc8,0xc9,0xc9, + 0x39,0x57,0x7e,0xae,0x98,0x89,0x4e,0x72,0x74,0x74,0x84,0xfd,0xfd,0x7d,0x58,0xad, + 0x56,0x94,0x95,0x95,0x41,0xa7,0xd3,0x9d,0x29,0x3f,0x2d,0x93,0x53,0xcc,0x14,0x89, + 0x4d,0x50,0xab,0xd5,0x98,0x98,0x98,0x80,0xdf,0xef,0xe7,0xf8,0x7c,0x3e,0xec,0xed, + 0xed,0x61,0x78,0x78,0x18,0xa5,0xa5,0xa5,0x70,0xb9,0x5c,0xa8,0xab,0xab,0x8b,0x29, + 0x3f,0x29,0x55,0xdf,0xb8,0x2d,0x47,0x7e,0xa3,0x19,0xca,0xf,0x12,0xc7,0xf8,0xde, + 0xc,0xa1,0x40,0xe,0xa3,0xd1,0x8,0xaf,0xd7,0xb,0x8f,0xc7,0x83,0xdd,0xdd,0x5d, + 0xc,0xc,0xc,0x70,0xf1,0xea,0xea,0x2a,0xa7,0xa6,0xa6,0x26,0x4a,0x1e,0xce,0x94, + 0x49,0x9f,0x5a,0x44,0xbc,0x10,0x11,0xc6,0x1f,0x4,0x3e,0x7d,0x16,0xb9,0x7c,0x6c, + 0x6c,0xc,0x6e,0xb7,0x1b,0xdb,0xdb,0xdb,0xe8,0xef,0xef,0x47,0x49,0x49,0x9,0x66, + 0x67,0x67,0xc3,0xa8,0x54,0xaa,0x8,0x79,0x48,0x6c,0x66,0x99,0x9e,0x94,0x32,0x7c, + 0x54,0xec,0xfd,0xd,0x18,0x4c,0x66,0x54,0x55,0x55,0xe1,0xf0,0xf0,0x90,0x6f,0x7f, + 0x70,0x70,0x10,0x15,0x15,0x15,0xe8,0xed,0xed,0x8d,0xa0,0xbc,0xbc,0x3c,0x2c,0xf, + 0x89,0x25,0xb6,0xf5,0xd3,0xe2,0x9f,0x54,0xea,0xa1,0x38,0x5c,0x12,0xb2,0xb2,0xb2, + 0xf8,0x89,0x60,0xe2,0xf1,0xf1,0x71,0x8,0x82,0x80,0xbc,0xbc,0x3c,0xe4,0xe6,0xe6, + 0x86,0xc9,0xce,0xce,0x8e,0x4f,0xfc,0x23,0x0,0x7c,0xa7,0x7c,0x39,0x16,0xb3,0xc6, + 0x49,0x92,0x84,0x95,0x95,0x15,0x5e,0x1a,0x8b,0xc5,0x82,0xee,0xee,0x6e,0x74,0x75, + 0x75,0x71,0xf4,0x7a,0x7d,0x94,0x38,0x66,0x29,0xdc,0xbf,0x80,0x6f,0x94,0xb7,0x46, + 0xda,0x50,0xa5,0x92,0x37,0x6e,0x67,0x67,0x87,0x67,0xed,0x70,0x38,0xb0,0xb6,0xb6, + 0xc6,0x17,0x9,0xd1,0xd9,0xd9,0x19,0x25,0x8e,0xd9,0xbc,0xaf,0x54,0xfa,0xd1,0x2e, + 0xe2,0xbe,0x20,0xe7,0x47,0x6f,0x6e,0x6e,0x8e,0x4b,0x43,0x38,0x9d,0xce,0x8,0xfa, + 0xfa,0xfa,0x22,0xc5,0x67,0x1d,0xb7,0x37,0x34,0xd3,0x7b,0x42,0x1,0x64,0x32,0x19, + 0x1e,0xc9,0x32,0x91,0x9e,0x92,0x80,0x86,0x86,0x6,0x6c,0x6c,0x6c,0x60,0x73,0x73, + 0x13,0x5b,0x5b,0x5b,0x11,0xb0,0x6,0x46,0x89,0x63,0x5d,0x10,0x85,0x42,0x81,0xca, + 0xca,0x4a,0x14,0xdd,0xbd,0xe,0xeb,0xab,0x5b,0x78,0xfd,0x2c,0x9,0x69,0x97,0x9, + 0xea,0xeb,0xeb,0xb1,0xbc,0xbc,0x8c,0xf5,0xf5,0x75,0xbe,0x48,0x88,0x9e,0x9e,0x9e, + 0xd8,0xe2,0xd3,0x57,0x9a,0xd5,0xd1,0x66,0xb3,0x21,0x23,0x35,0x11,0x8d,0x8f,0x93, + 0xf0,0xee,0x79,0x22,0xf4,0x45,0x4,0x57,0x53,0x8,0xb4,0x5a,0x2d,0x16,0x17,0x17, + 0x79,0x6d,0x59,0xad,0x19,0xac,0x81,0x71,0x89,0x59,0xb0,0x28,0x8a,0x3c,0xc3,0xf4, + 0x64,0x2,0xcd,0x3,0x82,0x97,0x4f,0x8,0x54,0x2,0x41,0xea,0x25,0x82,0xa1,0xa1, + 0x21,0xcc,0xcf,0xcf,0xf3,0x98,0xa5,0xa5,0x25,0x74,0x74,0x74,0xc4,0x27,0x66,0xc1, + 0x6c,0x22,0xbb,0x59,0xb5,0xb5,0xb5,0xb8,0x42,0xcb,0xa0,0xb8,0x43,0xf0,0xf0,0x26, + 0x41,0x66,0x6,0x41,0x75,0x75,0x35,0xa6,0xa7,0xa7,0x79,0xcc,0xc2,0xc2,0x2,0x4c, + 0x26,0x53,0x7c,0x62,0xb6,0x55,0xbb,0xdd,0xce,0xc5,0x53,0x53,0x53,0xd0,0x68,0x34, + 0x48,0x4e,0x22,0xb8,0x96,0x46,0x50,0x58,0x58,0x88,0x91,0x91,0x11,0x4c,0x4e,0x4e, + 0xf2,0x71,0x16,0xd7,0xde,0xde,0x1e,0x9f,0x78,0x66,0x66,0x6,0x6,0x83,0x81,0xd3, + 0xd6,0xd6,0x86,0xd6,0xd6,0x56,0x7e,0x2a,0x8a,0x8b,0x8b,0xd1,0xd4,0xd4,0x84,0x96, + 0x96,0x16,0xfe,0x8d,0x8d,0xb1,0x98,0xe6,0xe6,0xe6,0xf8,0xc4,0x17,0xe5,0x42,0xff, + 0x3c,0xfa,0x24,0x1c,0x93,0xc8,0xde,0x67,0xc5,0xfd,0x1,0xb1,0xa8,0xf6,0xe3,0x9f, + 0xb0,0x20,0xc8,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/icon.png + 0x0,0x0,0x1,0x2e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x30,0x0,0x0,0x0,0x34,0x8,0x2,0x0,0x0,0x0,0x43,0xf1,0x2c,0xc6, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, + 0x0,0x0,0x0,0x38,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x58,0x56,0x20,0x56,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x2e,0x31,0x30, + 0x61,0x20,0x20,0x52,0x65,0x76,0x3a,0x20,0x31,0x32,0x2f,0x32,0x39,0x2f,0x39,0x34, + 0x20,0x28,0x50,0x4e,0x47,0x20,0x70,0x61,0x74,0x63,0x68,0x20,0x31,0x2e,0x32,0x29, + 0xdd,0x15,0x2e,0x49,0x0,0x0,0x0,0x8e,0x49,0x44,0x41,0x54,0x78,0x9c,0xed,0xd6, + 0x41,0xe,0x40,0x30,0x18,0x5,0x61,0x15,0x77,0x75,0x26,0xa7,0xad,0x85,0xc4,0x2, + 0xc9,0x28,0xc1,0x93,0xcc,0xb7,0x97,0x4e,0xda,0x68,0xff,0x52,0x6b,0xed,0x92,0xf4, + 0x5f,0x7,0x6c,0xfd,0x3c,0xa8,0x8c,0xe3,0x43,0x1d,0xab,0x9f,0xef,0xd0,0xb,0xc, + 0x22,0x71,0x41,0xe5,0xf0,0x62,0x7c,0xe1,0x6f,0x5a,0xd4,0x69,0xda,0x2e,0xdd,0x74, + 0x53,0xdf,0x9,0xdd,0xaf,0x7d,0x28,0xee,0xc8,0xe2,0x82,0x86,0xcb,0x5f,0x9e,0x3c, + 0x82,0x56,0x71,0x3b,0x64,0x10,0x31,0x88,0x18,0x44,0xc,0x22,0x6,0x91,0xb8,0xa0, + 0xe6,0xc7,0xf5,0xa1,0x37,0x75,0x15,0xb7,0x43,0x8e,0xb0,0x24,0xee,0xc8,0xe2,0x82, + 0x1c,0x61,0x89,0x41,0xc4,0x20,0x62,0x10,0x31,0x88,0x18,0x44,0xc,0x22,0xce,0xd4, + 0xc4,0x20,0x62,0x10,0x99,0x1,0xe5,0x5,0x24,0xf0,0x6b,0xcb,0x57,0xf3,0x0,0x0, + 0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd7,0x3,0x16,0xf,0x20,0x1,0x18,0xe2,0xa7, + 0xad,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/axe_box.png + 0x0,0x0,0x1,0x76, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x3d,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xe9,0xad,0x83,0x30, + 0x10,0x84,0xc7,0x28,0xd5,0xb8,0x20,0x8a,0xa0,0x8a,0xd4,0x43,0x15,0xae,0xc2,0x74, + 0xc3,0xbe,0x1f,0x79,0x1b,0x99,0xc3,0x7b,0x5,0x5,0x29,0x23,0xa1,0x4,0x87,0xf5, + 0x7c,0x3e,0x76,0x63,0x12,0x11,0x11,0x6e,0xd4,0x3,0x0,0x96,0x65,0x71,0x5,0xe5, + 0x3c,0x6f,0xee,0x6b,0x1d,0x43,0xe6,0x39,0x67,0xc,0xfe,0xa0,0xd9,0xd4,0xa6,0xa9, + 0x94,0x2,0x0,0x3e,0x0,0x36,0x6a,0x47,0xcc,0xdf,0x23,0x10,0x2e,0x80,0x33,0xf3, + 0x2b,0x20,0x4c,0x0,0x92,0xf9,0xa7,0x10,0x2a,0x80,0xc5,0xfc,0x8,0x31,0x99,0x1, + 0x1e,0xd6,0x4e,0xad,0x7a,0x3d,0x6f,0x8f,0x51,0x1,0x58,0x79,0xce,0xdb,0x86,0x27, + 0xb7,0x3f,0xcd,0x66,0x75,0xac,0x31,0x0,0x36,0x6f,0x3b,0xf0,0x2c,0xcd,0x1,0xbe, + 0x91,0xbe,0x7,0xe6,0x7c,0x4a,0x6e,0x95,0x16,0x2f,0xce,0x0,0x93,0xef,0x3f,0x1, + 0x98,0x97,0x40,0x83,0xd7,0x37,0xe1,0x7f,0x7,0xfb,0x91,0x58,0x96,0x40,0x9a,0x7a, + 0x96,0xbb,0x14,0x5f,0xad,0xdf,0x5,0x58,0xd7,0xf5,0x5e,0x80,0x61,0xb0,0x75,0x6d, + 0x2e,0x44,0x40,0x2c,0xb,0xb4,0x8d,0x68,0x2e,0x44,0xef,0x6c,0xe8,0xfc,0xd9,0x9c, + 0x65,0x3,0xc7,0x49,0xb5,0xc0,0x55,0x88,0x5a,0xf3,0x5a,0xc7,0x8d,0x69,0xf,0x4c, + 0x2b,0x44,0x89,0x88,0xa8,0x3d,0x92,0xb5,0xf9,0x6d,0xc9,0x63,0x4d,0x3d,0xf3,0x52, + 0xa,0xa6,0x69,0x92,0x97,0xa0,0x37,0xf2,0x33,0x49,0xcf,0x48,0x45,0xcb,0x7c,0x1e, + 0x90,0xcc,0xf7,0xbf,0x79,0xe,0x25,0x22,0x80,0xd5,0xfc,0x13,0x88,0x2e,0x80,0xd7, + 0x3c,0xa,0xa1,0x2e,0x41,0xe4,0xcc,0xef,0x81,0x30,0xed,0x1,0xbe,0xa2,0x10,0x92, + 0x5c,0x95,0xd0,0x22,0x2f,0xe8,0x1,0x20,0xfa,0x9a,0x15,0xd5,0xe5,0x33,0xe0,0x1d, + 0xc0,0x1b,0x80,0xdf,0xd5,0xbe,0xad,0x44,0x44,0x94,0x52,0xba,0xc5,0x1c,0x0,0xfe, + 0x0,0xe2,0x90,0xad,0x5f,0x7f,0xa6,0x32,0x3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e, + 0x44,0xae,0x42,0x60,0x82, + // /home/grosse/Workarea/mccwb/src/QMcCad/images/ozoom.png + 0x0,0x0,0x1,0x8f, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x56,0x49,0x44,0x41,0x54,0x58,0x85,0xcd,0x96,0xdb,0x91,0x84,0x20, + 0x10,0x45,0x2f,0xd6,0xc4,0x60,0xe,0x90,0xc4,0x6a,0x3a,0x44,0x41,0x14,0x93,0x8e, + 0x6c,0x12,0x90,0x83,0x49,0xf4,0x7e,0x38,0x2d,0x83,0x62,0x21,0xe8,0xc,0x7b,0x7f, + 0xac,0xe2,0x61,0x1f,0xfb,0xa9,0x20,0x22,0x42,0x43,0x3d,0x0,0xc0,0x7b,0x5f,0x75, + 0x59,0x4a,0x59,0x7d,0x17,0x0,0x94,0x52,0xe8,0xaa,0x6f,0x5f,0x94,0xb5,0x16,0x0, + 0xda,0x1,0xb0,0x9a,0x3,0x3c,0x72,0x7,0x94,0xd2,0xbb,0x35,0xe7,0x9e,0x9f,0x7, + 0x8,0x86,0xcd,0xe1,0x1e,0xd1,0x74,0x3f,0xc0,0xd6,0x30,0xd1,0xcf,0xee,0x92,0x10, + 0xe6,0xf5,0xfc,0x5,0x60,0x2e,0x79,0x24,0x2,0x58,0x8c,0x1f,0x1b,0x66,0xf1,0x1e, + 0x3,0x28,0xa5,0xab,0x21,0x36,0x49,0x98,0x37,0x9e,0x2,0xb9,0xa2,0x15,0x20,0xc4, + 0xb5,0xec,0xa5,0xcb,0x79,0x93,0x4c,0xd6,0x22,0x80,0x56,0xea,0x80,0x10,0xfb,0x5a, + 0x97,0x5e,0xf1,0xc2,0xff,0xf0,0x40,0x4b,0x65,0x3b,0x61,0xa9,0xa4,0x94,0xa7,0xce, + 0xf1,0x30,0xba,0x1d,0xa0,0x74,0x3c,0x77,0x0,0xf7,0x76,0xf3,0x6a,0x2c,0xe5,0xba, + 0xd2,0x11,0x9b,0xe7,0xc0,0xa,0xc0,0xf4,0xa5,0x5e,0xe0,0xaf,0xb7,0xb6,0x6e,0x30, + 0x25,0x5b,0xf1,0x59,0x88,0xf7,0x73,0xc3,0x30,0x62,0x9e,0xcf,0x25,0xe0,0xbb,0xa2, + 0x24,0x74,0xee,0xb9,0x36,0x13,0x9e,0x78,0xe9,0x69,0xc8,0x86,0x4d,0xb4,0x3e,0xc, + 0x23,0xac,0x9d,0xd0,0xf7,0xe7,0x13,0x71,0x57,0x5,0x1c,0x8a,0x2d,0x48,0x2c,0x5e, + 0x63,0xb7,0x8f,0xd5,0x10,0x87,0x65,0xb8,0x5,0x49,0xed,0x49,0xb9,0x94,0x9d,0x52, + 0x53,0x35,0x44,0xb6,0xf,0x9c,0x29,0x2d,0xe7,0xea,0x21,0x6e,0x2b,0x43,0xe7,0x3c, + 0x42,0x48,0x2,0x44,0x2e,0x31,0x6f,0xed,0x3,0x35,0x10,0xf1,0x2f,0xd9,0xac,0xf2, + 0x46,0x7a,0x97,0x85,0x28,0x9,0xc7,0x47,0x3a,0x61,0x89,0x27,0xe2,0x3e,0x90,0xf9, + 0xba,0x52,0x88,0xad,0x27,0x52,0x1e,0x10,0x44,0x44,0xde,0xfb,0x75,0x3c,0x7e,0x53, + 0x5a,0xeb,0x5,0x40,0x8,0xf1,0x75,0xe3,0xac,0x3f,0x4,0x86,0xac,0xd2,0xf0,0x7, + 0xf3,0xd4,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + +}; + +static const unsigned char qt_resource_name[] = { + // images + 0x0,0x6, + 0x7,0x3,0x7d,0xc3, + 0x0,0x69, + 0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73, + // mouse.png + 0x0,0x9, + 0xc,0x98,0xbf,0x87, + 0x0,0x6d, + 0x0,0x6f,0x0,0x75,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // saveas.png + 0x0,0xa, + 0xb,0x8d,0x66,0xc7, + 0x0,0x73, + 0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x61,0x0,0x73,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // close.png + 0x0,0x9, + 0x6,0x98,0x83,0x27, + 0x0,0x63, + 0x0,0x6c,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // wireframe.png + 0x0,0xd, + 0xc,0x29,0x2d,0xa7, + 0x0,0x77, + 0x0,0x69,0x0,0x72,0x0,0x65,0x0,0x66,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // leftview.png + 0x0,0xc, + 0x1,0xa1,0xe0,0xc7, + 0x0,0x6c, + 0x0,0x65,0x0,0x66,0x0,0x74,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // open.png + 0x0,0x8, + 0x6,0xc1,0x59,0x87, + 0x0,0x6f, + 0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // redo.png + 0x0,0x8, + 0xb,0xb2,0x58,0x47, + 0x0,0x72, + 0x0,0x65,0x0,0x64,0x0,0x6f,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // backview.png + 0x0,0xc, + 0x2,0xc9,0x12,0xc7, + 0x0,0x62, + 0x0,0x61,0x0,0x63,0x0,0x6b,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // transparency.png + 0x0,0x10, + 0xf,0xfb,0xa4,0xc7, + 0x0,0x74, + 0x0,0x72,0x0,0x61,0x0,0x6e,0x0,0x73,0x0,0x70,0x0,0x61,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x63,0x0,0x79,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // cut.png + 0x0,0x7, + 0xa,0xc7,0x57,0x87, + 0x0,0x63, + 0x0,0x75,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // color.png + 0x0,0x9, + 0x3,0x65,0x83,0x87, + 0x0,0x63, + 0x0,0x6f,0x0,0x6c,0x0,0x6f,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // szoom.png + 0x0,0x9, + 0x6,0x60,0xa1,0x67, + 0x0,0x73, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // save.png + 0x0,0x8, + 0x8,0xc8,0x58,0x67, + 0x0,0x73, + 0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // splash.png + 0x0,0xa, + 0x8,0x94,0x19,0x7, + 0x0,0x73, + 0x0,0x70,0x0,0x6c,0x0,0x61,0x0,0x73,0x0,0x68,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // line.png + 0x0,0x8, + 0x0,0x48,0x59,0x27, + 0x0,0x6c, + 0x0,0x69,0x0,0x6e,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // gotocell.png + 0x0,0xc, + 0x9,0xe2,0x3c,0x67, + 0x0,0x67, + 0x0,0x6f,0x0,0x74,0x0,0x6f,0x0,0x63,0x0,0x65,0x0,0x6c,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // rightarrow.png + 0x0,0xe, + 0x6,0xd9,0x18,0x47, + 0x0,0x72, + 0x0,0x69,0x0,0x67,0x0,0x68,0x0,0x74,0x0,0x61,0x0,0x72,0x0,0x72,0x0,0x6f,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // frontview.png + 0x0,0xd, + 0x4,0xe6,0xe1,0x67, + 0x0,0x66, + 0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x74,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // topview.png + 0x0,0xb, + 0xf,0x40,0x98,0xc7, + 0x0,0x74, + 0x0,0x6f,0x0,0x70,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // bringtofront.png + 0x0,0x10, + 0xf,0x9b,0x88,0x67, + 0x0,0x62, + 0x0,0x72,0x0,0x69,0x0,0x6e,0x0,0x67,0x0,0x74,0x0,0x6f,0x0,0x66,0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // panview.png + 0x0,0xb, + 0xf,0x27,0x5c,0xc7, + 0x0,0x70, + 0x0,0x61,0x0,0x6e,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // rotate.png + 0x0,0xa, + 0x8,0xab,0x7a,0x7, + 0x0,0x72, + 0x0,0x6f,0x0,0x74,0x0,0x61,0x0,0x74,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // bottomview.png + 0x0,0xe, + 0x2,0xc0,0x84,0x87, + 0x0,0x62, + 0x0,0x6f,0x0,0x74,0x0,0x74,0x0,0x6f,0x0,0x6d,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // decompose.png + 0x0,0xd, + 0x3,0xe4,0x9e,0x7, + 0x0,0x64, + 0x0,0x65,0x0,0x63,0x0,0x6f,0x0,0x6d,0x0,0x70,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // openNew.png + 0x0,0xb, + 0x4,0x26,0x8f,0x27, + 0x0,0x6f, + 0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x4e,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // dzoom.png + 0x0,0x9, + 0x6,0x60,0x8f,0x67, + 0x0,0x64, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // convert.png + 0x0,0xb, + 0xc,0x43,0x9c,0xc7, + 0x0,0x63, + 0x0,0x6f,0x0,0x6e,0x0,0x76,0x0,0x65,0x0,0x72,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // print.png + 0x0,0x9, + 0x0,0x57,0xb8,0x67, + 0x0,0x70, + 0x0,0x72,0x0,0x69,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // sendtoback.png + 0x0,0xe, + 0xf,0xd,0x22,0x27, + 0x0,0x73, + 0x0,0x65,0x0,0x6e,0x0,0x64,0x0,0x74,0x0,0x6f,0x0,0x62,0x0,0x61,0x0,0x63,0x0,0x6b,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // shading.png + 0x0,0xb, + 0x0,0xbd,0x98,0x27, + 0x0,0x73, + 0x0,0x68,0x0,0x61,0x0,0x64,0x0,0x69,0x0,0x6e,0x0,0x67,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // rightview.png + 0x0,0xd, + 0xe,0x35,0xa1,0x27, + 0x0,0x72, + 0x0,0x69,0x0,0x67,0x0,0x68,0x0,0x74,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // select.png + 0x0,0xa, + 0xb,0xa8,0x6f,0x7, + 0x0,0x73, + 0x0,0x65,0x0,0x6c,0x0,0x65,0x0,0x63,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // undo.png + 0x0,0x8, + 0x4,0xb2,0x58,0xc7, + 0x0,0x75, + 0x0,0x6e,0x0,0x64,0x0,0x6f,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // past.png + 0x0,0x8, + 0x8,0xa7,0x59,0x87, + 0x0,0x70, + 0x0,0x61,0x0,0x73,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // izoom.png + 0x0,0x9, + 0x6,0x60,0xb5,0x67, + 0x0,0x69, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // export.png + 0x0,0xa, + 0x6,0x9a,0xc9,0xa7, + 0x0,0x65, + 0x0,0x78,0x0,0x70,0x0,0x6f,0x0,0x72,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // draw.png + 0x0,0x8, + 0x8,0x8a,0x5a,0x27, + 0x0,0x64, + 0x0,0x72,0x0,0x61,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // document.png + 0x0,0xc, + 0x9,0x3c,0xf,0x27, + 0x0,0x64, + 0x0,0x6f,0x0,0x63,0x0,0x75,0x0,0x6d,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // scolor.png + 0x0,0xa, + 0x3,0x6a,0x63,0x87, + 0x0,0x73, + 0x0,0x63,0x0,0x6f,0x0,0x6c,0x0,0x6f,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // delete.png + 0x0,0xa, + 0xc,0xad,0xf,0x7, + 0x0,0x64, + 0x0,0x65,0x0,0x6c,0x0,0x65,0x0,0x74,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // copy.png + 0x0,0x8, + 0x6,0x7c,0x5a,0x7, + 0x0,0x63, + 0x0,0x6f,0x0,0x70,0x0,0x79,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // person.png + 0x0,0xa, + 0xa,0x6f,0x8e,0x67, + 0x0,0x70, + 0x0,0x65,0x0,0x72,0x0,0x73,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // fitall.png + 0x0,0xa, + 0x8,0x22,0xf6,0x7, + 0x0,0x66, + 0x0,0x69,0x0,0x74,0x0,0x61,0x0,0x6c,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // wzoom.png + 0x0,0x9, + 0x6,0x60,0xa9,0x67, + 0x0,0x77, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // material.png + 0x0,0xc, + 0x1,0xe,0xe,0x47, + 0x0,0x6d, + 0x0,0x61,0x0,0x74,0x0,0x65,0x0,0x72,0x0,0x69,0x0,0x61,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // leftarrow.png + 0x0,0xd, + 0xc,0x15,0x7,0xa7, + 0x0,0x6c, + 0x0,0x65,0x0,0x66,0x0,0x74,0x0,0x61,0x0,0x72,0x0,0x72,0x0,0x6f,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // VG.png + 0x0,0x6, + 0x5,0xaa,0x57,0x47, + 0x0,0x56, + 0x0,0x47,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // new.png + 0x0,0x7, + 0x4,0xca,0x57,0xa7, + 0x0,0x6e, + 0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // find.png + 0x0,0x8, + 0x0,0x47,0x5a,0xe7, + 0x0,0x66, + 0x0,0x69,0x0,0x6e,0x0,0x64,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // icon.png + 0x0,0x8, + 0xa,0x61,0x5a,0xa7, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // axe_box.png + 0x0,0xb, + 0x9,0xba,0x81,0xe7, + 0x0,0x61, + 0x0,0x78,0x0,0x65,0x0,0x5f,0x0,0x62,0x0,0x6f,0x0,0x78,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // ozoom.png + 0x0,0x9, + 0x6,0x60,0xb9,0x67, + 0x0,0x6f, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + +}; + +static const unsigned char qt_resource_struct[] = { + // : [225::31] + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, + // :/images [225::31] + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x35,0x0,0x0,0x0,0x2, + // :/images/find.png + 0x0,0x0,0x5,0x1a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd6,0x2e, + // :/images/line.png + 0x0,0x0,0x1,0x7e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x90,0xe4, + // :/images/print.png + 0x0,0x0,0x2,0xfe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb0,0x65, + // :/images/shading.png + 0x0,0x0,0x3,0x38,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb4,0xbb, + // :/images/material.png + 0x0,0x0,0x4,0xb6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xcb,0xf1, + // :/images/leftview.png + 0x0,0x0,0x0,0x7c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb,0x70, + // :/images/bottomview.png + 0x0,0x0,0x2,0x6c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9e,0x75, + // :/images/backview.png + 0x0,0x0,0x0,0xc6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x13,0x26, + // :/images/color.png + 0x0,0x0,0x1,0x1e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1c,0x83, + // :/images/scolor.png + 0x0,0x0,0x4,0x20,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc1,0xf3, + // :/images/decompose.png + 0x0,0x0,0x2,0x8e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xa0,0xa, + // :/images/openNew.png + 0x0,0x0,0x2,0xae,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xa4,0x36, + // :/images/undo.png + 0x0,0x0,0x3,0x8e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb8,0x3, + // :/images/new.png + 0x0,0x0,0x5,0x6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd4,0x1c, + // :/images/frontview.png + 0x0,0x0,0x1,0xd4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x97,0x15, + // :/images/VG.png + 0x0,0x0,0x4,0xf4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xcf,0xd3, + // :/images/dzoom.png + 0x0,0x0,0x2,0xca,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xa9,0x8d, + // :/images/szoom.png + 0x0,0x0,0x1,0x36,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1d,0x6a, + // :/images/wzoom.png + 0x0,0x0,0x4,0x9e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xca,0x60, + // :/images/izoom.png + 0x0,0x0,0x3,0xba,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xba,0x33, + // :/images/ozoom.png + 0x0,0x0,0x5,0x62,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xdc,0x2e, + // :/images/copy.png + 0x0,0x0,0x4,0x54,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc5,0xd4, + // :/images/close.png + 0x0,0x0,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x8,0x92, + // :/images/export.png + 0x0,0x0,0x3,0xd2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xbb,0xd5, + // :/images/open.png + 0x0,0x0,0x0,0x9a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd,0xe, + // :/images/rightarrow.png + 0x0,0x0,0x1,0xb2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x94,0x76, + // :/images/fitall.png + 0x0,0x0,0x4,0x84,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc7,0xe8, + // :/images/draw.png + 0x0,0x0,0x3,0xec,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xbe,0x4e, + // :/images/splash.png + 0x0,0x0,0x1,0x64,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x21,0x26, + // :/images/past.png + 0x0,0x0,0x3,0xa4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb8,0xeb, + // :/images/rotate.png + 0x0,0x0,0x2,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9c,0xbf, + // :/images/save.png + 0x0,0x0,0x1,0x4e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1f,0x20, + // :/images/document.png + 0x0,0x0,0x4,0x2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xbf,0xb6, + // :/images/axe_box.png + 0x0,0x0,0x5,0x46,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xda,0xb4, + // :/images/gotocell.png + 0x0,0x0,0x1,0x94,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x91,0x67, + // :/images/icon.png + 0x0,0x0,0x5,0x30,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd9,0x82, + // :/images/person.png + 0x0,0x0,0x4,0x6a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc7,0x8, + // :/images/cut.png + 0x0,0x0,0x1,0xa,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1b,0x96, + // :/images/cut.png + 0x0,0x0,0x1,0xa,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1a,0xa9, + // :/images/saveas.png + 0x0,0x0,0x0,0x2a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x4,0xf, + // :/images/select.png + 0x0,0x0,0x3,0x74,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb7,0x92, + // :/images/redo.png + 0x0,0x0,0x0,0xb0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x12,0x3d, + // :/images/leftarrow.png + 0x0,0x0,0x4,0xd4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xcd,0x1a, + // :/images/wireframe.png + 0x0,0x0,0x0,0x5c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9,0xd3, + // :/images/convert.png + 0x0,0x0,0x2,0xe2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xab,0x39, + // :/images/mouse.png + 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, + // :/images/delete.png + 0x0,0x0,0x4,0x3a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xc2,0x8f, + // :/images/rightview.png + 0x0,0x0,0x3,0x54,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb5,0xf3, + // :/images/sendtoback.png + 0x0,0x0,0x3,0x16,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb3,0x75, + // :/images/panview.png + 0x0,0x0,0x2,0x36,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9b,0x7d, + // :/images/topview.png + 0x0,0x0,0x1,0xf4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x98,0xc0, + // :/images/bringtofront.png + 0x0,0x0,0x2,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9a,0x54, + // :/images/transparency.png + 0x0,0x0,0x0,0xe4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x14,0xd3, + +}; + +int qInitResources() +{ + extern bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} +Q_CONSTRUCTOR_FUNCTION(qInitResources) +int qCleanupResources() +{ + extern bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} +Q_DESTRUCTOR_FUNCTION(qCleanupResources) diff --git a/src/MCCAD/QMcCad/main.cpp b/src/MCCAD/QMcCad/main.cpp new file mode 100644 index 0000000..700dcaf --- /dev/null +++ b/src/MCCAD/QMcCad/main.cpp @@ -0,0 +1,330 @@ +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "../McCadMcVoid/McCadVoidCellManager.hxx" +#include "../McCadTool/McCadConvertConfig.hxx" +#include "../McCadIOTools/McCadInputModelData.hxx" +#include "../McCadTool/MaterialManager.hxx" + +using namespace std; + +map > PluginMakerMap; + +// print Version number +/////////////////////////// +void printVersion() { + cout << "\n=============================================\n" << + " " << "McCad" << " " << MCCAD_VERSION_MAJOR << "." << + MCCAD_VERSION_MINOR << "." << + MCCAD_VERSION_PATCH << endl << + "=============================================\n\n" << endl; +} + +// read file, return geometry +/////////////////////////////// +Handle_TopTools_HSequenceOfShape readFile( TCollection_AsciiString fileName){ + // get reader plugin + TCollection_AsciiString fileExtension = fileName; + fileExtension = fileExtension.Split(fileExtension.SearchFromEnd(".")-1); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + McCadEXPlug_ExchangePlugin* readerPlugin = pluginManager->GetPlugin(fileExtension); + // read file + readerPlugin->SetFilename(fileName); + Handle_TopTools_HSequenceOfShape shapes = new TopTools_HSequenceOfShape; + shapes = readerPlugin->Import(); + return shapes; +} + +// write geometry +////////////////// +void writeFile( TCollection_AsciiString outFileName, Handle_TopTools_HSequenceOfShape shapes){ + //get writer plugin + TCollection_AsciiString fileExtension = outFileName; + fileExtension = fileExtension.Split(fileExtension.SearchFromEnd(".")-1); + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + McCadEXPlug_ExchangePlugin* writerPlugin = pluginManager->GetPlugin(fileExtension); + // write file + writerPlugin->SetFilename(outFileName); + writerPlugin->Export(shapes); +} + +// MAIN +////////////////////// +int main(int argc, char *argv[]) { + // define messenger system + McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance(); + McCadMessenger_ObserverInterface* stdCoutObserver = new McCadMessenger_StdOut; + msgr->Register(stdCoutObserver); + + // define plugin path + char* pLibPath = getenv("MCCAD_LIBDIR"); + OSD_Path pluginPath("empty"); + if (pLibPath == NULL) { + cout << "MCCAD_LIBDIR is not defined!!! " << endl; + return 1; + } + else + pluginPath = OSD_Path(pLibPath); + + // load plugins + McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance(); + pluginManager->LoadSharedLibrary(pluginPath); + + // handle input parameters + TCollection_AsciiString Prog = argv[0]; + if(argc > 4 ) { + string arg3(argv[3]), arg4(argv[4]); + if(arg3 == ">" || arg3 == ">>") { + argc = 3; + } + else if(arg4 == ">" || arg4 == ">>") { + argc = 4; + } + else { + printUsage(Prog); + exit(0); + } + } + bool openFile = false; + + // handle input + TCollection_AsciiString inName; + if(argc > 1) + +//if (1) + { + TCollection_AsciiString inParameter; + inParameter = argv[1]; + if(argc > 2) + inName = argv[2]; + TCollection_AsciiString outputName; + TCollection_AsciiString strMatName = ""; + if (argc > 3) + strMatName = argv[3]; + if(inParameter.IsEqual("-h") || inParameter.IsEqual("--help")) { + printUsage(); + exit(0); + } + + /* test code */ + //inParameter = "-m"; + TCollection_AsciiString config_file = "McCadConfig.txt"; + //inName = "convertedTest.stp"; + //strMatName = "material.xml"; + /* test code */ + + // Expander + if(inParameter.IsEqual("-e") || inParameter.IsEqual("--explode")) { + cout << "\nMcCad_Exploder\n====================\n\n"; + Handle_TopTools_HSequenceOfShape inputShapes = readFile( inName ); + McCadIOHelper_Expander expander(inputShapes); + Handle_TopTools_HSequenceOfShape expandedFiles = expander.GetExplodedShapes(); + if(expandedFiles->Length() < 2){ + TCollection_AsciiString message("Failed to expand file : "); + message.AssignCat(inName); + msgr->Message(message.ToCString()); + exit(0); + } + TCollection_AsciiString tmpName(inName); + TCollection_AsciiString fileFilter = tmpName.Split( tmpName.SearchFromEnd(".") -1 ); + for(int i=1; i<=expandedFiles->Length(); i++){ + TCollection_AsciiString outName(tmpName); + outName.Prepend("ExOut"); + outName.AssignCat("_"); + outName.AssignCat(i); + outName.AssignCat(fileFilter); + Handle_TopTools_HSequenceOfShape singleShape = new TopTools_HSequenceOfShape; + singleShape->Append(expandedFiles->Value(i)); + writeFile(outName, singleShape); + } + } + + // Convertor + else if(inParameter.IsEqual("-d") || inParameter.IsEqual("--decompose")) { + cout << "\nMcCad_Decomposer\n====================\n\n"; + // read file + Handle_TopTools_HSequenceOfShape inputShapes = readFile( inName ); + + // decompose geometry + McCadConvertTools_Convertor convertor(inputShapes); + convertor.Convert(); + if (argc == 4 && !outputName.IsEmpty()) + convertor.SetFileName(outputName); + + if(!convertor.IsConverted()){ + cout << "Conversion failed!!!\n"; + return -1; + } + + // export decomposed geometry to stp file + TCollection_AsciiString exportName("converted"); + exportName += inName; + inName = exportName.Split(exportName.SearchFromEnd(".")); + exportName += "stp"; + writeFile( exportName, convertor.GetConvertedModel()); + } + + // export decomposed geometry to stp file + // Lei Lu 20150501 +// TCollection_AsciiString exportName("converted"); +// exportName += inName; +// inName = exportName.Split(exportName.SearchFromEnd(".")); +// exportName += "stp"; +// writeFile( exportName, convertor.GetConvertedModel()); + // } + + // Fuse + else if(inParameter.IsEqual("-f") || inParameter.IsEqual("--fuse")) { + cout << "\nMcCad_Fusioner\n====================\n\n"; + McCadIOHelper_Merger myMerger(inName); + if(argc == 4 && !outputName.IsEmpty()) + myMerger.MergeToFile(outputName); + else + myMerger.Merge(); + } + + // Surface check + else if(inParameter.IsEqual("-s") || inParameter.IsEqual("--surface-check")) { + cout << "\n McCad_SurfaceChecker\n====================\n\n"; + if(argc < 3 || (argc == 4 && outputName.IsEmpty()) || argc > 4) { + cout << "Output file name required\n\n"; + exit(-1); + } + McCadCSGTool_SurfaceChecker surfCheck; + surfCheck.readDirectory(inName, outputName); + } + + // Void Generator + else if(inParameter.IsEqual("-m") || inParameter.IsEqual("--mcnp") || + inParameter.IsEqual("-t") || inParameter.IsEqual("--tripoli")|| + inParameter.IsEqual("-g") || inParameter.IsEqual("--gdml")) + { + // read parameter file + if (!McCadConvertConfig::ReadPrmt(config_file)) + { + return 0; + } + + McCadInputModelData input_model; + if (!input_model.LoadSTEPModel(inName)) + { + cout << "#Main Function: Read geometry data error! Please check the input file name!\n\n"; + return 0; + } + + // New void generation algorithm + // Modified by Lei Lu 12/08/2012 ~ 18/12/2013 + McCadVoidCellManager * pVoidCellManager = new McCadVoidCellManager(); + + + + Handle(TopTools_HSequenceOfShape) hInputShape = input_model.GetModelData(); + pVoidCellManager->ReadGeomData( hInputShape ); + pVoidCellManager->ReadMatData(strMatName); + TCollection_AsciiString outName = inName; // Set the output file name + outName.Split(outName.SearchFromEnd(".")-1); // Remove the file extension. + + if(inParameter.IsEqual("-t") || inParameter.IsEqual("--tripoli")) + { + pVoidCellManager->SetConvetor("TRIPOLI"); + outName += "_TRIPOLI.txt"; + } + else if(inParameter.IsEqual("-m") || inParameter.IsEqual("--mcnp")) + { + pVoidCellManager->SetConvetor("MCNP"); + outName += "_MCNP.txt"; + } + //qiu add to generate GDML input + else if (inParameter.IsEqual("-g") || inParameter.IsEqual("--gdml")) + { + pVoidCellManager->SetConvetor("GDML"); + outName += ".gdml"; + } + + + pVoidCellManager->SetOutFileName(outName); + pVoidCellManager->Process(); // Process the conversion work + + delete pVoidCellManager; + pVoidCellManager = NULL; + } + + // open file for GUI + else if(inParameter.Search(".stp") > 0 || inParameter.Search(".mcn") > 0 || + inParameter.Search(".d") > 0 || inParameter.Search(".step") > 0 || + inParameter.Search(".mcnp") > 0 || inParameter.Search(".tri") > 0 || + inParameter.IsEqual(".") ) + { + openFile = true; + inName = inParameter; + } + + // print version + else if(inParameter.IsEqual("-v") || inParameter.IsEqual("--version")) + printVersion(); + else { + cout << "\nUnknown Parameter ... " << argv[1] << endl; + printUsage(Prog); + } + + if(!openFile) + return 0; + } + + // GUI + ////////////////////////////////////// + QApplication app(argc, argv); + QSplashScreen* splash = new QSplashScreen(QPixmap(":images/splash.png"), Qt::WindowStaysOnTopHint); + splash->show(); + splash->showMessage(app.tr("Loading libraries ....."), Qt::AlignRight | Qt::AlignBottom); + QMcCad_Application QMcWin; + + // loading plugins + QMcWin.SetPluginPath(pluginPath); + QMcWin.LoadPlugins(); + Handle_TColStd_HSequenceOfAsciiString Formats = QMcWin.Formats(); + for (int j=1; j<= Formats->Length(); j++) + splash->showMessage(app.tr(Formats->Value(j).ToCString()), Qt::AlignRight|Qt::AlignBottom); + + QMcWin.show(); + + // delete splash + if (splash) { + splash->finish(&QMcWin); + delete splash; + } + + // open file imediately after window is loaded + if(openFile) + QMcWin.SetOpenFile(inName); + + // run Qt program + return app.exec(); +} diff --git a/src/MCCAD/QMcCad/moc_CADProperties.cxx b/src/MCCAD/QMcCad/moc_CADProperties.cxx new file mode 100644 index 0000000..958ac0e --- /dev/null +++ b/src/MCCAD/QMcCad/moc_CADProperties.cxx @@ -0,0 +1,86 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'CADProperties.h' +** +** Created: Wed Dec 10 16:13:31 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "CADProperties.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'CADProperties.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_CADProperties[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 4, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 15, 14, 14, 14, 0x05, + + // slots: signature, parameters, type, tag, flags + 58, 14, 14, 14, 0x08, + 72, 14, 14, 14, 0x08, + 99, 14, 14, 14, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_CADProperties[] = { + "CADProperties\0\0MaterialSelected(Graphic3d_NameOfMaterial)\0" + "ResetSlider()\0SlotItemSelectionChanged()\0" + "SlotMaterialSelected(QString)\0" +}; + +const QMetaObject CADProperties::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_CADProperties, + qt_meta_data_CADProperties, 0 } +}; + +const QMetaObject *CADProperties::metaObject() const +{ + return &staticMetaObject; +} + +void *CADProperties::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_CADProperties)) + return static_cast(const_cast(this)); + return QWidget::qt_metacast(_clname); +} + +int CADProperties::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: MaterialSelected(*reinterpret_cast< Graphic3d_NameOfMaterial(*)>(_a[1])); break; + case 1: ResetSlider(); break; + case 2: SlotItemSelectionChanged(); break; + case 3: SlotMaterialSelected(*reinterpret_cast< QString(*)>(_a[1])); break; + } + _id -= 4; + } + return _id; +} + +// SIGNAL 0 +void CADProperties::MaterialSelected(Graphic3d_NameOfMaterial _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} diff --git a/src/MCCAD/QMcCad/moc_McCadExDllMcnp_Mcnp.cxx b/src/MCCAD/QMcCad/moc_McCadExDllMcnp_Mcnp.cxx new file mode 100644 index 0000000..e2dee3f --- /dev/null +++ b/src/MCCAD/QMcCad/moc_McCadExDllMcnp_Mcnp.cxx @@ -0,0 +1,81 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'McCadExDllMcnp_Mcnp.hxx' +** +** Created: Tue Aug 12 16:54:49 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../../inc/McCadExDllMcnp_Mcnp.hxx" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'McCadExDllMcnp_Mcnp.hxx' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_McCadExDllMcnp_Mcnp[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 2, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 21, 20, 20, 20, 0x05, + + // slots: signature, parameters, type, tag, flags + 38, 20, 20, 20, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_McCadExDllMcnp_Mcnp[] = { + "McCadExDllMcnp_Mcnp\0\0ExportFinished()\0ContinueExportFromDocument()\0" +}; + +const QMetaObject McCadExDllMcnp_Mcnp::staticMetaObject = { + { &McCadEXPlug_ExchangePlugin::staticMetaObject, qt_meta_stringdata_McCadExDllMcnp_Mcnp, + qt_meta_data_McCadExDllMcnp_Mcnp, 0 } +}; + +const QMetaObject *McCadExDllMcnp_Mcnp::metaObject() const +{ + return &staticMetaObject; +} + +void *McCadExDllMcnp_Mcnp::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_McCadExDllMcnp_Mcnp)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "QWidget")) + return static_cast(const_cast(this)); + return McCadEXPlug_ExchangePlugin::qt_metacast(_clname); +} + +int McCadExDllMcnp_Mcnp::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = McCadEXPlug_ExchangePlugin::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: ExportFinished(); break; + case 1: ContinueExportFromDocument(); break; + } + _id -= 2; + } + return _id; +} + +// SIGNAL 0 +void McCadExDllMcnp_Mcnp::ExportFinished() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_ActionFactory.cxx b/src/MCCAD/QMcCad/moc_QMcCad_ActionFactory.cxx new file mode 100644 index 0000000..1021202 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_ActionFactory.cxx @@ -0,0 +1,60 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_ActionFactory.h' +** +** Created: Fri Nov 14 10:18:23 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_ActionFactory.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_ActionFactory.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_ActionFactory[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_ActionFactory[] = { + "QMcCad_ActionFactory\0" +}; + +const QMetaObject QMcCad_ActionFactory::staticMetaObject = { + { &QObject::staticMetaObject, qt_meta_stringdata_QMcCad_ActionFactory, + qt_meta_data_QMcCad_ActionFactory, 0 } +}; + +const QMetaObject *QMcCad_ActionFactory::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_ActionFactory::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_ActionFactory)) + return static_cast(const_cast(this)); + return QObject::qt_metacast(_clname); +} + +int QMcCad_ActionFactory::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_ActionMaster.cxx b/src/MCCAD/QMcCad/moc_QMcCad_ActionMaster.cxx new file mode 100644 index 0000000..6e4d817 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_ActionMaster.cxx @@ -0,0 +1,201 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_ActionMaster.h' +** +** Created: Fri Nov 14 10:18:23 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_ActionMaster.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_ActionMaster.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_ActionMaster[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 56, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 21, 20, 20, 20, 0x05, + + // slots: signature, parameters, type, tag, flags + 37, 20, 20, 20, 0x0a, + 48, 20, 20, 20, 0x0a, + 59, 20, 20, 20, 0x0a, + 69, 20, 20, 20, 0x0a, + 80, 20, 20, 20, 0x0a, + 91, 20, 20, 20, 0x0a, + 104, 20, 20, 20, 0x0a, + 120, 20, 20, 20, 0x0a, + 138, 20, 20, 20, 0x0a, + 151, 20, 20, 20, 0x0a, + 169, 20, 20, 20, 0x0a, + 187, 20, 20, 20, 0x0a, + 200, 20, 20, 20, 0x0a, + 214, 20, 20, 20, 0x0a, + 227, 20, 20, 20, 0x0a, + 237, 20, 20, 20, 0x0a, + 250, 20, 20, 20, 0x0a, + 268, 20, 20, 20, 0x0a, + 287, 20, 20, 20, 0x0a, + 304, 20, 20, 20, 0x0a, + 324, 20, 20, 20, 0x0a, + 342, 20, 20, 20, 0x0a, + 361, 20, 20, 20, 0x0a, + 377, 20, 20, 20, 0x0a, + 389, 20, 20, 20, 0x0a, + 404, 20, 20, 20, 0x0a, + 416, 20, 20, 20, 0x0a, + 427, 20, 20, 20, 0x0a, + 440, 20, 20, 20, 0x0a, + 460, 20, 20, 20, 0x0a, + 482, 20, 20, 20, 0x0a, + 496, 20, 20, 20, 0x0a, + 511, 20, 20, 20, 0x0a, + 530, 20, 20, 20, 0x0a, + 550, 20, 20, 20, 0x0a, + 567, 20, 20, 20, 0x0a, + 583, 20, 20, 20, 0x0a, + 599, 20, 20, 20, 0x0a, + 611, 20, 20, 20, 0x0a, + 627, 20, 20, 20, 0x0a, + 640, 20, 20, 20, 0x0a, + 651, 20, 20, 20, 0x0a, + 669, 20, 20, 20, 0x0a, + 681, 20, 20, 20, 0x0a, + 694, 20, 20, 20, 0x0a, + 706, 20, 20, 20, 0x0a, + 725, 20, 20, 20, 0x0a, + 742, 20, 20, 20, 0x0a, + 764, 20, 20, 20, 0x0a, + 781, 20, 20, 20, 0x0a, + 801, 20, 20, 20, 0x0a, + 825, 20, 20, 20, 0x0a, + 844, 20, 20, 20, 0x0a, + 864, 20, 20, 20, 0x0a, + 878, 20, 20, 20, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_ActionMaster[] = { + "QMcCad_ActionMaster\0\0ActionStarted()\0SlotUndo()\0SlotRedo()\0" + "SlotCut()\0SlotCopy()\0SlotPast()\0SlotSelect()\0SlotSelectAll()\0" + "SlotDeselectAll()\0SlotRedraw()\0SlotZooomWindow()\0SlotZoomDynamic()\0" + "SlotZoomIn()\0SlotZoomOut()\0SlotFitAll()\0SlotPan()\0SlotRotate()\0" + "SlotBackProject()\0SlotFrontProject()\0SlotTopProject()\0" + "SlotBottomProject()\0SlotLeftProject()\0SlotRightProject()\0" + "SlotWireFrame()\0SlotShade()\0SlotDistance()\0SlotAngle()\0SlotArea()\0" + "SlotVolume()\0SlotCurveProperty()\0SlotSurfaceProperty()\0SlotMakeBox()\0" + "SlotMakeCone()\0SlotMakeCylinder()\0SlotMakeHalfSpace()\0" + "SlotMakeSphere()\0SlotMakeTorus()\0SlotMakeWedge()\0SlotErase()\0" + "SlotModelCopy()\0SlotMirror()\0SlotMove()\0SlotModelRotate()\0" + "SlotScale()\0SlotStrech()\0SlotUnion()\0SlotIntersection()\0" + "SlotDifference()\0SlotBackgroundColor()\0SlotShapeColor()\0" + "SlotShapeMaterial()\0SlotShapeTransparency()\0SlotAntialiasing()\0" + "SlotSetHiddenLine()\0SlotSetAxis()\0SlotSetGrid()\0" +}; + +const QMetaObject QMcCad_ActionMaster::staticMetaObject = { + { &QObject::staticMetaObject, qt_meta_stringdata_QMcCad_ActionMaster, + qt_meta_data_QMcCad_ActionMaster, 0 } +}; + +const QMetaObject *QMcCad_ActionMaster::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_ActionMaster::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_ActionMaster)) + return static_cast(const_cast(this)); + return QObject::qt_metacast(_clname); +} + +int QMcCad_ActionMaster::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: ActionStarted(); break; + case 1: SlotUndo(); break; + case 2: SlotRedo(); break; + case 3: SlotCut(); break; + case 4: SlotCopy(); break; + case 5: SlotPast(); break; + case 6: SlotSelect(); break; + case 7: SlotSelectAll(); break; + case 8: SlotDeselectAll(); break; + case 9: SlotRedraw(); break; + case 10: SlotZooomWindow(); break; + case 11: SlotZoomDynamic(); break; + case 12: SlotZoomIn(); break; + case 13: SlotZoomOut(); break; + case 14: SlotFitAll(); break; + case 15: SlotPan(); break; + case 16: SlotRotate(); break; + case 17: SlotBackProject(); break; + case 18: SlotFrontProject(); break; + case 19: SlotTopProject(); break; + case 20: SlotBottomProject(); break; + case 21: SlotLeftProject(); break; + case 22: SlotRightProject(); break; + case 23: SlotWireFrame(); break; + case 24: SlotShade(); break; + case 25: SlotDistance(); break; + case 26: SlotAngle(); break; + case 27: SlotArea(); break; + case 28: SlotVolume(); break; + case 29: SlotCurveProperty(); break; + case 30: SlotSurfaceProperty(); break; + case 31: SlotMakeBox(); break; + case 32: SlotMakeCone(); break; + case 33: SlotMakeCylinder(); break; + case 34: SlotMakeHalfSpace(); break; + case 35: SlotMakeSphere(); break; + case 36: SlotMakeTorus(); break; + case 37: SlotMakeWedge(); break; + case 38: SlotErase(); break; + case 39: SlotModelCopy(); break; + case 40: SlotMirror(); break; + case 41: SlotMove(); break; + case 42: SlotModelRotate(); break; + case 43: SlotScale(); break; + case 44: SlotStrech(); break; + case 45: SlotUnion(); break; + case 46: SlotIntersection(); break; + case 47: SlotDifference(); break; + case 48: SlotBackgroundColor(); break; + case 49: SlotShapeColor(); break; + case 50: SlotShapeMaterial(); break; + case 51: SlotShapeTransparency(); break; + case 52: SlotAntialiasing(); break; + case 53: SlotSetHiddenLine(); break; + case 54: SlotSetAxis(); break; + case 55: SlotSetGrid(); break; + } + _id -= 56; + } + return _id; +} + +// SIGNAL 0 +void QMcCad_ActionMaster::ActionStarted() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_Application.cpp b/src/MCCAD/QMcCad/moc_QMcCad_Application.cpp new file mode 100644 index 0000000..3bf8c2b --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_Application.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_Application.h' +** +** Created: Wed Apr 30 11:17:05 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_Application.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_Application.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_Application[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 14, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // slots: signature, parameters, type, tag, flags + 20, 19, 19, 19, 0x08, + 34, 19, 19, 19, 0x08, + 49, 19, 19, 19, 0x08, + 65, 19, 19, 19, 0x08, + 80, 19, 19, 19, 0x08, + 97, 19, 19, 19, 0x08, + 112, 19, 19, 19, 0x08, + 124, 19, 19, 19, 0x08, + 135, 19, 19, 19, 0x08, + 152, 19, 19, 19, 0x08, + 164, 19, 19, 19, 0x08, + 175, 19, 19, 19, 0x08, + 193, 19, 19, 19, 0x08, + 212, 19, 19, 19, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_Application[] = { + "QMcCad_Application\0\0SlotFileNew()\0SlotFileOpen()\0SlotFileClose()\0" + "SlotFileSave()\0SlotFileSaveAs()\0SlotHardcopy()\0SlotPrint()\0" + "SlotQuit()\0OpenRecentFile()\0SlotAbout()\0SlotHelp()\0" + "SlotUpdateMenus()\0SlotEditorClosed()\0SlotUpdateMainTitle()\0" +}; + +const QMetaObject QMcCad_Application::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_QMcCad_Application, + qt_meta_data_QMcCad_Application, 0 } +}; + +const QMetaObject *QMcCad_Application::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_Application::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_Application)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "McCadAEV_Application")) + return static_cast(const_cast(this)); + return QMainWindow::qt_metacast(_clname); +} + +int QMcCad_Application::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: SlotFileNew(); break; + case 1: SlotFileOpen(); break; + case 2: SlotFileClose(); break; + case 3: SlotFileSave(); break; + case 4: SlotFileSaveAs(); break; + case 5: SlotHardcopy(); break; + case 6: SlotPrint(); break; + case 7: SlotQuit(); break; + case 8: OpenRecentFile(); break; + case 9: SlotAbout(); break; + case 10: SlotHelp(); break; + case 11: SlotUpdateMenus(); break; + case 12: SlotEditorClosed(); break; + case 13: SlotUpdateMainTitle(); break; + } + _id -= 14; + } + return _id; +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_Application.cxx b/src/MCCAD/QMcCad/moc_QMcCad_Application.cxx new file mode 100644 index 0000000..1d4a754 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_Application.cxx @@ -0,0 +1,121 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_Application.h' +** +** Created: Wed Dec 10 12:42:36 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_Application.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_Application.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_Application[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 19, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 20, 19, 19, 19, 0x05, + + // slots: signature, parameters, type, tag, flags + 46, 19, 19, 19, 0x08, + 60, 19, 19, 19, 0x08, + 75, 19, 19, 19, 0x08, + 91, 19, 19, 19, 0x08, + 106, 19, 19, 19, 0x08, + 123, 19, 19, 19, 0x08, + 138, 19, 19, 19, 0x08, + 150, 19, 19, 19, 0x08, + 161, 19, 19, 19, 0x08, + 190, 19, 19, 19, 0x08, + 214, 19, 19, 19, 0x08, + 263, 261, 19, 19, 0x08, + 295, 19, 19, 19, 0x08, + 312, 19, 19, 19, 0x08, + 324, 19, 19, 19, 0x08, + 335, 19, 19, 19, 0x08, + 353, 19, 19, 19, 0x08, + 375, 19, 19, 19, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_Application[] = { + "QMcCad_Application\0\0SignalResetTransparency()\0SlotFileNew()\0" + "SlotFileOpen()\0SlotFileClose()\0SlotFileSave()\0SlotFileSaveAs()\0" + "SlotHardcopy()\0SlotPrint()\0SlotQuit()\0SlotTransparencyChanged(int)\0" + "SlotApplyTransparency()\0SlotMaterialSelected(Graphic3d_NameOfMaterial)\0" + ",\0SlotUpdataProgress(int,QString)\0OpenRecentFile()\0SlotAbout()\0" + "SlotHelp()\0SlotUpdateMenus()\0SlotEditorClosed(int)\0" + "SlotUpdateMainTitle()\0" +}; + +const QMetaObject QMcCad_Application::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_QMcCad_Application, + qt_meta_data_QMcCad_Application, 0 } +}; + +const QMetaObject *QMcCad_Application::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_Application::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_Application)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "McCadAEV_Application")) + return static_cast(const_cast(this)); + return QMainWindow::qt_metacast(_clname); +} + +int QMcCad_Application::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: SignalResetTransparency(); break; + case 1: SlotFileNew(); break; + case 2: SlotFileOpen(); break; + case 3: SlotFileClose(); break; + case 4: SlotFileSave(); break; + case 5: SlotFileSaveAs(); break; + case 6: SlotHardcopy(); break; + case 7: SlotPrint(); break; + case 8: SlotQuit(); break; + case 9: SlotTransparencyChanged(*reinterpret_cast< int(*)>(_a[1])); break; + case 10: SlotApplyTransparency(); break; + case 11: SlotMaterialSelected(*reinterpret_cast< Graphic3d_NameOfMaterial(*)>(_a[1])); break; + case 12: SlotUpdataProgress(*reinterpret_cast< int(*)>(_a[1]),*reinterpret_cast< QString(*)>(_a[2])); break; + case 13: OpenRecentFile(); break; + case 14: SlotAbout(); break; + case 15: SlotHelp(); break; + case 16: SlotUpdateMenus(); break; + case 17: SlotEditorClosed(*reinterpret_cast< int(*)>(_a[1])); break; + case 18: SlotUpdateMainTitle(); break; + } + _id -= 19; + } + return _id; +} + +// SIGNAL 0 +void QMcCad_Application::SignalResetTransparency() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_Editor.cpp b/src/MCCAD/QMcCad/moc_QMcCad_Editor.cpp new file mode 100644 index 0000000..bc8a39c --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_Editor.cpp @@ -0,0 +1,121 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_Editor.h' +** +** Created: Wed Apr 30 11:17:06 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_Editor.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_Editor.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_Editor[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 13, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 15, 14, 14, 14, 0x05, + 38, 14, 14, 14, 0x05, + 62, 14, 14, 14, 0x05, + + // slots: signature, parameters, type, tag, flags + 80, 14, 14, 14, 0x0a, + 101, 14, 14, 14, 0x0a, + 121, 14, 14, 14, 0x0a, + 140, 14, 14, 14, 0x0a, + 159, 14, 14, 14, 0x0a, + 177, 14, 14, 14, 0x0a, + 196, 14, 14, 14, 0x0a, + 203, 14, 14, 14, 0x0a, + 214, 212, 14, 14, 0x0a, + 240, 212, 14, 14, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_Editor[] = { + "QMcCad_Editor\0\0keyPressed(QKeyEvent*)\0keyReleased(QKeyEvent*)\0" + "updateMainTitle()\0SlotDecomposeModel()\0SlotGenerateVoids()\0" + "SlotConvertModel()\0SlotExplodeModel()\0SlotMergeModels()\0" + "SlotViewModified()\0goOn()\0goOnVG()\0e\0keyPressEvent(QKeyEvent*)\0" + "keyReleaseEvent(QKeyEvent*)\0" +}; + +const QMetaObject QMcCad_Editor::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_QMcCad_Editor, + qt_meta_data_QMcCad_Editor, 0 } +}; + +const QMetaObject *QMcCad_Editor::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_Editor::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_Editor)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "McCadAEV_Editor")) + return static_cast(const_cast(this)); + return QMainWindow::qt_metacast(_clname); +} + +int QMcCad_Editor::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: keyPressed(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 1: keyReleased(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 2: updateMainTitle(); break; + case 3: SlotDecomposeModel(); break; + case 4: SlotGenerateVoids(); break; + case 5: SlotConvertModel(); break; + case 6: SlotExplodeModel(); break; + case 7: SlotMergeModels(); break; + case 8: SlotViewModified(); break; + case 9: goOn(); break; + case 10: goOnVG(); break; + case 11: keyPressEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 12: keyReleaseEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + } + _id -= 13; + } + return _id; +} + +// SIGNAL 0 +void QMcCad_Editor::keyPressed(QKeyEvent * _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void QMcCad_Editor::keyReleased(QKeyEvent * _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} + +// SIGNAL 2 +void QMcCad_Editor::updateMainTitle() +{ + QMetaObject::activate(this, &staticMetaObject, 2, 0); +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_Editor.cxx b/src/MCCAD/QMcCad/moc_QMcCad_Editor.cxx new file mode 100644 index 0000000..e974d3c --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_Editor.cxx @@ -0,0 +1,159 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_Editor.h' +** +** Created: Fri Nov 14 10:18:23 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_Editor.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_Editor.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_Editor[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 18, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 15, 14, 14, 14, 0x05, + 35, 14, 14, 14, 0x05, + 58, 14, 14, 14, 0x05, + 82, 14, 14, 14, 0x05, + 100, 14, 14, 14, 0x05, + 109, 14, 14, 14, 0x05, + 126, 124, 14, 14, 0x05, + + // slots: signature, parameters, type, tag, flags + 154, 14, 14, 14, 0x0a, + 175, 14, 14, 14, 0x0a, + 195, 14, 14, 14, 0x0a, + 214, 14, 14, 14, 0x0a, + 233, 14, 14, 14, 0x0a, + 252, 14, 14, 14, 0x0a, + 272, 14, 14, 14, 0x0a, + 296, 14, 14, 14, 0x0a, + 321, 14, 14, 14, 0x0a, + 345, 343, 14, 14, 0x0a, + 371, 343, 14, 14, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_Editor[] = { + "QMcCad_Editor\0\0decompositionDone()\0keyPressed(QKeyEvent*)\0" + "keyReleased(QKeyEvent*)\0updateMainTitle()\0saveAs()\0destroyed(int)\0,\0" + "updateProgress(int,QString)\0SlotDecomposeSolid()\0SlotGenerateVoids()\0" + "SlotExplodeModel()\0SlotViewModified()\0SlotReadVGParams()\0" + "updateProgress(int)\0SlotDecompositionDone()\0SlotVoidGenerationDone()\0" + "SlotSetVGParameters()\0e\0keyPressEvent(QKeyEvent*)\0" + "keyReleaseEvent(QKeyEvent*)\0" +}; + +const QMetaObject QMcCad_Editor::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_QMcCad_Editor, + qt_meta_data_QMcCad_Editor, 0 } +}; + +const QMetaObject *QMcCad_Editor::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_Editor::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_Editor)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "McCadAEV_Editor")) + return static_cast(const_cast(this)); + return QMainWindow::qt_metacast(_clname); +} + +int QMcCad_Editor::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: decompositionDone(); break; + case 1: keyPressed(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 2: keyReleased(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 3: updateMainTitle(); break; + case 4: saveAs(); break; + case 5: destroyed(*reinterpret_cast< int(*)>(_a[1])); break; + case 6: updateProgress(*reinterpret_cast< int(*)>(_a[1]),*reinterpret_cast< QString(*)>(_a[2])); break; + case 7: SlotDecomposeSolid(); break; + case 8: SlotGenerateVoids(); break; + case 9: SlotExplodeModel(); break; + case 10: SlotViewModified(); break; + case 11: SlotReadVGParams(); break; + case 12: updateProgress(*reinterpret_cast< int(*)>(_a[1])); break; + case 13: SlotDecompositionDone(); break; + case 14: SlotVoidGenerationDone(); break; + case 15: SlotSetVGParameters(); break; + case 16: keyPressEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 17: keyReleaseEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + } + _id -= 18; + } + return _id; +} + +// SIGNAL 0 +void QMcCad_Editor::decompositionDone() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} + +// SIGNAL 1 +void QMcCad_Editor::keyPressed(QKeyEvent * _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} + +// SIGNAL 2 +void QMcCad_Editor::keyReleased(QKeyEvent * _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 2, _a); +} + +// SIGNAL 3 +void QMcCad_Editor::updateMainTitle() +{ + QMetaObject::activate(this, &staticMetaObject, 3, 0); +} + +// SIGNAL 4 +void QMcCad_Editor::saveAs() +{ + QMetaObject::activate(this, &staticMetaObject, 4, 0); +} + +// SIGNAL 5 +void QMcCad_Editor::destroyed(int _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 5, _a); +} + +// SIGNAL 6 +void QMcCad_Editor::updateProgress(int _t1, QString _t2) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)), const_cast(reinterpret_cast(&_t2)) }; + QMetaObject::activate(this, &staticMetaObject, 6, _a); +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_LogWindow.cpp b/src/MCCAD/QMcCad/moc_QMcCad_LogWindow.cpp new file mode 100644 index 0000000..813beb5 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_LogWindow.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_LogWindow.h' +** +** Created: Wed Apr 30 11:17:08 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_LogWindow.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_LogWindow.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_LogWindow[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_LogWindow[] = { + "QMcCad_LogWindow\0" +}; + +const QMetaObject QMcCad_LogWindow::staticMetaObject = { + { &QTextEdit::staticMetaObject, qt_meta_stringdata_QMcCad_LogWindow, + qt_meta_data_QMcCad_LogWindow, 0 } +}; + +const QMetaObject *QMcCad_LogWindow::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_LogWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_LogWindow)) + return static_cast(const_cast(this)); + return QTextEdit::qt_metacast(_clname); +} + +int QMcCad_LogWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QTextEdit::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_LogWindow.cxx b/src/MCCAD/QMcCad/moc_QMcCad_LogWindow.cxx new file mode 100644 index 0000000..e410d75 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_LogWindow.cxx @@ -0,0 +1,60 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_LogWindow.h' +** +** Created: Fri Nov 14 10:18:24 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_LogWindow.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_LogWindow.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_LogWindow[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_LogWindow[] = { + "QMcCad_LogWindow\0" +}; + +const QMetaObject QMcCad_LogWindow::staticMetaObject = { + { &QTextEdit::staticMetaObject, qt_meta_stringdata_QMcCad_LogWindow, + qt_meta_data_QMcCad_LogWindow, 0 } +}; + +const QMetaObject *QMcCad_LogWindow::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_LogWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_LogWindow)) + return static_cast(const_cast(this)); + return QTextEdit::qt_metacast(_clname); +} + +int QMcCad_LogWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QTextEdit::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_PDialog.cxx b/src/MCCAD/QMcCad/moc_QMcCad_PDialog.cxx new file mode 100644 index 0000000..124cba8 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_PDialog.cxx @@ -0,0 +1,60 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_PDialog.h' +** +** Created: Fri Nov 14 10:18:23 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_PDialog.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_PDialog.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_PDialog[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_PDialog[] = { + "QMcCad_PDialog\0" +}; + +const QMetaObject QMcCad_PDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_QMcCad_PDialog, + qt_meta_data_QMcCad_PDialog, 0 } +}; + +const QMetaObject *QMcCad_PDialog::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_PDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_PDialog)) + return static_cast(const_cast(this)); + return QDialog::qt_metacast(_clname); +} + +int QMcCad_PDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_VGParameters.cxx b/src/MCCAD/QMcCad/moc_QMcCad_VGParameters.cxx new file mode 100644 index 0000000..3fc2fa0 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_VGParameters.cxx @@ -0,0 +1,60 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_VGParameters.h' +** +** Created: Fri Jul 18 13:41:18 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_VGParameters.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_VGParameters.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_VGParameters[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_VGParameters[] = { + "QMcCad_VGParameters\0" +}; + +const QMetaObject QMcCad_VGParameters::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_QMcCad_VGParameters, + qt_meta_data_QMcCad_VGParameters, 0 } +}; + +const QMetaObject *QMcCad_VGParameters::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_VGParameters::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_VGParameters)) + return static_cast(const_cast(this)); + return QDialog::qt_metacast(_clname); +} + +int QMcCad_VGParameters::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_View.cpp b/src/MCCAD/QMcCad/moc_QMcCad_View.cpp new file mode 100644 index 0000000..9db5b39 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_View.cpp @@ -0,0 +1,116 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_View.h' +** +** Created: Wed Apr 30 11:17:07 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_View.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_View.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_View[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 14, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 13, 12, 12, 12, 0x05, + 28, 12, 12, 12, 0x05, + + // slots: signature, parameters, type, tag, flags + 45, 43, 12, 12, 0x0a, + 75, 43, 12, 12, 0x0a, + 107, 43, 12, 12, 0x0a, + 136, 12, 12, 12, 0x0a, + 156, 12, 12, 12, 0x0a, + 176, 12, 12, 12, 0x0a, + 203, 12, 12, 12, 0x0a, + 231, 43, 12, 12, 0x0a, + 256, 43, 12, 12, 0x0a, + 282, 43, 12, 12, 0x0a, + 310, 12, 12, 12, 0x0a, + 325, 12, 12, 12, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_View[] = { + "QMcCad_View\0\0InitFinished()\0viewModified()\0e\0" + "mousePressEvent(QMouseEvent*)\0mouseReleaseEvent(QMouseEvent*)\0" + "mouseMoveEvent(QMouseEvent*)\0LeaveEvent(QEvent*)\0EnterEvent(QEvent*)\0" + "FocusInEvent(QFocusEvent*)\0FocusOutEvent(QFocusEvent*)\0" + "wheelEvent(QWheelEvent*)\0keyPressEvent(QKeyEvent*)\0" + "keyReleaseEvent(QKeyEvent*)\0SlotInitTask()\0PreExecute()\0" +}; + +const QMetaObject QMcCad_View::staticMetaObject = { + { &QGLWidget::staticMetaObject, qt_meta_stringdata_QMcCad_View, + qt_meta_data_QMcCad_View, 0 } +}; + +const QMetaObject *QMcCad_View::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_View::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_View)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "McCadCom_CasView")) + return static_cast(const_cast(this)); + return QGLWidget::qt_metacast(_clname); +} + +int QMcCad_View::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QGLWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: InitFinished(); break; + case 1: viewModified(); break; + case 2: mousePressEvent(*reinterpret_cast< QMouseEvent*(*)>(_a[1])); break; + case 3: mouseReleaseEvent(*reinterpret_cast< QMouseEvent*(*)>(_a[1])); break; + case 4: mouseMoveEvent(*reinterpret_cast< QMouseEvent*(*)>(_a[1])); break; + case 5: LeaveEvent(*reinterpret_cast< QEvent*(*)>(_a[1])); break; + case 6: EnterEvent(*reinterpret_cast< QEvent*(*)>(_a[1])); break; + case 7: FocusInEvent(*reinterpret_cast< QFocusEvent*(*)>(_a[1])); break; + case 8: FocusOutEvent(*reinterpret_cast< QFocusEvent*(*)>(_a[1])); break; + case 9: wheelEvent(*reinterpret_cast< QWheelEvent*(*)>(_a[1])); break; + case 10: keyPressEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 11: keyReleaseEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 12: SlotInitTask(); break; + case 13: PreExecute(); break; + } + _id -= 14; + } + return _id; +} + +// SIGNAL 0 +void QMcCad_View::InitFinished() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} + +// SIGNAL 1 +void QMcCad_View::viewModified() +{ + QMetaObject::activate(this, &staticMetaObject, 1, 0); +} diff --git a/src/MCCAD/QMcCad/moc_QMcCad_View.cxx b/src/MCCAD/QMcCad/moc_QMcCad_View.cxx new file mode 100644 index 0000000..42c60e2 --- /dev/null +++ b/src/MCCAD/QMcCad/moc_QMcCad_View.cxx @@ -0,0 +1,116 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'QMcCad_View.h' +** +** Created: Fri Nov 14 10:18:23 2008 +** by: The Qt Meta Object Compiler version 59 (Qt 4.1.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "QMcCad_View.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'QMcCad_View.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 59 +#error "This file was generated using the moc from 4.1.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +static const uint qt_meta_data_QMcCad_View[] = { + + // content: + 1, // revision + 0, // classname + 0, 0, // classinfo + 14, 10, // methods + 0, 0, // properties + 0, 0, // enums/sets + + // signals: signature, parameters, type, tag, flags + 13, 12, 12, 12, 0x05, + 28, 12, 12, 12, 0x05, + + // slots: signature, parameters, type, tag, flags + 45, 43, 12, 12, 0x0a, + 75, 43, 12, 12, 0x0a, + 107, 43, 12, 12, 0x0a, + 136, 12, 12, 12, 0x0a, + 156, 12, 12, 12, 0x0a, + 176, 12, 12, 12, 0x0a, + 203, 12, 12, 12, 0x0a, + 231, 43, 12, 12, 0x0a, + 256, 43, 12, 12, 0x0a, + 282, 43, 12, 12, 0x0a, + 310, 12, 12, 12, 0x0a, + 325, 12, 12, 12, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_QMcCad_View[] = { + "QMcCad_View\0\0InitFinished()\0viewModified()\0e\0" + "mousePressEvent(QMouseEvent*)\0mouseReleaseEvent(QMouseEvent*)\0" + "mouseMoveEvent(QMouseEvent*)\0LeaveEvent(QEvent*)\0EnterEvent(QEvent*)\0" + "FocusInEvent(QFocusEvent*)\0FocusOutEvent(QFocusEvent*)\0" + "wheelEvent(QWheelEvent*)\0keyPressEvent(QKeyEvent*)\0" + "keyReleaseEvent(QKeyEvent*)\0SlotInitTask()\0PreExecute()\0" +}; + +const QMetaObject QMcCad_View::staticMetaObject = { + { &QGLWidget::staticMetaObject, qt_meta_stringdata_QMcCad_View, + qt_meta_data_QMcCad_View, 0 } +}; + +const QMetaObject *QMcCad_View::metaObject() const +{ + return &staticMetaObject; +} + +void *QMcCad_View::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QMcCad_View)) + return static_cast(const_cast(this)); + if (!strcmp(_clname, "McCadCom_CasView")) + return static_cast(const_cast(this)); + return QGLWidget::qt_metacast(_clname); +} + +int QMcCad_View::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QGLWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: InitFinished(); break; + case 1: viewModified(); break; + case 2: mousePressEvent(*reinterpret_cast< QMouseEvent*(*)>(_a[1])); break; + case 3: mouseReleaseEvent(*reinterpret_cast< QMouseEvent*(*)>(_a[1])); break; + case 4: mouseMoveEvent(*reinterpret_cast< QMouseEvent*(*)>(_a[1])); break; + case 5: LeaveEvent(*reinterpret_cast< QEvent*(*)>(_a[1])); break; + case 6: EnterEvent(*reinterpret_cast< QEvent*(*)>(_a[1])); break; + case 7: FocusInEvent(*reinterpret_cast< QFocusEvent*(*)>(_a[1])); break; + case 8: FocusOutEvent(*reinterpret_cast< QFocusEvent*(*)>(_a[1])); break; + case 9: wheelEvent(*reinterpret_cast< QWheelEvent*(*)>(_a[1])); break; + case 10: keyPressEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 11: keyReleaseEvent(*reinterpret_cast< QKeyEvent*(*)>(_a[1])); break; + case 12: SlotInitTask(); break; + case 13: PreExecute(); break; + } + _id -= 14; + } + return _id; +} + +// SIGNAL 0 +void QMcCad_View::InitFinished() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} + +// SIGNAL 1 +void QMcCad_View::viewModified() +{ + QMetaObject::activate(this, &staticMetaObject, 1, 0); +} diff --git a/src/MCCAD/QMcCad/qrc_qmccad.cpp b/src/MCCAD/QMcCad/qrc_qmccad.cpp new file mode 100644 index 0000000..351e7b2 --- /dev/null +++ b/src/MCCAD/QMcCad/qrc_qmccad.cpp @@ -0,0 +1,5636 @@ +/**************************************************************************** +** Resource object code +** +** Created: Wed Dec 21 12:16:07 2011 +** by: The Resource Compiler for Qt version 4.7.4 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include + +static const unsigned char qt_resource_data[] = { + // /home/mccad/Desktop/images/mouse.png + 0x0,0x0,0x4,0xb, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, + 0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd0,0x9,0x1d,0x6,0x27,0x0,0xaf, + 0xc1,0x95,0x6b,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0, + 0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb, + 0x11,0x0,0x0,0xb,0x11,0x1,0x7f,0x64,0x5f,0x91,0x0,0x0,0x3,0x88,0x49,0x44, + 0x41,0x54,0x58,0xc3,0xed,0x96,0x49,0x4b,0x1b,0x71,0x18,0xc6,0xfd,0x24,0x7e,0xc, + 0x3f,0x80,0x9e,0x4,0x2f,0x92,0x83,0x58,0xa,0x6,0xf,0x1e,0x3c,0x58,0x82,0x7a, + 0x10,0x41,0xf,0x52,0x10,0x4,0x17,0xf0,0x24,0x7a,0x88,0x8,0x6e,0x7,0x15,0x83, + 0x88,0xb,0x11,0xd,0x2a,0x2a,0x6e,0x49,0xe3,0x9e,0x68,0x16,0xc5,0x2c,0x6a,0x62, + 0x4c,0x62,0xb6,0xa7,0xf3,0xbc,0x65,0xa6,0x41,0xec,0x92,0x54,0x6d,0xa1,0xe,0xbc, + 0x68,0x66,0x86,0xff,0xf3,0x7b,0xf7,0x29,0x28,0x78,0xbf,0xbe,0x5f,0x78,0xc6,0xde, + 0x5c,0xfc,0xaf,0x7a,0x5e,0xf0,0xdf,0x2,0xe4,0xa,0xf1,0x6a,0xb5,0xf2,0xab,0xc3, + 0xe4,0xf9,0xc2,0xc2,0x2,0xd2,0xe9,0xb4,0x66,0x83,0x83,0x83,0x2f,0xa,0xf2,0xa3, + 0xc3,0x44,0xd8,0x6a,0xb5,0xa2,0xa6,0xa6,0x46,0xec,0xf6,0xf6,0x16,0x89,0x44,0x42, + 0x3,0xe1,0xf3,0x57,0x1,0x29,0x29,0x29,0xc1,0xc9,0xc9,0x9,0x6e,0x6e,0x6e,0x10, + 0xa,0x85,0x70,0x7f,0x7f,0x8f,0x40,0x20,0xa0,0x81,0x64,0x32,0x19,0x9c,0x9e,0x9e, + 0x6a,0xbf,0xc7,0xc6,0xc6,0x5e,0x16,0xc4,0x60,0x30,0x88,0xa7,0xb4,0x78,0x3c,0x2e, + 0x96,0x4c,0x26,0x45,0x98,0x9e,0xab,0xc2,0x84,0xf2,0x7a,0xbd,0xd8,0xde,0xde,0x96, + 0x68,0x64,0xa5,0x26,0x7f,0x71,0xb3,0xd9,0xc,0xb7,0xdb,0xad,0x89,0x50,0x98,0xa2, + 0xd9,0xe2,0x4,0x4a,0x78,0x3c,0x88,0x2b,0xe9,0xb9,0xbb,0xbb,0xc3,0xe5,0xe5,0x25, + 0x2e,0x2e,0x2e,0x70,0x78,0x78,0x88,0xf9,0xf9,0xf9,0xbc,0x21,0x30,0x3b,0x3b,0x8b, + 0xeb,0xeb,0x6b,0x44,0xa3,0x51,0x2d,0xcf,0x2a,0x48,0x24,0x12,0x91,0xbf,0x3e,0x9f, + 0x4f,0x60,0x32,0x9f,0x3f,0x23,0x5d,0x57,0x87,0xc7,0xc7,0x47,0x49,0x91,0xdf,0xef, + 0x97,0x68,0x1c,0x1c,0x1c,0xe4,0xd,0x81,0x99,0x99,0x19,0x9c,0x9f,0x9f,0xcb,0x61, + 0xb1,0x58,0x4c,0x0,0xe8,0xad,0xa,0x42,0x6f,0xa3,0xc9,0x28,0x7c,0x51,0x1f,0xec, + 0x8b,0x8b,0xf0,0xad,0xad,0x21,0xb3,0xbf,0x8f,0x94,0x92,0xaa,0x40,0x20,0x82,0xbd, + 0x3d,0x9f,0x12,0x3d,0x6f,0xde,0x91,0x40,0x6b,0x6b,0xab,0x72,0xc8,0x1e,0x9c,0x4e, + 0xa7,0x78,0xfa,0xf0,0xf0,0xa0,0x15,0x1f,0xc5,0xe9,0xb9,0xd1,0x69,0x84,0xce,0xac, + 0x43,0x67,0x67,0x27,0xec,0x4a,0xba,0x32,0x4a,0xde,0x13,0xa1,0x8,0x3e,0x7e,0x70, + 0xc2,0xf0,0xc9,0x5,0x8f,0x3b,0x28,0x29,0xc9,0x7,0x2,0x75,0x4a,0x48,0x4d,0x26, + 0x13,0xec,0x76,0xbb,0x6,0xd1,0xd0,0xd0,0x80,0xab,0xab,0xab,0x6f,0x61,0x57,0x6c, + 0xc0,0x31,0x80,0x42,0x53,0x21,0xf4,0x16,0x3d,0xfc,0x31,0xbf,0xdc,0xa3,0xb8,0xcd, + 0x1a,0x95,0x7a,0x61,0xfa,0x8,0xed,0x72,0xb9,0xa4,0x85,0x73,0x81,0x40,0x59,0x59, + 0x99,0x40,0x4c,0x4c,0x4c,0x88,0x7,0x3b,0x3b,0x3b,0x2,0x40,0xef,0xd5,0x54,0x50, + 0xb0,0xed,0x4b,0x1b,0x9c,0x11,0x27,0xc2,0xe1,0xa4,0x26,0xae,0x2,0x12,0x22,0x1c, + 0xe,0x4b,0x14,0x8e,0x8e,0x8e,0xb0,0xba,0xba,0x9a,0x1b,0x44,0x45,0x45,0x5,0xea, + 0xeb,0xeb,0xa5,0x1e,0x7a,0x7a,0x7a,0x70,0x7c,0x7c,0x2c,0xde,0xd0,0x2b,0x15,0x82, + 0xc2,0x14,0x7d,0x2a,0xae,0x76,0xa,0xeb,0x87,0xef,0x3b,0x1c,0xe,0x89,0xe6,0xa2, + 0x52,0x2f,0xbf,0xd,0x50,0x5c,0x5c,0x8c,0xca,0xca,0x4a,0xf1,0x9c,0x0,0x5b,0x5b, + 0x5b,0x72,0xc8,0xd9,0xd9,0x99,0x6,0x11,0x89,0xa4,0x9e,0x15,0x7f,0x1a,0x5,0xb6, + 0x33,0x1d,0x58,0x5f,0x5f,0xcf,0x2d,0xa,0xa5,0xa5,0xa5,0xa8,0xae,0xae,0x46,0x53, + 0x53,0x13,0xfa,0xfb,0xfb,0x25,0x8c,0xcc,0x27,0x3b,0x24,0x18,0xc,0xa,0x44,0x2a, + 0x95,0x7a,0x56,0x5c,0x8d,0x2,0xdf,0x61,0xd,0x11,0x7c,0x77,0x77,0x57,0x5a,0x3c, + 0xa7,0x82,0xac,0xaa,0xaa,0x92,0x28,0x74,0x77,0x77,0x63,0x78,0x78,0x18,0x1b,0x1b, + 0x1b,0x52,0x17,0xf4,0x8a,0x35,0xc1,0xe,0x51,0xf7,0x42,0xb6,0x38,0x2f,0x35,0xa, + 0x7c,0x8f,0xd0,0x84,0xb7,0x58,0x2c,0xe8,0xea,0xea,0xca,0xd,0xa2,0xb6,0xb6,0x16, + 0xed,0xed,0xed,0xe8,0xeb,0xeb,0xc3,0xe8,0xe8,0xa8,0x14,0x25,0x3d,0xe2,0xc0,0xe1, + 0xc0,0x92,0xb9,0xa0,0x54,0xfd,0x53,0x10,0x5e,0xfc,0x4d,0x48,0x16,0x23,0x53,0xc8, + 0x71,0x3d,0x34,0x34,0x94,0xfb,0x6c,0x68,0x6e,0x6e,0x46,0x6f,0x6f,0x2f,0x8c,0x46, + 0x23,0xa6,0xa6,0xa6,0xb0,0xb4,0xb4,0x24,0x5e,0xd1,0x8,0xc2,0xa1,0xc5,0x49,0xa8, + 0xee,0x8b,0xec,0xb5,0xcd,0x7b,0x7c,0xce,0xc5,0x66,0xb3,0xd9,0xd0,0xd2,0xd2,0x92, + 0xdf,0x84,0x6c,0x6c,0x6c,0x14,0x88,0x91,0x91,0x11,0x4c,0x4e,0x4e,0xca,0xe2,0xa1, + 0x47,0x2c,0x30,0x8f,0xb2,0x13,0x98,0x6b,0x6e,0x4d,0x7a,0x2c,0x7b,0x42,0x89,0x8, + 0x61,0x38,0xa6,0x79,0x9f,0x51,0x60,0xf4,0x74,0x3a,0x5d,0xfe,0x7b,0x82,0x46,0x88, + 0xe9,0xe9,0x69,0x69,0xab,0x95,0x95,0x15,0x6c,0x6e,0x6e,0x8a,0x77,0x14,0xc8,0x5e, + 0xdd,0x6a,0x5a,0x68,0x6c,0xc9,0xf1,0xf1,0x71,0x69,0xed,0xa2,0xa2,0xa2,0x3f,0xdf, + 0x96,0xb4,0xb9,0xb9,0x39,0x69,0xad,0x7d,0x65,0xf,0x70,0xd8,0xb0,0x30,0x29,0x4e, + 0x63,0x5d,0xd0,0xd8,0x86,0x1c,0xeb,0x2c,0x62,0xbd,0x5e,0x2f,0x9d,0xf5,0xe2,0x9f, + 0x72,0xcb,0xcb,0xcb,0xb2,0x86,0xe9,0xbd,0x3a,0x82,0x99,0x6b,0xae,0x74,0x16,0x2d, + 0xc5,0xd9,0xca,0xe5,0xe5,0xe5,0xaf,0xf6,0x11,0x2c,0x7,0xf3,0xeb,0x88,0xe1,0xe6, + 0xca,0xe6,0xff,0x9c,0x1b,0x1c,0xe7,0x1d,0x1d,0x1d,0x6f,0xf6,0xf5,0x8d,0x9f,0xd8, + 0xfb,0xf5,0xef,0x5d,0x5f,0x1,0x7d,0x6f,0x24,0x3e,0xa1,0x41,0x41,0xeb,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/saveas.png + 0x0,0x0,0x4,0x7f, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0xf9,0x43,0xbb,0x7f,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1, + 0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0x1,0x14, + 0xc,0x3b,0x9,0x57,0x8a,0xa0,0xc7,0x0,0x0,0x3,0xff,0x49,0x44,0x41,0x54,0x38, + 0xcb,0x95,0x95,0x7f,0x4c,0x94,0x75,0x1c,0xc7,0x5f,0xcf,0x73,0x77,0x78,0xc0,0x21, + 0xf1,0x6b,0x22,0x34,0xea,0x44,0xf1,0x47,0x6d,0x29,0x5b,0xb3,0x62,0x88,0xcc,0x6c, + 0xa5,0x5c,0xfe,0xaa,0xf9,0x6b,0xa4,0xab,0xdc,0x54,0x4a,0xac,0x15,0xd,0x75,0x65, + 0x83,0xc9,0xcc,0xa2,0xf9,0xb3,0xb2,0x72,0x41,0x96,0xe2,0xd4,0x21,0xc2,0xc8,0x8d, + 0x26,0xd4,0xa0,0xe4,0x8f,0x12,0x8e,0x43,0x11,0xa3,0x3b,0xb8,0x10,0x38,0x7e,0x1c, + 0xc7,0x71,0x70,0xc7,0x73,0x7c,0xfb,0x43,0x40,0x12,0x4e,0xe9,0xbd,0x7d,0xf6,0xec, + 0xd9,0xbe,0x9f,0xd7,0x5e,0xcf,0xf7,0xf3,0x6c,0x1f,0x49,0x8,0x1,0x80,0x24,0x49, + 0x32,0xa0,0x1a,0x57,0xd2,0x48,0xf9,0x4c,0x7d,0xe5,0x9f,0x89,0x1a,0x21,0x61,0x6d, + 0xb7,0x9a,0x93,0xd7,0xa5,0x58,0x0,0xef,0x68,0xc9,0xa3,0x50,0x83,0xc1,0xb0,0x21, + 0x22,0x22,0xc2,0x6,0xc,0x0,0x4e,0xa0,0xf,0x70,0xf8,0xaa,0x1d,0xbb,0xb6,0x39, + 0xa2,0xd4,0x3,0x25,0xbd,0x85,0xdf,0x97,0x44,0x59,0xac,0xa6,0xad,0x1b,0xd7,0xdb, + 0x80,0x2d,0x80,0xe,0xd0,0x48,0x42,0x8,0x24,0x49,0xd2,0xa4,0xa4,0xa4,0x5c,0x8d, + 0x5f,0xe5,0x48,0x8,0x9c,0xd1,0x49,0x86,0xc1,0xf4,0x20,0x51,0x14,0xef,0x30,0x96, + 0x9b,0x57,0xb0,0x57,0x9f,0xa7,0xbb,0xbc,0x9,0x6e,0x3a,0xb1,0xe9,0x1f,0xc3,0x1c, + 0x1b,0xd7,0xb6,0xf7,0x40,0x4e,0x12,0x60,0x53,0x8f,0x9c,0x55,0xb9,0x5c,0xae,0x84, + 0xc0,0x19,0x9d,0x5c,0x3a,0x75,0x8b,0xc,0x3,0x64,0x66,0x66,0xfa,0x4,0x67,0xef, + 0xd9,0x8e,0xea,0xce,0x45,0xbc,0xaa,0x76,0xa,0x6b,0x9a,0x78,0xda,0xee,0x20,0xd0, + 0xee,0x60,0x79,0x5c,0x42,0xe4,0xb5,0x97,0x52,0xe6,0x16,0x95,0x16,0xf7,0x8f,0x81, + 0xdd,0x6e,0x37,0xde,0x61,0x37,0x42,0x28,0x0,0xe4,0xe4,0xe4,0x4c,0x4e,0x15,0x1e, + 0x5a,0xab,0xd6,0x20,0x94,0x56,0xe,0x1e,0xad,0xa7,0xae,0x49,0xc7,0x23,0x61,0x83, + 0x44,0xf7,0x35,0x53,0x52,0x78,0x96,0x22,0x63,0xb5,0x7,0x98,0x36,0xa,0x1e,0x1b, + 0x52,0xd2,0xc6,0xbb,0xcf,0xc9,0x8c,0x83,0x74,0xfe,0x24,0x3c,0xd5,0x4a,0x64,0x98, + 0x8b,0x83,0x47,0x8c,0xdc,0x34,0xcb,0xc,0xfb,0xd9,0x59,0xb9,0x73,0x21,0x1d,0xba, + 0x50,0xf2,0x76,0x96,0x1,0xa8,0x1,0xd5,0x4,0xf0,0x68,0xee,0x37,0x16,0xca,0x30, + 0x9d,0xa6,0xd3,0x74,0x78,0xae,0x93,0xfb,0x95,0x85,0x5f,0x6b,0x63,0x19,0x70,0xff, + 0xc5,0xfe,0xbd,0x31,0xd8,0xe7,0xc8,0x94,0xfe,0x5d,0x36,0x7a,0x54,0x6,0x24,0xb5, + 0xaf,0x7b,0x1c,0x6f,0x9c,0x9d,0x95,0x85,0xb5,0x36,0x1f,0x59,0x54,0x50,0x5c,0xdc, + 0x48,0x55,0xf9,0x0,0xfd,0xf6,0x56,0x32,0xdf,0x89,0x26,0x69,0x69,0xa,0xf9,0x96, + 0x53,0x13,0xfa,0x7d,0x82,0xc7,0x1b,0x1b,0x6b,0xce,0x11,0xa6,0xb2,0x50,0xf9,0x4b, + 0x3f,0x3f,0x9e,0x6d,0xc5,0xd9,0xeb,0x20,0x6d,0x7d,0x8,0x89,0x8b,0x9f,0xe3,0xf1, + 0xf8,0x4f,0x50,0xcc,0xc7,0x26,0xf4,0xcb,0x3c,0x24,0xbd,0xdd,0x37,0x8,0xb,0x30, + 0x51,0x6f,0x6d,0xe3,0xb3,0x93,0x46,0x94,0x9e,0xe9,0x18,0x12,0xfc,0x58,0xfd,0xea, + 0x5c,0x66,0x3d,0x7b,0x0,0x8d,0xc6,0x7f,0xd2,0xbe,0x49,0x8d,0x33,0xb,0xee,0x5d, + 0xf9,0xf6,0x79,0x87,0x19,0xea,0x15,0xec,0xfb,0xb4,0x88,0x16,0xbb,0x87,0x15,0x7a, + 0xc1,0x6b,0x1b,0xe7,0x71,0xde,0x56,0xcb,0x60,0xd9,0x2c,0x9f,0x42,0x93,0x82,0x8b, + 0x3f,0xf,0xe3,0x76,0x4d,0x2f,0x69,0xaf,0xaf,0xc4,0x6f,0x76,0x34,0x1f,0x67,0x95, + 0xd2,0xde,0x34,0xc0,0xfc,0x18,0x17,0xbb,0xd2,0xe6,0xb3,0x6c,0x87,0x9,0x5b,0x8f, + 0x1b,0x80,0x98,0x5,0xb0,0xe9,0xc3,0x29,0x82,0x5b,0x1b,0x3d,0xe4,0x7d,0xfb,0x16, + 0x2f,0x24,0x2e,0xe1,0xfd,0xb4,0x13,0xfc,0x66,0x72,0x31,0x3b,0x44,0xe1,0xa3,0xb7, + 0x83,0xa9,0x68,0xe,0x67,0xf7,0x7b,0xeb,0xd1,0xeb,0xf5,0x7c,0x90,0xbd,0x89,0xe6, + 0xfa,0x29,0x1a,0xbb,0xda,0x82,0x38,0x9c,0xf3,0x6,0xc9,0x89,0xc9,0x64,0x65,0x1f, + 0xa7,0xda,0x58,0x47,0x48,0xf0,0x20,0xbb,0xd3,0xf4,0x38,0x95,0x21,0x6e,0xdf,0x59, + 0xc0,0xa2,0x85,0xd1,0xe8,0x74,0x3a,0x54,0x2a,0xdf,0xb3,0xf9,0xcf,0xf0,0x16,0xcc, + 0x5c,0xc9,0x9c,0x81,0x15,0xac,0x59,0xbd,0x84,0x2f,0x8e,0x9e,0xa6,0xa2,0xdc,0x88, + 0x4a,0xdd,0xcd,0xee,0x37,0x83,0x89,0x79,0x32,0x88,0x53,0xa5,0x6e,0x54,0xb2,0x1f, + 0x5a,0xad,0x16,0x8d,0x46,0xf3,0xc0,0xa1,0x8f,0x19,0xbf,0x9b,0x9e,0xce,0xf3,0x8f, + 0x46,0xe1,0xda,0x7c,0x8b,0xdc,0x6f,0x2e,0x71,0xe6,0x42,0x3,0x21,0xa2,0x9f,0x1d, + 0x5b,0x23,0x99,0xbf,0x28,0x96,0xdc,0x2f,0x6b,0xb8,0x7e,0xc3,0xc1,0xc2,0x27,0xc2, + 0x90,0x65,0x19,0x49,0x92,0x1e,0xe,0xce,0x3d,0x76,0x64,0xfa,0xda,0xb5,0xcf,0xd0, + 0x54,0x7d,0x99,0x9f,0xaf,0x56,0x72,0x21,0xff,0xa,0x92,0x2c,0xb1,0x6a,0x5d,0xc, + 0xf1,0x8b,0xb5,0x9c,0x2b,0x69,0xa3,0xbc,0xae,0xb,0x0,0xbd,0x5e,0x8f,0x56,0xab, + 0x45,0x96,0xef,0x7d,0xac,0x57,0x1,0xc5,0x33,0xf6,0x3a,0xc,0x8,0x35,0xc0,0x86, + 0xd4,0x57,0x36,0xbb,0x1c,0xff,0x10,0x3c,0x6d,0x26,0x1,0x4a,0x38,0xfe,0xb2,0x9d, + 0x84,0x65,0x1,0x2c,0x7d,0x31,0x8a,0xc2,0x8b,0x1d,0x14,0x54,0x98,0x51,0xee,0xfe, + 0x4,0x64,0xec,0xdf,0x34,0xc1,0xae,0xcb,0xa,0x66,0x23,0x0,0xd,0x80,0x2,0x78, + 0x25,0x21,0x4,0x4e,0x8f,0x3b,0xdf,0x6e,0xae,0x4a,0xb5,0x37,0xd6,0xd2,0xd7,0xd5, + 0x42,0x83,0xed,0x27,0xe2,0x16,0x6b,0x38,0x93,0xd7,0xcd,0xd7,0xdf,0xdd,0xc1,0xad, + 0xc,0x31,0x85,0x34,0x0,0xc5,0xc0,0x45,0xc0,0xa2,0x6,0xf0,0x38,0xbd,0x97,0x2a, + 0xab,0xae,0xa5,0x86,0x7,0x58,0x10,0xf4,0xa0,0x26,0xc6,0x79,0xe2,0x50,0x43,0xf9, + 0xf,0x45,0xcd,0x27,0x99,0x5a,0x86,0x47,0x4c,0xfb,0x80,0x4e,0xc0,0xa5,0x6,0xb0, + 0xb6,0xfc,0xde,0x9d,0x95,0x73,0xc8,0xb2,0xf6,0xe5,0xe5,0xfb,0xc2,0x43,0x43,0x7, + 0xd3,0xf7,0x14,0xfc,0x31,0x6e,0xef,0x4d,0x25,0x62,0x64,0xd7,0xb9,0x1,0x17,0xe0, + 0x92,0x84,0x10,0x94,0x5e,0x3e,0x2c,0x75,0xf5,0x4,0x46,0xa6,0x6e,0xd9,0xd6,0xf9, + 0x7f,0x96,0xe9,0x7d,0x60,0x31,0x7e,0x99,0xfe,0xb,0x33,0xdb,0xa5,0x23,0x1c,0x72, + 0x88,0xd0,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/close.png + 0x0,0x0,0x1,0x3d, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x4,0x0,0x0,0x0,0x6e,0xbd,0xa4,0xb0, + 0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0xbd,0x1f,0x5d,0xec,0x3,0x0,0x0, + 0x0,0x71,0x49,0x44,0x41,0x54,0x78,0xda,0x63,0x60,0x18,0x5,0x64,0x2,0x46,0x38, + 0xeb,0x3f,0x86,0x8,0x6,0x60,0x42,0x30,0xef,0xc0,0x34,0xa1,0x42,0xec,0x26,0xff, + 0x67,0x60,0x84,0x69,0x60,0x78,0x2,0xa5,0x1d,0x50,0x6c,0x42,0x32,0xf9,0x2e,0x9c, + 0xf5,0x84,0x41,0x86,0x90,0x33,0x94,0x91,0x4c,0x84,0xd0,0x7,0x70,0x2b,0xbe,0xcb, + 0xc0,0xc0,0x20,0x83,0x64,0xee,0x1,0x6,0x7,0xdc,0x8a,0x11,0xe0,0x9,0x54,0xe9, + 0x1,0x42,0x8a,0x61,0xe6,0x3a,0x10,0x67,0xf2,0x13,0xa8,0x6b,0x31,0x4d,0x66,0x41, + 0x30,0x97,0x40,0x31,0x3,0x56,0xcf,0xa1,0x85,0x33,0x3,0x76,0x80,0x27,0x46,0x87, + 0x2,0x0,0x0,0xc,0x88,0x1f,0xfb,0xc0,0x1c,0xa4,0x91,0x0,0x0,0x0,0x43,0x74, + 0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,0x0,0x40,0x28,0x23,0x29, + 0x49,0x6d,0x61,0x67,0x65,0x4d,0x61,0x67,0x69,0x63,0x6b,0x20,0x34,0x2e,0x32,0x2e, + 0x38,0x20,0x39,0x39,0x2f,0x30,0x38,0x2f,0x30,0x31,0x20,0x63,0x72,0x69,0x73,0x74, + 0x79,0x40,0x6d,0x79,0x73,0x74,0x69,0x63,0x2e,0x65,0x73,0x2e,0x64,0x75,0x70,0x6f, + 0x6e,0x74,0x2e,0x63,0x6f,0x6d,0x91,0xba,0x21,0xb8,0x0,0x0,0x0,0x2a,0x74,0x45, + 0x58,0x74,0x53,0x69,0x67,0x6e,0x61,0x74,0x75,0x72,0x65,0x0,0x33,0x34,0x32,0x64, + 0x31,0x32,0x35,0x66,0x30,0x65,0x37,0x63,0x34,0x65,0x31,0x31,0x35,0x31,0x30,0x64, + 0x64,0x39,0x31,0x30,0x63,0x31,0x30,0x63,0x35,0x30,0x37,0x62,0xa5,0xcd,0xbb,0x8e, + 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/wireframe.png + 0x0,0x0,0x1,0x99, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x60,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0x51,0xe,0xc3,0x20, + 0x8,0x86,0xb1,0xd9,0x65,0xe4,0x40,0x3d,0x4f,0xcf,0xd3,0x53,0xf4,0x14,0x7a,0x9b, + 0xb2,0x87,0x85,0x96,0xda,0x2a,0x60,0x9b,0xf5,0x4f,0x96,0xb8,0x45,0xe4,0x13,0x1, + 0x5d,0x20,0x22,0x82,0x17,0xf5,0x1,0x0,0xc8,0x39,0xbb,0x8c,0x10,0xe7,0xc3,0xf7, + 0x94,0xc6,0x2e,0xe7,0x88,0x8,0x83,0xdf,0x68,0x36,0xfd,0xa6,0x69,0x59,0x16,0x0, + 0x0,0x1f,0x0,0x3b,0x92,0x3b,0xe6,0x71,0xf,0x84,0xb,0xe0,0xca,0xf9,0x13,0x10, + 0x26,0x80,0x96,0xf3,0xbb,0x10,0x2a,0x80,0xc5,0xf9,0x1d,0x88,0x8f,0x75,0x51,0x0, + 0x80,0x18,0x71,0x1b,0xef,0xc5,0x3b,0x15,0xf3,0x93,0xd9,0xb9,0x9,0x40,0x3a,0xcd, + 0x79,0x5f,0xbc,0x16,0x99,0xda,0xfc,0x2e,0x80,0x18,0xd1,0xb4,0x88,0x94,0x9c,0x6f, + 0xb1,0xaf,0xe6,0x40,0x8f,0xf3,0x2b,0x18,0x19,0x11,0x17,0x0,0x43,0xdc,0x91,0xc5, + 0xbe,0x79,0x4,0xe5,0xe,0x2c,0x11,0x29,0xe7,0x6b,0x10,0x6a,0x12,0x96,0x67,0xca, + 0xaa,0x55,0x81,0xf7,0xd8,0x54,0x80,0xda,0xe2,0x9e,0xfe,0xd0,0x92,0xfb,0x32,0xb2, + 0x6a,0x5d,0xd7,0x77,0x1,0x86,0xc1,0xb6,0x74,0x17,0x80,0x6c,0xb5,0xbd,0xb7,0x60, + 0x37,0xc0,0x53,0xef,0x1,0x96,0x39,0x9,0xb9,0x2,0xea,0xf,0xb8,0x69,0x1b,0x79, + 0x2a,0xe1,0x4,0xc0,0xbb,0x21,0x3a,0x96,0x5d,0x8,0xbb,0x83,0x32,0xf3,0x65,0x4, + 0x52,0x1a,0x5d,0xd,0x4c,0x6d,0x44,0x57,0xe,0x4a,0xa5,0x34,0x6e,0x73,0x10,0xe7, + 0xc3,0x8d,0x18,0x23,0x36,0x4b,0xb6,0xa,0x20,0xbb,0x18,0xd1,0x2f,0x2,0xda,0x83, + 0x84,0x1d,0x9d,0xbb,0x67,0x3d,0x47,0x9a,0x11,0x90,0x61,0x27,0x9a,0xa0,0xec,0x7a, + 0xa5,0x38,0x3f,0xd8,0xce,0xd2,0xa4,0xaa,0x0,0x65,0xd8,0x73,0xf6,0x74,0x3c,0x79, + 0x1c,0x6d,0x3b,0xb5,0xc,0x7b,0x5a,0xad,0xb4,0xd1,0x4a,0xd4,0xf4,0x26,0xe4,0x4f, + 0x2f,0x44,0x4b,0xae,0xcb,0xc8,0x22,0x2f,0xe8,0x9,0xe0,0xee,0xed,0xe6,0xd5,0xe3, + 0x11,0xf0,0x6e,0x60,0x3,0xe0,0xff,0x6a,0xff,0x56,0x20,0x22,0xa,0x21,0xbc,0xe2, + 0x1c,0x0,0xe0,0xb,0x19,0xd2,0xb6,0xa5,0x5,0x41,0xe3,0x57,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/leftview.png + 0x0,0x0,0x1,0x9a, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x61,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xe1,0x11,0x83,0x20, + 0xc,0x85,0x1f,0x9e,0xcb,0x98,0x81,0x1c,0xc2,0x29,0x9c,0xc7,0x29,0x98,0x2,0xb6, + 0x31,0xfd,0xd1,0x8b,0x45,0x5,0x12,0xa8,0xd7,0xbe,0xbb,0x5e,0x2d,0x35,0xbc,0xf, + 0x49,0x0,0x1d,0x33,0x33,0xfe,0xa8,0x11,0x0,0x62,0x8c,0x4d,0x41,0x44,0xdb,0xe9, + 0x77,0x8,0x73,0x97,0x39,0x11,0x61,0x68,0xf,0xda,0x4c,0x6d,0x9a,0xbc,0xf7,0x0, + 0xd0,0x6,0x20,0x46,0xe9,0x88,0xe5,0xba,0x7,0xa2,0x9,0x20,0x67,0xfe,0x4,0x84, + 0x9,0xa0,0x66,0xfe,0x2d,0x84,0xa,0x60,0x31,0xbf,0x43,0x2c,0x66,0x80,0xd1,0xda, + 0xa9,0x55,0xef,0xfb,0xed,0x31,0x2a,0x80,0x88,0x36,0x3a,0x37,0xac,0xd2,0xbe,0x9a, + 0xcd,0xc2,0x1c,0xfa,0x0,0xc4,0x3c,0xed,0xa0,0x65,0x6a,0x6e,0xf0,0x89,0xf4,0x1c, + 0xd8,0x28,0x4b,0x6e,0x95,0x16,0x5f,0x7d,0x2,0x42,0x7e,0xfd,0x6,0x60,0x9e,0x2, + 0xd,0xfe,0x6,0x30,0x11,0x21,0x86,0x4f,0x90,0x74,0x70,0x1d,0x89,0x65,0xa,0x6a, + 0x8f,0x5e,0x74,0x9b,0x82,0x18,0x2,0x26,0xd2,0x3,0x9f,0x52,0x36,0x7,0x7e,0x9, + 0x31,0x2,0x28,0x9a,0xf1,0xa,0xc4,0xbe,0x8d,0xe,0xfb,0xbe,0xdb,0x1,0xd2,0x39, + 0x17,0x4d,0x44,0x70,0x2b,0xd0,0x9b,0xff,0xc3,0x60,0xdb,0x66,0xb2,0x55,0x70,0x24, + 0xe2,0x25,0x89,0x7a,0xaa,0x40,0x4b,0x44,0xb5,0xa,0xa4,0x93,0xa3,0x1a,0xa,0x9b, + 0x4d,0xae,0x1a,0x24,0xae,0xb6,0x16,0x64,0xab,0xc0,0x62,0x1e,0xc2,0x7c,0x32,0x2d, + 0x81,0x69,0xb,0x91,0x63,0x66,0x4e,0x8f,0x64,0x69,0x7d,0x5b,0xea,0x58,0x53,0xc9, + 0xdc,0x7b,0x8f,0x65,0x59,0xea,0x2b,0x61,0x69,0xe4,0x39,0xd5,0xee,0xa9,0x2d,0x5a, + 0xe6,0xf3,0x40,0xcd,0xfc,0xfa,0x5f,0xcb,0xa1,0xa4,0xa,0x60,0x35,0xff,0x6,0xa2, + 0x8,0xd0,0x6a,0xde,0xb,0xa1,0x4e,0x41,0xcf,0x99,0xbf,0x5,0xc2,0x94,0x3,0xf2, + 0xe9,0x85,0xa8,0xc9,0x7c,0x24,0xb3,0xaa,0x15,0xf4,0x6,0xd0,0xfb,0x9a,0xd5,0xab, + 0xc7,0x9f,0x40,0xeb,0x0,0xe,0x0,0x79,0x57,0xfb,0xb5,0x1c,0x33,0xb3,0x73,0xee, + 0x2f,0xe6,0x0,0xf0,0x2,0xad,0xda,0xc7,0x3a,0x2e,0x77,0xf3,0x70,0x0,0x0,0x0, + 0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/open.png + 0x0,0x0,0x5,0x2b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x4,0xbd,0x49,0x44,0x41,0x54,0x48,0xc7,0x95, + 0x95,0x6b,0x6c,0x53,0x65,0x18,0xc7,0x7f,0x6f,0xdb,0xdd,0x5b,0x56,0x16,0x58,0x58, + 0x77,0x61,0xb0,0x8d,0x5d,0x3b,0xc6,0x3a,0xa,0x13,0x86,0x83,0x5d,0x2,0xc2,0xc6, + 0x17,0x22,0xa8,0x31,0x18,0x13,0x9c,0x8,0x7e,0x32,0x12,0x21,0x31,0x1a,0xe3,0x96, + 0xc5,0x80,0x91,0x88,0x9b,0x23,0x40,0x34,0x44,0x14,0x51,0x37,0x60,0x3,0xbb,0x19, + 0xe5,0xba,0x65,0xc,0xd8,0x40,0xb9,0xc,0x36,0x1,0x45,0xd8,0xa,0x3,0xd9,0xb2, + 0x5b,0xfb,0xbe,0xad,0x1f,0x76,0x5a,0xeb,0xc2,0x17,0x4f,0xf2,0xff,0x70,0x72,0x4e, + 0x7e,0xff,0xe7,0xf9,0x9f,0xf3,0x3e,0x8f,0xf0,0x7a,0xbd,0x4,0x5e,0x42,0x8,0x1d, + 0xa0,0x9f,0x24,0xa1,0x3d,0x56,0x1,0xf2,0x68,0xf2,0x2,0x78,0x27,0x81,0x44,0xe0, + 0xbd,0x10,0x42,0x0,0x4e,0xa0,0x1,0xf8,0x0,0x68,0x7,0x62,0x80,0x13,0xc0,0x46, + 0xe0,0x9,0xe0,0xd6,0x24,0x3,0xe0,0x3e,0x3,0xbf,0x44,0x40,0x35,0x2,0xb8,0xba, + 0x7f,0xff,0xfe,0xd4,0xae,0xae,0x2e,0x9a,0x8e,0x37,0x79,0xb7,0x6e,0xdb,0x2a,0x6c, + 0x39,0x36,0xde,0x78,0xeb,0x75,0xf7,0x29,0xc7,0x99,0x21,0x60,0x17,0xf0,0x15,0x30, + 0xf2,0x14,0xf8,0x7f,0xba,0x11,0x80,0x1,0xd0,0x69,0xe0,0xb1,0xc3,0xd,0xd,0x58, + 0x62,0x63,0x71,0xb9,0x5c,0xd4,0xd6,0xd6,0x62,0x36,0x9b,0x9,0x8b,0x8,0x63,0x56, + 0x5a,0x22,0x8e,0x16,0x7,0x87,0xf,0x1c,0xb9,0xb,0x9c,0xd3,0x3a,0xaa,0x1,0x42, + 0x81,0x57,0x81,0xfe,0x80,0x6e,0xdc,0x2,0x8,0x3,0xec,0x40,0x37,0x70,0x7f,0x4f, + 0x5d,0x1d,0xf1,0xf1,0xf1,0x4c,0x31,0x9b,0x9,0xa,0xe,0xa6,0xa7,0xa7,0x87,0xce, + 0xce,0x4e,0x7a,0x7b,0x7b,0x29,0x5d,0x51,0xca,0xb8,0x18,0xa7,0xea,0xbd,0x2a,0x96, + 0x3d,0x57,0xe8,0x2e,0x2d,0x5e,0x1e,0xd4,0xd9,0x75,0x91,0x4f,0x2a,0x77,0x8e,0x0, + 0x5d,0xc0,0x76,0x2d,0xbe,0x31,0x1,0xec,0x5,0xd6,0x3,0xbf,0x3,0x29,0x6f,0x6f, + 0xde,0x4c,0x88,0x5e,0x4f,0x72,0x5a,0x1a,0x96,0xc4,0x44,0x4c,0x91,0x91,0x18,0x82, + 0x82,0x18,0x78,0x34,0x40,0x7d,0x7d,0x3d,0x4e,0xa7,0x13,0x7b,0x81,0x9d,0x5,0xb, + 0xed,0x4c,0x33,0x4f,0x67,0x74,0x7c,0x4,0xe7,0x3,0x27,0x75,0xbb,0xeb,0x68,0x3c, + 0xd4,0xa4,0x80,0x4a,0x60,0x8f,0x0,0xbc,0x47,0xda,0x1a,0x38,0x77,0xb6,0x83,0xbd, + 0x3b,0xf7,0x91,0x36,0x33,0x69,0xfc,0x7e,0x77,0x77,0xb0,0xd5,0x6a,0x15,0x99,0x39, + 0x39,0x24,0x65,0x64,0x10,0x93,0x90,0x80,0xd1,0x64,0xf2,0x1b,0x1c,0xfc,0xf6,0x20, + 0xe3,0x9e,0x71,0x66,0xc4,0xce,0xa0,0x7c,0x4d,0x39,0x3a,0x4,0x7a,0x8f,0x9e,0x2b, + 0x4f,0x7e,0x63,0x43,0x61,0x85,0xb,0xc8,0x11,0xc0,0x68,0x73,0x97,0x23,0xd4,0x12, + 0x1b,0x83,0xa3,0xb1,0x19,0xc7,0x91,0x66,0xee,0xdc,0xb8,0xe3,0x49,0x89,0xb6,0xe8, + 0x6e,0x5f,0xbf,0x4e,0x5a,0x5a,0x1a,0x56,0x9b,0x8d,0xa4,0x8c,0xc,0x66,0xc4,0xc5, + 0x11,0x61,0x32,0x61,0x30,0x18,0xb8,0xd9,0x73,0x93,0xb,0x97,0x2f,0xd0,0x79,0xe9, + 0x22,0x65,0xeb,0xca,0x48,0x4c,0x9a,0x49,0x42,0x7e,0x3c,0x36,0x9d,0x1d,0x20,0x4f, + 0x0,0xb9,0x15,0x5b,0x5e,0xeb,0x78,0x73,0xcb,0x66,0x1d,0x42,0x30,0x32,0x3c,0x42, + 0xdb,0x89,0x56,0x5a,0x4f,0xb5,0xf1,0xe0,0xfe,0x43,0x86,0xff,0x70,0x32,0x3c,0xf0, + 0x88,0x6c,0xab,0x95,0xcc,0xdc,0x5c,0x92,0xd2,0xd3,0x89,0xb6,0x58,0x88,0x30,0x1a, + 0xd1,0x1b,0xc,0xc,0xe,0xe,0x52,0xb3,0xb7,0x86,0x90,0xa8,0x60,0x36,0x56,0x55, + 0xb0,0xd8,0xf4,0x2c,0x40,0x81,0x0,0x12,0x80,0x7d,0x1f,0x7f,0xb9,0xa3,0xa8,0x78, + 0x45,0x11,0x4a,0x79,0x50,0x4a,0xa1,0xa4,0xe4,0x7c,0xeb,0x79,0x1a,0xbf,0x3f,0x86, + 0x31,0x24,0x8c,0xc7,0x77,0xfb,0xe8,0xbb,0x79,0x8b,0x2c,0xab,0x95,0x1c,0xbb,0x9d, + 0xd9,0xa9,0xa9,0x44,0x5b,0x2c,0x84,0x19,0x8d,0xe8,0xf5,0x7a,0xe,0x9d,0x38,0xc8, + 0xd2,0x75,0x85,0x2c,0x8f,0x5b,0x9,0xb0,0x4c,0x0,0xd1,0xc0,0xaa,0xe2,0xd5,0xc5, + 0x9f,0x57,0xef,0xaa,0xa,0x12,0x42,0x68,0x60,0x85,0x94,0x13,0x6,0x1d,0xed,0xe7, + 0x69,0x3b,0xd9,0x46,0xdf,0x9f,0x7d,0x8c,0xdd,0x1b,0xc0,0x3d,0x32,0x8a,0x2d,0x67, + 0x1e,0xf3,0xf2,0xf3,0xc9,0xb4,0xd9,0x88,0x9c,0x3a,0x95,0x6f,0x7e,0xfc,0x1a,0x7b, + 0x79,0x1e,0x6b,0xe7,0xbe,0x8,0x50,0x22,0x80,0xa9,0xc0,0x94,0xd0,0xf0,0xd0,0x96, + 0xaa,0xda,0xf,0x53,0x16,0x2f,0x2d,0x40,0x69,0x40,0xa5,0x14,0x52,0x4a,0xa4,0x5b, + 0xa1,0x94,0xe4,0x56,0xef,0x6d,0xea,0xf,0xd4,0x13,0x11,0x12,0xca,0xe0,0x5f,0x3, + 0xb8,0x86,0x86,0xd9,0xb0,0x69,0x13,0xa9,0xd9,0xd9,0x34,0xb4,0x34,0x30,0x7b,0xf1, + 0x2c,0x2a,0x8a,0x36,0x2,0x94,0xa,0xc0,0x8,0x44,0x0,0xb6,0x65,0xab,0x96,0x1e, + 0xad,0xfc,0xb4,0x52,0xa7,0xdc,0x12,0xa5,0x3c,0x48,0x25,0x51,0x1a,0xd4,0x7,0x57, + 0x4a,0x71,0xf5,0xf2,0x55,0xda,0x4e,0xb5,0x33,0xd0,0xff,0x90,0xac,0xc4,0x64,0xd6, + 0xbe,0xf0,0x32,0xa7,0x2f,0xb4,0x12,0x91,0x1c,0xc6,0x3b,0xeb,0xb6,0xf9,0xc1,0x21, + 0xda,0x21,0x31,0x1,0xc7,0x76,0x7c,0xb1,0x3d,0x2b,0x6f,0xe1,0x7c,0x94,0x74,0xfb, + 0xa3,0x50,0x52,0x69,0xd5,0x2b,0x7f,0xfe,0x52,0x2a,0x1e,0x3d,0x18,0xa0,0xab,0xfd, + 0x12,0xb6,0x64,0x2b,0x4f,0x5c,0xa3,0xc,0x99,0x6,0xa9,0xde,0xf4,0x91,0x1f,0x1c, + 0x4,0x4,0x3,0xe1,0xc0,0xb4,0xb8,0xc4,0xb8,0x46,0xdb,0x22,0x5b,0xe2,0xea,0xe7, + 0xcb,0x74,0x96,0x38,0xb,0x52,0x4e,0x54,0xaf,0xa4,0x44,0x2a,0xf,0x1e,0xb7,0xf4, + 0x77,0x22,0x95,0xe4,0xf4,0xc9,0x33,0x84,0xc,0xe9,0x98,0x93,0x91,0xc5,0x8d,0xa1, + 0x6e,0xea,0xde,0xdf,0xed,0x7,0xeb,0x34,0x78,0x88,0x6,0x37,0x1,0x5,0x51,0xd3, + 0xcd,0xd5,0x45,0xe5,0xc5,0xd3,0x6c,0xf6,0x5c,0x91,0x9a,0x9e,0x8a,0xf4,0x55,0xaa, + 0x7d,0x58,0x25,0x25,0xd2,0x2d,0xe9,0x77,0xf6,0x73,0xad,0xf3,0xa,0x39,0x73,0xf2, + 0xe8,0xb8,0x7d,0x8e,0x43,0x35,0xdf,0xf9,0xc1,0x42,0x9b,0xb9,0x86,0x80,0x58,0x7c, + 0xb9,0x6f,0x88,0xb6,0x44,0xaf,0xcc,0x9e,0x6f,0x4d,0x2c,0x5d,0x55,0x4a,0x6c,0xbc, + 0x5,0x29,0x3d,0x28,0xe5,0x46,0xba,0x27,0xf2,0x56,0x6e,0xc9,0xd1,0x86,0x26,0x4a, + 0xf2,0x4b,0x39,0x76,0xb6,0x89,0x9f,0x7f,0xf8,0x65,0x2,0xec,0xf5,0x7a,0x7d,0x73, + 0xd8,0x7,0xf,0xd6,0x26,0x56,0x98,0xd6,0x41,0x38,0x50,0x18,0x69,0x8e,0x7c,0x77, + 0x51,0xc9,0x33,0x53,0xac,0x36,0xab,0x48,0x4e,0x49,0xd2,0xf2,0x9f,0xf8,0x6b,0x46, + 0x86,0x87,0x79,0xec,0xfc,0x9b,0x66,0x87,0x83,0x4b,0x6d,0xbf,0xfe,0xb,0xe,0x18, + 0xf2,0xbe,0x8d,0xe1,0xcb,0x7d,0xb2,0xc9,0xfa,0xa8,0xe8,0xa8,0x35,0x73,0x32,0x53, + 0x62,0x96,0x94,0x2c,0x21,0x36,0xce,0x82,0x52,0xa,0xb7,0x5b,0xf2,0xd3,0xf1,0x16, + 0xae,0x75,0x5d,0xe3,0xee,0xad,0x7b,0x13,0x7,0xe4,0x29,0x1b,0x64,0xb2,0x81,0x2f, + 0x7f,0x9f,0x41,0x18,0xf0,0x4a,0xb8,0x31,0xfc,0xa5,0x9c,0x5,0x73,0xcd,0xe9,0xd6, + 0x34,0x91,0x92,0x9a,0x42,0x7f,0x7f,0x3f,0x9f,0x55,0xd7,0xe2,0x1a,0x73,0x4d,0x1c, + 0xe9,0xc9,0x3b,0x2f,0xc0,0x40,0xa7,0xc9,0xa0,0x69,0xb2,0x81,0x11,0x28,0xd3,0x86, + 0x7c,0xb4,0xf6,0xe,0xda,0xfa,0x2a,0x7a,0x2a,0xf8,0x7f,0x18,0xf8,0x14,0xac,0x75, + 0xe8,0x1,0x5c,0xc0,0xc8,0x3f,0xd8,0x60,0x2b,0x47,0x61,0x7b,0xa0,0xe6,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/redo.png + 0x0,0x0,0x0,0xe5, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x37,0x4,0x95,0x65,0x7e,0x42,0x0,0x0,0x0,0x72,0x49,0x44, + 0x41,0x54,0x78,0xda,0xed,0x93,0x41,0xb,0xc0,0x20,0x8,0x85,0xb5,0xdf,0x1d,0x3b, + 0xc8,0xfb,0xdf,0xee,0x30,0x82,0x65,0x29,0xe1,0xb6,0xc3,0xa0,0xf,0x3a,0x94,0xbd, + 0xa7,0xa1,0x11,0x6d,0x7e,0xb,0xdb,0x3,0x8,0xb4,0x1e,0xde,0xf5,0xca,0x49,0x63, + 0xe8,0x9a,0xcc,0x4b,0x0,0x6d,0x31,0x9e,0x57,0x1a,0x9,0xbd,0x4,0x2d,0x66,0x8c, + 0x6d,0x20,0xe6,0x9e,0xa0,0xf2,0xb8,0x27,0x2a,0xb9,0xd6,0xcc,0x2a,0xed,0x29,0xf9, + 0xbe,0xc7,0x2f,0x7b,0x60,0x1c,0x37,0xba,0x7c,0x61,0xda,0x19,0x43,0x56,0x45,0xab, + 0x23,0x39,0x88,0xae,0x5,0x49,0x19,0xf8,0x3f,0x6f,0x36,0x3a,0x9b,0xcd,0x3b,0x9c, + 0x59,0x6e,0x28,0xb1,0x52,0x2f,0x22,0x22,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/backview.png + 0x0,0x0,0x1,0xa9, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x70,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xeb,0x71,0xc3,0x20, + 0x10,0x84,0x17,0x4f,0x9a,0xf1,0x15,0xa4,0x22,0x54,0x5,0xf5,0xa8,0xa,0xaa,0x40, + 0xdd,0xe8,0xf2,0x23,0xc1,0x3,0x8,0xd0,0x1e,0x56,0xe2,0x9d,0xf1,0xd8,0x46,0x1c, + 0xfb,0xf1,0x38,0x40,0x4e,0x55,0x15,0x1f,0xd4,0x17,0x0,0xec,0xfb,0x6e,0xa,0x12, + 0xd9,0x8a,0xff,0x31,0x2e,0x53,0xe6,0x22,0x82,0x87,0x3d,0x68,0xa3,0xca,0x7a,0x7a, + 0x8a,0x0,0x0,0x42,0x8,0x0,0x60,0x3,0x48,0x46,0x79,0x8f,0xd3,0x6f,0x6,0xe2, + 0x29,0x82,0x3d,0xc6,0xa2,0x8c,0x6,0x68,0x99,0x5b,0x20,0x5a,0xe6,0x34,0xc0,0xc8, + 0x9c,0x81,0xe8,0x99,0x53,0x0,0x8c,0xf9,0x19,0x62,0xa5,0xcc,0x81,0xdf,0x2c,0x60, + 0x1a,0x1d,0x29,0x37,0xf9,0xa9,0xbf,0x50,0xe6,0x14,0x40,0x92,0x6c,0x52,0x16,0xf8, + 0x54,0xee,0xa1,0x8d,0xe7,0xea,0x1,0xe7,0x1,0x64,0xe5,0x71,0x39,0xc3,0x50,0x0, + 0xa9,0xf1,0xbc,0x81,0x62,0x6a,0xbc,0x14,0xcf,0x52,0xcf,0x63,0x15,0xdf,0xd2,0xf5, + 0x1a,0xd8,0xa4,0x49,0xde,0x53,0x3d,0xec,0x57,0xf1,0xc3,0x11,0x48,0xe4,0xf5,0x37, + 0x80,0xe6,0x14,0xb0,0xc3,0x4e,0x3,0xe4,0xd,0xd4,0x3d,0xa9,0xa7,0x40,0x3d,0x8a, + 0x61,0x3f,0x1,0xcf,0x2,0x58,0x94,0xb6,0xd9,0x97,0xfc,0x75,0xcc,0x2d,0x0,0xdd, + 0x54,0x23,0x46,0xc0,0x7c,0x18,0xb1,0x3a,0x8e,0x83,0xaa,0xf7,0x67,0x0,0x8f,0x7, + 0xd7,0xb4,0x69,0xa,0x7a,0x59,0x40,0xc7,0xcc,0x2,0xe4,0x19,0xd0,0x3b,0xf1,0x5a, + 0x5b,0x76,0x8a,0x1b,0xed,0x5,0xa6,0x8d,0x28,0x37,0x8f,0x71,0x29,0x4c,0x7b,0x60, + 0x57,0x1b,0x91,0x53,0x55,0xcd,0xaf,0x64,0x79,0x7e,0x33,0x79,0x7c,0xa5,0x9e,0x79, + 0x8,0x1,0xeb,0xba,0x8e,0xa7,0xa0,0xd7,0xf3,0x96,0x46,0x75,0x46,0x47,0x3a,0x7d, + 0x1f,0x18,0x99,0xd7,0xcf,0x2c,0x77,0xc4,0x21,0x0,0x6b,0xfe,0xe,0x44,0x17,0xc0, + 0x6a,0x3e,0xb,0x71,0x39,0x5,0x33,0x77,0x7e,0xb,0x4,0xb5,0x6,0xd2,0x67,0x16, + 0x62,0xa4,0x5b,0x4f,0x43,0xc0,0xb6,0x0,0x9b,0x0,0xb3,0xaf,0x59,0xb3,0xba,0x7d, + 0x4,0xac,0x1d,0x78,0x1,0xa4,0x77,0xb5,0xff,0x96,0x53,0x55,0x75,0xce,0x7d,0xc4, + 0x1c,0x0,0xbe,0x1,0x38,0x12,0xdc,0xda,0x44,0xd9,0x16,0x20,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/transparency.png + 0x0,0x0,0x5,0xd2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x5,0x99,0x49,0x44,0x41,0x54,0x68,0x81,0xed,0x59,0x5b,0x6e,0x24,0x3b, + 0x8,0xc5,0xd1,0x2c,0x8c,0x5a,0x59,0x57,0xaf,0xac,0xbc,0x33,0xdf,0xf,0x1b,0x73, + 0xe,0xe0,0x24,0xba,0xf,0x4d,0x74,0x35,0x48,0x51,0x57,0x57,0xdb,0xc0,0xe1,0x6d, + 0xa7,0x89,0xe8,0x90,0xff,0x1,0x7d,0xfc,0x6e,0x5,0xfe,0x2d,0xfa,0x3,0xe4,0xa7, + 0xd1,0x1f,0x20,0x3f,0x8d,0x7e,0xfd,0x93,0xcd,0x63,0x3c,0xd2,0xda,0x25,0x63,0x3c, + 0xe5,0xef,0xad,0x5d,0x7b,0x9d,0x88,0x48,0xbb,0x9a,0x48,0x57,0x5a,0xdf,0xda,0x1b, + 0x76,0xf4,0xbf,0xad,0x4b,0xfb,0x7e,0xf9,0x55,0x19,0xe3,0xb5,0x15,0x34,0x10,0xa8, + 0x28,0x31,0x6e,0xef,0xbd,0xbe,0x14,0xbc,0x40,0x21,0xdf,0xcc,0xe3,0xda,0xb2,0xbf, + 0x2,0x79,0x0,0x82,0x4a,0x4f,0x85,0x2a,0xc5,0xa6,0x35,0xa7,0x80,0xe8,0x1d,0xb6, + 0xb4,0x91,0x29,0x63,0x8a,0xe9,0xe6,0x3d,0x79,0x38,0x7f,0x7,0x1,0x1e,0x85,0x77, + 0x91,0x8a,0xd0,0x52,0xfa,0x66,0xcc,0x11,0x4c,0x25,0x4,0xc1,0xa0,0x82,0xa8,0x28, + 0xf3,0x57,0x11,0xbd,0xa5,0x35,0x97,0x83,0xeb,0xa2,0x41,0x26,0x2f,0x4,0xa4,0x12, + 0xbc,0xa4,0xc3,0xfe,0x4e,0x24,0x72,0xc3,0x9f,0xaf,0x15,0xb9,0xe9,0x33,0xed,0x51, + 0x59,0xeb,0x6f,0x5a,0x33,0xdf,0xdf,0xbc,0x76,0xf3,0xd2,0x92,0x5f,0x94,0x83,0x7a, + 0x8b,0xe8,0xf8,0x88,0x5e,0x70,0xb,0x5c,0xd2,0xda,0xbb,0x70,0xbb,0x2e,0xcb,0xbf, + 0xc3,0xfa,0xf7,0x8c,0xfb,0x4d,0x7d,0xe7,0x80,0x5b,0x7c,0x79,0xb2,0xdf,0xb4,0x97, + 0xc9,0xbd,0x19,0x65,0x6c,0x39,0xc5,0x3e,0xca,0x91,0x1c,0x8b,0xe6,0x3e,0xa5,0x4d, + 0x1e,0x6,0xbd,0xc8,0x89,0x9e,0xf8,0x20,0x70,0xcc,0x29,0x5b,0x13,0xab,0x58,0xce, + 0x4f,0xb,0xa5,0x48,0xbd,0x2,0xa2,0x7b,0x53,0x25,0x4,0x15,0x8f,0x5e,0xaa,0x94, + 0x89,0x6,0x48,0xb9,0xa2,0xf7,0xf6,0x4c,0x5a,0xa3,0xb7,0x8c,0x87,0x6b,0x50,0x36, + 0x1c,0x27,0x3e,0x34,0x44,0x43,0xa7,0xe0,0x3e,0xb6,0xc2,0x18,0xcf,0xa,0x9f,0xe, + 0xcc,0x6d,0xcf,0xb5,0xc3,0x51,0xf4,0x4e,0x7b,0x53,0xbf,0xe8,0xf7,0x5a,0x27,0xe4, + 0x1,0xe4,0x8d,0x7f,0x26,0x3f,0xf3,0x5a,0xfc,0xb9,0xfc,0x9a,0xf0,0x1e,0xc2,0x1, + 0xc1,0xea,0x16,0xce,0x55,0xc6,0xad,0x89,0xfd,0x81,0xc3,0xa2,0x27,0x39,0xfb,0x79, + 0x81,0x42,0x2f,0x31,0xc0,0x48,0x9d,0xbe,0xfd,0x8a,0x3f,0x4e,0x0,0x59,0xf9,0xa9, + 0x94,0xbf,0xa3,0x35,0x50,0x46,0x4d,0x11,0x7,0xaa,0xf4,0x3c,0xc3,0x66,0x19,0x49, + 0xbb,0x3f,0xf7,0x7b,0xca,0x32,0x2f,0x3d,0x63,0x35,0xcd,0x3b,0xf4,0x97,0xa,0xd4, + 0x31,0xd9,0xf3,0xd8,0x70,0xfe,0x4d,0x49,0x71,0xcc,0x33,0xcc,0x95,0xa8,0x4c,0xd5, + 0x8,0x29,0xf,0x17,0x8,0x36,0x4a,0xa4,0x5e,0x1,0xd1,0x24,0x34,0x87,0x85,0x86, + 0x10,0xba,0xcb,0x10,0x43,0x65,0x19,0xbc,0x87,0x6c,0x1e,0x77,0x72,0x81,0x70,0x10, + 0xde,0x64,0xd1,0x18,0x8,0x84,0xfa,0xc8,0x18,0x4f,0x50,0xcc,0xde,0xbf,0x44,0xa8, + 0xaa,0xbd,0x56,0x55,0x71,0x46,0x16,0x12,0x3b,0xe1,0x4d,0x20,0xf5,0x16,0xf0,0xc6, + 0xd5,0x76,0x78,0xf9,0x1a,0x25,0x5e,0xae,0x30,0x8f,0x32,0x11,0x4,0x0,0xe9,0x32, + 0xe3,0x3e,0xcf,0x3c,0xa6,0xdc,0xfc,0xdd,0x87,0x45,0x1b,0x19,0xbc,0xc9,0xb1,0x31, + 0x7c,0x9f,0x51,0x9f,0x39,0xb1,0x40,0x6c,0x85,0xa9,0x4,0x77,0x2e,0xbd,0xa1,0xaa, + 0x7d,0x36,0x84,0x86,0xf3,0x48,0xdf,0x88,0x4d,0x79,0x44,0xee,0xbd,0x42,0x41,0x51, + 0x15,0xcf,0xa3,0x17,0xec,0x9d,0xeb,0xbc,0x1f,0xa8,0x48,0xbf,0x57,0x62,0xeb,0x12, + 0xe7,0x20,0xc6,0x78,0x89,0x68,0x9f,0x6b,0xac,0xc4,0x87,0x3e,0x63,0xa5,0xb8,0x2, + 0x44,0x40,0x30,0x7e,0xa7,0x65,0x9f,0xa5,0x3c,0x8f,0x25,0xf3,0xf7,0x17,0x3c,0xe3, + 0x18,0xdf,0x8f,0x5e,0x99,0xca,0xde,0x12,0xf3,0x40,0x24,0x84,0x60,0xbf,0xb9,0xc1, + 0x5a,0x18,0x92,0x61,0x13,0xf,0x1b,0xbc,0x78,0x0,0xfc,0x6c,0x78,0x8b,0x3,0xa3, + 0xa8,0xec,0x3d,0xa7,0x61,0x52,0x54,0x7c,0xdd,0xfa,0xc4,0x1,0x72,0xef,0xc1,0x75, + 0x36,0xa8,0xc2,0x7a,0x7a,0xf,0x43,0x63,0x2a,0xbf,0xd5,0x58,0x52,0x59,0xf0,0x5c, + 0x12,0x5,0x62,0xbf,0xcf,0x70,0x59,0x56,0x8e,0xa3,0x87,0x4f,0x1,0x8b,0x27,0xf4, + 0xe,0xa6,0x2e,0x9e,0x8f,0x98,0xf8,0xdd,0x79,0xe5,0xf2,0xcb,0x67,0xc,0x2e,0x8f, + 0x1,0x0,0x28,0xd6,0xae,0x36,0x15,0xa9,0x4a,0x31,0x9c,0x6,0x71,0x1f,0x1e,0x7d, + 0x77,0x68,0x15,0x20,0x4c,0xbf,0x6f,0x94,0x5f,0x47,0x5d,0x4f,0xc0,0x4e,0xed,0x6a, + 0x81,0xe1,0xb5,0x3b,0x73,0xd5,0xe0,0x5a,0x7b,0x4f,0xb0,0xda,0xf9,0x37,0x28,0xb9, + 0x9,0x3c,0x78,0x9,0x41,0xf8,0xec,0x65,0x85,0xc8,0x29,0x9d,0x10,0xcf,0xcd,0x4a, + 0x72,0xb9,0x8c,0xd6,0x33,0x4b,0x7,0x8f,0x4d,0x9e,0x63,0x25,0xad,0xc8,0x18,0x63, + 0xcb,0xda,0x7c,0x49,0x3e,0xfe,0xae,0x24,0x62,0x2,0x62,0x10,0x22,0xa1,0x6a,0x59, + 0xb3,0x33,0x2b,0x44,0x6b,0xcd,0xf0,0x0,0x26,0x68,0x39,0xc,0x97,0x8,0x3a,0xc, + 0x84,0xd1,0x3,0xe3,0x19,0x45,0x48,0x89,0xcc,0x28,0xe1,0xa,0xe9,0xba,0x25,0xe2, + 0xa3,0xee,0xe9,0xd8,0x1b,0xab,0x1b,0x56,0x1f,0x3f,0xd6,0xfa,0x91,0x38,0x56,0xb1, + 0x58,0x81,0xf6,0x1e,0xac,0x60,0xbb,0x12,0x15,0x55,0xf,0xf4,0xab,0x2a,0x57,0xba, + 0xa0,0x3b,0x1d,0x5c,0xbc,0x0,0x74,0xb2,0xea,0xee,0x3b,0xcf,0x70,0xcb,0xeb,0xd, + 0x9d,0xff,0x50,0xd9,0x80,0xb6,0x2c,0xdc,0xbf,0x72,0x31,0x8e,0x4b,0x3c,0xfb,0xf5, + 0xcd,0xa3,0xbc,0xa0,0x3b,0x5f,0xa0,0x71,0xd3,0x14,0x79,0xad,0x64,0xb7,0xdf,0x3c, + 0xb4,0x7c,0x14,0xb9,0xf7,0xf7,0x49,0x30,0xf5,0x3e,0x23,0xe4,0xe1,0x52,0x72,0x87, + 0x60,0x7d,0xf9,0x57,0xdd,0x77,0x95,0x63,0xbc,0x1,0x38,0xdd,0x39,0x55,0x0,0x71, + 0x4d,0x3c,0xd2,0x7a,0xc2,0xe7,0x73,0x45,0x75,0xbc,0x3d,0x8f,0xec,0x5a,0xc8,0x98, + 0x40,0xc8,0x23,0xd5,0x5,0x42,0xdc,0xf8,0xd9,0xe0,0x56,0xaf,0x7b,0xad,0x30,0x19, + 0x69,0x8d,0x1d,0xc8,0xa6,0xf7,0xee,0xa4,0x74,0xfe,0x8e,0x7,0xba,0x4e,0x72,0x9, + 0x88,0x2b,0xcd,0x8a,0xc5,0x4b,0xba,0xf8,0x8c,0x7b,0xb9,0x9,0xde,0x3b,0x7f,0xc8, + 0x82,0xd0,0xed,0x69,0x1a,0x16,0x2c,0xb9,0xa6,0xa8,0x4a,0xce,0x8f,0x4c,0xd4,0xd9, + 0x4f,0x63,0xc7,0x77,0x42,0xac,0xba,0x17,0x4e,0xa7,0x4a,0xea,0x33,0x1d,0xb8,0xb8, + 0x82,0x5f,0xe9,0x90,0x87,0xd1,0xd,0x1a,0x6f,0xec,0x72,0xf9,0xb3,0x77,0xe5,0xb0, + 0x18,0x6e,0x10,0x73,0xc9,0xbe,0xe9,0x19,0x4b,0x70,0xdc,0x87,0xef,0x72,0xa9,0xd5, + 0xc0,0x47,0xd3,0xdf,0x7,0xba,0x8d,0x43,0xe8,0x2,0x4b,0xdb,0x75,0x4f,0x1d,0x4a, + 0xf1,0xda,0x6,0xcf,0xd,0xfe,0xbe,0xbb,0x17,0xa0,0xf9,0xed,0x43,0x1a,0xdd,0x63, + 0x29,0x84,0x18,0x7e,0x37,0xd9,0x8f,0xc4,0x30,0xfb,0x70,0x17,0xf7,0xbd,0x9,0x3f, + 0x73,0x1d,0xf7,0x83,0x57,0x15,0x6,0x9c,0x43,0x79,0x52,0x40,0x23,0x90,0x9c,0x95, + 0x27,0x5c,0x70,0xce,0x39,0x19,0xf5,0x4d,0xd,0x31,0x2a,0x93,0x3f,0x9d,0x1,0x2b, + 0x2a,0x7b,0x8d,0xc7,0xf3,0x53,0xae,0x29,0xa9,0xe3,0x74,0x8b,0x63,0x3b,0xe7,0x47, + 0xe6,0xd5,0x45,0x44,0xd,0x88,0x4a,0x74,0x55,0x65,0x81,0xfc,0xff,0x9,0x3d,0x7a, + 0x64,0x3e,0xe3,0x2d,0x4c,0x2e,0xe5,0xbc,0x57,0xc9,0xfb,0x66,0x88,0x78,0xf6,0x38, + 0xf5,0x18,0xba,0x7c,0x40,0x61,0xfe,0xdc,0x41,0x21,0x4d,0xfd,0xa5,0xf6,0x96,0xed, + 0x67,0x45,0x62,0x13,0x8b,0x0,0xa3,0x72,0xd5,0xfa,0x93,0x77,0xc3,0xf4,0xfb,0xe, + 0x16,0xb5,0x84,0x53,0x78,0x77,0xed,0xf8,0x8f,0x97,0xe,0xe9,0xec,0x52,0x34,0xd8, + 0x49,0xb9,0xb0,0xc4,0xb0,0xc1,0xd2,0x8d,0xc9,0x7d,0xfa,0xaf,0x55,0xb8,0x7c,0xe0, + 0x3,0x53,0x45,0x38,0x17,0xd9,0x33,0xc6,0x6f,0x7d,0x75,0xa3,0x29,0xc6,0x99,0xbf, + 0x29,0x19,0x3d,0xc0,0x9,0xef,0xa0,0x32,0xa5,0x86,0xc8,0xc,0x19,0xa0,0x85,0xc8, + 0x89,0x59,0x29,0xa0,0x98,0xb1,0x30,0x79,0xb9,0x39,0x6a,0x0,0xaa,0xa4,0xc3,0x67, + 0xd,0x91,0x8e,0xba,0xa7,0x6a,0x85,0x6b,0x22,0x88,0xd8,0x5f,0xf0,0x5d,0x7d,0x7, + 0xc5,0x45,0x3,0xaf,0x9e,0xc,0x28,0x5e,0x32,0xf0,0xfe,0x1e,0x40,0xf8,0xbb,0x74, + 0x1b,0x6f,0xc7,0xc8,0xac,0x70,0x9d,0x3,0x71,0xc,0xc1,0xeb,0xd5,0xbc,0xdf,0x28, + 0x8e,0x43,0x66,0x20,0xfb,0xb4,0xe3,0x81,0xdd,0x23,0x7c,0x1d,0xf2,0x34,0xc6,0x7f, + 0x46,0x5f,0x85,0xd3,0xe9,0x3f,0x5d,0x6,0xa2,0xba,0x86,0x3d,0xad,0xb7,0x3d,0xb1, + 0xba,0x7d,0x2a,0xff,0xbb,0x40,0x26,0xe9,0xfa,0x9c,0x2,0xbe,0x3e,0x4d,0xa2,0x62, + 0x11,0x1c,0xf,0x97,0x55,0x8f,0xfa,0xf,0x81,0xfc,0x5c,0xfa,0xb,0x56,0xab,0x7c, + 0xbd,0xff,0x56,0x79,0xbc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/mccad/Desktop/images/cut.png + 0x0,0x0,0x0,0xe9, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x39,0x31,0x5d,0x55,0x97,0xef,0x0,0x0,0x0,0x76,0x49,0x44, + 0x41,0x54,0x78,0xda,0xcd,0xd4,0xc1,0xe,0x80,0x20,0x8,0x6,0x60,0xe0,0xc1,0x3d, + 0xf8,0xe2,0x7f,0x37,0x2b,0x47,0x13,0x2,0x4a,0x2e,0x4e,0xa7,0xdf,0x0,0x9d,0x44, + 0x3f,0x5,0x9c,0xeb,0x23,0xa4,0x2a,0xa3,0xad,0x60,0x64,0xc1,0x1a,0xc4,0x51,0x98, + 0xab,0x5b,0x1,0x4f,0x1b,0x3c,0x19,0xc1,0x7b,0x46,0x68,0x83,0x40,0x41,0x8f,0x3b, + 0xee,0x63,0xa,0x3c,0x30,0x3e,0xe7,0x1d,0xc1,0xea,0xe7,0x4c,0xaf,0xe0,0x6b,0x5c, + 0x43,0x66,0xcc,0x8d,0x3f,0x1,0x1a,0xa4,0xe3,0xa2,0x6f,0x6c,0xfc,0xf1,0x27,0xd4, + 0xd8,0x5a,0xbe,0xc4,0x2f,0xd7,0x5c,0x9d,0xe5,0x82,0xd6,0x4f,0x8e,0xd7,0x78,0xbc, + 0xdf,0xa9,0x71,0x0,0xfb,0xf7,0x2f,0xac,0x14,0x2c,0x74,0x27,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/magic.png + 0x0,0x0,0x3,0xf7, + 0xff, + 0xd8,0xff,0xe0,0x0,0x10,0x4a,0x46,0x49,0x46,0x0,0x1,0x1,0x0,0x0,0x1,0x0, + 0x1,0x0,0x0,0xff,0xdb,0x0,0x43,0x0,0x9,0x6,0x7,0x8,0x7,0x6,0x9,0x8, + 0x7,0x8,0xa,0xa,0x9,0xb,0xd,0x16,0xf,0xd,0xc,0xc,0xd,0x1b,0x14,0x15, + 0x10,0x16,0x20,0x1d,0x22,0x22,0x20,0x1d,0x1f,0x1f,0x24,0x28,0x34,0x2c,0x24,0x26, + 0x31,0x27,0x1f,0x1f,0x2d,0x3d,0x2d,0x31,0x35,0x37,0x3a,0x3a,0x3a,0x23,0x2b,0x3f, + 0x44,0x3f,0x38,0x43,0x34,0x39,0x3a,0x37,0xff,0xdb,0x0,0x43,0x1,0xa,0xa,0xa, + 0xd,0xc,0xd,0x1a,0xf,0xf,0x1a,0x37,0x25,0x1f,0x25,0x37,0x37,0x37,0x37,0x37, + 0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37, + 0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37, + 0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0xff,0xc0,0x0, + 0x11,0x8,0x0,0x2d,0x0,0x2d,0x3,0x1,0x22,0x0,0x2,0x11,0x1,0x3,0x11,0x1, + 0xff,0xc4,0x0,0x19,0x0,0x1,0x1,0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x7,0x6,0x4,0x3,0x1,0x2,0xff,0xc4,0x0,0x37,0x10, + 0x0,0x2,0x1,0x2,0x4,0x4,0x3,0x3,0xa,0x7,0x0,0x0,0x0,0x0,0x0,0x0, + 0x1,0x2,0x3,0x4,0x11,0x0,0x5,0x12,0x21,0x6,0x13,0x31,0x41,0x14,0x22,0x23, + 0x32,0x61,0x71,0x42,0x51,0x62,0x81,0x82,0x83,0x91,0xa2,0xa3,0xc1,0x93,0xb2,0xb3, + 0xc2,0xd1,0xd2,0xe1,0xff,0xc4,0x0,0x1a,0x1,0x0,0x2,0x3,0x1,0x1,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x4,0x1,0x3,0x5,0x0,0x6, + 0xff,0xc4,0x0,0x23,0x11,0x0,0x2,0x2,0x2,0x2,0x2,0x1,0x5,0x0,0x0,0x0, + 0x0,0x0,0x0,0x0,0x0,0x1,0x2,0x0,0x11,0x3,0x4,0x5,0x31,0x12,0x21,0x13, + 0x22,0x41,0x61,0x81,0xc1,0xff,0xda,0x0,0xc,0x3,0x1,0x0,0x2,0x11,0x3,0x11, + 0x0,0x3f,0x0,0x8e,0xcb,0x25,0xa0,0xa2,0xc8,0xc,0x54,0x2f,0xc,0x59,0x8f,0x91, + 0xd9,0x6a,0x29,0x23,0x98,0xcd,0x75,0x4,0x9d,0x4c,0x8,0x50,0x2f,0x60,0x5,0xba, + 0x6f,0x7b,0xe2,0x83,0x86,0xb2,0xfc,0xcb,0x37,0x6d,0x53,0x9a,0x44,0x8c,0x7b,0x4c, + 0xb9,0x75,0x38,0xb7,0xe9,0xe2,0x6f,0x22,0xa1,0xf1,0x52,0x6,0xb0,0xd9,0x23,0x1f, + 0xa6,0xb8,0x54,0xe1,0xf8,0x9a,0x92,0x6,0x82,0x54,0x29,0x20,0xdc,0x83,0xd7,0xb6, + 0x21,0xfc,0xbc,0x6c,0x4f,0x3f,0xb7,0xba,0xe9,0x98,0xe3,0x56,0xfb,0xc9,0xcc,0xc3, + 0x2a,0xa9,0xa6,0xac,0x92,0x28,0x8d,0x39,0x88,0x1b,0xa9,0x34,0x14,0xc4,0xdb,0xdf, + 0xe9,0xe3,0xa6,0x5b,0x93,0x3d,0x52,0xd4,0x9a,0x8a,0xaa,0x48,0x79,0x49,0xa9,0x6f, + 0x97,0xd3,0x79,0x8f,0xf0,0xf1,0x6e,0xd4,0x6,0xa9,0x8b,0x18,0xfe,0x41,0xb1,0xb6, + 0xfd,0x3f,0xe6,0x31,0x66,0x39,0x4b,0xa4,0x4b,0x12,0xdf,0x48,0xb3,0x30,0xb7,0x7b, + 0x62,0xcc,0x62,0xd4,0x5f,0x71,0x1c,0x9b,0x3b,0xab,0x6c,0x18,0xf8,0xc2,0xba,0xfa, + 0x9c,0xda,0x9c,0x39,0x45,0xa1,0x2a,0xa4,0x8b,0x9c,0xba,0x9f,0x7f,0xc9,0x89,0x8c, + 0xf4,0xd3,0xd7,0x72,0x6b,0x3c,0x2a,0xd3,0xd4,0xbe,0xa4,0x9c,0x43,0x65,0x8d,0xd9, + 0x40,0xf3,0x5,0xb5,0x96,0xe0,0xee,0x6,0xd7,0xc2,0xe6,0x67,0x51,0x4d,0x14,0x3c, + 0xa3,0x2,0xec,0x6c,0xc2,0xc3,0x4b,0x6d,0xdf,0xbe,0xa,0x78,0x81,0x51,0x65,0x22, + 0x14,0xb4,0x7c,0xf7,0xd2,0x2e,0x4d,0x86,0x94,0xc0,0x10,0x47,0x62,0x6b,0x71,0x9b, + 0xaf,0x9d,0x8a,0xb1,0xbf,0x52,0x9f,0x84,0x40,0xb0,0x2f,0x70,0x2c,0x97,0xb7,0x5f, + 0x61,0x70,0xaf,0xc3,0xc2,0x39,0xc0,0x13,0x32,0xc8,0x7e,0x96,0xe7,0xf1,0xc1,0x17, + 0xc,0xcd,0xa1,0x77,0xd8,0xe9,0x4f,0xe9,0xae,0x11,0xb2,0x9c,0xc6,0x18,0xc4,0x7a, + 0xc1,0x66,0x1b,0x4,0x53,0xd7,0xe2,0x71,0x70,0xf6,0xb5,0x32,0x76,0x9c,0x63,0xde, + 0x66,0x6e,0xae,0x20,0x45,0x12,0x2a,0xd9,0x14,0x5b,0x19,0x73,0x38,0x79,0xb0,0x3a, + 0xa8,0x1b,0x8d,0xcd,0xed,0x8e,0x34,0x79,0xa4,0x6f,0xca,0x52,0x57,0xd4,0x22,0xc0, + 0x6c,0x0,0x27,0x6f,0xdf,0x19,0x33,0x29,0xbc,0x5a,0x4d,0x14,0x4,0x89,0x63,0xbf, + 0x4f,0xdf,0x0,0x14,0xdc,0xd7,0xcd,0xb1,0x84,0xe0,0xa5,0xf7,0xf8,0x90,0xdc,0x41, + 0x6,0x82,0xcb,0xb7,0xc1,0x46,0xb,0xb8,0x8d,0xa,0x4c,0x14,0x82,0x3d,0x56,0xfe, + 0x54,0xc2,0xf4,0x73,0x52,0xc7,0x1b,0xcf,0x5a,0x40,0x22,0xcb,0x69,0x5a,0xe0,0x9d, + 0xf7,0x1f,0x86,0xb,0x78,0xd6,0xa1,0x2a,0xf3,0x59,0x66,0x88,0xe,0x5b,0x4c,0xda, + 0x6c,0x3b,0x4,0x40,0x31,0xe,0xf6,0xd5,0x5d,0x44,0x78,0x41,0x59,0x49,0x1d,0x11, + 0xfd,0x13,0x5f,0xf,0x52,0x55,0xd4,0xcb,0x78,0x62,0x7e,0x42,0xa2,0x19,0x26,0xb7, + 0x91,0x0,0x8d,0x49,0xb9,0xe9,0xd3,0x17,0x19,0x4d,0x34,0x35,0x34,0xfc,0xc8,0x67, + 0x6,0xd7,0x4,0x8e,0xbf,0x58,0xed,0x82,0x7c,0xbf,0x88,0xb3,0xa,0x3c,0xb6,0x7c, + 0xba,0x39,0x9b,0xc3,0xcd,0x61,0x22,0xed,0xe6,0x0,0x6d,0xd4,0x1b,0x1e,0xd7,0x18, + 0xf6,0xc,0xee,0xa6,0x9f,0x52,0x42,0xf2,0xaa,0x9d,0x88,0xd4,0xbb,0xfe,0x5c,0x71, + 0x26,0xbe,0x98,0xde,0xdf,0x1a,0xf9,0xf2,0x16,0xf5,0x16,0xe3,0xcd,0xd9,0x25,0xd1, + 0xad,0x9,0x59,0x3,0x6a,0x52,0xf,0x41,0xd0,0x1f,0x9b,0x1e,0x3e,0x78,0x63,0xcd, + 0xcb,0xf3,0xb4,0x24,0x92,0x5d,0xec,0x76,0xb1,0xdf,0x7c,0x13,0xb7,0x10,0x55,0x96, + 0xd5,0xa9,0x81,0xbd,0xb6,0xd2,0x3f,0xb7,0x1f,0x32,0xe7,0x55,0x12,0xb7,0xa8,0xd2, + 0x1f,0xb4,0xbf,0xeb,0x83,0xf9,0x22,0x63,0x85,0xcd,0xd1,0x61,0x5f,0xb8,0xd3,0xc6, + 0xf9,0x86,0x4c,0x78,0x6e,0x66,0x2f,0x7,0x35,0x93,0xc8,0x14,0x8b,0xea,0xf7,0x1, + 0x81,0x1a,0x89,0xc,0xb4,0x50,0xb1,0x37,0xf5,0xa4,0xef,0xee,0x4c,0x72,0xa8,0xac, + 0x59,0x54,0xf3,0x16,0x56,0xfb,0xc1,0xfe,0x31,0x8a,0x79,0xcc,0x9a,0x52,0x20,0x63, + 0x89,0x7,0x95,0x41,0xbf,0x5e,0xa4,0x9e,0xe7,0x0,0xc6,0xe6,0xbe,0x96,0xa1,0xd7, + 0xb2,0xc6,0xc9,0x9f,0xff,0xd9, + // /home/mccad/Desktop/images/color.png + 0x0,0x0,0x0,0xe3, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x98,0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x92,0xc1,0x11, + 0xc3,0x20,0xc,0x4,0xd7,0x19,0xca,0x48,0x1,0xe9,0x2,0x95,0xe1,0x72,0x54,0x8c, + 0x1f,0x29,0x3,0xba,0x48,0x9,0xe9,0x42,0x79,0x8,0xfc,0xf0,0x80,0x4c,0x1,0xb9, + 0x8f,0x86,0x11,0x3a,0x96,0x1b,0xc1,0x5f,0x1b,0x60,0x41,0xef,0x56,0x9,0xc0,0x4a, + 0xf1,0x93,0xc8,0xfa,0x64,0xd3,0x23,0xe8,0xd9,0x8a,0x41,0x2,0xe0,0xf9,0xf5,0x93, + 0x2,0xaf,0x1d,0xfb,0xbc,0x9d,0x44,0xb1,0x3b,0x20,0x37,0x38,0xf6,0xe8,0x4e,0x27, + 0x19,0x1a,0x6d,0x80,0x99,0x79,0x6,0xb5,0xa,0x39,0x43,0xad,0xde,0xec,0xd1,0xa8, + 0xce,0xd,0x52,0x1f,0x5c,0xd0,0x90,0xc4,0xbf,0x90,0xfd,0x29,0x99,0x19,0xe9,0xa5, + 0x5e,0xd,0x64,0x8d,0x60,0x1e,0x62,0x69,0x74,0x22,0x15,0xc8,0x40,0xb,0x81,0x2, + 0x48,0xab,0x63,0x84,0x68,0xf,0x96,0x14,0xad,0x72,0x34,0x73,0xea,0x7,0xd0,0x54, + 0x25,0xa6,0xae,0x89,0xbd,0x26,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42, + 0x60,0x82, + // /home/mccad/Desktop/images/szoom.png + 0x0,0x0,0x1,0xb2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x79,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xdb,0x99,0x83,0x20, + 0x10,0x85,0xf,0xfb,0xa5,0x86,0xf4,0xc0,0x34,0xb1,0xda,0x44,0x8a,0x48,0x15,0x6e, + 0x13,0x29,0xc2,0x26,0x64,0x9b,0xc0,0x1e,0xd2,0x4,0xfb,0xc0,0x8e,0x72,0xf1,0x2, + 0xa8,0xe1,0xbc,0x24,0x19,0x34,0xf3,0x3b,0x37,0x44,0x18,0x63,0xc,0x2a,0xea,0x6, + 0x0,0x42,0xfc,0x7c,0xdc,0xb1,0xd6,0xf,0x10,0x91,0x5,0x60,0x43,0xae,0xa4,0x94, + 0x18,0xc7,0x31,0xfb,0x3e,0xa2,0x1e,0x4a,0x29,0x0,0x98,0x1,0xce,0x16,0xf5,0x34, + 0x7d,0xd7,0xf,0xbd,0x7a,0xdd,0xd7,0x55,0x0,0xa9,0xda,0x8d,0x0,0xd1,0x33,0xb2, + 0x69,0xfd,0xba,0x1e,0x60,0x76,0xdc,0xad,0xae,0x19,0x33,0xf8,0x76,0x27,0xec,0x6b, + 0xf6,0x30,0x1d,0x11,0x40,0xe8,0xd8,0x98,0xef,0xe8,0xf,0x85,0xe8,0xfe,0x3f,0x7f, + 0x1,0x74,0x87,0x22,0xe2,0x1,0x58,0xe7,0xeb,0x8e,0x59,0xbc,0xc6,0x0,0x44,0xcf, + 0x62,0x88,0x20,0x2,0xfb,0xce,0x43,0x10,0xb,0x61,0xe5,0x86,0x37,0xbb,0xb,0xe6, + 0xbc,0xa6,0x39,0x77,0x21,0x38,0xa,0x25,0xaa,0xde,0x86,0xe,0x40,0x97,0xfd,0xf4, + 0xac,0x23,0x51,0xb8,0x6c,0x12,0x6e,0xe5,0xdd,0x55,0xf5,0x14,0x9c,0x1e,0x1,0x29, + 0x65,0x5d,0x80,0xdc,0xdd,0xd1,0x2b,0x42,0xb7,0xa7,0x73,0x74,0x64,0x22,0x56,0xaf, + 0x81,0x9,0x80,0xe9,0x73,0xa3,0xc0,0x4f,0xaf,0xd4,0xb0,0x7b,0xed,0x26,0x80,0x55, + 0x97,0x5,0xe1,0x5e,0xd7,0x34,0x2d,0xde,0xef,0xbc,0x2,0x4,0x82,0x22,0xd4,0xfa, + 0x35,0xd,0x13,0xde,0xf1,0x96,0x77,0x43,0x76,0xdc,0x79,0xf6,0xa6,0x69,0xa1,0xd4, + 0x80,0xfb,0x3d,0xbd,0x10,0xa3,0x2e,0xe0,0x54,0x84,0x20,0xbe,0xd8,0xc6,0x61,0x6f, + 0x8b,0x21,0x56,0xdb,0x30,0x4,0x59,0x5a,0x93,0xd2,0xb6,0x1d,0xd1,0x50,0xc,0xb1, + 0x3b,0x7,0x52,0x5a,0x4b,0xeb,0x72,0x88,0xf8,0x8d,0x68,0xe5,0xb5,0xca,0x73,0xb8, + 0x30,0xe7,0x4b,0x21,0x4e,0x9d,0x3,0x5a,0x8f,0x98,0xeb,0x62,0x86,0xd8,0xea,0x8e, + 0xd3,0x7,0x51,0x2e,0x44,0xdc,0x5,0x89,0xdb,0xe8,0x1e,0x44,0x6a,0x3a,0x26,0x0, + 0xa2,0xfe,0xb0,0xe3,0x58,0x8d,0xff,0xab,0x89,0xcf,0xa0,0x37,0xc0,0x9e,0xb,0xf9, + 0xac,0xf6,0x69,0x9,0x63,0x8c,0x11,0x42,0x54,0x71,0xe,0x0,0x7f,0x65,0x15,0xb3, + 0x26,0xe4,0x84,0x54,0x8c,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/mccad/Desktop/images/selected2ghost.png + 0x0,0x0,0x1,0xc1, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a, + 0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0xa,0x7,0xb,0xb, + 0x3,0x58,0x2a,0xa0,0xcf,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d, + 0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74, + 0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x2e,0x49,0x44, + 0x41,0x54,0x48,0xc7,0xed,0x95,0xb1,0x6a,0x83,0x50,0x14,0x86,0x3f,0x8d,0x4d,0xa, + 0x1d,0x7c,0x80,0xc,0x5d,0x5c,0xdc,0xb3,0x85,0x70,0x3,0xe6,0x2d,0x42,0xa7,0x3e, + 0x44,0x1e,0x21,0x4f,0xd1,0xa9,0x43,0xdf,0x20,0x53,0x16,0x37,0x4b,0x96,0x4c,0x4a, + 0x16,0xa1,0x82,0x6b,0x40,0x87,0xa2,0xa0,0xde,0x2e,0x89,0x56,0x5a,0xc3,0xd,0x45, + 0xba,0xe4,0x2c,0xf7,0x72,0x39,0xe7,0xff,0xce,0xb9,0xf7,0x5c,0x8e,0x96,0x65,0x99, + 0xa4,0x27,0x8b,0xa2,0x8,0x3,0x20,0xc,0xc3,0x5e,0x0,0x8e,0xe3,0xa0,0xd3,0xb3, + 0xdd,0x0,0xff,0xf,0x30,0xce,0x9b,0xfb,0xd5,0x8a,0xaa,0x2c,0x3b,0x1d,0x9f,0x76, + 0x3b,0x5e,0x5c,0x17,0x0,0x73,0xbb,0xbd,0x28,0x5a,0x8c,0xc7,0x94,0x96,0xd5,0x0, + 0x9e,0xe7,0x73,0xaa,0xa2,0xe8,0xc,0x78,0x9b,0x4e,0x6b,0xb8,0x1e,0xc7,0xe4,0x42, + 0x30,0x72,0xdd,0x7a,0xad,0x4c,0x13,0x3d,0x49,0x0,0xea,0x33,0x23,0x8e,0x1b,0xc0, + 0xeb,0x64,0xd2,0x29,0xbe,0xf4,0xbc,0x56,0x65,0xf,0x87,0x3,0x7a,0x10,0x0,0x30, + 0x3a,0x55,0x74,0x16,0xff,0x7e,0x96,0xb,0x1,0xeb,0xf5,0xf5,0x6f,0x20,0x7,0x3, + 0x25,0xbf,0x1a,0xae,0x2a,0xfc,0x68,0x9a,0x4,0x41,0x80,0xd4,0x2f,0x87,0xe4,0x42, + 0xb4,0x56,0x65,0xc0,0x47,0x92,0x60,0xdb,0x36,0x72,0x38,0x54,0xca,0xfc,0xea,0xa, + 0x9a,0xc6,0xee,0xa9,0x82,0xf7,0xe3,0x11,0x0,0x4d,0xd3,0xd4,0xee,0xde,0xf3,0xd4, + 0x1,0xd6,0x66,0x83,0xef,0xfb,0x4a,0x89,0xe4,0x42,0x20,0x81,0xcf,0xd9,0xac,0x69, + 0xd3,0xe5,0x89,0xf6,0x9b,0xf9,0x69,0xda,0x16,0xd7,0xb4,0x1f,0xff,0x20,0x17,0x82, + 0xbb,0xfd,0xbe,0x6e,0xd7,0x74,0xb1,0x68,0xdc,0xb3,0x2c,0x93,0xb7,0x79,0x70,0x3, + 0xfc,0x6d,0x1e,0x44,0x51,0x84,0xe3,0x38,0xbd,0x1,0xbe,0x0,0xb,0x5e,0x7e,0x2c, + 0xd3,0x3a,0xee,0xaa,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + + // /home/mccad/Desktop/images/save.png + 0x0,0x0,0x2,0x2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x1,0x94,0x49,0x44,0x41,0x54,0x48,0xc7,0x63, + 0xf8,0xff,0xff,0x3f,0x3,0x8,0x3,0x1,0x13,0x10,0xb3,0x2,0x31,0x7,0x10,0x73, + 0x3,0x31,0xf,0x10,0xf3,0x12,0x89,0x79,0xa0,0x7a,0x38,0xa0,0x66,0x30,0xc1,0xd, + 0xf5,0xf5,0xf5,0x8d,0x12,0x15,0x15,0xfd,0x0,0x64,0xff,0x27,0x7,0x73,0x70,0x70, + 0x7c,0x4,0xd2,0xe9,0x40,0x2c,0x8,0xc4,0xec,0x30,0x83,0x59,0x7d,0x7c,0x7c,0x8e, + 0xd4,0xcd,0xb6,0xfb,0xdf,0xb9,0x49,0xeb,0x3f,0xa9,0xa0,0x75,0xbd,0xe2,0xff,0xb8, + 0x66,0xb0,0x5,0xe7,0x80,0x58,0xd,0x6c,0x38,0xd4,0x60,0xe,0x27,0x27,0x27,0xb0, + 0xa1,0x56,0x1,0x2c,0x60,0xc5,0x15,0x15,0x15,0x38,0x31,0xb2,0x3c,0x98,0xbd,0x82, + 0xe1,0x7f,0xc6,0x4,0xb8,0xeb,0xad,0x80,0x58,0x1a,0x66,0x30,0xb7,0xb5,0xb5,0xf5, + 0xff,0xb6,0xd,0xca,0xff,0x2d,0xfd,0x19,0x48,0x76,0x31,0xc8,0xe0,0xb4,0x3e,0xb8, + 0xc1,0xee,0x40,0xac,0x4,0x33,0x98,0x7,0x66,0x30,0x48,0x11,0x39,0x2e,0x46,0x32, + 0xd8,0x1b,0x88,0x55,0x61,0x6,0xf3,0xa2,0x1b,0x4c,0x81,0x8b,0x7d,0xc1,0xe1,0x8c, + 0xcb,0x60,0x5c,0x2e,0x24,0xc2,0xc5,0xf8,0xd,0xa6,0x99,0x8b,0x69,0x62,0x30,0x39, + 0x98,0x28,0x83,0x75,0xcc,0x85,0x89,0xce,0x71,0x72,0x5a,0x24,0x18,0xc,0x52,0x60, + 0x60,0x25,0xf5,0x5f,0x41,0x97,0x1,0x3,0xe7,0xe4,0xe4,0xfc,0x6f,0x6d,0x6d,0xfd, + 0xbf,0x6c,0xd9,0xb2,0xff,0xb2,0x5a,0x10,0xb5,0x24,0x19,0x8c,0xcd,0x50,0x10,0x2e, + 0x2e,0x2e,0xfe,0xbf,0x60,0xc1,0x82,0xff,0x9b,0x36,0x6d,0x2,0xf3,0xa9,0x66,0x70, + 0x51,0x51,0xd1,0xff,0x15,0x2b,0x56,0xfc,0xdf,0xbe,0x7d,0x3b,0x75,0xd,0x6,0x5, + 0xc3,0xaa,0x55,0xab,0xfe,0xef,0xd8,0xb1,0x83,0x28,0x83,0x79,0x4c,0x4c,0x4c,0xc0, + 0xa5,0x14,0x21,0x83,0x41,0x61,0xb,0xa,0x86,0x5d,0xbb,0x76,0xc1,0xd,0x2e,0x5d, + 0xc2,0xf0,0x3f,0xa9,0x3,0x7b,0x96,0xe6,0x96,0x95,0x95,0x3d,0x1,0x2a,0xfa,0x60, + 0xa5,0x94,0x8c,0x1a,0x71,0x18,0xa4,0x16,0x64,0xa8,0x53,0x34,0x98,0x7d,0x3,0xbd, + 0x10,0xe2,0x80,0x16,0xd2,0xe7,0xc8,0x2d,0xe8,0xa1,0x86,0xf6,0xa0,0x17,0x9b,0xac, + 0xd0,0x92,0x5f,0xd,0x2a,0xe1,0xe,0xf5,0x92,0x2f,0x91,0xd8,0x1b,0xaa,0xc7,0xa, + 0xbd,0xa0,0x67,0x2,0x57,0x27,0x10,0xc3,0xa5,0xc1,0x5e,0x1,0x85,0x13,0x44,0x11, + 0x31,0x58,0x15,0xaa,0x47,0x1a,0xa5,0x6a,0xa2,0x45,0x65,0xa,0x0,0x58,0xc4,0x17, + 0xe0,0xd,0x6c,0x62,0x9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/mccad/Desktop/images/splash.png + 0x0,0x0,0xa8,0x8c, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x2,0x58,0x0,0x0,0x0,0xf0,0x8,0x6,0x0,0x0,0x0,0xdc,0xb6,0x1a,0x76, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1, + 0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdb,0xc,0x15, + 0xa,0x36,0x25,0xd9,0x95,0xcc,0x4,0x0,0x0,0x20,0x0,0x49,0x44,0x41,0x54,0x78, + 0xda,0xec,0x9d,0x77,0x7c,0x14,0xc5,0xfb,0xc7,0xdf,0xb3,0x57,0x52,0x21,0x9,0xc5, + 0x10,0x7a,0x2f,0x22,0x55,0x10,0x14,0x8,0x6,0x69,0x2,0x8a,0xa,0x88,0x1d,0xb, + 0x45,0x10,0x1,0x41,0x6c,0x28,0xfa,0x5,0x7e,0x28,0x20,0x2a,0x8a,0x80,0x48,0x55, + 0x44,0x51,0x29,0xd2,0x44,0x54,0x40,0x4,0x94,0x2e,0x35,0xa0,0xf4,0x16,0x6a,0x80, + 0xf4,0xe4,0xee,0x76,0x7e,0x7f,0xdc,0xed,0xe5,0x2,0x1,0x2e,0xe1,0x12,0x52,0xe6, + 0xed,0x2b,0x12,0x8e,0xdb,0xd9,0xdd,0xd9,0xd9,0x99,0xcf,0x3c,0xf3,0xcc,0xf3,0x8, + 0x29,0xa5,0x44,0x51,0xe8,0x91,0x52,0x22,0x84,0x50,0x15,0xa1,0x50,0x28,0x14,0xa, + 0x85,0xf,0xd0,0x54,0x15,0x28,0x61,0xa5,0xeb,0xba,0x12,0x57,0xa,0x85,0x42,0xa1, + 0x50,0x28,0x81,0xa5,0xf0,0x15,0xba,0xae,0xe3,0x70,0x38,0x54,0x45,0x28,0x14,0xa, + 0x85,0x42,0xa1,0x4,0x96,0xc2,0x57,0x38,0x1c,0xe,0x6c,0x36,0x9b,0xaa,0x8,0x85, + 0x42,0xa1,0x50,0x28,0x94,0xc0,0x52,0x78,0x62,0xb8,0xd1,0x65,0xc7,0x9d,0xce,0xe1, + 0x70,0x90,0x96,0x96,0xa6,0x2a,0x51,0xa1,0x50,0x28,0x14,0x8a,0xfc,0x2c,0xb0,0x94, + 0x4f,0xbd,0xef,0x11,0x42,0x64,0xdb,0x49,0x3d,0x2d,0x2d,0x8d,0xc4,0xc4,0x44,0x55, + 0x89,0xa,0x85,0x42,0xa1,0x50,0xe4,0x47,0x81,0xe5,0x70,0x38,0x70,0x38,0x1c,0xd9, + 0x12,0x1,0x37,0x63,0xa1,0x29,0x2c,0xa4,0xa6,0xa6,0x66,0xeb,0x38,0x9b,0xcd,0x46, + 0x52,0x52,0x92,0xaa,0x40,0x85,0x42,0xa1,0x50,0x28,0xf2,0xa3,0xc0,0xba,0x78,0xf1, + 0x22,0x76,0xbb,0x3d,0x5b,0xc7,0xc6,0xc5,0xc5,0x61,0xb7,0xdb,0xd5,0x4e,0xb7,0xeb, + 0x90,0x5d,0x91,0x94,0x90,0x90,0xc0,0xd9,0xb3,0x67,0x55,0x5,0x2a,0x14,0xa,0x85, + 0x42,0x91,0xd7,0x4,0x96,0x37,0x16,0xa6,0xe4,0xe4,0xe4,0x6c,0xef,0x56,0x4b,0x4e, + 0x4e,0x56,0x56,0x16,0x2f,0x44,0x68,0x76,0xeb,0x36,0x36,0x36,0x56,0x55,0xa0,0x42, + 0xa1,0x50,0x28,0x14,0x79,0x49,0x60,0x19,0xbe,0x3f,0x29,0x29,0x29,0x6e,0x5f,0xa0, + 0xcc,0xb8,0x78,0xf1,0x62,0xb6,0x77,0xab,0x5d,0xba,0x74,0x89,0xcb,0x97,0x2f,0xab, + 0xa7,0x75,0x83,0x3a,0xca,0xe,0xba,0xae,0x67,0xdb,0xb2,0xa8,0x50,0x28,0x14,0xa, + 0x85,0x22,0x87,0x4,0x96,0xb1,0x6c,0x97,0x92,0x92,0xc2,0xd9,0xb3,0x67,0xaf,0x69, + 0xa5,0x32,0x7c,0xb0,0xb2,0x83,0xcd,0x66,0x53,0xb1,0x9a,0x6e,0xc0,0xd1,0xa3,0x47, + 0xb3,0x75,0x5c,0x52,0x52,0x12,0x17,0x2f,0x5e,0x54,0x15,0xa8,0x50,0x28,0x14,0xa, + 0x45,0x5e,0x12,0x58,0x86,0xc5,0x2a,0x34,0x34,0x14,0x93,0xc9,0xc4,0xae,0x5d,0xbb, + 0xd0,0x75,0xfd,0x2a,0x4b,0xd6,0xcd,0x2c,0x11,0x26,0x24,0x24,0x90,0x9c,0x9c,0xac, + 0x9e,0xd6,0x75,0xd8,0xb3,0x67,0x4f,0xb6,0x8e,0xb3,0xdb,0xed,0x3e,0xaf,0x5b,0xcf, + 0x67,0xaf,0x36,0x26,0x28,0x14,0xa,0x85,0x42,0x9,0xac,0x6c,0xe0,0xb9,0x2c,0x58, + 0xac,0x58,0x31,0xfc,0xfd,0xfd,0xf9,0xfd,0xf7,0xdf,0xdd,0x9f,0x1b,0xff,0x96,0x96, + 0x96,0x86,0xae,0xeb,0xd9,0x3a,0x47,0x62,0x62,0x22,0x29,0x29,0x29,0xea,0x69,0x5d, + 0x87,0xec,0x2e,0x11,0xfa,0x7a,0x17,0xa1,0xb1,0x64,0x1c,0x1b,0x1b,0xcb,0xe5,0xcb, + 0x97,0xd5,0xc6,0x4,0x85,0x42,0xa1,0x50,0x28,0x81,0x95,0xd9,0x60,0xe9,0x8d,0x5, + 0xc2,0x18,0x44,0x85,0x10,0xd4,0xaa,0x55,0xb,0x3f,0x3f,0x3f,0xbe,0xff,0xfe,0xfb, + 0xc,0x3b,0xff,0x6e,0x66,0x89,0x2f,0x25,0x25,0x45,0x5,0xc3,0xbc,0x1,0xa7,0x4e, + 0x9d,0xca,0x33,0xd7,0xf2,0xef,0xbf,0xff,0x72,0xe1,0xc2,0x5,0x42,0x42,0x42,0xf2, + 0xc4,0xf5,0x18,0xf9,0x16,0x95,0x35,0x4d,0xa1,0x50,0x28,0x14,0xb7,0x5c,0x60,0x49, + 0x29,0x33,0x58,0x8e,0xbc,0x19,0x9c,0x8c,0xef,0x44,0x46,0x46,0x12,0x11,0x11,0xc1, + 0xb4,0x69,0xd3,0xdc,0xc7,0xdf,0xcc,0x12,0x61,0x4a,0x4a,0x8a,0x4a,0xe7,0x72,0x3, + 0xe2,0xe3,0xe3,0x6f,0xb9,0x88,0x1,0xd8,0xb8,0x71,0x23,0xc9,0xc9,0xc9,0x54,0xab, + 0x56,0xcd,0xeb,0x76,0x93,0x9b,0xd7,0xa7,0x50,0x28,0x14,0xa,0xc5,0x2d,0x15,0x58, + 0x0,0x7e,0x7e,0x7e,0x1c,0x38,0x70,0x80,0xc4,0xc4,0xc4,0xeb,0xee,0x10,0x34,0xf0, + 0xfc,0x4e,0xf3,0xe6,0xcd,0xa9,0x5d,0xbb,0x36,0xe3,0xc6,0x8d,0x3,0x9c,0xce,0xd4, + 0xd9,0xdd,0xad,0x66,0xb7,0xdb,0x95,0x93,0xfb,0xd,0x88,0x89,0x89,0xb9,0x65,0x22, + 0xc4,0x58,0x16,0xfc,0xe3,0x8f,0x3f,0x48,0x4a,0x4a,0xe2,0x8e,0x3b,0xee,0xc8,0xf0, + 0x79,0x5e,0x40,0xb5,0x1f,0x85,0x42,0xa1,0x50,0xe4,0x19,0x81,0x65,0xb1,0x58,0xa8, + 0x5c,0xb9,0x32,0x6b,0xd7,0xae,0xe5,0xfc,0xf9,0xf3,0x5e,0xd,0x96,0x9e,0xcb,0x85, + 0x91,0x91,0x91,0x94,0x2f,0x5f,0x9e,0xc1,0x83,0x7,0x93,0x9a,0x9a,0x9a,0xed,0x1, + 0x3c,0x31,0x31,0x51,0x39,0xb9,0xdf,0x80,0x93,0x27,0x4f,0x66,0xfb,0x58,0x21,0x4, + 0x76,0xbb,0x3d,0xdb,0xcf,0x47,0x8,0xc1,0xcf,0x3f,0xff,0xcc,0x9e,0x3d,0x7b,0x68, + 0xd5,0xaa,0x15,0x26,0x93,0x29,0x43,0x5b,0xc8,0xb,0xa8,0x25,0x42,0x85,0x42,0xa1, + 0x50,0xe4,0x9,0x81,0x65,0x58,0xa3,0x82,0x82,0x82,0x68,0xd6,0xac,0x19,0xab,0x57, + 0xaf,0xe6,0xd8,0xb1,0x63,0x6e,0xcb,0xc4,0x8d,0x30,0xfc,0xb7,0x7a,0xf4,0xe8,0x41, + 0xa3,0x46,0x8d,0x98,0x3e,0x7d,0xba,0xdb,0x99,0x3a,0xab,0x3,0x9d,0xdd,0x6e,0xcf, + 0xb6,0x83,0x7c,0x61,0x21,0x3b,0xa1,0x16,0x8c,0xe7,0x70,0xe9,0xd2,0x25,0x4e,0x9d, + 0x3a,0x95,0x65,0x2b,0x8f,0x71,0xfc,0xec,0xd9,0xb3,0x39,0x74,0xe8,0x10,0xfd,0xfa, + 0xf5,0xcb,0xd6,0xf3,0xcd,0xd,0x6c,0x36,0x9b,0x12,0x58,0xa,0x85,0x42,0xa1,0xb8, + 0xf5,0x2,0xcb,0x53,0x64,0x15,0x2d,0x5a,0x94,0xa8,0xa8,0x28,0x16,0x2e,0x5c,0x48, + 0x6c,0x6c,0xac,0xd7,0xcb,0x85,0xc6,0x60,0xfb,0xc4,0x13,0x4f,0x50,0xa5,0x4a,0x15, + 0x5e,0x79,0xe5,0x95,0xab,0x6,0x67,0x6f,0x7,0x47,0x15,0xc,0xd3,0xb7,0x18,0xcb, + 0x77,0x9a,0xa6,0x71,0xe9,0xd2,0x25,0xc2,0xc3,0xc3,0xb1,0x58,0x2c,0x5e,0x3f,0x17, + 0xe3,0xf8,0xaf,0xbe,0xfa,0x8a,0xd3,0xa7,0x4f,0xd3,0xab,0x57,0xaf,0xc,0x9f,0xe7, + 0xb5,0x7b,0x55,0x2,0x4b,0xa1,0x50,0x28,0x14,0x79,0x46,0x60,0x79,0xa,0xa5,0x12, + 0x25,0x4a,0xd0,0xbd,0x7b,0x77,0x86,0xd,0x1b,0xc6,0xd9,0xb3,0x67,0xbd,0x5e,0x2e, + 0x34,0xbe,0x57,0xb5,0x6a,0x55,0xaa,0x57,0xaf,0x4e,0xeb,0xd6,0xad,0xb3,0x3c,0x8, + 0x2b,0x1f,0x2c,0xef,0x44,0x44,0x56,0xbe,0x27,0x84,0x20,0x29,0x29,0x89,0x9f,0x7e, + 0xfa,0x89,0x6a,0xd5,0xaa,0xe1,0xe7,0xe7,0x97,0xe1,0x79,0x7b,0x73,0xfc,0xf7,0xdf, + 0x7f,0xcf,0x8a,0x15,0x2b,0x18,0x3a,0x74,0x28,0x56,0xab,0xd5,0xab,0xe3,0x6f,0x15, + 0x4a,0xa0,0x2b,0x14,0xa,0x85,0x22,0x4f,0x9,0x2c,0xcf,0x81,0xb5,0x54,0xa9,0x52, + 0xbc,0xf5,0xd6,0x5b,0x8c,0x1b,0x37,0x8e,0xfd,0xfb,0xf7,0x67,0x69,0x60,0x4f,0x4d, + 0x4d,0xe5,0xf5,0xd7,0x5f,0xe7,0xb1,0xc7,0x1e,0xe3,0x81,0x7,0x1e,0xe0,0xcc,0x99, + 0x33,0x5e,0x1f,0xaf,0x96,0x8,0x7d,0x87,0x21,0x80,0x62,0x62,0x62,0x98,0x39,0x73, + 0x26,0x75,0xeb,0xd6,0xcd,0x92,0xf8,0x30,0x8e,0x9f,0x3c,0x79,0x32,0x2b,0x56,0xac, + 0x60,0xee,0xdc,0xb9,0x68,0x9a,0x96,0xa7,0xad,0x43,0x52,0x4a,0x92,0x93,0x93,0x55, + 0x1b,0x52,0x28,0x14,0xa,0x45,0xde,0x13,0x58,0xc6,0xb2,0x60,0xb9,0x72,0xe5,0xe8, + 0xd7,0xaf,0x1f,0xe3,0xc7,0x8f,0xe7,0xd4,0xa9,0x53,0x5e,0x2d,0x17,0x1a,0x22,0xe9, + 0xd2,0xa5,0x4b,0xf4,0xec,0xd9,0x93,0xbe,0x7d,0xfb,0xf2,0xdc,0x73,0xcf,0x91,0x9a, + 0x9a,0xea,0xd5,0xf1,0x37,0x93,0x66,0x47,0x91,0x51,0x68,0x0,0x9c,0x3d,0x7b,0x96, + 0x99,0x33,0x67,0xf2,0xd0,0x43,0xf,0x51,0xb9,0x72,0x65,0xaf,0x85,0x87,0x71,0xfc, + 0xb4,0x69,0xd3,0xf8,0xef,0xbf,0xff,0x98,0x34,0x69,0x92,0xfb,0xf3,0xbc,0x1e,0x50, + 0x34,0x2d,0x2d,0x4d,0x2d,0x11,0x2a,0x14,0xa,0x85,0x22,0xef,0x9,0x2c,0x43,0x64, + 0x1,0x54,0xaa,0x54,0x89,0xc1,0x83,0x7,0xf3,0xd8,0x63,0x8f,0x71,0xe1,0xc2,0x5, + 0xaf,0x6,0x57,0xcf,0x5d,0x5c,0x9d,0x3a,0x75,0xe2,0xe9,0xa7,0x9f,0x26,0x2a,0x2a, + 0xca,0xab,0xc1,0x59,0xed,0x0,0xbb,0x79,0x61,0x65,0xd4,0x73,0x5a,0x5a,0x1a,0x63, + 0xc7,0x8e,0xa5,0x4b,0x97,0x2e,0x94,0x29,0x53,0xc6,0x2b,0xe1,0xea,0xb9,0x2c,0xb8, + 0x64,0xc9,0x12,0xbe,0xff,0xfe,0x7b,0x46,0x8f,0x1e,0x8d,0xbf,0xbf,0x7f,0x86,0x76, + 0x91,0x97,0xef,0x3f,0x29,0x29,0x49,0x59,0xb0,0x14,0xa,0x85,0x42,0x91,0x37,0x5, + 0x96,0xe7,0x80,0x55,0xb3,0x66,0x4d,0x3e,0xfd,0xf4,0x53,0x1e,0x7d,0xf4,0x51,0x77, + 0x1e,0xbc,0xeb,0x89,0x20,0xcf,0xc1,0x4d,0x4a,0xc9,0xe3,0x8f,0x3f,0xce,0x8b,0x2f, + 0xbe,0x48,0xeb,0xd6,0xad,0xdd,0x51,0xc8,0xaf,0x75,0xbc,0xae,0xeb,0x6a,0x70,0xbc, + 0x49,0x84,0x10,0x9c,0x3e,0x7d,0x9a,0xbe,0x7d,0xfb,0xd2,0xa1,0x43,0x7,0x6a,0xd4, + 0xa8,0x91,0x65,0x61,0x3d,0x63,0xc6,0xc,0x3e,0xfa,0xe8,0x23,0x96,0x2d,0x5b,0x86, + 0xbf,0xbf,0x7f,0xbe,0x12,0xbd,0xca,0x82,0xa5,0x50,0x28,0x14,0x8a,0x3c,0x2f,0xb0, + 0x8c,0x65,0xbd,0xfa,0xf5,0xeb,0x33,0x7e,0xfc,0x78,0x86,0xc,0x19,0xc2,0xb1,0x63, + 0xc7,0xae,0xbb,0xdc,0x77,0xe5,0xe7,0x52,0x4a,0x9e,0x79,0xe6,0x19,0x5e,0x7b,0xed, + 0x35,0x7a,0xf5,0xea,0xc5,0xc5,0x8b,0x17,0xaf,0x79,0xbc,0xb7,0x29,0x7b,0x14,0xd7, + 0x7e,0x5e,0xa7,0x4e,0x9d,0xa2,0x6f,0xdf,0xbe,0xf4,0xea,0xd5,0x8b,0x56,0xad,0x5a, + 0x79,0x5d,0xa7,0xc6,0x77,0x66,0xcc,0x98,0xc1,0xba,0x75,0xeb,0x58,0xba,0x74,0xa9, + 0x7b,0xb7,0x61,0x7e,0xc9,0x33,0x28,0xa5,0x24,0x25,0x25,0x45,0x89,0x74,0x85,0x42, + 0xa1,0x50,0xe4,0x1a,0xe6,0x9b,0x19,0xb4,0xd,0x91,0x35,0x62,0xc4,0x8,0xda,0xb5, + 0x6b,0xc7,0xe6,0xcd,0x9b,0x9,0xe,0xe,0xce,0x74,0xf0,0xf5,0x5c,0xe6,0xf3,0x4c, + 0x4,0xdd,0xae,0x5d,0x3b,0x12,0x13,0x13,0x69,0xd5,0xaa,0x15,0x5b,0xb6,0x6c,0xc1, + 0x64,0x32,0x5d,0x75,0xbc,0x1a,0x18,0x6f,0x4e,0x5c,0x38,0x1c,0xe,0x7a,0xf5,0xea, + 0xc5,0x90,0x21,0x43,0x68,0xd2,0xa4,0x49,0x86,0x67,0x78,0xa3,0x63,0x85,0x10,0xfc, + 0xfe,0xfb,0xef,0x7c,0xf3,0xcd,0x37,0x2c,0x5c,0xb8,0x90,0xa0,0xa0,0xa0,0x7c,0x25, + 0xae,0x8c,0xfb,0x88,0x8b,0x8b,0x53,0xed,0x48,0xa1,0x50,0x28,0x14,0xb9,0x86,0x76, + 0x33,0x7,0x1b,0x42,0xe9,0xae,0xbb,0xee,0xe2,0x8b,0x2f,0xbe,0x20,0x32,0x32,0x92, + 0x43,0x87,0xe,0x65,0x6a,0x89,0xba,0xf2,0xef,0x46,0x8,0x7,0x29,0x25,0x8f,0x3c, + 0xf2,0x8,0xc3,0x86,0xd,0xa3,0x79,0xf3,0xe6,0x9c,0x38,0x71,0xe2,0xaa,0xe3,0x8d, + 0x64,0xbd,0x8a,0xac,0x89,0xa,0x80,0x84,0x84,0x4,0xba,0x75,0xeb,0xc6,0x3,0xf, + 0x3c,0x40,0xab,0x56,0xad,0xbc,0x16,0x57,0xc6,0x77,0x16,0x2d,0x5a,0xc4,0xd0,0xa1, + 0x43,0xf9,0xe9,0xa7,0x9f,0x28,0x5a,0xb4,0xa8,0xd7,0xc7,0xe6,0x35,0x6e,0x26,0x52, + 0xbd,0x42,0xa1,0x50,0x28,0x14,0xb9,0x2a,0xb0,0x3c,0x45,0x56,0x64,0x64,0x24,0x93, + 0x26,0x4d,0xa2,0x7f,0xff,0xfe,0x1c,0x3d,0x7a,0xd4,0x2b,0x91,0xe5,0xf9,0x79,0xd7, + 0xae,0x5d,0x19,0x3d,0x7a,0x34,0xbd,0x7b,0xf7,0xe6,0xe4,0xc9,0x93,0x5e,0xef,0x4e, + 0x54,0x5c,0xfb,0xb9,0xc4,0xc6,0xc6,0xd2,0xad,0x5b,0x37,0xba,0x75,0xeb,0xc6,0x8b, + 0x2f,0xbe,0xe8,0xb5,0x38,0x32,0xea,0x7d,0xee,0xdc,0xb9,0x7c,0xf7,0xdd,0x77,0xac, + 0x5e,0xbd,0xda,0x6d,0x99,0xcc,0xaf,0x62,0x33,0x31,0x31,0x51,0x89,0x74,0x85,0x42, + 0xa1,0x50,0xe4,0x1a,0x66,0x5f,0x14,0x62,0x88,0xa1,0xa6,0x4d,0x9b,0x32,0x6c,0xd8, + 0x30,0xba,0x74,0xe9,0xc2,0xfa,0xf5,0xeb,0xf1,0xf3,0xf3,0x73,0x2f,0x27,0x5d,0x6b, + 0x70,0xf6,0x8c,0xf8,0x1e,0x15,0x15,0x85,0xa6,0x69,0x3c,0xf0,0xc0,0x3,0xfc,0xf5, + 0xd7,0x5f,0xee,0xe0,0x97,0x4a,0x68,0x65,0x5d,0x50,0xd8,0xed,0x76,0xfa,0xf4,0xe9, + 0x43,0xbf,0x7e,0xfd,0x78,0xf0,0xc1,0x7,0xdd,0x9f,0x7b,0xbb,0x2c,0xb8,0x61,0xc3, + 0x6,0x66,0xcf,0x9e,0xcd,0xdc,0xb9,0x73,0x9,0x9,0x9,0xc9,0x77,0xcb,0x82,0x57, + 0xde,0x53,0x42,0x42,0x82,0x12,0x58,0xa,0x85,0x42,0xa1,0xc8,0x35,0x34,0x5f,0x15, + 0x64,0x88,0xa8,0x66,0xcd,0x9a,0x31,0x62,0xc4,0x8,0x9a,0x34,0x69,0xc2,0xe9,0xd3, + 0xa7,0xbd,0x1e,0x94,0x8d,0xe3,0x5b,0xb6,0x6c,0xc9,0xe8,0xd1,0xa3,0xb9,0xeb,0xae, + 0xbb,0x38,0x71,0xe2,0x84,0x7a,0x42,0xd9,0xc0,0x66,0xb3,0x31,0x60,0xc0,0x0,0x1a, + 0x36,0x6c,0xc8,0x83,0xf,0x3e,0x98,0xc1,0xf7,0xcd,0x9b,0xe7,0xb0,0x76,0xed,0x5a, + 0x7a,0xf7,0xee,0xcd,0x9c,0x39,0x73,0x28,0x5e,0xbc,0xb8,0xd7,0xc7,0xe6,0x65,0x81, + 0x15,0x1f,0x1f,0xaf,0x4,0x96,0x42,0xa1,0x50,0x28,0x72,0xd,0xb3,0x2f,0xb,0x33, + 0x44,0x52,0x87,0xe,0x1d,0x8,0x8,0x8,0xe0,0xf9,0xe7,0x9f,0x67,0xca,0x94,0x29, + 0x94,0x2f,0x5f,0x3e,0x4b,0xc7,0xb7,0x6f,0xdf,0x9e,0xe0,0xe0,0x60,0x7a,0xf5,0xea, + 0xc5,0xb4,0x69,0xd3,0xdc,0x83,0xa4,0xe2,0xc6,0x24,0x27,0x27,0xf3,0xcc,0x33,0xcf, + 0x70,0xd7,0x5d,0x77,0x31,0x74,0xe8,0xd0,0x2c,0x8b,0xa3,0x85,0xb,0x17,0x32,0x6d, + 0xda,0x34,0x7e,0xff,0xfd,0x77,0x4a,0x96,0x2c,0x99,0xaf,0x2d,0x57,0x9e,0x2,0xeb, + 0xd2,0xa5,0x4b,0x2a,0x58,0xad,0x42,0xa1,0x50,0x28,0xf2,0xa7,0xc0,0xf2,0x14,0x49, + 0x51,0x51,0x51,0x8,0x21,0x78,0xf2,0xc9,0x27,0x59,0xb3,0x66,0x4d,0x96,0x2d,0x59, + 0xcd,0x9b,0x37,0xe7,0x7f,0xff,0xfb,0x1f,0x8f,0x3d,0xf6,0x18,0xcd,0x9b,0x37,0xcf, + 0xf7,0x83,0x7c,0x6e,0xd1,0xbb,0x77,0x6f,0x3a,0x77,0xee,0xcc,0x53,0x4f,0x3d,0xe5, + 0x16,0x17,0xde,0xd6,0xdd,0x96,0x2d,0x5b,0x98,0x3a,0x75,0x2a,0xb3,0x66,0xcd,0x22, + 0x3c,0x3c,0xbc,0x40,0x88,0x2b,0xa3,0xe,0x52,0x52,0x52,0x94,0x48,0x57,0x28,0x14, + 0xa,0xc5,0xad,0x17,0x58,0xc6,0xce,0x3d,0x23,0x9c,0x82,0xb1,0xbc,0x62,0xfc,0xe9, + 0x19,0x47,0xe9,0xca,0x98,0x4a,0xc6,0xef,0xf7,0xdc,0x73,0xf,0xcf,0x3d,0xf7,0x1c, + 0xd,0x1a,0x34,0xa0,0x75,0xeb,0xd6,0x24,0x26,0x26,0x12,0x17,0x17,0xe7,0xf5,0x40, + 0x57,0xb7,0x6e,0x5d,0x86,0xd,0x1b,0xc6,0xa3,0x8f,0x3e,0xca,0xc8,0x91,0x23,0x49, + 0x4e,0x4e,0x26,0x2d,0x2d,0x4d,0x3d,0xb5,0x2b,0x8,0x9,0x9,0xc1,0x6c,0x36,0x33, + 0x7e,0xfc,0x78,0xc2,0xc2,0xc2,0x78,0xf0,0xc1,0x7,0xb9,0x7c,0xf9,0xb2,0x57,0xc7, + 0x26,0x26,0x26,0x62,0xb3,0xd9,0xd8,0xb5,0x6b,0x17,0x8f,0x3e,0xfa,0x28,0x3f,0xfd, + 0xf4,0x13,0x81,0x81,0x81,0x5e,0x1f,0x9f,0xd7,0x31,0x92,0x5a,0xa7,0xa4,0xa4,0x10, + 0x1f,0x1f,0xef,0xe,0x33,0x71,0xe5,0x77,0xc,0x21,0x99,0xd9,0xef,0x99,0xfd,0x64, + 0xf6,0xdd,0xcc,0xce,0xad,0x50,0x28,0x14,0x8a,0xc2,0x89,0x90,0xd7,0x50,0x3b,0x49, + 0x49,0x49,0xc4,0xc7,0xc7,0x13,0x1f,0x1f,0x4f,0x62,0x62,0x22,0x97,0x2f,0x5f,0x26, + 0x35,0x35,0x95,0xb8,0xb8,0x38,0xec,0x76,0x3b,0x9,0x9,0x9,0xa4,0xa4,0xa4,0x60, + 0xb3,0xd9,0x48,0x4d,0x4d,0x25,0x2d,0x2d,0xd,0xbb,0xdd,0x8e,0xc3,0xe1,0x40,0xd7, + 0x75,0xf7,0xb6,0x78,0x7f,0x7f,0x7f,0x76,0xef,0xde,0xcd,0xf2,0xe5,0xcb,0xe9,0xd6, + 0xbd,0x3b,0x55,0x23,0x4a,0x23,0xa5,0xf7,0x4b,0x7e,0xc1,0xc1,0x41,0xcc,0x99,0xff, + 0x23,0xc7,0x8e,0x1d,0xa3,0x73,0xe7,0xce,0x14,0x2f,0x5e,0x1c,0x87,0xc3,0xa1,0x6, + 0x2f,0xf,0xfc,0xfc,0xfc,0xf8,0x64,0xc2,0x27,0x34,0xb9,0xa3,0x1e,0xed,0xda,0xb7, + 0x27,0x2d,0x2d,0x15,0x6f,0xaa,0x57,0x0,0xd1,0xc7,0x8e,0xb0,0x61,0xfd,0x7a,0x12, + 0x13,0x13,0xe9,0xd6,0xad,0x1b,0x45,0x8b,0x16,0xc5,0x66,0xb3,0x15,0x88,0xfa,0xd5, + 0x34,0xa7,0x8b,0xa1,0xdd,0x6e,0xe7,0xaf,0xbf,0xfe,0xa2,0x61,0xc3,0x86,0x4,0x5, + 0x5,0x65,0x98,0x4,0x48,0x29,0xb1,0x58,0x2c,0xf8,0xfb,0xfb,0xe3,0xef,0xef,0x8f, + 0xd5,0x6a,0x25,0x30,0x30,0x10,0xb3,0xd9,0x4c,0x60,0x60,0xa0,0xfb,0xb3,0xe0,0xe0, + 0x60,0x2,0x2,0x2,0xdc,0x3f,0xfe,0xfe,0xfe,0x4,0x4,0x4,0x60,0x36,0x9b,0xb1, + 0x5a,0xad,0x58,0x2c,0x16,0x34,0x4d,0xc3,0x64,0x32,0x5d,0x25,0xc4,0x14,0xa,0x85, + 0x42,0x51,0xf8,0x30,0x5f,0x6f,0xd0,0xb6,0x5a,0xad,0x84,0x85,0x85,0xb9,0x53,0xd5, + 0x64,0x66,0xd5,0xba,0xd2,0x92,0x95,0xd9,0x9f,0x9a,0xa6,0xd1,0xbb,0x4f,0x1f,0xf6, + 0x2f,0x59,0xc6,0x2f,0x1f,0xe,0x41,0xb3,0xd9,0xf1,0x76,0xb1,0x26,0xd5,0x24,0xe8, + 0xdd,0xae,0x1d,0x56,0x93,0x89,0xd5,0xab,0x56,0x33,0x64,0xda,0x97,0x5e,0xe7,0xd0, + 0x2b,0xc,0x48,0x29,0x19,0x3c,0x78,0x30,0x69,0xa9,0x69,0x44,0xbf,0xf4,0x30,0xfb, + 0xd3,0x6c,0x48,0x79,0xe3,0x95,0x5f,0x21,0xe0,0x5c,0x5a,0xa,0xbf,0xb5,0x7c,0x86, + 0x23,0x87,0xf,0x33,0x67,0xce,0x1c,0xc2,0xc2,0xc2,0xa,0xe4,0x32,0x5a,0x52,0x52, + 0x12,0x63,0xc6,0x8c,0xa1,0x5f,0xbf,0x7e,0x84,0x87,0x87,0x5f,0x53,0x8c,0x65,0x66, + 0xa9,0xf2,0xfc,0xfc,0x5a,0xbf,0x3b,0xeb,0x53,0x9,0x2a,0x85,0x42,0xa1,0x50,0x78, + 0x21,0xb0,0x4c,0x26,0x93,0x4f,0x4f,0x54,0xb3,0x66,0x4d,0x82,0xcf,0xc4,0x60,0xe9, + 0x39,0x8c,0xbf,0x66,0x8d,0x2,0x87,0xe,0x52,0x3a,0x47,0xfa,0xeb,0x9a,0x21,0x20, + 0x28,0x30,0x90,0x3d,0x1,0x70,0xc7,0xd0,0x17,0xe9,0xd4,0xa9,0x13,0xeb,0xd6,0xad, + 0xf3,0xda,0x71,0xbe,0xa0,0x8a,0x2a,0xc3,0x57,0x6d,0xc2,0x84,0x9,0x54,0xa9,0x59, + 0x83,0xd0,0xc0,0x20,0xce,0xfb,0x9b,0x41,0xda,0x6f,0x74,0xb0,0xd3,0x74,0x65,0xb7, + 0x73,0xec,0xbe,0xa7,0xb8,0xbd,0x69,0x53,0x3e,0x1c,0x37,0x8e,0xea,0xd5,0xab,0x17, + 0xd8,0xfa,0x4a,0x4c,0x4c,0xc4,0xdf,0xdf,0x9f,0xe2,0xc5,0x8b,0x73,0xdb,0x6d,0xb7, + 0xa9,0xb7,0x5e,0xa1,0x50,0x28,0x14,0x39,0x8e,0x96,0x6b,0x27,0xb2,0xd9,0xd9,0xd8, + 0xab,0xb,0x97,0xdb,0x37,0xa7,0x79,0xcf,0xff,0x61,0xbe,0x9c,0x0,0x9a,0xf7,0x33, + 0x7e,0x7f,0x4,0x5f,0xc6,0x1f,0xa1,0xe3,0xf8,0x11,0xc,0xea,0xd5,0x87,0xcd,0x9b, + 0x37,0xbb,0xc5,0x46,0x61,0xc3,0xb0,0x94,0x8c,0x1c,0x39,0x92,0x8d,0x5b,0x36,0xf3, + 0xd3,0x5d,0x15,0xb8,0x64,0x4b,0xf1,0xf6,0x60,0x6e,0xb3,0x4b,0xbe,0x38,0xd,0x3d, + 0xfb,0xf4,0xa5,0xfe,0xb,0x4f,0x60,0x4b,0x49,0x51,0x6f,0x82,0x42,0xa1,0x50,0x28, + 0x14,0xf9,0x51,0x60,0xe9,0x52,0xe2,0x17,0x97,0xc0,0xde,0x27,0x3a,0x70,0xf4,0xb1, + 0xf6,0xdc,0xfd,0xfa,0x27,0x20,0x1,0x2f,0x5,0x92,0x4,0x10,0x66,0xa6,0xc4,0x1d, + 0x25,0xbe,0x7b,0x1b,0xc6,0xe,0x7f,0x8f,0xff,0xfe,0xfb,0xaf,0xd0,0x45,0x7c,0x37, + 0xee,0xf5,0x95,0x57,0x5e,0xa1,0x88,0x2e,0x58,0xdf,0xb1,0x31,0x3b,0x2f,0x9e,0xc1, + 0x69,0x96,0xf2,0x92,0xb,0x97,0xd9,0xbd,0x71,0x27,0xff,0x3d,0x7e,0x1f,0xeb,0x2c, + 0x29,0x58,0xa4,0x5a,0xda,0x52,0x28,0x14,0xa,0x85,0x22,0x5f,0xa,0x2c,0x37,0x36, + 0x3b,0xc7,0x5b,0x37,0x25,0xa6,0x4d,0x53,0xee,0x7d,0x61,0x38,0xf8,0x59,0xd,0xe5, + 0xe0,0xdd,0xf1,0x42,0xe3,0x37,0x19,0x4f,0xa9,0x3e,0x4f,0xd0,0xaa,0x55,0x2b,0xe, + 0x1f,0x3e,0x5c,0x28,0x7c,0x5f,0x3c,0x45,0xe4,0xf4,0xe9,0xd3,0xf1,0xd7,0x61,0x68, + 0x79,0xc1,0xf1,0xe4,0x78,0xef,0x1e,0xa3,0x11,0x6c,0xd4,0xa1,0x73,0xcf,0x8a,0x7f, + 0x58,0xd1,0xae,0x3e,0x87,0xfd,0x5,0x48,0x28,0xc,0xf2,0xf4,0xca,0x9d,0xae,0xa, + 0x85,0x42,0xa1,0x50,0x14,0x2c,0x81,0x5,0x60,0xb7,0x73,0xe0,0xb9,0xce,0xc4,0xdc, + 0xd7,0x94,0x96,0x3d,0xde,0xc6,0x12,0x9f,0x8,0x5a,0x16,0x2e,0x45,0x68,0x4c,0x3c, + 0xb7,0x9f,0x67,0xa6,0x7e,0x42,0x9f,0x67,0x9e,0x65,0xc3,0x86,0xd,0x57,0x89,0x90, + 0x82,0x26,0xe,0xc,0x11,0x39,0x73,0xe6,0x4c,0x7e,0x5c,0xb4,0x90,0x1f,0x9a,0x94, + 0xc7,0x21,0x75,0x6f,0xb,0x0,0x93,0x9,0xbf,0x8b,0xf1,0x3c,0xf4,0xcd,0x5a,0x4e, + 0x3c,0xd8,0x9c,0xff,0x8a,0x9a,0xbd,0x17,0xb5,0xa,0x85,0x42,0xa1,0x50,0x28,0xf2, + 0x81,0xc0,0x12,0x2,0x2e,0x27,0xb0,0xff,0xb9,0x87,0x38,0xf0,0x58,0x7b,0xee,0x79, + 0xfd,0x13,0x84,0xcd,0x96,0xb5,0x1,0xdf,0x64,0x61,0xf4,0xc9,0x5d,0xf8,0xbd,0xd8, + 0x9d,0x2f,0xc6,0x7d,0xc4,0xb6,0x6d,0xdb,0xa,0xec,0x72,0xa1,0xdb,0xe7,0x6a,0xd4, + 0x48,0x76,0xfd,0xb5,0x91,0xe8,0xee,0x51,0x1c,0x4c,0x8e,0xbf,0xf1,0x6,0x1,0x8f, + 0xfa,0xe,0x38,0x7f,0x89,0x87,0x57,0xef,0x63,0x7b,0xe7,0xbb,0xd9,0x52,0xdc,0xea, + 0xdc,0x64,0xa0,0x76,0xbd,0x29,0x14,0xa,0x85,0x42,0x51,0x80,0x4,0x96,0x21,0xb2, + 0x52,0x52,0x39,0xd9,0xba,0x29,0x7,0xdb,0x37,0xa3,0x4d,0x9f,0x11,0x10,0xe0,0x9f, + 0x35,0x91,0xa5,0x99,0x58,0x9a,0x72,0x9e,0xa0,0xe7,0xbb,0xd0,0xad,0x4b,0x17,0xa2, + 0xa3,0xa3,0xb,0x9c,0xc8,0x32,0x96,0xb6,0xe6,0xce,0x9d,0xcb,0xc5,0xa3,0x27,0xf8, + 0xb4,0x69,0x59,0x8e,0xa6,0x25,0xe2,0xb5,0xcf,0x95,0x94,0x8,0x87,0xce,0x3,0xbf, + 0xec,0xe2,0xcf,0xa8,0xda,0x1c,0x9,0xf1,0x53,0xe2,0x4a,0xa1,0x50,0x28,0x14,0x8a, + 0x2,0x2b,0xb0,0xc,0x91,0xa5,0xeb,0x9c,0x78,0xb2,0x3,0xff,0xb5,0x6c,0x4c,0xdb, + 0xa7,0xde,0xc4,0x92,0x9c,0x9a,0xb5,0xc1,0x5f,0x8,0x26,0xc7,0xec,0xa5,0xcf,0x57, + 0x53,0x78,0xfe,0xa9,0xa7,0x59,0xbb,0x76,0x6d,0x81,0x10,0x59,0x9e,0x9,0x9a,0x57, + 0xac,0x58,0xc1,0xb4,0x59,0x33,0xf9,0xa6,0x69,0x5,0x74,0x21,0x9d,0xe2,0x4a,0xdc, + 0xb0,0x0,0xd0,0x4,0x1,0xc9,0x69,0x74,0x9d,0xb7,0x81,0x5d,0x2d,0x6a,0x73,0xb2, + 0x78,0x50,0x7a,0xbd,0x2b,0xa,0x2d,0xbe,0x7e,0x37,0x94,0x6f,0x9b,0x42,0xa1,0x50, + 0x5c,0x8d,0xf9,0x96,0x5f,0x81,0x10,0x10,0x97,0xc8,0xe1,0x17,0xbb,0x91,0x1c,0x5e, + 0x9c,0xe6,0x43,0x3f,0xe2,0xcf,0xf1,0x43,0xb0,0xfb,0x59,0xbd,0x17,0x2,0x66,0x2b, + 0xaf,0xef,0x5b,0xcf,0x13,0xc3,0x5e,0xe2,0xeb,0xcf,0x27,0x23,0x91,0xb4,0x8c,0x6c, + 0x99,0xaf,0x73,0xe9,0x19,0xd7,0x3d,0xf5,0xcb,0x2f,0xf9,0x6d,0xc9,0x52,0xfe,0x7d, + 0x34,0x8a,0xb3,0xc2,0xe1,0xf4,0x48,0x17,0xde,0xd5,0x6b,0xc8,0xc5,0x44,0xda,0xad, + 0xdc,0xc5,0x5f,0xad,0xea,0x70,0xbc,0x6c,0x18,0xd8,0x1c,0x4a,0x5c,0x15,0x52,0x41, + 0xe5,0xf9,0x1e,0x18,0xbf,0xc7,0xc7,0xc7,0x73,0xe0,0xc0,0x1,0xe,0x1c,0x38,0x40, + 0x6c,0x6c,0x2c,0x9,0x9,0x9,0x19,0x7e,0x1c,0xe,0x7,0x1,0x1,0x1,0x4,0x6, + 0x6,0xba,0xff,0x8c,0x88,0x88,0xa0,0x5c,0xb9,0x72,0x94,0x2f,0x5f,0x9e,0x72,0xe5, + 0xca,0xb9,0x23,0xd7,0x67,0x36,0x31,0x50,0x28,0x14,0xa,0x25,0xb0,0xf2,0x82,0xc8, + 0x4a,0x4c,0xe6,0x74,0xbb,0x7b,0x90,0xe,0x9d,0xf6,0xfd,0xdf,0x67,0xe9,0x37,0xef, + 0x43,0x52,0xa,0x5e,0x2f,0x85,0x99,0x2c,0xcc,0xbd,0x78,0x9c,0x9e,0x4f,0x3f,0xc8, + 0xa0,0x7e,0xfd,0xf9,0x72,0xd6,0x4c,0x1a,0x35,0x6a,0x94,0x2f,0x45,0x96,0x71,0xcd, + 0xb,0x17,0x2e,0x64,0xf3,0xca,0xdf,0x59,0xd8,0xf9,0x4e,0xec,0xc2,0xe1,0x5d,0x60, + 0x56,0x67,0x1,0x98,0x1c,0x3a,0x1d,0x7f,0xdd,0xcd,0xca,0x7b,0x6b,0x71,0xbe,0x64, + 0x51,0x25,0xae,0xa,0xa1,0xa8,0x32,0x84,0x8e,0xd1,0xfe,0x77,0xef,0xde,0xcd,0xfc, + 0xf9,0xf3,0xd9,0xb0,0x61,0x3,0xff,0xfc,0xf3,0xf,0x49,0x49,0x49,0x19,0xd2,0x5b, + 0x19,0xcb,0xd1,0x99,0xe5,0x6a,0x34,0xfe,0x34,0x99,0x4c,0xee,0x94,0x40,0x26,0x93, + 0x89,0x12,0x25,0x4a,0xd0,0xa6,0x4d,0x1b,0xda,0xb6,0x6d,0x4b,0xeb,0xd6,0xad,0x9, + 0x9,0x9,0xb9,0xa6,0xb0,0x53,0x28,0x14,0xde,0x4f,0x84,0xf2,0x5b,0xf9,0x8a,0xbc, + 0x2a,0xb0,0xc,0x91,0x25,0x25,0x67,0xba,0xb5,0x61,0xdb,0xd9,0xb,0x3c,0xf8,0xc4, + 0x9b,0x2c,0x9f,0x3c,0xc,0xbb,0xd9,0x9a,0xa5,0x32,0xa6,0x9d,0xda,0xcb,0xc4,0x59, + 0x93,0x78,0xfe,0x99,0x1e,0x7c,0x32,0xf1,0x33,0x5a,0xb5,0x6a,0x95,0x6f,0x1a,0x96, + 0xe7,0xa0,0xb8,0x69,0xd3,0x26,0x3e,0x9d,0xf8,0x19,0x5b,0xba,0x45,0x62,0xf7,0xac, + 0xa3,0x1b,0xd6,0x1,0x4,0xd8,0x74,0xba,0x2d,0xdb,0xc1,0xea,0xba,0x65,0x39,0x1f, + 0x1e,0x2,0xba,0x54,0xe2,0xaa,0x90,0x91,0x98,0x98,0xc8,0x99,0x33,0x67,0xd8,0xbc, + 0x79,0x33,0x8b,0x17,0x2f,0x66,0xf1,0xe2,0xc5,0x24,0x26,0x26,0xde,0x54,0xbb,0xf4, + 0x4c,0xfa,0x6e,0x10,0x1f,0x1f,0xcf,0xd4,0xa9,0x53,0x99,0x3a,0x75,0x2a,0x0,0x11, + 0x11,0x11,0x74,0xeb,0xd6,0x8d,0x6e,0xdd,0xba,0x51,0xb9,0x72,0x65,0x8a,0x15,0x2b, + 0x86,0xbf,0xbf,0xbf,0x7a,0x20,0x8a,0x42,0x83,0xdd,0x6e,0x67,0xcf,0x9e,0x3d,0xd9, + 0xca,0x86,0x62,0xb7,0xdb,0x9,0xa,0xa,0x76,0x8f,0x3,0x46,0xae,0x54,0x93,0x49, + 0x73,0xe5,0x3b,0x35,0xe1,0xe7,0xe7,0x8f,0x9f,0x9f,0x15,0x8b,0xc5,0x8c,0xa6,0x39, + 0x27,0x50,0xce,0xd7,0x52,0xa2,0x9,0xe1,0xa,0x2f,0x29,0xaf,0x12,0x56,0x9e,0xae, + 0x33,0xc6,0x78,0xa8,0x2c,0xce,0x85,0x45,0x60,0x19,0x2,0x22,0x21,0x89,0x53,0xfd, + 0x1f,0xe7,0xef,0x12,0xa1,0xb4,0x1c,0xfc,0x21,0xbf,0x8f,0x1b,0x4,0x58,0xb2,0x70, + 0x47,0x56,0xfa,0x6f,0xfd,0x85,0x7e,0x1f,0xff,0x8f,0x79,0x5f,0x4e,0x27,0x25,0x25, + 0x85,0xe,0x1d,0x3a,0xe4,0x1b,0x91,0x25,0x84,0x60,0xf1,0x92,0x25,0x7c,0xf6,0xd1, + 0xc7,0xec,0x7e,0xa4,0x19,0x9,0x7e,0x26,0xef,0x3,0x55,0x9,0x28,0x99,0x68,0xe7, + 0xbe,0xe5,0xdb,0x58,0x59,0xbf,0x2c,0xa7,0x6f,0x2f,0xf,0xa9,0x36,0x25,0xae,0xa, + 0xf8,0xac,0xd7,0xb3,0x83,0xdc,0xbb,0x77,0x2f,0x4b,0x96,0x2c,0x61,0xf5,0xea,0xd5, + 0xac,0x59,0xb3,0x86,0xd4,0xd4,0xd4,0x5c,0xbd,0x9e,0x98,0x98,0x18,0x3e,0xfd,0xf4, + 0x53,0x3e,0xfd,0xf4,0x53,0xca,0x97,0x2f,0x4f,0xe3,0xc6,0x8d,0x69,0xd9,0xb2,0x25, + 0x5d,0xbb,0x76,0x25,0x22,0x22,0x42,0x75,0xea,0x8a,0x2,0xcf,0xa5,0x4b,0x97,0xa8, + 0x5f,0xbf,0x7e,0xb6,0x8f,0x2f,0x51,0xa2,0xa4,0xfb,0xfd,0xd0,0x75,0x49,0x70,0x70, + 0x10,0x16,0x8b,0x85,0x22,0x45,0x82,0xf1,0xf3,0xf3,0xa3,0x78,0xf1,0xe2,0x14,0x9, + 0x2e,0x42,0x91,0xa2,0x45,0x10,0x42,0x50,0xa7,0x4e,0x3d,0xca,0x94,0x29,0x4b,0xd9, + 0x32,0x65,0xa8,0x58,0xb1,0x22,0x81,0x41,0xfe,0x58,0x2c,0x16,0xac,0x56,0x6b,0xa6, + 0x7d,0xc5,0x95,0xbf,0x1b,0xc2,0x4b,0xbd,0x8f,0x5,0x5d,0x60,0x19,0x22,0x2b,0x3e, + 0x91,0xb3,0xf,0xb4,0xe4,0x1f,0xab,0x85,0x36,0x83,0x3f,0xc4,0xf4,0xce,0x70,0xc0, + 0xee,0x7d,0x19,0x16,0x3f,0x26,0x9d,0xd8,0x4b,0x8f,0x27,0x3b,0xf2,0xe1,0xff,0x8d, + 0x26,0x28,0x28,0x88,0x96,0x2d,0xf3,0xb6,0x4f,0x96,0x71,0x6d,0xbf,0xfe,0xf6,0x1b, + 0xdf,0x7c,0x36,0x89,0x3f,0x1e,0x8f,0xc4,0x66,0x31,0x65,0xc9,0xfa,0xe4,0x6f,0xd7, + 0x69,0xb7,0x72,0x7,0x4b,0x9a,0x57,0xe3,0x72,0x44,0x98,0x12,0x57,0x85,0x0,0xa3, + 0x3d,0x2f,0x5d,0xba,0x94,0xff,0xfb,0xbf,0xff,0x63,0xef,0xde,0xbd,0xc4,0xc7,0xc7, + 0xe7,0x9,0xc7,0xf3,0x63,0xc7,0x8e,0x71,0xec,0xd8,0x31,0x16,0x2e,0x5c,0xc8,0xf0, + 0xe1,0xc3,0x69,0xd7,0xae,0x1d,0xc3,0x86,0xd,0xa3,0x4e,0x9d,0x3a,0x19,0xda,0xbc, + 0x42,0x51,0x10,0xdf,0xc9,0xec,0x72,0xfe,0xfc,0xb9,0xc,0x7f,0xbf,0x70,0xe1,0xdc, + 0xf5,0x87,0x3b,0x8b,0xc5,0xe3,0xc7,0x8a,0x9f,0x9f,0x95,0xd6,0xad,0xdb,0x71,0xc7, + 0x1d,0x77,0x50,0xa7,0xce,0x1d,0x94,0x8e,0x88,0x20,0xbc,0xd4,0x6d,0x19,0xf2,0xb0, + 0x1a,0xae,0x0,0x4a,0x5c,0x15,0x36,0x81,0x65,0x88,0x2c,0x5d,0x72,0xa1,0x73,0x14, + 0x3b,0x8e,0x9f,0xe6,0xdc,0xfc,0xf9,0xd4,0xee,0xde,0xd9,0x68,0x19,0x5e,0x2e,0x95, + 0x9,0x66,0x9f,0x8a,0x66,0xca,0xe4,0xf,0xe9,0xd3,0xf5,0x19,0x3e,0xf9,0xec,0x33, + 0xda,0xb7,0x6b,0x97,0xa7,0x2d,0x10,0xfb,0xa2,0xa3,0x19,0x33,0x7a,0x34,0x6b,0xbb, + 0x36,0xc3,0x66,0xd2,0x5c,0xe,0xed,0xe2,0x46,0x5,0x38,0xdd,0xd4,0x4c,0x1a,0x2f, + 0xac,0xfa,0x8f,0xef,0xaa,0x16,0xe3,0x72,0xe9,0x62,0x6a,0x59,0xb0,0x80,0xe2,0xd9, + 0x19,0x26,0x24,0x24,0xb0,0x7d,0xfb,0x76,0xfa,0xf7,0xef,0xcf,0xce,0x9d,0x3b,0xf3, + 0xec,0x35,0xeb,0xba,0xce,0xa5,0x4b,0x97,0x98,0x37,0x6f,0x1e,0xf3,0xe6,0xcd,0xa3, + 0x45,0x8b,0x16,0x7c,0xfa,0xe9,0xa7,0xd4,0xa8,0x51,0x83,0x80,0x80,0x0,0x25,0xb6, + 0x14,0x8a,0x9b,0xc0,0x66,0xb3,0x61,0xb3,0xd9,0x32,0x7c,0x36,0x7b,0xf6,0xc,0xf7, + 0xef,0x7e,0xd6,0x0,0x9a,0x35,0x6f,0x46,0xb5,0x6a,0xd5,0xa8,0x51,0xa3,0x3a,0x4f, + 0x3c,0xf1,0x38,0x25,0x4b,0x96,0xcc,0xf0,0xde,0xa9,0xf7,0x2f,0x67,0xd0,0xf2,0xec, + 0x95,0x9,0x1,0x49,0x29,0x9c,0x7d,0xe5,0x69,0xc2,0xc2,0xc2,0xd8,0xba,0x6c,0x25, + 0xa1,0xc2,0x9c,0x35,0xd1,0x60,0xb6,0xf2,0xe2,0x86,0xc5,0x74,0x9f,0x35,0x91,0x1f, + 0x67,0xce,0x66,0xfe,0xfc,0xf9,0x19,0x44,0x4d,0x5e,0x9a,0xf1,0x6c,0xda,0xbc,0x99, + 0x17,0x5f,0x7c,0x91,0x8d,0xed,0x1a,0x62,0xb,0xf0,0xcb,0x52,0x10,0xd1,0xca,0xc9, + 0x3a,0x26,0x1d,0x7e,0xc,0x93,0x5c,0xb8,0xb3,0xba,0x33,0xce,0x95,0xa2,0xc0,0x8a, + 0xab,0xb4,0xb4,0x34,0xbe,0xfa,0xea,0x2b,0x3a,0x77,0xee,0x4c,0x64,0x64,0x64,0x9e, + 0x16,0x57,0x99,0xf1,0xe7,0x9f,0x7f,0xd2,0xa0,0x41,0x3,0x9e,0x78,0xe2,0x9,0x16, + 0x2d,0x5a,0x94,0xa1,0x93,0x57,0x28,0x14,0xbe,0x25,0x35,0x2d,0x99,0x55,0xab,0x7e, + 0xe3,0x8b,0x2f,0x26,0xf3,0xde,0x7b,0xef,0x71,0xea,0xd4,0xe9,0xab,0x26,0x35,0x4a, + 0x5c,0x15,0x36,0x81,0x65,0x88,0xac,0x84,0x44,0x22,0x23,0x23,0xb9,0xbd,0x44,0x38, + 0x9d,0x37,0x1c,0x72,0x5a,0x6b,0xb2,0xd2,0x11,0x5b,0x3,0x18,0x11,0xfd,0x17,0x69, + 0x4f,0x77,0x62,0xee,0xf4,0x99,0x2c,0x5d,0xba,0x34,0x4f,0x75,0xe6,0x4e,0x71,0xb5, + 0x89,0x61,0x2f,0xbd,0xc2,0x86,0x6e,0xcd,0x49,0x8,0xf,0x5,0xdd,0xfb,0x14,0x38, + 0x21,0xba,0xa0,0xc1,0xf2,0x2d,0x90,0x96,0xc6,0x99,0xbb,0x6a,0x41,0x4a,0x9a,0xb2, + 0x5c,0x15,0x40,0x61,0x65,0xb4,0x95,0xe8,0xe8,0x68,0x5a,0xb4,0x68,0xc1,0xf3,0xcf, + 0x3f,0xcf,0xaa,0x55,0xab,0xf2,0xf5,0x7d,0x2d,0x5a,0xb4,0x88,0xee,0xdd,0xbb,0xd3, + 0xbc,0x79,0x73,0xe,0x1e,0x3c,0x78,0x95,0xe3,0xad,0x42,0xa1,0xf0,0x2d,0x15,0x2a, + 0x94,0xa7,0x74,0xe9,0x88,0xc,0xbb,0x8b,0x15,0x85,0x55,0x60,0x79,0x8,0x89,0x2e, + 0xdd,0xba,0x51,0x32,0x34,0x8c,0x77,0xa3,0x13,0x41,0x13,0x64,0x29,0x4b,0xb1,0xd0, + 0xf8,0xfa,0xe4,0x3e,0xda,0x8e,0x1b,0xce,0x90,0xc1,0x83,0x59,0xb4,0x68,0xd1,0x2d, + 0x6f,0x5c,0xc6,0x20,0x72,0xf8,0xf0,0x61,0xde,0x79,0xf5,0x4d,0x8a,0xce,0xec,0x88, + 0xcd,0xe2,0xe7,0xdd,0xd2,0x9e,0x74,0xfe,0xcf,0x8c,0xa0,0xe7,0xdf,0xc7,0x79,0xfa, + 0xc9,0x27,0x29,0x56,0x44,0xed,0x16,0x2c,0xc8,0xc2,0x2a,0x29,0x29,0x89,0x37,0xdf, + 0x7c,0x93,0xdb,0x6f,0xbf,0x9d,0x4d,0x9b,0x36,0xe1,0x70,0x38,0xa,0xc4,0x3d,0xa6, + 0xa5,0xa5,0xb1,0x61,0xc3,0x6,0xaa,0x56,0xad,0xca,0xa8,0x51,0xa3,0x48,0x4a,0x4a, + 0x52,0x42,0x4b,0xa1,0xc8,0x21,0xca,0x95,0x2b,0x4f,0x78,0xf8,0x6d,0xee,0x7e,0x25, + 0x2b,0xef,0x98,0x24,0x3d,0x84,0x8b,0x74,0xff,0x97,0xde,0x57,0x49,0x50,0xf9,0x6d, + 0xf3,0xa5,0xc0,0x2,0x1c,0xe,0x7,0xe3,0xc6,0x8e,0x25,0xce,0x9e,0xc6,0x63,0x7f, + 0x1e,0x22,0x54,0xb3,0x82,0xc8,0xc2,0xc3,0x34,0x5b,0x78,0x71,0xed,0x42,0x5e,0xfa, + 0x71,0x36,0x8b,0xbe,0xf9,0x96,0x6f,0xe6,0xce,0xbd,0x65,0x9d,0xb8,0x61,0x9a,0x3d, + 0x74,0xe8,0x10,0x3,0xfa,0xbd,0x44,0xd3,0x21,0x4f,0xb0,0x78,0x13,0x60,0xf1,0x76, + 0x59,0x50,0x52,0xc1,0x14,0xc0,0x93,0xbf,0xee,0x25,0xbc,0x66,0x35,0x3a,0x77,0xee, + 0xac,0x5a,0x72,0x1,0x14,0x57,0x86,0xd0,0x58,0xb6,0x6c,0x19,0x8d,0x1a,0x35,0xe2, + 0x83,0xf,0x3e,0x28,0xd0,0xf7,0xfc,0xce,0x3b,0xef,0x10,0x19,0x19,0xc9,0xaf,0xbf, + 0xfe,0x9a,0xad,0x1,0x40,0xa1,0x50,0x5c,0x9f,0xb6,0xed,0xda,0x1a,0x83,0x88,0x53, + 0x0,0x68,0x59,0x94,0x0,0xc2,0x35,0x66,0x4a,0xd7,0x44,0x5f,0xca,0x74,0x4d,0xe5, + 0x16,0x5f,0x8a,0x7c,0x27,0xb0,0xc,0x3e,0xfa,0xe8,0x23,0xee,0xa9,0xd7,0x80,0xfb, + 0xd7,0xfd,0xe7,0x8a,0x9d,0x95,0x85,0x83,0xfd,0x2,0x19,0xb8,0x71,0x5,0xe2,0x85, + 0x47,0x58,0xb5,0x78,0x29,0x73,0xe7,0xce,0xbd,0x25,0x9d,0xb8,0x10,0x82,0x3,0x7, + 0xe,0xd0,0xb9,0x73,0x67,0xfa,0xbf,0xfd,0x26,0x13,0x12,0x2e,0x61,0xd7,0x6d,0xde, + 0x4e,0x23,0x28,0x65,0xf2,0xa3,0xfa,0xbc,0x55,0x3c,0xd0,0xad,0x2b,0x43,0x5f,0x7d, + 0x35,0xfd,0x1f,0x14,0x5,0x4e,0x5c,0xbd,0xf4,0xd2,0x4b,0x74,0xeb,0xd6,0x8d,0xe8, + 0xe8,0xe8,0x42,0x71,0xef,0x5b,0xb7,0x6e,0xe5,0xe1,0x87,0x1f,0x66,0xc8,0x90,0x21, + 0x4a,0x64,0x29,0x14,0x3e,0x1e,0x77,0x5a,0x45,0xb5,0xca,0xf0,0xf7,0xac,0xf8,0x3f, + 0xa,0x29,0x10,0xd2,0xf9,0x5d,0xbb,0xd4,0x71,0xe8,0x12,0xdd,0xb5,0x1b,0xd1,0x1d, + 0xa8,0xd8,0x90,0x6e,0xd2,0xbd,0xd0,0x52,0xa8,0xc7,0xa7,0x7c,0x27,0xb0,0xa4,0x94, + 0xbc,0x3c,0x70,0x0,0x25,0x83,0x82,0x19,0x7b,0x1c,0x97,0x15,0x2b,0xb,0xcb,0x85, + 0x26,0x33,0xb3,0x8e,0x47,0x53,0xff,0x9d,0x81,0x8c,0xf9,0xe0,0x3,0xe6,0xcc,0x99, + 0x93,0x6b,0xcb,0x85,0x46,0x23,0x8e,0x89,0x89,0xe1,0x99,0x67,0x9e,0x61,0xf1,0xc2, + 0x45,0xb4,0xdf,0xb5,0x82,0xcb,0x29,0x49,0x5e,0x2f,0xb,0x6a,0xc0,0x73,0x5b,0x4e, + 0xd1,0xbd,0x4b,0x57,0x1e,0x79,0xe4,0x11,0x35,0xf8,0x14,0x30,0x61,0x65,0x74,0x7c, + 0xe7,0xcf,0x9f,0xe7,0xde,0x7b,0xef,0x65,0xd2,0xa4,0x49,0x24,0x27,0x27,0x17,0xaa, + 0x7a,0x48,0x4c,0x4c,0xe4,0xa3,0x8f,0x3e,0xa2,0x6d,0xdb,0xb6,0xc4,0xc5,0xc5,0xa9, + 0x25,0x43,0x85,0xc2,0x17,0x83,0xbd,0xa6,0x51,0xa7,0xce,0x1d,0xae,0xf7,0x28,0x63, + 0x2c,0x3a,0xe1,0x65,0x10,0x6b,0x43,0x42,0x99,0xa5,0x40,0xe8,0x3a,0x1a,0x12,0xa1, + 0xdb,0x90,0x9a,0x86,0x3b,0x47,0xae,0x74,0x8e,0xcb,0x42,0xea,0x48,0xe1,0xca,0xe, + 0x41,0xe1,0x74,0x5d,0xc9,0x77,0x2,0xcb,0x68,0x8,0x13,0x26,0x4c,0x60,0xef,0x91, + 0xc3,0xf4,0xdb,0x79,0x81,0x30,0xb3,0x5f,0xd6,0x96,0xb,0x4d,0x26,0x6,0xfc,0xb1, + 0x90,0x21,0xb,0xbf,0xe1,0xe7,0x5,0x8b,0x98,0x3d,0x7b,0x76,0x8e,0x77,0xe0,0xc6, + 0x4c,0xe1,0xdc,0xb9,0x73,0xc,0x1e,0x38,0x90,0xa7,0x7,0xbd,0x4c,0xe5,0x35,0x5f, + 0x21,0xac,0xde,0x46,0xb9,0xd6,0xa9,0xe0,0x17,0xcc,0x90,0x6d,0x67,0xd1,0x42,0x8b, + 0xf2,0xc2,0xb,0x2f,0x28,0x47,0xc5,0x2,0x38,0xc3,0x4,0x58,0xb7,0x6e,0x1d,0xf5, + 0xeb,0xd7,0xe7,0x8f,0x3f,0xfe,0x28,0xd4,0xf5,0xf1,0xeb,0xaf,0xbf,0x52,0xab,0x56, + 0x2d,0xb6,0x6e,0xdd,0xea,0xfd,0x20,0xa0,0x50,0x28,0x32,0xe5,0xf9,0xe7,0x5f,0xc8, + 0x30,0x16,0x65,0x67,0xbc,0x13,0x80,0x2e,0x25,0x42,0xd3,0x98,0x1c,0xbd,0x91,0xf7, + 0xb6,0xff,0x41,0x74,0xdc,0x25,0xec,0x52,0x47,0xd3,0x84,0xcb,0xd6,0xa1,0x23,0x75, + 0x90,0x18,0xe7,0x10,0x8,0x65,0xc1,0xca,0x7f,0x33,0xfd,0x99,0x33,0x66,0x50,0xa1, + 0x54,0x4,0xed,0xd6,0x1f,0xc0,0xac,0x99,0xb2,0x66,0x85,0xf4,0xf,0xa2,0xc7,0xef, + 0xdf,0x53,0xe4,0xa5,0x27,0xd8,0xb6,0x76,0x1d,0x53,0xa7,0x4e,0xcd,0xb1,0xe5,0x8, + 0xa3,0x41,0x5f,0xb8,0x70,0x81,0xe,0x1d,0x3a,0x10,0xd5,0xf5,0x61,0xde,0xb2,0x9f, + 0x2,0x61,0xf2,0xee,0x92,0xa5,0xa4,0x72,0x40,0x8,0xb5,0x7f,0xf8,0x83,0xaa,0xf5, + 0xea,0x30,0x6a,0xe4,0x48,0x35,0xa3,0x2f,0x60,0x18,0xcf,0x72,0xce,0x9c,0x39,0x74, + 0xec,0xd8,0x91,0x93,0x27,0x4f,0xaa,0x4a,0x1,0x4e,0x9d,0x3a,0x45,0xfb,0xf6,0xed, + 0x59,0xbe,0x7c,0xb9,0x6a,0xf3,0xa,0xc5,0x4d,0x9,0xac,0xe7,0xdd,0x13,0x15,0xaf, + 0xe3,0x5e,0x79,0x2c,0xe,0x19,0x4e,0xed,0x66,0x4d,0x70,0x3e,0x25,0x9e,0x11,0x3b, + 0x36,0x30,0x62,0xeb,0x9f,0xb4,0x5b,0x3a,0x8d,0x81,0x1b,0x7e,0x66,0xe3,0xe9,0xe3, + 0xce,0x49,0xbf,0x4,0x87,0x74,0x20,0x75,0x89,0x43,0x17,0x2e,0xcb,0x97,0xb8,0x66, + 0x24,0x79,0x25,0xb0,0xf2,0xe0,0x4c,0xdf,0x78,0x40,0x43,0x86,0xe,0x25,0x3c,0x20, + 0x88,0x71,0x67,0x2c,0x20,0xf4,0xac,0x89,0x2c,0xb3,0x95,0x2f,0xe,0xef,0xa2,0xcc, + 0x80,0x67,0x99,0xfb,0xf5,0x1c,0x26,0x4e,0x9c,0x98,0x23,0x22,0x4b,0x8,0xc1,0xc5, + 0x8b,0x17,0xb9,0xff,0xfe,0xfb,0x99,0x3a,0x79,0x32,0x7d,0x2e,0x47,0x73,0x29,0x39, + 0xd1,0xeb,0x1d,0x7f,0x26,0x21,0xe8,0xbe,0xe9,0x18,0xf,0xde,0xdf,0x81,0x5e,0xbd, + 0x7a,0x65,0x10,0x6d,0x8a,0x82,0x21,0xae,0x84,0x10,0x7c,0xff,0xfd,0xf7,0x3c,0xfb, + 0xec,0xb3,0xc4,0xc5,0xc5,0xa9,0x4a,0xf1,0xe0,0xfc,0xf9,0xf3,0x3c,0xf0,0xc0,0x3, + 0xfc,0xfa,0xeb,0xaf,0xca,0x27,0x4b,0xa1,0xc8,0x26,0x4d,0x9b,0x36,0xc9,0xf2,0xb8, + 0x21,0x85,0x44,0x48,0x23,0x9e,0xb5,0x30,0x6,0x34,0xc6,0xff,0xb3,0x81,0x73,0x49, + 0x71,0x20,0x24,0x31,0x76,0x7,0x53,0x77,0x6f,0xa1,0xdd,0xca,0x6f,0x79,0x7a,0xd5, + 0x3c,0x2e,0x4b,0x3b,0x66,0xa1,0x91,0x26,0xc0,0xac,0xbb,0x16,0x97,0xf4,0x74,0xab, + 0x59,0x61,0x1a,0xbb,0xb4,0xfc,0x7a,0xe1,0xc6,0x3,0x32,0x99,0x4c,0x7c,0xf2,0xc9, + 0x27,0xac,0xdb,0xb2,0x99,0x77,0x8f,0x49,0x8a,0x5a,0xad,0x59,0xdb,0x2a,0xaa,0x69, + 0xbc,0xbe,0x7e,0x29,0x9d,0xe7,0x8e,0x65,0xf1,0xca,0x25,0x4c,0x99,0x34,0xd9,0x67, + 0x9d,0xb8,0x51,0x46,0x42,0x42,0x2,0x43,0x6,0xbd,0xc2,0x53,0x2f,0xf5,0xa5,0xe1, + 0xb6,0xc5,0x8,0x93,0xc5,0x3b,0x71,0x25,0x75,0xca,0xf8,0x7,0x31,0xf6,0x98,0x24, + 0x49,0x48,0xfa,0xf4,0xe9,0xa3,0x2,0xc3,0x15,0x30,0x61,0x65,0x3c,0xcb,0x29,0x53, + 0xa6,0xd0,0xbd,0x7b,0xf7,0x2,0x13,0x7e,0xc1,0xd7,0xe8,0xba,0x4e,0xdb,0xb6,0x6d, + 0xdd,0xcb,0xf9,0xa,0x85,0xc2,0x7b,0xda,0xb7,0xbf,0xdf,0xdd,0xe7,0x64,0x65,0x6c, + 0x13,0x52,0x20,0x5d,0x7e,0xce,0xba,0x2e,0x11,0x8,0x8e,0x27,0x5c,0x66,0xc1,0x89, + 0xff,0x9c,0xca,0x49,0x98,0x70,0xe8,0x3a,0xf8,0x9,0x2e,0xa7,0x26,0x32,0xe7,0xe0, + 0x6e,0x22,0x66,0x8e,0xe5,0xc3,0xdd,0x1b,0x49,0x48,0x49,0x41,0x58,0x5c,0xfd,0x9c, + 0x0,0x5d,0x77,0x64,0x18,0xbb,0x3c,0x82,0x3c,0x5c,0xe9,0x11,0xaf,0x4,0x56,0x5e, + 0x1b,0xa4,0x7e,0xfc,0xe1,0x7,0xec,0x36,0x1b,0xf,0xfc,0x7d,0x84,0x20,0x8b,0x35, + 0x6b,0x85,0xf8,0x7,0x32,0x78,0xd9,0x32,0xfc,0x5e,0x7d,0x8c,0x65,0x3b,0x7f,0x65, + 0xe2,0x84,0xcf,0x32,0xa8,0xed,0x9b,0xb1,0x4a,0xa4,0xa5,0xa5,0xd1,0xa5,0x4b,0x17, + 0xca,0x35,0xaa,0xcf,0x70,0xf3,0x79,0x30,0x99,0xbd,0x5e,0x16,0xac,0x1d,0x52,0x92, + 0x7b,0x96,0x6c,0x26,0xc9,0x62,0xe2,0x93,0x8f,0x3f,0xce,0x70,0xbf,0x8a,0xfc,0x8f, + 0xd1,0xd1,0x8c,0x1d,0x3b,0x96,0xbe,0x7d,0xfb,0xaa,0xa,0xf1,0x82,0x67,0x9f,0x7d, + 0x96,0xf1,0xe3,0xc7,0xab,0x77,0x41,0xa1,0xc8,0x2,0x9d,0x3a,0x75,0xcc,0xd6,0xfb, + 0x22,0x5,0x6e,0xf7,0x74,0x29,0x25,0x38,0x1c,0xcc,0x3f,0xb8,0x87,0x7f,0x2f,0x9c, + 0x1,0x8b,0x1f,0x48,0xdd,0x95,0xda,0x4e,0x80,0x66,0x2,0xcd,0x42,0x32,0xe,0x86, + 0x6e,0x58,0x4a,0xeb,0x5f,0x66,0xf0,0xd1,0xb6,0x75,0x8,0x4d,0x20,0xd0,0x71,0xe8, + 0xc6,0xc6,0x7f,0x97,0x15,0x4b,0x1a,0x63,0xac,0x0,0x51,0x30,0x1d,0xe1,0xf3,0xbd, + 0xc0,0xf2,0xb4,0x36,0xd,0x7f,0xf7,0x5d,0x4a,0xf9,0x7,0x32,0xea,0x9c,0x5,0x64, + 0x16,0x2d,0x1,0x56,0x2b,0x4b,0xff,0x3b,0xce,0x91,0xa7,0xee,0x66,0xde,0xef,0x3f, + 0x32,0x72,0xd4,0xa8,0x9b,0xb2,0x12,0x9,0x21,0x48,0x4d,0x4d,0x25,0x32,0x32,0x92, + 0x1,0xfd,0xfb,0x33,0x22,0x28,0x8e,0xcb,0x29,0xc9,0x5e,0x2f,0xb,0xfa,0x99,0xcc, + 0x74,0x5c,0x7f,0x80,0x96,0xcd,0x9a,0x31,0xec,0xad,0xb7,0x32,0x88,0x36,0x45,0xfe, + 0xc7,0x68,0xb3,0xf3,0xe7,0xcf,0x67,0xd8,0xb0,0x61,0xaa,0x42,0xb2,0xc0,0xd0,0xa1, + 0x43,0xf9,0xe1,0x87,0x1f,0xd4,0x72,0xa1,0x42,0xe1,0x25,0x35,0x6b,0xd6,0xcc,0x60, + 0x30,0xf0,0x3e,0x34,0x43,0xba,0x5d,0x49,0x0,0x67,0x6d,0xc9,0xcc,0x3e,0xb0,0x1d, + 0xac,0x16,0xb0,0x3b,0xd2,0xd5,0x17,0xc2,0xf9,0x23,0x5c,0x3f,0x66,0xb,0xbb,0xce, + 0x5f,0xe4,0xd5,0xed,0x6b,0x88,0xfc,0x71,0x2a,0xc7,0x13,0x13,0x30,0xb,0xdd,0xf9, + 0x1d,0xdd,0x10,0x6f,0x4e,0x8b,0x98,0xc0,0x29,0xae,0x44,0x1,0x7c,0x95,0xcd,0x5, + 0xe1,0x26,0xc,0xd1,0x61,0xb5,0x5a,0xf9,0x70,0xfc,0x78,0x3a,0x76,0xea,0xc4,0xe7, + 0x6d,0xda,0x32,0x34,0x2c,0x89,0x24,0x5b,0x5a,0x96,0xf2,0xfa,0xed,0x8e,0x4e,0x86, + 0x27,0x3b,0x11,0x37,0x75,0x19,0x45,0x3,0x2,0x19,0x30,0xf8,0x95,0x2c,0x89,0x1b, + 0xe3,0x7b,0xc9,0xc9,0xc9,0xbc,0x3a,0x78,0x30,0x8f,0xf6,0x78,0x86,0x4e,0xa7,0x37, + 0x83,0xc9,0x82,0x57,0x2,0x5d,0xea,0x94,0xf4,0xf,0xe6,0xc3,0xb,0xfe,0xfc,0x95, + 0x7a,0x82,0x97,0xfa,0xf7,0xcf,0xf0,0x52,0x28,0xa,0x86,0xb0,0x12,0x42,0xb0,0x71, + 0xe3,0x46,0xba,0x76,0xed,0x7a,0xcb,0xdf,0x9d,0x80,0x80,0x0,0x2,0x3,0x3,0x9, + 0x8,0x8,0xc0,0x62,0xb1,0x60,0x32,0x99,0x30,0x99,0x4c,0x68,0x9a,0x86,0xae,0xeb, + 0x38,0x1c,0xe,0xf7,0x9f,0xa9,0xa9,0xa9,0x24,0x25,0x25,0x91,0x9c,0x9c,0x4c,0x5a, + 0x5a,0xda,0x2d,0xbb,0xee,0x47,0x1f,0x7d,0x94,0x55,0xab,0x56,0x11,0x15,0x15,0xa5, + 0x1a,0x95,0x42,0x71,0x1d,0xaa,0x57,0xaf,0x49,0xd5,0xaa,0xd5,0x9c,0x16,0x15,0x57, + 0x60,0xd1,0xeb,0x8d,0x67,0xe9,0xb1,0xac,0xa4,0x3b,0xd6,0xa4,0x94,0x20,0x34,0x58, + 0x1d,0x73,0x84,0x3,0x97,0x2e,0x38,0xd3,0xb9,0x9,0xe1,0xcc,0xaa,0xe2,0x3e,0xc0, + 0x75,0xc,0xce,0x78,0x59,0x3a,0x76,0x84,0x30,0xf1,0x67,0xec,0x71,0xca,0xcf,0xfa, + 0x3f,0x3e,0xbb,0xef,0x51,0x1e,0xa9,0x50,0x93,0xd2,0x81,0x41,0x48,0xdd,0x19,0xa0, + 0x54,0xe2,0x3c,0x87,0x26,0x25,0xd2,0xe5,0x20,0x9f,0x1e,0xea,0x41,0x9,0xac,0x3c, + 0x37,0x78,0x9,0x21,0x58,0xb6,0x74,0x29,0xfd,0x5f,0x7a,0x89,0xc7,0xfc,0xcc,0x2c, + 0x6c,0x58,0x96,0x8b,0x69,0x29,0xde,0x17,0x62,0x12,0x90,0x90,0xcc,0xce,0x67,0xda, + 0xf0,0xc5,0x92,0xd5,0x30,0x5e,0x32,0xf0,0xd5,0x21,0x5e,0x89,0x2c,0xcf,0x7f,0xef, + 0xdb,0xe7,0x45,0xac,0xe5,0x23,0x78,0x27,0x28,0xe,0xec,0x16,0x2f,0x6f,0x40,0xa7, + 0x61,0x89,0xd2,0x34,0x58,0xba,0x89,0x6d,0xc1,0xc1,0x4c,0x9e,0x34,0x49,0x9,0xab, + 0x2,0x88,0x10,0x82,0xd,0x1b,0x36,0xd0,0xb6,0x6d,0xdb,0x5b,0x72,0xfe,0x80,0x80, + 0x0,0x1a,0x37,0x6e,0x4c,0xa3,0x46,0x8d,0xa8,0x59,0xb3,0x26,0xa5,0x4b,0x97,0x26, + 0x22,0x22,0x82,0x88,0x88,0x8,0x8a,0x16,0x2d,0x8a,0xbf,0xbf,0x3f,0x26,0x93,0x29, + 0x43,0xbb,0x4e,0x49,0x49,0x21,0x35,0x35,0x95,0xf3,0xe7,0xcf,0x13,0x13,0x13,0x43, + 0x4c,0x4c,0xc,0xa7,0x4e,0x9d,0x62,0xd7,0xae,0x5d,0x6c,0xda,0xb4,0x89,0xdd,0xbb, + 0x77,0xe7,0xfa,0x7d,0x3c,0xf4,0xd0,0x43,0xac,0x5a,0xb5,0x8a,0x3b,0xef,0xbc,0x53, + 0x35,0x2a,0x85,0xe2,0x1a,0x54,0xac,0x58,0x9e,0x52,0xa5,0xc2,0xbd,0x1e,0x47,0x84, + 0x31,0x11,0x14,0xc2,0xed,0xcf,0xac,0x1,0x9,0xf6,0x34,0xbe,0x39,0xb0,0x8b,0x4, + 0x5b,0x2a,0x58,0xfc,0x3d,0xcc,0x5b,0x86,0x22,0x4a,0xff,0x5d,0x6a,0x2,0x84,0x19, + 0xa9,0xeb,0x60,0xb2,0x82,0xbf,0x85,0x97,0xd7,0x2c,0x60,0x6e,0xa9,0x72,0xbc,0x75, + 0x67,0x2b,0x3a,0x95,0xaf,0xe6,0xdc,0x65,0x28,0x25,0x66,0x4c,0x48,0xd,0x84,0x94, + 0xce,0x25,0x49,0x29,0x32,0x2c,0x4d,0x2a,0x81,0x95,0x87,0x6,0x2e,0x43,0xe4,0x8c, + 0xff,0xe8,0x23,0xde,0x1e,0x36,0x8c,0xb7,0xce,0x6a,0xc,0x2d,0x6a,0x7,0xcd,0x9c, + 0x95,0x82,0xc0,0xa1,0x13,0xdd,0xe1,0x2e,0xbe,0x5e,0xf4,0x1b,0xa7,0xce,0x9d,0x65, + 0xcc,0x98,0x31,0x37,0xdc,0x1,0x61,0x7c,0x7e,0x5f,0xeb,0xd6,0x3c,0xf2,0xf0,0xc3, + 0xbc,0x1c,0x74,0x9,0x99,0x5,0xb,0x5a,0x88,0x35,0x80,0x7b,0xd7,0x44,0x53,0xb6, + 0x56,0x2d,0x6,0xbd,0x92,0x35,0xcb,0x99,0x22,0xff,0xb4,0xd1,0x33,0x67,0xce,0xd0, + 0xa7,0x4f,0x1f,0x12,0x13,0x13,0x73,0xf5,0xdc,0x51,0x51,0x51,0xbc,0xfa,0xea,0xab, + 0x34,0x6e,0xdc,0x18,0x7f,0x7f,0x7f,0x82,0x82,0x82,0xbc,0x4a,0x95,0x61,0x58,0xb9, + 0x2,0x2,0x2,0x8,0xd,0xd,0xa5,0x6a,0xd5,0xaa,0xee,0x7f,0x4b,0x4b,0x4b,0x23, + 0x29,0x29,0x89,0xb8,0xb8,0x38,0x96,0x2e,0x5d,0xca,0xc8,0x91,0x23,0x39,0x7d,0xfa, + 0x74,0xae,0xdc,0x4f,0x5c,0x5c,0x1c,0x7d,0xfb,0xf6,0x65,0xf9,0xf2,0xe5,0x14,0x2f, + 0x5e,0x5c,0xbd,0x27,0xa,0x45,0x26,0xef,0x6e,0xdd,0xba,0xf5,0xf0,0xf3,0xf3,0x73, + 0x8f,0x27,0x57,0x8e,0x95,0x99,0x58,0xa,0xdc,0xe2,0xca,0xfd,0xaf,0x9a,0x60,0x5f, + 0xec,0x5,0x96,0x1c,0xd8,0x8d,0xb0,0x5a,0x9d,0x96,0x27,0x97,0xef,0x94,0xdb,0xdc, + 0x94,0xc1,0xfa,0x94,0xbe,0xe3,0xd0,0x59,0x88,0x40,0x58,0xfc,0xd8,0x78,0xe6,0x34, + 0x5d,0x7e,0x9f,0xc7,0x93,0x95,0xea,0x30,0xb1,0x59,0x47,0x2,0xcd,0x56,0xd7,0x61, + 0xae,0xeb,0x92,0xee,0x5,0xc3,0x2,0x51,0xff,0x5a,0x41,0x6c,0x50,0x0,0x7e,0x7e, + 0x7e,0x8c,0x19,0x3b,0x96,0x5f,0x7f,0x59,0xc9,0x3c,0xbf,0x6a,0x98,0x34,0x53,0xd6, + 0x13,0x51,0x4a,0xc9,0xd6,0x27,0xa2,0x58,0xbf,0x7b,0x7,0x23,0xde,0x7b,0xcf,0x1d, + 0xd8,0xf3,0xca,0xb5,0x6b,0xe3,0xef,0x69,0x69,0x69,0xc,0x7e,0xe5,0x15,0x5a,0xb5, + 0x6d,0x43,0x7f,0xff,0x73,0x4e,0xf5,0xee,0xe5,0x6e,0xc1,0x22,0x16,0x2b,0xb3,0x1c, + 0x11,0xc4,0x25,0x26,0x30,0x70,0xd0,0xa0,0xab,0xee,0x47,0x91,0xbf,0x31,0xda,0x88, + 0xdd,0x6e,0x67,0xd4,0xa8,0x51,0xb9,0x62,0xf1,0x11,0x42,0x10,0x1a,0x1a,0x4a,0xff, + 0xfe,0xfd,0x39,0x71,0xe2,0x4,0xab,0x56,0xad,0xa2,0x43,0x87,0xe,0x94,0x28,0x51, + 0x82,0xe0,0xe0,0xe0,0xac,0xe7,0x21,0xcb,0x4,0xab,0xd5,0x4a,0x48,0x48,0x8,0xe5, + 0xcb,0x97,0xa7,0x5f,0xbf,0x7e,0xc4,0xc4,0xc4,0xb0,0x74,0xe9,0x52,0x9a,0x35,0x6b, + 0x86,0xd5,0x6a,0xcd,0xf1,0x7b,0xdc,0xbc,0x79,0x33,0x9f,0x7e,0xfa,0xa9,0x7a,0x4f, + 0x14,0x8a,0xcc,0x2c,0x28,0x66,0x33,0x2d,0x5a,0xb4,0xc8,0x30,0x59,0xbf,0xe1,0x4e, + 0x74,0xf,0xcb,0x95,0x5d,0x4a,0xec,0xe,0x1d,0x74,0xc9,0x88,0x2d,0x7f,0x0,0x8e, + 0x4c,0x2c,0x56,0x22,0xfd,0x57,0xc8,0x38,0xe6,0xb9,0xd3,0xd9,0x49,0xa4,0xd0,0xd0, + 0xcd,0x26,0xd2,0x24,0xcc,0xdc,0xb3,0x91,0xbb,0x96,0xcd,0xe2,0xb7,0x33,0x87,0x1, + 0x7,0xba,0x43,0x47,0xd7,0xc9,0x20,0xae,0x64,0x56,0x32,0xb4,0x28,0x81,0x95,0xfb, + 0x3,0x9a,0xa6,0x69,0xac,0x58,0xb1,0x82,0x9f,0x7e,0x5e,0xce,0x4b,0x7,0x12,0x28, + 0x19,0x18,0x9c,0x35,0x91,0x25,0x4,0x24,0xa6,0xb0,0xfe,0xb1,0x48,0x16,0xec,0xdb, + 0xc1,0x87,0xa3,0xdf,0xbf,0x6a,0xc0,0xf4,0x9c,0x5,0xbc,0x37,0x7c,0x38,0xc7,0xd2, + 0x92,0x78,0xaf,0xa4,0x1d,0x30,0x79,0x77,0xe,0x5d,0xa7,0x51,0x78,0x39,0x6,0xed, + 0x8b,0x67,0xe1,0x9a,0xdf,0x99,0x32,0x79,0x32,0x9a,0xa6,0xa9,0x1,0xa3,0x80,0x32, + 0x77,0xee,0x5c,0x26,0x4e,0x9c,0x98,0xe3,0xe7,0x29,0x5f,0xbe,0x3c,0x6f,0xbf,0xfd, + 0x36,0x7b,0xf6,0xec,0xe1,0xb3,0xcf,0x3e,0xa3,0x4c,0x99,0x32,0x19,0x66,0xaf,0xbe, + 0x6c,0x5f,0x57,0xa6,0xb2,0xe9,0xd8,0xb1,0x23,0xeb,0xd6,0xad,0x63,0xc1,0x82,0x5, + 0xb4,0x6f,0xdf,0x3e,0xc7,0xef,0x75,0xe4,0xc8,0x91,0xac,0x5c,0xb9,0x32,0xc3,0x35, + 0x28,0x14,0xa,0x27,0x77,0xdf,0x7d,0x77,0x96,0xd,0xb,0x86,0x48,0x12,0x3a,0x98, + 0x85,0xc6,0xa6,0xb,0xa7,0x58,0xf2,0xdf,0x56,0xb4,0x80,0xc0,0x2c,0x96,0x5,0x19, + 0x1c,0xab,0x8c,0x3f,0xfc,0xfd,0xd9,0x73,0xf6,0x34,0x1d,0x97,0x7d,0xc5,0xf8,0xdd, + 0x9b,0x70,0x0,0xc6,0x7c,0xcf,0x99,0x5a,0x47,0x7a,0x84,0x88,0x50,0x2,0x2b,0xcf, + 0xe1,0x69,0x2,0x9d,0x31,0x73,0x26,0x96,0xa4,0x14,0x6,0x9d,0x72,0x38,0xb7,0x95, + 0x66,0xad,0x20,0xb0,0x39,0xd8,0xd1,0xa6,0x1,0xb,0x76,0x6e,0x61,0xc0,0x80,0x1, + 0x19,0x6,0x14,0xe3,0xf7,0xc7,0x1e,0x7f,0x9c,0x24,0x87,0x83,0xc5,0x8d,0x2b,0x60, + 0x97,0xe,0xaf,0x17,0x90,0x23,0x82,0x43,0x68,0xb1,0x66,0x2f,0x68,0x82,0x19,0xd3, + 0xa7,0x63,0x32,0x99,0xd4,0x20,0x51,0x0,0xc5,0xbe,0x10,0x82,0x7f,0xfe,0xf9,0x87, + 0x17,0x5e,0x78,0x21,0xc7,0xcf,0x37,0x60,0xc0,0x0,0x36,0x6f,0xde,0xcc,0x88,0x11, + 0x23,0x28,0x5d,0xba,0x74,0xae,0x6d,0x92,0xb8,0xb2,0xfc,0x8e,0x1d,0x3b,0xf2,0xc3, + 0xf,0x3f,0xb0,0x6c,0xd9,0x32,0x4a,0x94,0x28,0x91,0xa3,0xe7,0x7e,0xfc,0xf1,0xc7, + 0x49,0x48,0x48,0x50,0x3b,0xb,0x15,0xa,0xf,0x9a,0x34,0xb9,0x87,0xd0,0xd0,0x90, + 0xac,0xf5,0x57,0xae,0x95,0x3f,0xf7,0xea,0x9e,0x49,0xf0,0xee,0x5f,0xcb,0xc0,0x1a, + 0x8a,0x74,0xa4,0xe7,0x23,0xcc,0x60,0xc8,0xba,0x66,0xa7,0x40,0xc6,0x58,0xf,0xae, + 0x5d,0x86,0xd2,0x1,0xc2,0x24,0x49,0xd3,0x61,0xe8,0xc6,0xe5,0xb4,0x59,0xf1,0xd, + 0xc7,0x12,0xe3,0xd2,0x27,0x7f,0x92,0x2,0xb1,0x54,0xa8,0x15,0xe4,0xc6,0xe5,0xb9, + 0x5c,0x38,0xfa,0x83,0xf,0xf8,0x63,0xe5,0x6f,0xac,0x28,0xd1,0x30,0x5d,0xa5,0x67, + 0x91,0xbf,0x1e,0x68,0xcc,0x7f,0x31,0x27,0x79,0x65,0xe0,0x20,0x77,0x43,0xd0,0x75, + 0x9d,0x61,0x6f,0xbd,0x45,0xd9,0x32,0x65,0x98,0x50,0xbb,0x28,0x36,0x87,0x61,0x42, + 0xbd,0xf1,0x2c,0xc1,0xaa,0x99,0x98,0x29,0xca,0x72,0xf9,0xe2,0x45,0xde,0x7d,0xef, + 0x3d,0xf7,0x92,0x8d,0xb2,0x5e,0x15,0xcc,0x76,0xf8,0xc2,0xb,0x2f,0x60,0xb7,0xdb, + 0x73,0xec,0x3c,0xe1,0xe1,0xe1,0x2c,0x5f,0xbe,0x9c,0x9,0x13,0x26,0x50,0xb2,0x7a, + 0xf2,0xf5,0xf4,0x0,0x0,0x20,0x0,0x49,0x44,0x41,0x54,0x64,0xc9,0x3c,0xb1,0xfb, + 0x34,0x28,0x28,0x88,0xe,0x1d,0x3a,0xb0,0x6d,0xdb,0x36,0x6e,0xbf,0xfd,0xf6,0x1c, + 0x3b,0x4f,0x6c,0x6c,0x2c,0xaf,0xbf,0xfe,0xba,0x7a,0x7f,0x14,0x3e,0xd,0x12,0x9d, + 0xdf,0xe9,0xd8,0xf1,0x7e,0x2c,0x16,0x8b,0xd7,0xf7,0x6c,0xc4,0xfb,0x94,0xae,0xb8, + 0x54,0x52,0xb3,0xb1,0xfa,0xcc,0x11,0xd6,0xc5,0xc6,0x82,0x45,0xbf,0xda,0xa2,0xe4, + 0xcd,0xab,0x76,0xe5,0xd2,0xa1,0x4,0x4c,0x9a,0x2b,0xfe,0x15,0x8,0x87,0x99,0x3f, + 0x4e,0x1f,0xe2,0xde,0xa5,0xb3,0x39,0x74,0xe9,0x12,0x76,0x69,0xc3,0x2e,0xf5,0x2, + 0x11,0x7c,0xd4,0x5c,0x58,0x5e,0x38,0xab,0xd5,0xca,0xb2,0x65,0xcb,0xe8,0xdc,0xb9, + 0x33,0xff,0x8b,0xba,0x97,0x49,0x65,0xcd,0x9c,0x49,0x8c,0xcf,0x52,0x8,0x7,0x52, + 0xd2,0x58,0xd1,0xb9,0x11,0x97,0x57,0xee,0x60,0xf4,0x7b,0xff,0xe3,0xad,0xf7,0xde, + 0xe5,0xb3,0x9,0x13,0xd8,0x7a,0xfc,0x8,0xbf,0x44,0xd5,0x2,0x87,0xf4,0xae,0x3c, + 0xdd,0x41,0xc3,0x88,0xf2,0xf4,0x3e,0x94,0xc4,0x17,0x4b,0xbe,0x65,0xee,0x37,0xdf, + 0x64,0xd8,0xb5,0xa5,0x28,0x58,0x6d,0x4f,0x8,0xc1,0x8c,0x19,0x33,0xd8,0xb9,0x73, + 0x67,0x8e,0x9d,0xa7,0x75,0xeb,0xd6,0xcc,0x98,0x31,0x83,0x72,0xe5,0xca,0xe5,0x29, + 0x91,0x61,0x58,0x94,0xca,0x95,0x2b,0xc7,0xee,0xdd,0xbb,0x19,0x38,0x70,0x20,0x9f, + 0x7f,0xfe,0x39,0xba,0xae,0xfb,0xfc,0x5c,0xf3,0xe6,0xcd,0xa3,0x4f,0x9f,0x3e,0xd4, + 0xad,0x5b,0x37,0x4f,0xb7,0x85,0xbc,0x52,0x4e,0x41,0x7c,0xcf,0x3c,0xdb,0x7e,0x4a, + 0x4a,0xa,0x67,0xce,0x9c,0xe1,0xf4,0xe9,0xd3,0x5c,0xba,0x74,0x89,0x94,0x94,0x14, + 0x92,0x92,0x92,0x48,0x4a,0x4a,0x42,0x8,0x81,0xa6,0x69,0x84,0x84,0x84,0xe0,0xe7, + 0xe7,0x47,0xb1,0x62,0xc5,0x28,0x51,0xa2,0x4,0x25,0x4b,0x96,0x24,0x24,0x24,0x24, + 0x43,0xfd,0xe6,0xe7,0xfa,0x8e,0x8c,0x8c,0xcc,0x70,0xf,0xd7,0xbe,0x17,0x8f,0x5d, + 0x83,0x22,0xfd,0x23,0xa4,0x89,0x25,0xff,0xed,0x22,0x21,0x25,0xde,0x19,0x58,0x14, + 0x5c,0xa1,0x19,0xb2,0x29,0x7c,0xa4,0xc7,0xb9,0x5c,0x16,0x30,0x69,0x71,0x6e,0x2a, + 0x3b,0x7c,0xfe,0x28,0xa3,0x77,0xaf,0x66,0x5a,0xb3,0x87,0x9d,0xd1,0xe1,0x4d,0xe4, + 0xfb,0x70,0xd,0x85,0x42,0x60,0x19,0xd,0xcb,0x6c,0x36,0xb3,0x60,0xc1,0x2,0x86, + 0xe,0x19,0x42,0x5f,0xca,0xf3,0x5e,0x31,0x91,0xd5,0x82,0x20,0xd5,0xc6,0xdf,0x2d, + 0x6f,0x47,0x6c,0x3a,0xc8,0xea,0xd6,0xad,0xf1,0x2f,0x17,0xc1,0xea,0x7b,0x6b,0x65, + 0x54,0xe8,0x37,0xa0,0x6a,0xb1,0xdb,0xb8,0x6f,0xc3,0x1,0x76,0xc7,0xc5,0xf3,0xdd, + 0xb7,0xdf,0x62,0xb5,0x5a,0x55,0xa7,0x59,0x80,0x89,0x8f,0x8f,0x67,0xd4,0xa8,0x51, + 0x39,0x66,0xbd,0x7a,0xf5,0xd5,0x57,0x79,0xf7,0xdd,0x77,0x9,0xe,0xe,0xce,0x93, + 0x31,0xd3,0x3c,0x3b,0xf6,0x4f,0x3f,0xfd,0x94,0xa,0x15,0x2a,0xf0,0xea,0xab,0xaf, + 0xfa,0xfc,0x3c,0x17,0x2e,0x5c,0x60,0xd6,0xac,0x59,0xee,0x48,0xef,0x79,0xa1,0xe, + 0x32,0x1b,0xf8,0x8f,0x1c,0x39,0x42,0x74,0x74,0x34,0xfb,0xf7,0xef,0xe7,0xc8,0x91, + 0x23,0xc4,0xc5,0xc5,0x11,0x1f,0x1f,0x4f,0x5c,0x5c,0x1c,0xa9,0xa9,0xa9,0x4,0x6, + 0x6,0x52,0xa4,0x48,0x11,0x82,0x82,0x82,0x8,0xb,0xb,0xa3,0x46,0x8d,0x1a,0xee, + 0x9f,0x52,0xa5,0x4a,0x15,0x98,0xc1,0xdf,0x97,0xf5,0x6b,0xd4,0xc1,0xce,0x9d,0x3b, + 0x59,0xba,0x74,0x29,0xab,0x57,0xaf,0xe6,0xdc,0xb9,0x73,0xc4,0xc5,0xc5,0x11,0x17, + 0x17,0x47,0x52,0x52,0x12,0x36,0x9b,0xed,0xaa,0x77,0xd0,0x64,0x32,0x61,0x36,0x9b, + 0x9,0xa,0xa,0xa2,0x48,0x91,0x22,0x4,0x7,0x7,0x13,0x16,0x16,0x46,0x54,0x54, + 0x14,0xad,0x5b,0xb7,0x26,0x32,0x32,0x32,0xdf,0xd6,0x6f,0xa5,0x4a,0x55,0x28,0x5d, + 0xa6,0xb4,0x57,0x6d,0x45,0xba,0x3,0x7e,0xba,0xb4,0x93,0x4,0x4d,0xe8,0xc4,0xda, + 0xd2,0xf8,0x78,0xff,0x36,0x84,0xd9,0xe2,0x8a,0xb4,0x2e,0xd3,0xc7,0x3a,0x29,0xbd, + 0x37,0x50,0x18,0xe2,0x4a,0x78,0xee,0x38,0x74,0x95,0xe5,0x4a,0xf,0xd6,0x30,0xa2, + 0x1a,0xc3,0xeb,0x45,0x81,0x6e,0x7,0x61,0x72,0x59,0xd2,0xf2,0xf7,0x22,0xa1,0xb9, + 0xb0,0xbc,0x88,0x9e,0xc1,0x48,0x3f,0x18,0x3b,0x96,0x2e,0x5d,0xba,0xf0,0xc7,0xa0, + 0xc1,0xb4,0x3c,0xbe,0xce,0xf9,0x30,0xb3,0x92,0x0,0xd3,0xa4,0x91,0x68,0x12,0x9c, + 0x3e,0x7a,0x94,0xdb,0x42,0x83,0x49,0xb3,0x98,0x9c,0x51,0x6d,0x6f,0xdc,0x1b,0xa0, + 0x9,0xc1,0x24,0x4a,0xf3,0xcd,0xc9,0x4d,0x4c,0x9f,0x3e,0x5d,0x2d,0xb,0x16,0x82, + 0x76,0xf7,0xfe,0xfb,0xef,0x73,0xf8,0xf0,0xe1,0x1c,0x29,0xfb,0x95,0x57,0x5e,0x61, + 0xdc,0xb8,0x71,0x57,0xb5,0xf3,0xbc,0xfa,0xfe,0x1,0xc,0x19,0x32,0x84,0xb4,0xb4, + 0x34,0xde,0x72,0x65,0x28,0xf0,0x25,0x1f,0x7f,0xfc,0x31,0xef,0xbc,0xf3,0xe,0x61, + 0x61,0x61,0xb9,0x2e,0x3e,0x3c,0xcf,0x67,0x84,0x74,0xd1,0x75,0x9d,0xa3,0x47,0x8f, + 0xf2,0xe3,0x8f,0x3f,0x32,0x7f,0xfe,0x7c,0x36,0x6f,0xde,0x7c,0x53,0xe7,0x8,0xa, + 0xa,0xa2,0x4b,0x97,0x2e,0x74,0xef,0xde,0x9d,0xfb,0xee,0xbb,0xcf,0xbd,0xfc,0xe3, + 0xe9,0x7b,0x76,0xa3,0x7b,0x36,0x2,0xc7,0xde,0xd4,0xc0,0x61,0x36,0xdf,0x92,0xb6, + 0x76,0x65,0x1d,0x1b,0x82,0x75,0xcc,0x98,0x31,0xcc,0x9d,0x3b,0x37,0xcb,0x89,0xd2, + 0x1d,0xe,0x87,0x3b,0x80,0x6e,0x6c,0x6c,0xac,0xfb,0xf3,0x75,0xeb,0xd6,0x31,0x72, + 0xe4,0x48,0x0,0x9e,0x7f,0xfe,0x79,0x86,0xc,0x19,0x42,0xf5,0xea,0xd5,0x31,0x99, + 0x4c,0x99,0xfa,0xe0,0xe6,0x45,0xee,0xbe,0xfb,0x6e,0x22,0x4a,0x85,0xbb,0xaf,0x55, + 0xd3,0xb4,0x6b,0x5e,0xb3,0x11,0x1c,0x1,0x21,0x91,0x3a,0x48,0x87,0x44,0xb3,0x68, + 0xc,0xfe,0x73,0x31,0xd8,0x25,0xd2,0xec,0x12,0x48,0xda,0x15,0x6,0x87,0x2c,0x75, + 0x2,0x57,0x58,0xb0,0x8c,0xf,0x34,0x41,0x84,0x35,0x98,0xcf,0x9a,0xdf,0x4f,0xf9, + 0x22,0xa1,0xe8,0x38,0x63,0x62,0x39,0xbf,0x96,0xbf,0x4d,0x58,0x5,0xda,0x7,0xeb, + 0x5a,0x1d,0x7d,0x60,0x60,0x20,0xb,0x16,0x2c,0xe0,0xed,0xd1,0xa3,0x98,0x28,0xcb, + 0x10,0x1e,0x54,0xd4,0x3b,0x93,0xa7,0x94,0x60,0xd2,0xa8,0xbd,0xe7,0x4,0x15,0x2e, + 0x24,0x71,0xe8,0xbd,0x9e,0x94,0x2c,0x51,0x82,0x6,0xbf,0xfd,0x93,0xfe,0xef,0xd7, + 0x7e,0x93,0xb9,0xe3,0xb6,0xd2,0xfc,0x14,0x54,0x93,0x8f,0xa7,0x7f,0xc9,0xc4,0x89, + 0x13,0x33,0xbc,0xac,0x8a,0x82,0x37,0xb3,0x6,0x38,0x7d,0xfa,0x34,0xef,0xbf,0xff, + 0x7e,0x8e,0x9c,0xa3,0x77,0xef,0xde,0xf9,0x2e,0x2f,0x9f,0x21,0x3c,0xde,0x7c,0xf3, + 0x4d,0x3e,0xfd,0xf4,0xd3,0x1c,0x39,0x47,0xff,0xfe,0xfd,0x6f,0xa9,0x88,0x3c,0x7e, + 0xfc,0x38,0x2b,0x56,0xac,0xe0,0xe5,0x97,0x5f,0xa6,0x54,0xa9,0x52,0x54,0xad,0x5a, + 0x95,0x37,0xde,0x78,0xe3,0xa6,0xc5,0x15,0x40,0x62,0x62,0x22,0x5f,0x7d,0xf5,0x15, + 0x1d,0x3b,0x76,0xc4,0xdf,0xdf,0x9f,0xe7,0x9e,0x7b,0x8e,0xe5,0xcb,0x97,0x13,0x13, + 0x13,0x73,0xcd,0x30,0x32,0x57,0xf2,0xf2,0xcb,0x2f,0x63,0xb5,0x5a,0x6f,0xea,0x27, + 0x26,0x26,0xe6,0x96,0x8a,0xab,0x23,0x47,0x8e,0x30,0x7d,0xfa,0x74,0xee,0xbd,0xf7, + 0x5e,0x2a,0x55,0xaa,0xc4,0x94,0x29,0x53,0xb2,0x2c,0xae,0xbc,0x65,0xc6,0x8c,0x19, + 0xd4,0xae,0x5d,0x9b,0x7a,0xf5,0xea,0xf1,0xe5,0x97,0x5f,0x72,0xf4,0xe8,0xd1,0xab, + 0x44,0x6d,0x5e,0xa4,0x46,0x8d,0x1a,0xf8,0xf9,0xf9,0x67,0x48,0x20,0x7f,0xed,0xf1, + 0x46,0xb8,0xec,0x58,0x4e,0xb1,0x65,0x36,0x6b,0x1c,0xba,0x14,0xcb,0xc2,0x63,0xfb, + 0x9d,0xc1,0xb7,0x75,0x81,0x4f,0x73,0xd9,0x48,0x99,0x6e,0x2a,0xd3,0x75,0x46,0x34, + 0x6e,0xc1,0x3d,0xe1,0x15,0xd0,0x75,0x89,0x26,0x25,0x1a,0x46,0x94,0x78,0xe5,0xe4, + 0x9e,0x2f,0x7,0xbf,0x80,0x80,0x0,0x7e,0x5e,0xbe,0x9c,0x9d,0x9b,0x36,0xd3,0xe7, + 0xa4,0xd,0xb3,0xd9,0x7c,0xe3,0x6,0xe1,0x67,0xa6,0xe5,0xae,0x53,0x94,0xfb,0xf7, + 0x14,0xcb,0x5b,0xdd,0xe,0xa9,0x69,0x2c,0xbd,0xab,0x2,0xa5,0x8b,0x86,0x51,0x77, + 0xc9,0xdf,0x10,0x1c,0x90,0xb9,0xc8,0x92,0x92,0xba,0xa5,0xca,0xd1,0x65,0xe7,0x69, + 0xbe,0x5d,0xbc,0x88,0xef,0xe7,0xcd,0xcb,0xb0,0x9c,0xa3,0x28,0xb8,0xe4,0xd4,0x60, + 0xff,0xda,0x6b,0xaf,0x31,0x65,0xca,0x94,0x7c,0x31,0x93,0xce,0x4c,0x84,0x48,0x29, + 0x79,0xf9,0xe5,0x97,0x79,0xfb,0xed,0xb7,0x7d,0x7e,0x8e,0xb9,0x73,0xe7,0xb2,0x6b, + 0xd7,0xae,0x5c,0x19,0x0,0x3d,0xcb,0xdf,0xbf,0x7f,0x3f,0xcf,0x3e,0xfb,0x2c,0x6d, + 0xdb,0xb6,0xa5,0x63,0xc7,0x8e,0x4c,0x9a,0x34,0x89,0xb,0x17,0x2e,0xe4,0xe8,0xf9, + 0xbf,0xfa,0xea,0x2b,0x3a,0x75,0xea,0x44,0xdb,0xb6,0x6d,0x19,0x33,0x66,0x8c,0x57, + 0x3,0x7f,0x60,0x60,0xe0,0x4d,0x9f,0xd7,0x17,0x31,0xd4,0xb2,0x2a,0xca,0x85,0x10, + 0x24,0x26,0x26,0x32,0x68,0xd0,0x20,0xda,0xb4,0x69,0x43,0xaf,0x5e,0xbd,0x58,0xbb, + 0x76,0x6d,0xae,0x5d,0xc7,0xde,0xbd,0x7b,0xe9,0xd3,0xa7,0xf,0x51,0x51,0x51,0xf4, + 0xef,0xdf,0x9f,0xc4,0xc4,0xc4,0x3c,0xfb,0xde,0x15,0x2d,0x1a,0x42,0x83,0x6,0xf5, + 0xaf,0x12,0x55,0x37,0x7a,0x1f,0xa4,0x3b,0xa7,0x20,0x8c,0xdd,0xb9,0x8e,0x44,0x5d, + 0xa6,0x87,0xba,0x92,0xc6,0xf2,0x5e,0x76,0xfd,0xaf,0x3c,0x97,0x14,0x5d,0x7d,0x56, + 0x52,0x12,0x13,0x1b,0xb7,0xa6,0x67,0xcd,0xbb,0xd0,0x75,0x87,0x3b,0x28,0xa9,0x14, + 0xd2,0x19,0x28,0x3e,0x9f,0xdb,0x1f,0xa,0xa5,0xc0,0x32,0x3a,0xa0,0xa0,0xa0,0x20, + 0xc6,0x7f,0xfc,0x31,0xdb,0xff,0xf8,0x93,0xd5,0x65,0x9b,0x82,0x3d,0xed,0xba,0x96, + 0xab,0xd6,0xbb,0xcf,0x62,0xdd,0xbe,0x9f,0x15,0x5d,0x9b,0x62,0xb7,0x38,0x3,0x97, + 0x4a,0x60,0x59,0xa3,0x72,0x34,0xae,0x54,0x95,0x3b,0xa6,0x2e,0x5,0x3f,0xeb,0x55, + 0xd,0x50,0x13,0x1a,0x63,0x6c,0xc5,0xd9,0xbf,0x7b,0xf,0xb3,0x67,0xcf,0x76,0x8b, + 0x2b,0x65,0xbd,0x2a,0xd8,0x6d,0x6c,0xd7,0xae,0x5d,0xfc,0xfe,0xfb,0xef,0x3e,0x2f, + 0xbb,0x4d,0x9b,0x36,0xbc,0xf3,0xce,0x3b,0xf9,0x4e,0x5c,0x65,0x36,0x8b,0x7e,0xef, + 0xbd,0xf7,0x72,0x24,0x56,0x96,0x91,0x40,0x3b,0x37,0x42,0x53,0x9c,0x3c,0x79,0x92, + 0x6e,0xdd,0xba,0x51,0xb3,0x66,0x4d,0x66,0xcf,0x9e,0xcd,0xbe,0x7d,0xfb,0x72,0x7d, + 0xf2,0xb4,0x7b,0xf7,0x6e,0xde,0x78,0xe3,0xd,0x2a,0x54,0xa8,0xc0,0xba,0x75,0xeb, + 0xdc,0x7d,0x5c,0x7e,0x9f,0xc4,0x79,0xfa,0x58,0x4d,0x99,0x32,0x85,0xe0,0xe0,0x60, + 0x26,0x4c,0x98,0xc0,0x81,0x3,0x7,0x6e,0xd9,0x35,0x1d,0x3e,0x7c,0x98,0xcf,0x3f, + 0xff,0x9c,0xf2,0xe5,0xcb,0xb3,0x64,0xc9,0x12,0xaf,0x84,0x4b,0x6e,0x53,0xb6,0x6c, + 0x19,0x1a,0x35,0xba,0xd3,0xeb,0xc8,0xed,0x4e,0x97,0x28,0xa7,0xbf,0x93,0x26,0x60, + 0x67,0xec,0x29,0x56,0xc4,0x1c,0xc4,0xad,0xae,0x34,0xed,0xea,0x28,0xed,0x59,0x11, + 0x56,0x18,0xc7,0x19,0xd7,0x23,0x91,0x29,0x76,0xfa,0xd5,0xbf,0x87,0xde,0x75,0x9b, + 0xa1,0x3b,0x1c,0x48,0xe1,0x8c,0xff,0xe8,0xe,0xcf,0x50,0x0,0xd2,0xe5,0x14,0x1a, + 0x1f,0xac,0x6b,0x75,0xf2,0xc1,0xc1,0xc1,0xcc,0x99,0x33,0x87,0xd6,0x6d,0xda,0xf0, + 0xc3,0x6b,0xaf,0xd1,0x27,0xed,0x28,0xb1,0x49,0x9,0x1e,0x5b,0x4a,0x9d,0xaa,0xbb, + 0xc9,0xd1,0xcb,0xb0,0xeb,0x5f,0x7e,0x7d,0xee,0x3e,0x48,0xb3,0xa7,0x67,0xd,0x7, + 0x70,0xe8,0x4c,0x6f,0x70,0x1b,0x4f,0x52,0x9f,0x2a,0xdb,0x37,0xb3,0xaf,0x4d,0x13, + 0xf6,0x1f,0x4f,0x2,0xa1,0x11,0x16,0x16,0xc0,0x94,0x90,0x8a,0x7c,0x32,0x76,0x32, + 0xdf,0x7d,0x3f,0xcf,0x6d,0x29,0x53,0xe2,0xaa,0x60,0x23,0xa5,0x64,0xd6,0xac,0x59, + 0x5c,0xba,0x74,0xc9,0xa7,0xe5,0x46,0x44,0x44,0x30,0x79,0xf2,0x64,0x82,0x83,0x83, + 0xf3,0x75,0x3b,0x32,0x3a,0x7c,0x93,0xc9,0xc4,0xf,0x3f,0xfc,0xc0,0xe8,0xd1,0xa3, + 0x7d,0x6a,0x15,0x9,0x9,0x9,0x21,0x36,0x36,0x96,0x62,0xc5,0x8a,0xe5,0xc8,0x80, + 0xf,0x70,0xe2,0xc4,0x9,0xbe,0xfc,0xf2,0x4b,0x46,0x8c,0x18,0x91,0x67,0xea,0xf5, + 0xd8,0xb1,0x63,0xb4,0x68,0xd1,0x82,0xd7,0x5e,0x7b,0x8d,0x61,0xc3,0x86,0x51,0xb4, + 0x68,0xd1,0x7c,0x29,0xc2,0x3d,0x85,0xd5,0x8e,0x1d,0x3b,0x18,0x32,0x64,0x48,0x8e, + 0x4c,0x56,0x6e,0x86,0xd8,0xd8,0x58,0x1e,0x7c,0xf0,0x41,0x7a,0xf7,0xee,0xcd,0xc8, + 0x91,0x23,0xb9,0xed,0xb6,0xdb,0xf2,0xcc,0xb5,0x95,0x29,0x53,0x96,0x80,0x80,0x0, + 0xe7,0x4,0x5f,0x4b,0x8f,0xb6,0x7e,0x55,0x5b,0x30,0x1c,0xc9,0x75,0x67,0x1e,0x40, + 0x23,0xb1,0xf3,0xaa,0xe3,0x47,0x39,0x95,0x10,0x97,0x51,0xe1,0x8,0xcd,0x38,0xc0, + 0x7b,0xe5,0xe3,0x99,0xd3,0xd0,0xb0,0x80,0x9,0x81,0x74,0x48,0x9a,0x94,0x2a,0xcd, + 0xbb,0x8d,0xee,0xc3,0x2c,0x9d,0xf1,0xe1,0x9d,0x31,0x2a,0x35,0xb7,0xbb,0x7d,0x41, + 0x48,0x97,0x53,0x68,0x5,0x96,0xe7,0x8b,0x5c,0xb4,0x68,0x51,0x7e,0x5d,0xb9,0x92, + 0x7e,0x2f,0xf6,0xe5,0xe5,0xa6,0x8d,0x18,0x5f,0xdc,0x9f,0x84,0xb4,0x54,0x67,0x83, + 0x30,0xb,0x1e,0x3a,0xa3,0x73,0x69,0xe3,0x2e,0x7e,0xef,0xd4,0x18,0x6c,0x8e,0xab, + 0x15,0xbc,0x10,0x90,0xe6,0xe0,0x9b,0x3a,0x25,0xe8,0xb4,0xc3,0x41,0xd5,0xf9,0x1b, + 0x88,0x1a,0xfc,0x2,0x5f,0xec,0xdf,0x4e,0xd4,0xe1,0x63,0xcc,0xf9,0x7d,0x2d,0x73, + 0xe6,0x7e,0x43,0x68,0x68,0xa8,0xb2,0x5c,0x15,0x92,0x36,0x75,0xf6,0xec,0x59,0xe6, + 0xcf,0x9f,0xef,0xf3,0xb2,0xbf,0xfe,0xfa,0x6b,0xaa,0x54,0xa9,0x52,0x20,0xda,0x91, + 0x21,0xb2,0x82,0x83,0x83,0x19,0x3d,0x7a,0x74,0x8e,0xe,0xd4,0xbe,0x2e,0x6b,0xe2, + 0xc4,0x89,0x4c,0x9a,0x34,0x89,0xe8,0xe8,0xe8,0x3c,0x59,0xb7,0x63,0xc7,0x8e,0x65, + 0xed,0xda,0xb5,0xcc,0x98,0x31,0x83,0x5a,0xb5,0x6a,0xe5,0xab,0xf6,0xe2,0x79,0xad, + 0xc3,0x87,0xf,0xe7,0xf3,0xcf,0x3f,0xcf,0xe0,0x80,0x9e,0xd7,0x98,0x3a,0x75,0x2a, + 0x1b,0x37,0x6e,0xe4,0xb3,0xcf,0x3e,0x73,0xa7,0xa5,0xb9,0x95,0x58,0x2c,0x16,0x5a, + 0xb6,0xbc,0x97,0xa0,0xa0,0x20,0xf,0xcb,0x15,0x99,0x4f,0xc8,0x5c,0xa2,0x4a,0x17, + 0x12,0x5d,0x7,0x4d,0x8,0xce,0xd9,0x92,0xf8,0xe6,0xd0,0x2e,0x6c,0xe,0xa7,0x3, + 0xfa,0x55,0x7,0x78,0xd3,0x8c,0xc,0xdf,0x74,0x91,0x71,0x49,0x51,0x8,0x1d,0x69, + 0x97,0xf8,0x59,0xcc,0x7c,0xd7,0xaa,0x2b,0xb7,0x59,0x3,0x91,0xc2,0xb9,0xca,0x93, + 0x6e,0xe9,0x72,0x5a,0xd3,0xa,0x42,0x3a,0xc2,0x42,0xb9,0x44,0x98,0x59,0x27,0x1f, + 0x12,0x12,0xc2,0xa4,0x29,0x93,0xd9,0xf9,0xc7,0x3a,0x96,0x44,0xdc,0x9,0xb6,0x54, + 0xd0,0x4,0xcf,0x5d,0xf6,0xe3,0xd8,0x37,0xb,0x59,0xd3,0xbd,0x5,0xd2,0xdf,0x7a, + 0xed,0xf5,0x67,0x57,0xf4,0xd9,0xa5,0xf5,0xc2,0xa9,0x14,0x71,0x7,0xbb,0xfa,0x8e, + 0x63,0xa6,0xad,0x1a,0x8e,0xb5,0xc7,0x99,0xbf,0x70,0x1,0x25,0x4a,0x94,0x50,0xe2, + 0xaa,0x10,0xb5,0xa9,0x2d,0x5b,0xb6,0xb8,0x9d,0x61,0x7d,0xc5,0x2b,0xaf,0xbc,0xc2, + 0x7d,0xf7,0xdd,0x57,0xe0,0xea,0x2a,0x3f,0x94,0x6f,0xbc,0xbb,0xa9,0xa9,0xa9,0x74, + 0xe9,0xd2,0x85,0x81,0x3,0x7,0xe6,0x59,0x71,0x65,0xf0,0xf7,0xdf,0x7f,0x73,0xe7, + 0x9d,0x77,0xb2,0x79,0xf3,0xe6,0x7c,0x13,0xe1,0xde,0xa8,0xe7,0xa4,0xa4,0x24,0x9a, + 0x37,0x6f,0xce,0xa8,0x51,0xa3,0xf2,0xb4,0xb8,0x32,0xd8,0xb1,0x63,0x7,0x1d,0x3a, + 0x74,0x60,0xd3,0xa6,0x4d,0xb7,0x3c,0xa6,0xa1,0xa6,0x69,0xd4,0xa8,0x51,0x3d,0xd3, + 0x1d,0xa6,0xd7,0xd2,0x41,0x46,0x70,0x51,0x4d,0x13,0xfc,0x7a,0xf0,0x3f,0xb6,0x9c, + 0x3b,0xe1,0x5a,0xa5,0xd1,0xf0,0x2e,0x64,0xfb,0x95,0x2f,0xde,0x15,0x79,0x4,0x8d, + 0x5,0x21,0x87,0x3,0x1c,0x69,0x6c,0x7d,0xe8,0x45,0x2a,0x86,0x84,0x61,0x17,0x12, + 0x29,0x4,0x1a,0xc2,0x29,0xb2,0x32,0x5c,0x94,0x12,0x58,0x5,0xaa,0x93,0xf,0x9, + 0x9,0xe1,0xcb,0x2f,0xbf,0x64,0xc8,0x6b,0xaf,0xb1,0xb6,0x46,0x1b,0x1a,0x9d,0x4f, + 0xc5,0xb6,0x7c,0x2d,0xdb,0x5e,0x7f,0x3c,0x3d,0xc,0xc3,0x8d,0x3a,0x6c,0x5d,0x32, + 0xb1,0x7a,0x0,0x8d,0x6a,0xde,0xc1,0x90,0xbe,0x2f,0x33,0xf1,0xb3,0x89,0x58,0x2c, + 0x16,0x25,0xae,0xa,0x9,0x46,0x47,0x36,0x61,0xc2,0x4,0x9f,0x96,0x5b,0xb1,0x62, + 0x45,0xde,0x7a,0xeb,0xad,0x3c,0x19,0xe7,0xaa,0xb0,0xf4,0x11,0xfb,0xf6,0xed,0xa3, + 0x5e,0xbd,0x7a,0x2c,0x58,0xb0,0x20,0x47,0x2,0xa5,0xe6,0x4,0xc9,0xc9,0xc9,0xb4, + 0x6e,0xdd,0x9a,0x3f,0xff,0xfc,0x33,0x4f,0xb7,0x19,0x4f,0x47,0xf6,0xc3,0x87,0xf, + 0x13,0x19,0x19,0xc9,0xfa,0xf5,0xeb,0xf3,0x95,0xf,0x59,0x42,0x42,0x2,0x4d,0x9a, + 0x34,0xc9,0x55,0xc7,0xfb,0xcc,0x8,0xe,0x2e,0x42,0xc5,0x8a,0x15,0xae,0xaa,0xd7, + 0xcc,0x75,0x90,0x74,0xaf,0xf8,0x69,0x8,0x92,0x53,0x52,0x98,0x76,0x68,0x1b,0x38, + 0xd2,0x5c,0xd6,0x2b,0x3d,0x7b,0x8a,0xc7,0xc8,0xb7,0xa3,0xbb,0x9e,0x9f,0xeb,0x75, + 0xb1,0x98,0x2c,0x4c,0x6f,0xd5,0x95,0xdb,0x8b,0x84,0x61,0x93,0x3a,0x42,0xba,0xa2, + 0x6b,0x9,0xe9,0x32,0x8e,0x89,0x6c,0xe9,0x39,0x25,0xb0,0xf2,0xc9,0xe0,0x58,0xbc, + 0x78,0x71,0xd6,0xac,0x59,0xc3,0xc0,0xc1,0xaf,0x50,0x69,0xcd,0xe,0x22,0x6,0x3f, + 0xf,0xc9,0xa9,0xde,0x39,0xf6,0x49,0x9,0x7e,0x16,0xc2,0x77,0x1c,0xe1,0xe0,0xb1, + 0xa3,0xee,0x0,0x90,0x37,0x9a,0x45,0x28,0xa,0xd6,0x40,0x7c,0xe6,0xcc,0x19,0x7e, + 0xfd,0xf5,0x57,0x9f,0xce,0x48,0xfb,0xf6,0xed,0x9b,0xe3,0xf9,0xfc,0x14,0xd7,0x16, + 0xcc,0xdf,0x7f,0xff,0x3d,0x8d,0x1b,0x37,0x66,0xff,0xfe,0xfd,0xf9,0xee,0x1e,0xe2, + 0xe2,0xe2,0x78,0xf8,0xe1,0x87,0x7d,0x12,0x26,0x22,0xa7,0xdf,0x9d,0xbf,0xff,0xfe, + 0x9b,0xa8,0xa8,0x28,0xb6,0x6e,0xdd,0x9a,0x6f,0xdb,0x4c,0xe7,0xce,0x9d,0x6f,0xe9, + 0xf9,0x1b,0x35,0xba,0x8b,0x5a,0xb5,0x6e,0x7,0x64,0x86,0x8,0xee,0xee,0x36,0xed, + 0xfa,0xbf,0x74,0x19,0xc,0x9c,0x22,0x4b,0x60,0x12,0x82,0x55,0x67,0x8f,0xf2,0xc7, + 0xe1,0x68,0xf0,0xb,0x4a,0xf7,0x9f,0xf2,0x5a,0xf0,0x48,0x8f,0xf4,0x36,0x1e,0x9, + 0x9e,0x8d,0x25,0x4a,0x29,0x79,0xb1,0xd6,0x9d,0x3c,0x5e,0xb9,0x1e,0xd2,0x64,0xc2, + 0x2c,0x4c,0xce,0xd8,0x5c,0xc2,0x95,0xd8,0x19,0x8f,0x28,0xf2,0xc2,0xcb,0xf3,0x71, + 0xe5,0xb5,0xc9,0x4c,0x7f,0x55,0x2,0x2b,0xf,0x11,0x1d,0x1d,0xcd,0x99,0x33,0x67, + 0xd0,0xfd,0xad,0xb4,0x94,0x41,0xd7,0xde,0x5d,0x78,0xf5,0x48,0x48,0xf8,0xde,0x63, + 0xd4,0xdf,0x79,0x8c,0xef,0x7e,0xf8,0x9e,0x37,0xde,0x78,0x83,0x46,0x8d,0x1a,0xd1, + 0xb4,0x69,0x53,0x25,0xb2,0xa,0xd1,0x60,0xfc,0xd1,0x47,0x1f,0xf9,0xb4,0xdc,0xb0, + 0xb0,0x30,0xfa,0xf4,0xe9,0xe3,0x6e,0x43,0x8a,0xdc,0x7b,0x9e,0x42,0x8,0xe6,0xcd, + 0x9b,0xc7,0x93,0x4f,0x3e,0x49,0x42,0x42,0x42,0xbe,0xbd,0x97,0xb,0x17,0x2e,0xd0, + 0xaa,0x55,0x2b,0xce,0x9e,0x3d,0x7b,0xe3,0x90,0x34,0xb7,0xa8,0x9e,0xff,0xfe,0xfb, + 0x6f,0x1e,0x79,0xe4,0x11,0x9f,0x2f,0xad,0x17,0x36,0x4a,0x97,0x8e,0x20,0x28,0x28, + 0x10,0x5d,0xcf,0x3c,0x3d,0x8e,0x73,0xf5,0xce,0x25,0xac,0xf0,0xb4,0x4f,0x9,0x6, + 0x6f,0x5c,0xa,0x7e,0x1,0x1e,0xce,0xe9,0x2e,0xb5,0xe3,0x4d,0xc,0x2c,0xc3,0x6a, + 0x25,0x85,0xc7,0x8e,0x41,0x57,0xf0,0x52,0x9b,0x9d,0x26,0x25,0x4a,0xf3,0xe9,0xdd, + 0xf7,0xe3,0x67,0x4e,0xf,0xbf,0x20,0xd0,0x9c,0xe2,0x4a,0x64,0xdd,0xa9,0x5d,0x4a, + 0x8f,0xd4,0x3e,0x86,0x13,0xbd,0x14,0x6e,0x7d,0x27,0xc5,0xad,0x1f,0x6b,0xcd,0xaa, + 0x39,0x66,0x7c,0xc9,0xb7,0x6e,0xdd,0xca,0xf3,0xcf,0x3f,0x4f,0x74,0x74,0x34,0xa9, + 0xa9,0xa9,0xb4,0x6f,0xdf,0x9e,0x3d,0xd3,0x67,0x50,0x6f,0xc7,0x32,0x67,0x9a,0x85, + 0x6b,0x6c,0x73,0x45,0x13,0x84,0x9e,0xbb,0xcc,0xbd,0xff,0x1c,0x67,0xd2,0xb7,0xdf, + 0x12,0x18,0x18,0x88,0x94,0x92,0xbe,0x7d,0xfb,0x62,0xb1,0x58,0x78,0xf0,0xc1,0x7, + 0x99,0x3b,0x77,0xae,0xa,0xd1,0x50,0x80,0x31,0x9e,0xe9,0x8c,0x19,0x33,0x7c,0x5a, + 0xee,0xd0,0xa1,0x43,0x9,0x9,0x9,0x51,0xed,0xe6,0x16,0x3c,0xcf,0xd9,0xb3,0x67, + 0xf3,0xec,0xb3,0xcf,0x16,0x88,0xfb,0x49,0x48,0x48,0xe0,0xde,0x7b,0xef,0xe5,0x9e, + 0x7b,0xee,0xc9,0x73,0xfd,0xee,0xa1,0x43,0x87,0xe8,0xdc,0xb9,0x33,0x67,0xcf,0x9e, + 0x55,0xd,0xef,0x26,0x89,0x6a,0x15,0x75,0xdd,0xc9,0x98,0x7b,0xf5,0xe,0x10,0x52, + 0x47,0x22,0xd0,0x80,0x1f,0x8e,0xee,0xe1,0x78,0x5c,0x22,0x42,0xd3,0x90,0x9e,0xa9, + 0x70,0xbc,0x4d,0x89,0xe3,0xe,0x5c,0xe5,0x4a,0xd4,0x6c,0xac,0x3d,0x3a,0xa0,0x42, + 0x40,0x10,0xbf,0x75,0x7a,0x6,0xe9,0x8c,0x2b,0x8a,0xc9,0x44,0xba,0xa0,0x72,0x39, + 0xb5,0x7b,0x25,0xb2,0x5c,0xd6,0xb6,0x74,0xff,0x79,0xe1,0x5c,0x86,0x74,0x1f,0x76, + 0xb5,0xa3,0xfc,0xad,0xec,0x37,0x95,0x5,0xcb,0xe3,0x25,0xdf,0xbd,0x7b,0x37,0xef, + 0xbc,0xf3,0xe,0xb,0x17,0x2e,0xa4,0x68,0xd1,0xa2,0x94,0x2c,0x59,0x92,0xc5,0x8b, + 0x17,0xd3,0xff,0x95,0x41,0xf4,0x49,0xa,0x4,0xa1,0x5f,0xed,0xe4,0x2e,0x25,0x58, + 0xcd,0x94,0x3b,0x76,0x81,0x36,0xbf,0xef,0x61,0xc4,0x27,0x1f,0xb9,0xb7,0x86,0x1b, + 0xb3,0x87,0x9e,0x3d,0x7b,0xd2,0xb1,0x63,0x47,0x5e,0x7a,0xe9,0x25,0xd2,0xd2,0xd2, + 0x94,0x25,0xeb,0xa,0x8b,0xcf,0xad,0x2e,0xc3,0x97,0xec,0xda,0xb5,0x8b,0xc4,0xc4, + 0x44,0x9f,0x95,0x67,0xb5,0x5a,0x19,0x32,0x64,0x88,0xb2,0x5e,0xdd,0x82,0x76,0x39, + 0x67,0xce,0x9c,0x2,0x23,0xae,0xc,0xa2,0xa3,0xa3,0x99,0x35,0x6b,0x56,0x9e,0xea, + 0x77,0x4f,0x9f,0x3e,0x4d,0x87,0xe,0x1d,0x94,0xb8,0xf2,0x11,0x9d,0x1f,0xec,0xe4, + 0x55,0xdf,0x28,0xa4,0x33,0xd,0xa0,0x43,0xd7,0x49,0xb6,0xdb,0xf8,0x7e,0xff,0x76, + 0x92,0xed,0x20,0xaf,0x4c,0xe6,0xec,0x6d,0xbf,0xe3,0xde,0xf9,0xe7,0x74,0x5a,0xc7, + 0xe5,0x63,0x55,0xcc,0x3f,0x80,0x1f,0x3b,0x3e,0x45,0xa0,0xd9,0xc,0x42,0xb8,0x37, + 0x1,0x48,0x61,0x88,0x3d,0x91,0xee,0x7f,0x75,0xe3,0x59,0x8f,0xdb,0xf2,0xe6,0xfc, + 0xab,0x53,0x5c,0xa5,0x39,0x1c,0xce,0x58,0x5a,0x52,0x4f,0x37,0xb8,0x89,0x5b,0x1f, + 0x27,0x50,0x85,0x69,0xf0,0x70,0xac,0xec,0xda,0xb5,0x2b,0xf3,0xe7,0xcf,0xa7,0x5a, + 0xb5,0x6a,0xee,0xc6,0x59,0xa6,0x4c,0x19,0xbe,0xff,0xe1,0x7,0x1e,0x7f,0xee,0x59, + 0x66,0xf6,0x7a,0x81,0x9e,0x17,0xf6,0xe0,0xf0,0x6c,0x7c,0x26,0x8d,0xca,0x87,0xce, + 0x51,0xe6,0xb7,0xad,0x7c,0xbe,0x60,0x1,0x25,0x4b,0x96,0xcc,0x34,0xc1,0x6b,0x9f, + 0x3e,0x7d,0xf0,0xf7,0xf7,0xa7,0x59,0xb3,0x66,0x19,0x76,0xf5,0x14,0xe6,0x41,0x53, + 0x8,0x1,0x76,0xd8,0x71,0x4c,0x72,0xe4,0x9c,0x9d,0xc3,0xe7,0xed,0x9c,0x88,0xb5, + 0x93,0x90,0xa4,0xb1,0x35,0x6c,0x9,0x49,0x96,0x58,0x84,0x74,0xc6,0x45,0xa9,0x98, + 0xd0,0x90,0x5a,0xe2,0x76,0x4a,0x14,0x15,0x54,0x28,0x61,0xa6,0xca,0x6d,0x16,0x6a, + 0x97,0x11,0x4,0x4,0x8a,0x4c,0x9f,0xe7,0xad,0x62,0xfd,0xfa,0xf5,0xd8,0x6c,0x36, + 0x9f,0x95,0x37,0x68,0xd0,0x20,0xcc,0x66,0xb3,0xb2,0x5e,0xe5,0x72,0x7f,0xf0,0xd7, + 0x5f,0x7f,0xd1,0xb7,0x6f,0xdf,0x2,0x79,0x8f,0x9e,0xa9,0x53,0x6e,0xf5,0xfb,0x9f, + 0x98,0x98,0x48,0x87,0xe,0x1d,0xf2,0xa5,0x6f,0x5b,0x5e,0xa4,0x6a,0xe5,0x1a,0x14, + 0x2d,0x1a,0xe2,0xde,0x84,0x91,0xd9,0x64,0xde,0xb9,0x78,0xe7,0x14,0x26,0x9a,0x90, + 0x60,0x17,0x1c,0x4e,0x8e,0xe3,0xc7,0xe3,0xfb,0xc1,0x6c,0x71,0xf9,0x43,0x65,0xa3, + 0xaf,0x11,0x19,0xb5,0x16,0x8,0x30,0x6b,0xbc,0x7f,0x67,0x14,0xd,0x8a,0x87,0x63, + 0x77,0x8,0x2c,0x26,0xe7,0xe7,0x46,0x62,0xe9,0x2b,0x8f,0xcb,0xc2,0x8b,0x9a,0x9e, + 0xd8,0x47,0xea,0x68,0x40,0x82,0xc3,0x4e,0xb0,0x66,0x75,0x8a,0x3b,0x91,0x37,0x26, + 0xdf,0x85,0x5a,0x60,0x19,0x9d,0xe9,0xd1,0xa3,0x47,0x89,0x8a,0x8a,0x62,0xcd,0x9a, + 0x35,0x54,0xac,0x58,0xf1,0xaa,0xc1,0xac,0x44,0x89,0x12,0xcc,0xfe,0x62,0x2a,0xcf, + 0x76,0xeb,0x8e,0x7c,0x3c,0x12,0x2,0xfd,0xdd,0x66,0xd3,0x12,0x17,0x12,0xa8,0xbb, + 0x6e,0x2f,0xd3,0x7f,0xfa,0x89,0x62,0xc5,0x8a,0x5d,0x73,0x20,0x94,0x52,0xd2,0xa3, + 0x47,0xf,0xfc,0xfd,0xfd,0x89,0x8c,0x8c,0x64,0xd9,0xb2,0x65,0x14,0x29,0x52,0xa4, + 0xc0,0xf,0x9c,0x9e,0xf7,0xe7,0x70,0x48,0xd2,0x1c,0xf0,0xdf,0x85,0x4,0x96,0xfc, + 0x93,0xcc,0xda,0xe8,0x54,0x56,0x16,0xf9,0xc,0xf0,0x4f,0x4f,0xc7,0x20,0x4,0x58, + 0x24,0x24,0x98,0x3d,0x66,0x44,0x92,0xdd,0x2c,0x63,0x29,0x4b,0xe0,0x3c,0xce,0x9f, + 0x68,0x40,0x87,0x60,0x47,0x69,0x7a,0x85,0x76,0xe1,0xbe,0x3a,0x16,0xee,0xa9,0x1a, + 0x40,0x90,0xc9,0x8a,0xc5,0x9c,0xf5,0x60,0xc3,0xbe,0x62,0xe3,0xc6,0x8d,0xce,0xa5, + 0x64,0x1f,0x61,0xa4,0xda,0x51,0xe2,0x2a,0xf7,0xda,0xea,0xa5,0x4b,0x97,0x68,0xd7, + 0xae,0x5d,0xbe,0xf6,0xb9,0xca,0xf,0x75,0xad,0xeb,0x3a,0x83,0x6,0xd,0x62,0xfb, + 0xf6,0xed,0xaa,0x42,0x7c,0xc4,0x13,0x4f,0x3c,0x9e,0x79,0x7d,0xbb,0x2,0x77,0x4a, + 0x57,0xa0,0x50,0x21,0x9c,0x4b,0x75,0xba,0x0,0xb3,0x55,0x63,0xf4,0xc6,0x3f,0xc1, + 0xae,0x83,0x49,0x77,0x5a,0xb0,0xdc,0xf1,0xab,0x6e,0xbc,0x64,0x77,0xd5,0x32,0xa2, + 0x94,0x8,0x7,0x48,0x4d,0xe7,0xb1,0x12,0x35,0xe8,0x5d,0xfb,0x2e,0xec,0xba,0x8e, + 0xb3,0x58,0x91,0x7e,0xd8,0x8d,0xda,0x8,0xb8,0x1d,0xf0,0x45,0xfa,0x7,0xce,0xbf, + 0x4b,0x89,0xae,0x3b,0x10,0x42,0x43,0x97,0xb0,0xf0,0xe8,0x1,0x7a,0xae,0x99,0xc7, + 0xb7,0x6d,0xba,0xd3,0xb1,0x7c,0xcd,0xc,0x2,0x33,0xc3,0x65,0x92,0xbb,0x11,0x20, + 0xcc,0x85,0xf9,0x5,0x37,0x2c,0x57,0x7d,0xfb,0xf6,0xe5,0xa7,0x9f,0x7e,0xca,0x54, + 0x5c,0x19,0xdf,0x2d,0x5d,0xba,0x34,0x93,0xbf,0x9a,0xc5,0xc0,0xe7,0x7b,0xb2,0xbb, + 0xfd,0x9d,0x98,0xeb,0x54,0x43,0x46,0x1f,0xa1,0xe9,0x9a,0xbd,0xbc,0x3e,0x7e,0xdc, + 0x75,0xc5,0x95,0xe7,0x4c,0xa2,0x7b,0xf7,0xee,0xa4,0xa5,0xa5,0xf1,0xd2,0x4b,0x2f, + 0x31,0x79,0xf2,0x64,0x82,0x82,0x82,0xa,0xa4,0xc8,0xf2,0x8c,0xc4,0xec,0xb0,0xc1, + 0x9a,0x63,0xe7,0x59,0x7e,0xfc,0x20,0x7f,0x44,0x27,0xb3,0x55,0x2c,0x3,0x93,0x15, + 0x42,0x1,0x59,0xe4,0xda,0x2d,0x5e,0x78,0xfe,0x62,0x72,0xfe,0x78,0xee,0x32,0xd1, + 0x20,0xc1,0x7c,0x86,0x8f,0x93,0x3e,0xe6,0xe3,0xf5,0xc0,0xda,0xa2,0x3c,0x18,0x7a, + 0x2f,0xf7,0xd4,0x34,0xd1,0x2e,0xa4,0x31,0x77,0x94,0x3,0xb3,0x35,0xf7,0x5e,0xa8, + 0xd8,0xd8,0x58,0xf6,0xed,0xdb,0xe7,0xb3,0xf2,0x9a,0x37,0x6f,0x4e,0x58,0x58,0x98, + 0xb2,0x5e,0xe5,0x62,0x7b,0x95,0x52,0xd2,0xb1,0x63,0x47,0xe2,0xe3,0xe3,0x55,0xa5, + 0xe4,0x70,0x5d,0xaf,0x5e,0xbd,0xda,0xe7,0xfe,0x8a,0x85,0x9d,0xfb,0x3b,0xb6,0xbb, + 0x42,0x58,0xc8,0x8c,0xbf,0x5f,0xe1,0xb0,0x6e,0x42,0xe3,0x70,0xc2,0x45,0x66,0xef, + 0xfa,0x1b,0xfc,0x83,0xd2,0x77,0xc,0x7a,0xed,0x77,0x95,0x89,0x8f,0x96,0x0,0x5d, + 0xb7,0xf1,0x74,0xa5,0x7a,0x7c,0xd5,0xa6,0x1b,0xba,0xd4,0x31,0xb,0xf,0x7f,0x28, + 0x2f,0x27,0x8c,0x6e,0x71,0xe5,0x11,0x80,0x34,0x43,0x44,0x7a,0x4d,0xe3,0x42,0x72, + 0x22,0x1f,0xec,0xfc,0x8b,0x4f,0xa2,0x37,0xe2,0x48,0x4d,0xa5,0xcf,0xea,0x1f,0xf9, + 0xf9,0x81,0x3e,0xd4,0x9,0x2b,0xe6,0xb6,0xc2,0xa5,0x6b,0xc0,0xdc,0xef,0x47,0xcd, + 0x85,0xf9,0x5,0xbf,0x7c,0xf9,0x32,0xdd,0xbb,0x77,0xe7,0xa3,0x8f,0x3e,0xa2,0x5e, + 0xbd,0x7a,0xd7,0x7c,0x0,0x46,0xc7,0x5b,0xa5,0x4a,0x15,0xbe,0xfc,0x6e,0x2e,0xaf, + 0xe,0x18,0x40,0x5a,0x4c,0x2,0xa7,0x36,0xef,0x60,0xc4,0x37,0xdf,0x50,0xa5,0x72, + 0x65,0xaf,0x1e,0x9e,0x51,0xce,0xd3,0x4f,0x3f,0x4d,0x70,0x70,0x30,0xdd,0xba,0x75, + 0x63,0xf1,0xe2,0xc5,0x5,0x6e,0x9,0xc8,0xf3,0x5e,0x16,0xad,0x87,0xf7,0xce,0x7e, + 0xc9,0xc1,0xd8,0x44,0x12,0x64,0x2c,0x58,0x35,0x10,0x45,0x33,0x11,0x51,0xd9,0x45, + 0x3,0x11,0x0,0x16,0xc0,0x92,0xc6,0xe2,0xe4,0x9f,0x59,0xbc,0x55,0xf2,0xb1,0xd8, + 0x41,0x99,0x22,0x1,0xf4,0x2f,0xfd,0x0,0x8f,0xd7,0xb,0x20,0x37,0xf6,0xec,0x5e, + 0xb8,0x70,0x81,0x23,0x47,0x8e,0xf8,0xac,0xbc,0x7b,0xef,0x4d,0x8f,0xc6,0xac,0xc8, + 0x59,0x8c,0x3a,0x7e,0xfd,0xf5,0xd7,0xd9,0xb0,0x61,0x83,0xaa,0x90,0x1c,0xee,0x1b, + 0xe2,0xe3,0xe3,0x79,0xf8,0xe1,0x87,0x73,0x35,0x9e,0xd8,0x6d,0xb7,0xdd,0x46,0xf3, + 0xe6,0xcd,0xa9,0x5d,0xbb,0x36,0x55,0xab,0x56,0x25,0x34,0x34,0x94,0xe0,0xe0,0x60, + 0x52,0x52,0x52,0xb8,0x7c,0xf9,0x32,0x27,0x4f,0x9e,0x64,0xcf,0x9e,0x3d,0x6c,0xdd, + 0xba,0x95,0x5d,0xbb,0x76,0xe5,0xbb,0xba,0xd,0xb,0x2b,0x76,0x95,0x91,0xe0,0xca, + 0x65,0x32,0x89,0x91,0x44,0xd9,0x69,0xcf,0x12,0x9a,0xe0,0xc5,0x3f,0x16,0x80,0x39, + 0x20,0xdd,0x6c,0x94,0xbd,0x7,0xeb,0xa9,0xae,0x68,0x5b,0xbe,0x1a,0x1f,0x36,0xbf, + 0x9f,0x34,0x87,0xd,0x8b,0x29,0x3d,0xe,0xa4,0xe1,0x3f,0x25,0xbc,0x7b,0x29,0xd3, + 0xf3,0x24,0x62,0x2c,0x75,0xba,0xe2,0x0,0x6a,0x1a,0x67,0x93,0x92,0x78,0xe4,0xd7, + 0x6f,0x59,0x7f,0xf6,0xa4,0x73,0xbe,0xed,0xef,0xcf,0xc9,0xe4,0x54,0x9e,0x5c,0xf5, + 0x2d,0x2b,0x3b,0xbc,0x40,0xa9,0xc0,0x20,0xb7,0xc9,0x4a,0x7a,0x2b,0x18,0x95,0xc0, + 0xf2,0x9d,0xb8,0x6a,0xd6,0xac,0x19,0xb3,0x66,0xcd,0xa2,0x51,0xa3,0x46,0x37,0x14, + 0x38,0x86,0x38,0x8a,0x88,0x88,0xe0,0xd5,0xb7,0xde,0xe2,0xce,0x3b,0xef,0x64,0xe7, + 0xce,0x9d,0x54,0xa9,0x5c,0x39,0xcb,0x1d,0xb9,0x94,0x92,0x87,0x1f,0x7e,0x98,0xd0, + 0xd0,0x50,0xba,0x74,0xe9,0xc2,0xdc,0xb9,0x73,0xb,0x84,0x25,0x2b,0xfd,0xfa,0x5, + 0xa7,0x2e,0xda,0x79,0x62,0xf9,0x6a,0xfe,0x48,0x59,0x7,0xc2,0xec,0x5a,0xfe,0xb3, + 0xe4,0xf4,0x30,0xe9,0x3c,0x97,0x9,0xce,0xc8,0x18,0xce,0x24,0x4a,0x9e,0xff,0xf7, + 0x63,0xfa,0x46,0xc3,0x5b,0x7e,0x81,0x39,0x7e,0xff,0xf1,0xf1,0xf1,0x9c,0x3e,0x7d, + 0xda,0x27,0x65,0x5,0x6,0x6,0xd2,0xb4,0x69,0x53,0x25,0xae,0x72,0xb1,0xdd,0x6e, + 0xd8,0xb0,0x81,0x2f,0xbe,0xf8,0x22,0xd7,0x4,0x9d,0x10,0x82,0xf0,0xf0,0x70,0x3a, + 0x75,0xea,0x44,0xa3,0x46,0x8d,0xa8,0x5f,0xbf,0x3e,0x65,0xcb,0x96,0x25,0x34,0x34, + 0x14,0x7f,0x7f,0x7f,0xe2,0xe2,0xe2,0xb8,0x78,0xf1,0x22,0xfb,0xf6,0xed,0x63,0xc7, + 0x8e,0x1d,0xac,0x5e,0xbd,0x9a,0xd5,0xab,0x57,0xe3,0x70,0x38,0xf2,0x4d,0xa0,0xd3, + 0x6b,0x9,0xd9,0x87,0x1f,0x7e,0x38,0xc7,0x97,0x60,0x85,0x10,0x98,0xcd,0x66,0x6, + 0xd,0x1a,0x44,0xbf,0x7e,0xfd,0xa8,0x58,0xb1,0xa2,0xd7,0xc7,0x26,0x24,0x24,0x30, + 0x7f,0xfe,0x7c,0x3e,0xf8,0xe0,0x3,0x9f,0x5a,0xa5,0x73,0x92,0xa6,0x4d,0x9b,0x52, + 0xa4,0x48,0x91,0xc,0x6d,0x5a,0x5c,0x61,0x59,0x2,0x89,0x5d,0x7,0xe1,0xd0,0x31, + 0x99,0x35,0x7e,0x3f,0x7f,0x8c,0x4d,0xa7,0xcf,0x81,0x59,0xc7,0xb9,0x4a,0x90,0x85, + 0x49,0xaf,0x67,0x3a,0x1c,0xa3,0x3d,0x6a,0x76,0x8a,0x9b,0x83,0x99,0xd0,0xf4,0x7e, + 0x6e,0xf3,0xf,0x46,0x77,0x5,0x2a,0x15,0xe9,0xb9,0x7a,0xae,0x5f,0xbc,0x4b,0x8, + 0xa5,0x8f,0x25,0x12,0xa9,0x83,0x2e,0x74,0x4,0x12,0xa4,0x9,0x4d,0x13,0x1c,0x3e, + 0x7f,0x8e,0xe6,0xbf,0xcc,0xe2,0x54,0x62,0x3c,0x98,0xcc,0x48,0xd7,0x7f,0x42,0x33, + 0xb3,0xeb,0xd2,0x45,0xde,0xde,0xbc,0x92,0x49,0x77,0x3f,0x80,0x30,0x4b,0xd0,0x4d, + 0x98,0x35,0xe1,0x12,0x96,0x32,0xdb,0x61,0x21,0x94,0xc0,0xf2,0xb2,0x23,0x3d,0x7b, + 0xf6,0x2c,0x83,0x7,0xf,0x66,0xea,0xd4,0xa9,0x5e,0x89,0x2b,0xcf,0x63,0xff,0xfd, + 0xf7,0x5f,0xde,0x7a,0xeb,0x2d,0xa6,0x4e,0x9d,0xca,0xf3,0xcf,0x3f,0xcf,0x84,0x9, + 0x13,0xb8,0xfb,0xee,0xbb,0xb3,0x34,0x10,0x1a,0x22,0x2b,0x2a,0xca,0xb9,0x9d,0x76, + 0xcc,0x98,0x31,0xbc,0xfa,0xea,0xab,0xf9,0x36,0x31,0xab,0x67,0xfd,0x24,0xa7,0xc0, + 0xe4,0x1d,0xfb,0x18,0xf1,0xeb,0x61,0x2e,0x97,0xfe,0xd3,0x69,0x5d,0xba,0x25,0x3d, + 0xb9,0x21,0xb8,0x4,0x26,0xe1,0x9c,0xa9,0x1d,0x39,0x7a,0x86,0x32,0x65,0xca,0xe4, + 0xd8,0x29,0x63,0x62,0x62,0x7c,0x56,0x56,0x68,0x68,0x28,0xb5,0x6a,0xd5,0x52,0xea, + 0x27,0x17,0xdb,0xef,0xb8,0x71,0xe3,0x88,0x8b,0x8b,0xcb,0xd1,0xf3,0x4,0x5,0x5, + 0xd1,0xb8,0x71,0x63,0x3a,0x74,0xe8,0xc0,0xa3,0x8f,0x3e,0x4a,0x85,0xa,0x15,0xae, + 0xdb,0x6,0x42,0x43,0x43,0xa9,0x54,0xa9,0x12,0xf7,0xdf,0x7f,0x3f,0x6f,0xbc,0xf1, + 0x6,0x0,0x6b,0xd7,0xae,0x65,0xee,0xdc,0xb9,0xfc,0xf5,0xd7,0x5f,0xec,0xdc,0xb9, + 0x33,0xdf,0xd5,0xf5,0xf2,0xe5,0xcb,0xf9,0xe3,0x8f,0x3f,0x72,0xf4,0x1c,0x2d,0x5a, + 0xb4,0xa0,0x67,0xcf,0x9e,0x3c,0xf3,0xcc,0x33,0xd9,0x6a,0xb,0xc1,0xc1,0xc1,0xf4, + 0xe8,0xd1,0x83,0x1e,0x3d,0x7a,0xb0,0x7d,0xfb,0x76,0xc6,0x8d,0x1b,0xc7,0x6f,0xbf, + 0xfd,0xc6,0xb9,0x73,0xe7,0xf2,0x6c,0xbd,0xd6,0xab,0x57,0x97,0xa0,0xa0,0xa0,0x4c, + 0x26,0xbc,0x64,0xf0,0x95,0xd2,0xa4,0x44,0xd7,0x4,0xba,0x43,0xb2,0x20,0x7a,0x1b, + 0x97,0xb0,0x7b,0x88,0xa5,0x2c,0x78,0x29,0x9,0x8f,0xc0,0xa2,0x9a,0x0,0xbb,0x24, + 0x48,0x4a,0xbe,0xe9,0xf0,0x10,0x35,0x8b,0xdd,0x96,0x7e,0x7e,0x43,0xd8,0x78,0xb9, + 0x4b,0xd0,0xbd,0x5c,0x8f,0x4,0x34,0x74,0x74,0x34,0x9,0x3a,0x2,0x1d,0x3b,0x9f, + 0xef,0xd9,0xc4,0xdb,0x5b,0xd7,0x90,0x94,0x9a,0x6,0x26,0x73,0x7a,0x87,0x2f,0x25, + 0xd2,0xac,0x21,0xec,0x76,0xa6,0xef,0xfd,0x9b,0xa8,0x72,0x95,0x79,0xb2,0x72,0x3d, + 0xd2,0xec,0xba,0xeb,0xf6,0x3c,0xc4,0x55,0x2e,0xe5,0x3a,0x34,0x17,0xa6,0xe,0x54, + 0x8,0x81,0xc3,0xe1,0x60,0xc8,0x90,0x21,0xf4,0xe8,0xd1,0x83,0x7b,0xee,0xb9,0x27, + 0x4b,0xe2,0x6a,0xdb,0xb6,0x6d,0xf4,0xea,0xd5,0x8b,0x69,0xd3,0xa6,0xd1,0xa0,0x41, + 0x3,0x5a,0xb7,0x6e,0x4d,0x9f,0x3e,0x7d,0x78,0xfd,0xf5,0xd7,0x69,0xd5,0xaa,0x55, + 0x96,0xc4,0x91,0xa7,0xc8,0x32,0x99,0x4c,0x8c,0x19,0x33,0x86,0x77,0xde,0x79,0x7, + 0x7f,0x7f,0xff,0x7c,0x27,0xb2,0x8c,0xeb,0x3d,0x77,0x49,0xf2,0xe2,0xf2,0xad,0x2c, + 0x48,0x5a,0x6,0xa5,0x75,0x90,0x1,0x79,0x27,0xa7,0x94,0x94,0x14,0x29,0x92,0xb3, + 0x56,0xac,0x3d,0x7b,0xf6,0xf8,0xac,0xac,0x90,0x90,0x10,0x2a,0x67,0xd1,0x3a,0xaa, + 0xc8,0x7e,0xdb,0x5d,0xb1,0x62,0x5,0x8b,0x16,0x2d,0xca,0xd1,0x73,0xf5,0xed,0xdb, + 0x97,0x1e,0x3d,0x7a,0xd0,0xa0,0x41,0x3,0xac,0x56,0x6b,0xe6,0x3,0xa1,0x17,0xd7, + 0x1a,0x19,0x19,0x49,0x64,0x64,0x24,0xe7,0xce,0x9d,0x63,0xed,0xda,0xb5,0xbc,0xff, + 0xfe,0xfb,0xf9,0x22,0xf2,0xb9,0x94,0x92,0xc4,0xc4,0x44,0x3e,0xf9,0xe4,0x13,0x9f, + 0x6e,0x4,0xf1,0xa4,0x7a,0xf5,0xea,0x8c,0x1c,0x39,0x92,0x4e,0x9d,0x3a,0x11,0x18, + 0x18,0x98,0xa5,0xfa,0xbd,0xd2,0xca,0x66,0x1c,0xd7,0xa0,0x41,0x3,0xe6,0xce,0x9d, + 0xcb,0x8e,0x1d,0x3b,0xf8,0xf0,0xc3,0xf,0x99,0x33,0x67,0x4e,0x9e,0xab,0x5b,0xab, + 0xd5,0x4a,0x9d,0x3a,0x75,0xdd,0xd7,0xed,0x79,0x1f,0x86,0x70,0x31,0x9c,0xd6,0x25, + 0x12,0xd,0x38,0x91,0x74,0x99,0x9f,0xe,0xef,0x77,0x5a,0x9f,0xcc,0xa6,0x6b,0xe7, + 0xd9,0xbd,0x9e,0x5,0xb,0x5c,0xf1,0x16,0x24,0x9a,0x9,0x3e,0xbf,0xfb,0x21,0xda, + 0x95,0xa9,0xee,0xba,0x6,0x97,0x43,0x97,0x47,0xcc,0x51,0x6f,0xe7,0xc6,0xc6,0x3d, + 0x38,0x75,0x90,0x8e,0x2e,0x5,0x66,0xb3,0x89,0x17,0xd6,0xfe,0xc4,0x57,0xff,0xee, + 0xc6,0xae,0xe3,0xc,0xa6,0x85,0x67,0x70,0x53,0xa7,0x65,0x4e,0x6a,0x1a,0x88,0x20, + 0x9e,0x5b,0xbd,0x80,0xaa,0x41,0xc5,0x69,0x12,0x5e,0x16,0xdd,0x1d,0xda,0x41,0xe6, + 0xaa,0xa7,0xbb,0x56,0x98,0x3a,0x51,0x80,0xe,0x1d,0x3a,0xf0,0xd4,0x53,0x4f,0xd1, + 0xa6,0x4d,0x9b,0xab,0x1b,0xe1,0x75,0x5e,0xb8,0x83,0x7,0xf,0xd2,0xbb,0x77,0x6f, + 0x96,0x2c,0x59,0x42,0x83,0x6,0xd,0x0,0x67,0x7e,0xb8,0x19,0x33,0x66,0x30,0x7c, + 0xf8,0x70,0x8e,0x1c,0x39,0x92,0xe5,0xf8,0x56,0xc6,0xb9,0x23,0x23,0x23,0x79,0xe2, + 0x89,0x27,0x18,0x39,0x72,0x24,0xc9,0xc9,0xc9,0xf9,0x53,0x5c,0xc5,0x39,0xb8,0xef, + 0xf3,0x68,0x16,0xa4,0xfe,0xe4,0xca,0x61,0x65,0xce,0x53,0x9,0x3b,0x75,0x29,0x29, + 0x51,0xbc,0xa8,0x3b,0x37,0x97,0x67,0x47,0xe4,0x2b,0x7c,0xe9,0xb7,0xd1,0xa8,0x51, + 0x23,0xa5,0x7e,0x72,0x1,0xe3,0x5d,0x7b,0xec,0xb1,0xc7,0x72,0xec,0x1c,0x15,0x2a, + 0x54,0x60,0xeb,0xd6,0xad,0x4c,0x9c,0x38,0x91,0x26,0x4d,0x9a,0x64,0x10,0x57,0xde, + 0xf6,0x41,0x57,0xe,0xfc,0x52,0x4a,0x4a,0x96,0x2c,0xc9,0x23,0x8f,0x3c,0xc2,0x96, + 0x2d,0x5b,0x98,0x32,0x65,0xca,0x2d,0x4f,0x32,0xec,0xcd,0xf5,0xaf,0x5f,0xbf,0xde, + 0xa7,0x69,0xa4,0x3c,0xe9,0xd8,0xb1,0x23,0x5b,0xb7,0x6e,0xa5,0x5b,0xb7,0x6e,0xee, + 0x40,0xcf,0x59,0xa9,0xdf,0xeb,0xd5,0xb7,0xd3,0x42,0x54,0x8f,0xaf,0xbf,0xfe,0x9a, + 0x39,0x73,0xe6,0xa0,0x69,0x79,0x6b,0xe8,0xc,0xd,0xd,0xa3,0x49,0x93,0x26,0x57, + 0xdd,0x6f,0x66,0x7d,0x9c,0x2e,0x4,0x9a,0x6,0x5f,0xfe,0xbb,0x93,0x93,0xb6,0x54, + 0x30,0x49,0xe7,0x76,0x42,0x6f,0x15,0x95,0x4c,0xff,0x5d,0x48,0x30,0xbb,0x72,0x42, + 0xf,0xa8,0xde,0x90,0xc7,0xab,0xd7,0xc3,0xa1,0xdb,0xdd,0xba,0x4a,0x48,0x81,0x40, + 0x5c,0xf7,0x19,0xc8,0x8c,0xc9,0x7b,0x5c,0x17,0x9,0xa9,0xe8,0x88,0x14,0x89,0x26, + 0x34,0x1c,0xba,0x4e,0x97,0x95,0xdf,0x30,0x63,0xcf,0x26,0xec,0x42,0xa6,0x2b,0x17, + 0xf7,0x4a,0x85,0x53,0x38,0x49,0xcd,0xb5,0x1d,0x5d,0x93,0xe8,0x36,0xc9,0xb,0x7f, + 0xfe,0x44,0x9a,0xdd,0x8e,0xa6,0x3b,0xb0,0x23,0x5d,0xbb,0x17,0x65,0xae,0x65,0xd1, + 0x29,0xf0,0x2,0xcb,0x33,0x3b,0xfb,0xc0,0x81,0x3,0x19,0x30,0x60,0x0,0xed,0xda, + 0xb5,0xf3,0x6a,0x70,0x35,0xbe,0x73,0xfc,0xf8,0x71,0x5e,0x7e,0xf9,0x65,0x26,0x4e, + 0x9c,0x48,0xe9,0xd2,0xa5,0x33,0x1c,0x5b,0xa6,0x4c,0x19,0x26,0x4e,0x9c,0x48,0xd7, + 0xae,0x5d,0xd9,0xb3,0x67,0x4f,0xb6,0x5e,0x66,0x29,0x25,0xb5,0x6b,0xd7,0xa6,0x47, + 0x8f,0x1e,0x2c,0x5a,0xb4,0xc8,0x1d,0xa8,0x32,0xaf,0x7,0x23,0x35,0xea,0x76,0xfb, + 0xe9,0x58,0x6a,0xce,0x58,0xc0,0xae,0x32,0x73,0x40,0xb7,0x66,0x71,0x7a,0x20,0x41, + 0xda,0x41,0xb7,0x83,0x5d,0x50,0x24,0xa5,0x14,0xb7,0xc9,0x52,0x94,0x33,0x45,0x50, + 0xc9,0x52,0x9a,0x2a,0x7e,0xa5,0xa9,0x68,0x89,0xa0,0xbc,0x29,0x82,0x70,0x59,0x8a, + 0x90,0xb4,0x70,0xb0,0x69,0xce,0xef,0x4b,0x3b,0xe0,0xf0,0xda,0x31,0xd3,0xd3,0x2f, + 0xe1,0xd4,0x69,0xdf,0x2f,0x5,0xfd,0xf7,0xdf,0x7f,0x3e,0x2b,0xab,0x4e,0x9d,0x3a, + 0x4a,0xfd,0xe4,0x42,0xfb,0x5,0xf8,0xe4,0x93,0x4f,0xb8,0x7c,0xf9,0xb2,0xcf,0xcb, + 0x37,0x9b,0xcd,0x3c,0xf1,0xc4,0x13,0x1c,0x39,0x72,0x84,0x86,0xd,0x1b,0xfa,0x6c, + 0xe2,0x74,0xa5,0x6f,0x8d,0x94,0x92,0x3e,0x7d,0xfa,0xb0,0x63,0xc7,0x8e,0x3c,0x2b, + 0xcc,0x8d,0xba,0x7e,0xef,0xbd,0xf7,0x72,0xc4,0x7a,0x33,0x7c,0xf8,0x70,0x96,0x2e, + 0x5d,0x4a,0x70,0x70,0xf0,0x55,0x31,0x8,0x7d,0x25,0xc2,0x8d,0xfb,0x78,0xf2,0xc9, + 0x27,0xd9,0xbe,0x7d,0x3b,0xa5,0x4b,0x97,0xce,0x33,0xf5,0x1b,0x1e,0x7e,0x1b,0x55, + 0xaa,0x54,0x46,0xd7,0xf5,0xab,0x2c,0x76,0xee,0x49,0xa5,0x6b,0xb9,0xce,0x8c,0x20, + 0x2e,0x35,0x8d,0x6f,0xf7,0x6f,0x1,0x87,0xdd,0xa9,0x8e,0x34,0xf,0x6b,0xd4,0xf5, + 0xf4,0x95,0x87,0xa3,0xb9,0xf3,0xeb,0x76,0xec,0xe,0xc9,0x3d,0x25,0xca,0xf1,0xd6, + 0x9d,0xad,0xb0,0x48,0xcd,0x69,0x25,0x13,0x64,0xcc,0x2d,0x78,0x5d,0x8b,0x95,0xcb, + 0x30,0x21,0xd3,0x8f,0x91,0x2,0xcc,0x76,0x89,0xc3,0xcf,0xce,0xb6,0xd8,0x33,0x34, + 0xf9,0x79,0x26,0xb,0xf6,0xef,0x4,0x4b,0xa0,0x53,0xb6,0x68,0x22,0x3d,0x45,0x8e, + 0xdb,0xd4,0x65,0x88,0x2b,0x67,0xa9,0xe,0x93,0x99,0x3d,0x17,0xcf,0xf3,0xc6,0xb6, + 0x95,0xe8,0x9a,0x19,0x4d,0x7,0x5d,0xea,0xb9,0x9a,0xa2,0xd0,0x5c,0xd0,0x3b,0x50, + 0xc3,0xaa,0xf4,0xdd,0x77,0xdf,0xd1,0xbe,0x7d,0x7b,0xee,0xbf,0xff,0xfe,0x2c,0x2d, + 0xb,0x1e,0x3a,0x74,0x88,0xc7,0x1f,0x7f,0x9c,0x31,0x63,0xc6,0x64,0xc8,0x29,0xe8, + 0xf9,0xbd,0xfa,0xf5,0xeb,0x33,0x7b,0xf6,0x6c,0xfa,0xf7,0xef,0xcf,0xc8,0x91,0x23, + 0x69,0xde,0xbc,0x79,0xb6,0x96,0xb,0xab,0x57,0xaf,0x8e,0xc9,0x64,0xe2,0xaf,0xbf, + 0xfe,0xa2,0x45,0x8b,0x16,0xf8,0xf9,0xf9,0xe5,0xd9,0xe5,0x42,0xe3,0xba,0x8e,0x9d, + 0x85,0x2e,0x4b,0x7e,0x23,0xb6,0xe8,0x1e,0x70,0x64,0x71,0x49,0x50,0x4f,0x81,0xe4, + 0x50,0x9a,0x5a,0xee,0xa1,0x61,0x65,0x33,0xf5,0x22,0x8a,0x50,0x9d,0x9a,0x84,0x4, + 0x41,0x90,0x9f,0xc0,0x62,0x12,0x98,0x35,0x67,0x78,0x16,0x9b,0x43,0x92,0x98,0x2a, + 0x49,0x48,0x71,0x70,0x40,0x1e,0xe2,0x68,0x5c,0x1c,0x7b,0x4f,0xd9,0xf8,0x2b,0xe6, + 0x34,0x27,0xcc,0x1b,0xc1,0x6c,0x6,0x93,0xe6,0x14,0x78,0x5e,0x5c,0x43,0x4e,0xc4, + 0x5a,0xbc,0x74,0xe9,0x92,0xcf,0xca,0xba,0xfd,0xf6,0xdb,0x95,0x2,0xca,0x5,0x8b, + 0x4a,0x62,0x62,0x22,0x33,0x67,0xce,0xf4,0x79,0xd9,0x16,0x8b,0x85,0x9,0x13,0x26, + 0xb8,0x83,0x95,0xe6,0xd4,0x7b,0xec,0x59,0x66,0xed,0xda,0xb5,0xf9,0xe5,0x97,0x5f, + 0x18,0x3a,0x74,0x68,0x9e,0xa,0x7f,0x60,0xdc,0xfb,0xa6,0x4d,0x9b,0xf8,0xfb,0xef, + 0xbf,0x7d,0x5a,0x76,0x50,0x50,0x10,0xd3,0xa6,0x4d,0x73,0x5b,0x20,0x73,0xba,0xbf, + 0x34,0xfa,0xea,0xba,0x75,0xeb,0xb2,0x61,0xc3,0x6,0xba,0x74,0xe9,0x92,0x27,0x96, + 0x67,0x3b,0x76,0x7c,0xe0,0x9a,0xa2,0xd6,0xe3,0x3,0x97,0x5b,0xaa,0x60,0xe2,0xde, + 0x4d,0x1c,0xbc,0x1c,0xb,0x16,0xbf,0xf4,0x78,0x57,0xe9,0xc1,0xa6,0xae,0xa5,0x84, + 0xdc,0x79,0xfe,0x8c,0x10,0xa,0xd8,0x25,0x95,0x8b,0x14,0x61,0xfa,0xbd,0xf,0x52, + 0x32,0x30,0xc8,0x15,0xc4,0x56,0x64,0xd0,0x64,0x37,0x8e,0x77,0x95,0x6e,0xc1,0x12, + 0xe,0x81,0xae,0x39,0xf3,0xa,0x9a,0x2d,0x66,0x16,0x1e,0xfb,0x97,0x97,0x56,0x2f, + 0x20,0x26,0x25,0x11,0xcd,0x3f,0x8,0x5d,0x5c,0x21,0xa8,0x8c,0x6b,0x76,0x7,0xb9, + 0x92,0x1e,0xcf,0xca,0xd9,0x16,0x66,0xff,0xbb,0x9b,0x87,0xcb,0xd7,0xa1,0x45,0x78, + 0x39,0x1c,0xd2,0xe,0x52,0x73,0x46,0x80,0x57,0x4e,0xee,0x37,0xff,0x52,0x3,0x2c, + 0x5a,0xb4,0x88,0x7a,0xf5,0xea,0x71,0xe7,0x9d,0x77,0x7a,0x3d,0xb3,0x11,0x42,0x70, + 0xec,0xd8,0x31,0x1e,0x79,0xe4,0x11,0x7e,0xf8,0xe1,0x7,0xaa,0x55,0xab,0x76,0xcd, + 0x17,0xd8,0xb0,0x40,0xcd,0x9e,0x3d,0x9b,0xa7,0x9e,0x7a,0x8a,0xd9,0xb3,0x67,0x53, + 0xa9,0x52,0xa5,0x2c,0x8b,0x2c,0x80,0x2a,0x55,0xaa,0x10,0x1a,0x1a,0xea,0x9e,0x8d, + 0xe6,0x35,0x53,0xf4,0x95,0x1d,0xcd,0x93,0x73,0xf7,0x72,0xb8,0xc8,0x5e,0x32,0xc4, + 0xa8,0xba,0xe1,0xc3,0xd1,0xc1,0x91,0xc8,0x80,0x90,0x41,0xf4,0xee,0x18,0x42,0xd5, + 0x12,0x81,0x98,0x34,0x30,0x6b,0xd7,0x73,0x3c,0x34,0x22,0x91,0x6a,0xb4,0xa0,0x6, + 0xba,0xe,0x76,0x5d,0x62,0xd3,0x75,0xfe,0x3d,0xd7,0x86,0x1f,0x37,0x25,0x32,0x6f, + 0xef,0x9,0xe,0x46,0xcc,0x77,0xf9,0x7e,0x89,0xeb,0xce,0xa4,0xcb,0x95,0x29,0xea, + 0xf3,0xe,0xd9,0x97,0xe,0xd2,0x35,0x6a,0xd4,0x50,0xa,0x28,0x17,0x58,0xb5,0x6a, + 0x55,0x8e,0x44,0x11,0x9f,0x31,0x63,0x6,0x4f,0x3d,0xf5,0x54,0xae,0xc,0xfa,0x9e, + 0xed,0xba,0x58,0xb1,0x62,0x4c,0x9e,0x3c,0x99,0xb0,0xb0,0x30,0xc6,0x8f,0x1f,0x9f, + 0xa7,0xea,0xda,0x8,0x9a,0xeb,0x4b,0x11,0x3b,0x71,0xe2,0xc4,0x5c,0x13,0x57,0x57, + 0xf6,0x7d,0x15,0x2a,0x54,0xe0,0xe7,0x9f,0x7f,0xa6,0x72,0xe5,0xca,0xb7,0x3c,0x28, + 0x6d,0xf7,0xee,0xdd,0xdc,0x75,0xa0,0x69,0xda,0x55,0xa1,0x1a,0x8c,0xf6,0xa1,0x9, + 0xc1,0xd1,0xc4,0x8b,0x4c,0xd9,0xff,0xf,0x98,0x2d,0x19,0xbb,0xd7,0x8c,0xbf,0x64, + 0x22,0x91,0xd2,0x7d,0xaa,0x34,0x29,0x70,0x48,0x9d,0x40,0xab,0x95,0x3f,0x3a,0x3c, + 0x4f,0x44,0x91,0x60,0x77,0x6c,0x2a,0xe1,0x11,0x47,0x4b,0x5c,0x2f,0x3c,0x82,0x5b, + 0xd7,0x39,0x1d,0xcf,0xa5,0xab,0x4c,0xa9,0xb,0x84,0x6,0xa3,0xf6,0x6c,0xe0,0x7f, + 0xbf,0x2c,0x42,0xf,0x2d,0x2,0x26,0xb,0x7a,0x86,0x6b,0xb9,0xf2,0xba,0x48,0x5f, + 0x2e,0x74,0x9,0x49,0xe9,0x5a,0xc,0x8c,0x4d,0x8c,0xe3,0xdd,0xad,0xab,0x58,0xde, + 0xee,0x71,0xac,0xc2,0x8c,0xd4,0x5c,0xd9,0x17,0x73,0x21,0x74,0x43,0x81,0x5d,0x22, + 0x34,0x5e,0x82,0xe8,0xe8,0x68,0x6e,0xbf,0xfd,0x76,0xee,0xbc,0xf3,0xce,0x2c,0x2d, + 0xb,0x9e,0x3d,0x7b,0x96,0x1,0x3,0x6,0x30,0x71,0xe2,0xc4,0xc,0xa9,0x73,0xae, + 0x7c,0x81,0xd,0x73,0xbd,0x94,0x92,0xf2,0xe5,0xcb,0x33,0x7e,0xfc,0x78,0x1e,0x7b, + 0xec,0x31,0x8e,0x1e,0x3d,0x9a,0xad,0x9c,0x83,0x52,0x4a,0x8a,0x17,0x2f,0x4e,0x9d, + 0x3a,0x75,0xf2,0x64,0x24,0x69,0xcf,0xfb,0x79,0x7c,0xd6,0x41,0xd6,0x15,0x9d,0xed, + 0x14,0x57,0xde,0xa8,0x2b,0xe9,0x20,0xd8,0x1e,0x46,0x87,0xe2,0x8d,0x39,0xd9,0x79, + 0x2c,0x13,0xba,0x97,0xa6,0x76,0x44,0x10,0x56,0x33,0x98,0x4d,0x59,0xdb,0xd5,0xa1, + 0x69,0x60,0x35,0xb,0x2,0x2d,0x26,0x1a,0x94,0x29,0xc2,0xff,0x3d,0x5c,0x8a,0x3, + 0xc3,0x1a,0xf1,0xf3,0x1d,0xef,0xd3,0x30,0xb4,0x3c,0xc5,0xb5,0x30,0xb0,0x9b,0x0, + 0x47,0xa6,0xcf,0xcb,0x73,0x52,0xe7,0x70,0xe8,0x3e,0x59,0x8e,0xf5,0xe5,0x32,0x53, + 0xc9,0x92,0x25,0x95,0xfa,0xc9,0xe1,0x76,0x6c,0xb3,0xd9,0x58,0xb4,0x68,0x11,0xa9, + 0xa9,0xa9,0x3e,0x2d,0x7b,0xfc,0xf8,0xf1,0x3c,0xf5,0xd4,0x53,0x37,0xed,0x3,0x94, + 0xd5,0xfe,0xce,0x38,0x8f,0xd5,0x6a,0x65,0xd4,0xa8,0x51,0x74,0xe8,0xd0,0x21,0xcf, + 0xf4,0xc5,0x7b,0xf6,0xec,0x61,0xdb,0xb6,0x6d,0x3e,0x2d,0x77,0xe0,0xc0,0x81,0x19, + 0x72,0x45,0xe6,0xa6,0xa5,0xdf,0xe8,0xdb,0x4b,0x96,0x2c,0xc9,0xee,0xdd,0xbb,0xf1, + 0xf3,0xf3,0xbb,0xa5,0x75,0x5c,0xb7,0x6e,0x5d,0x74,0x5d,0xcf,0x20,0xae,0x3c,0x85, + 0x95,0xa7,0x92,0xfa,0xed,0xd8,0x41,0x4e,0xc4,0xc6,0x38,0x3b,0xd1,0x1b,0xdf,0xa9, + 0xb3,0x93,0x34,0x7e,0x0,0x74,0x89,0x43,0x83,0x0,0x61,0x62,0x5a,0xe4,0x23,0x94, + 0x9,0xe,0xc2,0xe1,0xf2,0xe1,0xd2,0x5c,0xff,0x13,0x9a,0xe6,0x94,0x63,0xd7,0xf3, + 0xbd,0x12,0x32,0xfd,0x1a,0xa5,0x33,0x8c,0x82,0x45,0x83,0xf3,0xc9,0x9,0x3c,0xb7, + 0xe6,0x27,0xde,0xdd,0xf0,0xb,0x7a,0x48,0xb0,0x73,0x42,0x2e,0x48,0xbf,0x5e,0xc1, + 0xf5,0xc7,0x1b,0x21,0xd2,0x97,0x3a,0x85,0x6,0x16,0x2b,0xab,0x8f,0xec,0x66,0xda, + 0xde,0xad,0x68,0x26,0xcd,0xb9,0x83,0xd0,0x23,0x1c,0x44,0x4e,0xba,0xe2,0x14,0x68, + 0x1f,0xac,0xa4,0xa4,0x24,0x4a,0x96,0x2c,0x49,0x8d,0x1a,0x35,0xb2,0xb4,0x2c,0x78, + 0xe6,0xcc,0x19,0xfa,0xf5,0xeb,0x47,0xef,0xde,0xbd,0xbd,0x5e,0xee,0x33,0x1a,0x74, + 0xe3,0xc6,0x8d,0xf9,0xec,0xb3,0xcf,0x78,0xea,0xa9,0xa7,0xd8,0xb4,0x69,0x53,0xb6, + 0x1c,0xdf,0xa5,0x94,0x4,0x4,0x4,0xb8,0x63,0x9a,0xe4,0x35,0xe1,0xa,0x30,0x6e, + 0xf3,0x4e,0xe6,0xe9,0xb3,0x81,0x22,0xde,0x9,0x23,0x3d,0x95,0x5a,0xe6,0x5a,0xfc, + 0xd0,0xe8,0x45,0x96,0x3d,0xd4,0x81,0xd2,0xe1,0xf8,0xa4,0x63,0x4c,0xdf,0x85,0xec, + 0xac,0xe3,0xf6,0x77,0xc1,0xd6,0x2e,0xcf,0xb2,0xb2,0xc5,0x8b,0xbc,0x5e,0xf9,0x1, + 0xca,0x5c,0x6a,0x42,0x92,0x4c,0xbe,0xe6,0x16,0x61,0x87,0xae,0x13,0xe3,0x23,0x7f, + 0xac,0xa4,0xa4,0x24,0x9f,0xd5,0x73,0xd1,0xa2,0x45,0x95,0xa,0xca,0x61,0x52,0x53, + 0x53,0x59,0xbc,0x78,0xb1,0x4f,0xcb,0x1c,0x32,0x64,0x8,0x83,0x7,0xf,0xbe,0xa5, + 0x4b,0xfb,0x52,0x4a,0xfc,0xfd,0xfd,0x99,0x33,0x67,0xe,0x95,0x2a,0x55,0xca,0x13, + 0x75,0xfd,0xf5,0xd7,0x5f,0xfb,0x34,0x76,0x57,0xbb,0x76,0xed,0x18,0x37,0x6e,0xdc, + 0x55,0x93,0xbe,0x5b,0x31,0x89,0xaf,0x50,0xa1,0x2,0xb,0x16,0x2c,0xb8,0x65,0x75, + 0xdb,0xb5,0xcb,0x63,0x68,0x9a,0xc8,0x7c,0xf2,0xef,0xfa,0xf,0xe9,0xc,0x30,0x7a, + 0x21,0x25,0x81,0x59,0xff,0x6e,0x47,0xfa,0xf9,0x7b,0x97,0xaf,0xc6,0xd3,0xdc,0x24, + 0x71,0x8a,0x1d,0xb3,0x9,0x12,0x2e,0xf1,0x4e,0xbd,0x16,0x3c,0x5e,0xf9,0x76,0xd0, + 0xcc,0x98,0x84,0xb1,0x7e,0xe8,0xe1,0x53,0xe5,0x19,0x85,0x3d,0x53,0xe9,0xe6,0x3c, + 0xb9,0xdd,0xb5,0xee,0xa8,0x69,0x82,0xbf,0xcf,0xc7,0xd0,0x69,0xe5,0x77,0x7c,0x73, + 0x70,0x7,0x68,0x9a,0xeb,0xda,0x3d,0xae,0x41,0xb8,0x33,0x44,0x5f,0xf7,0x52,0x11, + 0x1e,0x29,0x7c,0x74,0x9,0xd6,0x20,0x86,0x6f,0xfb,0x8d,0x7f,0x2e,0x9c,0x46,0x8, + 0x70,0xe8,0x12,0x87,0x43,0xcf,0x38,0x88,0x28,0x81,0x95,0x35,0x2,0x3,0x3,0x29, + 0x5e,0xbc,0xb8,0xd7,0x9d,0x9d,0x10,0x82,0xb,0x17,0x2e,0xf0,0xc2,0xb,0x2f,0x30, + 0x7c,0xf8,0x70,0xf7,0xc,0x30,0x2b,0x1d,0xa5,0x94,0x92,0xbb,0xee,0xba,0x8b,0xaf, + 0xbe,0xfa,0x8a,0xa1,0x43,0x87,0x72,0xe8,0xd0,0xa1,0x6c,0xef,0x2e,0xcc,0x8e,0x5, + 0x2c,0x37,0x38,0x1c,0x3,0x9f,0xef,0xdc,0x85,0x33,0x7c,0xba,0x57,0x95,0x42,0x83, + 0xa2,0x35,0x59,0xd9,0xa9,0x2b,0xed,0x1b,0x9a,0x73,0xa4,0x53,0xbc,0x72,0xc7,0x4f, + 0xc3,0x2a,0x66,0x46,0xb7,0xaa,0xc3,0x3f,0x3d,0xdb,0xf1,0xbf,0x88,0x17,0x48,0xd2, + 0x33,0xb7,0x52,0x98,0x4d,0x1a,0xa5,0xc2,0xf3,0xae,0x90,0x55,0xe4,0x5c,0xfd,0x6e, + 0xd8,0xb0,0x81,0xf3,0xe7,0xcf,0xfb,0xac,0xcc,0x6,0xd,0x1a,0xf0,0xe6,0x9b,0x6f, + 0xe6,0x89,0x7b,0x93,0x52,0x12,0x16,0x16,0xc6,0x2f,0xbf,0xf7,0xcc,0x35,0xcd,0x0, + 0x0,0x20,0x0,0x49,0x44,0x41,0x54,0xfc,0x92,0x27,0x26,0xba,0x1b,0x37,0x6e,0xf4, + 0xd9,0x3b,0x5f,0xa6,0x4c,0x19,0xbe,0xfe,0xfa,0xeb,0xc,0x93,0xe2,0x5b,0x5d,0xd7, + 0xed,0xda,0xb5,0xa3,0x67,0xcf,0x9e,0xb7,0xe4,0x1a,0xba,0x74,0x7d,0xc8,0x29,0x57, + 0x32,0xcb,0x81,0xeb,0x12,0x2f,0x76,0x24,0xba,0xa6,0xb1,0x3a,0xe6,0x8,0xeb,0xcf, + 0x9e,0x70,0x59,0x78,0x84,0x47,0x68,0x6,0x99,0x69,0xbf,0xed,0x61,0x6e,0x2,0x69, + 0x47,0x13,0x26,0xb8,0x7c,0x91,0xa1,0x8d,0xda,0x32,0xa4,0x61,0xb,0xd0,0x25,0x42, + 0x38,0x97,0x1e,0xf1,0x8,0x8b,0xe5,0x19,0x58,0xf4,0xaa,0x5d,0xdb,0x52,0x66,0x38, + 0xa3,0x66,0x17,0x80,0xce,0xca,0xc3,0xfb,0x79,0x60,0xf9,0xc,0x76,0x5c,0x38,0xef, + 0x12,0x56,0xce,0x44,0xce,0x6e,0x15,0x28,0x85,0x97,0x16,0x2c,0xc3,0xf2,0x46,0x7a, + 0x20,0x54,0xa9,0x71,0x51,0xda,0x18,0xbb,0x79,0x25,0x20,0xb0,0x3b,0x83,0x3f,0x18, + 0xe9,0xa2,0x95,0xc0,0xca,0x6e,0xe3,0xbf,0x2a,0x9a,0xed,0x35,0x44,0x11,0x38,0x23, + 0x71,0x8f,0x1d,0x3b,0x96,0x11,0x23,0x46,0x50,0xb7,0x6e,0xdd,0x2c,0x77,0x8,0x9e, + 0xcb,0x85,0x95,0x2a,0x55,0x62,0xec,0xd8,0xb1,0x3c,0xf3,0xcc,0x33,0x9c,0x3d,0x7b, + 0xf6,0x3a,0x26,0xdb,0xfc,0x33,0xd0,0x3a,0xad,0xc4,0x92,0x29,0x7b,0x77,0x70,0x54, + 0x8f,0xf6,0x4e,0xf9,0x4b,0x9d,0x8a,0x81,0x25,0xf9,0xa3,0xdd,0x53,0x94,0x2d,0x6e, + 0xca,0xf1,0xfb,0xf2,0x2c,0x57,0x8,0x49,0x89,0xa2,0x1a,0x6f,0xb4,0x29,0x4d,0x42, + 0xb2,0x8e,0x43,0xcf,0xfc,0xfb,0x66,0xb3,0x49,0x9,0x9a,0x42,0x84,0xf1,0xe,0x7e, + 0xfe,0xf9,0xe7,0x3e,0x2b,0xd3,0x6c,0x36,0xf3,0xee,0xbb,0xef,0x52,0xbc,0x78,0xf1, + 0x3c,0xf1,0xde,0x1a,0xfd,0x4d,0xb5,0x6a,0xd5,0x78,0xff,0xfd,0xf7,0x6f,0x69,0x5d, + 0x1f,0x3c,0x78,0xd0,0xa7,0x21,0x4c,0x86,0xe,0x1d,0x4a,0x89,0x12,0x25,0xf2,0x4c, + 0xff,0x28,0x84,0xc0,0x64,0x32,0x31,0x64,0xc8,0x10,0xc2,0xc3,0xc3,0x73,0xfd,0xfc, + 0x55,0xaa,0x54,0xce,0x20,0x36,0x3d,0x27,0xe6,0x86,0x5d,0xc9,0x2a,0x4c,0xa4,0xd9, + 0x53,0x59,0x76,0x30,0x1a,0xe9,0xb0,0x39,0x77,0xe1,0x69,0xc2,0xb9,0xec,0x66,0xec, + 0xbe,0xbb,0xda,0xc,0x94,0x2e,0xb2,0x4,0x68,0x66,0xd,0xdd,0xae,0xd3,0xa1,0x66, + 0x5d,0xde,0x6d,0x78,0x2f,0x16,0x5d,0xe2,0x10,0x2e,0x17,0x75,0x21,0x9c,0xcb,0x82, + 0x22,0x13,0x57,0xf,0x41,0x6,0x91,0xa5,0x1b,0xef,0xa0,0x74,0x5a,0xb1,0x52,0x4c, + 0xe,0x66,0xff,0xbb,0x8b,0xfb,0x7f,0xff,0x96,0xb,0x36,0xd,0xdd,0x64,0x43,0xa, + 0x8f,0x65,0x41,0x23,0xf9,0xb4,0xc8,0xa2,0x10,0x72,0x1b,0xd5,0x24,0xc2,0x4,0x38, + 0x4c,0xcc,0x8f,0x39,0xc2,0x6f,0xa7,0xe,0xe1,0x27,0x1c,0x98,0x8c,0xc8,0xf5,0x52, + 0x59,0xb0,0x72,0xb4,0x3,0x10,0x42,0x90,0x92,0x92,0xc2,0x17,0x5f,0x7c,0x41,0x9b, + 0x36,0x6d,0x68,0xd8,0xb0,0xe1,0x4d,0xcd,0x8c,0x8c,0x6,0xde,0xa4,0x49,0x13,0xfe, + 0xef,0xff,0xfe,0x8f,0xae,0x5d,0xbb,0xb2,0x77,0xef,0x5e,0xaf,0xc4,0x5e,0xde,0x16, + 0xac,0x70,0xec,0x82,0x8d,0xcf,0x77,0xee,0xf4,0x88,0xa0,0x7b,0xbd,0xca,0x4d,0xa5, + 0x96,0xa5,0x1a,0xdb,0xef,0xef,0x4b,0x91,0x90,0xdc,0x37,0xe5,0x1b,0x75,0x6d,0x73, + 0x48,0xce,0x9e,0x97,0xc4,0xc6,0xa6,0x5d,0xf7,0xfb,0xe,0x87,0xce,0x7f,0x87,0x62, + 0xb0,0xdb,0xb3,0xb7,0xc5,0xf0,0xca,0xf8,0x46,0x37,0x43,0x72,0x72,0xb2,0x52,0x42, + 0x39,0xdc,0x2e,0x7c,0xb9,0x3c,0x78,0xef,0xbd,0xf7,0xd2,0xb9,0x73,0xe7,0x3c,0x77, + 0x9f,0x52,0x4a,0x9e,0x7d,0xf6,0x59,0xf7,0x26,0x9d,0x5b,0x71,0xd,0xff,0xfe,0xfb, + 0x2f,0x17,0x2e,0x5c,0xf0,0x49,0x79,0x15,0x2b,0x56,0xe4,0xe9,0xa7,0x9f,0xce,0x73, + 0xfd,0xa8,0x94,0x92,0x9a,0x35,0x6b,0xba,0x37,0x36,0xe4,0x16,0x8d,0x1b,0x35,0x21, + 0x22,0xa2,0xf4,0x35,0xdb,0xb8,0x5b,0x3b,0x68,0x92,0x43,0x71,0x71,0xcc,0xfa,0x6f, + 0x2b,0x98,0xfd,0x33,0xc4,0xb2,0xca,0xe4,0x6e,0xd2,0xc5,0x95,0x10,0x4e,0x2b,0x95, + 0x4,0x69,0x77,0x50,0x25,0x34,0x8c,0xff,0x35,0x68,0x4d,0x90,0x9f,0x3f,0x76,0x4d, + 0xa0,0xa1,0xc1,0xf5,0xb4,0x8f,0x4c,0xbf,0x1e,0x5d,0x4a,0x74,0x5d,0xa2,0xe9,0x12, + 0x63,0xaf,0x61,0xaa,0xae,0x33,0x7c,0xdd,0x52,0x9e,0xfb,0x75,0x2e,0xba,0x43,0x22, + 0x4d,0xba,0x6b,0x97,0xa2,0x85,0x74,0x93,0x58,0x6,0xd3,0x54,0xd6,0x2c,0x2,0x2e, + 0xf1,0x28,0x75,0xe7,0x3d,0xa5,0xa5,0xa6,0xf1,0xfe,0x3f,0xeb,0x40,0x33,0x23,0xd1, + 0x9d,0x8e,0xf0,0x42,0x59,0xb0,0x72,0xb4,0x3,0x48,0x4b,0x4b,0xe3,0xeb,0xaf,0xbf, + 0xa6,0x5d,0xbb,0x76,0xb4,0x6e,0xdd,0xda,0x67,0x33,0x23,0x29,0x25,0x2d,0x5b,0xb6, + 0xe4,0xcb,0x2f,0xbf,0xe4,0xd5,0x57,0x5f,0x75,0x27,0x2,0xce,0xeb,0xf1,0xad,0xae, + 0x37,0xeb,0x7f,0xe7,0xfb,0x44,0x12,0x43,0xf6,0x82,0xbc,0x51,0x50,0x43,0x49,0x44, + 0xea,0x1d,0xfc,0xd0,0xaa,0xb,0xa1,0xa1,0xb7,0xde,0x94,0x5f,0xea,0x36,0x41,0x89, + 0xe2,0xd7,0x17,0x40,0x9a,0x26,0x8,0x2f,0x19,0x9a,0xed,0x9d,0x9b,0xbe,0xf4,0x9b, + 0xca,0xe9,0x94,0x2d,0x85,0x9d,0x8d,0x1b,0x37,0xfa,0xb4,0x3c,0x23,0x2c,0x42,0x5e, + 0x7c,0xb7,0x4b,0x95,0x2a,0x45,0xf7,0xee,0xdd,0x6f,0xd9,0xfb,0xe7,0xcb,0xba,0x7e, + 0xf6,0xd9,0x67,0x29,0x56,0xac,0x58,0x9e,0x6d,0x57,0xb9,0x6d,0x2d,0xbc,0xbd,0x76, + 0x2d,0x4a,0x96,0x2c,0x91,0xd1,0xbf,0xed,0x8a,0x25,0x38,0x63,0xa8,0x7f,0x7a,0xfd, + 0xf,0x60,0xf6,0xbb,0x71,0x38,0x6,0xe9,0x19,0x81,0xdd,0x15,0xd4,0xd3,0x2c,0x90, + 0x98,0x19,0x73,0x67,0x14,0x8d,0xc2,0xcb,0x20,0x91,0x98,0x85,0x76,0xdd,0x28,0xed, + 0x46,0x4c,0x2b,0x21,0x5d,0xe9,0x6f,0x5c,0x7e,0x60,0xe,0x5d,0xc7,0x2c,0x4,0x7, + 0x2e,0xc7,0xd2,0x75,0xc5,0x4c,0x3e,0x8a,0xde,0xa,0x1,0xc1,0xce,0xc8,0xec,0x86, + 0xf3,0xb9,0xf0,0xc,0x1d,0x71,0x13,0x16,0x1,0xe3,0x7d,0x34,0x76,0xa8,0x5b,0xad, + 0xac,0x3a,0xbc,0x8b,0xaf,0xf6,0x6d,0x75,0x5,0xe6,0x95,0x19,0xaf,0xd8,0xc7,0xaf, + 0x6f,0xa1,0x15,0x58,0x46,0x47,0x68,0xb7,0xdb,0xd9,0xb4,0x69,0x13,0xed,0xdb,0xb7, + 0xa7,0x4e,0x9d,0x3a,0x3e,0xeb,0x20,0x3d,0x4d,0xb5,0x35,0x6a,0xd4,0x60,0xd4,0xa8, + 0x51,0xbc,0xf6,0xda,0x6b,0xee,0x48,0xed,0x39,0xbd,0x7b,0xc1,0xd7,0x75,0x25,0x84, + 0xe0,0xd8,0x69,0xf8,0xda,0xef,0x23,0x90,0x81,0xd7,0x6f,0xf8,0xae,0x58,0x29,0x4f, + 0x36,0x8,0xa7,0x76,0xd9,0xbc,0x11,0xcb,0xcb,0x6d,0x9,0x27,0x7d,0xdb,0xf2,0x95, + 0xf5,0x2f,0x84,0xa0,0x68,0x91,0x0,0x34,0x2d,0x7b,0xd7,0xea,0x4b,0x81,0x75,0xe6, + 0xcc,0x19,0xa5,0x82,0x72,0xf0,0xbd,0xf7,0xa5,0x6f,0x52,0xe7,0xce,0x9d,0x29,0x57, + 0xae,0x5c,0x9e,0x8c,0x59,0x67,0x5c,0x4f,0xcf,0x9e,0x3d,0xdd,0xa9,0x63,0x72,0xbb, + 0xae,0x57,0xaf,0x5e,0xed,0xb3,0x32,0x5f,0x7f,0xfd,0xf5,0x3c,0x3b,0x51,0x97,0x52, + 0x62,0xb1,0x58,0x72,0xd5,0xf,0xaf,0x54,0xa9,0x70,0xcc,0x66,0xf3,0x15,0xfa,0x28, + 0x5d,0xd0,0x18,0xfe,0x50,0x9b,0xcf,0x9d,0x66,0xfb,0xc9,0x43,0x98,0x34,0x8b,0x6b, + 0xd0,0x17,0xd7,0xb6,0x60,0x19,0xa9,0x67,0xc0,0xe9,0x20,0xe,0xc8,0xc4,0x14,0xc6, + 0x35,0x8e,0xa2,0x4b,0xd5,0x3a,0xd8,0x75,0x47,0xfa,0x18,0x67,0xf8,0x7e,0xc9,0xab, + 0xc5,0x95,0xe1,0xec,0x2e,0xdd,0xc1,0xb3,0x34,0xa4,0x0,0x93,0xc5,0xcc,0x6f,0xc7, + 0xf,0xd0,0x76,0xc5,0x2c,0x96,0x9e,0x38,0x1,0x9a,0x99,0x8c,0x97,0x24,0xd2,0xc5, + 0x95,0xbc,0xa9,0x6,0x98,0xde,0xe9,0xbb,0x3b,0x7f,0x10,0x7e,0xc1,0x3c,0xb7,0x7e, + 0x29,0xa9,0xf6,0xd4,0xf4,0x5c,0x89,0xd2,0x19,0x26,0x42,0xf8,0xd8,0x9a,0x55,0x28, + 0x5,0x96,0xd1,0x11,0xea,0xba,0xce,0x89,0x13,0x27,0xa8,0x58,0xb1,0x62,0x8e,0x75, + 0x90,0x46,0x79,0xd,0x1b,0x36,0xa4,0x4f,0x9f,0x3e,0x4c,0x9f,0x3e,0x9d,0xcb,0x97, + 0x2f,0xe7,0xab,0xa5,0x42,0xe3,0x5a,0x3f,0xdb,0x1e,0xd,0x58,0x6e,0x3c,0xab,0x10, + 0xe,0xee,0xd0,0x1b,0xf2,0xee,0x1d,0x51,0x19,0x8e,0xcf,0x2b,0x44,0xef,0x3f,0xc6, + 0xc1,0xc3,0x31,0xd7,0xbc,0x2e,0x4f,0xe1,0x95,0x15,0x11,0xec,0x4b,0x81,0xe5,0x4b, + 0x9f,0x15,0xc5,0xd5,0x6d,0xd9,0x97,0xe9,0x5a,0x5e,0x7e,0xf9,0xe5,0x3c,0xd9,0xce, + 0x3d,0xdb,0x70,0x85,0xa,0x15,0x68,0xde,0xbc,0x79,0xae,0xd7,0xb5,0xcd,0x66,0x63, + 0xcb,0x96,0x2d,0x3e,0x29,0xaf,0x4b,0x97,0x2e,0xee,0x5c,0xad,0x79,0xb9,0x6d,0xf5, + 0xea,0xd5,0x2b,0x57,0xce,0x57,0xbc,0x78,0x9,0x5a,0xb7,0x6e,0x93,0xc1,0xd7,0xd8, + 0x2d,0xac,0x0,0xdd,0x1,0xba,0x74,0xe6,0x7c,0x7c,0xe3,0xef,0xe5,0x60,0xd,0xc5, + 0xa1,0x39,0x7d,0xa0,0x32,0x88,0xa8,0xcc,0x2c,0x58,0x86,0x11,0xcb,0xc,0xd8,0xa1, + 0x5f,0xfd,0xa6,0xbc,0x5a,0x3f,0x12,0x5d,0x77,0x60,0x22,0x13,0xcb,0x95,0xb8,0x52, + 0xa3,0xa5,0x27,0xa4,0xd1,0xa5,0x3,0xdd,0xe1,0x14,0x3c,0x52,0xe8,0x7c,0xb0,0xeb, + 0x2f,0x3a,0xfd,0x36,0x8f,0xc3,0x71,0x97,0x9d,0x79,0x76,0x34,0x32,0x86,0x81,0xc0, + 0xc3,0xc2,0x76,0xb3,0x16,0x2c,0x4f,0x4b,0x96,0x7b,0xd9,0x54,0xa0,0x23,0x18,0xf0, + 0xf7,0xa,0x40,0xc7,0xa6,0xdb,0x5c,0xb7,0xa0,0x2c,0x58,0x3e,0x9d,0x6d,0xc4,0xc5, + 0xc5,0x11,0x1a,0x1a,0x4a,0xd9,0xb2,0x65,0x73,0xb4,0x83,0x34,0xac,0x25,0xf7,0xdd, + 0x77,0x1f,0xf,0x3d,0xf4,0x10,0x6b,0xd7,0xae,0x25,0x31,0x31,0x31,0x5f,0x89,0xac, + 0x4b,0xf1,0xb0,0x3c,0x7e,0xfd,0x8d,0x1d,0xdb,0x25,0x20,0x13,0x79,0xbb,0x56,0x7b, + 0x82,0x8b,0xe4,0xcd,0x25,0x93,0x12,0xc5,0x8b,0x12,0x1a,0x12,0x74,0xdd,0xf6,0xf1, + 0xef,0x81,0xf3,0xd8,0xec,0x7a,0x96,0x9e,0x91,0xd1,0x8e,0x94,0xc0,0xca,0xdb,0xd8, + 0xed,0x76,0x4e,0x9c,0x38,0xe1,0x93,0xb2,0x2a,0x55,0xaa,0x44,0xf5,0xea,0xd5,0xf3, + 0x85,0x35,0x7a,0xf0,0xe0,0xc1,0xb9,0x7e,0xce,0x3,0x7,0xe,0xf8,0xac,0xac,0x81, + 0x3,0x7,0xe6,0x69,0x21,0x6b,0xf4,0xf5,0xa5,0x4a,0x95,0xe2,0xae,0xbb,0xee,0xca, + 0xf1,0x73,0xf9,0xf9,0x59,0xa9,0x54,0xa9,0xd2,0x15,0x1b,0x7b,0x84,0x3b,0xc8,0xb9, + 0x43,0x3,0xa9,0xb,0xd6,0x9d,0x3e,0xcc,0xdf,0xe7,0x63,0x40,0xe8,0x1e,0xa9,0x65, + 0xc8,0xc4,0xaf,0xfd,0x8a,0x1d,0x85,0x42,0x22,0x75,0x13,0x2d,0x4b,0x97,0x63,0x5c, + 0x93,0x36,0x2e,0x6b,0x98,0x96,0xbe,0xec,0x77,0x85,0xb5,0x47,0xba,0xca,0x90,0x57, + 0x18,0xc8,0x74,0x1d,0x34,0xa9,0x63,0x3,0x5e,0xda,0xf0,0xb,0xc3,0x37,0xad,0x24, + 0xd5,0x6e,0x77,0x25,0x6b,0x76,0x7d,0x59,0x78,0xfc,0xe4,0x44,0x0,0x50,0xe1,0x11, + 0xcf,0xcb,0x69,0xb2,0xe2,0xa7,0xa3,0xfb,0xd8,0x13,0x7b,0xc6,0x25,0x6,0x8d,0x2b, + 0xf1,0xed,0x79,0xb,0xed,0x12,0xa1,0xcd,0x66,0x23,0x28,0x28,0x88,0xd0,0xd0,0xd0, + 0x1c,0xef,0x1c,0x3d,0x67,0x17,0x65,0xcb,0x96,0xa5,0x45,0x8b,0x16,0xec,0xdb,0xb7, + 0xcf,0x95,0x56,0x20,0x7f,0xf8,0x64,0xfd,0x77,0xc6,0xce,0xd9,0xcb,0x5e,0x5c,0xa7, + 0x96,0x4a,0xfd,0x53,0x7d,0xe8,0xde,0xdc,0x9c,0x27,0x3b,0x43,0x29,0x25,0xb7,0x95, + 0xc,0xa3,0x44,0xf1,0x90,0x6b,0x5a,0xad,0x0,0xaa,0x54,0x2a,0x86,0xc5,0xac,0x65, + 0xe9,0xd9,0xd4,0xae,0x5d,0xdb,0x67,0xd7,0xb9,0x73,0xe7,0x4e,0xa5,0x84,0x72,0x88, + 0x98,0x98,0x18,0x9f,0x5,0x17,0x6d,0xd8,0xb0,0x21,0xe1,0xe1,0xe1,0x79,0x7a,0xd0, + 0x37,0xae,0xad,0x6d,0xdb,0xb6,0xb9,0x7e,0xee,0x1d,0x3b,0x76,0xf8,0xec,0x1e,0x72, + 0x43,0xb4,0xf8,0xe2,0x3a,0x2d,0x16,0xb,0xcd,0x9a,0x35,0xcb,0xf1,0x73,0xdd,0x73, + 0x77,0xb,0xc2,0xc2,0xc2,0x32,0x18,0xd,0xdc,0xc6,0x29,0x29,0x30,0x49,0x9,0x9a, + 0xc6,0xec,0xfd,0x3b,0x48,0xb2,0xdb,0xd2,0x2d,0x53,0x86,0xa0,0x91,0x57,0xc8,0x23, + 0x4f,0x71,0x23,0x25,0x8,0x13,0xa1,0x69,0xf1,0xac,0xe9,0xf4,0x2c,0x7e,0xc2,0xe2, + 0x11,0x30,0x5d,0xb8,0x45,0x56,0x86,0x7b,0x77,0x59,0x87,0x84,0x4c,0xdf,0x59,0x88, + 0x4,0xb3,0xc9,0x44,0xa,0x92,0x16,0x4b,0x67,0x30,0x35,0x7a,0x13,0xba,0xee,0x70, + 0xee,0xea,0x33,0xe,0xf2,0x14,0x57,0x9e,0x62,0xc8,0xa7,0x1d,0xbf,0xe7,0x55,0x3a, + 0xcf,0x71,0x26,0x25,0x95,0x5,0x87,0xf7,0x61,0x32,0x99,0x71,0x67,0xce,0x51,0x4b, + 0x84,0xbe,0x19,0x64,0xad,0x56,0x2b,0x16,0x8b,0x25,0x57,0xfd,0x26,0x8c,0x97,0x20, + 0x34,0x34,0x94,0x8a,0x15,0x2b,0x72,0xe2,0xc4,0x9,0x74,0x5d,0xcf,0xb3,0xf1,0xae, + 0x3c,0x27,0x36,0xeb,0x92,0xfe,0xe1,0x3c,0xc7,0x6e,0xdc,0x88,0xed,0xe,0x5e,0xbc, + 0x2f,0x28,0xcf,0xa,0xc7,0x4c,0x63,0xc5,0x64,0x92,0x1c,0xd5,0x64,0xd2,0xb2,0xdc, + 0x36,0xee,0xb8,0xe3,0xe,0x9f,0x5d,0xe7,0xfe,0xfd,0xfb,0x49,0xf9,0x7f,0xf6,0xce, + 0x3b,0x3e,0xaa,0x2a,0xed,0xe3,0xdf,0x73,0xef,0x94,0xf4,0x42,0x9,0xa1,0x77,0x22, + 0x48,0x51,0xa4,0x8,0x88,0xa0,0x28,0x45,0x10,0x4,0x45,0xc1,0x5e,0xd0,0x15,0x7d, + 0x6d,0xab,0x8b,0xeb,0xba,0x6b,0xef,0xe8,0xda,0x1b,0x8b,0x62,0x41,0xa5,0x9,0x28, + 0x52,0x14,0x54,0x40,0x94,0x2e,0xbd,0x43,0x42,0x27,0x84,0x90,0x5e,0x67,0xe6,0xde, + 0xf3,0xfe,0x71,0x67,0x26,0x93,0x10,0x48,0x8,0x93,0x90,0xe0,0xf9,0xed,0x27,0x2b, + 0x99,0xcc,0x3d,0xe5,0xb9,0xa7,0xfc,0xce,0xf3,0x3c,0xe7,0x79,0xa,0xa,0x14,0x1b, + 0xaa,0x24,0x82,0x15,0x2c,0xd9,0x26,0x24,0x24,0x4,0xf5,0xf6,0x68,0x65,0xae,0x79, + 0x0,0xfd,0xfa,0xf5,0xab,0xd2,0x7a,0xd7,0xaf,0x5f,0x1f,0x94,0x72,0x7a,0xf4,0xe8, + 0xe1,0x8f,0x52,0x5e,0xdd,0x61,0xb3,0xd9,0xaa,0x24,0x59,0x7b,0xa7,0xb,0x3a,0x12, + 0x1b,0x6b,0x29,0x8,0x2,0x9d,0xdc,0x2d,0xae,0x20,0x11,0x9a,0xe4,0x60,0x5e,0x26, + 0x9f,0xec,0xda,0x58,0x3c,0x15,0x4e,0xa9,0x66,0x3d,0x51,0x94,0x93,0xd0,0x34,0xc0, + 0x34,0x88,0x95,0x6,0xbb,0x6f,0x7e,0x12,0x53,0x8,0x34,0x6f,0xda,0x19,0x8b,0x44, + 0x95,0x78,0xde,0x97,0xa4,0xd9,0x9b,0x22,0xc7,0x4,0x4c,0x8f,0x81,0xc7,0x74,0x23, + 0xa5,0x60,0x57,0x66,0xa,0xad,0xa6,0xbd,0xcd,0xea,0xd4,0xfd,0x20,0x74,0xc,0xa1, + 0x23,0x65,0x60,0x6c,0x2b,0x59,0x5c,0xd3,0x14,0xf8,0xdf,0x8a,0x6c,0x56,0xc5,0x19, + 0x55,0xf1,0x80,0xaa,0x2,0xc0,0x0,0x5d,0x42,0xa1,0x8b,0xaf,0xf7,0x6c,0xc2,0x30, + 0x4d,0xc,0x4c,0x9f,0x62,0x4b,0x11,0xac,0x60,0x6e,0xb2,0x55,0x7d,0xf2,0xf4,0xd5, + 0x57,0xbb,0x76,0x6d,0xea,0xd4,0xa9,0x43,0x41,0x41,0x41,0xb5,0x4d,0xe8,0xec,0x83, + 0xc7,0x90,0xac,0x4d,0xf4,0x66,0x5d,0x3f,0x65,0xe7,0x4c,0x62,0xf2,0xdb,0x33,0xb8, + 0x5d,0xad,0x6a,0xa9,0xbd,0x2a,0x6d,0xd3,0x79,0xff,0xc3,0xaf,0x48,0x49,0x39,0x5e, + 0x2a,0x11,0x2e,0x19,0xbc,0xb4,0x2c,0xb4,0x6c,0xd9,0x32,0x68,0x6d,0xcb,0xcc,0xcc, + 0x54,0x66,0xc2,0x6a,0x4e,0xb0,0x9c,0x4e,0x27,0x17,0x5e,0x78,0x61,0x8d,0x5a,0xf3, + 0x2e,0xbf,0xfc,0xf2,0x2a,0xad,0x37,0x58,0x9a,0xd8,0xf3,0xce,0x3b,0xf,0xcd,0x17, + 0x67,0xa9,0x6,0xa0,0x69,0xd3,0xa6,0x95,0x9e,0x89,0x23,0xa1,0x4d,0x42,0xa9,0x6b, + 0x95,0x10,0x96,0xc9,0x4b,0x8,0x9d,0x71,0xab,0x17,0x20,0xd,0xcf,0xa9,0x9,0x4b, + 0x40,0xac,0x2b,0x0,0x4c,0x49,0x98,0xcd,0xc1,0xa4,0x2b,0x46,0x52,0x3b,0x32,0xa, + 0x69,0x98,0x7e,0x52,0x55,0xaa,0x65,0x51,0xc8,0x22,0x93,0xa1,0xb0,0x1c,0xc5,0x85, + 0x26,0xb0,0x63,0x63,0xee,0x91,0x5d,0x5c,0x3a,0x73,0x22,0x87,0xb3,0x32,0xd0,0x85, + 0x37,0x5f,0xad,0x16,0xa8,0xad,0x22,0x38,0x71,0xa8,0x7c,0xe6,0x3f,0xbf,0x29,0x50, + 0x14,0x99,0x3,0x3,0x35,0x73,0x86,0x9,0x86,0x8d,0x30,0x21,0xb9,0xb5,0x75,0x27, + 0x26,0xf5,0xbd,0x6,0xa4,0x44,0x93,0xe5,0x4b,0x4c,0x7d,0xda,0x64,0x5b,0x2d,0xb7, + 0x67,0x67,0x63,0x17,0x42,0x10,0x1e,0x1e,0xee,0x3f,0x7d,0x54,0xe7,0xc5,0xc3,0x30, + 0x61,0xeb,0x41,0x37,0x84,0x95,0x3d,0xc8,0xbb,0xc5,0xc5,0x13,0x1b,0xe2,0xa8,0xf6, + 0xa4,0xd1,0x87,0x7b,0xef,0x19,0x55,0x6a,0x58,0x6,0x21,0x4,0xf9,0xf9,0x6e,0x34, + 0x4d,0xe0,0x74,0xda,0xca,0xf5,0x4e,0xa3,0xa2,0xa2,0x88,0x8a,0x8a,0xa,0x4a,0x88, + 0x85,0xf4,0xf4,0x74,0x36,0x6f,0xde,0x4c,0xd7,0xae,0x5d,0xd5,0x84,0x9,0x32,0x32, + 0x33,0x33,0x71,0xbb,0xdd,0x41,0xd1,0x54,0x54,0x97,0x54,0x34,0xe5,0x45,0x55,0x68, + 0x56,0x2,0x91,0x9c,0x9c,0x1c,0x94,0x72,0x5a,0xb6,0x6c,0x59,0xa3,0x7c,0x56,0xe3, + 0xe2,0xe2,0x88,0x88,0x88,0x20,0x3b,0x3b,0xbb,0x52,0xca,0xef,0xd8,0xa1,0x33,0xed, + 0xce,0x6f,0x5b,0xea,0xdf,0x4c,0x69,0xa2,0x9,0x8d,0x2d,0x19,0xa9,0x2c,0x3d,0x7c, + 0xa4,0x84,0x43,0x7a,0x29,0x34,0x42,0x8,0xcb,0x51,0xa,0x8b,0xfc,0xe8,0x8,0xc6, + 0xb5,0xef,0xc6,0xe0,0xc6,0x9,0x18,0x1e,0x3,0xa1,0x59,0x17,0xc2,0x74,0x71,0x62, + 0x40,0x66,0xab,0x34,0xaf,0x76,0xcb,0x14,0x7e,0xd3,0xa0,0x21,0x4d,0xfe,0xb9,0xe6, + 0x57,0xc6,0xaf,0x5d,0x4,0x21,0x21,0xe0,0xb4,0x83,0x1b,0x6f,0xf2,0x8f,0x92,0xa6, + 0xc8,0x20,0xbc,0x57,0x7f,0x5a,0x1c,0xd3,0x5b,0x9e,0x69,0xe9,0x8f,0xa4,0xf4,0xfe, + 0x5b,0x87,0xc2,0x3c,0xea,0x45,0xc5,0xd0,0xbb,0x41,0x13,0xa6,0xf4,0xb9,0x1e,0x61, + 0x71,0x49,0x4b,0x3c,0x9a,0x57,0xdb,0x24,0x94,0xf,0x56,0x8d,0x47,0x49,0xd,0x9a, + 0xae,0x57,0xef,0x48,0xe2,0xb9,0x46,0x21,0xeb,0xf4,0xef,0x40,0x96,0x41,0x34,0x24, + 0x9c,0xdf,0xc8,0x46,0xa8,0xa3,0x66,0x4,0x54,0x2d,0x4b,0xf6,0x42,0x13,0xe4,0xe4, + 0xba,0xca,0x5d,0x56,0x74,0x74,0x34,0xd,0x1a,0x34,0x8,0x4a,0xdb,0x4c,0xd3,0xe4, + 0xf7,0xdf,0x7f,0xc7,0xed,0x76,0xd7,0xc8,0xb8,0x69,0xd5,0x19,0x5,0x5,0x5,0x41, + 0xc9,0x8b,0x67,0xb3,0xd9,0x82,0x7a,0xb1,0xa1,0x2a,0xd0,0xac,0x59,0xb3,0x2a,0xad, + 0x2f,0x58,0xf1,0xdc,0x6a,0xd7,0xae,0x5d,0xa3,0x8,0x56,0x6c,0x6c,0x2c,0xa1,0xa1, + 0xa1,0x95,0x56,0x7e,0xa3,0xc6,0xf5,0x39,0xff,0xfc,0x76,0xd6,0x26,0x1e,0x70,0x38, + 0xb7,0xbc,0x34,0xc,0x90,0x26,0x9f,0x6e,0x5b,0xcb,0xd1,0x9c,0xc,0x6f,0x92,0x64, + 0x1f,0xe9,0xf0,0xb2,0xad,0x52,0x2c,0x69,0x42,0x7a,0xa0,0x30,0x9f,0x41,0x4d,0x5a, + 0x33,0xee,0xc2,0x3e,0x8,0x53,0xa2,0x79,0xd7,0x47,0xdd,0xeb,0x90,0xee,0x8f,0xc8, + 0x4e,0x80,0xbf,0x97,0xf7,0xdf,0x86,0x34,0x10,0x42,0x92,0x9c,0x9f,0xcb,0x2d,0xcb, + 0x66,0x31,0x7e,0xdd,0x12,0x70,0x3a,0xc1,0xb4,0xd2,0xde,0x18,0x76,0xe1,0x37,0x23, + 0x9e,0x91,0x29,0xb0,0x44,0xca,0x9d,0xe2,0xb,0x71,0xd1,0x77,0x74,0x9,0x18,0x2e, + 0xec,0x52,0x72,0x7e,0x44,0x2c,0xcf,0x76,0xed,0xc7,0xd2,0xc1,0x77,0x32,0xfd,0xb2, + 0x51,0x68,0x5e,0xbf,0x68,0x9b,0x26,0xd0,0x34,0x9f,0x9,0x34,0xf8,0x6e,0x2d,0x35, + 0x46,0x83,0xa5,0x36,0x99,0xb3,0x87,0x4d,0x7,0x5d,0xa0,0x39,0xca,0xd4,0x9f,0xda, + 0xcc,0x8,0x2e,0xc,0x6b,0x8d,0xa6,0xd5,0x9c,0x31,0x75,0xaa,0x50,0xd,0x21,0x4e, + 0x1b,0x21,0x4e,0x5b,0xb9,0xb5,0x71,0x71,0x71,0x71,0xb4,0x6e,0xdd,0x9a,0xed,0xdb, + 0xb7,0x7,0xa5,0x7d,0xdf,0x7f,0xff,0x3d,0xe3,0xc7,0x8f,0x27,0x26,0x26,0x46,0xd, + 0xc2,0x6a,0x48,0xb0,0x74,0x5d,0xa7,0x6e,0xdd,0xba,0x35,0xa6,0xdf,0x52,0x4a,0x9c, + 0x4e,0x27,0xba,0xae,0xfb,0x2f,0xd8,0x54,0x36,0xe,0x1f,0x3e,0x1c,0x94,0x72,0x22, + 0x22,0x22,0x6a,0x14,0xc1,0x72,0x3a,0x9d,0x27,0xc4,0xa7,0xa,0x26,0x12,0x12,0x12, + 0x8a,0x13,0x9e,0x80,0xd4,0x38,0x36,0x4d,0x27,0x29,0x3b,0x83,0x39,0x7b,0xb7,0x5a, + 0x9,0x93,0x35,0xcd,0xcb,0x45,0x2,0x1c,0x91,0x44,0x80,0x4d,0xcc,0x7b,0xed,0x50, + 0xba,0x4d,0xba,0xc4,0x37,0xe2,0xf3,0x3e,0xd7,0x10,0x6a,0xb3,0x61,0x25,0xb4,0xf0, + 0xea,0xa8,0x4,0x25,0xea,0x11,0xc5,0x2,0x89,0x9a,0xc2,0x9a,0xf,0xcb,0x8e,0x1d, + 0xe0,0x5f,0x2b,0x16,0xf2,0xdb,0xa1,0xbd,0x8,0x9b,0x86,0x44,0x2f,0x4a,0xbc,0x5c, + 0x92,0xd1,0x55,0x6c,0x10,0x97,0xd0,0x7c,0xc9,0xe2,0xec,0xca,0x17,0x1c,0xd5,0x63, + 0x60,0xe4,0xa7,0x73,0x6d,0xbb,0x6e,0xf4,0x6d,0xd0,0x82,0x21,0x4d,0x12,0x68,0x16, + 0x5d,0xb,0x4c,0xb3,0x68,0x3d,0xf,0x8c,0x4,0x21,0xbd,0x1e,0x66,0x41,0x1e,0x62, + 0x4a,0x83,0xa5,0x50,0x26,0xb6,0x1f,0x76,0x97,0x6b,0xa4,0x44,0xda,0x42,0x68,0x15, + 0x56,0xaf,0xc6,0xf4,0x4b,0x8,0x81,0x61,0x18,0x6c,0xd8,0xb0,0xf9,0x84,0xd,0xb7, + 0x22,0x7e,0x7a,0xe,0x87,0x83,0xb,0x2e,0xb8,0x20,0x68,0x1b,0xc1,0xb1,0x63,0xc7, + 0x58,0xb2,0x64,0x89,0xca,0x93,0x58,0x9,0x4,0x2b,0x58,0xe3,0x47,0xd3,0xb4,0x1a, + 0x35,0xde,0x75,0x5d,0x27,0x24,0x24,0xa4,0xca,0xea,0xc,0x56,0xca,0xa7,0x9a,0x36, + 0x7,0x7c,0x44,0xb6,0x32,0x10,0x11,0x1e,0xc1,0x80,0xfe,0x3,0x8b,0xc9,0xc6,0x97, + 0x3,0xd0,0xc4,0x4a,0x43,0x33,0x73,0xff,0x4e,0xf6,0xe6,0x65,0x5b,0xc1,0x3d,0x4d, + 0x59,0xa4,0x2d,0x92,0x25,0xd2,0xcf,0x98,0x6,0xe,0x24,0x48,0x83,0xe6,0x91,0x75, + 0x98,0xd2,0xe7,0x6,0x6a,0x85,0x84,0x63,0x9a,0xc2,0xbf,0xe4,0xfb,0x68,0x4c,0x20, + 0x99,0x93,0x52,0x22,0x4c,0x10,0x1e,0x70,0xe3,0x41,0xc3,0xe4,0xb3,0xc4,0xad,0xc, + 0x5d,0x30,0x85,0xdf,0x92,0xf7,0x81,0x4d,0x2f,0x8a,0xc6,0x1e,0xe0,0x0,0x5f,0x2c, + 0x14,0x43,0xc5,0x6,0x42,0xd1,0xb3,0x1e,0x13,0xc,0x1,0x86,0x40,0x98,0xa0,0xe1, + 0x41,0x14,0x2,0xb9,0x99,0x5c,0xd5,0xb8,0x25,0x73,0x46,0xdc,0xcb,0x57,0x97,0xdf, + 0xc0,0x7d,0xe7,0x77,0xa7,0x49,0x54,0xc,0x1e,0x69,0x7a,0xe3,0xa6,0x4a,0xbf,0x3f, + 0xbf,0x2f,0x65,0x90,0xf4,0xf9,0x8e,0xfd,0x55,0x9d,0xdc,0x4f,0xd7,0xe1,0x58,0x21, + 0x78,0xd8,0x9b,0xea,0x29,0x97,0x2a,0x37,0xd4,0x2e,0xa8,0x1f,0xa3,0xd7,0xa8,0xbe, + 0x15,0x14,0xba,0xd8,0xb4,0x79,0xeb,0x29,0x35,0x1a,0xf9,0x5,0xe5,0xf7,0xd7,0xe9, + 0xd9,0xb3,0x67,0x50,0x6f,0x95,0xbd,0xf0,0xc2,0xb,0x6a,0x0,0x6,0x19,0x1e,0x8f, + 0xe7,0x2f,0xb9,0xe9,0x83,0x65,0x4e,0xaa,0x9,0xb7,0x1e,0x4b,0x22,0x2f,0x2f,0xaf, + 0x46,0xad,0xfd,0x6e,0xb7,0x3b,0x28,0x5a,0xd2,0xd2,0x10,0x5b,0xab,0x36,0xfd,0xae, + 0xb8,0xac,0x54,0x79,0xe8,0x8,0x72,0xb,0xb,0xf8,0x61,0xef,0x56,0xdc,0x86,0x51, + 0x5c,0x7b,0xe4,0x27,0x38,0x45,0x8a,0x1f,0x5d,0x6a,0xb8,0x91,0x38,0x84,0x83,0xf7, + 0x2e,0xbd,0x8a,0x16,0x51,0xd1,0x78,0x30,0xad,0xaf,0x69,0x3e,0xb3,0xa3,0xf4,0xc6, + 0x56,0x2f,0x7e,0xd3,0xda,0x94,0x12,0x43,0x33,0xd0,0xa4,0xe0,0xab,0x9d,0x5b,0xb8, + 0x63,0xc1,0x17,0xa4,0x7b,0xf2,0x3,0x68,0x85,0x8e,0xdf,0x2c,0x29,0x4a,0xf8,0x5a, + 0x95,0x67,0xee,0x4,0xc6,0xec,0x92,0xa5,0x90,0x2c,0x5d,0x0,0x6,0xd8,0x40,0x4a, + 0xf,0xe1,0xba,0x9d,0xd6,0x75,0xc2,0xd9,0x76,0xcb,0xbf,0x99,0x33,0xe8,0x16,0x86, + 0x34,0x6d,0x8b,0xc3,0xae,0xfb,0x23,0xce,0xdb,0x10,0x8,0xdd,0xdb,0x93,0x62,0xb7, + 0xa,0x7d,0x3d,0x53,0x1a,0x2c,0x75,0x9a,0x3f,0xb,0xd8,0x77,0xdc,0x53,0xae,0x91, + 0xe2,0xb0,0x9,0x62,0xc3,0x6b,0x4e,0xbf,0xa4,0x94,0x84,0x87,0x85,0x72,0xf3,0x4d, + 0xd7,0x9f,0x52,0x9d,0x7f,0xe8,0x70,0xf9,0xfd,0x48,0x2e,0xb9,0xe4,0x92,0xa0,0x9e, + 0x5c,0xd7,0xae,0x5d,0xcb,0xfc,0xf9,0xf3,0xd5,0xe1,0x22,0x88,0x8,0x96,0x6,0xa7, + 0x26,0xbe,0xf,0xc3,0x30,0x82,0x16,0x3,0xac,0x3c,0x8,0x56,0x76,0x83,0xcc,0xcc, + 0xcc,0x1a,0x25,0xe7,0xc2,0xc2,0xc2,0xa0,0x11,0xf9,0x92,0x48,0x48,0xf0,0x5,0xb6, + 0x2d,0xae,0x51,0xf2,0x5e,0x1d,0xe4,0x8f,0x63,0x7,0x58,0x7c,0x60,0x8f,0x37,0x90, + 0x67,0x29,0x41,0x3c,0xa5,0xf4,0xc7,0x7b,0x32,0x34,0xd,0x99,0x99,0xc9,0x4b,0xdd, + 0xfa,0x70,0x55,0x93,0x4,0x4c,0x9,0x9a,0x2c,0x7a,0xc,0x21,0xbc,0x56,0x37,0xe9, + 0xf,0x2c,0xea,0xf3,0x95,0xd7,0x74,0x8d,0x94,0x42,0x17,0x63,0x7f,0x9b,0xc3,0xcd, + 0xb,0xbf,0x6,0x7b,0x8,0x78,0x4c,0xff,0x73,0xe5,0x26,0x52,0x65,0x69,0xab,0x84, + 0xf4,0x5,0xf7,0x2a,0x1e,0xf1,0xdd,0x4,0xcc,0x2,0x44,0x6e,0x2e,0xf7,0xb6,0xef, + 0xce,0xf7,0x3,0x6e,0x64,0xc7,0xc8,0x47,0x39,0x2f,0x26,0x6,0x13,0x8b,0x0,0x8a, + 0x80,0xff,0x59,0x31,0xba,0xbc,0x3d,0xa8,0xa2,0xb9,0xab,0x4c,0x84,0xa,0x65,0xe2, + 0x48,0xba,0x51,0x2e,0x66,0x6f,0xb7,0x9,0xa2,0x43,0x6b,0x4e,0xbf,0xca,0x4b,0xd6, + 0x5b,0x34,0xab,0x55,0xee,0xcd,0x34,0x22,0x22,0x22,0xe8,0x37,0xff,0x1e,0x7b,0xec, + 0x31,0x75,0xb8,0x8,0x32,0xc1,0xa,0x56,0x32,0xf7,0x9a,0x4,0x29,0x25,0x86,0x61, + 0x90,0x97,0x97,0x57,0x65,0x75,0xc6,0xc7,0xc7,0x7,0xa5,0x9c,0xfd,0xfb,0xf7,0x57, + 0x9a,0x46,0xa8,0x32,0x90,0x95,0x95,0x55,0x69,0x71,0xec,0x7a,0xf5,0x3a,0xf1,0x10, + 0x67,0x4a,0x89,0xf4,0x48,0xdc,0x1e,0xf,0xcf,0xfd,0xb9,0xd4,0x77,0x25,0x2e,0xe0, + 0xe5,0x53,0x9c,0x9c,0x8,0x61,0x11,0xb0,0xc2,0x6c,0x5e,0xe8,0x33,0x94,0x47,0xdb, + 0xf7,0x40,0x9a,0x20,0x74,0xcd,0xfb,0x5d,0x11,0xe0,0xa2,0x65,0x69,0x76,0xdc,0xd2, + 0x8d,0x29,0x25,0xa6,0x1b,0x34,0x4d,0x72,0x28,0x37,0x8b,0x1,0xf3,0x3e,0xe3,0x7f, + 0xbb,0x36,0x80,0x33,0xc4,0x4b,0xe2,0x34,0xaf,0xbe,0x2b,0xa0,0x7a,0x21,0x82,0x10, + 0x8a,0xc1,0x4,0x69,0x20,0x4c,0xef,0x5e,0xe4,0xd2,0xd0,0x1c,0x6,0xff,0xd7,0xb1, + 0x7,0x7,0x6e,0x7f,0x82,0x77,0xba,0xf,0xa4,0x6f,0x7c,0x73,0xa4,0x69,0x62,0x4a, + 0x81,0x86,0xee,0x77,0xc7,0x42,0x48,0xcb,0xcd,0x4c,0xe2,0x37,0x5,0xca,0x2a,0x5a, + 0x4b,0x15,0xc1,0x52,0x28,0x13,0x19,0x9e,0x7c,0xca,0xc3,0xb0,0xec,0x1a,0x35,0x32, + 0xf0,0x87,0x61,0x98,0x98,0xe6,0xc9,0x37,0x4b,0x4d,0x3b,0xbd,0x5b,0x91,0x3e,0x42, + 0x14,0x2c,0x24,0x26,0x26,0x32,0x6d,0xda,0xb4,0x1a,0xab,0x35,0xa9,0x8e,0x4,0x2b, + 0x18,0xbe,0x53,0xa6,0x69,0x92,0x96,0x96,0x56,0xa3,0xe,0x14,0xe9,0xe9,0xe9,0x55, + 0x5a,0x67,0x74,0x74,0x74,0x50,0xca,0xd9,0xbd,0x7b,0x77,0xa9,0x9,0xda,0xab,0x2b, + 0x52,0x52,0x52,0xc8,0xcd,0xcd,0xad,0x94,0xb2,0x3b,0x76,0x6c,0xef,0x8d,0x7f,0x85, + 0x5f,0xc3,0x64,0x22,0xd1,0x34,0xc1,0xca,0xe3,0x87,0x59,0xb9,0xeb,0x4f,0x84,0xdd, + 0x19,0xe0,0xc4,0x5e,0x92,0xec,0x48,0x70,0x19,0xe0,0x71,0x33,0xb0,0x45,0x47,0x1e, + 0xbb,0xa0,0x17,0x6e,0x3,0x84,0x66,0x95,0x61,0x99,0xd1,0xa4,0x37,0x52,0xbb,0x97, + 0x94,0x99,0x60,0x93,0x3a,0x48,0x13,0xd3,0x6e,0xb0,0x3d,0x33,0x9d,0x56,0x53,0xde, + 0x60,0x53,0xfa,0x51,0x2b,0xae,0x95,0xa6,0x79,0x7f,0xb0,0x7e,0xf7,0x91,0x3a,0xff, + 0xe0,0x3b,0x15,0xf3,0x27,0xc0,0x37,0x4c,0x16,0x7f,0x56,0x4a,0x84,0x29,0x2d,0x5f, + 0x2b,0x69,0x43,0xa0,0x71,0x5e,0x78,0xc,0xfd,0x9a,0xc4,0xe3,0xba,0xf1,0x19,0xde, + 0xed,0x31,0x8c,0x7a,0xa1,0x91,0xd8,0x35,0xdd,0x92,0x85,0xa6,0x79,0x9b,0xe2,0x33, + 0x5,0x7a,0x93,0x38,0x7b,0xdb,0xe0,0x33,0x5,0x56,0xd5,0x51,0x55,0x11,0x2c,0x85, + 0x32,0xb1,0xa1,0xd6,0x4c,0x90,0x65,0xfb,0x6d,0xd4,0x54,0x3f,0xb9,0x6d,0xdb,0x8f, + 0x92,0xb4,0x2f,0xbd,0x4c,0x2d,0x45,0x79,0xfb,0x35,0x64,0xc8,0x10,0x7f,0xa,0x8b, + 0x60,0xa0,0xa0,0xa0,0x80,0xf1,0xe3,0xc7,0x57,0x5a,0x4c,0x9d,0xbf,0x1a,0xc2,0xc3, + 0xc3,0x83,0x72,0xc3,0xcb,0xe3,0xf1,0xb0,0x7f,0xff,0xfe,0x1a,0xd5,0xf7,0xcd,0x9b, + 0x37,0x57,0x69,0x7d,0x4d,0x9a,0x34,0x9,0x4a,0x39,0x7f,0xfe,0xf9,0x67,0x8d,0x5a, + 0x57,0xe,0x1e,0x3c,0x58,0x29,0x66,0xcd,0xc6,0x8d,0x1b,0xd3,0xae,0x5d,0xbb,0x22, + 0x59,0x78,0xd3,0xd2,0xe8,0x12,0x4c,0x1d,0x1e,0xf8,0x65,0x6,0xc4,0x36,0x40,0x1a, + 0xde,0xf8,0x4f,0x25,0xd3,0xe1,0xf8,0x77,0x7e,0x49,0xfb,0x88,0xda,0x7c,0xdc,0x63, + 0x88,0xe5,0xca,0x84,0xe6,0x8d,0xae,0x2e,0x2c,0x62,0x25,0x44,0x51,0x74,0x76,0x1f, + 0x7,0x42,0xe0,0x91,0x92,0xf,0xb7,0xac,0xa3,0xf3,0xac,0xf7,0x28,0xf0,0x0,0x42, + 0x2f,0x1e,0xd4,0x33,0x30,0xc6,0x55,0x79,0xf,0xa5,0x22,0xa0,0x7d,0x52,0x80,0x34, + 0xbd,0x6d,0x97,0x96,0x46,0xcc,0xed,0xc6,0x26,0x4c,0x3a,0x87,0x47,0xf3,0x62,0xd7, + 0xcb,0x98,0x35,0xf0,0x26,0x16,0xd,0xb9,0x1b,0x6c,0x12,0xd3,0x30,0xb1,0x9c,0xd6, + 0x65,0x51,0x1e,0x44,0x7c,0xc1,0x57,0xbd,0xe4,0x4a,0x9c,0xbd,0x71,0xa3,0x8,0x96, + 0x42,0xd9,0xd0,0xf3,0xcb,0xa5,0xe2,0x95,0x25,0x88,0x56,0x4d,0x41,0xf3,0x66,0xb5, + 0x69,0x58,0x3f,0xf2,0xe4,0xa7,0xfe,0xcc,0x7c,0xe,0x1f,0xc9,0x2c,0x57,0xbf,0x7c, + 0xb,0xdf,0x83,0xf,0x3e,0x18,0xd4,0x36,0xae,0x59,0xb3,0x86,0xcf,0x3f,0xff,0xbc, + 0xda,0xa7,0x55,0xaa,0x9,0xa8,0x57,0xaf,0x1e,0x4e,0xa7,0xf3,0x8c,0xcb,0x71,0xbb, + 0xdd,0xec,0xd9,0xb3,0xa7,0x46,0xf4,0xd9,0x37,0x66,0x7e,0xfc,0xf1,0xc7,0x2a,0xad, + 0xf7,0x82,0xb,0x2e,0x8,0x4a,0x39,0xc9,0xc9,0xc9,0x1c,0x39,0x72,0xa4,0x46,0xac, + 0x2d,0xa6,0x69,0xb2,0x75,0xeb,0xd6,0x4a,0x99,0xa7,0x8d,0x1b,0x37,0xa6,0x55,0xab, + 0x56,0x27,0x30,0x14,0x4d,0x8,0xa6,0x25,0x6d,0x65,0x4b,0x76,0xa6,0x65,0xb,0xd3, + 0x8a,0x34,0x40,0x45,0x5a,0x2c,0xaf,0xec,0xc,0x83,0x38,0x47,0x18,0x93,0x2e,0xbf, + 0x96,0x26,0xd1,0x31,0x68,0xc2,0x86,0xae,0x5,0x10,0x36,0x1,0x42,0x4a,0x84,0x0, + 0xb7,0x89,0x95,0x3b,0x50,0x82,0xae,0xc1,0xdd,0xbf,0xcd,0xe6,0xb1,0x95,0x3f,0x91, + 0x6f,0x8,0xb0,0x69,0x7e,0xea,0xe5,0x75,0xbc,0x2a,0xd2,0x92,0x9d,0xde,0xe8,0x2c, + 0xea,0x89,0x69,0x60,0x33,0x84,0xa5,0x5,0x2b,0xcc,0x87,0xfc,0xe3,0x5c,0xd6,0xa4, + 0xd,0x13,0x7a,0xd,0xe5,0xa7,0xe1,0x77,0x31,0xae,0x53,0x6f,0xce,0x8b,0xaa,0x8d, + 0x34,0x4d,0x4b,0xf,0xa5,0x81,0xe6,0x3b,0xd8,0x7b,0xf3,0x20,0x16,0xed,0x41,0x3e, + 0x67,0xf6,0xb3,0x37,0x66,0x14,0xc1,0x52,0x50,0x1a,0x8d,0x70,0x7,0x21,0x21,0xf6, + 0x93,0xfe,0x3d,0x22,0xcc,0x41,0x4c,0x4c,0xf9,0x9c,0xcb,0x7c,0x1b,0xc0,0xe8,0xd1, + 0xa3,0x83,0xde,0xce,0x7,0x1e,0x78,0x80,0xa4,0xa4,0x24,0x45,0xb2,0xce,0x10,0xf5, + 0xeb,0xd7,0xf,0x8a,0xa3,0x7b,0x61,0x61,0x21,0xeb,0xd6,0xad,0xab,0x11,0x7d,0xf6, + 0x8d,0xcb,0xd9,0xb3,0x67,0x57,0x69,0xbd,0x9d,0x3a,0x75,0xa,0x5a,0x59,0x53,0xa7, + 0x4e,0x2d,0x46,0x16,0xab,0x2b,0x91,0x75,0xb9,0x5c,0xac,0x5a,0xb5,0xaa,0x52,0xca, + 0x8f,0x8d,0x8d,0xc5,0x66,0x2b,0x8a,0xcd,0xe7,0xbb,0xe7,0x57,0x60,0x18,0xcc,0xdc, + 0xb5,0x1e,0xb7,0xe6,0x8b,0xef,0xe4,0x35,0xd9,0xf9,0x1d,0xc5,0xf1,0x9b,0xe2,0x34, + 0x9b,0x83,0xb7,0x7a,0xd,0xa2,0x4b,0xdd,0x6,0x48,0x29,0xd1,0xbc,0x4,0xcd,0x77, + 0x5f,0xd0,0xef,0x77,0xe5,0xfd,0x44,0x47,0x23,0xdb,0x70,0xd3,0x69,0xd6,0xff,0xf8, + 0x72,0xc7,0x1a,0x5c,0x78,0xfc,0xfe,0x56,0xd6,0x8f,0x28,0x7f,0x78,0xab,0x62,0xe6, + 0x40,0x8a,0xdf,0x10,0xf4,0x3a,0xd2,0x1b,0x48,0xf4,0xfc,0x7c,0x6,0x35,0xeb,0xc0, + 0xcf,0x43,0xc7,0xf2,0xdd,0x15,0x23,0xb9,0xa3,0xed,0x45,0x44,0xd8,0xad,0xc,0x21, + 0x56,0xba,0x1d,0xd,0x81,0x40,0x43,0xf3,0x9b,0xfb,0x85,0xac,0x3a,0xdf,0x2a,0x45, + 0xb0,0x14,0x82,0x78,0x24,0x73,0x94,0x2b,0xcb,0xb8,0x28,0x71,0x5a,0xae,0x49,0x27, + 0xfb,0x93,0xb5,0x5b,0x4a,0x89,0xdd,0xae,0x13,0x16,0xea,0x28,0x77,0xbf,0xa4,0x94, + 0x34,0x6c,0xd8,0x90,0x2b,0xaf,0xbc,0x32,0xe8,0xed,0xed,0xd7,0xaf,0x1f,0xe9,0xe9, + 0xe9,0xca,0xe1,0xfd,0xc,0x10,0x1f,0x1f,0x1f,0x14,0xd,0x16,0x58,0x26,0xb7,0xaa, + 0xbc,0x95,0x77,0x26,0x58,0xb5,0x6a,0x55,0xa5,0xdd,0x6c,0x3b,0x19,0x82,0xa5,0xc1, + 0x2,0x78,0xe7,0x9d,0x77,0x8a,0x91,0xc5,0xea,0x4a,0x64,0x33,0x33,0x33,0xf9,0xf9, + 0xe7,0x9f,0x2b,0xa5,0xfc,0x3b,0xef,0xbc,0xdb,0x5f,0x8f,0x94,0x56,0xcc,0x2b,0x1, + 0x6c,0xca,0x3c,0xc6,0xf4,0x7d,0x3b,0x4a,0x64,0xc2,0x9,0xf8,0x45,0x1a,0x8,0xa9, + 0xa1,0x21,0x78,0xfa,0x82,0x9e,0x8c,0x6e,0xd5,0x9,0xb7,0xe9,0x9,0x6c,0xb8,0xff, + 0x19,0xd3,0x1b,0x82,0xc1,0x23,0x4d,0x1c,0xba,0xc6,0xc2,0x63,0x7,0xe8,0x38,0xeb, + 0x7d,0x36,0x1e,0x3d,0x8c,0xb0,0x87,0x15,0xe5,0xfa,0xb,0x8c,0x8,0x7f,0xda,0xaf, + 0x44,0x5a,0x49,0xa5,0x7d,0x3d,0x90,0x40,0x61,0x3e,0x51,0x9a,0x93,0xd1,0xd,0x1a, + 0xf2,0xeb,0x88,0xb1,0xcc,0xee,0x7f,0x3,0x97,0x37,0x49,0x20,0xc2,0xee,0xc4,0xf0, + 0x18,0x56,0xaa,0x1e,0x44,0xd1,0xc5,0x42,0x51,0x64,0x9d,0x14,0x42,0x14,0xd3,0x60, + 0x29,0x82,0xa5,0x50,0x63,0xd0,0x36,0x7d,0x8,0x8,0x57,0x39,0xa6,0x8c,0xac,0xf6, + 0xb,0x60,0x69,0xb,0xe2,0x86,0x4d,0x49,0x14,0x14,0xb8,0x4a,0x6d,0x77,0x45,0x2, + 0x8e,0xa,0x21,0x88,0x88,0x88,0xe0,0xc6,0x1b,0x6f,0xc4,0x6e,0xb7,0x7,0xb5,0xbd, + 0x49,0x49,0x49,0x3c,0xfc,0xf0,0xc3,0x18,0x86,0x51,0xe3,0xb5,0x58,0x55,0xd1,0xfe, + 0xd2,0xea,0x88,0x8e,0x8e,0x26,0x22,0x22,0x22,0x28,0xe5,0xaf,0x59,0xb3,0x86,0xe4, + 0xe4,0xe4,0x6a,0xaf,0x55,0x1,0xf8,0xf2,0xcb,0x2f,0xab,0xbc,0xee,0x46,0x8d,0x1a, + 0x5,0x2d,0x2c,0xc6,0xc1,0x83,0x7,0x59,0xb6,0x6c,0x59,0xb5,0x3d,0xc4,0xf9,0xda, + 0xf4,0xed,0xb7,0xdf,0x56,0x5a,0xa4,0xfc,0xa1,0x43,0x7,0xfb,0xd7,0x18,0x53,0x8, + 0x4c,0xc3,0x62,0x1a,0xcf,0xac,0xf8,0x9,0xa4,0x86,0xd0,0x7d,0x6c,0xc7,0x17,0x6b, + 0xa1,0xe8,0xd6,0xa0,0x34,0x24,0x57,0x34,0x6c,0xc0,0xbf,0x3b,0xf7,0xb5,0x52,0xc9, + 0x8,0xad,0x98,0x8f,0x95,0x5f,0x1f,0x26,0x4d,0x4c,0xb7,0x81,0x4d,0xe8,0x8c,0xff, + 0xf3,0x57,0x86,0xcf,0x9f,0xcc,0xbe,0xcc,0x4c,0xb0,0xeb,0x5e,0xc7,0x7a,0xcd,0x77, + 0x25,0xef,0xe4,0x7,0x6f,0x59,0xaa,0xea,0xca,0x6a,0x9a,0x10,0xd8,0x4d,0x59,0xa4, + 0x69,0x33,0x4c,0x70,0x67,0xf2,0x68,0x97,0xbe,0xfc,0x36,0xf8,0x4e,0xbe,0x1c,0x78, + 0x17,0x97,0xc4,0x35,0xc2,0xa1,0x6b,0xde,0x9b,0xa3,0x2,0xa1,0x9,0x2b,0x47,0xb4, + 0xaf,0xb4,0x80,0x8b,0x8a,0x81,0x79,0xa3,0x2b,0x1c,0x16,0x22,0x20,0xe5,0x8f,0xf4, + 0xb6,0xb5,0x58,0x52,0xa0,0xa,0xe,0x37,0x95,0xec,0xb9,0x86,0x6f,0x50,0x55,0x41, + 0x66,0xea,0x6a,0xb5,0xd8,0x56,0x8e,0x11,0xe6,0xf1,0x1d,0x48,0x6a,0x56,0xac,0x51, + 0xd6,0xfc,0xb9,0x9d,0x96,0xcd,0x4f,0x7e,0x9d,0xdc,0x34,0xa5,0xf7,0x56,0xca,0xe9, + 0xe1,0x96,0x5b,0x6e,0xe1,0xa9,0xa7,0x9e,0xe2,0xc0,0x81,0x3,0x41,0x6d,0xef,0x17, + 0x5f,0x7c,0xc1,0x45,0x17,0x5d,0xe4,0xf7,0xf3,0xaa,0x29,0x89,0xb5,0x4b,0x6e,0x44, + 0x42,0x8,0x36,0x6c,0xd8,0xc0,0xdb,0x6f,0xbf,0x8d,0xcb,0xe5,0xa,0x6a,0x1d,0x71, + 0x71,0x71,0x3c,0xf1,0xc4,0x13,0x27,0xa4,0xb2,0xf1,0xc9,0xaa,0x77,0xef,0xde,0x6c, + 0xdb,0xb6,0xed,0x8c,0xeb,0x39,0x74,0xe8,0x10,0x1b,0x36,0x6c,0xa0,0x69,0xd3,0xa6, + 0xd5,0xf6,0x3d,0x8,0x21,0x70,0xb9,0x5c,0x7c,0xf1,0xc5,0x17,0x67,0xa5,0xee,0xbe, + 0x7d,0xfb,0xb2,0x60,0xc1,0x82,0xa0,0x94,0xf7,0xf2,0xcb,0x2f,0x33,0x77,0xee,0xdc, + 0x6a,0x27,0xe7,0xc0,0x77,0xff,0xaf,0x7f,0xfd,0xab,0x72,0xb4,0x21,0x9a,0x66,0x99, + 0x7,0x4d,0xcb,0xc7,0x4a,0x33,0x24,0x9a,0x4d,0xe3,0x40,0x7a,0x1a,0xf3,0x92,0x77, + 0x0,0x21,0x1,0xe1,0x9d,0x4a,0xa4,0x93,0x31,0x6d,0xd4,0xf,0x2b,0xe4,0xc7,0x41, + 0x63,0xfc,0x7e,0x56,0x9a,0xd0,0xfc,0x4,0x42,0x78,0x53,0xc5,0x8,0x21,0x90,0x26, + 0xd8,0x1d,0x36,0x6e,0x5a,0xfc,0x2d,0x5f,0x27,0x6e,0x2,0xc3,0x6e,0x31,0x5,0x13, + 0xfc,0x79,0xd0,0xbc,0xe1,0xf,0x2c,0x92,0x55,0xda,0x8b,0xa7,0x78,0xa0,0x50,0x3f, + 0xd9,0xb3,0x3e,0x73,0xeb,0x56,0x14,0x78,0x87,0xd4,0xb8,0xbc,0x41,0x3c,0xf3,0x86, + 0x3c,0xd,0xd2,0xc0,0x30,0x3d,0x98,0xc2,0x40,0x47,0xf3,0xde,0x8c,0xf4,0x9a,0xff, + 0x8a,0x55,0x72,0x8a,0x7a,0x2b,0x3c,0x50,0xad,0x94,0x3f,0x3e,0x23,0xa9,0x45,0x38, + 0x8b,0x4c,0xa6,0x15,0xad,0x4b,0x11,0xac,0x1a,0xc,0x5f,0xaa,0x97,0xca,0x4a,0xc9, + 0xe0,0x43,0x7c,0xb4,0x56,0x2e,0x6,0xef,0x36,0x24,0xd9,0x79,0x10,0x19,0x59,0xb3, + 0x48,0xea,0x5d,0xb7,0xd,0x3a,0x25,0x51,0x59,0xf4,0xeb,0x2e,0xfa,0xf7,0x6b,0x73, + 0xda,0xe5,0xea,0xba,0xce,0xd3,0x4f,0x3f,0xcd,0x98,0x31,0x63,0x82,0xde,0xee,0x87, + 0x1e,0x7a,0x88,0xa8,0xa8,0x28,0x6e,0xbf,0xfd,0x76,0xbf,0xb9,0xa0,0x26,0x90,0xac, + 0x40,0x72,0xb5,0x66,0xcd,0x1a,0x86,0xd,0x1b,0x16,0xb4,0x7c,0x75,0x81,0x18,0x39, + 0x72,0x64,0xa9,0x79,0x2,0x7d,0x32,0xea,0xdf,0xbf,0x3f,0x13,0x26,0x4c,0x8,0x4a, + 0x5d,0xcf,0x3f,0xff,0x3c,0x43,0x87,0xe,0xad,0xd6,0x72,0x9f,0x30,0x61,0x42,0xa5, + 0x85,0xd,0x28,0xb,0xc1,0x24,0x58,0x2b,0x57,0xae,0xe4,0xcf,0x3f,0xff,0xa4,0x73, + 0xe7,0xce,0xd5,0x52,0xce,0x1f,0x7d,0xf4,0x51,0xa5,0x5,0x45,0x1d,0x3f,0xfe,0x8d, + 0x0,0x32,0x50,0xb4,0xe9,0xdf,0xbb,0xe2,0x7,0x90,0xa1,0xd6,0x55,0x42,0x3f,0xf1, + 0x1,0xd,0x61,0x69,0x80,0xa4,0xa4,0xae,0x5d,0x67,0xe5,0xb5,0xff,0xb0,0x72,0xf1, + 0x79,0x6d,0x6b,0x32,0xc0,0x11,0xca,0x8a,0x52,0x63,0x22,0x84,0xc6,0x81,0xfc,0x7c, + 0x9e,0x5c,0xbd,0x90,0x6f,0xb6,0xaf,0x46,0xb7,0x87,0x63,0x8,0xb7,0x97,0x5c,0x5, + 0x10,0x2b,0x9f,0x53,0xbb,0x38,0xb9,0x46,0xc8,0x9f,0x5f,0x5a,0xb3,0xca,0xc6,0xc4, + 0x32,0x55,0xa2,0xd3,0x36,0x22,0x82,0xcb,0x1b,0xb5,0xe0,0xd1,0xb,0x2f,0xa3,0x59, + 0x44,0xc,0xa6,0x61,0x5a,0x1a,0x39,0xcd,0x8e,0x16,0x18,0x83,0x4b,0x96,0xa6,0x94, + 0xa,0x7e,0xc4,0x75,0x8b,0xb3,0x49,0x84,0x29,0xf0,0x8,0x13,0x4d,0x82,0x89,0x40, + 0xf7,0xc6,0xcc,0x12,0xa5,0x37,0xa4,0x6c,0x52,0xac,0x68,0x8a,0x42,0x59,0x68,0x56, + 0xc7,0x66,0x4d,0x8e,0x32,0xe0,0xf2,0x48,0xd2,0xf3,0x6a,0x56,0xdf,0xca,0x32,0x1, + 0x4a,0x29,0xe9,0xdf,0xaf,0xcd,0x69,0x9b,0x24,0x7c,0x65,0xdd,0x75,0xd7,0x5d,0x34, + 0x6b,0xd6,0xac,0x52,0xda,0x3e,0x66,0xcc,0x18,0xde,0x7e,0xfb,0xed,0x93,0xb6,0xbd, + 0x3a,0xcb,0xfc,0xc7,0x1f,0x7f,0x64,0xd0,0xa0,0x41,0x95,0x42,0xae,0x0,0x5e,0x7b, + 0xed,0xb5,0x62,0x84,0xae,0x24,0x6,0xe,0x1c,0x18,0xb4,0xba,0xd6,0xac,0x59,0xc3, + 0x82,0x5,0xb,0xaa,0xe5,0xe5,0x3,0x29,0x25,0x59,0x59,0x59,0x4c,0x9f,0x3e,0xbd, + 0xca,0x12,0x3c,0x97,0x44,0x97,0x2e,0x5d,0x82,0x56,0xd6,0xf1,0xe3,0xc7,0xf9,0xf8, + 0xe3,0x8f,0xab,0x9d,0x89,0x5c,0x8,0x41,0x6a,0x6a,0x2a,0xaf,0xbf,0xfe,0x7a,0xa5, + 0xd5,0x71,0xfd,0xf5,0xd7,0x5,0xaa,0x5b,0x10,0x9a,0xc6,0x1f,0xc9,0x89,0xac,0x4c, + 0x3b,0x5a,0x44,0x7a,0x2,0xd6,0x1,0x69,0x7a,0x10,0x36,0x9d,0x48,0x9b,0xce,0x57, + 0x57,0x5c,0x4f,0x63,0x67,0x4,0x1e,0x8c,0x62,0x87,0x9c,0xa2,0x83,0xa5,0xa5,0x21, + 0xfb,0xf5,0x48,0x22,0x57,0xcf,0xfd,0x8c,0x6f,0x76,0xae,0x5,0x3d,0x4,0x43,0x98, + 0x45,0xce,0xec,0x81,0x5a,0xab,0xa2,0x1,0x56,0xe2,0xbf,0x25,0x19,0x96,0x95,0xb3, + 0x10,0x97,0x1b,0xdc,0x26,0x5d,0x6a,0xd7,0xe3,0x93,0xde,0x83,0x99,0x35,0xf0,0x66, + 0xde,0xed,0x35,0x9c,0x66,0x61,0xd1,0x56,0xfd,0x9a,0x40,0x17,0x2,0x3b,0x2,0x5d, + 0x4,0x27,0x10,0x7c,0xa0,0x23,0xbd,0x3c,0x41,0x43,0x20,0x8b,0xff,0xbf,0x8,0xe8, + 0x9a,0x21,0x31,0x31,0x90,0xb8,0x8b,0x69,0x2,0x65,0x60,0x3f,0x15,0xc1,0x3a,0xf7, + 0xe1,0xd3,0x92,0x54,0x36,0x9a,0xd6,0xb1,0x97,0x6b,0x60,0xe5,0xbb,0x24,0x47,0x32, + 0xcc,0x1a,0x2b,0xcb,0xca,0x2a,0xb3,0xb2,0x7c,0x5f,0xc,0xc3,0xe0,0xe1,0x87,0x1f, + 0xe6,0xc3,0xf,0x3f,0xac,0xb4,0x3e,0x4,0x5b,0x1e,0x42,0x8,0x16,0x2e,0x5c,0xc8, + 0xd,0x37,0xdc,0x40,0x6a,0x6a,0x6a,0xa5,0xd4,0x73,0xd3,0x4d,0x37,0xf9,0x49,0xed, + 0xc9,0x88,0x67,0x78,0x78,0x38,0x6d,0xdb,0xb6,0xd,0x5a,0x9d,0xb7,0xdc,0x72,0xb, + 0xa6,0x69,0x56,0x3b,0xa2,0x2b,0x84,0x60,0xf3,0xe6,0xcd,0x2c,0x5d,0xba,0xf4,0xac, + 0xbd,0xf3,0x16,0x2d,0x5a,0xd0,0xb2,0x65,0xcb,0xa0,0x95,0x39,0x61,0xc2,0x4,0x36, + 0x6f,0xde,0x5c,0x6d,0x8,0xad,0xaf,0xd,0x6f,0xbf,0xfd,0x76,0xa5,0x85,0xed,0x88, + 0x8f,0x6f,0x40,0xfd,0xfa,0xf5,0x3,0x52,0xe4,0x68,0x78,0xc,0x93,0xd9,0xfb,0x76, + 0x93,0x9e,0x9b,0x53,0x74,0x93,0xcf,0x97,0x6b,0x10,0x1,0x9a,0xd,0x91,0x9b,0xc5, + 0x8b,0xdd,0x7,0x70,0x65,0xa3,0xd6,0x18,0x18,0xde,0xa0,0x9b,0x27,0x6,0xda,0x14, + 0x2,0x66,0x27,0x6d,0x61,0xd8,0x82,0xaf,0xd8,0x92,0x91,0x8a,0xd0,0x1c,0xd6,0x58, + 0x96,0x81,0x4c,0xa7,0x44,0x84,0x76,0xdf,0xe7,0x81,0xa6,0x48,0x21,0x8b,0x87,0x84, + 0x40,0x20,0x5d,0x59,0xf4,0x6b,0xdc,0x9a,0x8f,0xfa,0xc,0x66,0xf9,0x35,0x63,0xb9, + 0xfd,0xbc,0xce,0xb4,0x8e,0x8e,0xc3,0x25,0xd,0xc,0xd3,0xb4,0xc,0x71,0xfe,0x84, + 0xd5,0xc2,0x9b,0xa6,0x27,0x8,0xf3,0x48,0x14,0xa5,0xf8,0xf1,0x99,0xfd,0x8a,0x8c, + 0x94,0x3e,0x3,0xa0,0xd7,0x18,0x28,0xc1,0xf4,0xc6,0xfe,0xb2,0xd9,0x74,0x6c,0x9a, + 0x1d,0x9b,0xe6,0xc0,0xf4,0xb6,0xcd,0x67,0x46,0xf5,0x13,0x2d,0x45,0xb0,0xce,0x7d, + 0x54,0xd5,0x62,0x9e,0x50,0xdf,0x6,0xa6,0x2c,0xd3,0x4c,0x98,0xe3,0x71,0xb3,0x37, + 0x27,0xa3,0x46,0x91,0xaa,0x4f,0x3e,0xfd,0x96,0xb4,0xb4,0x8c,0x13,0x64,0xe9,0x5b, + 0xc8,0xce,0xc4,0xfc,0xe6,0x7b,0xb6,0x5b,0xb7,0x6e,0xdc,0x78,0xe3,0x8d,0x95,0xd6, + 0x8f,0xfb,0xee,0xbb,0x8f,0x97,0x5e,0x7a,0xe9,0xac,0x99,0x80,0xca,0xbb,0x1,0x9, + 0x21,0x98,0x32,0x65,0xa,0x83,0x6,0xd,0xaa,0x34,0x33,0x8a,0xd3,0xe9,0xe4,0xdd, + 0x77,0xdf,0x2d,0xd7,0x77,0x1f,0x78,0xe0,0x81,0xa0,0xd5,0x9b,0x9a,0x9a,0xea,0xf7, + 0xbd,0xa9,0x4e,0x9b,0xbe,0x61,0x18,0x41,0xcf,0x2c,0x70,0xba,0x73,0xa0,0x59,0xb3, + 0x66,0x41,0xd,0xd7,0x0,0x30,0x60,0xc0,0x0,0x72,0x72,0x72,0xce,0x3a,0xc9,0xf2, + 0xad,0xd,0x5b,0xb6,0x6c,0x29,0xf7,0xb8,0xab,0x8,0x6,0xf,0x1e,0x6c,0x91,0x5, + 0x6f,0x9d,0x86,0x69,0x92,0x94,0x93,0xce,0xf4,0xc4,0x6d,0x98,0x81,0x6b,0x93,0x69, + 0x22,0xc,0x81,0x90,0x1e,0x64,0x41,0x1e,0xf,0x76,0xec,0xc3,0x3,0xed,0xba,0x62, + 0x48,0x3,0x21,0xac,0x70,0xc,0x86,0x90,0x78,0xa4,0x81,0x21,0x3d,0x8,0x20,0xdb, + 0xe3,0xe2,0xa9,0x8d,0x2b,0xb8,0x61,0xd1,0x34,0xb2,0xd,0x2b,0x89,0xb2,0xd4,0xbc, + 0xdc,0x4a,0x14,0x27,0x2c,0x27,0xd8,0xe6,0x7c,0xe4,0xca,0xb4,0xa2,0xbd,0xeb,0x6, + 0x80,0x7,0x5c,0x85,0xd4,0xd3,0x5,0x5d,0xa3,0xeb,0xf0,0xcb,0xb0,0xb1,0xfc,0xd0, + 0xff,0x46,0xfe,0xd6,0xae,0x1b,0xba,0x10,0x48,0xc3,0xd2,0x84,0xd9,0xbc,0xa4,0x4a, + 0x50,0xf4,0xe,0x3,0x93,0x4a,0x9f,0xf1,0xfe,0xe6,0x8b,0x7b,0x6a,0x82,0xdb,0x34, + 0xc0,0x30,0x91,0xa6,0x89,0x94,0x26,0x6e,0x29,0x11,0x46,0x91,0x9d,0xb5,0xd0,0xe3, + 0x62,0x6f,0xe6,0x71,0x76,0x66,0x1c,0xe3,0x99,0x8d,0xcb,0x19,0xb2,0x60,0x32,0xc3, + 0xe7,0x7f,0x89,0x26,0x4,0xa6,0x69,0xf8,0x4d,0xab,0x56,0x94,0x88,0xf2,0x8f,0x37, + 0x45,0xb0,0x14,0xca,0x44,0xa7,0x46,0x21,0x50,0x18,0x5d,0x66,0xa8,0x6,0x97,0x96, + 0xc1,0x1a,0xd7,0x26,0x2b,0x10,0x6f,0xd,0xc1,0x2d,0x37,0xf,0x25,0x2a,0x2a,0xb2, + 0xd4,0x8d,0xc1,0xe5,0x32,0xd9,0xb5,0x27,0xe5,0x8c,0x26,0xba,0x10,0x2,0x87,0xc3, + 0xc1,0xb8,0x71,0xe3,0x82,0x96,0xf8,0xb6,0x34,0x3c,0xf9,0xe4,0x93,0xc,0x1f,0x3e, + 0xdc,0x7f,0x82,0xae,0x2e,0x69,0x45,0x7c,0x1b,0x90,0xdb,0xed,0xe6,0xc1,0x7,0x1f, + 0x64,0xf4,0xe8,0xd1,0x95,0x6a,0xaa,0x7a,0xe1,0x85,0x17,0x88,0x8d,0x8d,0x2d,0x57, + 0xdf,0x47,0x8c,0x18,0x11,0x94,0x94,0x39,0x3e,0xbc,0xf7,0xde,0x7b,0x2c,0x5b,0xb6, + 0xac,0x5a,0x99,0xa,0x9f,0x7e,0xfa,0x69,0x96,0x2f,0x5f,0x7e,0xd6,0xf,0x82,0x3, + 0x7,0xe,0xc,0xaa,0xb6,0xfd,0xe8,0xd1,0xa3,0x5c,0x7f,0xfd,0xf5,0xb8,0x5c,0xae, + 0xb3,0xa6,0x35,0xf4,0x8d,0xed,0xc2,0xc2,0x42,0x86,0xf,0x1f,0x5e,0xa9,0x9,0xa9, + 0x7b,0xf6,0xbc,0xd8,0x1a,0xab,0x52,0x62,0x48,0x89,0xae,0x69,0xcc,0x4e,0xda,0xcc, + 0xde,0xec,0xe3,0x45,0x8e,0xe7,0x3e,0xcd,0x8c,0xf0,0x20,0xd,0x83,0xa1,0x6d,0x2e, + 0xe0,0x85,0xae,0x97,0x59,0x81,0x42,0xd1,0x10,0x42,0x43,0x13,0x1a,0x9a,0xe9,0xbd, + 0x8b,0x24,0x6d,0x6c,0xcb,0x4e,0x65,0xf4,0x92,0x6f,0x79,0x7e,0xf9,0x7c,0x5c,0x42, + 0x2b,0x71,0x2d,0x4f,0xb,0x20,0x55,0x81,0xf6,0x36,0x59,0x9c,0x5c,0xf9,0xd9,0x84, + 0xc0,0x70,0x67,0xe3,0x30,0x35,0xee,0x6d,0xd7,0x9d,0x99,0x3,0x6e,0xe3,0x97,0x61, + 0x77,0x72,0x59,0xc3,0x96,0x84,0xd8,0x6c,0x48,0x6f,0x2e,0x49,0xe1,0x4f,0x63,0xa3, + 0x79,0xff,0x4d,0xf9,0x7d,0xaa,0x4a,0xb9,0xed,0x47,0xc0,0x6f,0x45,0xb7,0x22,0x8b, + 0x62,0x7f,0x9,0x1,0x9a,0x14,0x14,0x6a,0x6,0x52,0x98,0x68,0x42,0xc3,0x2e,0x4, + 0x2e,0x24,0x9f,0x6f,0x5d,0xcb,0xb3,0xeb,0x7e,0xe5,0xae,0xc5,0xdf,0xd3,0x6f,0xde, + 0x97,0xf4,0x9c,0xf3,0x19,0xcf,0xad,0xfc,0x91,0xb9,0x7b,0x77,0x30,0x3f,0x79,0x1f, + 0x3b,0xd2,0x8f,0xa2,0x69,0x7a,0x80,0x22,0x4f,0x16,0xe5,0x5a,0x54,0x4,0x4b,0x21, + 0x18,0x8b,0x48,0xb8,0xdd,0x41,0x7,0xfd,0x62,0xca,0x74,0xc4,0x12,0x82,0xad,0x7, + 0xd,0xf2,0xdd,0x35,0x23,0x7c,0x80,0x45,0x7e,0xec,0xd8,0x6c,0x7a,0xa9,0x1b,0xa2, + 0xdd,0xae,0xd1,0xac,0x49,0xed,0xe0,0x90,0xd4,0x4e,0x9d,0xf8,0xdb,0xdf,0xfe,0x56, + 0xa9,0xfd,0x59,0xb4,0x68,0x11,0x17,0x5d,0x74,0x11,0xdf,0x7d,0xf7,0x9d,0x5f,0xe5, + 0x5e,0x1d,0x4e,0xf7,0xc9,0xc9,0xc9,0xf4,0xec,0xd9,0xb3,0x52,0x4f,0xf8,0x0,0xe7, + 0x9d,0x77,0x9e,0x3f,0xc0,0x6b,0x59,0x9b,0xae,0x94,0x92,0xe8,0xe8,0x68,0xfa,0xf7, + 0xef,0x1f,0xb4,0xfa,0x73,0x73,0x73,0x19,0x3a,0x74,0x28,0x69,0x69,0x69,0x67,0x55, + 0xf6,0x3e,0xb9,0x4f,0x9b,0x36,0x8d,0x57,0x5f,0x7d,0xb5,0x5a,0xcc,0xb5,0xd1,0xa3, + 0x47,0x7,0x9d,0x8,0xcd,0x9f,0x3f,0x9f,0xc7,0x1f,0x7f,0x1c,0xd3,0x34,0xcf,0x8a, + 0xac,0x7d,0xfd,0x69,0xd7,0xae,0x1d,0xbb,0x76,0xed,0xaa,0xb4,0x7a,0x62,0x62,0x6a, + 0xd1,0xa6,0x4d,0x82,0xbf,0x8f,0x76,0xd,0xe,0x65,0xa4,0xf1,0x65,0xe2,0x66,0x10, + 0x26,0x98,0x26,0x81,0x31,0xaf,0x84,0x10,0x74,0x8a,0x89,0xe7,0x83,0x9e,0x83,0x8, + 0xb5,0x39,0x30,0xa4,0x56,0xe4,0xa4,0x2d,0x41,0xa,0x13,0xa7,0xd4,0xd9,0x9f,0x97, + 0xc9,0x90,0xf9,0x93,0xf9,0x69,0x5f,0x92,0x95,0xe4,0x59,0xb,0x30,0x2f,0x52,0x32, + 0x9f,0xa0,0x28,0x8a,0x7f,0x55,0xd2,0x2c,0xe8,0xfb,0x62,0x6e,0x36,0xcf,0x76,0x1b, + 0xcc,0xde,0xd1,0x8f,0xf0,0xdf,0x5e,0x3,0xe8,0x5e,0xa7,0x1,0xe1,0x9a,0x13,0xc3, + 0x34,0xac,0x64,0xd4,0xde,0xb6,0x5,0x9a,0x2,0x7d,0x4,0x4d,0x20,0x4a,0xf1,0x93, + 0x2a,0x65,0x6c,0xb,0x59,0xec,0xb6,0x9f,0x9f,0x45,0x49,0xe1,0xd,0x34,0x2a,0x8b, + 0xdd,0x4,0xf4,0x35,0x5d,0xd7,0x35,0x42,0x84,0x9d,0xcc,0x42,0x37,0xf,0x2d,0x9e, + 0x4d,0xa7,0x99,0xef,0xd3,0x78,0xf2,0x6b,0xdc,0xbb,0x62,0x21,0xcf,0xae,0x5e,0xc6, + 0x37,0xfb,0xb6,0xb2,0x3f,0x37,0x8d,0x74,0x4f,0x96,0xc5,0x1f,0x6d,0x76,0xa,0xd, + 0xf,0xdf,0xef,0x4f,0x2a,0xe2,0x92,0x81,0xb7,0xa,0x15,0xc1,0x52,0x8,0xd6,0x22, + 0x62,0xd3,0xa0,0x7d,0x83,0x10,0x30,0x65,0x99,0x4,0x6b,0xcd,0xe1,0xc,0xb2,0xa, + 0x3c,0xd5,0xba,0x4f,0xa5,0x5,0x17,0x3d,0xd9,0xe2,0x6f,0xb7,0xeb,0x41,0x5b,0xbc, + 0x5f,0x7b,0xed,0x35,0x12,0x12,0x12,0x2a,0xb5,0x6f,0x99,0x99,0x99,0x5c,0x73,0xcd, + 0x35,0x7e,0x6d,0x56,0x60,0xbf,0xaa,0x3a,0xee,0x54,0x61,0x61,0x21,0xdf,0x7e,0xfb, + 0x2d,0xd,0x1b,0x36,0x64,0xcd,0x9a,0x35,0x95,0x5e,0xf7,0x83,0xf,0x3e,0x48,0xc3, + 0x86,0xd,0xcb,0xd5,0x4f,0x21,0x4,0x21,0x21,0x21,0x8c,0x18,0x31,0x22,0xa8,0x6d, + 0x48,0x4f,0x4f,0xa7,0x6d,0xdb,0xb6,0x1c,0x3e,0x7c,0xb8,0xca,0x35,0x2b,0x3e,0xad, + 0xa5,0x10,0x82,0x55,0xab,0x56,0xf1,0xc0,0x3,0xf,0x54,0x79,0x60,0xd1,0x93,0xb5, + 0x2b,0x22,0x22,0x82,0xb1,0x63,0xc7,0x6,0xbd,0xec,0xb7,0xde,0x7a,0x8b,0xf1,0xe3, + 0xc7,0xfb,0xdf,0x79,0x55,0x8e,0xf1,0xdc,0xdc,0x5c,0x6e,0xbd,0xf5,0x56,0x12,0x13, + 0x13,0x2b,0xb5,0xbe,0x26,0x4d,0x1b,0xd3,0xa4,0x49,0x13,0x34,0x4d,0xf3,0x46,0x32, + 0xd7,0x59,0x70,0x34,0x89,0x4d,0xfb,0x76,0x83,0xe6,0xf0,0x26,0x57,0xd6,0xd1,0x70, + 0x83,0x90,0xc4,0x68,0x4e,0xfe,0xdb,0x73,0x20,0xd,0xc3,0xa2,0x90,0xba,0x8e,0x2e, + 0x4,0x1e,0x69,0x20,0xd,0x2f,0x85,0x11,0x26,0x8b,0x53,0xf6,0xd3,0x71,0xd6,0xc7, + 0x24,0x66,0x66,0x62,0x8,0x13,0x19,0x10,0x13,0xcb,0x72,0x98,0x2f,0x5a,0xd3,0x7d, + 0x5a,0x2b,0xd,0xac,0x5b,0x80,0x86,0x69,0xfd,0xd9,0xe3,0x2,0x97,0x87,0x46,0x21, + 0xe1,0xc,0x6b,0xd8,0x98,0xac,0xb1,0x2f,0xf1,0x54,0x97,0xbe,0xd4,0xb,0x8f,0x24, + 0x44,0xd8,0x41,0xd7,0x90,0xba,0x44,0x13,0xda,0x9,0x7,0x3e,0x51,0xec,0xc7,0x4b, + 0xb2,0x7c,0x37,0x1b,0xa5,0x2c,0x16,0xe8,0xbd,0xd8,0xbc,0xf5,0x11,0x31,0x29,0x28, + 0x34,0xdd,0x98,0xa6,0x89,0x69,0x80,0x21,0x4d,0x3c,0x0,0x86,0xe5,0x54,0x2f,0xa5, + 0x49,0x6a,0x6e,0x6,0x3b,0xd2,0x53,0x58,0x7e,0xe4,0x20,0xc3,0x17,0x7e,0x8b,0xfd, + 0x93,0x67,0xa9,0x3d,0xf1,0xdf,0xbc,0xb3,0x73,0x2d,0x1b,0xd3,0x8e,0x91,0xe2,0x71, + 0x53,0x20,0xb,0x90,0x36,0x3,0x29,0x24,0x26,0x36,0x2b,0xa8,0xb6,0x8f,0x6c,0xba, + 0x5d,0x6c,0x3a,0x9e,0x44,0xa0,0x8a,0xbe,0xa3,0x51,0x31,0x0,0x0,0x20,0x0,0x49, + 0x44,0x41,0x54,0x4d,0x40,0xb9,0x88,0xa0,0x22,0x58,0xa,0xe5,0x86,0x4d,0x17,0x5c, + 0xd4,0xdc,0x46,0x99,0xb6,0x3f,0xa9,0x91,0x12,0xba,0x92,0x85,0xbb,0x8e,0x57,0xd9, + 0x62,0x57,0x51,0xd2,0x78,0xe8,0xf0,0x31,0x3e,0xff,0xe2,0xfb,0x52,0x7d,0xaf,0x4a, + 0x36,0x3b,0x18,0x1b,0xa5,0x4f,0x16,0xf3,0xe7,0xcf,0xa7,0x5e,0xbd,0x7a,0x95,0xde, + 0xc7,0xd9,0xb3,0x67,0xd3,0xa3,0x47,0xf,0x1e,0x7e,0xf8,0x61,0x36,0x6d,0xda,0xe4, + 0xef,0x47,0x65,0xbd,0x93,0x92,0x44,0x75,0xce,0x9c,0x39,0xc,0x1f,0x3e,0x9c,0xeb, + 0xae,0xbb,0xce,0x1b,0x2c,0xb0,0x72,0x31,0x62,0xc4,0x88,0xa,0x6d,0xe0,0x57,0x5d, + 0x75,0x15,0x8d,0x1b,0x37,0xe,0x6a,0x5b,0x52,0x52,0x52,0xe8,0xdd,0xbb,0x37,0x2b, + 0x57,0xae,0x2c,0x46,0x7c,0xaa,0x62,0xd3,0x17,0x42,0xf0,0xcb,0x2f,0xbf,0x70,0xdd, + 0x75,0xd7,0x91,0x92,0x92,0x52,0x6d,0xe6,0x1b,0xc0,0xb3,0xcf,0x3e,0x5b,0x29,0xe5, + 0xff,0xf3,0x9f,0xff,0x64,0xec,0xd8,0xb1,0xe4,0xe6,0xe6,0x56,0xba,0xe6,0xd0,0x47, + 0x60,0x33,0x33,0x33,0xb9,0xe3,0x8e,0x3b,0xaa,0x24,0x78,0x6b,0x9d,0xda,0xb5,0xa9, + 0x5f,0xbf,0x3e,0xa6,0x69,0xa2,0x69,0x1a,0x69,0x85,0xf9,0xbc,0xb2,0xee,0x67,0x8, + 0x8f,0xc6,0xeb,0x11,0xe,0x86,0x1b,0x69,0xea,0x68,0x86,0xe0,0xed,0x8b,0xaf,0xe4, + 0xf2,0xc6,0xad,0xf0,0x48,0x3,0x5d,0x8,0x34,0x4d,0xa0,0x4b,0x1b,0x2e,0xe9,0x6, + 0x69,0xf2,0xf2,0xda,0x3f,0xb8,0x6a,0xfe,0xa7,0x64,0xe6,0xe7,0x58,0xf9,0x4,0x3, + 0x9d,0xd2,0x65,0x11,0x8d,0xb0,0x1c,0xd6,0x8b,0xc8,0x96,0x2f,0xe8,0xa7,0x44,0x82, + 0x21,0x69,0x1a,0x53,0x8b,0xff,0x74,0xbd,0x94,0xa5,0x43,0xee,0x60,0xf6,0xa0,0x3b, + 0x89,0xf4,0x5a,0x2,0x34,0x61,0xe5,0x8,0xd4,0xfd,0xb1,0xb6,0x8a,0xc6,0x40,0xa9, + 0xef,0x47,0xc8,0x22,0x67,0x74,0xaf,0x86,0xcc,0xaa,0xe5,0x44,0x63,0x9c,0x5f,0x3b, + 0x25,0x24,0x4e,0x6c,0x68,0x1a,0x68,0xba,0xc4,0x63,0x5a,0xfe,0x55,0xab,0x8f,0x1f, + 0xe1,0xb9,0x35,0xbf,0xf2,0xd0,0xb2,0x1f,0x18,0x32,0x7f,0xa,0x6d,0xa7,0xbf,0x4b, + 0xaf,0xd9,0xef,0x32,0x7b,0xcf,0x3a,0x3c,0xa6,0x84,0x90,0x28,0xd0,0xed,0x56,0x92, + 0x6a,0x1,0xa0,0x83,0xd4,0xf1,0x26,0x35,0xf4,0x92,0x55,0xaf,0x86,0xce,0x66,0x63, + 0x7f,0x7e,0x3e,0xd9,0x85,0x5,0xde,0x84,0xd8,0x56,0xb,0x84,0x32,0x11,0x2a,0x4, + 0x77,0x81,0x84,0x5e,0x11,0xed,0xa9,0x45,0xa3,0x32,0xbe,0x8,0xd8,0x6d,0x7c,0xf8, + 0x53,0x41,0x31,0xd6,0x5f,0x1d,0x11,0x57,0x37,0x96,0xcb,0xfa,0x76,0x29,0x75,0x33, + 0x10,0x42,0xf2,0xeb,0xef,0xfb,0x83,0xaa,0x81,0xf0,0x2d,0x2c,0xcd,0x9b,0x37,0xe7, + 0xad,0xb7,0xde,0xa,0x7a,0x84,0xf7,0xd2,0x70,0xec,0xd8,0x31,0xde,0x7e,0xfb,0x6d, + 0x2e,0xbd,0xf4,0x52,0xae,0xbf,0xfe,0x7a,0x76,0xed,0xda,0x15,0x74,0xad,0x4a,0xa0, + 0xd6,0x4,0xac,0x74,0x2c,0x3d,0x7a,0xf4,0x60,0xe4,0xc8,0x91,0x41,0x8b,0x7d,0x54, + 0xe6,0xbb,0x8c,0x8b,0x63,0xf2,0xe4,0xc9,0xc5,0x36,0xc0,0xf2,0xa2,0x61,0xc3,0x86, + 0x5c,0x7d,0xf5,0xd5,0x41,0x6f,0x53,0x62,0x62,0x22,0x7d,0xfb,0xf6,0xe5,0xa3,0x8f, + 0x3e,0xaa,0x74,0x73,0xad,0x3f,0x2f,0x9d,0x10,0xbc,0xf1,0xc6,0x1b,0x5c,0x7d,0xf5, + 0xd5,0x41,0xf,0x6e,0x1b,0x8c,0x36,0xc6,0xc6,0xc6,0xf2,0xd0,0x43,0xf,0x55,0x4a, + 0xf9,0x13,0x26,0x4c,0xe0,0x8a,0x2b,0xae,0xe0,0xd8,0xb1,0x63,0x95,0x26,0x6b,0x9f, + 0x9c,0x37,0x6d,0xda,0x44,0xfb,0xf6,0xed,0x99,0x3e,0x7d,0x7a,0xa5,0xcb,0x4d,0xd3, + 0x34,0xfa,0x5f,0x39,0x8,0x5d,0xd7,0xd0,0xbc,0xb9,0x7,0x27,0xef,0xde,0xcc,0x9e, + 0xf4,0x4c,0x84,0x2f,0xd9,0xb2,0xf7,0xfc,0x22,0x4d,0x83,0xc7,0x3b,0xf7,0xe4,0x96, + 0xb6,0x5d,0x28,0x34,0x3c,0x56,0xac,0x2b,0x29,0x91,0xa6,0x89,0x66,0x13,0xb8,0x25, + 0x3c,0xba,0xfc,0x47,0xfe,0xb3,0xee,0x67,0xf2,0xd,0x81,0xd0,0xf4,0x12,0xa9,0x75, + 0x8a,0x48,0x44,0xa0,0x7b,0x93,0x30,0xbd,0x9b,0x80,0x61,0x0,0x1e,0x5a,0x47,0xc5, + 0xf2,0x71,0x9f,0xab,0xd9,0x78,0xcd,0x58,0x9e,0xb9,0xa0,0x1f,0x8d,0x22,0xa2,0x30, + 0xd,0x3,0xd3,0xf4,0xdd,0xb8,0xb,0x34,0xdf,0x51,0xec,0xa2,0x50,0xe9,0xf3,0x53, + 0x4,0x54,0x6b,0xa5,0xe9,0x91,0xa6,0xb0,0xac,0x9f,0x48,0xff,0x1a,0x23,0xa5,0xb7, + 0x5c,0x61,0xc5,0xf8,0x3a,0x90,0x97,0xc3,0x86,0xd4,0x14,0xe6,0x24,0xee,0x62,0xf0, + 0xfc,0x2f,0x69,0x3a,0xf9,0x15,0xfa,0x7f,0xf7,0x9,0xcf,0x6e,0xfc,0x9d,0x77,0xb7, + 0xae,0x63,0x55,0x7a,0x32,0x9a,0x6e,0x3,0x47,0x18,0x68,0x36,0xcb,0xa7,0x2c,0x80, + 0xd4,0xf9,0x23,0xd1,0x7,0x58,0x1a,0x8b,0x43,0x27,0x31,0x3b,0x87,0xbd,0x79,0x19, + 0x15,0xde,0xcf,0x14,0xc1,0x52,0x28,0x17,0x12,0xe2,0x42,0x88,0x8f,0x2a,0x7,0x29, + 0x30,0x43,0x58,0x5e,0xef,0x43,0x7e,0x58,0xed,0xf6,0x9a,0xea,0xab,0xa7,0x16,0xcb, + 0x66,0xd3,0x69,0xd2,0xa4,0xc1,0x9,0xed,0xb3,0x7e,0x17,0x5c,0xd6,0xb3,0x71,0xd0, + 0xdb,0xee,0x5b,0x58,0x46,0x8d,0x1a,0xc5,0xd,0x37,0xdc,0x50,0x65,0x7d,0xcd,0xc8, + 0xc8,0x60,0xfa,0xf4,0xe9,0xb4,0x69,0xd3,0x86,0xce,0x9d,0x3b,0x33,0x7d,0xfa,0x74, + 0x92,0x93,0x93,0xc9,0xce,0xce,0x3e,0x23,0xed,0x92,0x94,0x92,0xbc,0xbc,0x3c,0xd2, + 0xd2,0xd2,0x98,0x31,0x63,0x6,0x1d,0x3a,0x74,0xa0,0x7b,0xf7,0xee,0xac,0x58,0xb1, + 0xa2,0xca,0xf2,0xf3,0xd9,0x6c,0x36,0xa6,0x4e,0x9d,0x4a,0x68,0x68,0x68,0x85,0x6f, + 0x7b,0xfe,0xfb,0xdf,0xff,0xe,0xaa,0xb3,0xbb,0xf,0x5,0x5,0x5,0x8c,0x1d,0x3b, + 0x96,0x21,0x43,0x86,0x90,0x98,0x98,0x58,0x66,0xde,0xcb,0x8a,0x68,0xac,0x7c,0x9a, + 0x85,0x43,0x87,0xe,0x71,0xc3,0xd,0x37,0xf0,0xd8,0x63,0x8f,0x91,0x97,0x57,0xfd, + 0x82,0xd1,0xf9,0x36,0xd7,0xfb,0xef,0xbf,0x9f,0xe8,0xe8,0xe8,0x4a,0xa9,0x63,0xc5, + 0x8a,0x15,0xc4,0xc7,0xc7,0x33,0x65,0xca,0x94,0x62,0xe3,0x2f,0x58,0x1a,0xc4,0x9c, + 0x9c,0x1c,0x3e,0xfe,0xf8,0x63,0x3a,0x77,0xee,0xcc,0xc1,0x83,0x7,0xab,0x44,0x6e, + 0x9a,0xa6,0x71,0x49,0xef,0x9e,0x8,0xa1,0xe1,0x91,0x26,0x99,0xee,0x2,0xa6,0xee, + 0x58,0x8e,0xb4,0x85,0x58,0x4e,0xe3,0xbe,0x8c,0x38,0x48,0xae,0x6f,0x7e,0x3e,0xcf, + 0x5c,0x78,0x19,0xa6,0x69,0xe2,0xd4,0x74,0x4,0x78,0xc3,0x20,0xc0,0x8e,0xd4,0xa3, + 0x8c,0x5c,0x3c,0x83,0xb7,0xd6,0x2e,0x6,0x61,0x7,0x4d,0x9c,0x98,0x18,0x59,0xf8, + 0x55,0x55,0xde,0x9c,0x7e,0x1a,0x98,0x6,0xc2,0x34,0x8,0xf1,0xb8,0xe8,0xd1,0xb0, + 0x39,0x1f,0xf5,0xbc,0x9a,0xd,0xd7,0xdd,0xcf,0xdd,0x9,0x9d,0x89,0xb4,0x3b,0x41, + 0x3,0xbb,0xd0,0x10,0x9a,0x56,0x44,0xa0,0xbc,0xb9,0x5,0x3,0x9d,0xd1,0x3,0x2d, + 0x8e,0x25,0x13,0xd1,0x58,0xcf,0x60,0x99,0x6,0xbd,0x37,0x24,0xd,0x69,0x20,0x31, + 0xbd,0xef,0xce,0x24,0xd7,0xe3,0x26,0xcb,0x55,0xc8,0x2f,0x87,0xf7,0xf2,0xfa,0x86, + 0xdf,0x79,0x66,0xe5,0x22,0x2e,0x9b,0xf7,0x5,0x17,0x4c,0x7f,0x87,0xa1,0x73,0x27, + 0xf0,0x73,0x72,0x12,0x47,0x3c,0x26,0x99,0xba,0xc0,0x14,0x6,0xd8,0x25,0xe8,0x1a, + 0xa6,0xf0,0x6a,0xa8,0x74,0xbd,0xb8,0x3,0x3f,0xe2,0xc4,0x5b,0x91,0x81,0x39,0x1c, + 0x5,0xa0,0x9,0x52,0x73,0xd2,0x38,0x98,0x93,0x55,0xfc,0xb9,0xd3,0x59,0x9f,0x14, + 0x75,0x50,0x28,0xf,0x62,0xa3,0xa0,0x4f,0x4c,0x7b,0xb6,0xe6,0x1c,0x3c,0x75,0xf4, + 0x37,0x1,0x10,0xca,0xf3,0x7f,0xae,0xa0,0x7f,0x87,0xde,0x38,0x42,0xaa,0x8f,0x16, + 0xcb,0xba,0xf1,0xe3,0xc1,0xe9,0xb4,0x9d,0x40,0x7a,0x4a,0x6e,0x4,0xc2,0xe7,0xc8, + 0x59,0x49,0xa7,0xe0,0x89,0x13,0x27,0x72,0xe8,0xd0,0x21,0x7e,0xfd,0xf5,0xd7,0x2a, + 0x95,0xc1,0xba,0x75,0xeb,0xb8,0xfe,0xfa,0xeb,0x9,0xd,0xd,0xa5,0x6b,0xd7,0xae, + 0x74,0xed,0xda,0x95,0x76,0xed,0xda,0xd1,0xa8,0x51,0x23,0x1a,0x36,0x6c,0x48,0xfd, + 0xfa,0xf5,0x9,0xf,0xf,0x3f,0x21,0x19,0xb2,0xdb,0xed,0x26,0x2f,0x2f,0x8f,0xe4, + 0xe4,0x64,0x8e,0x1c,0x39,0xc2,0xe1,0xc3,0x87,0xd9,0xb2,0x65,0xb,0xab,0x57,0xaf, + 0x66,0xc5,0x8a,0x15,0x64,0x67,0x67,0x9f,0x95,0x77,0xfa,0xe4,0x93,0x4f,0xd2,0xb7, + 0x6f,0xdf,0xa,0x93,0x2b,0x29,0x25,0xf5,0xeb,0xd7,0xe7,0x95,0x57,0x5e,0x61,0xdc, + 0xb8,0x71,0x95,0xd2,0xc6,0xb9,0x73,0xe7,0xf2,0xdb,0x6f,0xbf,0x71,0xd7,0x5d,0x77, + 0x31,0x7c,0xf8,0x70,0x7a,0xf7,0xee,0x5d,0x2c,0xc8,0x63,0x69,0xe3,0xb0,0xbc,0x64, + 0x7d,0xcd,0x9a,0x35,0x4c,0x9f,0x3e,0x9d,0x89,0x13,0x27,0x92,0x96,0x96,0x56,0xed, + 0xd7,0x91,0x56,0xad,0x5a,0x71,0xe7,0x9d,0x77,0xf2,0xd6,0x5b,0x6f,0x55,0xca,0xe1, + 0xcb,0x34,0x4d,0x46,0x8f,0x1e,0x4d,0xef,0xde,0xbd,0x19,0x33,0x66,0xc,0x43,0x87, + 0xe,0x25,0x26,0x26,0xe6,0x84,0xf9,0x57,0x9e,0x39,0x1a,0x78,0x40,0x99,0x32,0x65, + 0xa,0x5f,0x7c,0xf1,0x45,0x95,0xdf,0xc8,0x8c,0x8f,0xaf,0x4f,0xf3,0xe6,0xcd,0xac, + 0x9b,0x70,0xa6,0xce,0xaa,0xd4,0x7d,0xac,0x3c,0x7e,0xc,0xa4,0xcd,0x7b,0x3d,0xe, + 0x28,0x28,0xa4,0x67,0xbd,0xc6,0xbc,0x7b,0xe9,0x10,0x7f,0xc0,0x50,0x1f,0x49,0xb0, + 0x9,0x8d,0xa9,0x49,0x5b,0xf8,0xcf,0xea,0x5f,0xd8,0x75,0xfc,0x8,0xb6,0x88,0x8, + 0xc,0x6f,0xd4,0xf2,0x62,0x1,0x43,0x3,0xb5,0x57,0xc2,0xeb,0xeb,0x95,0x93,0x4a, + 0xfd,0xda,0xd,0xb9,0xac,0x5e,0x3,0x6e,0x6e,0xdd,0x85,0x2e,0xf1,0xd,0xa9,0x1b, + 0x12,0xe1,0x27,0x42,0x22,0x80,0x30,0x5,0x86,0x5a,0xf0,0xf3,0x17,0x29,0x2,0xcc, + 0x7e,0x45,0x54,0xcb,0xe7,0xcd,0xe4,0xff,0xcd,0x77,0x10,0xf7,0x86,0x91,0xd0,0x0, + 0x97,0x34,0xd8,0x9c,0x76,0x8c,0xe4,0xdc,0x4c,0xb6,0x66,0xa7,0xf3,0xf3,0xc1,0x44, + 0x8e,0x65,0x67,0xb1,0x2b,0x3f,0x83,0x8c,0xdc,0x2c,0xf0,0x78,0x40,0x77,0x80,0xcd, + 0x9,0x8e,0x90,0x0,0xad,0x14,0x78,0x13,0x32,0x52,0x3c,0x2b,0x74,0x40,0x6e,0x46, + 0xff,0x75,0xc3,0x53,0x8c,0x3,0xaf,0xa9,0xd4,0x30,0x4c,0x92,0xf3,0x72,0x8b,0xb5, + 0x5d,0x9e,0x6,0xcd,0x52,0x4,0x4b,0xa1,0xdc,0xa4,0xe0,0xf1,0xe,0xdd,0xf8,0xf0, + 0xd0,0x6c,0x2b,0x2d,0xc3,0xa9,0x46,0x98,0xd4,0x59,0x65,0xff,0x95,0x57,0x36,0xdb, + 0x78,0xaa,0x4b,0x8f,0x6a,0x93,0xc6,0xc5,0x66,0xd3,0x58,0xb1,0x7a,0x3f,0xd,0x1b, + 0x44,0xd3,0xaa,0x45,0xed,0x53,0x2e,0xaa,0x15,0xd9,0xf4,0x4e,0xe7,0x24,0xef,0x74, + 0x3a,0x99,0x39,0x73,0x26,0xc3,0x86,0xd,0x3b,0x2b,0x41,0x20,0xf3,0xf3,0xf3,0x59, + 0xba,0x74,0x29,0x4b,0x97,0x2e,0x45,0xd3,0x34,0xc2,0xc2,0xc2,0x8,0xb,0xb,0x23, + 0x34,0x34,0x14,0x9b,0xcd,0x86,0xae,0xeb,0x56,0xde,0x33,0x29,0x31,0x4d,0x13,0xc3, + 0x30,0xf0,0x78,0x3c,0x14,0x14,0x14,0x90,0x97,0x97,0x47,0x7e,0x7e,0x3e,0x6e,0xb7, + 0xfb,0xac,0xbe,0xcf,0xfe,0xfd,0xfb,0xf3,0xcc,0x33,0xcf,0x9c,0xd1,0xbb,0xf2,0x3d, + 0xf7,0x7f,0xff,0xf7,0x7f,0x4c,0x9e,0x3c,0x99,0x8d,0x1b,0x37,0x56,0x4a,0x5b,0xb3, + 0xb2,0xb2,0x78,0xf3,0xcd,0x37,0xf9,0xe4,0x93,0x4f,0x68,0xd9,0xb2,0x25,0xd7,0x5d, + 0x77,0x1d,0xb7,0xde,0x7a,0x2b,0x8d,0x1a,0x35,0x3a,0xed,0xb2,0x52,0x53,0x53,0xf9, + 0xe6,0x9b,0x6f,0xf8,0xec,0xb3,0xcf,0x48,0x4a,0x4a,0x22,0x3d,0x3d,0xbd,0x46,0xac, + 0x23,0x81,0xb9,0xfa,0x3e,0xf8,0xe0,0x83,0x4a,0xd5,0x72,0xfe,0xf6,0xdb,0x6f,0xac, + 0x58,0xb1,0x82,0x86,0xd,0x1b,0xd2,0xbf,0x7f,0x7f,0xee,0xbb,0xef,0x3e,0x3a,0x75, + 0xea,0x54,0xae,0x71,0xe2,0xfb,0xce,0xc6,0x8d,0x1b,0x79,0xff,0xfd,0xf7,0x99,0x3b, + 0x77,0x2e,0x87,0xf,0x1f,0x3e,0x2b,0xda,0xf8,0x3e,0x7d,0x2e,0x23,0x26,0x26,0x16, + 0xd3,0x34,0xd0,0x35,0x9d,0xf1,0x1b,0x96,0x61,0x98,0x20,0x74,0xaf,0xe,0xc8,0x6d, + 0x10,0x19,0x1e,0xc6,0xe4,0x1,0xa3,0x88,0x73,0x86,0x62,0x98,0x12,0x29,0xd,0x90, + 0x1a,0xba,0xa6,0xf1,0xea,0xda,0xdf,0x78,0x76,0xf3,0x12,0xf2,0xb,0x3d,0xe0,0x8, + 0xc1,0xe3,0xf7,0xa9,0xa,0xf0,0xb9,0x12,0x12,0x5d,0x9a,0x18,0x8,0x84,0x74,0x20, + 0xdd,0xb9,0x38,0x85,0x87,0x47,0x7a,0xf4,0x67,0x64,0x8b,0xb,0x69,0x17,0x5d,0x17, + 0x87,0x4d,0x43,0x22,0x30,0xd,0xd3,0xe2,0x29,0xde,0x90,0x11,0x7e,0xd2,0x71,0xc2, + 0xfa,0xe9,0xb,0x42,0x85,0x15,0x15,0xdd,0xd4,0xd0,0xbc,0x26,0x39,0x13,0x13,0xe1, + 0x35,0x9e,0x19,0x78,0xd0,0x35,0x9b,0xff,0xd9,0xcf,0x93,0xb6,0xb0,0xf2,0x70,0x22, + 0x7b,0x32,0xd3,0xd8,0x96,0x95,0x4e,0x5a,0x5e,0x36,0x2e,0x53,0xe2,0x96,0x12,0xf0, + 0x46,0x95,0xb7,0x39,0xc1,0xe6,0xb0,0x34,0x6c,0x2,0xeb,0xf2,0x95,0x16,0x10,0x68, + 0xd5,0x47,0xa0,0x4a,0xfe,0x3b,0x30,0x87,0xe1,0xa9,0x58,0x52,0xc0,0x73,0x86,0xae, + 0xb1,0x2d,0x33,0x95,0x42,0xc3,0xc0,0xa9,0xe9,0x56,0xda,0x1c,0xa5,0xc1,0x52,0xa8, + 0xc,0x52,0xd0,0xb4,0x81,0x60,0x74,0xfe,0xdf,0xf9,0x26,0xf4,0xbf,0xa7,0x26,0x59, + 0xde,0xd3,0xca,0x67,0xab,0x8f,0x70,0x6b,0x13,0xf,0xcd,0xe2,0x6c,0xd5,0x82,0x64, + 0xb9,0xdd,0x6,0x7d,0x2e,0x69,0x51,0x2a,0xa1,0x12,0x42,0x90,0x98,0x74,0xc,0x87, + 0xc3,0x4e,0xa3,0x86,0x31,0x55,0xb2,0xd1,0xc4,0xc4,0xc4,0xf0,0xe5,0x97,0x5f,0xd2, + 0xbf,0x7f,0x7f,0x76,0xec,0xd8,0x71,0xd6,0xe4,0x62,0x9a,0x26,0x39,0x39,0x39,0xe4, + 0xe4,0xe4,0xd4,0x98,0x31,0xd9,0xb1,0x63,0x47,0x7e,0xfc,0xf1,0xc7,0x72,0x6b,0x25, + 0xca,0x42,0x48,0x48,0x8,0xcf,0x3c,0xf3,0x4c,0xd0,0x6f,0x15,0x96,0x46,0xb4,0xd6, + 0xad,0x5b,0xc7,0xba,0x75,0xeb,0x78,0xf2,0xc9,0x27,0x89,0x89,0x89,0x61,0xe0,0xc0, + 0x81,0x74,0xee,0xdc,0x99,0xf6,0xed,0xdb,0xd3,0xb8,0x71,0x63,0xa2,0xa3,0xa3,0x9, + 0xd,0xd,0xa5,0xa0,0xa0,0x80,0xac,0xac,0x2c,0x8e,0x1c,0x39,0xc2,0xa6,0x4d,0x9b, + 0xd8,0xb0,0x61,0x3,0xb,0x17,0x2e,0xe4,0xd0,0xa1,0x43,0x35,0xfa,0xb0,0x56,0xa7, + 0x4e,0x1d,0xde,0x7b,0xef,0x3d,0xee,0xbe,0xfb,0xee,0x4a,0x9e,0xef,0x6e,0xf6,0xee, + 0xdd,0xcb,0x84,0x9,0x13,0xfc,0x79,0x27,0x47,0x8d,0x1a,0x45,0xd7,0xae,0x5d,0xe9, + 0xdc,0xb9,0x33,0xf1,0xf1,0xf1,0xc4,0xc4,0xc4,0x20,0x84,0x20,0x23,0x23,0x83,0x23, + 0x47,0x8e,0xb0,0x7e,0xfd,0x7a,0x56,0xae,0x5c,0xc9,0xdc,0xb9,0x73,0xcf,0x9a,0x56, + 0x36,0x10,0x3d,0x7b,0x5e,0x4c,0x58,0x58,0x28,0x1e,0x69,0x70,0xa0,0x20,0x87,0x85, + 0xdb,0xff,0x84,0xe8,0x3a,0x7e,0x47,0x73,0x34,0x3b,0xf3,0xaf,0xba,0x95,0x66,0x11, + 0x31,0x96,0x83,0xb9,0x26,0x90,0xa6,0x7,0x97,0x34,0x79,0x78,0xd9,0x7c,0x3e,0x4e, + 0x5c,0x8d,0x70,0x9,0x2b,0x56,0x96,0x8f,0x84,0xf8,0x35,0x34,0x58,0xa4,0xc5,0xd4, + 0x30,0x84,0x6,0x86,0x81,0x43,0xcb,0x60,0x54,0x42,0x57,0xde,0xea,0x35,0x94,0x68, + 0x4d,0x3,0x9b,0xee,0x27,0x26,0x42,0xb3,0x38,0x8d,0xc,0x48,0x1f,0x53,0x64,0x38, + 0x2b,0x79,0x59,0xc8,0xf2,0x65,0x45,0x2,0xa6,0x65,0xb6,0x33,0x34,0xeb,0x73,0x9b, + 0x0,0x8f,0xe1,0xc1,0x85,0xc4,0xe1,0x11,0xfc,0x67,0xc7,0x52,0x16,0xec,0xde,0xc2, + 0xce,0xac,0x63,0x14,0x18,0x2,0xc3,0x74,0x7b,0x63,0x7b,0x89,0xa2,0x58,0x5c,0x9a, + 0xb0,0x4c,0x7d,0x7e,0x62,0xa4,0x15,0x69,0xa3,0x2,0xc3,0x4b,0xf8,0xff,0x1e,0x18, + 0x5f,0xab,0xa4,0x59,0xb0,0xc,0x15,0x94,0xc4,0xef,0xdc,0x6f,0x20,0x38,0x98,0x95, + 0x81,0xc7,0x34,0xb1,0xeb,0x36,0xb4,0xd3,0xc,0xd5,0xa0,0x8,0x96,0xc2,0x69,0x91, + 0x82,0x17,0xae,0x8f,0x62,0xc6,0x94,0x26,0xb8,0xc3,0x8f,0x72,0x6a,0x17,0x3e,0x8d, + 0x24,0xc7,0x5a,0x6e,0x59,0xe8,0xe4,0xc7,0x6b,0x6,0x13,0x16,0x5e,0xbd,0x12,0x12, + 0x97,0x76,0x7b,0xb0,0x45,0xf3,0xba,0x41,0xdb,0xb0,0xcb,0xbb,0xd9,0x34,0x69,0xd2, + 0x84,0xaf,0xbf,0xfe,0x9a,0xab,0xaf,0xbe,0xba,0xd2,0xf2,0xf2,0x9d,0x6b,0xe8,0xd8, + 0xb1,0x23,0x8b,0x16,0x2d,0xa,0xea,0xbb,0x12,0x42,0x30,0x64,0xc8,0x10,0x46,0x8e, + 0x1c,0x59,0x25,0xce,0xcb,0x3e,0xf8,0xcc,0x4f,0x53,0xa6,0x4c,0xf9,0x4b,0x1d,0xd6, + 0xc6,0x8c,0x19,0xc3,0xd2,0xa5,0x4b,0xab,0xe4,0x16,0x5e,0x20,0x6a,0x92,0xac,0x1d, + 0x76,0x27,0xad,0x5a,0xb5,0xb2,0x36,0x6a,0xa1,0x33,0x74,0xce,0xc7,0x10,0x59,0xb, + 0x9f,0x13,0xba,0x86,0xc9,0x7,0xbd,0x6,0xd3,0xab,0x76,0x3,0x4c,0x6f,0x3e,0x41, + 0x81,0xe0,0x70,0x61,0x1,0x77,0x2c,0x99,0xc1,0xc2,0xc4,0xdd,0x68,0x4e,0x7,0xd8, + 0x4,0xd2,0xf4,0x99,0x4,0x65,0x0,0xc3,0xb0,0xb4,0x51,0x14,0xe6,0xd2,0xac,0x56, + 0x43,0x86,0x34,0x69,0xc1,0xbf,0x3b,0xf5,0xa5,0x5e,0x44,0x4,0xa6,0x69,0xe0,0x91, + 0x2,0x1b,0x20,0xfc,0x1,0x47,0x8b,0x93,0x8b,0x92,0x26,0xc1,0x40,0x27,0x71,0x21, + 0x8a,0x2,0x30,0x8,0x5d,0xa0,0xa1,0x91,0x59,0x50,0xc8,0xf2,0xd4,0x3,0xa4,0xe5, + 0x65,0xf3,0xdd,0xd1,0x24,0x7e,0xdd,0xb7,0x87,0x63,0x59,0xc7,0x41,0xd3,0xc1,0xa6, + 0xa3,0x49,0x1d,0x53,0x98,0x8,0xdd,0x8e,0xc4,0xa4,0x98,0x49,0xcf,0x67,0xce,0xd4, + 0x2,0x3,0x9e,0x6,0x90,0xa8,0x40,0x73,0xe0,0x99,0xaf,0xcc,0x5e,0x2d,0x96,0x9, + 0xd2,0x60,0x5f,0x6e,0x3a,0x2e,0xd3,0x20,0x4c,0x4a,0xa5,0xc1,0x52,0xa8,0x5c,0x42, + 0xd0,0xa2,0xae,0x83,0xff,0x6b,0xd3,0x83,0x37,0xf7,0x4f,0x3,0x3d,0xa4,0x8c,0xd5, + 0x34,0x84,0x65,0xf9,0x2b,0xb9,0x7c,0x41,0x6,0xbf,0xd,0xba,0x9,0x7b,0x58,0xd5, + 0xc7,0x5,0x12,0x42,0xe0,0xb4,0x89,0x72,0xbb,0x53,0x55,0x35,0x9,0x94,0x52,0xd2, + 0xb9,0x73,0x67,0x7e,0xf9,0xe5,0x17,0x86,0xc,0x19,0xc2,0xee,0xdd,0xbb,0xd5,0x40, + 0x3b,0x5,0xea,0xd5,0xab,0xc7,0xb7,0xdf,0x7e,0x4b,0xdd,0xba,0x75,0x83,0xfa,0xae, + 0xa4,0x94,0xd8,0xed,0x76,0x26,0x4c,0x98,0xc0,0xcf,0x3f,0xff,0x5c,0x23,0xfc,0x99, + 0x6a,0x3a,0x5e,0x7f,0xfd,0x75,0xd6,0xaf,0x5f,0xef,0xf,0x23,0xa2,0x50,0x1c,0x17, + 0x76,0xee,0x4c,0xfb,0xf3,0xad,0x7c,0x99,0xdf,0x1f,0xdc,0xc9,0xc6,0x8c,0x2c,0x34, + 0x87,0xcd,0xba,0x98,0x52,0xe8,0xe2,0xe1,0xf6,0x3d,0xb8,0xa7,0xed,0x45,0x18,0xa6, + 0x89,0x26,0x25,0x42,0x87,0xdd,0x69,0x69,0xf4,0x9b,0xff,0x3f,0xf6,0xe7,0xe4,0x81, + 0xc3,0x8e,0xe9,0x4d,0x5e,0x6c,0x69,0x80,0x7c,0x57,0x3,0xbd,0x81,0x49,0xa5,0x46, + 0xcb,0xb0,0x30,0x9e,0xbe,0x64,0x18,0x97,0x36,0x68,0x46,0xd3,0xc8,0x58,0xff,0xad, + 0x43,0x81,0x66,0x45,0x70,0xf0,0xfa,0x5a,0x49,0xe1,0xcb,0x61,0x68,0x45,0x92,0x37, + 0x85,0x89,0x2e,0x5,0x98,0x1a,0x68,0x16,0x1d,0xb2,0xf9,0x4c,0x76,0x80,0x69,0x18, + 0x78,0x80,0x9c,0x2,0x17,0x2f,0xec,0x58,0xc9,0xfa,0x23,0x7b,0x38,0x96,0x99,0xc1, + 0xee,0xc2,0x7c,0xa,0x5c,0x85,0x16,0x39,0xb2,0x69,0xe0,0xc,0xf5,0xaa,0xc5,0x24, + 0xa6,0xf0,0xf9,0x7f,0x99,0x14,0x73,0x42,0x17,0x1,0x2a,0x37,0x19,0xa8,0x85,0x92, + 0x1,0x5a,0x2b,0x51,0x94,0x8c,0xfa,0x4c,0x6f,0xaf,0x17,0xf3,0xbf,0xd5,0x28,0x28, + 0xc8,0xc7,0x30,0x4d,0x2,0x98,0x65,0xb9,0x89,0x9c,0x22,0x58,0xa,0xa7,0xad,0xf5, + 0x19,0xdb,0xa1,0x3,0x33,0xf,0x6e,0x66,0x9f,0xdc,0x53,0xf6,0x40,0xd3,0xec,0xac, + 0xcc,0xd8,0xc3,0x95,0xb,0xbe,0xe5,0xbb,0x1,0xd7,0x12,0x1d,0xee,0x4b,0xae,0x59, + 0x39,0x44,0xa6,0x78,0xb9,0x2,0x8f,0x21,0xf9,0x68,0x71,0x6,0x21,0x76,0x51,0xea, + 0x77,0x8f,0xa5,0xe6,0xe0,0x74,0xe8,0x44,0x47,0x87,0x95,0xaa,0xd9,0xaa,0xa,0x79, + 0x4a,0x29,0x49,0x48,0x48,0x60,0xc9,0x92,0x25,0xc,0x18,0x30,0x80,0xcd,0x9b,0x37, + 0xab,0xc1,0x56,0xa,0xe2,0xe2,0xe2,0xd8,0xb6,0x6d,0x9b,0x3f,0x15,0x4e,0x65,0x84, + 0xd1,0x88,0x89,0x89,0x61,0xf1,0xe2,0xc5,0x74,0xec,0xd8,0x51,0x9,0xbc,0x92,0xc7, + 0x7d,0x5c,0x5c,0x1c,0xaf,0xbd,0xf6,0x1a,0x23,0x47,0x8e,0xac,0x51,0xe6,0xe9,0xaa, + 0x42,0xd3,0xa6,0x4d,0x69,0xd0,0xd0,0xf2,0xd1,0xfb,0x78,0xe3,0xef,0xe8,0xc2,0x89, + 0x41,0x21,0x78,0x4,0x7d,0x1a,0xb7,0xe0,0xf9,0x9e,0x3,0x2d,0xa5,0x8d,0x14,0x18, + 0x9a,0xc9,0x8c,0xbd,0x3b,0xb9,0xf3,0xa7,0xcf,0xc9,0xb7,0x45,0x82,0xdd,0x56,0x44, + 0x3e,0x74,0x10,0x1e,0x3,0xa9,0x1,0x52,0x43,0xa0,0x91,0x10,0x15,0xce,0x83,0xe7, + 0xf7,0xe2,0x9e,0x76,0x17,0xa3,0x4b,0x61,0x5,0x1b,0x95,0xde,0x79,0x20,0x2,0x14, + 0x39,0x9a,0xd7,0x28,0x26,0x8b,0xac,0x6f,0x2,0xd0,0xc,0x1d,0x53,0x48,0xa4,0x6e, + 0xa2,0xa1,0xa1,0x49,0xc9,0x91,0xfc,0x4c,0xe,0xe6,0x67,0x73,0x3c,0x2b,0x9b,0xf7, + 0xf7,0xac,0x67,0xde,0xbe,0x9d,0x98,0x5,0x99,0xa0,0x85,0x81,0xc3,0x86,0xd0,0xbc, + 0xe9,0x72,0x6c,0x76,0x6f,0xfe,0x42,0x8a,0x48,0x91,0xe6,0x25,0x53,0xd2,0x4b,0x6, + 0x9,0xf8,0xfd,0x64,0x89,0xa6,0x4b,0x7e,0x56,0x5a,0xae,0xc4,0xa,0x2a,0xb0,0x8a, + 0x34,0x63,0x82,0x74,0xc3,0xc3,0x91,0xfc,0x1c,0xea,0x84,0x86,0xfb,0x9d,0xf1,0x95, + 0x6,0x4b,0xa1,0xd2,0xd0,0xba,0x81,0xc6,0xfd,0x2d,0x2e,0x65,0x5c,0xe2,0x2e,0x6b, + 0xf6,0x96,0xe3,0x44,0xb0,0xe4,0xf8,0x9f,0xc,0x9a,0x19,0xca,0x7,0xbd,0x6,0x70, + 0x41,0xb,0xbd,0x52,0xe2,0x31,0xf9,0xd3,0x30,0x0,0x49,0x47,0x4d,0x7e,0xdc,0x7b, + 0x90,0x77,0x96,0x1c,0x65,0x5b,0xcc,0xc,0x9e,0x3d,0x89,0xb6,0xcd,0xe1,0xd0,0xfc, + 0xe4,0xea,0x6c,0x6e,0x38,0x52,0x4a,0x1a,0x34,0x68,0xc0,0xc2,0x85,0xb,0x19,0x39, + 0x72,0x24,0xcb,0x96,0x2d,0x53,0x3,0x2d,0x0,0x9d,0x3b,0x77,0x66,0xc1,0x82,0x5, + 0x95,0x42,0xae,0x4a,0xbe,0x87,0xe,0x1d,0x3a,0x30,0x69,0xd2,0x24,0xc6,0x8c,0x19, + 0x53,0xa9,0x79,0x13,0xff,0xea,0x90,0x52,0x32,0x70,0xe0,0x40,0x5e,0x7b,0xed,0x35, + 0xee,0xbb,0xef,0x3e,0x25,0x90,0x12,0xe8,0xd0,0xde,0x22,0xf9,0xcb,0x8e,0xec,0x65, + 0xf9,0xf1,0x64,0xc,0xcd,0x3,0x1e,0x49,0xdb,0xda,0x75,0xf9,0xdf,0xa5,0xd7,0x10, + 0xa6,0xdb,0x40,0x4a,0x72,0xa4,0x9b,0x97,0xd6,0x2e,0xe5,0xad,0xf5,0xbf,0x53,0x48, + 0x38,0xde,0x6c,0xca,0xf8,0x4d,0x5d,0xa6,0x89,0x34,0x3d,0xd4,0xb1,0x3b,0xe8,0x10, + 0xd7,0x88,0x1b,0x9a,0x9e,0xcf,0x98,0xf3,0xba,0xa1,0xdb,0x4,0xa6,0xe1,0xc6,0x23, + 0x34,0xeb,0xa6,0x9f,0x56,0x4a,0xf8,0x10,0xaf,0x2f,0x92,0x14,0x45,0xb1,0xad,0x34, + 0x21,0x48,0x73,0xe7,0x93,0xeb,0x72,0xb1,0x3b,0x2b,0x8d,0x35,0xc7,0xe,0x93,0x98, + 0x99,0xc2,0xea,0xf4,0x14,0xd6,0xa6,0x1c,0x86,0xfc,0x6c,0xeb,0x66,0x9f,0xdd,0x8e, + 0xe6,0x8c,0xc1,0xd4,0xad,0x58,0x5d,0xd2,0x34,0x8a,0xc8,0x92,0x37,0xa,0x44,0x31, + 0x6f,0xf3,0x62,0x9a,0x28,0x8a,0xda,0x5f,0xe5,0xb,0x32,0x45,0xda,0x32,0xcd,0x20, + 0xc3,0xe3,0xe6,0x68,0x41,0xe,0x1d,0xa8,0x57,0x22,0x4d,0x90,0x22,0x58,0xa,0x95, + 0xa4,0x21,0xfa,0x47,0x9f,0xc6,0x2c,0x3b,0x30,0x94,0xef,0x3d,0x53,0x41,0x46,0x94, + 0x7d,0x70,0xd0,0x43,0x58,0xee,0x5a,0x4e,0xff,0x1f,0x53,0x19,0xde,0xba,0x19,0xaf, + 0x74,0xbe,0x94,0xd8,0x5a,0xa5,0x69,0x9d,0x4e,0xb7,0x3d,0xde,0xb4,0x56,0xde,0xe7, + 0x57,0x6e,0x81,0xd7,0xe,0xcd,0x66,0xe3,0x91,0x6c,0x76,0xe7,0x26,0x43,0x9d,0x6c, + 0xc2,0x8c,0x70,0x24,0x79,0xa5,0x6e,0xa8,0x31,0xd1,0xe1,0x67,0xdc,0x86,0x60,0x6e, + 0xee,0xf1,0xf1,0xf1,0xcc,0x9d,0x3b,0x97,0x27,0x9e,0x78,0x82,0xf,0x3e,0xf8,0x40, + 0xd,0x38,0x60,0xc8,0x90,0x21,0x4c,0x9c,0x38,0x31,0xe8,0x66,0xc1,0x53,0xbd,0x87, + 0xdb,0x6e,0xbb,0x8d,0xc4,0xc4,0x44,0x9e,0x7f,0xfe,0x79,0xf5,0x2,0x2a,0x19,0x63, + 0xc7,0x8e,0xf5,0xc7,0xc8,0x52,0xb0,0x50,0xb7,0x6e,0x3d,0x2e,0xbb,0xf2,0x32,0x24, + 0x92,0xaf,0x76,0x6d,0x22,0x3d,0x2f,0x1f,0xcd,0x66,0x23,0x52,0xb,0xe1,0xe3,0x4b, + 0x86,0xd2,0x22,0xca,0xba,0x88,0xb3,0x3f,0x2f,0x9b,0xb1,0xbf,0xcd,0x62,0xde,0xfe, + 0x3d,0xde,0x14,0x2f,0x1,0x1,0x34,0xa5,0x6,0xf9,0xd9,0x84,0x47,0x46,0x33,0xb2, + 0x45,0x3b,0xee,0x68,0xdd,0x85,0xe,0x75,0xe3,0x88,0xd,0x9,0xb7,0x4c,0x72,0xa6, + 0x9,0xc2,0x86,0x2e,0xc0,0xc4,0xb4,0x4c,0x8d,0x5e,0xd7,0x23,0x53,0x93,0x8,0x29, + 0xb1,0x69,0x45,0x14,0x61,0x43,0x56,0x2a,0xbb,0x8f,0x25,0xb3,0x33,0xf3,0x38,0xbf, + 0xa5,0x1e,0x61,0xcf,0xf1,0x64,0xd2,0xb,0xf3,0x48,0xf5,0xb8,0x91,0x1e,0x97,0x15, + 0x1e,0x41,0xd7,0x21,0x22,0xc6,0x4f,0x50,0x4c,0xdd,0x2c,0x9e,0xc2,0x56,0x50,0xc2, + 0x94,0x57,0x4a,0x1c,0x2a,0x51,0xf2,0x83,0x2a,0xdf,0xe4,0x8a,0x54,0x59,0xa6,0xa4, + 0xc0,0x6d,0x92,0x53,0x60,0x5,0xcf,0x16,0xa7,0xe9,0x87,0xa5,0x8,0x96,0x42,0x85, + 0x36,0x20,0xa1,0x9,0xa6,0xdf,0x78,0x21,0x3d,0xdf,0x85,0xb5,0xd1,0xb3,0x40,0x3a, + 0xca,0x31,0x1f,0x1c,0x1c,0x73,0xee,0x65,0xc2,0xfe,0x7d,0x4c,0xd8,0xb7,0x90,0xa7, + 0x62,0xff,0xce,0xbd,0x7d,0xa3,0xa8,0x5f,0x4b,0x3f,0x81,0xc0,0x95,0x45,0xf0,0x2, + 0x94,0x63,0x1c,0x3a,0x6e,0x30,0x6d,0x55,0x2e,0x5f,0x6d,0xda,0xcf,0xda,0xba,0xd3, + 0xc1,0xb4,0x59,0x93,0x23,0x4,0x90,0x76,0x4a,0x86,0xe8,0x35,0xc,0x6b,0xc6,0xeb, + 0xba,0x56,0xac,0x5f,0xd5,0x45,0xb6,0x51,0x51,0x51,0xbc,0xfb,0xee,0xbb,0x74,0xe8, + 0xd0,0xa1,0xda,0xe4,0x93,0x3b,0x5b,0xf8,0xd7,0xbf,0xfe,0xc5,0x8b,0x2f,0xbe,0x58, + 0xa5,0xef,0xc9,0x57,0xc7,0x73,0xcf,0x3d,0xc7,0x81,0x3,0x7,0xf8,0xec,0xb3,0xcf, + 0xce,0x19,0x79,0xb6,0x6b,0xd7,0x8e,0x6e,0xdd,0xba,0x55,0x8b,0x3e,0x5,0xc6,0x9c, + 0xfb,0xdb,0xdf,0xfe,0x46,0x6a,0x6a,0x2a,0x4f,0x3f,0xfd,0xf4,0x39,0x21,0xe7,0x6b, + 0xaf,0xbd,0x96,0x9d,0x3b,0x77,0x56,0xd8,0xbf,0x2c,0x22,0x22,0x82,0xa6,0xd,0x1b, + 0x71,0x28,0x33,0x93,0xd9,0xfb,0xb6,0x82,0xdd,0x86,0xe9,0xca,0xe2,0xfd,0x2b,0x6e, + 0xa7,0x77,0xbd,0xc6,0x80,0x60,0x7b,0x7a,0xa,0x23,0x7e,0x9e,0xc1,0xb6,0xcc,0x23, + 0x45,0x66,0x37,0x69,0x22,0x4c,0xd,0x29,0xb,0x41,0x7a,0x78,0xbc,0xcb,0x15,0x8c, + 0x6a,0xdd,0x81,0x76,0xb1,0x71,0xd8,0xd,0x8d,0x42,0xbb,0xe9,0x8d,0xb8,0x1e,0x30, + 0x97,0x84,0x40,0x43,0x60,0x18,0x60,0x8,0xf,0x76,0xdd,0x8e,0xee,0xf5,0xa7,0x9a, + 0x73,0x64,0x37,0x8b,0x92,0x76,0xb0,0x35,0x2d,0x99,0x1d,0x59,0xd9,0x24,0x17,0x64, + 0xe3,0x71,0xb9,0x91,0x36,0x9f,0x26,0xca,0x9b,0xaa,0xc7,0xee,0x38,0x91,0x2c,0x9, + 0x59,0xdc,0x67,0x8a,0x0,0x72,0x55,0xf2,0xf3,0x6a,0xb5,0xc9,0x51,0xe4,0x58,0x2f, + 0x74,0xf2,0x5d,0x5,0x1c,0xc9,0xcf,0xa5,0x22,0xb4,0x4f,0x11,0x2c,0x85,0xa,0x2f, + 0x8c,0xe,0x9b,0x60,0xca,0xd,0x17,0x72,0xc5,0xac,0xfd,0xec,0xb,0xdd,0x60,0x9d, + 0x98,0x44,0x19,0x3,0xd7,0x6f,0x37,0x77,0xf0,0x5c,0xda,0xeb,0x3c,0x37,0xb9,0x36, + 0x83,0x9c,0x3,0xb8,0xb4,0x9d,0x9d,0xae,0x4d,0xc2,0x69,0xa4,0xd7,0x27,0xd4,0x29, + 0x71,0xda,0x84,0x37,0xe7,0xa6,0xc0,0x94,0x60,0x98,0x92,0x42,0x8f,0xa4,0xc0,0x2d, + 0x49,0x35,0xd2,0xd9,0x9d,0x91,0xc9,0xda,0xbd,0x2e,0x16,0xee,0x3f,0xc0,0x36,0x7d, + 0x91,0xb5,0xc0,0xd4,0xd5,0xac,0x64,0x9d,0x27,0x5c,0xd3,0xc5,0x9f,0x70,0xd4,0x30, + 0xc,0x56,0xac,0xde,0x4e,0x8f,0x6e,0x6d,0xab,0xad,0x6c,0xc1,0xa,0x16,0x78,0xef, + 0xbd,0xf7,0xd2,0xa9,0x53,0x27,0x6e,0xbf,0xfd,0x76,0x76,0xee,0xdc,0xf9,0x97,0x1a, + 0x63,0x71,0x71,0x71,0xbc,0xfc,0xf2,0xcb,0xdc,0x79,0xe7,0x9d,0x15,0xe,0xc6,0x79, + 0x66,0x87,0x58,0xab,0xce,0x49,0x93,0x26,0x51,0xb7,0x6e,0x5d,0x5e,0x7f,0xfd,0xf5, + 0x6a,0x9b,0x95,0xa0,0xbc,0x68,0xdd,0xba,0x35,0x7f,0xfc,0xf1,0x7,0xaf,0xbc,0xf2, + 0x4a,0xb5,0x1b,0xef,0xba,0xae,0xf3,0xd4,0x53,0x4f,0x91,0x9b,0x9b,0x5b,0x2c,0x79, + 0x73,0x4d,0x44,0xb7,0x6e,0xdd,0x98,0x31,0x63,0x6,0x3d,0x7a,0xf4,0xa8,0x70,0x19, + 0xe7,0x9d,0x77,0x1e,0x75,0x6a,0xd5,0x62,0xdc,0xba,0x5f,0x48,0xce,0xc9,0x4,0x69, + 0x32,0xee,0xa2,0xfe,0xdc,0xd4,0xaa,0x3d,0x0,0x33,0x93,0xb6,0x70,0xcb,0xe2,0x19, + 0xe4,0x79,0x24,0x76,0xcd,0x81,0x5b,0x9a,0x96,0xe6,0xc5,0xf0,0xd0,0x22,0xd4,0xc9, + 0x55,0x2d,0x3a,0xf2,0x44,0xa7,0xcb,0xa8,0x17,0x1e,0x86,0x86,0x8e,0x29,0xd,0xd0, + 0x25,0xe,0xf,0xfe,0xcb,0xdf,0x22,0x30,0x6c,0x1,0x82,0xfd,0xf9,0x19,0xa4,0x17, + 0xe4,0xb2,0x31,0xe5,0x18,0x5f,0xec,0xdd,0xc0,0xc6,0xe3,0x7,0xc8,0x74,0x79,0xf, + 0xa4,0x12,0xb0,0x79,0xbc,0x71,0xa8,0x84,0x55,0x88,0x4f,0x53,0xa6,0x51,0x54,0x68, + 0xa0,0x33,0xfa,0x9,0x6c,0x24,0xd0,0x29,0x3d,0x8,0xce,0xe8,0x95,0xce,0xb0,0xbc, + 0xdd,0x32,0xdd,0x64,0x7a,0x5c,0x45,0xbd,0x3b,0xd,0x2d,0xba,0x22,0x58,0xa,0x67, + 0x44,0xb2,0x5a,0x35,0x10,0x7c,0x3a,0xa8,0x17,0xc3,0xe6,0x64,0x93,0x13,0xbd,0x1d, + 0x8c,0x90,0xf2,0xcf,0x1b,0x2d,0x4,0x22,0xb2,0x99,0x2f,0xa7,0x30,0x7f,0x3b,0xb0, + 0xd9,0x49,0x5d,0x57,0x2,0x31,0x11,0x92,0x70,0xa7,0x86,0x5d,0x17,0xd8,0x34,0xf0, + 0x98,0xe0,0x36,0x24,0x79,0x85,0x92,0xec,0x2,0x83,0x23,0xe6,0x61,0x70,0xa6,0x59, + 0xce,0x90,0xa1,0x1a,0x10,0x59,0x6c,0xfe,0x9e,0xa,0xba,0xae,0xd3,0xeb,0xe2,0xf3, + 0xab,0xbd,0x7c,0x7d,0x1b,0x4c,0x8f,0x1e,0x3d,0xf8,0xe3,0x8f,0x3f,0x78,0xf1,0xc5, + 0x17,0x79,0xf3,0xcd,0x37,0xff,0x12,0x63,0x6b,0xf8,0xf0,0xe1,0x3c,0xf7,0xdc,0x73, + 0xb4,0x6f,0xdf,0xbe,0xca,0x89,0x55,0xc9,0xf1,0x2d,0xa5,0xe4,0xb5,0xd7,0x5e,0xa3, + 0x5e,0xbd,0x7a,0x3c,0xf6,0xd8,0x63,0x35,0x56,0xa6,0x5d,0xba,0x74,0x61,0xd6,0xac, + 0x59,0x44,0x47,0x47,0x9f,0xf5,0x0,0xb1,0x27,0x1b,0xef,0x42,0x8,0x5e,0x7d,0xf5, + 0x55,0x5a,0xb4,0x68,0xc1,0xfd,0xf7,0xdf,0x5f,0x23,0xfd,0xdf,0xae,0xba,0xea,0x2a, + 0x7f,0x18,0x88,0x8a,0xa6,0xa1,0xd2,0x75,0x9d,0x7e,0x7d,0x2f,0x27,0xc9,0x9d,0xcb, + 0x37,0x89,0x5b,0x41,0xc2,0x5d,0x1d,0x7b,0xf0,0x6a,0xf7,0x2b,0x31,0x4c,0x78,0x7e, + 0xdd,0x62,0x9e,0x5f,0xbf,0x18,0xd3,0xb4,0xfc,0x23,0x4c,0xd3,0x4,0x4f,0x3e,0x8d, + 0x63,0xea,0x30,0xee,0xfc,0x4b,0x18,0xdc,0xb4,0xd,0xcd,0xa3,0x6b,0x59,0x9f,0x4b, + 0xf0,0x58,0xc9,0x4,0x11,0x42,0x22,0x34,0xd0,0xbc,0x4e,0xe4,0xa6,0xdb,0xc3,0xec, + 0xe4,0x44,0x96,0x1d,0xd8,0xcd,0xa1,0xec,0x74,0x56,0xa5,0xa7,0xb1,0x37,0x2b,0xc5, + 0xb2,0x11,0xea,0xf6,0x22,0x2d,0x93,0xcd,0x47,0x38,0x1c,0xc5,0x92,0x3f,0x9f,0x18, + 0x7b,0xea,0xc4,0x83,0x6d,0x29,0x27,0xec,0xe0,0x39,0xa3,0x57,0xda,0x60,0x2c,0xa9, + 0xc9,0x32,0x31,0xbc,0x41,0x71,0x4d,0xd3,0xb2,0xde,0x28,0x13,0xa1,0x42,0x95,0x9d, + 0x3e,0x2f,0x6f,0x51,0x97,0xb5,0xa3,0x47,0x72,0xd9,0x47,0xeb,0x38,0xdc,0xf8,0x7, + 0x30,0x4f,0x83,0x64,0xa1,0x81,0x70,0x58,0xbe,0xf2,0xba,0xc9,0x31,0xe7,0x36,0x8e, + 0x49,0xe0,0x64,0x41,0x9e,0x43,0x7d,0x93,0xc0,0x59,0xad,0xe7,0x68,0xb0,0x64,0x2b, + 0xa5,0xa4,0x76,0xed,0xda,0xbc,0xf1,0xc6,0x1b,0xdc,0x7d,0xf7,0xdd,0x5c,0x7b,0xed, + 0xb5,0x6c,0xdb,0xb6,0xed,0x9c,0xec,0xb3,0xc3,0xe1,0xe0,0x83,0xf,0x3e,0xe0,0xe6, + 0x9b,0x6f,0xf6,0xa7,0xea,0x39,0x9b,0xbe,0x71,0x81,0x49,0x83,0x1f,0x7d,0xf4,0x51, + 0x2e,0xba,0xe8,0x22,0xae,0xb8,0xe2,0x8a,0x1a,0xb7,0xf1,0x5f,0x74,0xd1,0x45,0xcc, + 0x9b,0x37,0x8f,0xba,0x75,0xeb,0x56,0xfb,0x3,0x9b,0x10,0x82,0x7b,0xee,0xb9,0x87, + 0xf6,0xed,0xdb,0x33,0x74,0xe8,0xd0,0x1a,0x15,0x2e,0x63,0xe8,0xd0,0xa1,0x7c,0xf5, + 0xd5,0x57,0x44,0x44,0x44,0x9c,0x51,0x39,0xba,0xae,0xd3,0xbc,0x49,0x13,0x16,0x1c, + 0xde,0x4d,0x6a,0x56,0x6,0x3d,0x1b,0x35,0xe6,0xad,0x2e,0x3,0x30,0x3c,0x92,0x7b, + 0x7e,0x9f,0xc1,0xa7,0x5b,0x37,0x81,0x5d,0xf3,0x6b,0x8d,0x74,0xc3,0xcd,0xa4,0xfe, + 0x37,0x32,0xaa,0x59,0x7b,0x4,0x6e,0x74,0xe1,0x40,0x7a,0x73,0x10,0xea,0x9a,0x40, + 0xc3,0xc4,0x90,0x12,0xc3,0x10,0x64,0x16,0xe4,0x31,0x61,0xef,0x6,0xbe,0xde,0xf2, + 0x27,0xfb,0x32,0x53,0x70,0x9,0x1b,0x6e,0x1,0xba,0xa9,0x63,0xe8,0x6,0x68,0xf6, + 0xe2,0xf1,0xa4,0x7c,0x8e,0xe7,0x7e,0xa7,0xf9,0x52,0x8,0x53,0x79,0x4f,0xb7,0x35, + 0x6e,0x11,0xf6,0xed,0x4f,0x82,0x7c,0x3c,0x54,0x84,0x16,0x2a,0x82,0xa5,0x10,0x94, + 0xd3,0x67,0x9b,0xb8,0x10,0xfe,0xf8,0x5b,0x77,0x46,0xcf,0x71,0xb1,0x5c,0x2c,0xa9, + 0xe0,0x64,0x3b,0xd5,0xe9,0xa7,0xf4,0xaf,0x96,0x17,0x6e,0xb7,0xc4,0x30,0x6a,0x9e, + 0xd9,0x21,0x90,0x5c,0xb4,0x6d,0xdb,0x96,0xad,0x5b,0xb7,0xf2,0xca,0x2b,0xaf,0xf0, + 0xf6,0xdb,0x6f,0x93,0x9c,0x9c,0x7c,0x4e,0x8c,0x9f,0xd0,0xd0,0x50,0x2e,0xb9,0xe4, + 0x12,0x3e,0xfd,0xf4,0xd3,0x13,0x52,0xc7,0x9c,0x6d,0xdf,0xb8,0x40,0xa2,0xdb,0xb7, + 0x6f,0x5f,0xe,0x1e,0x3c,0xc8,0x35,0xd7,0x5c,0xc3,0xca,0x95,0x2b,0x6b,0x84,0x6c, + 0xfb,0xf7,0xef,0x1f,0xd4,0x88,0xf7,0x55,0x35,0xd6,0x7b,0xf5,0xea,0xc5,0xe6,0xcd, + 0x9b,0xe9,0xdd,0xbb,0x37,0x49,0x49,0x49,0x67,0x94,0x94,0xbc,0xb2,0xa1,0x69,0x1a, + 0xb7,0xde,0x7a,0x2b,0x93,0x26,0x4d,0xa,0x4a,0x79,0x21,0x4e,0x27,0x75,0xdb,0xb5, + 0xe6,0xa1,0xd,0x3f,0x13,0x17,0x19,0xc1,0xa7,0x97,0x8d,0xe2,0x98,0x91,0xc7,0xf5, + 0xb,0x26,0xb3,0x66,0xdf,0xe,0x44,0x44,0x24,0x4e,0xa1,0x91,0x10,0x5d,0x8b,0x9b, + 0x5a,0x9e,0xcf,0x3f,0x2e,0xe8,0x3,0x58,0xa6,0x3c,0x81,0x13,0x43,0x7a,0x30,0x24, + 0xa4,0xe6,0xe5,0xb2,0x37,0x3f,0x93,0x94,0xac,0x6c,0xe6,0x1d,0xde,0xcd,0xf,0xfb, + 0x76,0x90,0x7c,0x7c,0x3f,0x38,0x22,0xc1,0x1e,0x86,0x10,0xa1,0x48,0xcd,0x3,0x98, + 0x18,0xba,0xdb,0xca,0x6f,0x28,0xbd,0xe9,0x68,0xfc,0x5a,0x1c,0x51,0xce,0x45,0xf7, + 0x1c,0x22,0x57,0x25,0x35,0x6c,0x9a,0x4e,0x72,0x76,0x36,0x6e,0x8f,0x7,0x4d,0x68, + 0x9c,0x4e,0x5a,0x78,0x5b,0xd5,0x4e,0x9e,0x73,0x58,0xe5,0xf0,0x17,0xd7,0x64,0x49, + 0x29,0x69,0x5a,0x4f,0xe3,0x87,0xeb,0xfa,0xf0,0xd4,0xaa,0x30,0xde,0xdf,0x33,0xc3, + 0xba,0xaa,0x2b,0xce,0x32,0x87,0xf7,0x26,0x36,0x75,0x3a,0x35,0x74,0x5d,0xd4,0x78, + 0x19,0xb,0x21,0xf8,0xe7,0x3f,0xff,0xc9,0xf0,0xe1,0xc3,0x99,0x3c,0x79,0x32,0x5f, + 0x7c,0xf1,0x5,0xfb,0xf7,0xef,0xaf,0xb1,0xfd,0xba,0xe6,0x9a,0x6b,0x18,0x33,0x66, + 0xc,0x83,0x7,0xf,0xf6,0x93,0x80,0xea,0x40,0xac,0x4e,0x26,0xff,0xf8,0xf8,0x78, + 0x16,0x2e,0x5c,0xc8,0x87,0x1f,0x7e,0xc8,0xf8,0xf1,0xe3,0x49,0x4d,0x4d,0xad,0xb6, + 0xa4,0xf5,0x3f,0xff,0xf9,0xf,0x4f,0x3c,0xf1,0x44,0x8d,0x20,0x57,0xa5,0xc9,0xba, + 0x7e,0xfd,0xfa,0x6c,0xdf,0xbe,0x9d,0x77,0xdf,0x7d,0x97,0xa7,0x9e,0x7a,0xaa,0x5a, + 0xc6,0xca,0x8a,0x8b,0x8b,0xe3,0x85,0x17,0x5e,0xf0,0xa7,0xfd,0x9,0x8a,0x9c,0x85, + 0xe0,0x70,0x6c,0x8,0x59,0xf9,0x39,0xcc,0x1c,0x78,0x13,0x29,0x39,0x19,0x8c,0x5a, + 0x32,0x9d,0xc3,0x29,0xa9,0xd4,0xaa,0x15,0x4b,0xaf,0xb8,0x26,0xdc,0xd2,0xba,0x13, + 0x97,0x35,0x6a,0x4d,0x1d,0xa7,0x15,0x7e,0x26,0xbd,0xb0,0x90,0xb4,0x82,0x1c,0x52, + 0x72,0xb3,0x58,0x70,0xf4,0x0,0xbb,0x8e,0x1d,0x22,0x31,0x33,0x8d,0x2d,0x79,0x59, + 0xe4,0x64,0xa5,0x81,0xcd,0x6,0x76,0x27,0x44,0xc5,0xe3,0xb,0x40,0x25,0x85,0xc7, + 0x4a,0x81,0x23,0x6d,0x96,0xcb,0x94,0xf0,0xc7,0x4e,0x38,0x71,0x11,0x2d,0x33,0xb7, + 0x4c,0x4d,0x5a,0x5b,0x7d,0xed,0x3d,0x59,0xbb,0x4b,0xfc,0x5d,0x40,0x86,0xc7,0xc0, + 0x83,0x7,0xa7,0x70,0x54,0x4f,0xd,0x56,0x4d,0x99,0xdc,0xa,0x67,0xb6,0x28,0xd6, + 0x8a,0x11,0xbc,0x75,0x79,0x57,0x6e,0x3c,0xaf,0x5,0x77,0xfd,0xb8,0x8c,0xed,0xda, + 0x4a,0x20,0xb4,0xea,0xe7,0x9f,0x4,0x84,0x1,0xd2,0x8d,0x96,0x5d,0x1f,0xc4,0x91, + 0x73,0x46,0xc6,0x0,0x9,0x9,0x9,0x3c,0xf7,0xdc,0x73,0x3c,0xf4,0xd0,0x43,0x4c, + 0x9d,0x3a,0x95,0x47,0x1f,0x7d,0xb4,0x52,0x93,0xe7,0x6,0x1b,0xfd,0xfa,0xf5,0xe3, + 0xcd,0x37,0xdf,0xa4,0x4d,0x9b,0x36,0xd5,0xc2,0x1c,0x78,0x3a,0xf2,0x8f,0x8c,0x8c, + 0xe4,0x1f,0xff,0xf8,0x7,0x37,0xdf,0x7c,0x33,0xe3,0xc6,0x8d,0xe3,0xab,0xaf,0xbe, + 0xaa,0x56,0xed,0x6c,0xda,0xb4,0x29,0xf3,0xe6,0xcd,0xa3,0x6d,0xdb,0xb6,0x35,0x8e, + 0x5c,0x95,0x94,0xb5,0xcd,0x66,0xe3,0x91,0x47,0x1e,0x61,0xd4,0xa8,0x51,0x3c,0xf8, + 0xe0,0x83,0xcc,0x98,0x31,0xa3,0xda,0xb4,0xf1,0xe2,0x8b,0x2f,0xe6,0x9b,0x6f,0xbe, + 0xa1,0x59,0xb3,0x66,0x41,0x95,0xf3,0xe5,0xc3,0x86,0xf0,0x63,0xea,0x5e,0xde,0xea, + 0x35,0x88,0xc4,0xf4,0x74,0xee,0x59,0x3c,0x83,0x30,0x67,0x28,0xf7,0x5e,0x78,0x31, + 0xb7,0x9c,0xd7,0x85,0xee,0x75,0x1b,0xa1,0x6b,0x1a,0xc7,0xf2,0x72,0xf9,0x76,0xcf, + 0x66,0x12,0xb3,0x8e,0xb1,0x28,0xe5,0x8,0x5b,0x53,0xe,0x93,0x99,0x97,0x43,0x9e, + 0x66,0x62,0xf8,0x1c,0xcf,0x25,0x10,0x1a,0x19,0x10,0x57,0xca,0xf0,0x3a,0xa0,0x17, + 0x39,0x9b,0xcb,0xc0,0x90,0x9,0x2,0x8b,0x80,0xf9,0x4d,0x83,0x81,0x64,0xe3,0x64, + 0x84,0xaa,0xcc,0xc4,0x7e,0xe5,0x24,0x60,0xa5,0x84,0x6e,0xa8,0x70,0x59,0x27,0x55, + 0x4d,0x9d,0x84,0x5c,0xc9,0x93,0x7f,0x4f,0x8,0x72,0xd,0x37,0xa6,0x69,0x62,0x6a, + 0xa2,0x3c,0x91,0x1f,0x8b,0x94,0x5f,0x55,0x3b,0x6b,0x14,0x11,0x39,0xd7,0x49,0x16, + 0x80,0xae,0x4b,0x7a,0x36,0xa9,0xcd,0xc6,0xdb,0x87,0x31,0xbe,0xd6,0xb3,0xd4,0x72, + 0x86,0x62,0x33,0x1d,0x96,0xfa,0xd9,0x37,0x79,0x2b,0x83,0x50,0x21,0xbd,0x41,0x5c, + 0x4c,0x22,0xb5,0x70,0xba,0x19,0x7d,0x98,0xde,0xee,0x69,0xb2,0xef,0xbb,0x87,0xc, + 0xb7,0xeb,0x9c,0x20,0xf9,0x81,0xc1,0x54,0x1,0xea,0xd4,0xa9,0xc3,0xfd,0xf7,0xdf, + 0x4f,0x41,0x41,0x1,0xaf,0xbe,0xfa,0x2a,0xad,0x5a,0xb5,0x3a,0x63,0x1f,0x90,0xca, + 0x80,0xa6,0x69,0xc4,0xc4,0xc4,0x30,0x78,0xf0,0x60,0xd6,0xaf,0x5f,0xcf,0xa2,0x45, + 0x8b,0xe8,0xd0,0xa1,0x3,0xe,0x87,0xa3,0x46,0x1d,0xc2,0x7c,0x6d,0x14,0x42,0xd0, + 0xa0,0x41,0x3,0x26,0x4f,0x9e,0xcc,0xb2,0x65,0xcb,0xe8,0xde,0xbd,0x3b,0xa1,0xa1, + 0xa1,0x67,0xb5,0x6d,0xb1,0xb1,0xb1,0x8c,0x1b,0x37,0x8e,0xbd,0x7b,0xf7,0xd2,0xae, + 0x5d,0xbb,0x1a,0x7f,0xb8,0xd,0x34,0xcf,0xd6,0xaf,0x5f,0x9f,0xe9,0xd3,0xa7,0xb3, + 0x7a,0xf5,0x6a,0xba,0x75,0xeb,0x76,0x56,0x65,0x1d,0x1e,0x1e,0xce,0xf8,0xf1,0xe3, + 0x59,0xbe,0x7c,0x39,0xcd,0x9a,0x35,0xb,0xba,0xd6,0xb5,0x56,0xc3,0x66,0xe4,0x67, + 0xe5,0xf1,0x6b,0xca,0x51,0x1e,0xfb,0x6d,0x16,0xf7,0x74,0xec,0xc5,0x1f,0x23,0xee, + 0xe6,0xd5,0x1e,0x57,0x51,0xcb,0x19,0xc6,0x8b,0xeb,0x96,0xd2,0x6f,0xce,0x27,0x5c, + 0xf2,0xfd,0x44,0x46,0x2e,0x9e,0xc9,0xb8,0xe5,0x3f,0xf2,0x53,0xd2,0xe,0xe,0xba, + 0xf2,0xc8,0xd1,0x75,0xc,0xcd,0x61,0x99,0xfb,0xd0,0x8a,0x48,0x96,0xf4,0x6e,0xc0, + 0x81,0x61,0xda,0xc1,0xfa,0xdd,0x14,0x45,0x9,0x8e,0xa5,0x37,0x84,0x82,0x14,0x45, + 0x59,0x75,0x4c,0xe9,0xfd,0x2f,0xfe,0xe4,0xcd,0xfe,0xdf,0x4d,0xc0,0x34,0x4b,0xff, + 0xf1,0xdd,0x6c,0xf4,0x95,0x25,0x29,0xf1,0x5c,0x89,0x1f,0x19,0xd0,0xe,0xb3,0xc4, + 0x8f,0xc,0xc8,0x49,0x58,0xb2,0x2c,0x59,0xe2,0xe7,0xa4,0x75,0x4,0x94,0x65,0xfa, + 0xfa,0xeb,0x6d,0x67,0xb1,0x3e,0x9a,0xfe,0x7d,0xc4,0xfa,0x5d,0x23,0xdd,0x28,0xc4, + 0x65,0xca,0xd3,0x26,0x4c,0x4a,0x83,0xa5,0x50,0x69,0xa7,0x4f,0xbb,0x5d,0xf0,0xd8, + 0x70,0x3b,0x63,0x32,0x1f,0xe3,0xeb,0xad,0xfb,0x99,0x7b,0x74,0x13,0x7f,0xee,0x73, + 0x91,0x1c,0xba,0x12,0x74,0x9b,0x95,0x31,0xdd,0xb4,0x57,0x9c,0x78,0x4b,0x40,0x2b, + 0x4,0x3,0x30,0x24,0xba,0xa7,0x1e,0x97,0xc5,0xb5,0x26,0xa1,0xa1,0xe0,0xb6,0x5a, + 0x3,0xe9,0x9a,0x60,0xad,0x29,0x79,0x79,0xb9,0x68,0x42,0x3b,0x27,0xe5,0x1c,0x78, + 0x72,0x1e,0x37,0x6e,0x1c,0xe3,0xc6,0x8d,0x63,0xc9,0x92,0x25,0xcc,0x9f,0x3f,0x9f, + 0xc5,0x8b,0x17,0x9f,0x75,0x5f,0xa1,0xb8,0xb8,0x38,0x7a,0xf6,0xec,0x49,0xef,0xde, + 0xbd,0xb9,0xe6,0x9a,0x6b,0x68,0xd1,0xa2,0xc5,0x39,0xb3,0x2e,0xf8,0x36,0xd6,0x5e, + 0xbd,0x7a,0xb1,0x62,0xc5,0xa,0x16,0x2f,0x5e,0xcc,0xd7,0x5f,0x7f,0xcd,0xaf,0xbf, + 0xfe,0x5a,0xa5,0x39,0x25,0x9b,0x34,0x69,0xc2,0x88,0x11,0x23,0xb8,0xff,0xfe,0xfb, + 0xfd,0xc9,0x81,0x4f,0xa5,0x4d,0x9,0x46,0x8,0x84,0xaa,0xc,0xa3,0x10,0x38,0xce, + 0xbb,0x74,0xe9,0xc2,0xca,0x95,0x2b,0x99,0x3f,0x7f,0x3e,0x5f,0x7f,0xfd,0x35,0x8b, + 0x17,0x2f,0xe6,0xe0,0xc1,0x83,0x55,0xd2,0x8e,0x84,0x84,0x4,0xae,0xbd,0xf6,0x5a, + 0x1e,0x7e,0xf8,0x61,0x7f,0xd0,0xdb,0x53,0x8d,0xe1,0x8a,0xf8,0x8d,0xf5,0xee,0xd2, + 0x83,0x23,0x3,0x3b,0x13,0x23,0xd,0xb2,0x5d,0xf9,0x3c,0xd9,0x63,0x10,0x1e,0xc3, + 0xe0,0xd9,0x75,0xcb,0x59,0x7a,0x70,0x27,0x59,0xae,0x2,0xdc,0x86,0x9,0x78,0x35, + 0x51,0xba,0xe,0xf6,0x10,0x8b,0x10,0x18,0x1e,0x2f,0x6d,0x12,0x27,0x6a,0x65,0xe4, + 0xa9,0xe,0xa6,0x25,0x15,0x20,0xa2,0x78,0x72,0x65,0x9f,0xb2,0xc7,0xc,0xf4,0x91, + 0x95,0x65,0x2b,0x53,0xfc,0xf1,0x3a,0x4b,0x6b,0x47,0xe0,0x7a,0x6c,0x96,0xae,0x3c, + 0xf2,0x47,0x78,0x3f,0x49,0x5d,0x52,0xb,0xf8,0xae,0x79,0xf2,0xbe,0xa,0x2,0x7c, + 0xc9,0xa4,0xb5,0x5f,0x9c,0xf0,0x39,0xa7,0x90,0x95,0x41,0xae,0xbb,0x0,0xc3,0x30, + 0xd1,0x10,0xc8,0xd3,0xd0,0x10,0x54,0x19,0xc1,0xa,0x9,0x9,0x41,0xf,0xd,0x85, + 0xd3,0xcd,0x4a,0xa2,0x41,0x48,0xa8,0x41,0x78,0x78,0xb8,0x62,0x2e,0x65,0x2d,0x42, + 0xe1,0x15,0x30,0xc5,0x85,0x38,0x8,0xb,0xb,0xad,0xb4,0x45,0x11,0x20,0x26,0x1a, + 0xee,0xeb,0xd1,0x84,0xfb,0x68,0x42,0xb6,0x1,0x4b,0xe,0x5d,0xc1,0xa2,0x4d,0x2e, + 0x16,0xed,0x3d,0xcc,0x96,0xda,0xb3,0xc1,0xd0,0xbc,0x27,0x6,0xc3,0x7b,0x7a,0x10, + 0x60,0xd8,0x2,0xfa,0x22,0x41,0xf7,0xc6,0x60,0xf1,0xfd,0x68,0x3a,0x68,0x3a,0x3, + 0x32,0xee,0xa3,0x5b,0x1b,0xe8,0xdb,0x2e,0x84,0x4e,0xf1,0xe1,0xd4,0x2e,0xa5,0x2d, + 0x61,0x61,0xe1,0x84,0x85,0x85,0x11,0x15,0x15,0x55,0xe9,0x1b,0xee,0xd9,0xa,0x29, + 0x10,0x58,0x7f,0x9f,0x3e,0x7d,0xe8,0xd3,0xa7,0xf,0x69,0x69,0x69,0x1c,0x3d,0x7a, + 0x94,0xa5,0x4b,0x97,0xf2,0xc3,0xf,0x3f,0xf0,0xc3,0xf,0x3f,0x54,0x49,0x7b,0x6a, + 0xd7,0xae,0xcd,0x90,0x21,0x43,0x18,0x31,0x62,0x4,0x9d,0x3a,0x75,0x22,0x2e,0x2e, + 0xce,0xaf,0x71,0xa8,0xae,0x3e,0x56,0xc1,0x90,0x7b,0xdf,0xbe,0x7d,0xb9,0xe4,0x92, + 0x4b,0x38,0x76,0xec,0x18,0xdb,0xb7,0x6f,0x67,0xc2,0x84,0x9,0xfe,0x2b,0xfb,0x95, + 0x81,0x1e,0x3d,0x7a,0xf0,0xe8,0xa3,0x8f,0x72,0xf1,0xc5,0x17,0xd3,0xa0,0x41,0x83, + 0x12,0x1,0x78,0x4f,0x2e,0xdf,0xe8,0xe8,0x68,0xe2,0xe2,0xe2,0xd0,0x75,0xbd,0x42, + 0xf5,0x66,0x64,0x64,0x54,0xf8,0xd9,0x60,0x1c,0xdc,0x84,0x10,0xc,0x1a,0x34,0x88, + 0xfe,0xfd,0xfb,0x73,0xf4,0xe8,0x51,0x56,0xae,0x5c,0xc9,0x7b,0xef,0xbd,0xc7,0x2f, + 0xbf,0xfc,0x52,0x29,0xf5,0x5e,0x71,0xc5,0x15,0xfc,0xfd,0xef,0x7f,0xe7,0xc2,0xb, + 0x2f,0x24,0x3e,0x3e,0xbe,0xdc,0x87,0x83,0xb8,0xb8,0x38,0xea,0xd7,0xaf,0x5f,0xee, + 0x7a,0xf2,0x73,0x73,0x19,0xf5,0xe4,0xdf,0x79,0xef,0x78,0x2a,0xf1,0x76,0x1d,0x21, + 0x74,0xa6,0xee,0xd8,0x48,0x8e,0x34,0xd1,0xa5,0x41,0xdd,0x90,0x10,0xe2,0xc2,0xc2, + 0x2d,0x57,0x29,0x29,0xbc,0xb9,0x5,0xf1,0xa6,0x60,0xf6,0x9c,0xc8,0x93,0x4e,0xa, + 0x1d,0xac,0xc,0x83,0x4,0xb2,0xd,0x81,0xe6,0xfd,0x1c,0xa4,0x37,0xb5,0x33,0xc5, + 0xca,0xb5,0x79,0xff,0x2e,0x3,0x8,0xcd,0x89,0x26,0x3d,0x5f,0x98,0xab,0x22,0xbe, + 0x66,0xfa,0x3f,0x97,0xde,0x7f,0x9,0x74,0x6f,0xbb,0x41,0x62,0x78,0xbf,0xeb,0xab, + 0xd3,0xf7,0xc5,0x80,0x3a,0x2,0x9,0x92,0x9f,0xe0,0xe8,0x1,0x9f,0x99,0x27,0xe7, + 0x91,0x32,0x90,0xf3,0x89,0x62,0xa4,0x4a,0x48,0x4a,0x29,0x57,0x2b,0xf6,0x59,0x81, + 0xe1,0xe1,0xfc,0xf0,0x5a,0x68,0x3a,0x98,0xc2,0x44,0x9c,0xc6,0x26,0x2b,0xe4,0x49, + 0x8e,0x22,0x52,0x4a,0xd2,0xd2,0xd2,0x48,0x4e,0x4e,0xe6,0xd0,0xa1,0x43,0x64,0x66, + 0x66,0x72,0xec,0xd8,0x31,0x72,0x72,0x72,0x38,0x70,0xe0,0x0,0x39,0x39,0x39,0x64, + 0x67,0x67,0x93,0x95,0x95,0x45,0x76,0x76,0x36,0x79,0x79,0x79,0xb8,0x5c,0x2e,0xa, + 0xa,0xa,0x28,0x28,0x28,0xc0,0x34,0x4d,0xa,0xb,0xb,0x91,0xde,0x90,0xfc,0x2e, + 0x97,0xb,0xa7,0x6e,0xc3,0xa6,0x69,0xfe,0x45,0xb6,0x3c,0xa7,0x20,0x1,0x64,0x15, + 0x16,0x20,0x84,0x40,0xd3,0xce,0x3d,0x2d,0x44,0xb0,0xe0,0x76,0xbb,0x89,0x9,0xd, + 0x3b,0x6d,0xeb,0x9b,0xc7,0x30,0xc8,0xf7,0xb8,0xab,0x74,0xc1,0xd4,0x84,0x95,0xd5, + 0x41,0x17,0x82,0xd0,0x3a,0x1d,0x70,0x36,0xb8,0x0,0x67,0xed,0xd6,0x38,0xea,0xb4, + 0xc1,0x1e,0xd1,0x80,0x82,0x3a,0xf9,0x1c,0x6e,0xb3,0x1c,0xcd,0xb4,0xda,0xa4,0x19, + 0x76,0x9a,0xae,0xba,0xc,0x77,0xde,0x1,0xdc,0xd9,0x87,0x28,0x3c,0xbe,0x1b,0xd7, + 0xb1,0xed,0x14,0x1c,0x5e,0x8b,0xab,0x30,0x15,0x53,0xa,0xc,0xb3,0xf8,0x41,0xc7, + 0x66,0xb3,0x11,0x1a,0x1a,0x8a,0xae,0xeb,0x68,0xde,0x31,0xa7,0xeb,0xba,0x7f,0x91, + 0x76,0xb9,0x5c,0x98,0xa6,0x89,0xae,0xeb,0xd8,0xed,0x76,0x74,0x5d,0x27,0x34,0x34, + 0x14,0x87,0xc3,0x81,0xdd,0x6e,0x27,0x2c,0x2c,0x8c,0xb0,0xb0,0x30,0x22,0x23,0x23, + 0x9,0x9,0x9,0xe1,0xfc,0xf3,0xcf,0x67,0xe0,0xc0,0x81,0xd4,0xab,0x57,0x8f,0xc8, + 0xc8,0x48,0xec,0x76,0x3b,0x36,0x9b,0xd,0x4d,0xd3,0xd0,0x34,0xed,0x4,0xd3,0x5d, + 0x75,0xd1,0xb0,0x94,0x6c,0xd3,0xea,0xd5,0xab,0x99,0x3d,0x7b,0x36,0x2b,0x57,0xae, + 0x64,0xc3,0x86,0xd,0xe4,0xe7,0xe7,0x63,0x18,0x6,0x86,0x61,0x60,0x9a,0xa6,0x3f, + 0xf6,0x53,0x69,0x73,0xd3,0xd7,0x47,0x5f,0x9f,0x7d,0xf2,0xac,0x53,0xa7,0xe,0xdd, + 0xbb,0x77,0xe7,0x92,0x4b,0x2e,0x61,0xd8,0xb0,0x61,0x34,0x6d,0xda,0x54,0x4d,0xc8, + 0x0,0xac,0x5a,0xb5,0x8a,0x99,0x33,0x67,0x32,0x6b,0xd6,0x2c,0xe,0x1d,0x3a,0x84, + 0x69,0x9a,0x7e,0x99,0x9f,0x4c,0xde,0x81,0xb2,0xd6,0x75,0xdd,0x2f,0xeb,0x8b,0x2f, + 0xbe,0x98,0x91,0x23,0x47,0x72,0xdd,0x75,0xd7,0x51,0xbb,0x76,0xed,0xd3,0x26,0xf6, + 0x35,0xd1,0x1f,0xab,0x2c,0x2d,0x9a,0xaf,0x3f,0x1e,0x8f,0x87,0x5,0xb,0x16,0x30, + 0x75,0xea,0x54,0x66,0xcc,0x98,0x81,0xae,0xeb,0x7e,0x39,0x7,0xca,0xba,0x34,0x92, + 0xec,0x93,0xb1,0x6f,0x3d,0xe8,0xde,0xbd,0x3b,0x37,0xdc,0x70,0x3,0xd7,0x5e,0x7b, + 0x2d,0xd1,0xd1,0xd1,0x67,0xd4,0x2e,0x85,0xbf,0xb0,0xe2,0x43,0x56,0x91,0xae,0xf7, + 0xdf,0xff,0xfe,0x37,0xf7,0xdc,0x73,0xf,0x4d,0x9a,0x34,0x39,0xed,0x67,0x5f,0x79, + 0xe5,0x15,0x12,0x12,0x12,0x18,0x3e,0x7c,0xb8,0x7a,0x63,0x27,0x41,0x58,0x58,0x18, + 0x79,0x79,0x79,0xa7,0xfd,0xdc,0xba,0x75,0xeb,0xf8,0xe3,0x8f,0x3f,0xce,0xf9,0x3c, + 0x60,0x2f,0xbd,0xf4,0x12,0x8f,0x3c,0xf2,0x48,0xa5,0xfa,0x6e,0x54,0xe7,0xcd,0xeb, + 0x64,0x6d,0xcb,0xca,0xca,0x62,0xcf,0x9e,0x3d,0xec,0xd9,0xb3,0x87,0xd4,0xd4,0x54, + 0x72,0x73,0x73,0xc9,0xcd,0xcd,0x25,0x27,0x27,0x87,0x9c,0x9c,0x1c,0x5c,0x2e,0x17, + 0xe,0x87,0x83,0x90,0x90,0x10,0x42,0x42,0x42,0x88,0x8c,0x8c,0x24,0x3e,0x3e,0x9e, + 0xf8,0xf8,0x78,0xea,0xd7,0xaf,0x4f,0xf3,0xe6,0xcd,0x4f,0x7b,0x3,0xfa,0xab,0xa0, + 0x34,0x99,0xbb,0xdd,0x6e,0x12,0x13,0x13,0x49,0x4a,0x4a,0x22,0x29,0x29,0x89,0xe3, + 0xc7,0x8f,0x93,0x9f,0x9f,0x4f,0x6e,0x6e,0xae,0x7f,0xfe,0x86,0x85,0x85,0x11,0x1a, + 0x1a,0x4a,0x58,0x58,0x18,0xf5,0xeb,0xd7,0xa7,0x59,0xb3,0x66,0x34,0x6b,0xd6,0xcc, + 0x6f,0xfe,0x3b,0x17,0xc9,0x52,0x65,0xc8,0x3a,0x2d,0x2d,0x8d,0xdd,0xbb,0x77,0xb3, + 0x67,0xcf,0x1e,0xe,0x1d,0x3a,0x44,0x4e,0x4e,0xe,0x99,0x99,0x99,0x64,0x64,0x64, + 0x20,0x84,0x40,0xd7,0x75,0xea,0xd4,0xa9,0x43,0x68,0x68,0x28,0xf1,0xf1,0xf1,0x34, + 0x6f,0xde,0x9c,0xe6,0xcd,0x9b,0x2b,0x39,0x2b,0x4,0xd,0x55,0x66,0x22,0x2c,0x28, + 0x28,0x20,0x23,0x23,0xa3,0x42,0x4,0x2b,0x3f,0x3f,0xbf,0x5a,0x5e,0xd1,0xad,0x8e, + 0xa7,0xb9,0xd3,0x85,0x4f,0xfb,0x78,0x2e,0x23,0x2f,0x2f,0xf,0xc3,0x30,0xc8,0xca, + 0xca,0xaa,0x54,0x82,0x55,0x53,0x62,0xc,0x5,0x6e,0x1a,0x51,0x51,0x51,0x5c,0x78, + 0xe1,0x85,0x5c,0x78,0xe1,0x85,0x6a,0x12,0x55,0xa2,0xcc,0x7d,0xf3,0xd3,0x6e,0xb7, + 0x93,0x90,0x90,0x40,0x42,0x42,0xc2,0x19,0x13,0x9,0xb5,0xe9,0x9f,0x5c,0xd6,0x42, + 0x8,0x6a,0xd5,0xaa,0x45,0xb7,0x6e,0xdd,0xe8,0xd6,0xad,0x9b,0x92,0xb3,0xc2,0xb9, + 0x4d,0xb0,0x6a,0x7a,0x1e,0x2f,0x85,0x73,0x67,0x1,0x56,0x50,0xf2,0xa8,0xa9,0xf2, + 0x56,0xef,0xad,0x6a,0x64,0xa4,0xe4,0xac,0x10,0xc,0x54,0x99,0x53,0xd3,0x99,0x10, + 0xac,0xea,0xe8,0xdf,0xa2,0x50,0xb3,0x16,0x5c,0xa7,0xd3,0xa9,0xc6,0x90,0x82,0x82, + 0x82,0x82,0xc2,0xb9,0x47,0xb0,0xd4,0xe6,0xa6,0x70,0x36,0x61,0xb3,0xd9,0xd4,0x18, + 0x54,0x50,0x50,0x50,0x50,0x38,0xf7,0x8,0x96,0x82,0xc2,0xd9,0x82,0x10,0x2,0x87, + 0xc3,0xa1,0x8,0x96,0x82,0x82,0x82,0x82,0x82,0x22,0x58,0x25,0x37,0x48,0x5,0x85, + 0x33,0x41,0x68,0x68,0xa8,0xa,0xf3,0xa1,0xa0,0xa0,0xa0,0xa0,0x70,0xee,0x11,0xac, + 0x33,0xf5,0xa3,0x52,0x24,0x4b,0xe1,0x4c,0xc6,0x8e,0xd2,0x60,0x29,0x28,0x28,0x28, + 0x28,0x9c,0xb3,0x4,0xeb,0x6c,0x91,0x33,0x5,0x5,0xa5,0xc1,0x52,0x50,0x50,0x50, + 0x50,0x38,0x27,0xc6,0xef,0xce,0x64,0x0,0x0,0x20,0x0,0x49,0x44,0x41,0x54,0x9, + 0x96,0x2f,0xda,0x75,0x45,0x9f,0x55,0x50,0x38,0x13,0x82,0xae,0x6e,0x11,0x2a,0x28, + 0x28,0x28,0x28,0x9c,0x93,0x4,0x4b,0x69,0xb0,0x14,0xce,0x26,0xc1,0xa,0xb,0xb, + 0x53,0x44,0x5d,0x41,0x41,0x41,0x41,0xe1,0xdc,0x23,0x58,0xbe,0x5c,0x5a,0x15,0x6a, + 0xa4,0x37,0xf7,0x99,0x42,0xf5,0x23,0xbf,0x35,0x5,0xa1,0xa1,0xa1,0x8a,0xa4,0x2b, + 0x28,0x28,0x28,0x28,0x9c,0x7b,0x4,0xeb,0x4c,0x36,0xb7,0x33,0x31,0x2f,0x2a,0x92, + 0xa4,0x20,0x84,0x20,0x24,0x24,0x44,0x91,0x74,0x5,0x5,0x5,0x5,0x85,0x73,0x8f, + 0x60,0xd9,0x6c,0xb6,0xa,0x6f,0x70,0xbe,0x2c,0xe7,0xa,0x27,0x87,0xd3,0xe9,0x54, + 0xe4,0xac,0xc,0x82,0xa5,0x48,0xa8,0x82,0x82,0x82,0x82,0xc2,0x39,0x49,0xb0,0x2a, + 0xba,0xc1,0xd9,0xed,0x76,0x45,0xb0,0xca,0x21,0x5f,0x45,0xae,0x4e,0xe,0xa5,0xc1, + 0x52,0x50,0x50,0x50,0x50,0x38,0x27,0x9,0x96,0xc3,0xe1,0x38,0x23,0xd,0x96,0xda, + 0x1c,0x4f,0x8d,0xa8,0xa8,0xa8,0xa,0x3f,0xfb,0x57,0xd0,0x60,0x29,0x1f,0x2c,0x5, + 0x5,0x5,0x5,0x85,0x73,0x92,0x60,0xd9,0xed,0xf6,0x33,0xd2,0x60,0xd9,0xed,0x76, + 0xf5,0xb6,0xca,0x20,0xb0,0x15,0x25,0x1f,0x7f,0x5,0xe2,0x71,0x26,0xe3,0x4f,0x41, + 0x41,0x41,0x41,0x41,0xa1,0x5a,0x13,0xac,0x8a,0x6a,0xa1,0x9c,0x4e,0x67,0x85,0x4d, + 0x60,0x7f,0x15,0x44,0x44,0x44,0x54,0xe8,0x39,0x29,0xe5,0x39,0x2f,0x1b,0x21,0x84, + 0x22,0x58,0xa,0xa,0xa,0xa,0xa,0xe7,0x26,0xc1,0xa,0xb,0xb,0xab,0xb0,0x1f, + 0x95,0xd3,0xe9,0xac,0xb0,0x86,0xe6,0xaf,0x82,0x8a,0x9a,0x8,0xa3,0xa2,0xa2,0x68, + 0xd0,0xa0,0xc1,0x39,0x2f,0x1f,0x45,0xb0,0x14,0x14,0x14,0x14,0x14,0xce,0x49,0x82, + 0x75,0x26,0x3e,0x58,0xe,0x87,0x43,0x39,0xb9,0x97,0x83,0xc0,0x56,0x94,0x78,0x84, + 0x86,0x86,0x9e,0xf3,0xf2,0x51,0xe3,0x47,0x41,0x41,0x41,0x41,0xe1,0x9c,0x24,0x58, + 0xa1,0xa1,0xa1,0x4a,0x83,0x55,0x89,0x88,0x8d,0x8d,0xad,0xd0,0x73,0x21,0x21,0x21, + 0x44,0x47,0x47,0x9f,0xfb,0x3,0x5d,0xc5,0x52,0x53,0x50,0x50,0x50,0x50,0x38,0x17, + 0x9,0x56,0x6c,0x6c,0x6c,0x85,0x1d,0xd5,0xa3,0xa2,0xa2,0x2a,0xec,0x63,0xf4,0x57, + 0x41,0x45,0x49,0x92,0xc3,0xe1,0x20,0x3c,0x3c,0xfc,0x2f,0x41,0xb0,0x14,0x14,0x14, + 0x14,0x14,0x14,0xce,0x39,0x82,0x75,0x26,0x81,0x46,0xcf,0xc4,0xbc,0xf8,0x57,0x41, + 0x9d,0x3a,0x75,0x2a,0xf4,0xdc,0x5f,0xc5,0x44,0xa8,0xb4,0x57,0xa,0xa,0xa,0xa, + 0xa,0x55,0x89,0x2a,0xbb,0x9a,0x17,0x15,0x15,0x55,0xe1,0x9b,0x80,0xe1,0xe1,0xe1, + 0x7f,0x9,0x12,0x70,0xb6,0x8,0x56,0x45,0xfd,0xb7,0x14,0xb9,0x52,0x50,0x50,0x50, + 0x50,0x50,0x28,0x1d,0x55,0xa6,0x16,0x3a,0x93,0x48,0xda,0x21,0x21,0x21,0x2a,0xe, + 0x56,0x19,0xa8,0xa8,0x9,0x55,0xd7,0x75,0x25,0x5b,0x5,0x5,0x5,0x5,0x5,0x85, + 0x20,0xa3,0xca,0x34,0x58,0xb5,0x6a,0xd5,0x3a,0x23,0x1f,0xac,0x73,0x5d,0xcb,0x72, + 0xa6,0x68,0xda,0xb4,0x69,0x85,0xc9,0xab,0xba,0x61,0xa7,0xa0,0xa0,0xa0,0xa0,0xa0, + 0x50,0x43,0x9,0x56,0x64,0x64,0xe4,0x19,0x99,0x8,0xcf,0x24,0x99,0xf1,0x5f,0x1, + 0x91,0x91,0x91,0x15,0x7a,0x4e,0xd3,0x34,0xe5,0xdf,0xa6,0xa0,0xa0,0xa0,0xa0,0xa0, + 0x50,0x13,0x9,0x96,0x94,0x92,0x90,0x90,0x90,0xa,0x3f,0x1f,0x1e,0x1e,0x8e,0x10, + 0x2,0x29,0xa5,0xf2,0xa7,0x39,0x9,0xea,0xd6,0xad,0x5b,0xb1,0x1,0x60,0xb3,0xa9, + 0x28,0xf9,0xa,0xa,0xa,0xa,0xa,0xa,0x35,0x91,0x60,0x9d,0x29,0x29,0xf2,0x3d, + 0xaf,0xc8,0xd5,0xc9,0x51,0x51,0x1f,0x2c,0x25,0x53,0x5,0x5,0x5,0x5,0x5,0x85, + 0x4a,0xe0,0x3e,0xf2,0xaf,0x90,0x8c,0xee,0x2f,0x0,0xd3,0x34,0x95,0xa9,0x4f,0x41, + 0x41,0x41,0x41,0x41,0xa1,0x9a,0x40,0xed,0xc8,0xe7,0x0,0xa4,0x94,0x68,0x9a,0x86, + 0xe2,0xca,0xa,0xa,0xa,0xa,0xa,0xa,0xd5,0x3,0x4a,0x83,0xa5,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0x10,0x64,0x28,0xd,0x96,0x82,0x82,0x82,0x82,0x82,0x82,0x82, + 0x82,0x22,0x58,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0x8a,0x60,0x29,0x28,0x28, + 0x28,0x28,0x28,0x28,0x28,0x28,0x82,0xa5,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0, + 0xa0,0x8,0x96,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x22,0x58,0xa,0xa,0xa, + 0xa,0xa,0xa,0xa,0xa,0x8a,0x60,0x29,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28, + 0x28,0x82,0x55,0x5e,0x98,0x1,0xa1,0xc0,0xcc,0x72,0x84,0x5,0x93,0xa7,0xf9,0xfd, + 0x73,0x1,0x35,0xb5,0xcf,0xa5,0xb5,0xb5,0x2a,0xda,0x1f,0x28,0x2f,0x15,0x6a,0xae, + 0xe6,0x8d,0xf1,0xea,0x36,0x76,0x83,0xdd,0x36,0x79,0x96,0xe6,0x45,0x75,0x7b,0xbf, + 0xbe,0x3e,0x57,0xd5,0xbb,0x97,0x67,0xb0,0xd7,0xa8,0x75,0xa4,0xe6,0xad,0xd5,0x8a, + 0x60,0x1,0x9a,0x10,0xb4,0x9f,0xf9,0x11,0x6d,0xbf,0xfd,0x0,0xad,0x1c,0xb9,0xf9, + 0x84,0x10,0xdc,0xff,0xc7,0x7c,0x1c,0x9f,0xbd,0x78,0xca,0xef,0x57,0xe4,0xc5,0x9d, + 0xea,0x7b,0xf2,0x34,0x27,0x64,0x79,0x9f,0x2b,0x4f,0xb9,0x42,0x8,0x6,0xff,0xf4, + 0xd,0xb5,0x27,0x8f,0x2f,0x97,0x8c,0x82,0x39,0xc0,0xa5,0x94,0x15,0x1e,0xf8,0x9a, + 0x10,0x88,0xff,0x3d,0x8d,0x7d,0xd2,0x8b,0x44,0x7d,0xf9,0x2a,0xf5,0xbf,0xf9,0x6f, + 0xd0,0xdb,0x7f,0x32,0x79,0x3d,0xbb,0x6e,0x9,0xe2,0x93,0xe7,0x82,0x9e,0xef,0x31, + 0x18,0xef,0x33,0x18,0x8b,0x4e,0xae,0xc7,0x8d,0xf8,0xe8,0xdf,0x2c,0x39,0xb2,0xef, + 0x9c,0x20,0xa7,0xbe,0x84,0xf2,0x9f,0xec,0x58,0x47,0xe7,0xd9,0x13,0x10,0x1f,0x3d, + 0x49,0xae,0xdb,0x75,0xd6,0x8,0x99,0x26,0x4,0x75,0xbf,0x7e,0x83,0xfe,0xb,0x26, + 0x7,0x7d,0xc,0x9,0x21,0x10,0x13,0x9e,0xf2,0xcf,0x8b,0x66,0x53,0xdf,0xa9,0x92, + 0x79,0x71,0x36,0x88,0x94,0xef,0x77,0x21,0x4,0xe2,0xe3,0x7f,0x63,0x9f,0xf4,0x22, + 0xd1,0x5f,0xbe,0xc6,0xc5,0x73,0x3e,0xf5,0xf7,0x59,0x8,0xc1,0xeb,0x9b,0x96,0x23, + 0x3e,0x7d,0x1e,0xc7,0x67,0x2f,0x62,0x9b,0xf4,0x2,0x2b,0x52,0xe,0x6,0xbd,0x2d, + 0x42,0x8,0xee,0x5e,0xf6,0x3,0x21,0x9f,0xbd,0x54,0xee,0xbd,0x66,0x46,0xd2,0x36, + 0xc4,0xc7,0xff,0x39,0xe5,0x18,0xa8,0x8c,0x39,0x73,0xa6,0x7b,0x51,0x4d,0x81,0x6f, + 0x2e,0x7c,0xba,0x73,0x7d,0xd0,0xe7,0x99,0xad,0x2a,0x6,0xbb,0x10,0x82,0x9d,0x99, + 0xc7,0x79,0x69,0xfd,0x32,0xd6,0xa7,0x27,0x93,0xe7,0x71,0x73,0x79,0xfd,0x66,0xbc, + 0xd9,0x7d,0x0,0xa1,0x36,0x7b,0xb5,0x10,0x72,0xfd,0xb0,0x8,0x8c,0xd3,0x18,0x34, + 0x79,0x86,0x1b,0x77,0x61,0x41,0x99,0x2f,0xae,0xc3,0xcc,0x8f,0xd8,0x9c,0x7a,0x8, + 0x79,0xcf,0xf3,0xe5,0x7e,0xd9,0xf3,0xf,0xec,0xe2,0xed,0xad,0xab,0xd8,0x93,0x95, + 0x4e,0x7c,0x68,0x4,0x97,0xc4,0x37,0x66,0x54,0xf3,0xf3,0xe9,0x58,0xab,0x9e,0xb5, + 0xb1,0xb9,0x5d,0xfc,0x6b,0xed,0x2f,0x2c,0x3a,0x94,0x84,0x26,0x4,0x77,0xb4,0xbe, + 0x80,0x7,0xcf,0xef,0x86,0x4d,0xd3,0x10,0x42,0xb0,0xe4,0xc8,0x3e,0xbe,0xdf,0xbf, + 0x83,0x6f,0x12,0xb7,0x70,0x24,0x79,0x1f,0xf2,0x91,0xb7,0x8a,0xbd,0x8f,0xcf,0x76, + 0x6d,0x60,0xc1,0xc1,0x3d,0x4c,0xdb,0xf9,0x27,0xed,0xe2,0x1a,0xb1,0x65,0xc4,0xd8, + 0x72,0xb5,0x2d,0xc7,0xe3,0x22,0xd3,0x5d,0x58,0x39,0x3,0x7c,0xe2,0xb3,0x34,0x8b, + 0x8a,0x25,0xe9,0xfa,0x7,0x1,0x48,0x2d,0xc8,0xe3,0xba,0x5f,0xa6,0x63,0x17,0x3a, + 0xb,0x7,0xdd,0x7c,0x46,0x5a,0x0,0x79,0xf7,0xb3,0x0,0x5c,0x3c,0xe7,0x53,0x36, + 0xa6,0x1d,0xad,0xb2,0x31,0x55,0x60,0x78,0xc0,0x55,0x50,0x29,0xf2,0x1a,0xba,0x70, + 0x2a,0x6b,0x8f,0x1f,0x21,0xcb,0x55,0x48,0x4e,0x76,0x3a,0xd,0x6a,0xd7,0xa3,0xd0, + 0x30,0xf8,0xa8,0xd7,0x60,0xae,0x6b,0xd6,0x36,0x28,0x75,0xdc,0xf9,0xdb,0xf7,0x4c, + 0xfa,0x73,0x9,0xf2,0xa1,0x37,0x4e,0x7a,0x3a,0xab,0x15,0x19,0x83,0x53,0xd7,0x4f, + 0xf8,0xdb,0xb2,0xa3,0x7,0xe8,0xfd,0xf9,0xcb,0x1c,0x7b,0xf0,0x75,0xea,0x84,0x84, + 0x9d,0xfe,0x78,0x78,0xfd,0x1,0xde,0x1f,0x7c,0x1b,0xf7,0xb5,0xed,0x52,0xa5,0xeb, + 0xc0,0xf4,0xa4,0xad,0x8c,0x59,0x32,0x8b,0x65,0x43,0xef,0xa6,0x57,0x7c,0xe3,0x32, + 0xdb,0x39,0x69,0xd7,0x7a,0x1e,0x5f,0xfd,0x33,0x76,0x4d,0x27,0xd3,0x55,0x40,0x6e, + 0x76,0x6,0xd,0x6a,0xc7,0x3,0x92,0xf4,0xc2,0x2,0xd2,0x6e,0xfe,0x7,0x21,0x7a, + 0xc5,0x97,0xd9,0x2c,0x57,0x21,0x39,0x1e,0x77,0xa5,0xac,0xcb,0xf2,0x9e,0xe7,0x0, + 0xe8,0x30,0xf3,0x23,0xe,0xe6,0x65,0x9f,0x53,0x1b,0xe6,0x7b,0x5b,0x57,0xf3,0xc0, + 0xc2,0x6f,0xc8,0xb9,0xef,0x15,0xc2,0xed,0x8e,0xa2,0x3e,0xff,0xed,0x5,0x0,0x62, + 0x27,0x8f,0x27,0x3b,0x80,0x3c,0x4b,0x29,0x79,0xac,0x43,0xf,0x1e,0xeb,0xd0,0xc3, + 0x2a,0xe3,0xed,0x47,0xf1,0x9c,0xc6,0x7e,0x90,0x98,0x9d,0x4e,0xcb,0x89,0xcf,0x52, + 0x3b,0xae,0x11,0x11,0x36,0x3b,0x17,0xd5,0xa9,0x4f,0xff,0x86,0x2d,0xb9,0xb5,0x55, + 0xc7,0x13,0xf6,0xb8,0x5a,0xce,0x50,0x1a,0x47,0x44,0x95,0xbb,0x6c,0xb7,0x69,0x94, + 0xb9,0x8e,0x8,0x21,0x78,0x6c,0xd5,0x42,0xde,0xf8,0x7d,0x6e,0xb1,0xf5,0xfe,0x8c, + 0xd7,0xe5,0x77,0xff,0x1,0x61,0x91,0x34,0xc,0x8f,0xe4,0xbc,0xe8,0xda,0xf4,0xae, + 0xd7,0x94,0x5b,0x5b,0x77,0xa2,0x59,0x44,0xf4,0xb9,0xa5,0x65,0x71,0x15,0xe0,0x32, + 0x8d,0xa0,0x17,0x6b,0xab,0x8a,0xc1,0x9e,0xe3,0x76,0x71,0xe5,0x82,0xc9,0x8c,0x6a, + 0x71,0x3e,0xcb,0x7a,0xde,0x8e,0x5d,0xd3,0x79,0x70,0xf9,0x2,0xf2,0x3c,0x6e,0x42, + 0x74,0x5b,0xa9,0xac,0x31,0xf0,0xd4,0x71,0x2a,0x6,0x7d,0xaa,0xbf,0xb,0x21,0x30, + 0xa5,0x3c,0xe9,0x49,0xc1,0xf7,0x1d,0x80,0x85,0x3,0xad,0x4d,0xdc,0x90,0x26,0xba, + 0xd0,0x8a,0xfd,0xad,0xa2,0xa4,0x12,0x20,0xd6,0x19,0x82,0xc3,0x11,0x7a,0x5a,0xcf, + 0x3f,0xbf,0xfe,0x37,0x1e,0x6c,0xd7,0x9d,0xa1,0x4d,0xdb,0xe0,0x32,0xc,0xfe,0xb1, + 0x7a,0x21,0x7d,0xe7,0x7d,0xc1,0x9a,0x61,0x63,0x68,0x19,0x55,0x8b,0x8f,0x77,0xac, + 0xe5,0x87,0xfd,0xbb,0x58,0x33,0x6c,0xc,0x87,0xf3,0xb2,0xe9,0x39,0x67,0x12,0xed, + 0x62,0xeb,0x30,0xb0,0x51,0x2b,0xff,0x64,0xbf,0xb1,0x65,0x7b,0x1a,0x85,0x47,0xf1, + 0xf7,0xb4,0xe4,0x52,0x37,0xfe,0x2f,0xfa,0xc,0xe3,0xbb,0xfd,0x3b,0x88,0xb4,0x3b, + 0x83,0x76,0xd2,0x11,0xe5,0x90,0xf3,0xc9,0x10,0xe9,0xc,0x21,0xca,0xdb,0x96,0x6c, + 0x77,0x21,0x23,0x7f,0x99,0x41,0xdd,0x90,0x30,0xbe,0xe9,0x7b,0x2d,0x12,0x10,0x65, + 0xc8,0xfa,0x64,0x75,0x4,0xbe,0x7b,0x8f,0x69,0x6,0xbd,0xdd,0xe5,0x2d,0xeb,0x74, + 0xca,0x2e,0xab,0x5e,0x29,0x25,0xdf,0x5f,0x79,0x3,0x0,0xf3,0xf,0xee,0xe6,0xaa, + 0x99,0x1f,0x71,0x68,0xd4,0x23,0xe5,0x2e,0xbb,0xbc,0xf3,0x2a,0xd6,0x11,0xa,0xce, + 0x90,0x93,0xb6,0x2f,0xd4,0x66,0xe7,0xf8,0x4d,0x8f,0x9d,0x40,0x68,0x35,0x21,0x88, + 0x75,0x84,0x80,0x33,0xc4,0xfa,0x6f,0x89,0xbf,0x95,0xd6,0x8e,0x13,0xda,0x55,0xe2, + 0xd9,0x53,0xb5,0xbb,0x3c,0xef,0xe9,0x64,0xdf,0x29,0xf9,0xf9,0xdc,0x3,0xbb,0x40, + 0xb7,0x95,0x49,0xae,0x7c,0xcf,0xde,0xd1,0xfa,0x2,0xee,0x68,0x7d,0x1,0x0,0xdf, + 0xed,0xdb,0xc1,0x35,0xdf,0xfd,0x8f,0x43,0xa3,0x1e,0xae,0xd0,0x5a,0x51,0xd1,0xb1, + 0x77,0xba,0xef,0xb9,0x64,0xd9,0xc6,0x49,0xb4,0xc6,0xa7,0x7a,0xb6,0xa2,0xed,0x3b, + 0xd3,0x7e,0x95,0x97,0x90,0xac,0x4c,0x39,0x4,0x76,0x27,0x33,0xf7,0x6e,0xe7,0x96, + 0xd6,0x1d,0x4f,0x90,0x85,0xe4,0x44,0xcd,0x92,0xf,0x19,0x85,0x5,0x27,0x5f,0x70, + 0x4e,0xa6,0x6d,0x44,0x80,0xa6,0xb1,0xe1,0x9a,0x7b,0x68,0x18,0x1e,0xc5,0xf,0xfb, + 0x77,0x32,0x74,0xd1,0x54,0x76,0x64,0x1e,0xe7,0xbf,0xdd,0xfb,0x17,0xeb,0xfb,0xab, + 0x5d,0xfb,0xf1,0x6a,0xd7,0x7e,0xfe,0xbd,0x26,0x58,0x6b,0xaf,0x35,0xe7,0x42,0x83, + 0xb6,0xce,0x0,0xe0,0x8,0xe1,0x9e,0xf3,0x2e,0xe2,0xe3,0x5e,0x83,0x49,0xca,0x4e, + 0x67,0xf4,0xe2,0x59,0xcc,0x3b,0xb8,0x9b,0x3f,0xae,0xbe,0x3,0x4d,0x72,0xca,0xbd, + 0xfb,0x4c,0xd7,0xd6,0x53,0xed,0xdd,0xa7,0x2a,0xab,0xb2,0xc6,0x6e,0x45,0x50,0x25, + 0x26,0xc2,0xa7,0xff,0x5c,0x82,0x4,0x1e,0x6a,0xd7,0x9d,0x8,0xbb,0x13,0xa7,0x6e, + 0xe3,0x9d,0x1e,0x3,0x89,0x75,0x86,0x22,0x84,0xa0,0xc0,0xe3,0xe1,0x91,0x15,0x3f, + 0xd2,0x6a,0xfa,0x7b,0x74,0xff,0xfe,0x13,0x7e,0x4f,0xde,0x6f,0xb1,0x67,0x21,0xb8, + 0x71,0xf1,0x4c,0x1a,0x4f,0x79,0x9b,0x69,0x89,0x5b,0x68,0x3e,0xf5,0x1d,0xae,0xfa, + 0xe9,0x6b,0xe,0xe6,0x66,0xf9,0xff,0xde,0x61,0xd6,0x47,0x8c,0xfd,0x7d,0x2e,0x85, + 0x86,0x7,0x8f,0x69,0xf2,0xc4,0x9a,0x5f,0x68,0x3d,0xfd,0x7d,0xbf,0x0,0x35,0x21, + 0x68,0x38,0xe5,0x4d,0xc6,0x2c,0x9b,0xc3,0xe6,0xf4,0x14,0x2e,0x9f,0xf7,0x5,0x3, + 0x16,0x7c,0xc5,0x21,0x6f,0x19,0x3b,0x32,0x53,0x11,0x9f,0x3c,0x47,0xc3,0x29,0x6f, + 0xd1,0xf5,0xfb,0x89,0xfe,0x1,0x2f,0x84,0x20,0xcf,0xe3,0xe6,0x91,0x95,0x3f,0xd2, + 0x74,0xca,0xdb,0x3c,0xb6,0x6a,0x21,0x37,0xfc,0x32,0x83,0x6,0xdf,0xbc,0x19,0x38, + 0x2b,0xd9,0x99,0x99,0x4a,0xe7,0xd9,0x13,0xb8,0x74,0xee,0x67,0xcc,0x3b,0xb0,0xcb, + 0xff,0x6c,0x7a,0x61,0x1,0xe2,0x93,0x67,0xf9,0x23,0xe5,0x20,0x2e,0xd3,0x20,0xe6, + 0xcb,0xd7,0x10,0x13,0x9f,0xc5,0x90,0x66,0x99,0xf2,0x9a,0x3f,0xe0,0x46,0x46,0xb5, + 0x3c,0x9f,0x30,0x9b,0x9d,0x18,0x67,0x8,0xff,0xb9,0xe0,0x52,0x32,0x32,0x53,0x49, + 0xca,0xc9,0x0,0xe0,0xc3,0x6d,0x6b,0xb9,0xa1,0xc5,0xf9,0x44,0x3b,0x42,0x68,0x15, + 0x55,0x8b,0x5e,0xf1,0x4d,0x78,0x79,0xc3,0xef,0x45,0x8b,0x7e,0x9b,0xb,0xb8,0xa8, + 0x4e,0x3,0x74,0x4d,0xa3,0xc4,0x3a,0x82,0x10,0x82,0xb1,0x6d,0xbb,0xe0,0xac,0xe0, + 0xa9,0x5a,0x4a,0x98,0x96,0xb8,0x95,0xe6,0x53,0xdf,0x61,0xf0,0x8f,0xc5,0xdf,0x45, + 0xfb,0x99,0x1f,0xf1,0xc0,0xf2,0xf9,0xb8,0xc,0x3,0xb7,0x69,0xf0,0x8f,0x55,0xb, + 0x49,0x98,0xf1,0x7e,0xb9,0x7,0xb3,0xef,0x7b,0x3d,0xe6,0x4c,0x22,0x54,0xb7,0x31, + 0xa5,0xef,0xb5,0x96,0x56,0xce,0x4b,0xba,0xfe,0xb3,0xe6,0x57,0x12,0xa6,0xbf,0x47, + 0xc2,0x8c,0xf7,0x79,0xe6,0xcf,0xc5,0x27,0x3c,0x1b,0xf2,0xd9,0x4b,0x7c,0x93,0xb8, + 0x99,0x39,0xfb,0x77,0xd2,0xf5,0xbb,0x89,0xdc,0xb3,0xec,0x7,0x72,0xcb,0x38,0xfd, + 0xb,0x21,0xd8,0x94,0x76,0x94,0xff,0xac,0xf9,0x95,0x2e,0xdf,0xfd,0x8f,0x16,0xd3, + 0xde,0xe5,0x8e,0xa5,0xdf,0x73,0x30,0x27,0xcb,0xdf,0x9e,0x94,0xfc,0x5c,0xc4,0x27, + 0xcf,0x91,0x94,0x9d,0xce,0xc4,0x1d,0xeb,0x68,0x3f,0xf3,0x43,0x5e,0x5c,0xbf,0xc, + 0x53,0x4a,0x6c,0x93,0x5e,0x60,0xde,0x81,0xdd,0x7e,0x19,0x3c,0xbe,0x7a,0x11,0xb5, + 0x26,0x8f,0xf,0xac,0x81,0xbd,0xd9,0xe9,0x74,0xfd,0x6e,0x22,0x3d,0xe7,0x7c,0xca, + 0xac,0xbd,0xdb,0x8b,0xf5,0x75,0x53,0xda,0x51,0xfa,0x2f,0x98,0x4c,0xd3,0xa9,0x6f, + 0xf1,0xf8,0xaa,0x45,0x14,0x1a,0x9e,0x32,0xe5,0x15,0xf8,0xf7,0x3c,0x8f,0x1b,0x84, + 0x28,0x36,0xae,0x84,0x10,0x84,0x7e,0xfe,0x32,0xef,0x6f,0x5d,0xcd,0xbd,0xbf,0xcf, + 0xa5,0xcd,0xf4,0xf7,0x78,0x74,0xe5,0x4f,0xa4,0x17,0xe6,0xfb,0xdb,0xb9,0x32,0xe5, + 0x20,0xe3,0x56,0x2d,0xa4,0xe3,0xac,0x8f,0x48,0x98,0xf1,0x3e,0xf7,0xfd,0x31,0x8f, + 0x94,0xbc,0x5c,0xff,0xdf,0xc5,0x27,0xcf,0xf2,0xee,0xb6,0x55,0x60,0x77,0x12,0xfd, + 0xe5,0x6b,0xfe,0xfe,0xfb,0xca,0xbf,0x74,0xee,0xe7,0x44,0x7f,0xf9,0x1a,0x75,0xbe, + 0x7a,0x9d,0x65,0x47,0xf7,0x17,0x23,0xb4,0x71,0x5f,0xbf,0x41,0xf7,0x39,0x9f,0x40, + 0x44,0xc,0xb1,0x5f,0x8d,0x27,0xfc,0xf3,0x97,0x79,0x7d,0xd3,0x72,0x34,0x21,0x88, + 0xfe,0xf2,0x35,0x9e,0x5b,0xb7,0xd4,0x5f,0xcf,0xf4,0xa4,0xad,0xd8,0x27,0xbd,0xe8, + 0xff,0xfd,0xa6,0xc5,0xb3,0x88,0xfe,0xf2,0x55,0x8,0x8b,0xe4,0xce,0x65,0x73,0x88, + 0xfe,0xf2,0x55,0xba,0xcf,0xf9,0xc4,0xff,0xf7,0x94,0xfc,0x1c,0x86,0x2f,0x9a,0x46, + 0x93,0x29,0x6f,0x71,0xdb,0x92,0xd9,0x64,0xb9,0xa,0xcb,0x4d,0xae,0x8e,0xe6,0xe5, + 0x30,0x74,0xe1,0x14,0x9a,0x4d,0x7b,0x87,0x21,0x3f,0x7d,0xc3,0xd1,0xbc,0x1c,0xff, + 0x82,0x5b,0x68,0x78,0x10,0x13,0x9f,0xe5,0xab,0xc4,0xcd,0x0,0xfe,0xf9,0x7a,0xaa, + 0xf1,0x53,0xb2,0x5e,0xdf,0xbb,0x28,0x6d,0xb3,0xf9,0x6e,0xdf,0x76,0x7a,0xce,0x99, + 0x44,0xab,0xe9,0xef,0x32,0x61,0xdb,0x5a,0x4b,0xb3,0x1a,0xb0,0xd0,0x8f,0x5b,0xb5, + 0x88,0xb6,0xdf,0x7e,0x40,0xa7,0x59,0x1f,0xb3,0xf4,0xc8,0xbe,0xe2,0x4,0xc8,0x34, + 0xf9,0x64,0xc7,0x3a,0x12,0x66,0xbc,0xcf,0xa8,0x5f,0xbf,0x65,0x7b,0x46,0x2a,0x0, + 0xc9,0x79,0x39,0x68,0x9f,0x3e,0xcf,0xca,0x94,0x83,0xc,0x5b,0x38,0x95,0x76,0xdf, + 0x7e,0xc0,0xf8,0x4d,0x7f,0xe0,0x31,0xd,0xbf,0xbc,0xf6,0x65,0x67,0xd0,0x7f,0xc1, + 0x64,0x9a,0x4d,0x7b,0x87,0x91,0x3f,0xcf,0x20,0xc3,0x3b,0x6,0xca,0x32,0xff,0x8, + 0x21,0xc8,0x72,0x15,0x72,0xeb,0x92,0x59,0x34,0x9f,0xf6,0xe,0x7d,0xe7,0x7e,0xce, + 0xce,0x8c,0xd4,0x62,0x1b,0xd4,0xe2,0x23,0x7b,0xe9,0x38,0xf3,0x23,0x2e,0xfa,0xee, + 0x7f,0x2c,0x3e,0xb2,0x17,0xfb,0xa4,0x17,0x59,0x7f,0x3c,0x99,0x42,0xc3,0x43,0xb3, + 0x69,0xef,0x30,0x7e,0xd3,0x1f,0x48,0x29,0xc9,0xf7,0xb8,0xb9,0xee,0x97,0x19,0x74, + 0xfb,0x6e,0x62,0xa5,0x6f,0x6c,0x52,0x4a,0x3c,0xa6,0xc9,0xfa,0xb4,0x64,0x5a,0xd6, + 0x6d,0xc0,0xd7,0xde,0xf7,0x59,0x35,0x26,0x2d,0xe1,0xd7,0x8a,0xd,0x69,0xd2,0x86, + 0x4e,0xb5,0xea,0xf1,0xd5,0x9e,0x4d,0x25,0x34,0xf5,0xcf,0x10,0xff,0xf5,0x7f,0x89, + 0xfb,0xfa,0xd,0xff,0x5e,0x23,0xa5,0xc4,0x30,0x4d,0xde,0xd9,0xb2,0x92,0x16,0xd3, + 0xde,0xe5,0x9a,0x45,0x53,0x79,0x75,0xe3,0xef,0x84,0x7e,0xfe,0x72,0xb1,0xbd,0x66, + 0x7f,0x4e,0x6,0x97,0xce,0xfd,0x8c,0x8b,0xbe,0xfb,0x1f,0x5f,0xec,0xda,0x50,0x54, + 0xa6,0x10,0x88,0x4f,0x9e,0xe3,0xb9,0xf5,0xbf,0x81,0x33,0xd4,0x9a,0xaf,0x9f,0x3e, + 0xcf,0xc6,0xb4,0xa3,0xde,0x39,0x93,0xcb,0x6b,0x1b,0x7f,0xa7,0xef,0xbc,0xcf,0x69, + 0xf4,0xcd,0x9b,0x8c,0x58,0x34,0x8d,0x4d,0x69,0x29,0xe5,0x7e,0x17,0x3e,0xcd,0x4e, + 0xf3,0xc8,0x58,0xfe,0x96,0xd0,0x99,0x55,0x87,0xf6,0x20,0x3,0xc8,0xd5,0xb3,0xeb, + 0x96,0x70,0xfe,0xcc,0xf,0xe9,0x3c,0x7b,0x2,0xab,0x52,0xe,0xf9,0x3f,0xb7,0xcc, + 0x9b,0x5b,0xb9,0x63,0xe9,0x77,0x34,0xf1,0xee,0xaf,0x6f,0x6d,0x5e,0x49,0xbe,0xc7, + 0x53,0xa4,0x31,0x4e,0xdc,0xc2,0xc5,0xdf,0x7f,0x4a,0xeb,0xe9,0xef,0xf1,0xd9,0xce, + 0xf5,0xfe,0x79,0xe1,0x5b,0x4b,0x62,0x27,0x8f,0xe7,0xd9,0x75,0x4b,0xf9,0xfd,0xe8, + 0x1,0x2e,0xf9,0x61,0x12,0xd7,0xfd,0x3c,0x1d,0xb7,0x69,0xd0,0x67,0xee,0xe7,0xf4, + 0x5f,0x30,0xd9,0x3f,0xff,0x3f,0xd9,0xb9,0x8e,0x6,0xdf,0xbc,0x49,0x46,0x61,0x81, + 0xbf,0xfe,0x37,0x36,0x2d,0xa7,0xd3,0xac,0x8f,0xe9,0x30,0xf3,0x23,0x7e,0x39,0x94, + 0x54,0x6c,0xec,0xfe,0x99,0x7a,0x84,0x6e,0xdf,0x4f,0xe4,0xbc,0x19,0xef,0xb3,0xf8, + 0xf0,0x5e,0xd0,0xf4,0x9a,0x4b,0xb0,0x16,0x1e,0x4e,0xa4,0x7e,0x68,0x4,0xf5,0xc3, + 0x22,0xfc,0x9f,0x39,0x75,0x1b,0x9a,0x10,0xb8,0xc,0x83,0xdb,0x97,0x7e,0xc7,0x94, + 0xc4,0x2d,0x4c,0xed,0x3b,0x82,0x61,0x4d,0x12,0xb8,0x64,0xf6,0xc7,0xac,0x39,0x76, + 0x18,0x80,0x63,0x5,0x79,0x1c,0xcc,0xcb,0x62,0xfa,0xde,0xad,0xcc,0x1b,0x30,0x9a, + 0x94,0xfc,0x5c,0xfa,0xcc,0xfd,0x1c,0x97,0x61,0xbd,0xf4,0x11,0x4d,0xcf,0xe3,0xcb, + 0x3d,0x9b,0x38,0x5e,0x98,0x4f,0x9e,0xc7,0xcd,0xd4,0xc4,0x2d,0x5c,0xde,0xa0,0x69, + 0xb1,0xfa,0xf,0xe7,0x66,0xb1,0xee,0x78,0x32,0x2b,0x8f,0x1d,0xe2,0xbb,0x2b,0x6e, + 0xe0,0xfa,0xe6,0xed,0xf8,0xf1,0x50,0x22,0x0,0x9,0xd1,0x75,0x90,0x77,0x3d,0x85, + 0x5d,0xd3,0x38,0x9c,0x97,0x53,0x8c,0x3d,0xbf,0xb2,0x61,0x19,0x9f,0xec,0x58,0xcf, + 0xe4,0x3e,0xd7,0xd0,0x26,0xaa,0x16,0xdf,0xed,0xdf,0xc9,0x91,0xdc,0xac,0x0,0xe9, + 0xe9,0xfc,0x73,0xf5,0x2f,0xfc,0x70,0xe5,0x28,0x2e,0xae,0xdb,0x88,0xc1,0xb,0xa7, + 0xb0,0xdc,0x6b,0xb7,0x8f,0x75,0x86,0x20,0xef,0x7a,0x9a,0x1e,0x71,0x8d,0x70,0x68, + 0x3a,0x19,0xb7,0x8c,0x43,0x8e,0x79,0xba,0x5c,0x27,0x96,0x68,0x47,0x48,0xb1,0x5, + 0x61,0xe6,0xde,0x6d,0x60,0x77,0xe2,0xf0,0xe,0x82,0xdd,0x99,0xc7,0x69,0x16,0x11, + 0x4d,0x5a,0x61,0x3e,0x5,0x86,0x41,0x7c,0x68,0x38,0x9b,0xd2,0x53,0x4e,0x5c,0xf4, + 0x2b,0x61,0x4d,0x31,0x91,0xcc,0xda,0xb7,0x8d,0x79,0x3,0x46,0x73,0x24,0x3f,0x87, + 0x7e,0xf3,0xbf,0xc4,0x65,0x58,0x13,0x66,0x58,0x93,0x36,0x7c,0xbe,0x6b,0x23,0x19, + 0xae,0x2,0x72,0xdc,0x2e,0xa6,0x27,0x6d,0xa3,0x5f,0x83,0xe6,0xe5,0x2e,0x3b,0xc7, + 0xed,0xe2,0xba,0x9f,0xa7,0x63,0xd7,0x34,0xe6,0xd,0xb8,0x11,0x5d,0xd3,0xfc,0x72, + 0x58,0x7c,0x64,0x1f,0xe7,0xc5,0xd4,0x61,0xdb,0x75,0xf7,0xf3,0xbf,0x4b,0x86,0xf0, + 0xd6,0x96,0x55,0x8c,0xf8,0x79,0x7a,0xb1,0xfe,0x16,0xe6,0x66,0xb1,0xe8,0x50,0x12, + 0xfb,0x73,0x33,0x59,0x3a,0xf8,0x36,0x84,0x77,0x13,0xf2,0x95,0x51,0xda,0xa9,0x75, + 0x63,0xda,0x51,0x2e,0xfa,0x7e,0x22,0x87,0xf3,0xb3,0xf9,0x69,0xc0,0xcd,0xec,0xbe, + 0xee,0x7e,0x6e,0x6d,0xdd,0x81,0xc7,0xd7,0xfc,0x5c,0x6c,0x2c,0x90,0x97,0xcd,0xb7, + 0x7b,0xb7,0x21,0x31,0x59,0x79,0xf5,0x5d,0xcc,0x3d,0xb0,0xb,0x1,0x18,0x39,0x99, + 0xe4,0x1b,0x45,0x9b,0x70,0x7a,0x61,0x1,0xe9,0x81,0x63,0xc4,0x66,0x67,0xec,0x1f, + 0xf3,0x98,0x71,0xf9,0x75,0xc,0x6c,0xd8,0x92,0x11,0x8b,0xa6,0xf0,0xf3,0xe1,0x24, + 0x0,0x76,0x64,0xa4,0xd2,0xf1,0xdb,0xf,0xe9,0xd7,0xa0,0x39,0xb,0x7,0xde,0xc2, + 0x97,0x7b,0x36,0xf1,0xf2,0x86,0x65,0x41,0x71,0x36,0x2e,0xc8,0xcd,0xe2,0xb9,0xf5, + 0x4b,0xe9,0xdf,0xb0,0x5,0xf3,0xfa,0x8f,0x66,0x5a,0xd2,0x56,0x1e,0x5f,0x6d,0xf5, + 0x69,0xd1,0xe1,0x44,0x2e,0x9e,0xf3,0x9,0x6e,0xd3,0xe4,0x8f,0xc1,0x77,0xb0,0x69, + 0xf8,0xdf,0x18,0xd2,0xb8,0x35,0x2f,0x6d,0x5c,0x56,0x64,0x4a,0xb9,0xeb,0x69,0xfe, + 0xaf,0x6d,0x57,0x70,0x17,0x92,0x79,0xcb,0x38,0xe4,0x5d,0x4f,0xd1,0x3c,0x32,0xd6, + 0xff,0xf7,0xa5,0x83,0x6f,0x23,0xf3,0x96,0x71,0x1c,0x3f,0x7e,0x84,0x42,0xc3,0x28, + 0x26,0xab,0x94,0x1b,0x1f,0x65,0xf9,0x90,0x3b,0x21,0x27,0x83,0xd4,0x9b,0x1e,0x23, + 0xf7,0xb6,0x27,0xfc,0xa6,0x97,0xac,0x9c,0x4c,0x32,0x2,0xcc,0x1d,0x79,0x1e,0x37, + 0x9e,0x9c,0x4c,0x7f,0xb9,0x5f,0xf5,0x1d,0x4e,0xe6,0x2d,0x8f,0x43,0x5e,0x36,0x13, + 0x2f,0x19,0x42,0xe6,0x2d,0x8f,0xb3,0xf2,0xea,0xbb,0x0,0xcb,0x6c,0x5c,0xef,0xeb, + 0x37,0x88,0xb,0x9,0x63,0xe9,0xe0,0xdb,0xd8,0x90,0x9e,0xc2,0xe8,0x5f,0xbf,0x2d, + 0xf3,0xd0,0x22,0x84,0xe0,0x58,0x7e,0x2e,0x2d,0xa6,0xbf,0x4b,0xae,0xdb,0xcd,0xfc, + 0xfe,0xa3,0x29,0x34,0xc,0x9a,0x4c,0x7b,0xfb,0xff,0xdb,0xbb,0xf3,0xf8,0x28,0xaa, + 0x74,0xe1,0xe3,0xbf,0xea,0xce,0xd6,0xd9,0xf7,0x3d,0x90,0x85,0x25,0x21,0x24,0x40, + 0x2,0x4,0x24,0x11,0x10,0x90,0x45,0xc4,0x11,0x45,0x45,0x9d,0x79,0x65,0x74,0x5c, + 0xde,0xf1,0xbe,0xb8,0xcd,0x75,0x61,0x9c,0xeb,0xe8,0x1d,0x9d,0x4d,0x65,0xe6,0x8e, + 0x22,0xea,0x75,0xc5,0x11,0x15,0x1,0x45,0x45,0x10,0x77,0x76,0x3,0x4,0x24,0x40, + 0x2,0x49,0x48,0x48,0x8,0xd9,0xd7,0xde,0x97,0x7a,0xff,0xe8,0xa6,0x27,0x9d,0x5, + 0x3a,0x6c,0x73,0xe7,0x7e,0x9e,0xef,0x7f,0xd0,0x5d,0x5d,0x55,0xe7,0x9c,0x3a,0xf5, + 0xd4,0x39,0x4f,0x9d,0xd0,0x64,0x74,0x6,0x95,0xfe,0x5a,0x1f,0xd4,0x3b,0xfe,0x83, + 0xb9,0xae,0x51,0xe0,0xd3,0xd7,0x6b,0xd0,0x79,0xa6,0x30,0x28,0x8a,0xc2,0x87,0xc7, + 0xf,0xb3,0xf0,0xcb,0xf,0x78,0x60,0x74,0x1,0x6f,0x14,0x5d,0xc3,0xdd,0x3b,0x3e, + 0xe3,0xcb,0xba,0x4a,0x14,0x45,0xc1,0xe6,0x70,0x30,0x6e,0xfd,0xcb,0xbc,0x7d,0xec, + 0x0,0xcb,0xb,0xae,0x64,0xfb,0xfc,0x25,0xbc,0x53,0xf9,0xa3,0xc7,0x6f,0x1c,0x68, + 0x6b,0xa4,0xd1,0xa4,0x67,0xfb,0xfc,0x25,0xb4,0x98,0x8c,0xdc,0xfa,0xed,0x7a,0xba, + 0x2c,0x66,0xec,0xaa,0x3,0xd5,0x64,0xe0,0xd6,0x6f,0xd7,0xf3,0xab,0x9c,0xc9,0xfc, + 0x6d,0xf2,0x5c,0x1e,0xfd,0xe1,0x2b,0xfe,0xfc,0xe3,0x4e,0x0,0x6a,0xf5,0x1d,0xa4, + 0xae,0x5e,0x4e,0x98,0x6f,0x0,0x1b,0x67,0x2d,0xe6,0x78,0x77,0x3b,0xa3,0xd6,0xae, + 0xf0,0xb8,0x9,0x9d,0x69,0xd6,0xa1,0xe8,0x93,0xd7,0xd9,0xd3,0x7c,0x8a,0xd,0x33, + 0x6f,0x62,0x44,0x58,0x14,0x23,0xdf,0x5b,0x4e,0x65,0x67,0x2b,0x8a,0xa2,0x70,0xd2, + 0xd0,0xc9,0xf4,0xf5,0xaf,0x30,0x37,0x79,0x18,0x6f,0x14,0x5d,0xc3,0x92,0xef,0x3e, + 0xc6,0x66,0xd2,0x63,0x71,0xd8,0xf1,0x51,0x34,0x5c,0x1e,0x37,0x84,0xbf,0x94,0xee, + 0x46,0x5,0xaa,0xbb,0x3b,0xd8,0x52,0x57,0xc9,0xfc,0x21,0x23,0x6,0x35,0x2a,0x73, + 0xb6,0xff,0x1b,0xe8,0xd8,0x1b,0x8c,0x7a,0x67,0x8a,0x41,0xea,0x28,0xbe,0x70,0xf5, + 0xf3,0x97,0x6c,0xc4,0xc2,0xb5,0x9f,0xca,0xce,0x36,0x1a,0x8c,0x7a,0x16,0xe,0xcd, + 0xf4,0x9c,0x96,0xbd,0xe3,0x9,0xe6,0x24,0x67,0xd0,0xe4,0x6a,0xf3,0xa7,0x8f,0x6d, + 0x53,0x5d,0x5,0x4b,0xb7,0x6f,0xe4,0xf,0xe3,0x67,0x70,0x6f,0xd6,0x4,0x7e,0x57, + 0xb2,0x15,0x53,0xcf,0x7e,0xc4,0xd7,0x8f,0x1b,0xbe,0xfe,0x90,0x95,0x53,0xae,0xe2, + 0xae,0x11,0x79,0xfc,0x9f,0xaf,0x3f,0x64,0x75,0x45,0x69,0x8f,0xeb,0xf5,0x37,0x3c, + 0x3e,0xb6,0x8,0xcc,0x46,0xe7,0xf5,0xfa,0xf3,0xc7,0xc9,0x8d,0x8c,0xc3,0x64,0xb3, + 0x31,0xe1,0xe3,0x57,0xf9,0xbc,0xae,0x82,0xd7,0xa,0x17,0x50,0xbb,0xf8,0x7e,0x1e, + 0x1f,0x57,0xc4,0x83,0xbb,0x37,0xf,0x22,0x6c,0x54,0xdc,0x33,0x1f,0x3b,0x1b,0x6b, + 0x19,0x97,0x90,0x86,0xa2,0x38,0x67,0x7b,0x6e,0xfc,0x6a,0xd,0x2b,0x8f,0xec,0xe1, + 0x8d,0xa2,0x5,0xdc,0x98,0x9e,0x4d,0xc1,0xda,0x15,0x34,0x9b,0xf4,0xae,0x29,0xcb, + 0xcd,0x2c,0xda,0xf2,0x3e,0x45,0xf1,0x43,0xa8,0xb9,0xf1,0x3e,0x36,0x5e,0xb9,0x18, + 0x83,0xdd,0xc2,0xde,0x96,0x7a,0x14,0x45,0x61,0xd5,0xb1,0x3,0xdc,0xfc,0xcd,0x3a, + 0x1e,0x1d,0x73,0x19,0x2b,0xa7,0x5c,0xc5,0x92,0xef,0x3e,0x62,0x7b,0x43,0x8d,0xe7, + 0x68,0xa2,0xbe,0x83,0x1d,0x8d,0x27,0x38,0xd8,0xd6,0xc0,0xe6,0xd9,0xb7,0x90,0x17, + 0x95,0xc0,0xae,0xc6,0x3a,0x16,0xe,0xcd,0xe4,0x9b,0xfa,0x6a,0x4a,0x5d,0xf7,0xbd, + 0x17,0xe,0xfd,0x40,0x6e,0x64,0x1c,0xfe,0x5a,0x1f,0x1c,0xaa,0xca,0xd2,0x9d,0x9f, + 0xf3,0xf4,0xfe,0xad,0xbc,0x30,0x79,0x2e,0xff,0x36,0x6a,0x22,0x33,0x36,0xfc,0x37, + 0x27,0xba,0x3b,0x5c,0x83,0x1f,0x46,0xf2,0xd7,0xae,0x60,0x64,0x58,0x34,0x6b,0xae, + 0x58,0xc4,0xbd,0x3b,0x3f,0x87,0x8b,0x94,0xaa,0x74,0x49,0x2,0xac,0xe3,0x5d,0x6d, + 0xe8,0x7c,0x7c,0xfb,0x6d,0xe4,0x4d,0x26,0x3d,0x1f,0x1c,0x3f,0xc4,0x93,0x79,0xd3, + 0xc8,0x8f,0x49,0xe4,0xee,0xac,0x7c,0x86,0x46,0xc4,0xf1,0xd0,0xf,0x5f,0x78,0x7c, + 0xef,0xf7,0xe3,0x67,0x90,0x15,0x1e,0xc3,0xb3,0x13,0x67,0x51,0x6b,0xe8,0x62,0xbf, + 0x2b,0x97,0xe6,0x96,0x8c,0x1c,0xf4,0xc6,0x6e,0xbe,0xab,0xaf,0xa6,0x56,0xdf,0x49, + 0x55,0x73,0x3d,0x8b,0xd3,0x47,0xf7,0xd9,0x4f,0x9b,0xd9,0xc4,0xac,0xc4,0x74,0x42, + 0xfc,0xfc,0xf9,0xe9,0xf0,0x5c,0x8f,0x86,0xef,0xbe,0x89,0xf6,0x8a,0xda,0x3f,0x3d, + 0x71,0x8c,0x7f,0xcf,0x9d,0x4c,0x51,0xc2,0x50,0x6e,0xce,0xc8,0x61,0x8c,0x2b,0x7, + 0xea,0x1f,0x1b,0xd9,0x79,0xae,0x60,0x16,0x89,0x41,0xa1,0xfc,0x76,0xdc,0x54,0xb0, + 0x5a,0xd8,0xde,0x70,0xc2,0xe3,0x2b,0xf6,0xf3,0xbc,0x59,0xee,0x68,0x38,0xc1,0xfd, + 0xbb,0x36,0x33,0x25,0x29,0x9d,0xdc,0x8,0xd7,0xfe,0xcd,0x46,0xe2,0x75,0xc1,0x2c, + 0xf8,0x62,0x35,0xf,0xec,0xda,0x4c,0xa4,0xbf,0x8e,0x36,0x63,0xf7,0x25,0x1a,0xf2, + 0x54,0x78,0x7a,0xfc,0x15,0xee,0xba,0xa8,0xee,0xee,0x70,0x7,0x77,0x37,0x67,0xe4, + 0xd0,0x65,0xe8,0xe2,0xbb,0x53,0xd5,0x9c,0xe8,0xee,0xa4,0xba,0xa5,0x9e,0x5b,0xfa, + 0xa9,0x8b,0x81,0x54,0x75,0xb5,0xb3,0xe1,0x44,0x39,0x35,0xdd,0x1d,0x54,0x74,0xb4, + 0x7a,0x7c,0x76,0xf5,0x90,0x11,0x8c,0x8e,0x88,0xe1,0xa5,0x23,0x7b,0xd8,0x52,0x57, + 0x45,0xb8,0x7f,0x0,0x9f,0xd5,0x94,0xf7,0xee,0x9,0xa8,0xea,0x6a,0xe3,0xee,0x91, + 0xf9,0xe8,0x7c,0x7c,0x79,0x66,0xc2,0xc,0x52,0x82,0x42,0x7b,0x7e,0xdc,0x87,0xc1, + 0x66,0xc5,0x6a,0xb5,0xd2,0x69,0xb5,0xf0,0xd6,0xb1,0xfd,0xac,0xaf,0x29,0xa3,0x28, + 0x6e,0x28,0xef,0x4c,0xbb,0xd6,0xb3,0x4d,0x28,0xa,0xa5,0x6d,0xcd,0xfc,0x62,0x64, + 0x3e,0x41,0xbe,0x7e,0xbc,0x7f,0xc5,0x75,0xde,0xc5,0xaf,0x76,0x1b,0xcb,0xb,0x66, + 0x33,0x34,0x24,0x9c,0xc7,0xc6,0x14,0x81,0xaa,0xb2,0xc5,0xd5,0xe9,0xdf,0xb5,0xed, + 0x33,0xf2,0x62,0x93,0x78,0x38,0x77,0xa,0x23,0xc2,0xa2,0x78,0x32,0x6f,0x2a,0xeb, + 0x6b,0xca,0x2f,0x4c,0x2e,0x80,0xaa,0xb2,0x28,0x6d,0x14,0xb,0x53,0xb3,0x18,0x16, + 0x16,0xc5,0xd,0x69,0xd9,0xfc,0xbd,0xc2,0xf9,0x34,0xdf,0x61,0x31,0x83,0xdd,0x4e, + 0x8b,0xd9,0xc8,0x6b,0x47,0xf7,0xf3,0x79,0x5d,0x5,0xf3,0x52,0x86,0xb3,0x7c,0xd2, + 0x6c,0x8f,0x51,0x15,0xe7,0x71,0x28,0x3,0x8e,0xdc,0x38,0x13,0xc0,0x95,0x7e,0x6f, + 0x30,0x7a,0x9b,0x5,0x14,0x85,0x2e,0x8b,0x65,0x50,0xc1,0x48,0xcf,0xf2,0x36,0xf5, + 0x78,0xd2,0x5,0xb8,0x7f,0xe7,0x66,0xc2,0xfc,0x74,0x3c,0x37,0xe9,0x4a,0x52,0x43, + 0x22,0x58,0x31,0x79,0x2e,0xbb,0x9b,0x4f,0x52,0xdb,0xf3,0x46,0x34,0x80,0xd5,0x55, + 0xa5,0x18,0x2c,0x26,0xfe,0x3c,0x71,0x26,0x59,0xe1,0x31,0xfc,0x71,0xe2,0x4c,0x2c, + 0x56,0x2b,0x6f,0x1e,0xdb,0xef,0xf1,0xbd,0xde,0xd3,0xc8,0x17,0xc2,0xc3,0xbb,0xb7, + 0xf0,0x8b,0x91,0x79,0x5c,0x9f,0x36,0x8a,0xc2,0xf8,0x21,0xdc,0x9a,0x91,0xc3,0xcb, + 0xe5,0xfb,0xdc,0x53,0x92,0x25,0xcd,0xf5,0x3c,0x5b,0x30,0x8b,0xd9,0xc9,0xc3,0x8, + 0xf2,0xf5,0x63,0xe5,0x94,0xf9,0x1e,0x1,0x45,0x46,0x48,0x38,0xf7,0x65,0x17,0x10, + 0x15,0x10,0xc8,0xb2,0x31,0x85,0xec,0x39,0x55,0x4d,0x97,0xcd,0xe2,0x6e,0x5f,0xbf, + 0x1e,0x5b,0x48,0x61,0xfc,0x10,0xae,0x48,0x4c,0x63,0x5c,0x54,0x3c,0xaf,0x1f,0x2d, + 0x1,0xe0,0x6f,0x87,0x8a,0x41,0xa3,0xf0,0xbb,0xf1,0xd3,0xc9,0x8a,0x88,0xe1,0xb9, + 0x82,0x59,0xd4,0x77,0x77,0xf0,0x79,0xdd,0xb1,0xb3,0x1e,0x73,0x71,0xf3,0x49,0xe, + 0xb4,0x9c,0xe2,0xb9,0x82,0x59,0x8c,0x8e,0x8c,0x65,0xd9,0xd8,0x42,0xfc,0xfc,0x3, + 0x79,0xaa,0xe4,0x7b,0x0,0x5e,0x2b,0x2b,0x21,0x2c,0x24,0x8c,0x7,0x73,0x26,0x91, + 0x13,0x19,0xcb,0x33,0x13,0xae,0x0,0x57,0x7d,0x69,0x35,0x1a,0xae,0x4b,0xcd,0xa2, + 0xae,0xad,0x89,0xed,0xd,0x27,0x38,0xdc,0xde,0x4c,0x47,0x77,0x7,0x4b,0x86,0x8f, + 0xf1,0xba,0x1d,0x1c,0x6a,0x6b,0xe2,0xe9,0xfd,0x5b,0xf9,0xe3,0x81,0xed,0x7c,0x50, + 0x75,0x68,0x50,0x1,0xd2,0xfb,0x55,0xa5,0xa4,0x86,0x84,0x73,0xed,0xd0,0x91,0xd8, + 0x55,0x7,0xdf,0xd6,0x1f,0xbf,0x24,0x7d,0x23,0x5a,0x1f,0x9e,0x3b,0xb8,0x93,0x47, + 0x7f,0xf8,0x92,0x7b,0xb6,0x7f,0xc6,0x75,0xa9,0x99,0xfc,0xc7,0xb8,0xa9,0x7d,0xda, + 0xb7,0xb5,0x9f,0x36,0xf6,0xc6,0xd1,0xfd,0x5c,0x93,0x96,0xc5,0xc2,0xd4,0x4c,0x66, + 0x24,0xa6,0xb1,0x38,0x23,0xdb,0x39,0x5d,0xe0,0x6e,0x98,0x56,0x96,0x17,0xcc,0x26, + 0x2b,0x3c,0x86,0x3b,0xb3,0xf2,0xf1,0xf3,0xb,0x60,0xcd,0xf1,0x43,0x1e,0xbf,0x6b, + 0xb6,0xdb,0xfa,0x7d,0x20,0x6e,0x34,0xea,0xb1,0xd8,0xed,0xac,0x39,0x7e,0x88,0x77, + 0x2b,0xe,0x92,0x12,0x14,0xc6,0xe6,0x39,0xb7,0x7a,0xf7,0x20,0xa7,0x28,0xec,0x69, + 0x3e,0xc9,0x6f,0xf7,0x7e,0xeb,0x1c,0xd9,0x37,0x74,0xf1,0xe2,0x65,0x73,0xd1,0xa0, + 0x70,0xa4,0xbd,0x99,0xf,0x8e,0x1f,0xe6,0xe5,0xc2,0xf9,0x4c,0x88,0x49,0xe2,0xe1, + 0x9c,0xcb,0x8,0xb,0xe,0xe5,0xe5,0x32,0x67,0xdb,0xae,0xe9,0xee,0x4,0x5,0xe, + 0xb6,0x35,0xb1,0xb2,0x6c,0xf,0x87,0xda,0x9b,0x79,0x6c,0x4c,0x11,0x53,0xe2,0x9c, + 0xd3,0xef,0xcb,0xf6,0x7c,0xcd,0xbf,0x65,0x4f,0xe4,0x9a,0xa1,0x99,0x5c,0x91,0x98, + 0xc6,0xc2,0xb4,0x51,0xbc,0x74,0x64,0x6f,0x9f,0x43,0xa8,0x37,0x74,0x73,0x43,0x5a, + 0x36,0x81,0xbe,0x7e,0x2c,0x1d,0x3d,0x91,0xbc,0xe8,0x4,0x96,0x8c,0x18,0x83,0xd5, + 0x62,0x66,0x57,0x53,0x1d,0x35,0xdd,0xed,0xec,0x3b,0x55,0xcd,0xfc,0x94,0x61,0xe8, + 0x7c,0x7c,0x38,0x65,0xec,0xe6,0xe5,0xb2,0x7d,0x3c,0x3f,0xe9,0x4a,0xa,0xe3,0x87, + 0x70,0x67,0x66,0x1e,0xa9,0x91,0xb1,0xbc,0x78,0xb8,0x18,0x80,0xf,0x8f,0x1f,0x6, + 0x1f,0x5f,0x7e,0x3b,0x6e,0x2a,0xa3,0x23,0x63,0xf9,0xeb,0xa4,0xd9,0x70,0x11,0xf2, + 0x1c,0xe1,0x12,0xe4,0x60,0x1,0xa4,0x4,0x87,0x39,0x13,0x7e,0x9d,0xe3,0x8a,0x1e, + 0x9f,0x99,0x1d,0x76,0x1c,0xfa,0x4e,0xf2,0xa2,0x13,0x0,0x67,0x2,0x60,0xb8,0x7f, + 0x0,0x7,0x5d,0x37,0x6d,0x77,0x27,0x13,0x1a,0x9,0xc0,0xc4,0x98,0x24,0x2c,0x86, + 0x6e,0xe,0xb5,0x37,0x31,0x21,0x26,0x91,0x84,0xc0,0x60,0x2e,0x4f,0x19,0xce,0x9f, + 0xe,0xee,0x60,0x6e,0x52,0x6,0x9,0x11,0x31,0xc,0xf,0x8d,0xec,0x33,0xcf,0x1a, + 0xab,0xb,0x22,0xca,0x35,0x3f,0xed,0xa7,0xd1,0xe2,0xe7,0xaf,0x3d,0xe3,0x5c,0xac, + 0xc5,0x6e,0x67,0x6f,0xfd,0x71,0x9e,0xca,0x9f,0x6,0x40,0xb0,0xaf,0x1f,0x51,0x1, + 0xbd,0x73,0xa9,0x54,0x52,0x5d,0x4f,0xf5,0x3a,0x5f,0x5f,0x70,0xd8,0x69,0x32,0x19, + 0x2e,0xcc,0x60,0xb3,0xa2,0x70,0xa8,0xad,0x91,0x1b,0xbf,0x59,0x8b,0xbf,0x56,0xcb, + 0x1b,0x97,0x2f,0x20,0xfc,0x74,0x3e,0x8c,0xbf,0x8e,0x46,0x93,0x9e,0x77,0xa7,0x2f, + 0x24,0x40,0xeb,0xc3,0x63,0xc5,0x5f,0x13,0x16,0x10,0x74,0x69,0x3a,0x11,0x5,0xf7, + 0x48,0xc6,0xc4,0x98,0x24,0xcc,0x86,0x2e,0xca,0x3a,0x5a,0xc8,0x8f,0x4e,0x24,0x39, + 0x28,0x84,0x29,0xc9,0x19,0xfc,0xe1,0xc0,0x76,0x66,0x25,0xa6,0x91,0x14,0x19,0x47, + 0x46,0x3f,0x75,0x31,0x90,0x11,0x61,0x91,0xbc,0x33,0xf5,0x5a,0x26,0x7f,0xf2,0x1a, + 0x8b,0xbe,0x5e,0xc3,0xae,0x5,0x77,0xe0,0xab,0xd1,0x60,0xb6,0xdb,0xb8,0x6b,0xdb, + 0xa7,0x94,0xb4,0x34,0xf0,0xe0,0xe8,0x49,0x4c,0x4f,0xcf,0x66,0xcb,0xc9,0x2a,0xaa, + 0xbb,0xda,0x7b,0x57,0x7,0xa3,0x23,0x62,0x51,0x5d,0x4f,0x75,0x91,0xfe,0xba,0xbe, + 0x7,0xdf,0xcb,0xb8,0xa8,0x78,0x5e,0x2e,0x5a,0xc0,0x9f,0xf,0xee,0x60,0xcd,0x91, + 0x62,0x8,0x8,0x62,0x48,0x50,0x28,0x6b,0x67,0x2c,0x22,0x3f,0x3a,0xd1,0x23,0x60, + 0x29,0x74,0xe5,0xe5,0xa8,0xaa,0x4a,0x72,0x50,0x68,0xff,0x23,0x27,0xbd,0x77,0xa1, + 0x3a,0x18,0x19,0x1e,0xed,0xbc,0xd8,0xb4,0x1a,0x70,0x38,0x38,0x65,0xd2,0x3,0xb0, + 0xb3,0xa9,0x16,0x15,0x48,0x59,0xbd,0x1c,0xd5,0x15,0xf8,0x74,0xb7,0x37,0x61,0xb6, + 0xdb,0xce,0x2b,0x31,0xfa,0x74,0x61,0xa4,0xbb,0xea,0x9,0x20,0xdc,0x3f,0x0,0xbd, + 0x6b,0x8a,0x79,0x6e,0x72,0x6,0xcf,0x4e,0x9e,0xc7,0x5f,0xe,0xed,0xe2,0xed,0xd2, + 0x5d,0x68,0x2,0x82,0x18,0x1e,0x1a,0xc1,0xba,0x99,0x37,0x90,0x15,0x1e,0xc3,0xa5, + 0x34,0x98,0x1b,0xe7,0xee,0xe6,0x3a,0xba,0xac,0x66,0x32,0xd7,0xbc,0x88,0xea,0x7a, + 0xa2,0x6e,0x69,0x6d,0xe0,0x44,0x77,0x27,0x43,0x83,0xc3,0xcf,0xb8,0x6d,0x9d,0xbe, + 0xb,0xec,0x76,0xc6,0xb9,0xfa,0x99,0x71,0x51,0xf1,0xe0,0xb0,0x53,0xe3,0x45,0x70, + 0x76,0xbe,0x2a,0xda,0x9a,0x68,0x32,0x1b,0xf8,0xf4,0x44,0x39,0x2a,0x50,0x67,0xe8, + 0x6,0xa3,0x1e,0xae,0xb8,0xde,0x19,0x1c,0x5a,0x4c,0x2c,0x48,0x19,0x39,0x60,0xb9, + 0x84,0xf8,0xfa,0xbb,0x13,0xa5,0x63,0x3,0x83,0xc0,0x64,0xc0,0xe6,0x70,0xa0,0x55, + 0x14,0x70,0x38,0x18,0x13,0x19,0xef,0xfe,0xae,0xce,0xc7,0x87,0x7d,0xae,0xbc,0xcb, + 0xca,0xae,0x36,0x50,0x61,0x44,0x58,0x94,0xfb,0x7a,0xc5,0x6a,0xa1,0xc1,0xa8,0x3f, + 0xeb,0x31,0xb7,0x5b,0x4c,0x60,0x36,0x30,0x21,0x26,0x9,0x80,0xa1,0xc1,0xe1,0xf8, + 0x68,0x34,0x1c,0xe9,0x68,0x71,0x5,0x31,0x87,0x8,0xf5,0xf5,0x27,0x56,0xe7,0x9c, + 0x95,0x98,0x10,0x9d,0x4,0x3d,0xae,0x87,0xbc,0xe8,0x4,0x52,0xa3,0xe2,0x78,0x7c, + 0xef,0x37,0x64,0x84,0x44,0x90,0x1b,0x3f,0x84,0xf8,0xc0,0x60,0xaf,0xfb,0x82,0x1d, + 0x4d,0xb5,0x2c,0xfb,0x76,0x1d,0x68,0x7d,0x99,0x3c,0x64,0x4,0x8b,0xd2,0x46,0x79, + 0x9d,0x8b,0xf3,0x6e,0x65,0x29,0xe3,0xa3,0x13,0x28,0x88,0x4d,0xc6,0x5f,0xeb,0xc3, + 0xe6,0x93,0x55,0x4c,0x4d,0x48,0xbd,0xf8,0xb9,0x37,0xe,0x3b,0xb3,0x92,0xd2,0x51, + 0x80,0xb5,0xd5,0x47,0xf0,0xd7,0x6a,0xbd,0x3e,0xe7,0x35,0x55,0x87,0x79,0x30,0x67, + 0xb2,0x33,0xad,0x3,0xc8,0x8,0x89,0xf4,0xc,0xb0,0x1c,0xe,0x26,0xf4,0xe8,0x8f, + 0x34,0x8a,0xe2,0x55,0xdb,0xd,0xd0,0xfa,0xf0,0xe1,0x8c,0x45,0x3c,0xb9,0xef,0x3b, + 0x1e,0xde,0xfa,0x9,0xf8,0xf9,0x13,0xa5,0xb,0xe6,0xcd,0xa2,0x5,0x5c,0xe5,0xd5, + 0x88,0xa2,0x4a,0x6a,0x70,0x38,0xb3,0x93,0x33,0xd8,0xdb,0x72,0x8a,0x3,0x6d,0x8d, + 0xc4,0x6,0x4,0xa1,0x28,0xa,0xed,0x16,0x33,0xaa,0xcd,0xca,0x1d,0x5b,0x3f,0xc1, + 0x57,0xd1,0x38,0xfb,0xb0,0xee,0x4e,0x56,0x1c,0x2e,0xe6,0xb1,0x31,0x85,0xfc,0x65, + 0xd2,0x6c,0x62,0x2,0x2,0x79,0xf1,0x70,0x31,0x66,0x93,0x9e,0xc0,0xc0,0x10,0xae, + 0x4a,0x1e,0xc6,0xcb,0x85,0xf3,0x9,0xf7,0xb,0xa0,0xa6,0xbd,0x99,0xd7,0xca,0x4b, + 0xf8,0xa0,0xaa,0x14,0x15,0x85,0x3a,0x7d,0x27,0x98,0x4d,0xac,0x9a,0x76,0xad,0xc7, + 0x11,0xa4,0x86,0x84,0xa3,0xf3,0xf1,0x45,0x55,0x55,0x82,0x7c,0xfc,0x4e,0xf,0xe9, + 0x31,0x3b,0x35,0x93,0xf5,0x35,0x65,0x54,0x74,0xb5,0x11,0x12,0x14,0xca,0xe4,0xd8, + 0x64,0x0,0x8c,0x36,0x2b,0x26,0x93,0x81,0x87,0x76,0x6f,0x61,0x59,0xf1,0xd7,0xce, + 0x6b,0xae,0xb3,0x85,0xe5,0xa5,0xbb,0x78,0x66,0xc2,0xc,0x36,0xd5,0x56,0xa0,0x0, + 0xe9,0xa1,0xce,0xfe,0xb1,0x20,0x36,0x9,0x2e,0xc2,0x83,0xd5,0x25,0xb,0xb0,0xa6, + 0xc6,0xd,0x65,0x63,0xdd,0x31,0xea,0x8d,0xdd,0x24,0x4,0x86,0xb8,0x9f,0x14,0xb5, + 0x8a,0x82,0x8f,0xa2,0x1,0x7f,0x1d,0x95,0x5d,0x6d,0xe4,0x47,0x27,0xd0,0x65,0xb5, + 0xa0,0xb7,0x59,0x49,0xd4,0x79,0xbe,0x65,0xd1,0x60,0xe8,0x26,0x2e,0x30,0x98,0xa3, + 0x9d,0x2d,0xe0,0xef,0x4f,0xa2,0xeb,0x77,0x42,0x7c,0xfd,0x99,0x97,0x34,0x8c,0x47, + 0x8a,0xb7,0x50,0xda,0xd6,0xc8,0xb5,0x43,0xb3,0x88,0xd5,0x5,0xf5,0x69,0xd0,0x51, + 0xfe,0x3a,0x82,0x7c,0xfd,0x3c,0x12,0xa6,0xcf,0xd4,0xe8,0x7d,0x34,0x1a,0x12,0x23, + 0xa2,0x39,0xda,0xd9,0xea,0xae,0xb4,0xce,0xde,0x4f,0xe3,0x6a,0xbf,0x1,0xff,0x99, + 0xef,0xb7,0x5e,0x24,0x30,0x2b,0x8a,0xe2,0x7a,0x8b,0x6e,0xd,0xed,0x16,0x13,0xa5, + 0xb,0xef,0xf1,0x8,0x54,0xd2,0x42,0x23,0xa8,0xee,0xee,0x20,0x25,0x28,0xc,0xab, + 0xc3,0x4e,0x83,0x51,0x4f,0x76,0xc4,0x25,0xba,0x31,0xaa,0xce,0x9c,0xa4,0x58,0x5d, + 0x10,0xe5,0x9d,0x2d,0xe0,0xaf,0x73,0xd7,0x45,0x98,0x5f,0x0,0xb3,0x93,0x32,0xf8, + 0xcd,0xde,0xaf,0x39,0xd0,0xd6,0xc0,0x8d,0x69,0xd9,0x44,0x5,0xe8,0xbc,0xee,0xd4, + 0xfc,0x34,0x5a,0xf2,0xa2,0x13,0xf8,0xe3,0x84,0x99,0xdc,0xb7,0x63,0x23,0xcf,0xec, + 0xff,0x9e,0xdf,0x8c,0x9b,0x8a,0xc1,0x66,0xe5,0xcd,0xc3,0xc5,0xbc,0x3e,0xfd,0x7a, + 0x7e,0x3a,0x3c,0x97,0x36,0xb3,0x11,0x93,0xdd,0xda,0xef,0xa8,0xcd,0xb0,0xd0,0x48, + 0x7c,0x34,0xfd,0xf,0xcc,0xfa,0xf4,0x93,0x1f,0xe3,0xaf,0xf5,0xe1,0x17,0x99,0x79, + 0xfc,0x22,0x33,0xf,0x83,0xd5,0xca,0x33,0x7,0xb6,0xf2,0xf4,0xfe,0x6d,0x2c,0x2f, + 0xdd,0xc5,0xdb,0x53,0xaf,0xf5,0xe8,0xe0,0xf2,0xa3,0x12,0x9c,0xed,0xa7,0xe7,0xef, + 0x68,0xb4,0x58,0x5d,0x53,0x64,0xaa,0xaa,0xd2,0x69,0xf1,0xfe,0x2d,0xcb,0xb4,0x90, + 0x70,0x86,0x4,0x85,0xb2,0x69,0xce,0xad,0x17,0xa5,0xaa,0xfa,0x24,0x88,0xba,0xfe, + 0x1d,0xe8,0xe3,0xc7,0x3,0x39,0x93,0x78,0x20,0x67,0x12,0x6d,0x26,0x23,0x4f,0x94, + 0x7c,0xcb,0x5f,0x4b,0x77,0xf3,0x7a,0x79,0x9,0x7f,0x9c,0x38,0xab,0xcf,0xd4,0x80, + 0xb7,0x6d,0xb7,0x6f,0xcb,0x57,0xdc,0xd3,0xb2,0xee,0x6d,0xb5,0x5a,0x6c,0xae,0x1b, + 0xb1,0xaa,0xaa,0x34,0x18,0xbb,0x7,0x48,0x28,0x56,0xdc,0x97,0xd7,0xe9,0x6d,0x53, + 0x83,0xc3,0xe8,0xb6,0x5a,0x38,0x31,0x88,0x24,0x72,0x77,0x80,0xe9,0x17,0x0,0x1a, + 0xd,0x95,0x9d,0x6d,0xa4,0x87,0x46,0x50,0xd9,0xd9,0x6,0x1a,0xd,0x91,0x83,0x7c, + 0x1,0xe5,0x5c,0x84,0x5,0x6,0xf1,0x48,0xee,0x14,0x1e,0x19,0x53,0xd8,0xff,0x71, + 0xf9,0xf8,0x52,0xdc,0x72,0x92,0x69,0x9,0xa9,0xfd,0x96,0xf5,0xd9,0xca,0xbc,0x77, + 0xda,0xc1,0xe9,0x7a,0x8b,0xe,0x8,0x4,0x5,0xea,0xd,0x5d,0x24,0x4,0x86,0x50, + 0xde,0xd1,0xa,0x5a,0x9f,0x3e,0x2f,0xb6,0xf8,0xf4,0xf3,0xfb,0x81,0x3e,0xbe,0xe0, + 0xeb,0xc7,0xb1,0x8e,0x56,0x26,0xc6,0x26,0xd1,0x64,0x34,0x60,0x57,0x1d,0xc4,0xbb, + 0x2,0xaa,0x89,0xb1,0x49,0x7c,0x54,0x5d,0x46,0xbb,0xd9,0x48,0xb8,0xbf,0x8e,0xa3, + 0x1d,0x2d,0x1e,0x9d,0x5f,0x4a,0x50,0x28,0x93,0x62,0x92,0x58,0x5d,0x59,0xca,0xb7, + 0xa7,0x8e,0xf3,0x64,0xde,0x74,0xb4,0x8a,0xc6,0xab,0xf6,0xa3,0xaa,0x2a,0xb7,0x8f, + 0x18,0xc7,0xed,0x23,0xc6,0xd,0xaa,0xed,0x29,0x8a,0x82,0xc5,0x6e,0xa3,0xa4,0xb1, + 0x96,0x83,0x6d,0x4d,0xbc,0x79,0xec,0x0,0xe,0x55,0x65,0x97,0x2b,0x6d,0xa3,0xe7, + 0xf6,0x3e,0x8a,0x86,0x1,0x73,0x28,0x14,0xe7,0xb5,0xa2,0xaa,0xea,0xe0,0xda,0xbd, + 0xaa,0x92,0x1d,0x1e,0x43,0x66,0x78,0x34,0x21,0x3e,0x7e,0x5c,0xb9,0x69,0x15,0x7f, + 0x38,0xb0,0x8d,0x87,0x73,0xa7,0x9c,0x75,0xd3,0x9,0xb1,0x89,0x9c,0x34,0x74,0x62, + 0x75,0xd8,0xd1,0xa0,0x50,0x6f,0xe8,0xea,0x73,0x5d,0x68,0x35,0x1a,0x2f,0x1e,0x56, + 0x3c,0x93,0xbd,0x35,0x8a,0xc2,0xbc,0x94,0xe1,0xcc,0x4b,0x19,0xe,0x2a,0xbc,0x52, + 0xb6,0x97,0x5f,0xfd,0xb0,0x85,0x27,0x4b,0xbe,0xf7,0x2e,0xc0,0x52,0x21,0x32,0x40, + 0xc7,0xa4,0xd8,0x64,0x3e,0x9a,0x79,0x23,0xc9,0xef,0x3d,0xcf,0xd2,0x5d,0x9b,0x58, + 0x3f,0xf3,0x6,0x74,0x3e,0xce,0xf0,0x61,0xfb,0xfc,0xdb,0x48,0xf,0x89,0xec,0x53, + 0x87,0x9,0x81,0x21,0xbc,0x70,0xd9,0x3c,0x5e,0xb8,0x6c,0x1e,0xa5,0x6d,0x4d,0x3c, + 0xb8,0x7b,0x33,0xeb,0x6b,0xca,0x78,0xb0,0x7d,0x12,0x5,0xb1,0xc9,0x4,0xe9,0x2, + 0xf9,0xcf,0xfc,0x69,0xdc,0x3b,0x6a,0xe2,0xc0,0xfd,0x8c,0xa,0x49,0x81,0x21,0xfd, + 0x3e,0x70,0xfe,0x6c,0x58,0xe,0xb7,0x7c,0xf5,0x21,0x3b,0x1a,0x6a,0x19,0x15,0x11, + 0xe3,0x7e,0x20,0xf6,0xd5,0x68,0x41,0xab,0xe5,0xd3,0x59,0x37,0xb9,0x1f,0x10,0x7a, + 0x1a,0x13,0x15,0xcf,0x9a,0xea,0x23,0x34,0x1a,0xbb,0x89,0xd5,0x5,0x53,0xde,0xde, + 0xa,0x9a,0x8b,0x13,0x78,0x5f,0x92,0x29,0xc2,0xa7,0xc7,0x4f,0xc7,0x60,0xb5,0xf2, + 0x6a,0xd9,0x3e,0x8c,0x36,0x2b,0x56,0x87,0x9d,0x47,0x8a,0xbf,0xa4,0xcd,0x62,0x22, + 0xcc,0xcf,0x9f,0x31,0x31,0x49,0xac,0x3a,0xf6,0x23,0x1d,0x16,0x13,0xdb,0x1a,0x6a, + 0xa8,0xe8,0x6c,0x65,0xc9,0x8,0xcf,0xe1,0xe4,0xd5,0x95,0xa5,0x58,0xec,0x76,0x5e, + 0x3f,0xba,0x9f,0x18,0x5d,0xb0,0xc7,0x74,0xdd,0xdc,0x94,0x61,0x44,0xf8,0x7,0x62, + 0x53,0x55,0x2e,0x8f,0x1f,0xe2,0x2c,0xe0,0x33,0x5c,0x4,0x3d,0x2b,0xb2,0xe7,0xcd, + 0xa8,0x67,0x61,0xf8,0x6a,0xb4,0xcc,0x49,0xca,0xe0,0xfd,0xaa,0x43,0x34,0x18,0xf5, + 0x94,0xb4,0x36,0x50,0xd5,0xdd,0x36,0xe8,0x73,0x9f,0x10,0x9d,0x88,0xc5,0x6e,0xa3, + 0xc9,0xf5,0xd4,0xe8,0x4d,0x27,0x71,0xa2,0xbb,0x83,0x39,0x9b,0xde,0x61,0x78,0x58, + 0x14,0x27,0x6e,0x5c,0xea,0x1e,0xbd,0x3b,0xbd,0xed,0x9d,0x23,0xf3,0x59,0x73,0xfc, + 0x30,0x5d,0x56,0x33,0x55,0x5d,0xed,0xec,0x68,0x3c,0xc1,0xc3,0x39,0x97,0xf5,0x39, + 0x27,0xe7,0xeb,0xf3,0xea,0x59,0x3a,0x67,0xa5,0xdf,0xf2,0x18,0xf8,0x7a,0x53,0x79, + 0xbf,0xca,0x59,0x17,0x6f,0x94,0xef,0x27,0x21,0x30,0x84,0xd1,0x11,0xb1,0x1e,0x53, + 0x79,0xa1,0x7e,0x3a,0xec,0xde,0xd4,0xc5,0x0,0x96,0x66,0x17,0x70,0x5d,0x5a,0x36, + 0x4f,0x95,0x7c,0xcf,0xde,0xe6,0x7a,0xfc,0x34,0x5a,0x22,0x83,0x42,0x39,0xa1,0xef, + 0x40,0x55,0x55,0x36,0xd7,0x55,0x72,0xbc,0x47,0xe,0x83,0xb7,0x7e,0x32,0x74,0x24, + 0x46,0xab,0x85,0x8a,0xce,0x7f,0x4c,0x3f,0x9e,0x34,0x74,0xb1,0xf5,0x54,0xd,0x46, + 0x9b,0x95,0x40,0x5f,0x5f,0x7e,0x36,0x2c,0x17,0x45,0x81,0xf6,0x7e,0x2,0x25,0xb5, + 0x57,0xfb,0x51,0x50,0xc8,0x4d,0x48,0x65,0xc3,0x89,0x72,0x2c,0x76,0x1b,0xc5,0xcd, + 0xf5,0xec,0x69,0xae,0xf7,0xfa,0x78,0x7e,0x95,0x33,0x99,0xad,0xd,0xb5,0xac,0x3b, + 0x7e,0x4,0xbb,0xc3,0x81,0xc5,0x6e,0x63,0x73,0x6d,0x85,0xf3,0xb5,0xec,0xb3,0xdc, + 0x80,0x7a,0x3e,0xa1,0xa2,0xaa,0x83,0x7a,0x1b,0xa9,0xac,0xa3,0x85,0xe2,0xa6,0x93, + 0x58,0xec,0x76,0x22,0x2,0x74,0xce,0x1b,0x99,0xc3,0xde,0x67,0x9,0x8e,0xcc,0xb0, + 0x28,0xd0,0x68,0xdc,0xd3,0xb5,0xbd,0x93,0xa3,0x83,0x7c,0xfd,0x40,0x55,0xd1,0xf5, + 0xe8,0xfc,0x4e,0x7f,0x1e,0xee,0xe7,0xf,0x41,0xa1,0xec,0x6e,0xac,0xf3,0x68,0xbb, + 0x73,0x87,0x66,0xb2,0xa3,0xb1,0x96,0x56,0xb3,0x91,0xe3,0xdd,0xed,0xac,0xaf,0x2e, + 0x83,0x7e,0x8e,0x3d,0x39,0x3a,0xc1,0x9d,0x5f,0x71,0x7a,0xdb,0xa5,0xd9,0x5,0x9c, + 0x34,0x74,0xf3,0xe2,0xa1,0x62,0xcc,0x76,0x1b,0x76,0x87,0x83,0x1d,0x8d,0xb5,0xee, + 0x6b,0xeb,0x4c,0x8a,0xe2,0x52,0x40,0xab,0xe5,0xad,0x63,0x7,0xb0,0xd8,0xed,0xbc, + 0x5d,0x71,0x0,0x14,0xd,0xd3,0x7b,0x4,0x35,0x17,0xcb,0xdd,0x99,0xe3,0x79,0xa5, + 0xac,0x84,0xdd,0x4d,0xce,0xb2,0xe8,0xb6,0x9a,0x9d,0x79,0x95,0xc0,0xa4,0xd8,0x24, + 0x62,0x82,0xc2,0x78,0xfe,0xe0,0x4e,0xf7,0x79,0x7c,0x79,0xb2,0xea,0x82,0x8c,0xb4, + 0xcc,0x4b,0x1e,0x6,0x76,0x3b,0xef,0x55,0x1e,0xc2,0x62,0xb7,0xf1,0x5a,0xf9,0x3e, + 0xfc,0xfd,0x75,0xe4,0x47,0xc5,0x7b,0x7c,0xef,0xba,0xd4,0x2c,0xda,0x2d,0x26,0xf7, + 0x88,0xb0,0xaa,0xaa,0x64,0x84,0x44,0x12,0x15,0x1c,0xce,0x7f,0x97,0x97,0x60,0xb2, + 0x59,0xd9,0x70,0xa2,0xc,0xb3,0xd9,0xcc,0xd,0xae,0x91,0xa4,0x25,0xc3,0xc6,0xd2, + 0x6c,0xe8,0x62,0xf3,0xc9,0x2a,0xf4,0x36,0xd7,0x54,0xab,0x6b,0xb9,0x8e,0xd3,0x6d, + 0xe0,0x8e,0x91,0x79,0xae,0x7e,0xc8,0x97,0xc2,0xb8,0x14,0xaf,0xd7,0xd9,0xea,0xef, + 0xdc,0xbd,0x2d,0x8f,0x8f,0x6a,0xca,0x41,0xeb,0xc3,0xea,0x69,0xd7,0x62,0xb9,0x6d, + 0x19,0x3f,0xcd,0xc8,0xe5,0x68,0x67,0x2b,0xd5,0xdd,0x9e,0xa3,0xdd,0x37,0xa7,0x8f, + 0xa6,0x4e,0xdf,0xe5,0x2e,0xf3,0x9e,0xed,0xda,0x4f,0xa3,0x25,0x23,0x7e,0xa8,0x47, + 0xfe,0xd6,0x60,0x93,0xe4,0x67,0x25,0x67,0x50,0x14,0x9f,0xca,0x13,0xfb,0xbe,0xc3, + 0xd8,0x6b,0xfa,0xc9,0xb7,0x9f,0x40,0xe9,0x67,0x19,0xb9,0x7c,0x5d,0x5f,0xcd,0xd1, + 0xce,0x56,0xea,0xc,0x5d,0x7c,0xd7,0x50,0xd3,0xef,0x75,0x71,0x26,0x19,0x21,0x11, + 0xe0,0xe3,0xc3,0x91,0xb6,0x26,0xf7,0x71,0x5b,0x1d,0x76,0x3e,0xa9,0x29,0x77,0xa6, + 0x5,0x28,0x70,0xcd,0xd0,0x11,0xc,0x71,0xe5,0xef,0xe,0xfe,0xd9,0x5a,0xe5,0x99, + 0xf1,0x33,0xf8,0xe4,0xe8,0x1,0xca,0xda,0x5b,0x48,0xf,0x89,0x20,0x2f,0x2e,0x85, + 0xfb,0x77,0x7e,0xe1,0x9e,0xa6,0x3f,0x65,0xe8,0x66,0x43,0x4d,0x39,0x8a,0xa2,0xf0, + 0x49,0xcd,0x51,0xf7,0x8b,0x31,0xd9,0x11,0x31,0xdc,0x3e,0x62,0x1c,0x56,0x93,0x1, + 0x8b,0x6b,0xb4,0xe8,0x8e,0x11,0x79,0xfc,0xed,0x50,0x31,0x7b,0x5d,0x7d,0x66,0x97, + 0xc5,0xcc,0x87,0x55,0x87,0xbd,0xe,0xc2,0xf3,0xa2,0x12,0x88,0xb,0xa,0xc5,0x62, + 0xb7,0xb9,0x53,0x7e,0x54,0x55,0x25,0xca,0x5f,0xc7,0xac,0xe4,0x61,0x3c,0xf2,0xc3, + 0x57,0xee,0xfd,0x37,0x9b,0xf4,0xee,0x6b,0x6e,0xe1,0xd0,0x4c,0xb0,0x59,0x59,0x7b, + 0xbc,0xc,0xb3,0xdd,0xc6,0xca,0xb2,0x3d,0xa0,0xb9,0x38,0x63,0x4d,0x97,0x64,0x1d, + 0xac,0x70,0x7f,0x1d,0x1b,0x67,0xdf,0xcc,0xef,0xf,0x6c,0x63,0xfa,0xc6,0xb7,0x30, + 0xdb,0xec,0xe4,0x46,0xc6,0xe2,0xaf,0xd1,0x12,0xe4,0xeb,0xc7,0xeb,0x97,0x2f,0xe0, + 0x97,0xdb,0x37,0x32,0xf1,0xa3,0x57,0xb1,0xa9,0x2a,0xcb,0xc6,0x14,0x72,0xef,0xa8, + 0x9,0x1e,0xbf,0xd3,0x68,0xd2,0x93,0xbb,0xee,0x25,0xf4,0x36,0x2b,0x2f,0x4c,0x9e, + 0x4b,0xac,0xee,0x1f,0x53,0x62,0xb9,0x91,0x71,0x24,0xe8,0x82,0xb1,0xa9,0xe,0xf7, + 0x52,0x5,0x9e,0xf3,0x90,0x46,0xf7,0xdb,0x1d,0x3d,0x2b,0x4f,0x51,0x14,0x92,0x57, + 0x2f,0x27,0xd2,0x5f,0x47,0xb5,0xab,0x51,0xe6,0xae,0x5b,0x49,0xab,0xd9,0x48,0xed, + 0x4d,0xf7,0xf1,0xe0,0xe8,0xc9,0xdc,0xf6,0xfd,0x47,0x14,0x7c,0xfc,0x2a,0x33,0x13, + 0xd3,0x89,0xd,0x8,0xe2,0xa4,0xeb,0xc6,0xae,0xb7,0x5a,0xa0,0x77,0x23,0x35,0x19, + 0x30,0xf4,0xca,0x1b,0xb9,0x2f,0xbb,0x80,0x2d,0x75,0x95,0x8c,0xff,0xf8,0x55,0xac, + 0xe,0x7,0xb5,0x37,0xdd,0x77,0xd6,0x8e,0xe6,0xaa,0x2f,0x56,0xf3,0x63,0x7d,0x15, + 0x8d,0x51,0x9,0x14,0x7e,0xfa,0x6,0x76,0x55,0xc5,0x64,0xb3,0xf1,0xc2,0xe4,0x17, + 0xf,0x66,0x30,0x0,0x0,0x7,0xd0,0x49,0x44,0x41,0x54,0xb9,0xcc,0x49,0xce,0xe0, + 0x9e,0xac,0x7c,0x2a,0xba,0x5a,0x99,0xb9,0x71,0x95,0x33,0xa1,0x2f,0xbb,0x80,0xb9, + 0x29,0xc3,0xdc,0x91,0xff,0xec,0x4d,0xef,0x50,0xab,0xef,0xa4,0xce,0xd0,0x5,0x38, + 0xdf,0xee,0xd3,0xdb,0x2c,0xbc,0x3b,0x6d,0x21,0x13,0x63,0x92,0x48,0x79,0x6f,0x39, + 0xd1,0xfe,0x81,0x98,0x8d,0xdd,0x6c,0xaf,0xaf,0x26,0x77,0xdd,0x4a,0x67,0xb0,0xe6, + 0x5a,0x83,0x6a,0x20,0x9d,0x16,0xb,0xaa,0xd9,0x48,0xbd,0xa1,0x9b,0x9c,0x75,0x2f, + 0x61,0xb2,0x3b,0x8f,0xa9,0xe7,0x3a,0x47,0x63,0xa3,0xe2,0x89,0xf,0x8,0xa2,0xd1, + 0xc,0xb3,0x92,0xd2,0xbd,0x6e,0x27,0x5d,0x66,0x23,0x1d,0x3d,0xa6,0xf4,0xfe,0x36, + 0x79,0xe,0x3b,0x9b,0xea,0x98,0xb9,0x71,0x15,0xb5,0x37,0x2d,0x65,0xe5,0x94,0xab, + 0xf8,0xdd,0xfe,0xad,0x6c,0xa8,0x29,0xa7,0x30,0x3e,0x85,0x98,0x80,0x40,0xda,0x3a, + 0x5b,0x7b,0xd5,0xb3,0xc1,0x39,0x15,0x3d,0x80,0x7b,0x32,0xc7,0x53,0xdd,0xdd,0xc9, + 0xf5,0x5f,0xae,0xa1,0xc1,0xa4,0xe7,0xe4,0xe2,0xfb,0x51,0x70,0xe6,0xc1,0x3c,0xb1, + 0xef,0x5b,0x5a,0xcd,0x46,0x92,0x2,0x43,0xf8,0xbf,0x99,0xe3,0x59,0xd6,0x63,0xb4, + 0xc1,0x81,0xa,0x26,0xe7,0x13,0xbc,0x47,0xfb,0x1,0x7e,0x3f,0x61,0x6,0xbf,0xd9, + 0xfb,0x2d,0x5,0x1b,0x5e,0x63,0x4a,0x6c,0xa,0xf1,0x81,0xc1,0x1c,0xab,0x77,0x26, + 0xb1,0x1b,0x6c,0x36,0xe8,0x3d,0x65,0x6c,0x36,0xba,0x17,0xaf,0xbc,0x6d,0xf8,0x58, + 0xac,0xe,0x3b,0xcf,0x1c,0xd8,0xca,0xb2,0x3d,0x5f,0x91,0x14,0x18,0xca,0x94,0xb8, + 0x64,0x8f,0x91,0x8c,0x81,0x6e,0x40,0x37,0x7f,0xb3,0x8e,0x92,0xd6,0x53,0xb4,0x98, + 0xc,0xa0,0xd1,0x30,0xea,0xc3,0x15,0x58,0x5c,0x39,0x81,0xb,0x86,0x8c,0x4,0x93, + 0xc1,0x23,0x87,0xc9,0x68,0xb3,0xba,0x8f,0x45,0x3,0xac,0xae,0x3c,0xc8,0x43,0xbb, + 0xb7,0xa0,0xb7,0x99,0x49,0x8,0xc,0xe1,0xa1,0x31,0x85,0x3c,0x9a,0xeb,0x39,0xc2, + 0xb2,0x28,0x6d,0x14,0xef,0x56,0x96,0x32,0x6d,0xe3,0x5b,0xae,0x27,0xd5,0x25,0xa4, + 0x4,0x87,0xb1,0xea,0xd8,0x8f,0x3c,0x59,0xf2,0x9d,0xb3,0x1d,0x6b,0xb5,0x2c,0xfa, + 0x7a,0xd,0x61,0x7e,0x1,0x14,0xc5,0xd,0x61,0xe5,0x94,0xab,0x5c,0x53,0x4a,0x61, + 0xfc,0x32,0x6b,0x2,0x77,0x6d,0xff,0x14,0xdd,0x2e,0x1f,0x1e,0xca,0xb9,0x8c,0x3b, + 0x33,0xf3,0x78,0x2a,0x7f,0x1a,0xf,0xee,0xda,0xc2,0xd4,0x4f,0xdf,0x64,0x54,0x78, + 0xc,0x63,0x23,0xe3,0xd8,0x5e,0xd6,0x37,0xef,0xe2,0x77,0xf9,0xd3,0x79,0xb4,0xf8, + 0x2b,0x3e,0xab,0x3d,0xc6,0xc8,0xf0,0x68,0x3e,0x9e,0x79,0x23,0xf3,0x52,0x86,0xb3, + 0x76,0xc6,0xf5,0xfc,0xe9,0xc7,0x1d,0xfc,0xd7,0xa1,0xdd,0xc4,0xe9,0x82,0x98,0x10, + 0x9d,0xc8,0xaf,0x72,0x2f,0x3b,0x6b,0xfb,0x9a,0x12,0x3f,0x84,0x77,0xa7,0x5f,0xc7, + 0xaf,0xf7,0x7c,0xc3,0xdf,0x2b,0x7e,0xc4,0xae,0xaa,0xac,0x9a,0xb6,0x90,0xa9,0x9, + 0x9e,0x2f,0xc4,0x74,0xf5,0x77,0x5d,0x7b,0xc9,0xec,0xb0,0xf7,0xad,0x6f,0xe0,0xd7, + 0x63,0x8b,0xf0,0x51,0x14,0xee,0xde,0xf6,0x19,0x16,0xbb,0x8d,0xd4,0x90,0x70,0x66, + 0xb8,0xea,0x38,0x23,0x34,0x92,0x8d,0x57,0x2e,0xe6,0xbe,0x5d,0x9b,0xb9,0xec,0x93, + 0xd7,0x49,0xc,0xc,0xe1,0x86,0xb4,0x2c,0xf7,0xcb,0x21,0x16,0xb3,0xd1,0x79,0x73, + 0x74,0xb1,0x3b,0x4e,0xb7,0x45,0xd5,0x39,0x56,0xe1,0x6a,0x97,0xa7,0x75,0x58,0x2d, + 0xd8,0x5c,0xc7,0x3f,0x7f,0xc8,0x8,0x5e,0x99,0xfa,0x13,0x9e,0xde,0xbf,0x8d,0x17, + 0xf,0xff,0x0,0x8a,0xc2,0xfb,0xd3,0xaf,0x63,0x4c,0xaf,0x0,0xeb,0xff,0x65,0x4f, + 0xa4,0xce,0xd0,0xc5,0x35,0x5b,0xde,0xa3,0xc9,0x64,0xa0,0x6e,0xf1,0xfd,0x64,0x84, + 0x46,0xb0,0x7a,0xfa,0x42,0xee,0xdb,0xb9,0x99,0x31,0xeb,0x56,0x62,0x51,0x1d,0x2c, + 0x9f,0x32,0x8f,0xc5,0x19,0xa3,0x5d,0xe5,0x99,0xc2,0xa3,0xe3,0x2e,0xe7,0xde,0xed, + 0x9f,0xf1,0x5c,0x48,0x24,0x8b,0xd2,0xb2,0x58,0xed,0xf0,0x5c,0x1a,0x62,0x46,0x62, + 0x1a,0x41,0x3e,0x7e,0xc,0xd,0x9,0xf3,0x78,0x8,0xbb,0x98,0xde,0x3c,0xba,0x1f, + 0xec,0x36,0x26,0xb9,0xa6,0x8b,0x16,0xa7,0x8f,0xe2,0x8d,0xfd,0xdf,0x53,0xde,0xd1, + 0xea,0x31,0x8d,0xbc,0x6c,0x4c,0x21,0xed,0x16,0x13,0x33,0x37,0xbe,0x4d,0x9b,0xd5, + 0x4c,0xcd,0x8d,0x4b,0x3d,0x1e,0x5a,0xfe,0x5a,0x30,0x87,0xe7,0x4b,0x77,0x31,0x6a, + 0xcd,0x8b,0xcc,0x4c,0x4e,0xe7,0xaf,0x93,0xe6,0x9c,0x79,0x76,0x90,0x7f,0xd4,0xcb, + 0xe9,0x7e,0xf8,0x97,0x99,0xf9,0xdc,0xb4,0xe9,0x8,0xcf,0x1e,0xdc,0xc1,0xaf,0xc7, + 0x5e,0xce,0xe8,0xb5,0x2f,0x1,0x70,0xb8,0xa3,0x19,0x6c,0x16,0xc6,0xac,0x5b,0x49, + 0x8b,0xd9,0xc8,0xfe,0x9f,0xdc,0xc9,0x4d,0xe9,0xd9,0x7c,0x71,0xb2,0x92,0x59,0x1b, + 0x57,0x31,0x2e,0x2a,0x81,0xac,0xb0,0x68,0xf6,0xd6,0x56,0xc,0xd8,0xae,0x4c,0xbd, + 0xda,0x5,0xc0,0xfc,0x94,0xe1,0x5c,0x91,0x3c,0x9c,0x59,0x9b,0xde,0x71,0x26,0xce, + 0xcf,0xbe,0x85,0x61,0xa1,0x11,0x1c,0x68,0x6d,0x60,0xc5,0xe1,0x3d,0xd4,0x19,0x3a, + 0x49,0x8,0xc,0x61,0x62,0x74,0x22,0xff,0xee,0xc5,0x35,0xd3,0xbb,0xbf,0x52,0x14, + 0x85,0xa2,0xb8,0x21,0x84,0x85,0x84,0x73,0xfb,0xd6,0x8f,0xd9,0x71,0xf5,0xed,0xac, + 0xb9,0xe2,0x7a,0x1e,0xf9,0xe1,0x4b,0xe6,0x6c,0xfa,0x3b,0x7e,0x1a,0xd,0x23,0x43, + 0xa3,0x58,0x98,0x96,0xe5,0xbe,0xf7,0xff,0x67,0xc9,0xf7,0x1c,0x6c,0x6b,0x72,0x4e, + 0x97,0xea,0x82,0x59,0x31,0xf5,0x5a,0x26,0xc6,0x38,0x47,0x9a,0x9e,0xcc,0x9b,0x86, + 0xbf,0x46,0xcb,0xed,0x5b,0x37,0x60,0x73,0xd8,0x49,0xd,0x8e,0x60,0x56,0x52,0x5a, + 0xdf,0xfd,0xf7,0x93,0x1f,0xa5,0x28,0xa,0x19,0xa1,0x11,0xc,0xb,0x8d,0xa0,0xa1, + 0xf5,0x14,0xf7,0x64,0xe5,0xbb,0xff,0x3f,0xc8,0xd7,0x8f,0x37,0x8a,0x16,0xf0,0x58, + 0xf1,0x57,0x2c,0xf8,0xe2,0x3d,0xb4,0x8a,0xc2,0xf0,0xd0,0x48,0xae,0x76,0x8d,0xd8, + 0x8d,0x8a,0x88,0xe1,0xd9,0xc9,0x73,0x79,0x62,0xdf,0x37,0xbc,0x78,0xf8,0x7,0x67, + 0xce,0xb6,0x49,0xdf,0x6f,0xe,0xdb,0x79,0xa7,0x40,0xa8,0xff,0xe4,0x25,0x59,0xcf, + 0xb6,0x66,0xc5,0xac,0xcf,0x57,0xb1,0xe5,0x64,0x15,0xea,0xcf,0x1f,0x1f,0x70,0xbb, + 0x66,0xa3,0x81,0xec,0x75,0x2b,0x48,0xd,0xe,0x63,0xd7,0x82,0x3b,0x6,0xfc,0x9e, + 0xb7,0xeb,0x65,0xf4,0xf7,0x99,0xd5,0x6e,0x67,0xda,0xc6,0xb7,0xa8,0x33,0x74,0x72, + 0xfc,0x86,0xa5,0x7d,0xbe,0xd7,0xdf,0x7e,0xce,0x65,0xce,0xff,0x42,0xac,0x7f,0x73, + 0x21,0xd6,0xef,0x3a,0xd7,0xcf,0x9a,0x8c,0x7a,0x32,0xd7,0xae,0x20,0x33,0x34,0x92, + 0x6d,0x57,0xff,0x7c,0xd0,0xfb,0x1d,0xec,0xf1,0x9f,0xa9,0xfc,0xcf,0x76,0xfc,0xe7, + 0xb3,0x5e,0xd4,0xb9,0x9c,0xd3,0xf9,0x9c,0xe7,0xb9,0x4c,0x33,0xf7,0x77,0x1e,0xde, + 0x9e,0xf3,0xb9,0xae,0xcf,0x74,0x21,0xda,0xd0,0x40,0x75,0x75,0xa1,0xea,0xc3,0x9b, + 0xfd,0x9e,0x6b,0x3b,0x1c,0xcc,0xb6,0x67,0x5b,0xab,0xca,0xdb,0x7a,0xf3,0xa6,0xde, + 0x2f,0x54,0x59,0xf,0xd4,0xb7,0x6d,0xa9,0xab,0x64,0xd6,0x27,0xaf,0xb3,0x7f,0xd1, + 0xbd,0xe4,0x44,0xc4,0xba,0x97,0x88,0x48,0xfd,0xe0,0xbf,0xf8,0x59,0x46,0xe,0x6f, + 0x4e,0xfd,0xc9,0x25,0xbf,0x97,0xc,0xf4,0xef,0xc1,0xf6,0x5,0xe7,0xdb,0x1e,0xce, + 0x65,0xfb,0x7,0x77,0x6d,0xe6,0x85,0xc3,0xc5,0x98,0x6e,0x7b,0xec,0x9f,0x76,0xaf, + 0x39,0x5b,0x7b,0x3a,0x9f,0x6b,0xdd,0xf5,0x63,0xfd,0x66,0x7,0x9c,0x6b,0x9f,0xde, + 0x73,0x3b,0x50,0xe8,0x6f,0xf7,0x17,0x72,0xed,0xc3,0xff,0x31,0x53,0x84,0x83,0x1d, + 0xe,0xf6,0x76,0x2a,0xed,0xb4,0x4d,0x75,0x15,0x34,0xea,0x3b,0x79,0x68,0xf4,0xe4, + 0x3e,0xc3,0xbd,0xbd,0x47,0xac,0xbc,0xdd,0x87,0xa2,0x28,0xd4,0xe9,0xbb,0xdc,0x43, + 0xcb,0xbb,0x9a,0xeb,0x28,0x6d,0x6b,0xe2,0xd6,0x8c,0xdc,0x7e,0x7f,0xa3,0xbf,0xfd, + 0x9c,0x4b,0x45,0x9d,0x6f,0xe5,0x9e,0xcf,0xf6,0x67,0x2b,0xf,0x6f,0x3e,0xfb,0xb4, + 0xf6,0x28,0xad,0x86,0x2e,0x1e,0xe8,0xa7,0x2e,0xbc,0xd9,0x7e,0xb0,0xc7,0x7f,0xa6, + 0xf2,0x3f,0x9f,0x69,0x87,0xd3,0xeb,0xcb,0x5c,0x88,0xb2,0xf4,0xf6,0x18,0x2f,0x54, + 0x1d,0xf7,0xde,0x8f,0xb7,0xfb,0xed,0xf9,0xdd,0xb,0x71,0x5d,0x9e,0xeb,0x67,0x3, + 0xd5,0xd5,0xc5,0x28,0xb3,0x81,0xf6,0x7b,0xae,0xed,0x70,0x30,0xdb,0x9e,0xe9,0x9c, + 0x6,0x53,0x6f,0xde,0xd4,0xfb,0x85,0x2a,0xeb,0x9e,0xed,0xe3,0xfb,0x53,0xd5,0x38, + 0x54,0x7,0x5d,0x56,0x33,0x6f,0x57,0xfc,0x48,0x7a,0x44,0xac,0x3b,0x1,0x1a,0xe0, + 0xb5,0xa3,0x25,0x60,0xb7,0xb3,0x64,0xc4,0x58,0xaf,0xfb,0x82,0xb,0xd9,0xf7,0xd, + 0xf4,0xef,0x73,0x99,0x82,0x3c,0x9f,0xf6,0xe0,0xcd,0xf6,0x6,0x9b,0x95,0x1f,0x5d, + 0x6f,0xc6,0x57,0x74,0xb6,0xf2,0xc5,0xc9,0x2a,0xae,0xed,0xf5,0xa6,0xfb,0xa5,0xbe, + 0xd7,0x9c,0xad,0x3d,0x9d,0xcf,0xb5,0xae,0xc,0x10,0x5c,0x9d,0x4f,0x9f,0xde,0x73, + 0xbb,0x81,0x76,0x7f,0xb6,0x7e,0xe4,0x5f,0xee,0x4f,0xe5,0x9c,0xaf,0x4e,0xab,0xb9, + 0xdf,0x61,0xf7,0xd3,0x6a,0xba,0x3b,0xf8,0xf9,0xd6,0xd,0x5c,0x97,0x9e,0xcd,0xf5, + 0xae,0xfc,0x80,0xb,0x55,0x48,0x1d,0x16,0x13,0xcf,0x1f,0xdc,0x49,0x65,0x57,0x1b, + 0x75,0x86,0x6e,0x16,0xa7,0x67,0xf3,0x58,0x6e,0x21,0xa2,0x7f,0x95,0x9d,0x6d,0xdc, + 0xb5,0xed,0x53,0x6e,0xc8,0xc8,0xe1,0x3a,0xd7,0x30,0xb1,0xf2,0xbf,0xe4,0xef,0x9b, + 0x9,0x21,0x3c,0x6d,0xa9,0xab,0xe2,0x4f,0x7,0x76,0x70,0xc2,0xd0,0x89,0x56,0x51, + 0x78,0xad,0xe8,0x6a,0xe2,0x5d,0x6b,0x1d,0x7e,0x51,0x57,0xc9,0x53,0x25,0xdf,0x73, + 0xcf,0xa8,0x9,0xee,0x29,0x6f,0xe9,0xb,0x6,0x66,0x71,0xd8,0x79,0xa5,0x6c,0x2f, + 0x65,0x1d,0xad,0xd4,0x19,0x3a,0x19,0x1e,0x1a,0xc9,0x9f,0x26,0xce,0x94,0x82,0xf9, + 0x17,0xf7,0x4f,0x9f,0x22,0x3c,0x1b,0x9b,0xc3,0x81,0x8a,0x3a,0x60,0xb2,0xb4,0xaa, + 0xaa,0xd8,0x5c,0x7f,0x72,0x40,0x73,0x81,0x97,0xc1,0x57,0x55,0x15,0x87,0xaa,0xe2, + 0x40,0x45,0x41,0x71,0x26,0xc2,0x5f,0xe2,0xa5,0xf6,0xff,0x95,0x5c,0xcc,0xba,0x10, + 0x42,0xfc,0xcf,0xe2,0x70,0xf5,0x8f,0x2a,0x2a,0x1a,0x57,0xff,0x78,0xfa,0x7a,0x77, + 0xa8,0xaa,0xfb,0x4f,0xc1,0x48,0x5f,0xe0,0xe5,0xbd,0x6,0x67,0x79,0x2a,0xae,0xe9, + 0x2d,0xd,0xe7,0x3e,0x3a,0x25,0x24,0xc0,0x12,0x42,0x8,0x21,0x84,0xf8,0x5f,0x49, + 0x23,0x45,0x20,0x84,0x10,0x42,0x8,0x21,0x1,0x96,0x10,0x42,0x8,0x21,0x84,0x4, + 0x58,0x42,0x8,0x21,0x84,0x10,0x12,0x60,0x9,0x21,0x84,0x10,0x42,0x8,0x9,0xb0, + 0x84,0x10,0x42,0x8,0x21,0x24,0xc0,0x12,0x42,0x8,0x21,0x84,0x90,0x0,0x4b,0x8, + 0x21,0x84,0x10,0x42,0x48,0x80,0x25,0x84,0x10,0x42,0x8,0x21,0x1,0x96,0x10,0x42, + 0x8,0x21,0x84,0x4,0x58,0x42,0x8,0x21,0x84,0x10,0x42,0x2,0x2c,0x21,0x84,0x10, + 0x42,0x8,0x9,0xb0,0x84,0x10,0x42,0x8,0x21,0x24,0xc0,0x12,0x42,0x8,0x21,0x84, + 0x90,0x0,0x4b,0x8,0x21,0x84,0x10,0x42,0x48,0x80,0x25,0x84,0x10,0x42,0x8,0x21, + 0x1,0x96,0x10,0x42,0x8,0x21,0x84,0x4,0x58,0x42,0x8,0x21,0x84,0x10,0x42,0x2, + 0x2c,0x21,0x84,0x10,0x42,0x8,0x9,0xb0,0x84,0x10,0x42,0x8,0x21,0x24,0xc0,0x12, + 0x42,0x8,0x21,0x84,0x10,0x12,0x60,0x9,0x21,0x84,0x10,0x42,0x48,0x80,0x25,0x84, + 0x10,0x42,0x8,0x21,0x1,0x96,0x10,0x42,0x8,0x21,0x84,0x90,0x0,0x4b,0x8,0x21, + 0x84,0x10,0x42,0x2,0x2c,0x21,0x84,0x10,0x42,0x8,0x9,0xb0,0x84,0x10,0x42,0x8, + 0x21,0x24,0xc0,0x12,0x42,0x8,0x21,0x84,0x10,0x12,0x60,0x9,0x21,0x84,0x10,0x42, + 0x48,0x80,0x25,0x84,0x10,0x42,0x8,0x21,0x1,0x96,0x10,0x42,0x8,0x21,0x84,0x90, + 0x0,0x4b,0x8,0x21,0x84,0x10,0x42,0x2,0x2c,0x21,0x84,0x10,0x42,0x8,0x9,0xb0, + 0x84,0x10,0x42,0x8,0x21,0x84,0x4,0x58,0x42,0x8,0x21,0x84,0x10,0x12,0x60,0x9, + 0x21,0x84,0x10,0x42,0x48,0x80,0x25,0x84,0x10,0x42,0x8,0x21,0x24,0xc0,0x12,0x42, + 0x8,0x21,0x84,0xb8,0x18,0xfe,0x3f,0x4,0x44,0x23,0x27,0x57,0xa4,0xae,0x2e,0x0, + 0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/line.png + 0x0,0x0,0x0,0x7f, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x34,0x49,0x44,0x41,0x54,0x48,0xc7,0x63,0x60,0x18,0xe4, + 0xe0,0xff,0x90,0x31,0xf8,0x3f,0x16,0x4c,0x75,0xc3,0x69,0x12,0x4,0xff,0x7,0x7d, + 0x84,0x8d,0x1a,0x3a,0x6a,0xe8,0x60,0x36,0xf4,0x3f,0xad,0x5c,0x4a,0xb3,0x82,0x84, + 0x26,0xa5,0xd4,0xd0,0x2a,0xb0,0x87,0xe,0x0,0x0,0x92,0xdb,0x1e,0xe2,0x74,0x4c, + 0xbf,0xf2,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/gotocell.png + 0x0,0x0,0x3,0xb, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x9d,0x49,0x44,0x41,0x54,0x48,0xc7,0xbd, + 0xd5,0xdf,0x4b,0x93,0x51,0x0,0xc6,0xf1,0xb7,0x75,0x3c,0xd9,0xdb,0x6c,0xb5,0x5a, + 0xac,0x21,0x41,0x86,0x68,0x94,0xb5,0x51,0xd1,0x92,0x6e,0x42,0x9,0xaa,0x2d,0x64, + 0xe4,0x22,0x8,0x56,0x52,0x54,0x44,0x28,0xc3,0x46,0xf3,0xc2,0x8b,0x2e,0x92,0xd, + 0xba,0x31,0x72,0x86,0x65,0x18,0x21,0x91,0x50,0x66,0x49,0x9a,0xa6,0x2d,0x4d,0x5, + 0x21,0x21,0x92,0xea,0xca,0xb,0x2f,0xea,0xa2,0x8b,0xfe,0x83,0xa7,0xe7,0x7d,0x39, + 0xa6,0xc4,0x19,0x69,0x58,0x83,0xf,0x63,0xbf,0xbe,0xe7,0x3d,0xe7,0x3d,0xef,0x3b, + 0x3,0x80,0xf1,0x2f,0x18,0xff,0x2d,0xcc,0x47,0x84,0x6,0xac,0xe7,0xe5,0xe,0xf, + 0x88,0xab,0x2,0xc6,0x4e,0xc3,0x7a,0x91,0xa1,0xad,0xb4,0x62,0x39,0xc2,0x90,0xd7, + 0x25,0x2,0xed,0x1,0x88,0x5a,0xe,0xe0,0xb3,0x7,0x48,0xd1,0xca,0xa5,0xc,0xa0, + 0xf,0xa7,0x24,0x66,0x7e,0xcc,0xa0,0x61,0xac,0x1,0xde,0x76,0x2f,0x8c,0x1a,0x3b, + 0x3e,0x45,0x17,0xc8,0xf1,0xf7,0xe1,0x9b,0x12,0x93,0xdf,0x26,0xd1,0x3d,0xd3,0x8d, + 0xf4,0x87,0x34,0x82,0xfd,0x41,0x88,0x36,0x1e,0x7d,0xc8,0x1e,0xe0,0x3e,0xed,0xfb, + 0xd3,0x0,0xfa,0xf0,0x2d,0x69,0x47,0x9b,0xa7,0x9b,0x11,0x7f,0x1f,0x47,0x64,0x3c, + 0x2,0x7f,0xd6,0xf,0xd7,0x90,0xb,0x22,0xcd,0x1,0xca,0xec,0x1,0xd2,0xe4,0xc9, + 0xb5,0x3c,0xfa,0x70,0x46,0xce,0x47,0x27,0x22,0x8,0xbe,0xb,0xa2,0x68,0xa4,0x8, + 0x9e,0xac,0x7,0x66,0xd6,0x84,0xcc,0x4a,0x18,0x49,0x63,0x6e,0xfd,0x93,0xd6,0xfa, + 0x2f,0x2e,0x7c,0x57,0xfe,0x3a,0xd2,0x85,0x51,0xe7,0x6b,0x27,0xe4,0xb,0x9,0xf1, + 0x58,0x40,0xc,0xb,0xc8,0x51,0xe,0x70,0xd6,0x8e,0xf,0xd3,0xc9,0x85,0xcb,0xa3, + 0xf,0x77,0x48,0x7d,0xb4,0x57,0x45,0x5b,0x5,0x1c,0x37,0x1c,0xb6,0xfc,0x9,0xbe, + 0xf7,0x86,0xcb,0x53,0x61,0xf,0x70,0x94,0xf2,0xac,0xe5,0xd1,0x87,0x3b,0x25,0x82, + 0xa3,0x8c,0xbe,0xcd,0x11,0x6d,0x62,0xb4,0xde,0x1,0x79,0x5e,0xc0,0x5b,0xe7,0x45, + 0xec,0x63,0xc,0x55,0x2f,0xab,0x60,0x16,0x9a,0x50,0xfb,0x7e,0x95,0x3e,0xdc,0x25, + 0x51,0x94,0x55,0xd1,0xc1,0x5,0xd3,0x57,0x51,0x51,0x2f,0xb0,0xa1,0xce,0x8d,0x50, + 0x6f,0x8,0x8d,0xb3,0x8d,0x8,0x44,0x3,0xd6,0xf,0x47,0xe9,0x12,0x6d,0x21,0xa7, + 0x3e,0xdc,0x2d,0xe1,0x19,0x66,0x74,0x80,0xd1,0xe7,0x8c,0x3e,0x9a,0x8f,0xba,0xeb, + 0xdd,0xa8,0x7c,0x56,0x89,0xe4,0xd7,0x24,0xc2,0xa9,0xb0,0xf5,0x83,0xef,0xd4,0x45, + 0x27,0xe8,0x20,0x6d,0xa3,0xb5,0xfa,0x30,0xa7,0xed,0xec,0x63,0xb4,0x87,0xd1,0x4e, + 0x46,0x33,0x2,0xee,0xa6,0x75,0xf0,0xb7,0xf9,0x11,0x9f,0x8d,0x23,0xda,0x1a,0x85, + 0xab,0xd0,0x65,0x7d,0xb9,0x8f,0x2e,0x53,0x35,0x55,0x50,0x19,0x6d,0x26,0x53,0x1f, + 0xee,0x97,0x90,0x4f,0x19,0x7d,0x28,0x50,0xd0,0x52,0x80,0xd2,0xdb,0xa5,0xa8,0x99, + 0xaa,0x41,0xed,0x58,0x2d,0x8a,0x2b,0x8b,0xad,0x2f,0x8d,0xd0,0x35,0x3a,0x45,0x47, + 0x68,0x3f,0x15,0xd3,0x26,0x5a,0x43,0x42,0x1f,0x1e,0x92,0x30,0x1f,0x98,0x28,0xb9, + 0x57,0x82,0xea,0x6c,0x35,0x12,0x9f,0x12,0x28,0xbf,0x58,0x6e,0x7d,0xf8,0x99,0xee, + 0xd0,0x69,0x3a,0xae,0xa6,0xbe,0x9d,0x7c,0xf6,0xf4,0xd,0x43,0xce,0x6d,0x39,0x7d, + 0x78,0x5c,0x22,0xfc,0x2a,0x8c,0xc4,0x97,0x4,0x42,0x4d,0xa1,0xb9,0x69,0x3f,0xa1, + 0x33,0xea,0xb6,0x7a,0x88,0x76,0xab,0x13,0xb5,0x9e,0xf2,0x7f,0xbf,0x48,0xf4,0xe1, + 0x69,0x89,0x58,0x47,0xc,0xbe,0x80,0xcf,0x7a,0xa3,0x87,0xae,0x50,0x94,0xe,0xd3, + 0x5e,0x75,0x82,0x36,0xda,0x6b,0x69,0x4d,0x5b,0x73,0x59,0xeb,0xc2,0x2d,0xae,0xa8, + 0x7d,0x84,0x9d,0x74,0x4e,0x4d,0xd9,0xda,0xf8,0x7,0xa8,0x84,0xbc,0xf6,0x76,0x52, + 0x17,0xc2,0x92,0xfe,0x9a,0xf8,0x38,0xa6,0xce,0xee,0x2e,0xda,0x43,0x3b,0xa8,0x90, + 0x5c,0xf6,0xe6,0x5f,0xc4,0xad,0x33,0x57,0x38,0x4f,0x9d,0xc,0xaf,0xe2,0xa6,0xd5, + 0xba,0x9b,0x4d,0x2e,0x3f,0x1,0xa0,0x16,0xc7,0x6f,0x31,0x3c,0x62,0xee,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/rightarrow.png + 0x0,0x0,0x2,0x9b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x2d,0x49,0x44,0x41,0x54,0x48,0xc7,0xdd, + 0x94,0xbf,0x6b,0x53,0x51,0x14,0xc7,0x3f,0xdf,0xfb,0x5e,0xda,0x94,0xda,0xe8,0xa2, + 0xd4,0x82,0x28,0x16,0x14,0x41,0xc1,0x2e,0x82,0xa8,0x43,0xab,0x58,0x7,0xf1,0xe7, + 0xe0,0x22,0x88,0x7f,0x81,0xb8,0x88,0xe0,0xaa,0xa3,0xab,0x50,0x44,0x8b,0xe0,0x20, + 0xed,0x10,0x41,0x4b,0xa4,0xe8,0xa2,0x6e,0x52,0x8a,0x5d,0x1c,0x74,0x50,0x14,0x52, + 0x8d,0x25,0xa0,0x49,0x4d,0x6b,0x93,0xe3,0xf0,0x6e,0xd3,0x97,0xbe,0x24,0xd5,0xa1, + 0x8b,0x17,0xbe,0xdc,0xf7,0xe0,0xbc,0xcf,0x3d,0xe7,0x7b,0xcf,0x3b,0x32,0x33,0xd6, + 0x63,0x39,0xd6,0x69,0xfd,0xc7,0x60,0x49,0xc7,0x25,0x65,0x25,0xd,0x4b,0x72,0x92, + 0xd4,0xf6,0x3,0x33,0xfb,0x2b,0x1,0xd9,0x4b,0x57,0x76,0xd8,0x86,0x8d,0x18,0x70, + 0x12,0xe8,0x0,0xd4,0x2a,0xfe,0x5f,0xac,0x38,0x33,0x70,0x70,0xb,0x83,0x67,0x45, + 0xaa,0x83,0x27,0xc0,0x1,0x20,0xd5,0x2a,0x73,0xb7,0xaa,0xdc,0x3b,0x92,0xac,0x99, + 0x0,0x42,0x41,0xff,0x5e,0x38,0x7a,0x4e,0xa4,0xbb,0x78,0x5,0x5c,0x68,0x5,0x57, + 0xbc,0x8f,0x25,0xd9,0xc8,0xd8,0x30,0xf3,0x95,0x39,0x14,0x80,0x0,0x9,0x9c,0x3, + 0xb9,0x80,0xca,0x62,0x91,0xe2,0x8f,0xf7,0x38,0x89,0xf,0xef,0x8c,0xec,0x3d,0xe3, + 0x57,0x99,0xc3,0xc0,0x1b,0xe0,0xb7,0xc5,0x60,0xe1,0xea,0x93,0x2a,0x95,0x39,0xf2, + 0x85,0xa9,0x18,0x10,0x9c,0xa2,0x5d,0x82,0xc0,0x81,0x9c,0xd1,0xbf,0x1b,0x86,0x4e, + 0x8b,0xdc,0x23,0x7b,0x5d,0xab,0x71,0x11,0x18,0x97,0x54,0x87,0x27,0x3c,0x76,0x2e, + 0x2a,0x39,0x14,0x84,0xe,0x52,0x1e,0x56,0x7f,0x77,0x90,0x2,0xba,0x3a,0xe1,0xc8, + 0x31,0x71,0xf9,0xaa,0xc8,0x6c,0xe2,0x21,0x70,0x2a,0x6e,0x4b,0x2,0x1c,0x28,0x52, + 0xe8,0x61,0x41,0x7c,0x77,0x10,0xb0,0x72,0x40,0x28,0x63,0xcf,0x3e,0x38,0x71,0x5e, + 0x74,0xa6,0x19,0x7,0x36,0x13,0x85,0x24,0xad,0x8,0xfc,0x25,0x39,0x2f,0xc5,0xe4, + 0x7c,0x45,0xce,0xdb,0x22,0x7,0xe5,0x32,0xf4,0xf6,0x2,0x91,0xbb,0xdd,0x1e,0xb1, + 0x14,0x36,0xcb,0x38,0xf4,0xde,0x6,0x5a,0x1,0x2c,0x7b,0xee,0x62,0x9e,0x97,0x4a, + 0x30,0x37,0xb,0x2f,0x27,0x8d,0x85,0x5,0x1e,0x3,0xf3,0x44,0x77,0x9e,0xcc,0xd8, + 0x79,0x2b,0xea,0x19,0x7b,0xd0,0x32,0x14,0xff,0x5c,0x2a,0x41,0x21,0xf,0xcf,0x27, + 0x8c,0x99,0x69,0x72,0xc0,0x6d,0x60,0x11,0xa8,0x35,0xb7,0x42,0x46,0x28,0x6b,0x84, + 0x2a,0x99,0xe9,0xf7,0x3c,0xbc,0x98,0x80,0x99,0x69,0x9e,0x1,0xb7,0x80,0xcf,0x3e, + 0xe3,0x6a,0x53,0xf0,0xb7,0xaf,0x53,0x7c,0xfa,0xd8,0xd8,0x62,0xce,0x41,0x5f,0x1f, + 0x64,0x32,0x50,0xfe,0x9,0x85,0x59,0x98,0x9c,0x80,0xb7,0x11,0xf4,0x26,0xf0,0x5, + 0x28,0x2,0x15,0x33,0xab,0x26,0x66,0x5,0x30,0xe2,0xaf,0xa1,0xa9,0xee,0x8e,0x62, + 0xd7,0x6f,0x60,0xfb,0x7,0x30,0x20,0x7,0x1c,0x2,0xb6,0x3,0x3d,0x40,0xd8,0xc0, + 0x5a,0x5,0xe,0x7d,0xd0,0x56,0x60,0x27,0xb0,0x2b,0x26,0xbb,0xff,0xa0,0xe,0x7d, + 0xda,0xe,0xda,0xc,0x2c,0xf,0x4f,0xfb,0xd6,0xe9,0x89,0x69,0x74,0x70,0x8,0x3, + 0xc6,0x80,0x81,0x76,0xd0,0x4,0x78,0x8d,0xb1,0xd9,0xd,0x5c,0x3,0xb6,0xf9,0x1f, + 0xa1,0x25,0xd4,0xcc,0x1a,0x87,0xd0,0x1a,0x83,0xde,0xf9,0x6a,0x2,0xdf,0x52,0x55, + 0x33,0x5b,0x6a,0x15,0xff,0x7,0xeb,0xb2,0x41,0x22,0xd1,0xb9,0xdc,0x7,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/frontview.png + 0x0,0x0,0x1,0xa7, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x6e,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xd1,0x91,0xc3,0x20, + 0xc,0x44,0x17,0x4f,0x9a,0x39,0x15,0xe4,0x22,0xae,0xa,0x55,0x91,0x22,0xa8,0xc2, + 0x55,0xe0,0x6e,0xcc,0x7d,0x18,0xf9,0x30,0xd8,0x20,0xd9,0xb9,0x64,0xe6,0xf6,0x27, + 0xe,0x63,0xd8,0x87,0x40,0x8a,0xe2,0x62,0x8c,0x11,0x1f,0xd4,0x3,0x0,0xe6,0x79, + 0x36,0x4d,0x22,0xf2,0xbb,0xef,0x21,0x8c,0x97,0xcc,0x89,0x8,0x83,0x7d,0x92,0x57, + 0x8d,0xf5,0x34,0x4d,0x13,0x0,0xd8,0x0,0xc4,0x28,0xdf,0xb1,0x3c,0x5f,0x81,0x30, + 0x1,0x1c,0x99,0xbf,0x2,0x42,0x5,0xd0,0x32,0xbf,0xb,0xd1,0x5,0xd0,0x98,0xd7, + 0x10,0xdf,0x6a,0x80,0x87,0x76,0x51,0xad,0xd6,0xf7,0xf5,0x73,0xba,0x0,0x22,0xf2, + 0xb4,0x1f,0x60,0x19,0x67,0xb5,0x59,0x18,0xc3,0x35,0x0,0x31,0xcf,0x17,0xb0,0x1c, + 0x4d,0x5,0x9f,0xa9,0x7f,0x7,0x3c,0x1d,0x92,0x6b,0xd5,0x9b,0xdf,0x8c,0x80,0x90, + 0x97,0x9f,0x0,0xd4,0x47,0xd0,0x83,0xef,0x5f,0xc2,0xb4,0x40,0xb9,0x13,0xcd,0x11, + 0xb4,0x42,0x2f,0x32,0x97,0xe2,0x57,0xeb,0xff,0x2,0x2c,0xcb,0xf2,0x59,0x80,0x61, + 0xd0,0x2d,0xad,0x2e,0x44,0x91,0x1,0xf0,0xef,0xa5,0xda,0xba,0x18,0x62,0x38,0x3e, + 0x9f,0xd7,0xbb,0x88,0xea,0x42,0x14,0x42,0xca,0x86,0xec,0xc7,0x26,0x4a,0x2e,0x32, + 0x1f,0x66,0x83,0x64,0x4e,0xab,0x16,0x98,0xa,0x51,0x69,0x3e,0x87,0x3a,0x2d,0x5b, + 0xf3,0x8f,0x54,0x45,0xe0,0x28,0xbf,0xb7,0x30,0x72,0x32,0x67,0xac,0x61,0xf7,0xb4, + 0x1e,0x5,0x73,0x7a,0x8f,0x2b,0x83,0x5b,0x85,0xa8,0xb5,0xf3,0x6d,0x59,0x4e,0x61, + 0xce,0xde,0x29,0x8f,0xa3,0x55,0xb4,0xd4,0xfd,0x40,0x6e,0x7e,0x8,0x9b,0x47,0xcc, + 0xd0,0x94,0x34,0x1,0xb4,0xe6,0x77,0x20,0x4e,0x1,0xb4,0xe6,0xe5,0xb8,0x15,0xa2, + 0x7b,0x4,0x9a,0x9d,0x97,0xb2,0x40,0x34,0x1,0x22,0x18,0xe,0xc,0x22,0x6f,0x6e, + 0x36,0xb5,0xad,0xdc,0x69,0x16,0x88,0xb9,0x55,0x56,0xd0,0xa,0x20,0x84,0x11,0x5f, + 0x44,0xfb,0x54,0xfb,0x43,0x55,0x0,0x62,0x7e,0x55,0xd6,0x2e,0x7a,0x3,0x90,0xff, + 0x6a,0xd3,0xf3,0x9,0xa4,0xe7,0x77,0xc8,0xc5,0x18,0xa3,0x73,0xee,0x6d,0x86,0xa5, + 0x7e,0x0,0x6e,0x71,0xcb,0xd1,0x36,0x96,0x2f,0xf6,0x0,0x0,0x0,0x0,0x49,0x45, + 0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/topview.png + 0x0,0x0,0x1,0x90, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x57,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xeb,0x8d,0xc3,0x20, + 0x10,0x84,0x7,0x2b,0xd5,0x50,0x90,0x8b,0x70,0x15,0x5b,0xf,0x55,0x50,0x5,0xee, + 0xc6,0x7b,0x3f,0x2e,0x1b,0x61,0xcc,0x63,0x97,0x58,0x67,0xe9,0x46,0xb2,0x94,0x60, + 0x96,0xf9,0x20,0x30,0xb1,0x1d,0x33,0x33,0x1e,0xd4,0xb,0x0,0xf6,0x7d,0x37,0x15, + 0x79,0x1f,0x4e,0xdf,0x19,0x84,0x3d,0x25,0xb3,0xb9,0xf7,0x1e,0x8b,0xbd,0x28,0x8c, + 0x3b,0x29,0x14,0x63,0x4,0x0,0x1b,0x80,0x98,0xa7,0xb4,0x7e,0xda,0xe4,0xf3,0x2c, + 0x98,0x1a,0xa0,0x66,0xde,0xea,0x73,0x3b,0x80,0xc6,0x7c,0x76,0x25,0x86,0x0,0x1a, + 0xf3,0x2b,0xc4,0xa6,0x6,0x78,0x69,0x7,0x2d,0xc5,0x20,0x38,0x50,0xb5,0xdd,0x72, + 0x22,0x86,0x0,0x22,0x1f,0xfc,0xb9,0x81,0x0,0x26,0x82,0xb,0x4,0x7e,0xdf,0x67, + 0x2,0x1c,0x1,0x28,0xfb,0xbe,0x95,0xd6,0x2b,0x98,0xa,0x40,0xcc,0xf3,0x1,0xbc, + 0xf,0x70,0xf8,0x85,0x0,0x0,0x26,0x60,0x4f,0x9,0xb5,0xb9,0x5f,0xe0,0x33,0x8d, + 0xf7,0x40,0xf0,0x55,0x72,0x91,0x2c,0x77,0x6b,0xd9,0x47,0xf5,0x8e,0x99,0xb9,0x95, + 0x84,0x3d,0x72,0xad,0xc4,0xbc,0x4,0x89,0x31,0x62,0xdb,0x36,0xc5,0x26,0x6c,0xc, + 0xa0,0xca,0x5,0xc5,0x4,0xcc,0x51,0x7c,0xb7,0xfe,0x2f,0xc0,0x71,0x1c,0xcf,0x2, + 0x2c,0x8b,0x6e,0x68,0x75,0x10,0x1,0xc5,0xa6,0x22,0x69,0x23,0x7d,0xcd,0x2c,0x40, + 0x7e,0x2,0x5a,0x7f,0x36,0xb5,0xd3,0x20,0x75,0xbd,0x2c,0x30,0x5,0x51,0x6e,0x9e, + 0xd2,0x7a,0x32,0x6d,0x81,0x99,0x83,0x28,0x3f,0xdf,0x77,0x6,0x51,0x29,0x55,0x10, + 0xb5,0x66,0x5e,0x53,0xaf,0x4f,0x2f,0xb4,0xd4,0xcf,0x3,0x3d,0xf3,0xf2,0x9e,0xe5, + 0xa1,0xa4,0xb,0xa0,0x35,0xff,0x6,0xa2,0x9,0x60,0x35,0x9f,0x85,0x18,0xfe,0x4, + 0x16,0xf3,0x19,0x8,0xd5,0x1e,0x90,0x6b,0x16,0xa2,0x27,0x53,0x12,0x6a,0x64,0x5, + 0xbd,0x0,0xcc,0x2c,0xf9,0x37,0xba,0x7d,0x5,0xac,0x13,0xf8,0x0,0xc8,0xbb,0xda, + 0x5f,0xcb,0x31,0x33,0x3b,0xe7,0x1e,0x31,0x7,0x80,0x1f,0x7e,0x31,0xc9,0xb8,0xa5, + 0x1d,0x85,0xc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/bringtofront.png + 0x0,0x0,0x1,0x25, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0xda,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0x94,0x41,0xe, + 0x82,0x30,0x10,0x45,0x1f,0x46,0x38,0x83,0x77,0xf0,0xfe,0x87,0xf0,0x1a,0x5e,0x40, + 0xb1,0xa5,0x74,0xa6,0x1a,0x5c,0xb4,0x4,0x8c,0xa2,0x11,0xca,0xc2,0xc4,0x49,0xd8, + 0xd0,0xe4,0xe5,0xf5,0xf7,0x67,0x8a,0xb2,0x2c,0x3b,0x16,0x4c,0x8,0xa1,0x78,0xf5, + 0x7f,0xb,0xa0,0xaa,0xb3,0xa0,0x55,0x55,0x4d,0x9e,0x6d,0x58,0x69,0xfe,0xe0,0x1f, + 0x6,0x6f,0x33,0x30,0xba,0x55,0xc0,0xdd,0xed,0xa,0x37,0xf,0xa1,0x5,0x75,0x20, + 0x96,0x62,0xb7,0xcf,0x60,0x1c,0x5c,0x82,0x36,0xa0,0x16,0xc4,0x66,0x8a,0x42,0xed, + 0x0,0xf5,0x16,0xe4,0x92,0x9,0x2c,0x97,0x68,0x29,0x26,0x7e,0x9a,0xcb,0xd8,0xd7, + 0xe0,0xcd,0x8,0xdc,0x64,0x2,0xbb,0xf3,0x60,0xaa,0x39,0xc1,0xed,0x39,0x41,0xfb, + 0xac,0xcd,0x0,0x7e,0xb7,0xfe,0x3e,0x67,0x5c,0xc7,0x8c,0x43,0x93,0xe2,0x48,0x19, + 0x4f,0x2d,0xea,0x57,0x95,0xed,0x8e,0x87,0x21,0x4b,0x49,0x96,0xbe,0x8e,0xa6,0x92, + 0x1a,0x31,0xeb,0xf1,0xfc,0x29,0x56,0xaa,0xef,0x6b,0xb0,0x20,0xc9,0x54,0x47,0xf, + 0xf8,0x35,0xb8,0x4d,0xd7,0x56,0x3,0xe2,0x20,0x98,0xc7,0xaa,0xf5,0xb7,0x98,0x5, + 0xd6,0xde,0xd4,0x3e,0xf7,0x57,0x1a,0xb8,0x3a,0x0,0x8a,0xa5,0xcb,0x66,0x6a,0xee, + 0x91,0x61,0xa9,0x66,0xc0,0xf,0xb5,0x5d,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/panview.png + 0x0,0x0,0x1,0x3e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x5,0x49,0x44,0x41,0x54,0x58,0x85,0xed,0x97,0xc1,0x11,0x83,0x20, + 0x10,0x45,0x3f,0x99,0x34,0x23,0x5d,0xa4,0x89,0x14,0xb1,0x5,0xd1,0x4e,0xa8,0x2, + 0xca,0xd9,0x1c,0x32,0x1a,0x9c,0x0,0xba,0xbb,0x62,0x2e,0xfe,0x8b,0x7,0x7,0xfe, + 0x13,0xfe,0xb2,0xe2,0x98,0x99,0xf1,0x47,0xdd,0x1,0x20,0xe7,0xac,0x1a,0xec,0x3d, + 0x21,0xa5,0xa0,0x36,0xf7,0xde,0xe3,0xa6,0x1f,0x4c,0xab,0xa7,0x54,0x31,0x46,0x0, + 0xd0,0x1,0x94,0x5f,0x9e,0x52,0x50,0x43,0xa8,0x0,0x6a,0xcb,0x6e,0x81,0x10,0x1, + 0xf4,0xf6,0x5c,0xb,0x21,0x2,0xd8,0xa,0x9c,0x26,0x90,0xea,0x10,0x1e,0xa5,0xb, + 0xa0,0x9,0xb0,0x27,0x50,0xcc,0xaf,0x31,0x0,0xd6,0x13,0xae,0x36,0xdf,0x6e,0x80, + 0xa3,0xcd,0x81,0x7e,0x89,0xae,0x0,0x46,0x98,0x6f,0x41,0x2c,0x0,0x23,0xcd,0x7b, + 0x10,0x8e,0x99,0xd9,0xb9,0x47,0x73,0x90,0x35,0x68,0xad,0xb9,0x43,0x78,0x82,0x88, + 0x3e,0x0,0x39,0x67,0xd5,0xa,0x4c,0xd3,0x24,0x6e,0xe5,0xb3,0x4f,0x8c,0x11,0x44, + 0xf4,0xdd,0x2,0x6b,0x57,0x93,0x98,0x97,0x5a,0x85,0x70,0x24,0x44,0x6b,0x85,0x7f, + 0xca,0x50,0x2,0xd1,0xcb,0xce,0x1e,0xf3,0x2a,0x80,0x14,0x62,0x8f,0x7a,0xd9,0x6a, + 0x1e,0xc5,0xa3,0x4b,0x72,0x13,0xe0,0x2c,0x5d,0x0,0xe2,0x7f,0x42,0xcb,0x7b,0x33, + 0x40,0xaf,0x3a,0xb4,0xbd,0x44,0xbc,0x5,0x35,0x8,0x4b,0x23,0x53,0x65,0xa0,0x84, + 0xb0,0x76,0x51,0x75,0x8,0xcb,0x9b,0x91,0x45,0x4b,0x37,0x9c,0xef,0x6a,0x67,0x6a, + 0x69,0xc7,0xce,0xb9,0xd3,0xcd,0x67,0xbd,0x1,0xea,0x17,0x9a,0x79,0x14,0x14,0x12, + 0xbe,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/rotate.png + 0x0,0x0,0x1,0xb2, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x79,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xed,0x8d,0xc3,0x20, + 0xc,0x86,0x5f,0xa2,0x2e,0x13,0xeb,0xe6,0xc9,0x10,0x37,0x5,0xf3,0x30,0x45,0x87, + 0x38,0x39,0xdb,0x94,0xfb,0x91,0xc2,0x39,0x9,0x1f,0x36,0x4d,0xaf,0x96,0x22,0x91, + 0xf0,0xf1,0x3e,0x18,0x3,0x8e,0x8b,0x31,0x46,0x7c,0xd0,0x6e,0x0,0xb0,0xae,0xab, + 0xa9,0x13,0x51,0xd8,0xbd,0x33,0x2f,0x43,0xe2,0x44,0x84,0xc9,0xde,0x29,0xa8,0xbe, + 0xf5,0xec,0x7e,0xbf,0x3,0x80,0xd,0x20,0x9,0xc9,0x19,0xa7,0xf2,0x8,0x84,0x9, + 0xa0,0x24,0x7e,0x5,0x84,0xa,0xa0,0x25,0xfe,0x2a,0x44,0x17,0x40,0x23,0x7e,0x86, + 0xf8,0x56,0x3,0xdc,0xb4,0x83,0x6a,0x6d,0x6b,0xaf,0xef,0xd3,0xf4,0xc0,0x4c,0x64, + 0x12,0x1f,0xb1,0xae,0x7,0x4a,0x46,0x81,0x0,0x9f,0xca,0x5b,0x81,0x17,0x7e,0x3f, + 0x0,0x5,0xca,0x62,0xc7,0xd8,0x90,0x75,0x6f,0x1,0xa0,0x40,0xcd,0xc1,0x53,0x5d, + 0xaf,0xdd,0xd1,0x74,0xdb,0xd0,0x30,0x28,0x2f,0x9c,0xbd,0x71,0x9,0x80,0x75,0x46, + 0x9,0x42,0x1b,0xc0,0xe6,0xbb,0x40,0x63,0x33,0x11,0x9c,0xd7,0xed,0xa2,0x6e,0xc, + 0x44,0xf,0xc0,0xef,0x7,0x5a,0xb9,0xee,0x91,0x99,0x8,0x2b,0x33,0x7e,0x1e,0xf, + 0x38,0x7c,0x21,0x3e,0xdf,0x87,0x0,0x9c,0xb7,0x45,0xf5,0x2c,0xc4,0xa6,0x69,0xca, + 0xb0,0x73,0x3,0x62,0x68,0x9,0xe4,0x79,0x9f,0xca,0x2d,0x91,0x4,0x71,0x9,0x40, + 0x2d,0x1f,0x68,0xb9,0xb9,0x5,0x31,0x94,0xf,0x0,0xdb,0x1,0x24,0xef,0x9,0xcd, + 0x2d,0x58,0x82,0x3c,0x1,0x10,0x85,0xbf,0x53,0x4e,0xec,0xe9,0xa3,0x78,0xa9,0xbc, + 0x5b,0x1a,0xe5,0xf6,0x35,0xe5,0x3,0x47,0xc1,0x1e,0x84,0xfc,0x56,0xf3,0x50,0x1f, + 0xc0,0xfb,0xed,0xa9,0x88,0x17,0x21,0xc,0x87,0x57,0x13,0x20,0x53,0xb,0x88,0x96, + 0x31,0x2f,0xb9,0xad,0x36,0x33,0xaa,0x2,0x9c,0x2,0xee,0x19,0xf,0xb5,0x73,0x3e, + 0xd5,0xc9,0x99,0x6b,0x20,0x4c,0x19,0x91,0xbc,0xf1,0x4e,0xed,0x84,0x30,0xf3,0x92, + 0xc5,0x7b,0x10,0x5d,0x80,0x52,0x0,0x6a,0xd6,0x57,0x42,0xbc,0x4,0x60,0x35,0x6b, + 0x56,0x7c,0x2,0x18,0xfd,0xcd,0x1a,0xb5,0xcb,0x3d,0x60,0x9d,0x40,0x6,0x48,0xff, + 0x6a,0xff,0x6d,0x2e,0xc6,0x18,0x9d,0x73,0x1f,0x11,0x7,0x80,0x5f,0x7c,0x8e,0xd0, + 0xbd,0x3f,0xb0,0x8c,0xa7,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/mccad/Desktop/images/bottomview.png + 0x0,0x0,0x1,0x91, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x58,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xfd,0x8d,0x83,0x30, + 0xc,0xc5,0x5f,0x50,0x97,0x39,0xf,0xc4,0x10,0x37,0x45,0xa6,0xe8,0x10,0x99,0x82, + 0x29,0x92,0x6d,0x70,0xff,0xe0,0x8c,0x2,0xe4,0xc3,0xe,0x48,0x95,0xee,0x49,0x55, + 0x4b,0x5a,0xfb,0xfd,0x12,0x27,0x2e,0x38,0x66,0x66,0x7c,0x51,0x2f,0x0,0x48,0x29, + 0x99,0x82,0x88,0xc2,0xe1,0x3a,0xc6,0x79,0xc8,0x9c,0x88,0x30,0xd9,0x83,0x82,0x6a, + 0xac,0xa7,0x65,0x59,0x0,0xc0,0x6,0x20,0x46,0xf9,0x8c,0xe5,0xf3,0x8,0x84,0x9, + 0xa0,0x64,0xfe,0x4,0x84,0xa,0xa0,0x65,0x7e,0x17,0xa2,0xb,0xa0,0x31,0xbf,0x42, + 0xfc,0xaa,0x1,0x5e,0xda,0xa4,0x5a,0x6d,0xbf,0xd7,0xc7,0x74,0x1,0x44,0x14,0xe8, + 0x38,0xe0,0x65,0xdc,0xab,0xcd,0xe2,0x1c,0xc7,0x0,0xc4,0x3c,0x4f,0x60,0x29,0xcd, + 0x5,0x3e,0x53,0x7f,0xf,0x4,0x2a,0x92,0x6b,0xd5,0x8b,0x6f,0xae,0x80,0x90,0x9f, + 0xdf,0x1,0xa8,0x4b,0xd0,0x83,0xef,0x6f,0xc2,0xbf,0x4,0xe7,0x99,0x68,0x4a,0xd0, + 0x5a,0x7a,0x91,0xb9,0x15,0x3f,0xad,0xff,0xb,0xb0,0xae,0xeb,0x77,0x1,0xa6,0x49, + 0x97,0x5a,0xdd,0x88,0x80,0xb1,0x53,0xd0,0xdb,0x88,0xea,0x46,0xb4,0x9f,0x86,0xca, + 0x9f,0x4d,0xe9,0x34,0x48,0x5c,0xab,0x17,0x98,0x1a,0x51,0x6e,0x1e,0xe3,0x7c,0x30, + 0xad,0x81,0x99,0x1b,0x51,0xe9,0x7c,0xef,0xcb,0xe8,0xf3,0xc4,0xdb,0x5,0x3,0x70, + 0xfe,0x38,0x96,0xeb,0x56,0x23,0xaa,0xcd,0x5c,0xf4,0x43,0x1b,0x18,0x7b,0xc0,0x65, + 0x74,0xe7,0x72,0xb4,0x9a,0x96,0xfa,0x7e,0xa0,0x64,0x9e,0xe2,0x6,0x98,0x62,0x4, + 0x67,0x0,0x96,0x9b,0x92,0x26,0x80,0xc6,0x5c,0x34,0xa,0x51,0x5,0xb0,0x98,0xdf, + 0x81,0xe8,0x96,0xe0,0x5c,0xb7,0x9a,0x79,0xfe,0xbd,0xe6,0x74,0xa8,0x1,0x88,0xc2, + 0xfe,0xb2,0x48,0x7b,0x2b,0x67,0xea,0x84,0x1a,0x59,0x41,0x2f,0x0,0xa3,0x8f,0x59, + 0xa3,0x7a,0x7c,0x5,0xac,0x13,0xd8,0x1,0xe4,0x59,0xcd,0xaa,0xe5,0xfd,0x6,0x6, + 0x63,0x1,0xc0,0x31,0x33,0x3b,0xe7,0x86,0x13,0xdc,0xd5,0x7,0x6b,0x1c,0xc0,0xfc, + 0x74,0x7,0x1b,0xfe,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + + // /home/mccad/Desktop/images/decompose.png + 0x0,0x0,0x4,0x28, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xd6,0x0,0xd6,0x0,0xd6,0x19,0x42, + 0xf,0xe5,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x1c,0x9,0x1c,0x33,0x8b,0x80,0x7d,0xc1,0x0,0x0,0x3,0xb5,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0xdf,0x2b,0xbb,0x51,0x1c,0xc7,0xdf,0xcf,0xcc,0x33, + 0x4c,0xe2,0x59,0xa2,0xb5,0x1b,0x33,0x6b,0x9b,0x1f,0x37,0x94,0x9a,0x89,0x22,0x19, + 0x9a,0xb,0x25,0x2e,0xd4,0xf2,0x7,0x90,0x92,0x5a,0xa,0xa1,0x2c,0x97,0xae,0xb5, + 0x72,0x83,0x8b,0x15,0x8a,0xb,0x51,0x9b,0x94,0xb,0x72,0xe1,0xe6,0xc1,0x94,0x2b, + 0x66,0x7e,0xc,0x13,0xb6,0x87,0x6c,0xdf,0x8b,0x6f,0xdf,0x8b,0x6f,0x3b,0x8f,0x7d, + 0xe7,0x3b,0x3c,0xc7,0xb9,0x7c,0x7f,0xce,0x39,0xcf,0xf3,0x7a,0xce,0xe7,0x9c,0xe7, + 0x73,0x3e,0xe7,0x30,0x3c,0xcf,0xc7,0xf0,0x3,0x8a,0xec,0x27,0x40,0x78,0xbd,0x5e, + 0xc8,0x13,0x55,0x32,0x99,0x4c,0xc9,0x7d,0x19,0x99,0xc,0x2c,0xcb,0x82,0x65,0x59, + 0x64,0x65,0x65,0x81,0xe3,0x38,0xa8,0x54,0x2a,0xa8,0xd5,0x6a,0x14,0x15,0x15,0x41, + 0xa7,0xd3,0xa1,0xac,0xac,0xc,0x39,0x39,0x39,0x29,0x85,0x91,0xa7,0xfa,0xeb,0x44, + 0xa3,0x51,0x44,0x22,0x11,0x44,0x22,0x11,0x3c,0x3c,0x3c,0x20,0x10,0x8,0xc4,0xd5, + 0x61,0x18,0x6,0x25,0x25,0x25,0xb0,0x58,0x2c,0xb0,0x5a,0xad,0x28,0x2d,0x2d,0xfd, + 0xef,0xe7,0x32,0x89,0xe6,0x48,0xb2,0x23,0xf2,0x91,0xa2,0xd5,0x6a,0x61,0xb7,0xdb, + 0x61,0xb3,0xd9,0xc0,0xb2,0xec,0x87,0x5c,0x4b,0x12,0x73,0xe4,0xf4,0xf4,0x14,0x23, + 0x23,0x23,0x68,0x69,0x69,0xc1,0xe6,0xe6,0xe6,0xd7,0xb9,0x56,0x61,0x61,0x21,0xaa, + 0xab,0xab,0xdf,0x75,0x2f,0x41,0x10,0xf0,0xfc,0xfc,0x8c,0x60,0x30,0x88,0xcb,0xcb, + 0x4b,0xdc,0xde,0xde,0x26,0xec,0xd7,0xef,0xf7,0xa3,0xaf,0xaf,0xf,0xad,0xad,0xad, + 0x18,0x1f,0x1f,0x47,0x66,0x66,0xe6,0xe7,0x82,0x98,0x4c,0x26,0x4c,0x4d,0x4d,0x25, + 0xd5,0xe6,0xee,0xee,0xe,0x87,0x87,0x87,0xd8,0xdb,0xdb,0x83,0xd7,0xeb,0xc5,0xf1, + 0xf1,0xb1,0x68,0xdd,0xb5,0xb5,0x35,0x9c,0x9c,0x9c,0xc0,0xe5,0x72,0x81,0xe3,0x38, + 0x69,0x2d,0xbf,0x79,0x79,0x79,0x30,0x9b,0xcd,0xe8,0xef,0xef,0xc7,0xd2,0xd2,0x12, + 0x96,0x97,0x97,0x61,0xb3,0xd9,0x20,0x93,0x91,0x5f,0xc1,0xe7,0xf3,0xa1,0xb7,0xb7, + 0x17,0xa1,0x50,0x48,0xda,0xff,0x11,0xbd,0x5e,0xf,0xa7,0xd3,0x9,0xb7,0xdb,0xd, + 0xa3,0xd1,0x28,0xa,0xe3,0x70,0x38,0x10,0x8b,0xc5,0xa4,0xb,0xf2,0xa7,0x18,0xc, + 0x6,0xcc,0xcf,0xcf,0xc3,0x6a,0xb5,0x8a,0xae,0x48,0x8b,0x8b,0x8b,0x74,0xfc,0xd9, + 0x15,0xa,0x5,0xa6,0xa7,0xa7,0xd1,0xd0,0xd0,0x40,0xb4,0xcf,0xcc,0xcc,0x24,0x74, + 0x31,0xc9,0x84,0x28,0x69,0x69,0x69,0x70,0x3a,0x9d,0xd0,0x68,0x34,0x71,0xb6,0x50, + 0x28,0x84,0xb9,0xb9,0x39,0x7a,0x62,0x2d,0xa5,0x52,0x89,0xd1,0xd1,0x51,0xa2,0xcd, + 0xed,0x76,0xe3,0xf5,0xf5,0x95,0x9e,0xa0,0xb1,0xa6,0xa6,0x6,0x95,0x95,0x95,0x71, + 0xfa,0xcd,0xcd,0xd,0xb6,0xb7,0xb7,0xe9,0x8a,0x7e,0xbb,0xba,0xba,0x88,0xba,0xc7, + 0xe3,0xa1,0xb,0xa4,0xb1,0xb1,0x11,0xa,0x85,0x22,0x4e,0xdf,0xd9,0xd9,0xa1,0xb, + 0x44,0xa1,0x50,0xa0,0xaa,0xaa,0x2a,0x4e,0xbf,0xb8,0xb8,0x10,0xd,0x75,0x24,0xbb, + 0xb1,0xaa,0xa8,0xa8,0x20,0xea,0x3c,0xcf,0xd3,0x5,0x62,0x30,0x18,0x88,0xfa,0xd9, + 0xd9,0x19,0x5d,0x20,0x6a,0xb5,0x9a,0xa8,0x5f,0x5d,0x5d,0xd1,0x5,0x92,0x9f,0x9f, + 0x4f,0xd4,0x83,0xc1,0x20,0x5d,0x20,0x4a,0xa5,0x92,0xa8,0xb,0x82,0x40,0x17,0x48, + 0x46,0x46,0x6,0x51,0x8f,0x44,0x22,0x74,0x81,0x44,0xa3,0x51,0x72,0x92,0x81,0x61, + 0xe8,0x2,0x79,0x79,0x79,0x11,0xfd,0xc7,0x50,0x5,0xf2,0xf8,0xf8,0x98,0x94,0xcb, + 0x49,0x16,0x44,0x6c,0x99,0x55,0xa9,0x54,0x74,0x81,0x9c,0x9f,0x9f,0x8b,0x66,0x70, + 0xa8,0x2,0x11,0xcb,0xb2,0x90,0x36,0x5e,0x92,0x6,0x39,0x38,0x38,0x20,0xea,0x62, + 0x89,0xa,0x49,0x82,0x84,0xc3,0x61,0xec,0xef,0xef,0x13,0x47,0x23,0x37,0x37,0x97, + 0x1e,0x90,0x8d,0x8d,0xd,0xe2,0xb6,0xd6,0x62,0xb1,0xd0,0xb5,0x1f,0x59,0x58,0x58, + 0x20,0xea,0xf5,0xf5,0xf5,0xf4,0x80,0x6c,0x6d,0x6d,0x11,0xe7,0x47,0x41,0x41,0x1, + 0xcc,0x66,0x33,0x1d,0x20,0x4f,0x4f,0x4f,0x98,0x98,0x98,0x20,0xda,0x3a,0x3b,0x3b, + 0x21,0x97,0xcb,0xa5,0xf,0xf2,0xf6,0xf6,0x86,0xa1,0xa1,0x21,0xf8,0xfd,0xfe,0x38, + 0x1b,0xc7,0x71,0xe8,0xe9,0xe9,0x79,0xb7,0xbd,0x24,0x40,0x4,0x41,0xc0,0xe0,0xe0, + 0xa0,0x68,0x96,0x64,0x60,0x60,0x0,0xd9,0xd9,0xd9,0xd2,0x6,0xe1,0x79,0x1e,0xdd, + 0xdd,0xdd,0x58,0x5f,0x5f,0x27,0xda,0x9b,0x9a,0x9a,0xd0,0xd1,0xd1,0x91,0xb0,0x1f, + 0xf9,0x77,0x1,0xf8,0x7c,0x3e,0xb8,0x5c,0x2e,0xac,0xae,0xae,0x8a,0x86,0xec,0x46, + 0xa3,0x11,0x93,0x93,0x93,0xff,0xd4,0xdf,0x97,0x81,0xdc,0xdf,0xdf,0xe3,0xe8,0xe8, + 0x8,0xbb,0xbb,0xbb,0xf0,0x78,0x3c,0xef,0x1e,0xf4,0x0,0xbf,0xf,0x93,0x66,0x67, + 0x67,0x13,0xba,0xd4,0x7f,0x81,0xf0,0x3c,0xf,0x87,0xc3,0x21,0x6a,0x8f,0xc5,0x62, + 0x10,0x4,0x1,0xe1,0x70,0x18,0xd7,0xd7,0xd7,0xff,0x7c,0xf4,0xf6,0xa7,0xb4,0xb7, + 0xb7,0x63,0x6c,0x6c,0x4c,0x74,0xef,0x91,0x32,0x90,0x40,0x20,0x80,0x95,0x95,0x95, + 0x94,0x8f,0x9a,0x46,0xa3,0xc1,0xf0,0xf0,0x30,0xea,0xea,0xea,0x92,0x6e,0x2b,0x97, + 0xc2,0xaa,0xa5,0xd3,0xe9,0x60,0xb7,0xdb,0xd1,0xd6,0xd6,0xf6,0xa1,0xe3,0xe9,0x6f, + 0x3,0x61,0x18,0x6,0x7a,0xbd,0x1e,0xb5,0xb5,0xb5,0x68,0x6e,0x6e,0x4e,0xc9,0x59, + 0xbe,0xfc,0x33,0x5e,0x32,0x3d,0x3d,0x1d,0x2c,0xcb,0x42,0xa9,0x54,0xfe,0x75,0x85, + 0x43,0xab,0xd5,0xa2,0xb8,0xb8,0x18,0xe5,0xe5,0xe5,0x5f,0x7f,0x85,0x43,0x2c,0xd7, + 0x2a,0xb5,0xf2,0x23,0x6e,0x7,0xfd,0x35,0x22,0x5e,0xaf,0x97,0x6a,0x90,0x1f,0x33, + 0x22,0xbf,0x0,0xcb,0xfd,0x3d,0xba,0x1b,0xa5,0x61,0xe6,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/openNew.png + 0x0,0x0,0x5,0x53, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x5,0x8,0x9,0x2f,0x7,0xbc,0x44,0x5,0x3c,0x0,0x0,0x4,0xe0,0x49,0x44, + 0x41,0x54,0x38,0xcb,0x95,0x95,0x5b,0x6c,0x14,0x55,0x1c,0xc6,0x7f,0x67,0x76,0xbb, + 0xbb,0x6d,0xb7,0xb7,0x5d,0xba,0xdb,0x2b,0x16,0xba,0x2b,0xdb,0x96,0xba,0x40,0xad, + 0x85,0x5a,0x2a,0x48,0x0,0x51,0x4,0x43,0x48,0x94,0xf8,0x80,0xc1,0x18,0xc3,0x8b, + 0x36,0xe1,0x9,0x9,0x89,0x3e,0xa8,0x3c,0xf1,0x66,0xaa,0x31,0x12,0x6a,0x51,0x34, + 0x80,0x1,0x4,0x49,0xb9,0x47,0x45,0xc,0x50,0x6c,0x4b,0xd3,0x42,0x5b,0x28,0x2d, + 0xbd,0x6d,0xb7,0xf4,0x46,0x28,0xdb,0xdd,0x39,0x73,0x7c,0x60,0xba,0xa9,0xd,0x2f, + 0x4e,0xf2,0xe5,0xe4,0x64,0x66,0x7e,0xdf,0xff,0xfc,0x67,0xce,0x77,0x84,0x52,0x8a, + 0xd9,0x97,0x10,0x42,0x3,0x2c,0x73,0x24,0xcc,0xdb,0x72,0x96,0xc,0x53,0xa,0x40, + 0xcd,0x5,0x29,0xa5,0xe2,0x32,0x1,0x61,0xe0,0x5b,0x20,0x1f,0x18,0x30,0x5f,0xbc, + 0x4,0x4,0x80,0xec,0x88,0xa,0xaa,0x88,0xa,0x2a,0x20,0x19,0x48,0x4,0xec,0xe6, + 0xdc,0x6a,0x16,0xa1,0xcd,0x14,0x22,0x4c,0x69,0xc0,0xed,0xfa,0xfa,0x7a,0xb5,0x6b, + 0xd7,0x2e,0x15,0x28,0xe,0x18,0x75,0x87,0xea,0x54,0x6b,0x6b,0xab,0xaa,0x5e,0x5f, + 0x15,0x5,0x1e,0x2,0x9f,0xcd,0x2,0x7b,0x1,0x37,0x90,0x61,0xce,0x9d,0xa6,0x91, + 0xd,0xb0,0xa,0xd3,0x69,0xc6,0x25,0x72,0xe2,0xf8,0x71,0x72,0x72,0x73,0x89,0x46, + 0xa3,0xd4,0xd6,0xd6,0x92,0x9e,0x9e,0x4e,0x62,0x72,0x22,0xb,0x2,0x5,0x34,0x9c, + 0x6b,0xe0,0xe7,0x1f,0x7a,0x70,0x88,0xe6,0x5f,0x22,0x2a,0xb8,0xc5,0x21,0x9a,0xff, + 0x2,0x1c,0x11,0x15,0x5c,0xe6,0x10,0xcd,0xd9,0x40,0x6c,0x46,0x1a,0x90,0x0,0xac, + 0x0,0x32,0x0,0xc2,0xa1,0x10,0xa3,0xe1,0x30,0x9a,0x10,0xd4,0xd4,0xd4,0x50,0x55, + 0x55,0x85,0x86,0xc6,0xc5,0xd3,0x97,0x78,0x63,0xcd,0x46,0x0,0xb2,0xf3,0xb3,0xb7, + 0x0,0xd4,0x1d,0xa9,0xab,0xac,0xd9,0xf3,0xf1,0x32,0xb3,0xab,0xc7,0x80,0xea,0x99, + 0xca,0x2d,0xc0,0x37,0xc0,0x7e,0xe0,0x2d,0xc0,0xbd,0xa8,0xa0,0x80,0xfe,0x7b,0xf7, + 0x50,0x52,0x62,0xb5,0xd9,0xf0,0x78,0xbd,0x2c,0x2e,0x2d,0xa5,0xa8,0xb8,0x88,0x8b, + 0x17,0x2e,0xb2,0x61,0x63,0x1f,0x4a,0xbc,0x8f,0x62,0x7,0x1b,0xd6,0x7d,0x4a,0xa6, + 0x7b,0x37,0x59,0x59,0xa7,0x68,0x6a,0x7b,0x31,0xbf,0xa3,0xad,0x73,0x2b,0x30,0x5, + 0xb4,0x5a,0x80,0x13,0x27,0xaf,0x1e,0xd7,0xa,0x8b,0xa,0xdd,0x9d,0xed,0x5d,0x44, + 0x23,0xd1,0xe9,0x6b,0x97,0x2f,0x5b,0x26,0x46,0x46,0xc4,0xf4,0xd4,0x14,0x0,0x9, + 0x76,0x3b,0xa9,0xa9,0xa9,0x94,0x97,0x97,0xe3,0xc9,0x39,0x49,0xfd,0x77,0x76,0xae, + 0x37,0xde,0x60,0xf3,0xe6,0x61,0x7a,0x86,0xd7,0x91,0xe7,0x3d,0x83,0xcf,0xbf,0x8f, + 0xe5,0xdb,0x2a,0xb4,0x5f,0xf,0x9e,0x5a,0x1,0x1c,0xb0,0x2,0x11,0x47,0x62,0xa2, + 0xe3,0x9d,0xed,0x6f,0x93,0xe1,0xce,0xa0,0xe1,0xe4,0x59,0xbb,0x1a,0x73,0x19,0x4f, + 0x94,0x12,0x47,0xf,0x1f,0x26,0x10,0x8,0x50,0x5a,0x56,0x46,0x61,0x71,0x31,0x59, + 0x79,0x79,0x0,0xec,0xfc,0x70,0x27,0x9d,0x5d,0x9d,0xec,0xf9,0x24,0x8b,0xcf,0xbf, + 0xf8,0x8,0x80,0xd0,0xd4,0x10,0xcb,0xaa,0x97,0x62,0x7e,0xbc,0x24,0xb,0x70,0x26, + 0x29,0x35,0xe9,0x83,0x8a,0xaa,0x97,0x84,0x2f,0xe0,0x63,0xe5,0x9a,0x95,0x64,0xe7, + 0x79,0x45,0xe8,0xd1,0x28,0x22,0x25,0x99,0x91,0xc1,0x30,0x4d,0xd7,0xae,0x31,0x19, + 0xe,0x13,0x9d,0x9e,0x66,0x78,0x60,0x13,0x9,0x36,0x1b,0x5e,0xaf,0x97,0x17,0x16, + 0x7,0xe9,0xba,0xb3,0x9a,0xdd,0x7b,0xef,0xd1,0x71,0xb7,0x83,0x25,0xd5,0x41,0xe, + 0x7c,0x79,0x10,0xa0,0xde,0x2,0x24,0x34,0x5e,0x69,0xc,0xfa,0x4a,0x7c,0xb,0x17, + 0x14,0x16,0x20,0x84,0x46,0x5e,0x41,0x3e,0xcb,0xab,0x2a,0x48,0xcf,0x48,0xe3,0xc1, + 0xf0,0x30,0xb9,0xbe,0x5,0x3c,0x1c,0x1d,0xe5,0xef,0x8b,0x97,0x19,0xd,0x85,0x90, + 0xb1,0x18,0x9a,0x10,0x24,0xd8,0x6c,0x24,0x39,0x9d,0x54,0x57,0x56,0xd3,0x37,0xde, + 0x4b,0xae,0x3f,0x87,0x43,0xfb,0x7f,0x4,0x38,0x64,0x1,0xec,0xc0,0xb4,0x54,0xc6, + 0xeb,0xab,0xd7,0xaf,0xb2,0xa0,0x14,0x86,0x94,0x18,0xd2,0x20,0x33,0xcb,0x43,0xe5, + 0x2b,0x2b,0x10,0x76,0x8d,0xf0,0xc4,0x18,0x31,0x9b,0x95,0x50,0xdf,0x20,0x4d,0x37, + 0x6e,0xf0,0x78,0x74,0x14,0xa1,0x69,0xa4,0xb9,0x5c,0xd8,0x1d,0xe,0x5a,0x6e,0xb7, + 0x30,0x6f,0xbe,0x9b,0xa3,0x5f,0x1f,0x8b,0x83,0x6d,0xc0,0xc0,0xc0,0x83,0x81,0x4d, + 0xbe,0x92,0x42,0x77,0x7e,0xc1,0x7c,0xa4,0x34,0x90,0x52,0x62,0x18,0x12,0x29,0x25, + 0x99,0x1e,0xf,0x4b,0xcb,0x97,0x90,0xbf,0x70,0x3e,0x3d,0x3,0x3,0x78,0x9f,0xcb, + 0x65,0x38,0x34,0x42,0x4b,0xe3,0x4d,0xfc,0x7e,0x3f,0xae,0xcc,0x4c,0x3a,0xee,0x76, + 0x90,0x38,0x2f,0x91,0x53,0xdf,0x9f,0x8e,0x83,0xad,0x80,0xa6,0xc7,0xf4,0x96,0x98, + 0x1e,0xdb,0xb6,0xfa,0xb5,0xd5,0x42,0xea,0x3a,0x52,0x1a,0xe8,0x52,0x22,0x75,0xe3, + 0xa9,0x81,0x6e,0xe0,0x4c,0x49,0xa6,0x6c,0x79,0x19,0x9,0xe,0x1b,0x43,0x63,0xa3, + 0x3c,0x96,0x31,0x22,0x8f,0x1e,0xe1,0xf7,0x2f,0xa2,0x7f,0x68,0x10,0xe9,0xd0,0x39, + 0x7f,0xf4,0x42,0xbc,0xc7,0x33,0x5b,0x7a,0xbc,0xbb,0xe3,0xfe,0xba,0xe2,0xa5,0x45, + 0x9e,0xec,0xdc,0x1c,0xa4,0xd4,0x91,0xba,0x8c,0x8f,0x4f,0xab,0x37,0x90,0xd2,0x20, + 0xc3,0x95,0x4e,0x49,0xb0,0x4,0xdf,0xa2,0x42,0x6,0xc3,0x23,0xd8,0xd,0xd,0xa9, + 0x14,0x93,0x72,0x82,0x3f,0x7f,0xbb,0x12,0x7,0x6b,0xb3,0xe0,0xa7,0xdb,0x9a,0xda, + 0x36,0xf4,0x74,0xf7,0xa4,0x65,0xe5,0x78,0x85,0x33,0xc5,0x89,0x94,0x12,0x69,0x18, + 0xf1,0xd1,0xd0,0x9f,0xb6,0xc7,0xd0,0x25,0x56,0x9b,0x95,0x9e,0xbe,0x5e,0x1e,0xf6, + 0x85,0xf1,0x66,0xe5,0xd2,0x3f,0xd6,0x4f,0xe3,0xe5,0xc6,0x38,0x98,0xd9,0xb1,0x38, + 0x39,0x3e,0x79,0xe4,0xce,0xad,0x3b,0xcd,0x7f,0x5c,0xf8,0xbd,0x72,0x7c,0x72,0x22, + 0xc9,0x6a,0xb1,0x8,0xb7,0xdb,0x85,0x94,0x6,0x86,0xae,0xa3,0xc7,0x2b,0x97,0x48, + 0x5d,0x62,0x73,0xd8,0xe8,0x1f,0xea,0xc7,0xeb,0xca,0xe6,0x6e,0x7f,0x17,0x6d,0xd7, + 0xdb,0xfe,0x3,0xc6,0x8c,0x47,0x65,0x66,0xec,0xe0,0x93,0xa9,0xc8,0x4f,0x6d,0xff, + 0xb4,0x19,0x2d,0x37,0x6f,0x79,0x7a,0x7b,0x7a,0xd3,0xdd,0xf3,0xdc,0x38,0x53,0x9c, + 0x48,0xdd,0x40,0x4a,0x1d,0x5d,0xd7,0x91,0x86,0xc4,0x9e,0x60,0xa3,0xa9,0xe9,0x16, + 0xbe,0xf9,0x3e,0x5a,0xda,0x9b,0xe9,0x6e,0xbf,0xf,0x50,0x2f,0x94,0x52,0x8,0x21, + 0x84,0x99,0xa5,0x56,0xf3,0x2f,0x71,0x98,0x11,0x98,0x64,0x6a,0x55,0x5a,0x7a,0xda, + 0xde,0x97,0xd7,0x56,0xa6,0x96,0x96,0x95,0xa,0x9f,0xbf,0x10,0x5d,0x7f,0x5a,0xb1, + 0xae,0xeb,0x4c,0x3d,0x7e,0xcc,0xd8,0xf0,0x38,0x67,0x1b,0x1a,0x68,0xbe,0x7a,0xb, + 0x60,0x9d,0x98,0x9,0xfe,0x59,0x70,0x8b,0x99,0x78,0xb6,0x67,0x98,0x6c,0x77,0x79, + 0x5c,0x5b,0x9f,0x2f,0xf1,0x67,0x57,0xaf,0xad,0x26,0x37,0x2f,0x7,0x29,0x25,0xb1, + 0x98,0xce,0xf9,0x33,0xe7,0x68,0x6f,0x6a,0xa7,0xaf,0x7b,0x0,0xe0,0x55,0x31,0xfb, + 0x44,0x31,0xe1,0x73,0xd,0x12,0xcc,0x4d,0x34,0x63,0x90,0x8,0xbc,0x97,0xe4,0x4c, + 0x7a,0x77,0x49,0x45,0x30,0xbd,0xa8,0x34,0x20,0xfc,0x8b,0xfc,0x84,0x42,0x21,0xbe, + 0xda,0x57,0x4b,0x34,0x12,0x5,0x58,0x29,0xe6,0x1e,0x55,0xb3,0xc,0x34,0x53,0x56, + 0x53,0x73,0xd,0x9c,0xc0,0x9b,0xc0,0xe,0xc0,0x63,0x3e,0x3,0x30,0x1,0xac,0x79, + 0x26,0xf8,0x7f,0x18,0xcc,0xc8,0x66,0xae,0xd0,0x0,0xa2,0xc0,0xd4,0xbf,0xce,0x54, + 0x3a,0x62,0x8e,0xb3,0x36,0x54,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42, + 0x60,0x82, + // /home/mccad/Desktop/images/dzoom.png + 0x0,0x0,0x1,0xa8, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x6f,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xdb,0x75,0xc3,0x20, + 0xc,0x86,0x45,0x4f,0x67,0xc8,0xe,0xd6,0x12,0xb5,0x97,0xc8,0x10,0x99,0x82,0x29, + 0x32,0x44,0x97,0x30,0x5d,0x2,0xef,0x90,0x25,0x94,0x7,0x22,0x9b,0x8b,0x31,0x37, + 0xbb,0xe8,0x25,0x39,0x40,0xac,0xcf,0xbf,0x6e,0x44,0x10,0x11,0x41,0x47,0xfb,0x6, + 0x0,0x58,0x96,0xa5,0x8b,0x73,0x44,0x84,0xaf,0x96,0x7,0xc,0xc3,0x50,0xfd,0x5b, + 0xa5,0x14,0x0,0x7c,0x14,0xb8,0xc2,0xf0,0x17,0xd7,0xef,0xfa,0xae,0xa3,0xe7,0x9a, + 0x14,0x38,0xc3,0x92,0xa,0x20,0x3e,0x82,0x35,0xad,0x9f,0xd7,0x3,0x6c,0x8e,0x65, + 0x74,0x8f,0x68,0x76,0xd7,0x2d,0xd9,0x63,0xeb,0x7e,0x38,0x2,0x0,0xdf,0x31,0xd1, + 0x4f,0xf0,0x40,0x21,0xe4,0xe7,0xf3,0xf,0x0,0x64,0x93,0x22,0xe,0x80,0x71,0x1e, + 0x77,0xcc,0xc6,0x7b,0xc,0x80,0xf8,0xa8,0x86,0xf0,0x14,0x48,0x3b,0xf7,0x41,0xc, + 0x84,0x31,0x5b,0xde,0xe2,0x2a,0xd8,0xe2,0x9a,0xe7,0xdc,0x86,0x60,0x15,0x6a,0xac, + 0x7b,0x19,0x5a,0x0,0xb2,0xf8,0xed,0xd9,0x5a,0x54,0xb8,0xac,0x13,0x1e,0xc5,0xdd, + 0xb6,0xee,0x21,0x38,0x5d,0x81,0x9c,0x1,0x65,0x4f,0xdf,0xd3,0x1,0x4a,0x47,0xbb, + 0x93,0x84,0x76,0x4d,0x97,0x58,0x4b,0x47,0xec,0x9e,0x3,0x2b,0x0,0xd3,0x97,0xaa, + 0xc0,0x6f,0xaf,0xd4,0x9c,0x3c,0x7b,0x8,0x60,0x4c,0x16,0x41,0xd8,0xe7,0xc6,0x71, + 0x82,0xd7,0xab,0xfc,0x86,0xe4,0x24,0xa1,0xd6,0xcf,0xb5,0x99,0xf0,0xc4,0xdb,0x9f, + 0x86,0xec,0x58,0x3a,0xeb,0xe3,0x38,0x81,0x52,0x33,0xdc,0x6e,0xf9,0x89,0x18,0x54, + 0x1,0x87,0xc2,0x7,0x71,0x8d,0xd7,0x58,0xf6,0xa9,0x1a,0x22,0x5a,0x86,0x3e,0xc8, + 0xde,0xde,0x30,0x98,0xb2,0x43,0x9c,0xab,0x21,0x92,0x7d,0x20,0xa7,0xb4,0xb4,0xae, + 0x87,0x8,0x6f,0x44,0x91,0x6b,0x95,0xe3,0x70,0xa7,0xcf,0xd7,0x42,0x9c,0xda,0x7, + 0xb4,0x5e,0x60,0xcb,0x8b,0xd,0xe2,0xa8,0x3a,0x4e,0x6f,0x44,0xa5,0x10,0x61,0x15, + 0x64,0x8e,0xd1,0x14,0x44,0x6e,0x38,0x9a,0x86,0xd1,0xd1,0xe0,0x31,0x4a,0xf8,0x9, + 0x1c,0x9e,0x5f,0x1,0xf8,0xbf,0xda,0x7f,0x9b,0x20,0x22,0x12,0x42,0x74,0x71,0xe, + 0x0,0xf0,0x6,0x38,0x1b,0xb2,0x58,0x24,0xcf,0x84,0x99,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/convert.png + 0x0,0x0,0x5,0x28, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xd6,0x0,0xd6,0x0,0xd6,0x19,0x42, + 0xf,0xe5,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x1c,0x9,0x1d,0x1c,0x39,0x4a,0x71,0xd9,0x0,0x0,0x4,0xb5,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0x49,0x48,0x72,0x5d,0x18,0xc7,0xff,0xb7,0x3e,0xb, + 0x6d,0x22,0x1a,0x24,0x42,0xa5,0x81,0x2c,0x68,0x30,0x2a,0x72,0x51,0xb8,0x4c,0x88, + 0xc4,0x45,0x2d,0x8d,0x90,0xa0,0x61,0x11,0x51,0x54,0xbb,0x16,0x16,0x46,0xe5,0xa6, + 0x68,0xd3,0xb0,0xa8,0x68,0x11,0x64,0x34,0x10,0x52,0x21,0x16,0xad,0x2a,0x83,0x86, + 0x85,0xd2,0x22,0xc2,0xc,0x29,0xcd,0x28,0xa5,0xb2,0xd2,0x7c,0x77,0x1f,0xef,0xfb, + 0xdd,0x1b,0x39,0x5c,0x79,0xbd,0xdf,0xb3,0xfc,0x9f,0x41,0x7f,0x67,0x78,0xce,0x73, + 0xce,0x73,0x9,0x93,0xc9,0xe4,0xc7,0xff,0xc0,0xfe,0xa1,0xbb,0xc3,0xf7,0xf7,0x77, + 0x98,0xcd,0x66,0x58,0x2c,0x16,0xd8,0x6c,0x36,0x3c,0x3f,0x3f,0xc3,0xe3,0xf1,0xc0, + 0xe7,0xf3,0x21,0x2e,0x2e,0xe,0x49,0x49,0x49,0xc8,0xc8,0xc8,0x0,0x9f,0xcf,0x47, + 0x41,0x41,0x1,0xb8,0x5c,0x6e,0xd8,0xbf,0xb9,0xbf,0xbf,0x4f,0xf,0x88,0xd5,0x6a, + 0xc5,0xce,0xce,0xe,0xf4,0x7a,0x3d,0x4c,0x26,0x13,0xbc,0x5e,0x6f,0xc0,0x6d,0xb3, + 0xb2,0xb2,0x20,0x16,0x8b,0x51,0x5f,0x5f,0xf,0xb1,0x58,0x8c,0x98,0x98,0x98,0x90, + 0xfe,0x3,0x11,0xce,0xd2,0x3a,0x3f,0x3f,0xc7,0xcc,0xcc,0xc,0xf6,0xf6,0xf6,0x68, + 0x99,0x4d,0x2e,0x97,0xb,0x99,0x4c,0x6,0x85,0x42,0x81,0xf4,0xf4,0xf4,0xa0,0x66, + 0x24,0x24,0x10,0xa7,0xd3,0x89,0xf1,0xf1,0x71,0x6c,0x6e,0x6e,0x46,0x64,0xbd,0x73, + 0x38,0x1c,0x28,0x95,0x4a,0xb4,0xb4,0xb4,0x80,0xc3,0xe1,0x44,0x6,0xe4,0xe4,0xe4, + 0x4,0x3d,0x3d,0x3d,0x78,0x78,0x78,0x88,0xf8,0x6,0x4e,0x4f,0x4f,0xc7,0xc1,0xc1, + 0x1,0xfd,0x7b,0x44,0xa7,0xd3,0x61,0x60,0x60,0x0,0x3e,0x9f,0xef,0xdb,0x3a,0xd9, + 0xd9,0xd9,0x90,0x48,0x24,0x10,0x89,0x44,0xc8,0xc9,0xc9,0x41,0x56,0x56,0x16,0x38, + 0x1c,0xe,0x58,0x2c,0x16,0x5e,0x5f,0x5f,0xf1,0xf4,0xf4,0x84,0x9b,0x9b,0x1b,0x98, + 0xcd,0x66,0x18,0x8d,0x46,0x1c,0x1e,0x1e,0xe2,0xf3,0xf3,0x93,0xb2,0xaf,0x60,0x6, + 0x2b,0xe0,0x19,0xd1,0xe9,0x74,0xe8,0xef,0xef,0xc7,0xd7,0xd7,0x17,0x65,0xb9,0x44, + 0x22,0x41,0x6b,0x6b,0x2b,0x2a,0x2a,0x2a,0x82,0x1a,0x75,0xb7,0xdb,0x8d,0xed,0xed, + 0x6d,0xcc,0xcf,0xcf,0xe3,0xfa,0xfa,0x9a,0x54,0x6e,0x32,0x99,0xe8,0x5b,0x5a,0xe7, + 0xe7,0xe7,0x68,0x6e,0x6e,0xa6,0x1c,0x39,0x2e,0x97,0x8b,0xa1,0xa1,0x21,0xd4,0xd4, + 0xd4,0x84,0xb5,0x8c,0xfc,0x7e,0x3f,0xb6,0xb6,0xb6,0xa0,0xd1,0x68,0xe0,0x70,0x38, + 0x82,0x6,0x89,0x9,0x64,0xc4,0xba,0xbb,0xbb,0x29,0x21,0x8a,0x8b,0x8b,0xb1,0xb2, + 0xb2,0x12,0x36,0x4,0x0,0x10,0x4,0x81,0x86,0x86,0x6,0xe8,0x74,0x3a,0xc8,0xe5, + 0xf2,0xa0,0xdb,0xff,0x8,0x32,0x36,0x36,0x86,0xfb,0xfb,0x7b,0x92,0x2e,0x14,0xa, + 0x31,0x37,0x37,0x17,0x94,0x9b,0xc,0xc4,0x12,0x12,0x12,0xa0,0x56,0xab,0xa1,0x56, + 0xab,0xc1,0x62,0xb1,0xe8,0x39,0xd9,0x2f,0x2f,0x2f,0xb1,0xba,0xba,0x4a,0xd2,0x13, + 0x13,0x13,0x31,0x39,0x39,0x89,0xe4,0xe4,0xe4,0x88,0x79,0x2c,0xb9,0x5c,0x8e,0xec, + 0xec,0x6c,0x7a,0x66,0x64,0x6a,0x6a,0x8a,0x52,0xef,0xed,0xed,0x5,0x8f,0xc7,0x8b, + 0xb8,0xfb,0xad,0xaa,0xaa,0xa,0x1f,0xc4,0x66,0xb3,0xc1,0x60,0x30,0x90,0xf4,0xbc, + 0xbc,0x3c,0x34,0x35,0x35,0x45,0x5d,0xd0,0xf8,0x2d,0xc8,0xda,0xda,0x1a,0xfc,0x7e, + 0xb2,0x43,0x53,0x2a,0x95,0x21,0xc7,0x43,0x7f,0x5,0x44,0xaf,0xd7,0x93,0x34,0x36, + 0x9b,0xd,0xa9,0x54,0x1a,0x95,0x61,0x3c,0x25,0x88,0xdd,0x6e,0xc7,0xe5,0xe5,0x25, + 0x49,0xaf,0xad,0xad,0x5,0x9b,0xcd,0x66,0xe,0xc8,0xe9,0xe9,0x29,0x65,0xe5,0xea, + 0xea,0xea,0xa8,0xbd,0x58,0x51,0x82,0x98,0xcd,0x66,0xca,0xca,0x22,0x91,0x88,0x59, + 0x20,0x57,0x57,0x57,0x94,0x27,0x6f,0x6e,0x6e,0x2e,0xb3,0x40,0xee,0xee,0xee,0x48, + 0x5a,0x46,0x46,0x6,0xe2,0xe3,0xe3,0x99,0x5,0x62,0xb7,0xdb,0x49,0x5a,0x5a,0x5a, + 0x5a,0x54,0x3f,0x3e,0x50,0x82,0xbc,0xbc,0xbc,0x90,0xb4,0x94,0x94,0x14,0xe6,0x81, + 0x7c,0x7c,0x7c,0x90,0xb4,0xb8,0xb8,0x38,0xe6,0x81,0x50,0xdd,0x0,0xa3,0xf1,0x34, + 0xff,0x11,0x84,0x6a,0x53,0x53,0xcd,0x12,0x23,0x41,0xde,0xde,0xde,0x98,0x7,0x42, + 0xe5,0xa1,0x9c,0x4e,0x27,0xf3,0x40,0xa8,0x9e,0x31,0xed,0x76,0x3b,0x65,0x34,0x1c, + 0xd5,0x20,0x7c,0x3e,0x9f,0xa4,0x79,0x3c,0x1e,0xd8,0x6c,0x36,0x66,0x81,0x14,0x16, + 0x16,0x22,0x98,0x18,0x2c,0x6a,0x41,0x4a,0x4a,0x4a,0x28,0x2b,0x1f,0x1f,0x1f,0x33, + 0xb,0xa4,0xa8,0xa8,0x8,0xa9,0xa9,0xa9,0x24,0x7d,0x7f,0x7f,0x9f,0x59,0x20,0x4, + 0x41,0xa0,0xb6,0xb6,0x96,0xa4,0xdf,0xde,0xde,0xe2,0xec,0xec,0x8c,0x39,0x20,0x0, + 0xbe,0x7d,0x24,0x5b,0x58,0x58,0x60,0x16,0x48,0x75,0x75,0x35,0x4,0x2,0x1,0x49, + 0xdf,0xdd,0xdd,0xd,0xe8,0x19,0x33,0x6a,0x40,0x8,0x82,0x40,0x5b,0x5b,0x1b,0x49, + 0xf7,0xfb,0xfd,0x50,0xa9,0x54,0x41,0x65,0xa5,0x42,0xb5,0xd7,0xd7,0xd7,0xf0,0x41, + 0x0,0xa0,0xa1,0xa1,0x1,0xf9,0xf9,0xf9,0x24,0xfd,0xe2,0xe2,0x2,0x1a,0x8d,0x26, + 0xa2,0x10,0xe,0x87,0x3,0xa,0x85,0x82,0x1e,0x90,0xd8,0xd8,0x58,0xc,0xf,0xf, + 0x53,0x46,0xbe,0x8b,0x8b,0x8b,0x98,0x9e,0x9e,0x8e,0x8,0xc4,0xd1,0xd1,0x11,0x1a, + 0x1b,0x1b,0x83,0x3a,0xb7,0x7e,0x8c,0xcd,0x4b,0x4b,0x4b,0xd1,0xd9,0xd9,0x49,0x59, + 0x36,0x31,0x31,0x81,0xc1,0xc1,0x41,0xbc,0xbf,0xbf,0xd3,0x2,0xe0,0x76,0xbb,0xa1, + 0x56,0xab,0xa1,0x54,0x2a,0xff,0x48,0x2d,0xd0,0x2,0x2,0x0,0x1d,0x1d,0x1d,0xa8, + 0xab,0xab,0xa3,0x2c,0xd3,0x6a,0xb5,0x90,0xc9,0x64,0xd0,0xeb,0xf5,0x21,0xc7,0x62, + 0x6e,0xb7,0x1b,0xb3,0xb3,0xb3,0x90,0x4a,0xa5,0x58,0x5a,0x5a,0xa,0xa9,0x9f,0x80, + 0x52,0x6f,0x4,0x41,0x60,0x74,0x74,0x14,0x9f,0x9f,0x9f,0x94,0xef,0xc1,0x56,0xab, + 0x15,0x5d,0x5d,0x5d,0x10,0x8,0x4,0x90,0xc9,0x64,0x90,0x48,0x24,0x10,0xa,0x85, + 0x88,0x8d,0x8d,0xfd,0xb6,0x4f,0xa7,0xd3,0x9,0xa3,0xd1,0x8,0xbd,0x5e,0xf,0x83, + 0xc1,0x0,0x8f,0xc7,0x13,0xd6,0x6c,0x6,0x95,0xc,0xf5,0x7a,0xbd,0x50,0xa9,0x54, + 0xd0,0x6a,0xb5,0x3f,0xd6,0x65,0xb3,0xd9,0xe0,0xf1,0x78,0x94,0x39,0x44,0x8b,0xc5, + 0x12,0xf0,0xd2,0xa1,0x35,0xf5,0xf6,0x5f,0xdb,0xd8,0xd8,0xc0,0xc8,0xc8,0x8,0x5c, + 0x2e,0x57,0xc4,0xbc,0x56,0x51,0x51,0x11,0xfa,0xfa,0xfa,0x20,0x16,0x8b,0x23,0x7, + 0x2,0x0,0x8f,0x8f,0x8f,0x98,0x98,0x98,0xc0,0xfa,0xfa,0xfa,0xb7,0x59,0xd9,0x50, + 0x4c,0x20,0x10,0xa0,0xbd,0xbd,0x1d,0x32,0x99,0xc,0x4,0x41,0x4,0xd4,0x26,0x2c, + 0x90,0xdf,0xfd,0xfd,0xf2,0xf2,0x32,0x74,0x3a,0x1d,0x2c,0x16,0x4b,0x48,0x7d,0x70, + 0x38,0x1c,0x48,0xa5,0x52,0xc8,0xe5,0x72,0x54,0x56,0x56,0x6,0xdd,0x9e,0x16,0x90, + 0xdf,0xed,0xea,0xea,0xa,0xa7,0xa7,0xa7,0xb8,0xb8,0xb8,0xf8,0xf7,0xa3,0x1a,0x97, + 0xcb,0x5,0x8f,0xc7,0x3,0xaf,0xd7,0x8b,0xf8,0xf8,0x78,0x24,0x25,0x25,0x21,0x33, + 0x33,0x13,0x7c,0x3e,0x1f,0x42,0xa1,0x10,0xe5,0xe5,0xe5,0x28,0x2b,0x2b,0xb,0xeb, + 0xb9,0x89,0x76,0x90,0xbf,0x65,0x7f,0x7c,0xf9,0x10,0xcd,0x77,0xd,0xda,0xe,0x44, + 0x26,0xd8,0x2f,0xf,0x92,0xfa,0x6,0x74,0x14,0x61,0xa9,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/print.png + 0x0,0x0,0x3,0xc, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x37,0x28,0xa7,0xbd,0x12,0xa1,0x0,0x0,0x2,0x99,0x49,0x44, + 0x41,0x54,0x78,0xda,0x8d,0x95,0x2f,0x5b,0xe3,0x40,0x10,0xc6,0x7f,0xbd,0xa7,0x62, + 0xd6,0x25,0xae,0x95,0x91,0xc5,0xb5,0xb2,0x12,0x5c,0x71,0xd4,0x81,0x2c,0xe,0xbe, + 0x1,0xfd,0x8,0x27,0x4f,0x82,0x4,0xd7,0x73,0xc5,0x81,0xc,0xae,0x38,0x2a,0x57, + 0xa6,0x2e,0x71,0x3b,0x6e,0x4f,0x6c,0x36,0xa4,0x7f,0xf2,0x1c,0x63,0x36,0x99,0x9d, + 0xbc,0xf3,0xce,0xbc,0x93,0xdd,0x1e,0x1d,0xb6,0x5e,0xaf,0xbd,0x88,0x90,0xa6,0xe9, + 0x9e,0x5f,0x55,0x1,0x70,0xce,0x1,0x50,0x55,0x15,0x49,0x92,0x70,0x71,0x71,0xd1, + 0x6b,0xc7,0xf5,0xbb,0x80,0x45,0x84,0xc9,0x64,0xd2,0x0,0x1d,0xee,0x45,0x2b,0xcb, + 0x12,0x6b,0xed,0x51,0x4c,0x27,0x30,0xc0,0x76,0xbb,0x3d,0x2,0x3b,0x4c,0xe4,0x9c, + 0xc3,0x18,0xf3,0x73,0xe0,0x53,0x0,0xaa,0x7a,0x94,0xe0,0x54,0x45,0x0,0xbf,0x4e, + 0x39,0xf3,0x3c,0xf7,0xaa,0xda,0x30,0x31,0xc6,0x60,0x8c,0xd9,0xeb,0x77,0xec,0xbf, + 0x88,0x1c,0xf5,0xb7,0x93,0xb1,0x73,0x8e,0x24,0x49,0x28,0xcb,0x12,0x11,0x69,0x84, + 0x6a,0xdb,0xa9,0xf2,0xff,0xcb,0x38,0x96,0x78,0x38,0x11,0x6d,0xd0,0x98,0xac,0xab, + 0x15,0xfd,0xae,0xf,0xdb,0x23,0x75,0xaa,0xa2,0xb8,0xb6,0x27,0xa4,0x6d,0xbd,0x53, + 0xce,0xd5,0x6a,0xe5,0xb3,0x2c,0x63,0x38,0x1c,0x76,0x82,0x47,0x21,0x3f,0x3e,0x3e, + 0xea,0x9e,0x27,0xcc,0xe7,0x97,0xbd,0x93,0x8c,0xdf,0xde,0xde,0xbc,0xb5,0x96,0xfc, + 0x3d,0x47,0x66,0x82,0x88,0x34,0x0,0x87,0x6b,0x64,0x5a,0x16,0x25,0x79,0x9e,0xb3, + 0xab,0x76,0xdc,0xdd,0xdd,0xf9,0xd9,0x6c,0xc6,0xe5,0xe5,0x65,0xaf,0xd7,0x6,0xdd, + 0x6e,0x2d,0x55,0xb1,0xc3,0x29,0x80,0xeb,0x14,0xc6,0x48,0x8a,0x20,0x60,0xc0,0x16, + 0x96,0xcd,0xe6,0x93,0xdd,0xae,0xc0,0x39,0xe5,0xec,0x2c,0x63,0xb1,0x58,0x84,0x56, + 0x44,0xa6,0xe7,0xd3,0x73,0x4c,0x9a,0xe2,0x9c,0x82,0x3a,0xf4,0xb8,0x7e,0x40,0xc8, + 0xf9,0xe0,0x9d,0x35,0x53,0x9d,0x92,0x7e,0xa5,0x3c,0xbd,0x3c,0x61,0xbf,0xc2,0xdf, + 0xe7,0xd4,0x91,0x8d,0xce,0x2,0xe8,0xe3,0xe3,0xb3,0x2f,0x8b,0xd2,0xff,0xc4,0xbe, + 0xfc,0x97,0x1f,0xf9,0x91,0x17,0x2f,0x7e,0xe4,0x47,0x7e,0xb3,0xd9,0xf8,0xdf,0xf, + 0x7f,0xfc,0x78,0x3c,0xf6,0x83,0x41,0xe6,0x93,0x24,0xf1,0xd9,0x20,0xf3,0xfd,0x6a, + 0x57,0x71,0x73,0x73,0xd5,0xa9,0xee,0xa1,0xa5,0xa4,0x9c,0x33,0x25,0x47,0x98,0x31, + 0x63,0x3c,0x1e,0x93,0xc8,0x90,0x52,0xb,0x9e,0x9e,0x5f,0xa8,0xaa,0x8a,0x74,0x90, + 0xd2,0x57,0xc0,0xda,0x22,0xcc,0xa3,0x2a,0x88,0x10,0x72,0x48,0xad,0x36,0x18,0x4c, + 0xe8,0xb8,0x3a,0x10,0xc3,0x9d,0x3e,0x70,0x85,0x65,0xa8,0x43,0x3e,0xd9,0x82,0x2a, + 0xe9,0x70,0x18,0xf6,0x6b,0x75,0xfa,0x65,0x51,0x60,0x45,0x42,0x3f,0x55,0x69,0x74, + 0x33,0x10,0x54,0xac,0x2b,0x31,0xa,0x4e,0x80,0xe0,0x13,0xc0,0xea,0xe,0x25,0x9c, + 0x21,0x76,0xbb,0x6d,0x34,0x31,0x71,0xdc,0xa2,0x43,0x23,0x20,0xda,0xc,0x85,0x43, + 0x43,0xe,0xb7,0x17,0xd9,0x4c,0x8e,0x44,0x4d,0xdb,0x3f,0x10,0x8e,0x3e,0x2,0x5a, + 0xb6,0x3e,0x70,0x35,0xd9,0x76,0xa0,0x2,0xe2,0x40,0xf,0x77,0xc,0xaa,0x25,0x75, + 0x9d,0xb1,0x36,0x26,0x93,0x29,0xbf,0xd0,0x16,0xcb,0x86,0xac,0xb,0xaf,0x5a,0xaf, + 0x7b,0xa0,0x26,0x86,0xd5,0xa0,0x35,0x60,0xdd,0xce,0xc1,0x60,0xc0,0x62,0x71,0x13, + 0x18,0x5b,0x6b,0xa3,0x54,0x20,0xa,0x95,0x0,0x55,0x50,0x4e,0x35,0xc0,0x48,0x64, + 0xa5,0xdf,0x60,0x7c,0xf7,0x1c,0x55,0x44,0x60,0xb9,0x5c,0x32,0x9f,0xcf,0x7b,0xfd, + 0x2c,0xcb,0x78,0x7f,0x7d,0xe7,0xef,0xeb,0x2b,0xce,0x29,0xe1,0xfc,0x11,0x64,0xff, + 0x2e,0xfa,0x7e,0x17,0xd9,0x2b,0x3b,0x8a,0x8e,0x8,0xcb,0xe5,0x92,0xfb,0xfb,0xfb, + 0xde,0xde,0x21,0xb4,0x5a,0xad,0xfc,0x6a,0xf5,0xca,0xae,0xbe,0xbf,0x1c,0xae,0x16, + 0x45,0x8f,0x6e,0x15,0x55,0x70,0xae,0xc,0xcf,0x95,0x32,0x99,0x4e,0xb8,0xbe,0xbe, + 0xe6,0xf6,0xf6,0xb6,0xc1,0xfb,0x7,0xd1,0xf6,0x9e,0xc,0x80,0x78,0x91,0x90,0x0, + 0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/sendtoback.png + 0x0,0x0,0x1,0x42, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0xf7,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0x94,0x5d,0x6e, + 0x83,0x30,0x10,0x6,0xc7,0x15,0x70,0x86,0xde,0xa1,0xf7,0x3f,0x57,0x94,0xd8,0x26, + 0xf6,0x6e,0x88,0xfb,0x80,0xcd,0x4f,0x2,0x55,0x70,0xd4,0x87,0x4a,0x5d,0x89,0x17, + 0x1b,0x46,0xf3,0x69,0x97,0x35,0x6d,0xdb,0x26,0xde,0x28,0x55,0x35,0x5b,0xe7,0xd, + 0x80,0x88,0x54,0x41,0xbb,0xae,0xdb,0xbd,0xfb,0xe0,0x97,0xea,0x1f,0xfc,0x87,0xc1, + 0xcd,0xab,0x2f,0x1a,0x63,0xf6,0xae,0xd2,0x5b,0x60,0x80,0x94,0x36,0x18,0xf7,0x1, + 0x86,0x0,0x7a,0x5,0xe9,0x21,0x3a,0xcc,0xe7,0xd7,0x31,0xf0,0x33,0x54,0x41,0xb, + 0xd4,0x83,0x38,0x88,0xee,0xb8,0xf1,0xaa,0x6,0x19,0x81,0xda,0xcf,0xd0,0xe0,0x20, + 0x5e,0x2a,0xc1,0xe9,0xe,0x43,0x9c,0xa3,0xab,0x1f,0x2d,0xa3,0x1d,0x1f,0xa9,0x31, + 0x4e,0x3,0xdc,0x2,0x48,0x89,0xee,0x41,0x1d,0x4,0xbb,0x0,0xfb,0xa,0xb0,0xe4, + 0xe8,0x93,0xe5,0x83,0xa9,0x54,0x83,0xf3,0x87,0x13,0xd0,0x2d,0xa0,0x2e,0xa7,0xb0, + 0x33,0xf8,0xa7,0xf5,0xb7,0xaa,0x70,0xc9,0x9d,0xb7,0x33,0xb8,0x4c,0x82,0xfa,0xf9, + 0xc,0x68,0xf6,0x16,0xf5,0xe6,0x8f,0x10,0xce,0xcf,0xd0,0x62,0x1a,0xf3,0x44,0x54, + 0x35,0x2f,0x9c,0xc6,0x91,0x9a,0x2c,0x1d,0xc4,0x6c,0x2a,0x8b,0x6,0x1e,0x6,0x5f, + 0xcf,0xd9,0xd4,0x42,0xec,0x41,0xed,0xba,0x81,0x25,0x45,0x15,0x58,0x8a,0xe9,0xc6, + 0x54,0x44,0xf,0xb7,0x7e,0xdc,0x2d,0x47,0xa6,0xf8,0x88,0xc3,0x37,0x88,0x41,0xdf, + 0x2d,0x45,0x65,0x21,0xa3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /home/mccad/Desktop/images/shading.png + 0x0,0x0,0x1,0x34, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x0,0xfb,0x49,0x44,0x41,0x54,0x58,0x85,0xed,0x97,0xcd,0x11,0x84,0x20, + 0xc,0x85,0x1f,0x3b,0x36,0x63,0xa,0xb2,0x1e,0xea,0xa1,0xa,0xab,0x80,0x72,0xb2, + 0x27,0x58,0x76,0x5d,0x48,0x82,0x8e,0x5e,0x78,0x27,0x74,0x48,0xde,0x7,0xfe,0x24, + 0x38,0x66,0x66,0x3c,0xa8,0x5,0x0,0x52,0x4a,0xa6,0x20,0xa2,0xf0,0x75,0x1d,0xe3, + 0x36,0x64,0x4e,0x44,0x78,0xd9,0x83,0x82,0xea,0x9e,0xa4,0x7d,0xdf,0x1,0xc0,0x6, + 0x90,0x8d,0xea,0x15,0xe7,0xf1,0x8,0x84,0x9,0xe0,0x9f,0xf9,0x15,0x10,0x2a,0x80, + 0x9e,0xf9,0x59,0x8,0x11,0x40,0x63,0x7e,0x6,0x62,0xd1,0x26,0x5,0x80,0x75,0xa5, + 0x32,0xfe,0x7c,0xbc,0xfe,0x67,0x7e,0x54,0x9b,0xab,0x0,0x6a,0x53,0x8d,0xea,0xf9, + 0x29,0xc9,0x30,0xdd,0x47,0x60,0x35,0x1f,0x89,0x6f,0x2,0x9c,0x35,0xd7,0xe6,0x31, + 0xff,0x88,0xae,0xd6,0x4,0x98,0x0,0x13,0x60,0x2,0x1c,0x6a,0x41,0xae,0x64,0x77, + 0x75,0x8a,0xb7,0xec,0x0,0x51,0x68,0x96,0xe8,0x26,0x80,0xa6,0x92,0x69,0x24,0xe5, + 0xe9,0x96,0x63,0xe7,0x7c,0x19,0x33,0xfb,0xe6,0xbc,0x56,0x9c,0xa6,0x89,0x69,0x2, + 0xd4,0x5b,0x16,0xe3,0x86,0x94,0x2c,0xad,0x77,0x28,0x39,0x24,0x8,0xf1,0x1d,0x18, + 0xe9,0xf9,0xeb,0x18,0xa9,0x3d,0x53,0xf5,0x84,0xbd,0x97,0x48,0x3,0xd1,0x93,0xd8, + 0x92,0x59,0x65,0x5,0x3d,0x0,0x8c,0x1e,0xb3,0x46,0x75,0xf9,0xe,0x58,0x17,0x50, + 0x0,0xf2,0x59,0xed,0x6e,0x39,0x66,0x66,0xe7,0xdc,0x23,0xe6,0x0,0xf0,0x6,0xec, + 0xcc,0x60,0xe9,0x41,0x28,0x13,0x26,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/mccad/Desktop/images/rightview.png + 0x0,0x0,0x1,0x9b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x62,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x97,0xfd,0x91,0x84,0x20, + 0xc,0xc5,0x1f,0xce,0x36,0x63,0xa,0xb2,0x8,0xaa,0xb0,0x1e,0xab,0xa0,0xa,0xec, + 0xc6,0xec,0x1f,0x77,0x78,0x7c,0x8,0x24,0xe8,0xde,0xbe,0x99,0x1d,0x95,0x35,0xbc, + 0x1f,0xc1,0x20,0x1a,0x66,0x66,0x7c,0x51,0x2f,0x0,0xd8,0xf7,0x5d,0x15,0x44,0xb4, + 0x25,0xd7,0xde,0x2f,0x43,0xe6,0x44,0x84,0x49,0x1f,0xb4,0x89,0xda,0x7a,0x72,0xce, + 0x1,0x80,0xe,0x20,0x18,0xc5,0x23,0xe,0xe7,0x23,0x10,0x2a,0x80,0x2b,0xf3,0x27, + 0x20,0x44,0x0,0x2d,0xf3,0xbb,0x10,0x5d,0x0,0x89,0x79,0x9,0x61,0xc5,0x0,0x2f, + 0x69,0xa7,0x52,0xfd,0xdc,0x2f,0x8f,0xe9,0x2,0x4,0xd1,0x46,0x69,0xc3,0x1a,0xda, + 0x57,0xb1,0x99,0x5f,0xfc,0x18,0x40,0x30,0x8f,0x3b,0xd0,0x4c,0x4d,0x1,0x1f,0xa9, + 0xff,0xc,0x6c,0x74,0x49,0x2e,0x55,0x2f,0xbe,0x99,0x81,0x40,0x9e,0x1f,0x1,0x88, + 0xa7,0x20,0x37,0x9f,0x89,0xb0,0xfb,0xbf,0xb6,0xfe,0x43,0xf8,0xdb,0x41,0x3e,0x12, + 0xc9,0x14,0xe4,0xa9,0xcf,0xcd,0x1,0xe5,0x4a,0x78,0x47,0xbc,0xa2,0x30,0x7,0x14, + 0x55,0x70,0x47,0x33,0x51,0x72,0x4,0x80,0x19,0x80,0xfd,0x24,0xc0,0x71,0x1c,0xe7, + 0xf9,0xee,0x7d,0x91,0x7e,0xe7,0x1c,0x60,0xed,0xe7,0xa6,0x60,0x9a,0xd2,0xae,0xcd, + 0x9a,0x66,0x20,0x48,0x95,0x81,0x91,0x2a,0x88,0x63,0xae,0x32,0x21,0x5e,0x88,0xce, + 0x6a,0xa8,0xbc,0x6c,0xae,0xaa,0x21,0xc4,0xc5,0xf1,0xea,0x2a,0xa8,0x99,0x7b,0xbf, + 0x24,0xa6,0x35,0xb0,0xde,0x42,0x64,0x98,0x99,0xe3,0x2d,0x59,0x5c,0xdf,0xad,0x25, + 0x54,0xaa,0x9a,0xb9,0x73,0xe,0xd6,0xda,0xf6,0x14,0xd4,0x46,0x7e,0xa5,0xd6,0x3d, + 0xad,0x45,0x4b,0xbc,0x1f,0x68,0x99,0xe7,0xff,0x69,0x36,0x25,0x4d,0x0,0xa9,0xf9, + 0x1d,0x88,0x2a,0x80,0xd6,0x7c,0x14,0xa2,0x3b,0x5,0x23,0x7b,0x7e,0xd,0x84,0xe8, + 0x19,0x8,0xbf,0x51,0x88,0x96,0x1e,0x7f,0x17,0x68,0x41,0xb,0x80,0xd1,0xcf,0xac, + 0x51,0x3d,0x9e,0x1,0xed,0x0,0x4e,0x80,0xf0,0xad,0xf6,0xdf,0x32,0xcc,0xcc,0xc6, + 0x98,0xaf,0x98,0x3,0xc0,0x1b,0x9f,0xf7,0xca,0x8d,0x15,0xaa,0x51,0x4e,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/select.png + 0x0,0x0,0x0,0x6d, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x0,0x0,0x0,0x0,0x3a,0x98,0xa0,0xbd, + 0x0,0x0,0x0,0x34,0x49,0x44,0x41,0x54,0x78,0xda,0x85,0xce,0xa1,0xd,0x0,0x30, + 0xc,0x3,0xc1,0xdf,0x7f,0xaa,0x8c,0x16,0x52,0x45,0x71,0x1e,0xd4,0xc0,0xe0,0x80, + 0x65,0xea,0x84,0xa9,0x0,0x4,0x8,0x10,0x20,0x40,0x80,0x80,0xcf,0xc6,0x79,0x9a, + 0xa3,0xfb,0xed,0x2,0x12,0x4a,0xf0,0xd2,0x7e,0x31,0x95,0x41,0x8a,0x2f,0xc4,0xb5, + 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/undo.png + 0x0,0x0,0x0,0xe4, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x36,0x1d,0xe8,0x15,0xe7,0xc3,0x0,0x0,0x0,0x71,0x49,0x44, + 0x41,0x54,0x78,0xda,0xed,0x93,0xc1,0xa,0xc0,0x20,0xc,0x43,0x9b,0x7e,0x77,0xd8, + 0x41,0xfa,0xdf,0xdd,0x41,0xc6,0x6,0xda,0x4d,0x9d,0x97,0x31,0x3,0x1e,0x94,0xf6, + 0x55,0xdb,0x28,0xb2,0xf4,0x59,0xa1,0x2f,0xdc,0xbc,0x7a,0x9a,0x44,0xb8,0x11,0x1, + 0xd8,0x5c,0x84,0xe8,0x1,0x96,0x3a,0xf3,0x51,0x26,0x13,0x31,0xf0,0xbe,0xf0,0xf5, + 0xe6,0x1,0x84,0x28,0xf7,0xad,0x6d,0xca,0xb1,0xfa,0xfc,0x74,0x62,0x64,0x78,0xda, + 0xda,0xb3,0xc9,0xe0,0xd6,0xa1,0x75,0x83,0xc7,0xe1,0xfa,0xc6,0xbf,0x35,0x57,0x4c, + 0x91,0x25,0xf3,0xc,0x3d,0xd6,0xf0,0xcf,0x9b,0xef,0x9e,0xa5,0x3f,0x69,0x7,0x62, + 0xac,0x28,0xb1,0x7,0x21,0xc,0x2f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/mccad/Desktop/images/past.png + 0x0,0x0,0x1,0x44, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x38,0x11,0x7f,0x20,0x86,0x66,0x0,0x0,0x0,0xd1,0x49,0x44, + 0x41,0x54,0x78,0xda,0xcd,0x95,0x51,0xa,0xc3,0x20,0xc,0x86,0xff,0x14,0x4f,0x25, + 0xf4,0x64,0x4a,0x1f,0x4a,0x3c,0xd9,0xa0,0xd7,0xca,0x1e,0xda,0x6d,0xd6,0x26,0xa8, + 0x9d,0x83,0x5,0x24,0x45,0xe3,0x97,0xdf,0x98,0x22,0xf0,0x23,0xa3,0xca,0xba,0xdc, + 0xd8,0x73,0x9,0x12,0x95,0x9c,0xcd,0x12,0xb5,0xb,0xa4,0x56,0x68,0x2f,0xdc,0xbd, + 0xa0,0xbc,0x32,0x80,0x8,0x80,0x11,0x97,0xa8,0x82,0xf2,0x44,0x4a,0xbc,0xe4,0x70, + 0x2,0x20,0x65,0xd0,0xf6,0xd8,0xaa,0x35,0xf4,0xb3,0xd7,0xe0,0x6f,0xf0,0xb4,0xbb, + 0x7d,0x71,0xf7,0x3d,0x66,0xef,0x73,0xc7,0xc1,0x4e,0x41,0x7e,0xf6,0x8d,0x60,0x36, + 0xe1,0xae,0xcc,0x9c,0x1f,0xaf,0xcf,0x9f,0x6d,0xd2,0x33,0xdf,0xf1,0xd7,0x16,0x11, + 0x5e,0x6d,0x78,0x5c,0xb8,0xa3,0xde,0x9f,0xcb,0x73,0x75,0xc5,0x80,0x48,0xb0,0x9b, + 0x97,0x12,0x44,0xc2,0xd1,0x96,0xd1,0xae,0xb1,0x5,0x27,0x4a,0xca,0xf,0x14,0x4e, + 0xdf,0x44,0x10,0x20,0x52,0xb3,0xe2,0x9a,0x6a,0xd,0x3e,0x4c,0x71,0x9,0x1f,0xa2, + 0x58,0x4b,0xfa,0xb5,0x62,0x2d,0x21,0x51,0x1a,0x5b,0xe3,0x61,0x8a,0xad,0xb,0x2c, + 0x5f,0xa,0x63,0xb0,0xf4,0x1a,0xc0,0xd2,0xf0,0xcc,0xb0,0xe0,0x9f,0xec,0x9,0xe3, + 0x25,0xc1,0x98,0x31,0xe7,0x44,0x89,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/mccad/Desktop/images/ghost2displayed.png + 0x0,0x0,0x1,0xcf, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a, + 0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0xa,0x7,0xb,0xa, + 0x2e,0x4,0xee,0xcd,0xfb,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d, + 0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74, + 0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x3c,0x49,0x44, + 0x41,0x54,0x48,0xc7,0xed,0x95,0xb1,0x6a,0x2,0x41,0x10,0x86,0x3f,0xb3,0x87,0x10, + 0x52,0x24,0xad,0x55,0xe0,0x3a,0x7d,0x82,0x14,0x76,0x57,0x6b,0x21,0x57,0xd8,0x78, + 0x8,0x56,0x29,0xf3,0x8,0xe6,0x5,0x84,0xf4,0x36,0x2b,0x58,0xc8,0x95,0x36,0x82, + 0xad,0x95,0x85,0xdd,0x5d,0x27,0x78,0x5c,0x11,0x22,0x11,0x8b,0xa8,0xab,0x70,0x9c, + 0x45,0x8c,0x89,0x82,0x1a,0x92,0x2c,0x69,0xfc,0x9b,0xdd,0x62,0x98,0x6f,0x67,0xe7, + 0xdf,0x9d,0x84,0x52,0x2a,0x46,0x93,0x82,0x20,0xc0,0x0,0x18,0xe,0x87,0x5a,0x0, + 0x96,0x65,0x71,0x81,0x66,0x9d,0x1,0xff,0xf,0x30,0x3e,0x36,0x37,0x9d,0xe,0xb1, + 0x10,0x7,0x3,0x23,0x29,0x79,0x93,0x12,0x0,0x29,0x25,0xf7,0xad,0xd6,0xc1,0xd8, + 0xfa,0x74,0xca,0xe3,0x64,0x42,0x2a,0x95,0x22,0xa1,0x94,0x8a,0x5f,0xb2,0x59,0x84, + 0xe3,0x10,0xb9,0x2e,0xc2,0xb6,0x89,0x5c,0x17,0x80,0x64,0xa9,0xc4,0xaa,0xd1,0x40, + 0xd8,0x36,0x46,0x18,0xf2,0x5a,0x2e,0x3,0x90,0xc9,0x64,0x8e,0x9e,0x7a,0x64,0x9a, + 0xdc,0x2d,0x16,0x9f,0x15,0x8,0xc7,0x1,0x40,0xd8,0xf6,0xce,0x1a,0x6d,0x82,0x0, + 0x96,0x83,0x1,0x6c,0x0,0x23,0xd3,0x3c,0x98,0xfc,0x76,0xef,0x4d,0x9d,0xec,0xc1, + 0x75,0xb5,0xfa,0xe,0xcd,0xe5,0xf4,0x34,0x79,0xd9,0xed,0x2,0xf0,0x50,0xab,0xe1, + 0xfb,0xfe,0xcf,0x9b,0x7c,0x4a,0x4f,0x85,0x2,0x93,0x74,0xfa,0xef,0x2b,0x50,0xbd, + 0x1e,0x0,0xab,0x7e,0x5f,0xcf,0x15,0x5d,0x15,0x8b,0x0,0xc4,0x61,0xa8,0x7,0x30, + 0x6b,0x36,0xb9,0x9c,0xcf,0x99,0xb5,0xdb,0xdf,0x4e,0xfa,0xd5,0x49,0x6,0xb0,0xe3, + 0xff,0x64,0xa5,0xc2,0xaa,0x5e,0xdf,0xda,0x35,0x1e,0x8f,0x79,0xce,0xe7,0x8f,0x5a, + 0x71,0x5f,0x9e,0xe7,0x6d,0xbf,0xeb,0x84,0x52,0x2a,0x3e,0xcf,0x83,0x33,0xe0,0x77, + 0xf3,0x20,0x8,0x2,0x2c,0xcb,0xd2,0x6,0x58,0x3,0x7a,0xf6,0x74,0x77,0x63,0x4b, + 0xb4,0x38,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/izoom.png + 0x0,0x0,0x1,0x9e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x65,0x49,0x44,0x41,0x54,0x58,0x85,0xc5,0x95,0xdb,0x91,0x84,0x20, + 0x10,0x45,0x2f,0xd6,0xc4,0x60,0xe,0x74,0x12,0xab,0xe9,0x18,0x5,0x51,0x4c,0x3a, + 0xb2,0x49,0x40,0xe,0x26,0xd1,0xfb,0xe1,0x36,0x28,0xea,0x28,0xa8,0xe3,0xfd,0xb1, + 0xaa,0x85,0xea,0x43,0x3f,0x15,0x33,0x33,0x1e,0xd4,0xb,0x0,0xbc,0xf7,0x45,0x97, + 0xb5,0xd6,0xc5,0x77,0x1,0x80,0x88,0x50,0x15,0xdf,0x3e,0x29,0x6b,0x2d,0x0,0xdc, + 0xb,0x40,0x3,0x81,0x6,0xfa,0x78,0xe6,0xb1,0x8,0x88,0x5e,0x7b,0x7,0x88,0xba, + 0x85,0xcd,0xb9,0xf7,0xfd,0x0,0xd1,0xb1,0xd9,0xfc,0xc7,0xdc,0x5f,0xf,0x90,0x3a, + 0x66,0xfe,0x59,0x5c,0x52,0xca,0xfc,0x7f,0x7f,0x1,0x98,0x10,0x91,0xad,0x7c,0xa7, + 0x76,0x57,0xbb,0x75,0x80,0xd1,0xf9,0xb6,0x63,0x91,0xfc,0x13,0x0,0xa2,0xae,0x38, + 0x2d,0x49,0x4,0xf6,0x9d,0xa7,0x20,0x23,0xc4,0xa8,0xe9,0xcb,0x80,0xf8,0xf2,0xd4, + 0x3e,0x55,0xe8,0x82,0x98,0xd7,0x63,0xce,0xa7,0x10,0x12,0x85,0x12,0x3d,0xde,0x86, + 0x15,0x10,0x73,0x9f,0xfb,0x7a,0xd1,0x99,0x28,0x3c,0x1e,0x81,0xdd,0x41,0x74,0x46, + 0x9f,0x8a,0xef,0x36,0x0,0xad,0xf5,0xa1,0x73,0xb2,0x8c,0x2e,0x7,0xc8,0x5d,0xcf, + 0x15,0x20,0xb3,0xdd,0xcc,0x7a,0x3a,0x47,0xe9,0x44,0xcc,0x6,0x78,0x52,0x1,0x40, + 0xe8,0x73,0xa3,0x20,0xaf,0xb7,0xb6,0x6c,0x31,0x25,0x11,0x30,0x59,0x10,0xd3,0x73, + 0x4d,0xd3,0x62,0x18,0x8e,0x15,0xe0,0x54,0xb3,0x22,0x74,0xee,0x1d,0x86,0x89,0x6c, + 0xbc,0xf5,0x6d,0x28,0x8e,0xcd,0xcc,0xde,0x34,0x2d,0xac,0xed,0x51,0xd7,0xc7,0xb, + 0x71,0xd1,0x5,0x61,0xb5,0x26,0x20,0x73,0x89,0x4d,0xc2,0xde,0x16,0x43,0x6c,0xb6, + 0x61,0xa,0xb2,0xf6,0x4f,0xeb,0xb1,0xed,0x88,0xfa,0x62,0x88,0xdd,0x39,0x70,0xa4, + 0xb5,0x9c,0x2b,0x87,0xb8,0xac,0xd,0x9d,0xf3,0x88,0x29,0x89,0x10,0x7b,0x85,0x79, + 0xe9,0x1c,0x28,0x81,0xb8,0x7c,0x10,0xe5,0x42,0xdc,0x32,0x9,0x73,0x20,0x6e,0x1b, + 0xc5,0x6b,0x10,0x6b,0x5,0xa9,0x98,0x99,0xbd,0xf7,0x61,0x3d,0x7e,0x53,0x5d,0xd7, + 0x8d,0x0,0x4a,0xa9,0xaf,0x3b,0x17,0xfd,0x1,0x67,0x7,0xb3,0xa2,0xc3,0x43,0xbd, + 0x1f,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/export.png + 0x0,0x0,0x2,0x75, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1, + 0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd8,0xa,0x10, + 0xe,0x4,0x2d,0x3,0x3d,0xcf,0xa7,0x0,0x0,0x1,0xf5,0x49,0x44,0x41,0x54,0x38, + 0xcb,0xb5,0x95,0xbd,0x6e,0x1a,0x41,0x10,0xc7,0x7f,0xb,0x44,0x81,0x38,0xf2,0xe1, + 0xc4,0x5,0x42,0x96,0x22,0xe5,0x9,0xac,0xe8,0x44,0x63,0x9,0x9a,0xd0,0x26,0x2d, + 0x1d,0x6f,0x85,0x78,0x8b,0xe4,0x15,0x28,0x4c,0x71,0xba,0x60,0x9,0x5d,0xe1,0x8a, + 0x82,0x50,0x50,0xd8,0xa,0x4a,0x9c,0xc3,0x70,0xbb,0x4c,0xa,0xee,0x4e,0x7c,0x2c, + 0xf6,0x11,0x25,0x23,0xfd,0x75,0xba,0xfd,0xf8,0xed,0xec,0xec,0xec,0xac,0x12,0x11, + 0xfe,0x87,0x15,0x76,0x1b,0x94,0x52,0xa,0xc8,0xc7,0x7d,0x79,0x20,0x67,0x99,0x27, + 0xc0,0xa,0xd0,0x80,0x11,0x11,0xf3,0x2c,0x18,0xc8,0x37,0x9b,0xcd,0x68,0xb1,0x58, + 0x60,0xcc,0xde,0x78,0xe6,0xf3,0x39,0x83,0xc1,0x80,0x46,0xa3,0xe1,0xf5,0x7a,0xbd, + 0x4f,0xc0,0x6f,0xa5,0xd4,0xa3,0x88,0xe8,0xed,0xa5,0x45,0xb6,0x4,0x14,0xeb,0xf5, + 0xba,0x68,0xad,0xad,0x1a,0xe,0x87,0x12,0x7b,0x2c,0xb5,0x5a,0xed,0x1b,0xf0,0xe, + 0x38,0x5,0xa,0x9b,0x1c,0xdb,0x36,0xf3,0xc6,0x18,0x8c,0x31,0x68,0xad,0xf7,0x94, + 0xec,0xa2,0xdb,0xed,0xe2,0x79,0xde,0x7,0xd7,0x75,0xbf,0x2,0x6f,0x80,0x57,0x4a, + 0xa9,0x34,0x2,0x36,0x70,0xe,0x20,0x81,0xef,0x6a,0xb5,0x5a,0x1,0x50,0x2a,0x95, + 0xe8,0x74,0x3a,0xf8,0xbe,0x7f,0xe9,0xba,0xee,0x17,0xe0,0xc,0x28,0x2a,0xa5,0xf2, + 0x87,0x62,0x4c,0x2,0xb6,0x65,0x8c,0xd6,0xeb,0x50,0xb6,0xdb,0xed,0xb4,0xcd,0xf7, + 0xfd,0x4b,0xe0,0x1c,0x78,0x4,0x96,0x80,0x39,0x8,0x8e,0xa2,0xc8,0xa,0x2e,0x97, + 0xcb,0xf4,0xfb,0xfd,0xf4,0x7f,0x3c,0x1e,0xd3,0x6a,0xb5,0x0,0xca,0xc0,0x3d,0xf0, + 0xb,0x58,0x1e,0x4,0x6b,0xad,0xd3,0x6d,0x57,0x2a,0xeb,0x61,0xd3,0xa9,0xc6,0x71, + 0x1c,0x1c,0xc7,0x49,0xc7,0x25,0x63,0x80,0x97,0xc0,0x8b,0x24,0x94,0xb9,0xa7,0xc0, + 0x89,0x12,0xab,0x54,0xa,0x7,0xf,0x33,0xce,0x79,0x15,0x6b,0x1d,0x63,0xa5,0xee, + 0x37,0xf6,0x7c,0xc7,0xf5,0x35,0x54,0xab,0xf6,0x5,0x2f,0x2e,0x8a,0x0,0x8c,0x46, + 0x3f,0x1,0x58,0x2e,0x97,0xd9,0x6e,0x5e,0x56,0x8b,0xa2,0x28,0x3d,0x64,0xe,0xa5, + 0x96,0xc8,0x5b,0x95,0x8,0xce,0x4f,0xaf,0xae,0x3e,0x73,0x7b,0x7b,0x47,0x10,0x4c, + 0x9,0x82,0xe9,0xde,0xa4,0x20,0x98,0x12,0x45,0x51,0xaa,0xa3,0x3c,0xd6,0x5a,0xef, + 0x4d,0xba,0xb9,0xf9,0x1e,0x7b,0xbb,0x9d,0x96,0x47,0x81,0x37,0xbd,0xf1,0xbc,0xd1, + 0x1e,0x70,0x37,0x24,0x7f,0x5,0x7e,0xca,0x36,0xb3,0x26,0x13,0x38,0xa9,0x15,0xff, + 0x14,0x3c,0x9b,0xcd,0x8,0xc3,0x90,0xc9,0x64,0xf2,0x2c,0x38,0xc,0x43,0x7b,0x87, + 0xa5,0x6c,0x9e,0x24,0x65,0xf1,0x48,0x7d,0x4,0xde,0x3,0x27,0x22,0x62,0xf5,0xd8, + 0x0,0xd5,0x58,0x67,0x40,0x29,0x43,0x5a,0xcf,0x81,0x1f,0xf1,0xd7,0x0,0xa8,0xdd, + 0x42,0x13,0xd7,0xd4,0x12,0xf0,0x3a,0xfe,0x66,0xb9,0x44,0x3a,0x86,0x3e,0x0,0x73, + 0x11,0xd1,0x36,0x70,0x96,0x37,0x6f,0xd7,0x56,0xb1,0xa7,0xc9,0x1b,0x28,0x7f,0x0, + 0xbd,0xd7,0x6c,0x3a,0xd9,0xe0,0x1b,0xba,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/draw.png + 0x0,0x0,0x1,0x64, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x2b,0x49,0x44,0x41,0x54,0x58,0x85,0xed,0x97,0xdd,0xad,0x83,0x30, + 0xc,0x85,0x4f,0x50,0x97,0x89,0x7,0xea,0x3c,0xcc,0xc3,0x14,0x4c,0x11,0x6f,0x83, + 0xef,0x43,0x65,0xe4,0x4b,0x21,0xb1,0x3,0x2d,0x2f,0x3d,0x52,0x24,0x12,0x41,0xce, + 0xe7,0xc4,0xf9,0x21,0x89,0x88,0xe0,0x46,0x3d,0x0,0x80,0x99,0x43,0x1f,0x11,0x4d, + 0xff,0xea,0xa5,0x3c,0xbb,0xcc,0x89,0x8,0x43,0xfc,0xa3,0xc9,0xd5,0xd6,0xd2,0x3c, + 0xcf,0x0,0x10,0x3,0x50,0x23,0x1b,0xb1,0x3e,0xf7,0x40,0x84,0x0,0xf6,0xcc,0xaf, + 0x80,0x70,0x1,0xd4,0xcc,0xcf,0x42,0x34,0x1,0x3c,0xe6,0x67,0x20,0x1e,0xde,0x4e, + 0xbd,0x8a,0xbe,0x1f,0x5e,0x5,0x57,0xeb,0x7,0xf0,0x3,0xb8,0x1d,0xa0,0xb9,0xc, + 0xf7,0x94,0x33,0x41,0xcf,0x50,0xe6,0xbe,0x83,0xa8,0x1b,0x20,0x67,0x2,0x73,0x59, + 0x37,0x1b,0x91,0x57,0x7d,0xab,0x65,0x59,0x30,0xc,0xed,0x1,0xe,0x4d,0x81,0x9a, + 0x5b,0x31,0x17,0xe4,0x4c,0xef,0x1d,0x3b,0xcc,0x43,0x0,0xd6,0xdc,0x6e,0xb5,0x44, + 0xd3,0x21,0xc4,0xa5,0x0,0xd6,0xd0,0xd3,0xf6,0x11,0x0,0x6b,0x54,0xca,0xb3,0xfb, + 0x26,0x54,0x5,0x20,0x9a,0x76,0x23,0x4a,0x69,0x84,0xc8,0xb8,0x9a,0x5b,0x10,0x91, + 0x11,0x29,0x8d,0x9f,0xbf,0xf,0x58,0x8,0xd5,0x36,0x31,0x8f,0xa6,0xe8,0x8,0xce, + 0x7d,0x1f,0x0,0x5e,0xd1,0x6a,0xc2,0x69,0x51,0x73,0x3b,0x2a,0x91,0x91,0xa8,0x2, + 0x6c,0xcd,0x55,0xcc,0x65,0x2d,0x56,0x3d,0x10,0x87,0x0,0x47,0xe6,0x2d,0x45,0x21, + 0x9a,0x53,0xd0,0x93,0xe9,0x11,0x8,0x57,0xe,0xd4,0x92,0xc8,0x3,0x51,0x53,0xd7, + 0x61,0x54,0x53,0x14,0xf4,0xd,0xe0,0x8a,0xcd,0xe5,0x14,0xc0,0x59,0x45,0x3,0x58, + 0x1,0xf4,0x5f,0xed,0xdb,0x4a,0x22,0x22,0x29,0xa5,0x5b,0xcc,0x1,0xe0,0xf,0xbd, + 0x70,0x9b,0xf3,0xfe,0xc3,0x2,0x5e,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/mccad/Desktop/images/document.png + 0x0,0x0,0x2,0x39, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x12,0x0,0x0,0x0,0x12,0x8,0x6,0x0,0x0,0x0,0x56,0xce,0x8e,0x57, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5, + 0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd2,0x2,0x6,0xb,0x2d,0xe,0x7, + 0x4e,0x83,0x31,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0, + 0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb, + 0xd,0x0,0x0,0xb,0xd,0x1,0xed,0x7,0xc0,0x2c,0x0,0x0,0x1,0xb6,0x49,0x44, + 0x41,0x54,0x38,0xcb,0x95,0x94,0xcd,0x4b,0xc2,0x70,0x1c,0xc6,0xa5,0x8e,0x41,0xd4, + 0xb1,0xff,0xa1,0x83,0xc7,0xe8,0xe8,0xa1,0xa0,0x63,0x14,0xf8,0x3f,0x88,0x20,0x4, + 0x11,0x74,0xf0,0x92,0x90,0x41,0x54,0x4,0x85,0x1e,0xa2,0x88,0x5e,0xa8,0xc8,0x22, + 0xa8,0x88,0x69,0x59,0x11,0x15,0x21,0x15,0x11,0xbd,0x88,0x9a,0x59,0xe6,0xda,0x24, + 0xb7,0x69,0x4b,0xcd,0xa7,0xdf,0x96,0x86,0xcd,0xe6,0xd6,0x17,0x3e,0x6c,0x83,0x2f, + 0x9f,0x3d,0x7b,0xe0,0x37,0x83,0x41,0x31,0x66,0xb3,0x19,0x5a,0x90,0xb5,0x7a,0x42, + 0xad,0xa1,0xda,0x48,0x8b,0xa1,0x50,0xa8,0x2,0x6a,0x6b,0x5d,0x96,0xb8,0x5c,0xae, + 0x92,0xac,0xa9,0xaa,0xac,0x24,0x52,0xe,0x4d,0xd3,0xb0,0x5a,0xad,0xf2,0xbd,0x2e, + 0x99,0x52,0xe4,0x76,0xbb,0x65,0xf2,0xf9,0x3c,0x6c,0x36,0x1b,0x2,0x81,0xc0,0x8f, + 0xcc,0x68,0x34,0xaa,0xcb,0xd4,0x12,0x49,0xe3,0x74,0x3a,0x65,0x99,0xc5,0x62,0x81, + 0xc9,0x64,0x2a,0x89,0x3a,0x8a,0x9d,0x7d,0x4f,0x67,0x6b,0x33,0x26,0x46,0x1c,0xb8, + 0x3c,0xf3,0xcb,0x57,0xe9,0x59,0x39,0x99,0x74,0x1a,0xd1,0xc8,0x77,0x5f,0x23,0xce, + 0x81,0x92,0xa8,0x9b,0xd0,0x58,0x1e,0xa6,0x8e,0xd0,0xa2,0xf6,0x69,0x12,0xb9,0x8f, + 0xc,0x84,0x37,0x6,0xf1,0xc8,0x2d,0x7c,0x9b,0x1e,0x55,0x51,0x8d,0x14,0x51,0x12, + 0x85,0xc3,0xe1,0x5f,0x49,0xa,0x85,0x2,0x72,0x62,0x1a,0xa2,0xc0,0x82,0x67,0x1f, + 0x91,0x8c,0x7,0x41,0xad,0x4e,0xaa,0x8a,0xaa,0x96,0x5d,0xe,0x13,0xbd,0xfa,0x9f, + 0xe8,0xf3,0x33,0x8f,0xac,0x28,0x40,0xe4,0x5f,0x91,0x4e,0xc6,0xc0,0xd3,0x41,0xa4, + 0x9e,0xaf,0xc0,0x84,0x4f,0x41,0x2d,0x8f,0xfe,0x2d,0xfa,0xab,0xec,0xac,0xc8,0x63, + 0x7c,0xd8,0x51,0x1,0x73,0xbf,0xf,0x6a,0x71,0x48,0x5f,0xd9,0xd9,0xc,0x7,0x91, + 0xa3,0x49,0x92,0x28,0xb8,0xc4,0x1d,0xde,0x62,0x97,0x48,0x46,0x4e,0xc0,0x4,0xfd, + 0x48,0x5c,0xef,0x80,0x9a,0x77,0x68,0x97,0x2d,0x89,0xde,0x53,0x9,0x8,0x6c,0x14, + 0xa3,0x83,0xfd,0x15,0xc4,0x2f,0xd6,0x40,0xcd,0xda,0xf5,0x75,0x24,0xb0,0xf,0xe0, + 0x5e,0x6e,0x48,0x92,0x73,0x24,0x43,0xc7,0x60,0xee,0x76,0x49,0x92,0x6d,0x59,0xf2, + 0x74,0xb6,0x0,0x6a,0xa6,0x4f,0x5b,0x74,0xe4,0xdf,0x94,0x39,0xf4,0xae,0xe0,0x60, + 0x7b,0x16,0xfb,0x1b,0x6e,0xec,0x79,0xc6,0xb0,0xbb,0x34,0x8,0xdf,0x9c,0x1d,0xde, + 0xe9,0x5e,0x50,0x53,0x3d,0xda,0x22,0x69,0x41,0x2f,0xaa,0xa2,0xe2,0xb9,0x69,0x23, + 0x74,0x15,0x97,0xb4,0x68,0xff,0x75,0xd6,0x94,0xa5,0x13,0x1a,0x8a,0x6f,0xd2,0x42, + 0xfe,0xc9,0x7d,0x1,0xf0,0x94,0x38,0xfd,0xac,0xef,0xa5,0x3b,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/scolor.png + 0x0,0x0,0x0,0x98, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0xf,0x4,0x3,0x0,0x0,0x0,0x1f,0x5d,0x52,0x1c, + 0x0,0x0,0x0,0x21,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x0,0xff,0xff,0x0,0xff, + 0x0,0xc4,0xc4,0xc4,0xff,0x0,0xff,0xff,0x0,0x0,0x84,0x0,0x0,0xff,0xff,0xff, + 0xff,0xff,0x0,0x0,0x84,0x84,0x0,0x0,0xff,0x89,0xd4,0x2d,0x82,0x0,0x0,0x0, + 0x32,0x49,0x44,0x41,0x54,0x78,0xda,0x63,0x30,0x86,0x2,0x6,0x3,0x6,0x30,0x0, + 0x32,0x42,0x3,0x3a,0x1a,0x5c,0x1c,0xb0,0x32,0xe0,0x6a,0x94,0x14,0x56,0x2d,0x10, + 0x14,0xc0,0xca,0x80,0xab,0x49,0x4b,0x98,0x39,0xa1,0xbc,0x0,0x2b,0x3,0xa6,0x6, + 0x66,0x3b,0x0,0x33,0xc2,0x1c,0x54,0x94,0x2f,0x87,0xdc,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/delete.png + 0x0,0x0,0x3,0x41, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0xd3,0x49,0x44,0x41,0x54,0x48,0xc7,0x7d, + 0x95,0x4b,0x68,0x53,0x41,0x14,0x86,0x6f,0xdb,0x24,0x8d,0x90,0x84,0x42,0xb0,0x75, + 0x51,0x50,0xe3,0xae,0xb5,0xb,0x25,0x1b,0xab,0x5d,0xf8,0xd8,0x55,0xeb,0x6b,0x61, + 0x97,0xd2,0x22,0x94,0x74,0xd5,0xee,0xdc,0xa8,0x20,0xa,0xae,0xbb,0x4a,0x41,0xa8, + 0xb8,0x12,0x45,0x54,0x74,0xa1,0xa0,0x58,0x15,0x1f,0xa0,0x1,0x6b,0x35,0xd2,0x2a, + 0x5a,0x6c,0x2b,0xa9,0x56,0xe9,0x4b,0xd3,0x3c,0x3c,0xfe,0xe7,0xe6,0x4c,0x66,0xee, + 0x24,0x6d,0xe0,0x63,0xee,0xcd,0xfc,0xf3,0xdf,0x99,0x73,0xe6,0xcc,0x38,0x44,0xe4, + 0x98,0xe0,0x57,0x7,0xf8,0xa1,0x1e,0xf8,0x41,0xad,0xad,0x31,0xb4,0xb5,0x86,0x36, + 0xc0,0x63,0xcb,0x7d,0x86,0xa8,0x46,0x8c,0x88,0xfa,0xfb,0x73,0x32,0x60,0x23,0x8, + 0x1,0x5f,0x15,0x53,0x9f,0xab,0x1d,0x18,0x50,0xda,0x46,0x10,0x16,0x8f,0x1a,0x53, + 0xe8,0x9a,0xfe,0x1b,0x1a,0xa2,0x62,0x77,0x37,0xe5,0x4b,0x62,0x66,0x33,0x88,0x70, + 0x7f,0x85,0x36,0x99,0xa4,0x62,0x4f,0xf,0x15,0x3,0x1,0xa5,0x8d,0x81,0x6,0xb7, + 0xdf,0x5c,0x7e,0x11,0xa6,0x85,0xde,0x5e,0xca,0xb7,0xb4,0x50,0x16,0xef,0xdf,0xb5, + 0xf9,0x56,0x65,0xae,0x4c,0x8b,0xc3,0xc3,0x54,0x48,0x24,0x28,0xdf,0xd6,0x46,0xcb, + 0x78,0x1f,0xd7,0xda,0x98,0xab,0x15,0x63,0x5a,0x4d,0x24,0x72,0xab,0x98,0x69,0xb6, + 0xb5,0x95,0xfe,0xe2,0xfd,0xf,0x58,0x0,0xd3,0xde,0x1,0x51,0x7e,0xce,0xc3,0x14, + 0xfa,0xb2,0x76,0x12,0x5c,0x6,0x67,0x1d,0xa7,0x20,0xda,0x26,0x65,0x1c,0xe4,0x3f, + 0x96,0xc0,0xa2,0xb4,0x8a,0x5f,0x5e,0x73,0xca,0xc1,0x34,0xb,0xd3,0x15,0x98,0x2e, + 0x89,0xe9,0x8,0x38,0xae,0x35,0xed,0xa0,0x59,0x19,0x7,0x24,0xf8,0xf4,0x19,0xcc, + 0x89,0xe1,0x6f,0x69,0x99,0xc5,0x78,0x9c,0x56,0x6,0x7,0x69,0xb9,0xaf,0x8f,0x16, + 0x60,0xca,0x7d,0x69,0x99,0xe9,0x31,0x6d,0xda,0x5,0x76,0xb8,0x5e,0x46,0x8c,0x43, + 0x92,0x28,0xfa,0x8,0x66,0x40,0x46,0x3e,0xc2,0xfc,0x88,0x46,0x69,0x1e,0xf1,0xfc, + 0x19,0x8b,0xb9,0xef,0xef,0x40,0x12,0x1c,0xd1,0xa6,0x98,0xb4,0xb3,0x4b,0x3c,0x42, + 0xf6,0xf6,0x89,0x48,0xa2,0x5c,0x73,0xe,0xc1,0x6c,0x15,0xde,0x8b,0xe9,0x61,0xaf, + 0x69,0xbb,0x91,0x64,0x9f,0xbd,0x37,0xfd,0xd2,0xc1,0x89,0xa2,0x19,0x2c,0xff,0x1b, + 0x66,0x3a,0x85,0x67,0x93,0x97,0xe0,0x82,0x36,0x3d,0x1,0x3a,0xca,0xbb,0x41,0xb6, + 0x65,0xb5,0x6a,0xf2,0xab,0xec,0x67,0x10,0xd3,0xaf,0x58,0xfe,0x27,0x3c,0x9b,0x70, + 0x18,0x6e,0x6a,0xe3,0x4e,0xb0,0x5d,0xc6,0xf8,0x2b,0x2a,0xcf,0xde,0xfc,0xf3,0xc8, + 0xfe,0x34,0x12,0x35,0x81,0x98,0xa6,0x25,0x51,0x8a,0xf,0x20,0x5,0x9e,0x68,0xf3, + 0xf5,0x8d,0x95,0xe9,0x1c,0x4c,0xa7,0xb0,0xa5,0xd2,0xc8,0xfe,0x98,0x18,0x3c,0x0, + 0xaf,0xc0,0x5b,0x30,0x26,0xed,0x1b,0x30,0x6a,0x17,0x86,0x1d,0xa,0x55,0xfb,0x19, + 0x98,0x7e,0x81,0xe9,0x38,0x4c,0x79,0x56,0xf7,0xc1,0x25,0x70,0x1a,0x5c,0x5,0xcf, + 0xc5,0x30,0x25,0x2d,0x7f,0xec,0x51,0x65,0x85,0xfa,0x3c,0x25,0x3d,0x8b,0xda,0x9f, + 0x84,0x69,0xa,0xa6,0x9c,0xa0,0xbb,0xe0,0x3c,0x38,0x60,0x14,0xc8,0x3d,0xf0,0xc, + 0xbc,0x90,0x24,0x72,0xfb,0x18,0x5c,0xf3,0x9e,0x2d,0xa1,0x72,0x49,0x4f,0xe0,0x94, + 0x4a,0xe3,0x40,0x79,0x8d,0x64,0xf1,0xc0,0xdb,0xe0,0x1c,0xd8,0xef,0xcd,0x7e,0xa7, + 0x32,0x67,0xb3,0xa7,0xf2,0x91,0x5b,0x32,0x81,0x84,0x2e,0xe9,0x46,0x4f,0x49,0x8f, + 0x6,0x83,0xf4,0x10,0xed,0x75,0x70,0x6,0xec,0xf3,0xee,0xd3,0xe,0x49,0x12,0x43, + 0x77,0x24,0x4c,0x37,0xc0,0x45,0x70,0x48,0x6b,0x77,0xdb,0x25,0xdd,0xc4,0x1d,0x57, + 0x24,0x9e,0x7b,0x2b,0x37,0xbf,0x3a,0x84,0xa2,0x6a,0x9f,0x8f,0x94,0xe,0x1e,0x3a, + 0xa8,0xb5,0x47,0x41,0xdc,0x3c,0x84,0xea,0x24,0xe8,0xdb,0x58,0x70,0x52,0x2f,0xa9, + 0x4b,0xca,0xd4,0x3e,0x36,0xcb,0x15,0x7a,0x4a,0x6b,0xd9,0x74,0x8f,0x78,0x44,0xec, + 0xad,0xd6,0xa0,0xcc,0x65,0x49,0x3b,0xc1,0x96,0x35,0xe,0xfa,0x88,0xf4,0x29,0x6d, + 0x5c,0xc6,0xea,0x83,0xde,0xba,0x9a,0x78,0xc0,0x26,0x37,0x4e,0xa5,0xf0,0x84,0xd7, + 0xb9,0x9a,0xc2,0xa2,0x69,0x96,0x31,0x91,0x8a,0xab,0xc9,0xba,0x4c,0xf9,0x72,0xdc, + 0x60,0x5f,0x90,0x6b,0x68,0x3,0xa2,0xad,0x37,0xb5,0xff,0x1,0x3d,0xa9,0x97,0x96, + 0x8a,0x42,0x62,0x69,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + + // /home/mccad/Desktop/images/copy.png + 0x0,0x0,0x1,0x30, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd, + 0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd6,0x6,0x4,0xe,0x34,0x21,0xf5,0x4c,0xf9,0xc6,0x0,0x0,0x0,0xbd,0x49,0x44, + 0x41,0x54,0x78,0xda,0xd5,0x94,0x51,0xe,0x84,0x20,0xc,0x44,0x67,0x88,0xc7,0xf2, + 0xe,0x5e,0xc6,0x3f,0xb3,0x7e,0xb0,0x57,0xf3,0x5c,0xdb,0xfd,0x70,0x35,0xa4,0x14, + 0x10,0x70,0xb3,0xd9,0x26,0xc4,0x84,0xd6,0xd7,0x71,0x2c,0x0,0xff,0x16,0x4,0x20, + 0x17,0x6a,0xda,0xc0,0x22,0x36,0x9b,0x64,0x33,0x7c,0x30,0x20,0xc0,0xde,0xed,0x7c, + 0x92,0x94,0x5a,0xf8,0xa0,0x41,0x56,0xb4,0xc0,0x4f,0x2b,0x2c,0xc5,0xfb,0x9e,0x2f, + 0x20,0x56,0x66,0x4,0xd9,0xb1,0xff,0x58,0x9f,0xc9,0xfb,0xcf,0x8a,0xc3,0x85,0x1e, + 0xeb,0x15,0xda,0xa3,0x73,0x47,0x8c,0xe3,0x2,0xb,0x7e,0xc9,0xe3,0x5c,0x7e,0x9a, + 0x0,0x60,0xc1,0xb6,0x41,0x42,0x5b,0x92,0x53,0xa1,0x61,0xa9,0xa9,0x99,0x67,0x7, + 0xe0,0x15,0xc1,0xbb,0x15,0x93,0x4f,0xb5,0xe3,0x5,0x58,0xd9,0xa5,0x58,0xe4,0x91, + 0x6c,0xd4,0xad,0xb8,0xfa,0xe4,0x95,0x14,0x97,0x9a,0x7f,0x4d,0xb1,0x4b,0xcd,0xb0, + 0x9e,0xd7,0x5c,0x8d,0xae,0x3d,0x14,0x97,0xbe,0x51,0xba,0x3c,0x2e,0x5e,0x2a,0xad, + 0x1e,0xd7,0xbc,0x74,0x9b,0xe2,0xf8,0x10,0xfc,0x30,0xde,0x62,0xda,0x9a,0xba,0x70, + 0x84,0x8f,0x14,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/person.png + 0x0,0x0,0x0,0xdc, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x2,0x0,0x0,0x0,0x4b,0xd6,0xfb,0x6c, + 0x0,0x0,0x0,0x6,0x74,0x52,0x4e,0x53,0x0,0x0,0x0,0x0,0x0,0x0,0x6e,0xa6, + 0x7,0x91,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff, + 0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x7f,0x49,0x44,0x41,0x54,0x78,0xda,0xcd,0x53, + 0x41,0xe,0xc0,0x20,0x8,0x6b,0x17,0xff,0xff,0xe5,0xee,0x40,0xb2,0x30,0x87,0xa2, + 0x9b,0x26,0xe3,0x86,0xb6,0x95,0x82,0x0,0xbb,0x43,0x92,0xa4,0x4f,0x7c,0x40,0xa6, + 0xf3,0x89,0x9f,0xaa,0x1c,0xdb,0x1b,0x31,0x62,0xa4,0x38,0x74,0x2a,0x57,0x7,0x49, + 0x0,0xb4,0x6b,0xf2,0x5d,0x99,0x20,0xb9,0xa0,0x17,0xec,0xd6,0x79,0x7b,0xb0,0x65, + 0xa4,0xf8,0xa4,0x6f,0x9e,0xd,0xb7,0xb,0x8c,0xfc,0x43,0x22,0xb6,0x17,0x8e,0xd9, + 0x46,0x38,0x24,0xe1,0xf9,0xd6,0x53,0x9f,0x32,0xfd,0x42,0x7e,0xbb,0xae,0xa1,0x84, + 0x87,0x13,0xfc,0x9,0x95,0x14,0x94,0x0,0x6,0x4b,0x6d,0xc2,0x26,0xac,0x46,0xe0, + 0x7a,0x47,0xf2,0x86,0x3f,0xc0,0x27,0xc4,0xf,0x9e,0x9e,0x78,0x71,0xdc,0x47,0x0, + 0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/fitall.png + 0x0,0x0,0x2,0x74, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0xf9,0x43, + 0xbb,0x7f,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x10,0xf,0x5,0x5,0x91,0x61,0x82,0x4a,0x0,0x0,0x2,0x1,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0xdb,0xd5,0x83,0x20,0xc,0x80,0x31,0xc7,0x65,0x64, + 0x20,0xd7,0x69,0xff,0x75,0x9c,0x82,0x29,0x70,0x1c,0xfb,0x84,0x7f,0x54,0x2e,0x49, + 0x0,0x45,0xf2,0xd4,0x9e,0x52,0xcc,0x47,0x8,0xb9,0xc8,0x60,0xad,0xdd,0x54,0x7, + 0x2,0x3d,0x40,0x18,0x63,0xfa,0x0,0xe9,0xc6,0x22,0x4a,0x29,0x35,0xe2,0x2f,0xd3, + 0x34,0x89,0x26,0x19,0xfe,0x86,0x22,0xca,0x6c,0x1f,0xbe,0xbb,0xae,0xeb,0x7a,0x5, + 0xc1,0x3f,0xa4,0x44,0x2f,0x7a,0xff,0x6c,0x67,0x1b,0x1e,0xa7,0x97,0xff,0x71,0x76, + 0x8e,0xce,0xe7,0x16,0x24,0x36,0x5f,0x68,0xe1,0xd9,0x5b,0x4b,0x2f,0x7a,0x87,0xb0, + 0xb3,0x4d,0x42,0x38,0xe5,0xad,0x9d,0xf,0x50,0x67,0xc1,0x73,0xe1,0x67,0x54,0xf1, + 0x11,0x2a,0xc0,0x19,0x2,0x5b,0x24,0x6,0xe3,0x3,0x2a,0xe,0x82,0x21,0x92,0x63, + 0x3d,0x10,0x1c,0x18,0xfc,0x1c,0x2a,0xc,0xdc,0x9,0x51,0x13,0x6,0x4a,0x42,0xa4, + 0x1c,0x5a,0x34,0x8e,0x8,0x3,0x25,0x21,0x6a,0x9,0x5,0x6,0x5a,0x87,0xa0,0xc2, + 0x0,0xe5,0xcf,0xad,0x48,0x4c,0x1f,0x48,0x5,0xbb,0x16,0xc5,0xa7,0x1f,0xbc,0xc5, + 0x1a,0x29,0xbd,0xe0,0x6d,0xd6,0x8,0xe9,0x9,0x35,0xad,0x81,0x53,0xd,0x49,0xda, + 0xc1,0xb1,0x4a,0x3a,0x8e,0x10,0x2,0x57,0x8,0x2,0xa7,0x1b,0xee,0x73,0x2d,0x8b, + 0x43,0x6e,0x94,0x8e,0x41,0x84,0x56,0x53,0xa,0x13,0x5b,0x54,0x38,0xd7,0x15,0xfb, + 0x79,0x5d,0x1,0x22,0x17,0x6,0xa7,0x36,0x76,0xb6,0x87,0x3a,0x8,0xee,0xb2,0x44, + 0xd,0x98,0xf8,0xa9,0x25,0x84,0x28,0x91,0x57,0xe5,0xc0,0x8c,0xa5,0x1c,0xbc,0x84, + 0xb2,0xd2,0x83,0x25,0x8,0x52,0x7a,0x5,0x4b,0x2f,0x86,0xdb,0x35,0x7a,0xf9,0x86, + 0xb7,0x16,0xb5,0x56,0x78,0x2c,0x10,0x6,0xb6,0x3e,0xe4,0x14,0x3e,0x54,0x7,0xf6, + 0xcd,0xc5,0x39,0x18,0x28,0xfe,0xb,0xb9,0x55,0x9c,0xe4,0x34,0x92,0x40,0xa4,0xb6, + 0x1e,0x94,0x28,0x49,0x39,0x30,0x52,0x8,0x56,0x64,0xdf,0x3e,0xdb,0x45,0x1,0xa9, + 0xe3,0x3b,0x98,0x73,0xae,0x55,0x32,0x8f,0xc3,0xd,0xbd,0xf1,0x96,0xaa,0xee,0xbb, + 0x54,0x2f,0xb,0xfa,0x6e,0x62,0x77,0x51,0x21,0xb6,0x5a,0x19,0xa6,0xf4,0x4,0xe, + 0x75,0xab,0xd6,0xa8,0x5e,0x21,0xde,0x59,0xb7,0x83,0x84,0xbe,0x35,0x6b,0x90,0xba, + 0x28,0xad,0xc0,0xa4,0x1a,0x86,0xa4,0x6,0xdd,0xd3,0x30,0x94,0xae,0x27,0x50,0xf7, + 0xe3,0x53,0x30,0xd4,0xd6,0x2d,0x70,0x9c,0x8b,0x2,0x43,0xcd,0xcd,0x28,0xe3,0x38, + 0xfd,0x67,0xe0,0x9e,0x14,0x29,0x18,0x4a,0xa2,0x49,0x29,0xa7,0xb9,0x4d,0x74,0x56, + 0x8a,0x42,0x7d,0xc7,0x17,0x83,0x49,0x41,0x9c,0xdf,0x51,0x66,0x95,0xba,0x5c,0x18, + 0xdf,0x3,0x1d,0xc,0x56,0x3a,0x6,0x41,0x7d,0x4b,0x5c,0xc,0x84,0x62,0x9d,0xbd, + 0xbb,0x88,0x2c,0x73,0x81,0xf2,0x58,0x34,0x27,0x10,0xf,0xf8,0x52,0x8d,0xf4,0xc2, + 0xc0,0x65,0x52,0xc2,0x5,0x2,0xc9,0xe5,0x0,0x9f,0xac,0xeb,0xaa,0x8c,0x31,0x47, + 0x90,0xb7,0x4a,0x57,0x97,0x6a,0x46,0x4c,0xd5,0x5d,0x61,0xf5,0x46,0xf9,0x1,0x14, + 0xf6,0x76,0x2f,0x58,0xb7,0x32,0x2e,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /home/mccad/Desktop/images/wzoom.png + 0x0,0x0,0x1,0x8d, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x54,0x49,0x44,0x41,0x54,0x58,0x85,0xcd,0x97,0xdd,0x91,0x83,0x30, + 0xc,0x84,0xd7,0x37,0xd4,0x90,0x1e,0xac,0x26,0xe,0x9a,0x48,0x11,0xa9,0xc2,0xd7, + 0x44,0x8a,0x48,0x13,0xf8,0x9a,0x30,0x3d,0xa4,0x9,0xdd,0x83,0x4f,0x10,0xc,0xc, + 0xc8,0x40,0x9c,0x7d,0xc9,0x8c,0x7f,0xa2,0xf,0x59,0x5a,0x8f,0xd,0x33,0x33,0xa, + 0xaa,0x2,0x0,0x63,0x7e,0xde,0x1e,0x38,0x84,0x2b,0x88,0x28,0x2,0xc8,0x80,0x56, + 0xd6,0x5a,0x74,0x5d,0xa7,0xde,0x47,0xf4,0x80,0xf7,0x1e,0x0,0xf0,0xa5,0xde,0x7d, + 0xb0,0x8a,0x3,0x54,0x6b,0xb,0x88,0x6e,0x93,0xb1,0x10,0xee,0xe7,0x3,0xc,0x81, + 0xdd,0xe2,0x1c,0x73,0x7b,0x3c,0x40,0x1a,0x98,0xf9,0x7b,0xb2,0xc9,0x18,0xf7,0xff, + 0xfb,0xb,0xc0,0xed,0xca,0xc8,0x8,0x20,0x6,0x5f,0xe,0x2c,0x92,0x39,0x1,0x20, + 0xba,0x65,0x43,0x24,0x45,0xb8,0x1e,0x7c,0xe,0x64,0x8f,0x7a,0x80,0xe1,0x5c,0x75, + 0x7f,0x1a,0xd7,0xbb,0xd9,0x62,0x55,0x1,0x94,0xd2,0xb,0x80,0xcb,0x4e,0xe9,0x9e, + 0x2c,0x7c,0x52,0x6,0xca,0x68,0xd5,0x9,0xb5,0xb2,0xd6,0x96,0x5,0xd0,0xde,0x8e, + 0xa3,0x22,0x8c,0xc6,0xa2,0xd7,0x1e,0x47,0x2c,0x5e,0x3,0x3d,0x80,0xd0,0x6b,0xb3, + 0x20,0x5f,0xef,0x7d,0xde,0xc5,0x34,0x6b,0xc5,0x5b,0x21,0x5e,0xd7,0xd5,0x75,0x83, + 0xe7,0x53,0x57,0x80,0x40,0x52,0x84,0x21,0xdc,0x7b,0x33,0x91,0x1b,0x6f,0xfe,0x36, + 0x94,0xc0,0x6e,0x34,0x5e,0xd7,0xd,0xbc,0x6f,0x71,0xb9,0x6c,0x2f,0xc4,0x49,0x17, + 0xc8,0x51,0xa4,0x20,0x63,0xc9,0x98,0xa4,0xbd,0xc9,0x86,0x58,0x6c,0xc3,0x14,0x64, + 0x6e,0xce,0xda,0xd8,0x76,0x44,0x6d,0x36,0xc4,0xaa,0xf,0x6c,0x69,0xad,0x10,0xf2, + 0x21,0xe,0x6b,0xc3,0x10,0x3a,0xc,0x47,0x32,0x40,0xac,0x15,0xe6,0xa1,0x3e,0x90, + 0x3,0x71,0xb8,0x11,0x69,0x21,0x4e,0x71,0x42,0xd,0x44,0x5f,0x84,0x44,0x8f,0x13, + 0x50,0xea,0x4,0x62,0xfa,0x6,0xad,0x80,0xf8,0x2e,0x94,0xb7,0xda,0xbb,0x65,0x98, + 0x99,0x8d,0x31,0x45,0x82,0x3,0xc0,0x1f,0x67,0xc4,0x9b,0xa1,0x4b,0x7a,0x92,0x78, + 0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/material.png + 0x0,0x0,0x1,0x25, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x10,0x0,0x0,0x0,0xf,0x8,0x6,0x0,0x0,0x0,0xed,0x73,0x4f,0x2f, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8e,0x7c,0xfb,0x51,0x93, + 0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83, + 0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe8,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60, + 0x0,0x0,0x3a,0x97,0x0,0x0,0x17,0x6f,0x97,0xa9,0x99,0xd4,0x0,0x0,0x0,0xb0, + 0x49,0x44,0x41,0x54,0x78,0x9c,0x62,0xfc,0xff,0xff,0x3f,0x3,0x25,0x0,0x20,0x80, + 0x58,0xf0,0x4b,0x33,0xe2,0x30,0xfd,0x3f,0x23,0x8c,0x5,0x10,0x40,0x78,0xc,0x0, + 0x69,0x46,0x28,0xc4,0x25,0x7,0x10,0x40,0x4c,0xa4,0x6b,0x86,0xb9,0x0,0xe2,0x3a, + 0x80,0x0,0xc2,0x61,0x0,0xcc,0x10,0xc2,0xae,0x3,0x8,0x20,0x4c,0x2f,0x30,0x2, + 0x25,0xff,0xc3,0x6c,0xc0,0x61,0x8,0x48,0x2b,0x54,0x6,0x20,0x80,0xb0,0x87,0x1, + 0xd8,0x10,0xa8,0x42,0x2,0x0,0x20,0x80,0x58,0xc0,0x8a,0xf1,0xd9,0x42,0xc0,0x10, + 0x80,0x0,0xc2,0x13,0x6,0xc4,0x1,0x80,0x0,0x62,0x81,0xf8,0x17,0xd9,0x66,0xa8, + 0x8b,0x88,0xf4,0x2,0x40,0x0,0x61,0xf,0x3,0x58,0x20,0xe2,0x8a,0x7,0x24,0x83, + 0x1,0x2,0x8,0xd3,0x80,0xff,0x88,0x38,0xc6,0x99,0x16,0xfe,0x23,0xc2,0xd,0x20, + 0x80,0xf0,0x84,0x1,0x71,0x9,0x9,0x20,0x80,0x70,0x18,0x80,0xec,0xa,0x6c,0x0, + 0x91,0x90,0x0,0x2,0x8,0x4f,0x5e,0xc0,0x67,0x8,0xc2,0x75,0x0,0x1,0x6,0x0, + 0x8c,0x88,0x32,0x2d,0xb6,0x60,0x6,0x89,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/leftarrow.png + 0x0,0x0,0x2,0xb5, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x47,0x49,0x44,0x41,0x54,0x48,0xc7,0xdd, + 0x95,0xbd,0x6b,0x53,0x61,0x14,0xc6,0x7f,0xcf,0x7b,0x6f,0x62,0x62,0x5b,0x63,0x45, + 0x7,0x11,0x45,0xdb,0x4a,0xa3,0xd0,0xae,0x5d,0xba,0xe8,0x50,0x5d,0x4,0xab,0xc5, + 0xf,0xa8,0x5d,0xb4,0x9d,0x4,0x8b,0x8b,0xd0,0xc9,0x3f,0x43,0xc5,0x41,0xe8,0xa4, + 0x82,0x5,0x7,0x45,0x10,0x95,0x22,0x38,0x75,0xe8,0xe6,0x52,0x8b,0x83,0xa8,0x68, + 0x31,0x4d,0xdb,0x24,0xb4,0x37,0x39,0xe,0xb9,0xb9,0xbd,0x8d,0x31,0x29,0x42,0x17, + 0xf,0x3c,0xbc,0xe7,0x7e,0x3c,0xcf,0x39,0xef,0x79,0xcf,0x3d,0x57,0x66,0xc6,0x4e, + 0x98,0x63,0x87,0xec,0x3f,0x15,0x96,0x34,0x24,0x69,0x46,0xd2,0x19,0x49,0x4e,0x92, + 0x5a,0x92,0xcc,0xac,0x29,0x80,0xa1,0x4c,0x67,0xd2,0x2e,0x4e,0xb4,0x1b,0xf0,0x1c, + 0x48,0x1,0x5e,0x2b,0x9e,0x6b,0x91,0x69,0x7f,0x72,0x97,0x7b,0x75,0xe5,0x46,0x96, + 0x43,0xdd,0x5,0x80,0x73,0xc0,0x6e,0xc0,0xff,0xe7,0x52,0x48,0xba,0x90,0x6e,0xf3, + 0xe7,0x47,0xc6,0x7a,0xe9,0xca,0xa,0xdf,0x8f,0xda,0x72,0x9,0x28,0x49,0xb2,0x3a, + 0xdc,0x97,0xe4,0xd7,0xca,0xa4,0x46,0x7d,0x2c,0xa9,0xbf,0xad,0x23,0x31,0x3f,0x3e, + 0xd9,0xc7,0xd1,0xde,0xa,0xcb,0x6b,0x9f,0x29,0xad,0xe7,0x48,0xa7,0xf7,0xb2,0x3f, + 0xd3,0x8d,0x44,0x4,0x4,0x5f,0x7f,0xce,0x71,0x77,0xdc,0x0,0xf6,0x0,0x45,0x33, + 0xb,0xfc,0x6,0xa2,0xe7,0x9d,0xd3,0xcc,0xf0,0xd5,0x1e,0x8e,0xf4,0x4,0xfc,0xca, + 0x2f,0x50,0x2e,0x17,0xf0,0x1d,0x4,0xeb,0x39,0xbe,0x2f,0xcd,0x21,0x57,0xdd,0xaa, + 0x5c,0x15,0x5f,0x16,0x22,0x7a,0x3b,0xb0,0x1,0x6c,0x15,0x96,0x74,0x36,0xd3,0x99, + 0x9c,0xb9,0x7e,0xb3,0x8f,0xae,0xac,0xb1,0xbc,0xba,0x88,0xca,0x45,0x3c,0x7,0x4e, + 0x55,0x11,0xe7,0x40,0xc4,0x7c,0x81,0xbf,0x59,0xd0,0x34,0x90,0x27,0x7e,0x8,0x92, + 0x3a,0x52,0x29,0xef,0xe5,0xd8,0xc4,0x9,0x8e,0x1d,0x5f,0x27,0x97,0xfb,0x44,0xb9, + 0x52,0x88,0xc8,0x71,0x51,0x17,0x13,0x55,0x18,0x34,0x34,0xbf,0x76,0x6e,0xf1,0x8c, + 0x85,0x8c,0xec,0xc9,0xa,0xcb,0x2b,0x8b,0x58,0xb8,0xfd,0x78,0x3d,0x5d,0x3,0x51, + 0xb9,0x2d,0x19,0xff,0xd9,0x15,0x66,0x96,0x2f,0x15,0x2b,0xf,0x1e,0x4f,0x7f,0xa4, + 0xbc,0xb1,0x86,0xe7,0xc0,0x57,0x8,0x17,0x5b,0xeb,0xfc,0x84,0x3,0x4f,0xad,0xdb, + 0x6d,0x6a,0xf6,0xf5,0xc6,0xa3,0x17,0xcf,0xc,0x67,0x55,0x42,0x2d,0x40,0x22,0x26, + 0xe2,0xb9,0xf0,0x7e,0x2c,0x48,0xbd,0xd5,0x77,0x45,0xe,0xb8,0xfd,0x61,0x16,0xcf, + 0x73,0x76,0x6d,0xf8,0x52,0x95,0xe8,0x14,0x96,0x20,0xb6,0xfd,0xea,0xb5,0x70,0x5e, + 0xf5,0x9d,0xa6,0xc2,0x66,0x56,0x96,0xb4,0x2,0x4c,0xbe,0x7f,0x87,0x9c,0x18,0x1d, + 0xb9,0xc,0x5e,0x2,0x7e,0x7c,0x83,0xc2,0x2a,0x98,0x36,0x6b,0x5c,0x5b,0x8b,0x6b, + 0x91,0x44,0x0,0x54,0xfe,0x3a,0x2b,0xc2,0x80,0xfb,0x80,0xe9,0x53,0xa7,0xb1,0x7b, + 0xf,0xb1,0x3b,0x53,0x18,0x34,0xc5,0x53,0xe0,0x20,0x90,0x32,0xb3,0xc6,0xdf,0xbc, + 0x99,0x5,0x92,0xf2,0xc0,0xad,0xb7,0x6f,0xc0,0x39,0x46,0x7,0x6,0xa2,0xc7,0x83, + 0xc0,0xa,0x50,0x8a,0x51,0x2,0xa0,0x8,0xac,0x86,0x3e,0xad,0x26,0x5b,0x94,0xf9, + 0xe0,0x20,0x6,0x3c,0x1,0xba,0x80,0x3,0x40,0x47,0xc,0x6d,0xe1,0xd4,0xf3,0xa3, + 0x31,0xb1,0x8d,0xb1,0x59,0x13,0x9f,0x2,0xe,0x87,0xf3,0x20,0xd9,0x8a,0xa7,0xed, + 0xfc,0x4c,0x25,0xf9,0x80,0x17,0xb6,0x67,0x19,0x8,0xcc,0xac,0xd2,0x8c,0xf3,0x1b, + 0x9f,0xf3,0x34,0x4f,0x8f,0xf9,0xca,0x81,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/VG.png + 0x0,0x0,0x4,0x45, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x32,0x0,0x0,0x0,0x32,0x8,0x6,0x0,0x0,0x0,0x1e,0x3f,0x88,0xb1, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xd6,0x0,0xd6,0x0,0xd6,0x19,0x42, + 0xf,0xe5,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0, + 0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7, + 0xd8,0x4,0x1c,0x9,0x17,0x13,0x53,0x1a,0x84,0xc2,0x0,0x0,0x3,0xd2,0x49,0x44, + 0x41,0x54,0x68,0xde,0xdd,0x9a,0xdb,0x4e,0xfa,0x4a,0x14,0xc6,0x3f,0xb0,0x16,0x41, + 0x2d,0x1e,0x30,0x44,0xa3,0x21,0x12,0x8c,0x67,0x4c,0x88,0x26,0x24,0x34,0x4a,0x14, + 0x34,0x94,0x20,0xd1,0xf8,0x28,0xbe,0x83,0xf1,0x51,0xbc,0xf2,0x44,0xf1,0x4a,0xc5, + 0xa8,0xd7,0xc6,0x13,0x46,0x45,0x7d,0x0,0x95,0xa0,0xde,0xa9,0xf8,0xdf,0x57,0x3b, + 0xd9,0xff,0x3d,0x33,0xd8,0x96,0x69,0x25,0xce,0xe5,0xc7,0x2a,0xf4,0xd7,0x59,0x6b, + 0xbe,0xd5,0x15,0x6c,0xf9,0x7c,0xfe,0xf,0x7e,0xc1,0xb2,0xff,0x6,0x88,0x5c,0x2e, + 0x7,0xe1,0xbf,0x42,0x36,0x9b,0xc5,0xf2,0xf2,0x32,0x11,0xd8,0xdb,0xdb,0xb,0x55, + 0x55,0x2d,0xbb,0xb1,0xa5,0xa5,0x25,0xe4,0xf3,0x79,0x42,0x5f,0x5d,0x5d,0x45,0x2a, + 0x95,0xfa,0x7e,0x47,0x62,0xb1,0x18,0x24,0x49,0x22,0x82,0x1e,0x1e,0x1e,0x70,0x7a, + 0x7a,0x6a,0x9,0xc4,0xed,0xed,0x2d,0x15,0xa2,0xb1,0xb1,0x11,0xf1,0x78,0x5c,0x5b, + 0x6a,0x89,0xa2,0x8,0x45,0x51,0xa8,0x81,0x1b,0x1b,0x1b,0x96,0x80,0xac,0xaf,0xaf, + 0x53,0x75,0x45,0x51,0xd0,0xd0,0xd0,0xa0,0xbd,0x46,0x16,0x17,0x17,0xa9,0x81,0xd9, + 0x6c,0x16,0xef,0xef,0xef,0xa6,0x42,0x7c,0x7e,0x7e,0x22,0x93,0xc9,0x50,0x3f,0x63, + 0xdd,0x17,0x13,0x64,0x64,0x64,0x4,0x81,0x40,0x80,0x8,0x7c,0x7b,0x7b,0xc3,0xee, + 0xee,0xae,0xa9,0x20,0x47,0x47,0x47,0x78,0x7a,0x7a,0xa2,0xd6,0xe8,0xd8,0xd8,0x98, + 0xfe,0x53,0x8b,0x45,0x6f,0x76,0x7a,0xb1,0xd2,0x6a,0x61,0x61,0xc1,0xd8,0xf1,0x3b, + 0x3f,0x3f,0xf,0x41,0x10,0x8,0xfd,0xf8,0xf8,0x18,0x8f,0x8f,0x8f,0xa6,0x40,0x94, + 0x4a,0x25,0xe4,0x72,0x39,0xf2,0x6,0xed,0x76,0xa4,0xd3,0x69,0x63,0x20,0x6d,0x6d, + 0x6d,0x98,0x9a,0x9a,0x22,0xf4,0xaf,0xaf,0x2f,0x6c,0x6e,0x6e,0x9a,0x2,0xa2,0xaa, + 0x2a,0x3e,0x3e,0x3e,0x8,0x5d,0x96,0x65,0x74,0x74,0x74,0x18,0x37,0x44,0xd6,0x76, + 0x9a,0x5,0xc2,0x4a,0xdb,0xef,0x8a,0xfc,0x5b,0x90,0xc9,0xc9,0x49,0xb4,0xb7,0xb7, + 0x13,0xfa,0xdd,0xdd,0x1d,0xce,0xcf,0xcf,0xb9,0x7b,0xc7,0xe5,0xe5,0x25,0xa1,0xbb, + 0xdd,0x6e,0x44,0xa3,0xd1,0xea,0x40,0x4,0x41,0x60,0xba,0x28,0xab,0x28,0x79,0xef, + 0x46,0x2a,0x95,0x82,0x28,0x8a,0xd5,0xf7,0x5a,0xac,0x6d,0xdd,0xd9,0xd9,0xe1,0xe6, + 0x29,0xe5,0x72,0x19,0xdb,0xdb,0xdb,0x86,0x4f,0x2b,0x4d,0x20,0x81,0x40,0x0,0xa3, + 0xa3,0xa3,0x84,0xfe,0xf2,0xf2,0x82,0xbd,0xbd,0x3d,0x53,0xbd,0x63,0x60,0x60,0x0, + 0x83,0x83,0x83,0xfc,0xba,0x5f,0xd6,0x53,0xe1,0xe5,0x29,0xd5,0x78,0x87,0x2e,0x10, + 0x45,0x51,0xa8,0x79,0xca,0xc3,0x53,0x4a,0xa5,0x12,0xf6,0xf7,0xf7,0x9,0xbd,0xbe, + 0xbe,0x9e,0x59,0x9f,0x86,0x41,0x24,0x49,0x42,0x2c,0x16,0xd3,0x95,0xdb,0x5a,0x57, + 0x36,0x9b,0xa5,0x7a,0x47,0x34,0x1a,0x45,0x4b,0x4b,0xb,0xff,0x17,0x2b,0xb3,0x5a, + 0x96,0x6a,0xbd,0x43,0x37,0x48,0x38,0x1c,0x46,0x67,0x67,0x27,0xa1,0x17,0xa,0x5, + 0xea,0xf9,0xaf,0x65,0x15,0xa,0x5,0x5c,0x5c,0x5c,0x10,0xba,0xc7,0xe3,0x81,0x2c, + 0xcb,0xe6,0x80,0x54,0xea,0x77,0x8c,0x7a,0xa,0x6b,0x37,0xd2,0xe9,0x34,0xea,0xea, + 0xea,0xcc,0x7b,0x67,0x67,0x9d,0x22,0xaa,0xaa,0xea,0xf6,0x94,0x72,0xb9,0x8c,0xad, + 0xad,0x2d,0x2e,0xa7,0x95,0x6e,0x90,0x9e,0x9e,0x1e,0x8c,0x8f,0x8f,0x53,0x3d,0x85, + 0xd6,0xb5,0x1a,0xf1,0x8e,0x60,0x30,0x8,0xbf,0xdf,0x6f,0xfe,0x14,0x85,0x57,0xd1, + 0xf3,0x2c,0x72,0x43,0x20,0x73,0x73,0x73,0x70,0xb9,0x5c,0x84,0x7e,0x78,0x78,0x88, + 0xe7,0xe7,0x67,0x4d,0xdf,0xc1,0xea,0xa,0x1c,0xe,0x7,0x12,0x89,0x84,0x35,0x20, + 0x4e,0xa7,0x93,0xfa,0x63,0x7a,0x3c,0x85,0xe5,0x1d,0xf1,0x78,0x1c,0xcd,0xcd,0xcd, + 0xd6,0x80,0xf0,0x68,0x59,0x58,0x71,0x46,0x8b,0xdc,0x30,0x48,0x28,0x14,0x82,0xcf, + 0xe7,0x23,0xf4,0x9b,0x9b,0x1b,0xea,0x3c,0x4a,0xcb,0xbb,0x4c,0x57,0x57,0x17,0xc2, + 0xe1,0xb0,0xb5,0x20,0xd5,0xec,0x4a,0x25,0xef,0xb0,0xd9,0x6c,0xd6,0x83,0xa4,0xd3, + 0x69,0xd8,0xed,0xe4,0xa5,0x99,0x4c,0x86,0x9a,0xff,0x66,0x79,0x47,0xd5,0x20,0x5e, + 0xaf,0x17,0x91,0x48,0x84,0xda,0xcd,0x1e,0x1c,0x1c,0x50,0xaf,0x61,0x75,0xcb,0x13, + 0x13,0x13,0xe8,0xee,0xee,0xfe,0x19,0x90,0x4a,0x4f,0x91,0xd5,0xb2,0x98,0xe1,0x1d, + 0x5c,0x40,0xa6,0xa7,0xa7,0xe1,0x76,0xbb,0xa9,0x9e,0x52,0x2c,0x16,0xff,0xd2,0x5e, + 0x5f,0x5f,0xa9,0x53,0x4a,0x97,0xcb,0x85,0xd9,0xd9,0xd9,0x9f,0x5,0x11,0x45,0x11, + 0xc9,0x64,0x92,0xd0,0x69,0xf3,0x5b,0xd6,0xcc,0x2a,0x91,0x48,0xc0,0xe9,0x74,0xfe, + 0x2c,0x48,0xa5,0xb4,0xf8,0x7f,0x7a,0xb1,0x66,0x61,0x3c,0x8a,0x9c,0xb,0xc8,0xd0, + 0xd0,0x10,0xfa,0xfb,0xfb,0x9,0xfd,0xfa,0xfa,0x1a,0x57,0x57,0x57,0x0,0x80,0xfb, + 0xfb,0x7b,0x9c,0x9d,0x9d,0x11,0x31,0x3e,0x9f,0xf,0xa1,0x50,0xa8,0x36,0x40,0xb4, + 0x78,0xa,0xaf,0xe1,0x82,0xe9,0x20,0xa9,0x54,0x8a,0x3a,0xf0,0xfe,0xf7,0x3d,0x85, + 0xe6,0x1d,0x36,0x9b,0x4d,0xd3,0x60,0xda,0x52,0x90,0xd6,0xd6,0x56,0xea,0x58,0xb3, + 0x58,0x2c,0x62,0x65,0x65,0x85,0xea,0x1d,0x91,0x48,0x4,0x5e,0xaf,0xb7,0xb6,0x40, + 0x2a,0x15,0xfd,0xda,0xda,0x9a,0x25,0x69,0xc5,0xd,0x44,0x96,0x65,0x78,0x3c,0x1e, + 0x4d,0xb1,0x92,0x24,0x61,0x66,0x66,0xa6,0x36,0x41,0x4,0x41,0xd0,0x9c,0xf3,0xc9, + 0x64,0x52,0xf3,0x60,0xda,0x72,0x10,0x3d,0xe9,0xc2,0xab,0x25,0x31,0xd,0xc4,0xef, + 0xf7,0x23,0x18,0xc,0x56,0x8c,0xe9,0xeb,0xeb,0xc3,0xf0,0xf0,0x70,0x6d,0x83,0x68, + 0x79,0xda,0x66,0xed,0x6,0x77,0x10,0x45,0x51,0xe0,0x70,0x38,0x98,0x75,0xa4,0x77, + 0x30,0xad,0xab,0x4e,0x79,0x7e,0x59,0x53,0x53,0x13,0x4e,0x4e,0x4e,0xf0,0x13,0xeb, + 0x57,0xfc,0x3b,0xe8,0xaf,0x1d,0xd1,0x3b,0x2d,0xac,0xb5,0xf5,0x6b,0x76,0xe4,0x1f, + 0xae,0x64,0x83,0x40,0x68,0xbf,0x37,0xbc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/new.png + 0x0,0x0,0x2,0xe, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x1,0xa0,0x49,0x44,0x41,0x54,0x48,0xc7,0xb5, + 0xd5,0xcf,0x8b,0x1,0x61,0x18,0xc0,0xf1,0x11,0x49,0x66,0xed,0x75,0x73,0xb2,0x29, + 0x2e,0x6e,0x56,0x2e,0x8a,0xc3,0x72,0xd9,0xda,0x7f,0xf,0x57,0x39,0x50,0x2e,0xca, + 0x45,0xc9,0x41,0xf9,0xd1,0xa8,0x69,0x4a,0xe,0x1c,0x28,0x25,0x49,0x71,0x20,0xa2, + 0xd4,0xb3,0xcf,0xf3,0xf6,0x8e,0xb6,0x99,0x31,0xef,0xcc,0xd6,0x1e,0x3e,0xbd,0xa5, + 0xf7,0xf9,0x9a,0xde,0x78,0x47,0x2,0x0,0xe9,0x3f,0x98,0x3f,0x90,0x24,0xf,0xf2, + 0xa1,0x0,0x92,0x51,0xc8,0xc2,0xb,0xa,0x22,0x3f,0xf2,0x3a,0xd,0xfb,0xa,0x85, + 0x2,0x64,0xb3,0x59,0xc8,0x64,0x32,0x26,0xc9,0x64,0x92,0x36,0x41,0x2e,0x97,0x53, + 0x70,0x7d,0xe3,0x5f,0xe2,0x73,0x12,0xe,0x50,0xf4,0x7e,0xbf,0x5b,0x9a,0x4c,0x26, + 0x2c,0x4c,0xd2,0xe9,0xb4,0x8a,0x6b,0x4,0xbd,0x1a,0xe3,0x56,0x61,0x99,0x9e,0xec, + 0x76,0xbb,0xc1,0xf5,0x7a,0x35,0xd1,0x34,0x8d,0x45,0xcb,0xe5,0x32,0x5b,0x53,0xa9, + 0x94,0x86,0xeb,0xbb,0x31,0x6e,0x15,0xe,0x51,0xf8,0x72,0xb9,0xc0,0xf9,0x7c,0x36, + 0x51,0x55,0x95,0x5,0x2b,0x95,0xa,0x14,0x8b,0xc5,0xdf,0xf1,0x8,0x3f,0x16,0xaf, + 0x6d,0xf8,0x74,0x3a,0xc1,0xf1,0x78,0x34,0x51,0x14,0xe5,0x71,0x14,0x6,0x1f,0xfc, + 0xcc,0xfd,0xb6,0xe1,0xc3,0xe1,0x0,0xfb,0xfd,0xde,0x64,0x3e,0x9f,0xc3,0x70,0x38, + 0x7c,0xa8,0xd7,0xeb,0x7a,0xf8,0x93,0x1f,0x49,0xd0,0x36,0xbc,0xdb,0xed,0x60,0xbb, + 0xdd,0xa,0xf5,0xfb,0x7d,0x3d,0xfc,0x85,0x62,0x74,0x1c,0xb6,0xe1,0xcd,0x66,0x3, + 0xeb,0xf5,0x5a,0xa8,0xd7,0xeb,0xe9,0xe1,0x6f,0x14,0xa7,0x79,0xdb,0xf0,0x6a,0xb5, + 0x82,0xe5,0x72,0x29,0xd4,0xe9,0x74,0xdc,0x85,0x17,0x8b,0x5,0x3b,0x4f,0x91,0x76, + 0xbb,0xed,0x2e,0x3c,0x9b,0xcd,0x60,0x3a,0x9d,0xa,0xb5,0x5a,0x2d,0x77,0x61,0x1a, + 0xa2,0x3f,0x83,0x48,0xb3,0xd9,0x74,0x17,0xa6,0xa1,0xf1,0x78,0x2c,0xd4,0x68,0x34, + 0xdc,0x85,0x69,0x68,0x30,0x18,0x8,0xd5,0x6a,0x35,0x77,0xe1,0xd1,0x68,0xc4,0x7e, + 0x4a,0x22,0xd5,0x6a,0xd5,0x79,0x38,0x91,0x48,0x40,0xb7,0xdb,0x65,0xf7,0x81,0x48, + 0xa9,0x54,0x72,0x1c,0x96,0x9f,0xdc,0x5,0x22,0x79,0x14,0xa5,0xf9,0xa7,0xf7,0x31, + 0xa,0xf3,0x4b,0x25,0xcf,0x9f,0x44,0x24,0xcf,0xf7,0xd3,0x5c,0xe0,0xe9,0x1b,0x84, + 0xbf,0x7e,0xc2,0xfc,0x9,0xe2,0xe,0x44,0xf9,0xfe,0x90,0x7e,0x27,0xff,0xf5,0x9d, + 0x67,0x24,0xf3,0xfd,0x34,0xe7,0xa1,0xce,0xf,0xab,0x58,0x8,0xd0,0xc3,0x4c,0xf8, + 0xc6,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/viewall.png + 0x0,0x0,0x1,0x8e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x2,0x0,0x0,0x0,0x6f,0x15,0xaa,0xaf, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a, + 0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0xa,0x7,0xb,0x9, + 0x31,0xa2,0xcb,0x93,0xcd,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d, + 0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74, + 0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0xfb,0x49,0x44, + 0x41,0x54,0x38,0xcb,0x63,0xfc,0xf1,0xe3,0x7,0x3,0xc5,0xe0,0xd1,0xa3,0x47,0x2c, + 0xc,0xc,0xc,0xf7,0xee,0xdd,0xa3,0xd0,0x20,0x67,0x67,0x67,0x26,0x6,0x2a,0x81, + 0x51,0x83,0x8,0x3,0x16,0x8,0xc5,0x13,0x1e,0xfe,0xff,0xeb,0x57,0x34,0xb9,0xe9, + 0x61,0x61,0x7,0x67,0xcf,0x9e,0x7b,0xf8,0x30,0x3,0x3,0xc3,0xa2,0x45,0x8b,0x8e, + 0xa7,0x6d,0xc3,0xd4,0xff,0x64,0xde,0xeb,0xbb,0x2d,0xcf,0x25,0x25,0x25,0x19,0x7f, + 0xfc,0xf8,0xe1,0x28,0x23,0xf3,0xff,0xcb,0x17,0x4c,0x45,0xab,0x54,0x55,0xc3,0x6e, + 0xdf,0x9e,0x77,0xee,0x1c,0x3,0x3,0x83,0x96,0x96,0x16,0x56,0x87,0xd8,0xdf,0xd3, + 0x3b,0xa8,0x74,0x49,0x52,0x52,0x92,0x85,0x81,0x81,0x61,0x5,0x1f,0x1f,0x3,0x1f, + 0x1f,0x9a,0x8a,0xf0,0x67,0xcf,0x90,0xdd,0x68,0x7f,0x4f,0xf,0xd3,0x94,0x83,0x4a, + 0x97,0x46,0x50,0xac,0xa1,0x1,0xf9,0x7b,0xf7,0xe0,0x24,0x5a,0x30,0x63,0xd,0x2c, + 0xec,0x6,0xc9,0xdf,0xbb,0xa7,0x97,0x81,0x25,0x1b,0x5f,0x9a,0xa1,0xa4,0x97,0x71, + 0x8f,0x81,0x21,0x80,0x58,0xaf,0x61,0x35,0x5,0x97,0xf8,0x41,0xa5,0x4b,0xd7,0xae, + 0x5d,0x83,0xba,0x28,0xfc,0xd9,0x33,0xe2,0xc3,0x2,0x39,0xca,0x19,0x18,0x18,0x20, + 0xa6,0x40,0xd,0x82,0x24,0x39,0x38,0x88,0x98,0x84,0xcf,0x20,0xb8,0xce,0xd1,0x62, + 0x4,0x3b,0x58,0x91,0xf7,0x83,0xa,0x6,0x5d,0x9a,0xa1,0x84,0x47,0x96,0xf1,0xd6, + 0xad,0x5b,0xf6,0xf6,0xf6,0x94,0x7b,0xd,0x0,0x0,0x1b,0x59,0x4f,0x32,0x9a,0xc5, + 0x9a,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/find.png + 0x0,0x0,0x3,0x50, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0xe2,0x49,0x44,0x41,0x54,0x48,0xc7,0xbd, + 0x95,0x5d,0x48,0x93,0x51,0x18,0xc7,0x8f,0x5e,0x58,0x6a,0x9a,0x37,0x81,0x85,0x5e, + 0x78,0xe1,0x95,0x5d,0x4,0xc1,0x8a,0xc2,0xd7,0x61,0x50,0xe0,0x57,0x19,0x31,0x61, + 0x9,0xc2,0x86,0xe1,0x10,0x1c,0xc8,0x18,0xe2,0x45,0x49,0x5e,0x78,0x93,0x91,0xc3, + 0xb1,0x26,0x7e,0x80,0xc3,0xef,0x79,0x95,0xe0,0x84,0x4,0x15,0x9b,0x9a,0xaf,0x5f, + 0xe9,0x50,0xd8,0xc4,0x57,0x10,0x11,0xac,0x45,0x6b,0x63,0xb6,0x6,0xff,0xce,0x39, + 0xb8,0xe1,0xdc,0xb4,0x21,0xd4,0xb,0x3f,0x5e,0x78,0xcf,0x73,0x7e,0xe7,0x39,0xcf, + 0x73,0xe,0x2f,0x1,0x40,0xfe,0x5,0xe4,0xbf,0x8b,0xe9,0x83,0xbf,0x71,0x61,0x71, + 0x30,0x18,0x8c,0x20,0x10,0x8,0xe0,0xe0,0xe0,0x0,0xa3,0xa3,0xa3,0xc8,0xc9,0xc9, + 0x39,0x57,0x7e,0xae,0x98,0x89,0x4e,0x72,0x74,0x74,0x84,0xfd,0xfd,0x7d,0x58,0xad, + 0x56,0x94,0x95,0x95,0x41,0xa7,0xd3,0x9d,0x29,0x3f,0x2d,0x93,0x53,0xcc,0x14,0x89, + 0x4d,0x50,0xab,0xd5,0x98,0x98,0x98,0x80,0xdf,0xef,0xe7,0xf8,0x7c,0x3e,0xec,0xed, + 0xed,0x61,0x78,0x78,0x18,0xa5,0xa5,0xa5,0x70,0xb9,0x5c,0xa8,0xab,0xab,0x8b,0x29, + 0x3f,0x29,0x55,0xdf,0xb8,0x2d,0x47,0x7e,0xa3,0x19,0xca,0xf,0x12,0xc7,0xf8,0xde, + 0xc,0xa1,0x40,0xe,0xa3,0xd1,0x8,0xaf,0xd7,0xb,0x8f,0xc7,0x83,0xdd,0xdd,0x5d, + 0xc,0xc,0xc,0x70,0xf1,0xea,0xea,0x2a,0xa7,0xa6,0xa6,0x26,0x4a,0x1e,0xce,0x94, + 0x49,0x9f,0x5a,0x44,0xbc,0x10,0x11,0xc6,0x1f,0x4,0x3e,0x7d,0x16,0xb9,0x7c,0x6c, + 0x6c,0xc,0x6e,0xb7,0x1b,0xdb,0xdb,0xdb,0xe8,0xef,0xef,0x47,0x49,0x49,0x9,0x66, + 0x67,0x67,0xc3,0xa8,0x54,0xaa,0x8,0x79,0x48,0x6c,0x66,0x99,0x9e,0x94,0x32,0x7c, + 0x54,0xec,0xfd,0xd,0x18,0x4c,0x66,0x54,0x55,0x55,0xe1,0xf0,0xf0,0x90,0x6f,0x7f, + 0x70,0x70,0x10,0x15,0x15,0x15,0xe8,0xed,0xed,0x8d,0xa0,0xbc,0xbc,0x3c,0x2c,0xf, + 0x89,0x25,0xb6,0xf5,0xd3,0xe2,0x9f,0x54,0xea,0xa1,0x38,0x5c,0x12,0xb2,0xb2,0xb2, + 0xf8,0x89,0x60,0xe2,0xf1,0xf1,0x71,0x8,0x82,0x80,0xbc,0xbc,0x3c,0xe4,0xe6,0xe6, + 0x86,0xc9,0xce,0xce,0x8e,0x4f,0xfc,0x23,0x0,0x7c,0xa7,0x7c,0x39,0x16,0xb3,0xc6, + 0x49,0x92,0x84,0x95,0x95,0x15,0x5e,0x1a,0x8b,0xc5,0x82,0xee,0xee,0x6e,0x74,0x75, + 0x75,0x71,0xf4,0x7a,0x7d,0x94,0x38,0x66,0x29,0xdc,0xbf,0x80,0x6f,0x94,0xb7,0x46, + 0xda,0x50,0xa5,0x92,0x37,0x6e,0x67,0x67,0x87,0x67,0xed,0x70,0x38,0xb0,0xb6,0xb6, + 0xc6,0x17,0x9,0xd1,0xd9,0xd9,0x19,0x25,0x8e,0xd9,0xbc,0xaf,0x54,0xfa,0xd1,0x2e, + 0xe2,0xbe,0x20,0xe7,0x47,0x6f,0x6e,0x6e,0x8e,0x4b,0x43,0x38,0x9d,0xce,0x8,0xfa, + 0xfa,0xfa,0x22,0xc5,0x67,0x1d,0xb7,0x37,0x34,0xd3,0x7b,0x42,0x1,0x64,0x32,0x19, + 0x1e,0xc9,0x32,0x91,0x9e,0x92,0x80,0x86,0x86,0x6,0x6c,0x6c,0x6c,0x60,0x73,0x73, + 0x13,0x5b,0x5b,0x5b,0x11,0xb0,0x6,0x46,0x89,0x63,0x5d,0x10,0x85,0x42,0x81,0xca, + 0xca,0x4a,0x14,0xdd,0xbd,0xe,0xeb,0xab,0x5b,0x78,0xfd,0x2c,0x9,0x69,0x97,0x9, + 0xea,0xeb,0xeb,0xb1,0xbc,0xbc,0x8c,0xf5,0xf5,0x75,0xbe,0x48,0x88,0x9e,0x9e,0x9e, + 0xd8,0xe2,0xd3,0x57,0x9a,0xd5,0xd1,0x66,0xb3,0x21,0x23,0x35,0x11,0x8d,0x8f,0x93, + 0xf0,0xee,0x79,0x22,0xf4,0x45,0x4,0x57,0x53,0x8,0xb4,0x5a,0x2d,0x16,0x17,0x17, + 0x79,0x6d,0x59,0xad,0x19,0xac,0x81,0x71,0x89,0x59,0xb0,0x28,0x8a,0x3c,0xc3,0xf4, + 0x64,0x2,0xcd,0x3,0x82,0x97,0x4f,0x8,0x54,0x2,0x41,0xea,0x25,0x82,0xa1,0xa1, + 0x21,0xcc,0xcf,0xcf,0xf3,0x98,0xa5,0xa5,0x25,0x74,0x74,0x74,0xc4,0x27,0x66,0xc1, + 0x6c,0x22,0xbb,0x59,0xb5,0xb5,0xb5,0xb8,0x42,0xcb,0xa0,0xb8,0x43,0xf0,0xf0,0x26, + 0x41,0x66,0x6,0x41,0x75,0x75,0x35,0xa6,0xa7,0xa7,0x79,0xcc,0xc2,0xc2,0x2,0x4c, + 0x26,0x53,0x7c,0x62,0xb6,0x55,0xbb,0xdd,0xce,0xc5,0x53,0x53,0x53,0xd0,0x68,0x34, + 0x48,0x4e,0x22,0xb8,0x96,0x46,0x50,0x58,0x58,0x88,0x91,0x91,0x11,0x4c,0x4e,0x4e, + 0xf2,0x71,0x16,0xd7,0xde,0xde,0x1e,0x9f,0x78,0x66,0x66,0x6,0x6,0x83,0x81,0xd3, + 0xd6,0xd6,0x86,0xd6,0xd6,0x56,0x7e,0x2a,0x8a,0x8b,0x8b,0xd1,0xd4,0xd4,0x84,0x96, + 0x96,0x16,0xfe,0x8d,0x8d,0xb1,0x98,0xe6,0xe6,0xe6,0xf8,0xc4,0x17,0xe5,0x42,0xff, + 0x3c,0xfa,0x24,0x1c,0x93,0xc8,0xde,0x67,0xc5,0xfd,0x1,0xb1,0xa8,0xf6,0xe3,0x9f, + 0xb0,0x20,0xc8,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/viewselectedonly.png + 0x0,0x0,0x1,0xb8, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a, + 0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0xa,0x7,0xb,0xa, + 0x17,0x5b,0xeb,0x45,0xf3,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d, + 0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74, + 0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x25,0x49,0x44, + 0x41,0x54,0x48,0xc7,0xed,0x95,0x31,0x4e,0xc3,0x30,0x18,0x85,0x1f,0x21,0xc,0x96, + 0xac,0x9c,0xa0,0xd9,0xc8,0x60,0x71,0x87,0x2e,0x3e,0x44,0xd8,0x39,0x17,0xcc,0x88, + 0x91,0x2b,0x74,0x80,0xa9,0x5b,0x95,0x22,0x55,0x41,0x72,0x44,0xa4,0x8c,0x91,0xfe, + 0xca,0x29,0x6d,0x63,0x6,0x94,0x10,0xe1,0xb8,0x2a,0x8,0x8b,0xa5,0x6f,0xf9,0x63, + 0xc9,0x7e,0xdf,0x6f,0x3f,0xcb,0x39,0x6b,0x9a,0xc6,0xc0,0x93,0x94,0x52,0x8,0x1, + 0x20,0xcf,0x73,0x2f,0x0,0x29,0x25,0x2,0x78,0xd6,0x9,0xf0,0xff,0x80,0xb0,0xfb, + 0xe0,0x69,0xa,0xb3,0x5e,0x3b,0x27,0x5e,0xd7,0x35,0x6e,0x67,0xb3,0x7e,0x2c,0x84, + 0x70,0xce,0xdd,0x6f,0x36,0xd0,0xdb,0xed,0x17,0xe0,0x66,0x3a,0x85,0x21,0x72,0x2e, + 0x78,0x48,0x12,0x98,0xb2,0xec,0xc7,0x71,0x1c,0x3,0x0,0x88,0x8,0x9c,0x73,0x10, + 0x11,0x18,0x63,0xd0,0x5a,0x7f,0x36,0xcb,0x39,0x30,0x4,0xdc,0x47,0x11,0x10,0x45, + 0xa3,0xe6,0x69,0x59,0x5a,0x3b,0xe3,0x9c,0x3b,0x2b,0x7d,0x6b,0xf4,0xcf,0x33,0x8, + 0x82,0xc0,0x2f,0xa0,0x6d,0x5b,0xbf,0x0,0xc6,0xd8,0xf1,0x80,0xf7,0x97,0x47,0x3c, + 0x69,0xdd,0xd7,0x8b,0xa4,0x85,0x10,0x2,0xab,0xdd,0x2,0x6f,0xfb,0x57,0xac,0x76, + 0xb,0x6b,0x4d,0x17,0xb4,0x75,0x4d,0xc7,0xcc,0x2f,0xc3,0x2b,0x0,0x70,0xd6,0x31, + 0x75,0x81,0x17,0x45,0xe1,0x6,0x9c,0x4f,0x26,0x7,0x4d,0xe,0x89,0x88,0x7a,0xf3, + 0x1e,0x90,0xe,0xee,0x38,0x0,0x98,0xba,0xc6,0xf3,0xf,0xc,0x87,0xdd,0x57,0x55, + 0x65,0x1f,0xd1,0xdd,0x7c,0xfe,0xeb,0x50,0x87,0xdd,0x9e,0x5e,0x53,0x5b,0xc6,0xf8, + 0x5,0x64,0xcb,0xa5,0x3f,0x40,0x96,0x65,0xc7,0xfd,0xf,0x94,0x52,0x90,0x52,0x7a, + 0xcb,0xe0,0x3,0xc4,0xd9,0x76,0x79,0xed,0x2e,0xcd,0x6d,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/icon.png + 0x0,0x0,0x18,0x79, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x92,0x0,0x0,0x0,0x92,0x8,0x2,0x0,0x0,0x0,0x21,0x19,0x4,0xd9, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a, + 0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xd9,0xa,0x7,0xa,0x2b, + 0xa,0xb5,0xb0,0x56,0xfe,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d, + 0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74, + 0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x17,0xe6,0x49,0x44, + 0x41,0x54,0x78,0xda,0xed,0x9d,0x77,0x40,0x53,0xd7,0x1e,0xc7,0x6f,0x42,0x8,0x84, + 0xbd,0x22,0x24,0x20,0xd3,0x80,0x28,0x86,0xa9,0x88,0x5,0x65,0x85,0xa5,0x82,0x60, + 0x91,0x16,0x51,0x7c,0xe,0xac,0x6d,0xb5,0xe3,0xa9,0xef,0x95,0x5a,0xab,0x45,0x4b, + 0x1d,0x88,0x5a,0xa5,0xa8,0x60,0x59,0x1a,0xad,0x58,0x95,0x51,0x7,0x48,0x45,0x11, + 0x64,0x83,0xc8,0x94,0xbd,0x5,0x42,0x8,0x64,0x90,0xfd,0xfe,0xb8,0x96,0x2a,0x23, + 0xde,0x28,0xbe,0x5a,0x7a,0xbe,0x7f,0xc1,0xbd,0x67,0xde,0xcf,0x3d,0xf7,0x9c,0xf3, + 0x3b,0xbf,0x73,0x82,0x12,0x8b,0xc5,0x10,0xd0,0xdf,0x4d,0x68,0xf0,0x8,0x0,0x36, + 0x20,0x80,0xd,0x8,0x60,0x3,0xd8,0x80,0x0,0x36,0x20,0x80,0xd,0x60,0x3,0x2, + 0xd8,0x80,0x0,0x36,0x20,0x80,0xd,0x60,0x3,0x2,0xd8,0x80,0x0,0x36,0x80,0xd, + 0x8,0x60,0x3,0x2,0xd8,0x0,0x36,0x20,0x80,0xd,0x8,0x60,0x3,0x2,0xd8,0x0, + 0x36,0x20,0x80,0xd,0x8,0x60,0x3,0xd8,0x80,0x0,0x36,0x20,0x80,0xd,0x60,0x3, + 0x2,0xd8,0x80,0x0,0x36,0x20,0x80,0xd,0x60,0x3,0x2,0xd8,0x80,0x0,0x36,0x80, + 0xd,0x8,0x60,0x3,0x2,0xd8,0x0,0x36,0x20,0x80,0xd,0x8,0x60,0x3,0x2,0xd8, + 0x66,0x82,0x30,0xef,0x42,0x21,0x84,0x42,0x61,0x4f,0x4f,0x4f,0x6f,0x6f,0x6f,0x5f, + 0x5f,0x5f,0x4f,0x4f,0x4f,0x77,0x77,0x37,0x8d,0x46,0x63,0x32,0x99,0x6c,0x36,0xdb, + 0xc5,0xc5,0x65,0xcb,0x96,0x2d,0xaf,0x97,0xec,0xdd,0xbb,0x77,0x8f,0x1d,0x3b,0x86, + 0xe4,0x98,0x23,0xb1,0x58,0x8c,0xc3,0xe1,0x4e,0x9d,0x3a,0x45,0x24,0x12,0x1f,0x3c, + 0x78,0x10,0x15,0x15,0x85,0x46,0xa3,0x25,0x87,0x97,0x91,0x91,0x89,0x8e,0x8e,0x9e, + 0x3d,0x7b,0x36,0x4,0x41,0xa7,0x4f,0x9f,0xce,0xca,0xca,0x92,0x1c,0xe5,0xb5,0x25, + 0x12,0x89,0x9c,0x9d,0x9d,0x3f,0xff,0xfc,0xf3,0xf1,0x25,0xf8,0xab,0xd4,0xd6,0xd6, + 0x76,0xec,0xd8,0xb1,0xd0,0xd0,0x50,0x32,0x99,0xac,0xa2,0xa2,0x32,0x69,0xa1,0x43, + 0x42,0x42,0x5e,0x2f,0xf1,0x92,0x92,0x12,0xd,0xd,0xd,0xe4,0x4f,0x27,0x2a,0x2a, + 0xa,0x8e,0x98,0x98,0x98,0x88,0x30,0xca,0xe3,0xc7,0x8f,0xe1,0x28,0xc1,0xc1,0xc1, + 0x6f,0xf5,0xb5,0x5e,0xbd,0x7a,0xf5,0xb8,0xda,0xfd,0x95,0xad,0xad,0xb5,0xb5,0xf5, + 0xcb,0x2f,0xbf,0x94,0x1c,0x46,0x5e,0x5e,0xfe,0x35,0x52,0xae,0xaf,0xaf,0xf,0x8, + 0x8,0x18,0x1c,0x1c,0x44,0x18,0x7e,0xeb,0xd6,0xad,0x63,0x25,0x91,0x95,0x95,0x45, + 0x12,0x45,0x46,0x46,0x66,0xac,0x79,0xbd,0x5e,0x21,0x91,0x6b,0x62,0xfa,0x7f,0x65, + 0xdf,0x46,0x26,0x93,0x75,0x74,0x74,0xa6,0x3d,0xd9,0xae,0xae,0xae,0x55,0xab,0x56, + 0xb5,0xb7,0xb7,0x23,0xc,0xef,0xec,0xec,0x7c,0xf2,0xe4,0x49,0x30,0x24,0x79,0x49, + 0x6c,0x1,0x7f,0xaa,0x5b,0x6a,0x6a,0x6a,0x4b,0x96,0x2c,0x99,0xde,0xec,0x18,0xc, + 0xc6,0xea,0xd5,0xab,0xeb,0xea,0xea,0x10,0x86,0xd7,0xd7,0xd7,0x4f,0x4e,0x4e,0xc6, + 0x62,0xb1,0x0,0xdb,0x73,0x35,0xc,0xd1,0x3e,0xca,0xcd,0x74,0xf8,0xf5,0xe7,0x41, + 0x2e,0x67,0xaa,0x30,0x8e,0x8e,0x8e,0xd3,0x98,0x23,0x97,0xcb,0xd,0x9,0x9,0x29, + 0x2c,0x2c,0x44,0x18,0x5e,0x51,0x51,0x91,0x4a,0xa5,0xea,0xe9,0xe9,0x81,0x91,0x24, + 0x4,0x41,0x50,0x3f,0x87,0x7d,0xb4,0xb2,0xe0,0x6c,0x4d,0xd9,0x10,0x77,0x14,0x82, + 0xa0,0xf3,0xb5,0x15,0x3b,0xad,0x1c,0x26,0xd,0xb9,0x68,0xd1,0xa2,0x69,0xcc,0x37, + 0x2c,0x2c,0x2c,0x23,0x23,0x3,0x79,0xf8,0x93,0x27,0x4f,0x4e,0x7b,0x73,0xff,0xbb, + 0xb6,0xb6,0xc4,0xfa,0x4a,0xbb,0xd4,0xb8,0xc3,0xe5,0xf9,0x30,0x33,0x8,0x82,0x62, + 0xab,0x4b,0x99,0x7c,0xde,0xa4,0x81,0xad,0xad,0xad,0xd,0xd,0xd,0xa7,0x25,0xdf, + 0x9d,0x3b,0x77,0x26,0x25,0x25,0x21,0xf,0xbf,0x6d,0xdb,0xb6,0x8d,0x1b,0x37,0x82, + 0xe9,0x36,0x54,0x43,0xef,0xf7,0xce,0xbc,0xb8,0x21,0x27,0xad,0x9d,0xc9,0x78,0xf1, + 0x7a,0xd3,0x30,0x9d,0xfa,0xf4,0xc9,0xa4,0x51,0x14,0x14,0x14,0x6c,0x6d,0x6d,0xdf, + 0x3c,0xeb,0x88,0x88,0x88,0xa8,0xa8,0x28,0xe4,0xe1,0x29,0x14,0x4a,0x74,0x74,0x34, + 0xb0,0x92,0x40,0xe7,0x6a,0xca,0x1c,0xaf,0x25,0xdc,0x6a,0x6f,0x9a,0xf4,0x6e,0x4c, + 0x75,0xa9,0x70,0x8a,0x69,0xaf,0x83,0x83,0xc3,0x1b,0x66,0x9d,0x90,0x90,0xb0,0x77, + 0xef,0x5e,0xe4,0xe1,0x8d,0x8d,0x8d,0x13,0x13,0x13,0xe5,0xe4,0xe4,0xfe,0xd1,0xd8, + 0x7a,0xd8,0xcc,0xb0,0xdc,0xcc,0xb0,0xdc,0x4c,0xfa,0x1f,0x5f,0xc5,0x89,0xaa,0x18, + 0xe8,0x4d,0x6b,0xad,0x9f,0xf4,0x96,0xab,0xab,0xab,0x8c,0x8c,0xcc,0x6b,0xe7,0x9e, + 0x96,0x96,0x16,0x16,0x16,0x86,0x3c,0xbc,0x82,0x82,0xc2,0x85,0xb,0x17,0x8,0x4, + 0xc2,0x34,0x3e,0xc4,0xd1,0xd1,0xd1,0xb7,0xa,0x69,0x62,0xfa,0xd3,0x30,0x24,0x79, + 0xd0,0xd3,0x7e,0xae,0xa6,0xec,0xd5,0x66,0x88,0x8a,0x47,0x7e,0x86,0x66,0x68,0x14, + 0x6a,0xdc,0x75,0x73,0x73,0x73,0x3d,0x3d,0xbd,0xb6,0xb6,0xb6,0xd7,0xc8,0xfa,0xde, + 0xbd,0x7b,0xc1,0xc1,0xc1,0x7c,0x3e,0x1f,0x79,0x94,0x13,0x27,0x4e,0x2c,0x5e,0xbc, + 0x78,0x7a,0x1f,0xeb,0xb6,0x6d,0xdb,0x5c,0x5d,0x5d,0x27,0x1a,0xb7,0x50,0x28,0x54, + 0x43,0x43,0x43,0x64,0x64,0x24,0xc2,0xbe,0x79,0xfe,0xfc,0xf9,0x13,0x4d,0x71,0x22, + 0x91,0x68,0xce,0x9c,0x39,0xd3,0x8f,0x6d,0x8d,0xc9,0xbc,0x87,0xb,0x3a,0x4e,0x56, + 0x15,0x49,0xe,0xf6,0xb0,0xb7,0xe3,0x6e,0x57,0xb,0x45,0xcf,0x78,0xa2,0x9,0xc0, + 0xda,0xda,0xfa,0x35,0xb0,0x3d,0x7e,0xfc,0x78,0xcd,0x9a,0x35,0x2c,0x16,0xb,0x79, + 0x94,0x1d,0x3b,0x76,0x6c,0xde,0xbc,0x79,0xda,0x5b,0x83,0xa3,0xa3,0xe3,0x54,0x33, + 0x99,0xf2,0xf2,0x72,0x84,0xd8,0x2,0x2,0x2,0x90,0xf7,0x17,0xd3,0xd3,0xb7,0x1d, + 0x5d,0x42,0x71,0xd7,0x33,0x7a,0x75,0xb0,0x8a,0x82,0x49,0xfb,0x37,0x4f,0x4f,0x4f, + 0x69,0x73,0x6c,0x6b,0x6b,0xb,0xc,0xc,0xec,0xef,0xef,0x47,0x1e,0xc5,0xc3,0xc3, + 0xe3,0xc8,0x91,0x23,0xff,0xe7,0x4e,0x8,0xf9,0x5b,0xc5,0x66,0xb3,0xff,0xdf,0x43, + 0x12,0x59,0x34,0x3a,0xc5,0xdd,0x9f,0xa4,0xfa,0xa,0xd3,0xed,0x9d,0x8e,0xe6,0x82, + 0xde,0xce,0x89,0xd7,0x17,0x2f,0x5e,0x8c,0x9a,0xf0,0xf1,0x94,0x20,0x1a,0x8d,0x16, + 0x10,0x10,0xd0,0xd0,0xd0,0x80,0x3c,0xa,0x89,0x44,0x4a,0x4a,0x4a,0xfa,0xdb,0x59, + 0x43,0xde,0xfa,0x48,0x52,0x1b,0xa7,0x78,0x89,0x12,0xa0,0x26,0xf7,0xa,0xa3,0xea, + 0xa1,0xf2,0x87,0x93,0x3e,0x53,0x3,0x3,0x3,0x84,0x19,0x31,0x99,0xcc,0x35,0x6b, + 0xd6,0x94,0x95,0x95,0x21,0x2f,0x9b,0xa2,0xa2,0x62,0x72,0x72,0xb2,0xb6,0xb6,0x36, + 0x34,0x53,0x34,0x9d,0xf3,0x36,0x1b,0x3c,0xe1,0xbc,0xcb,0x4a,0x19,0x89,0xed,0xe6, + 0x66,0x7b,0x63,0x15,0xad,0x6f,0xe2,0x63,0xb5,0xb6,0xb6,0x46,0x92,0x85,0x50,0x28, + 0xc,0x9,0x9,0xc9,0xc9,0xc9,0x91,0xaa,0x60,0x31,0x31,0x31,0xf6,0xf6,0xf6,0xd0, + 0xc,0xd2,0x34,0x5b,0x49,0xfc,0x8d,0xe6,0xee,0x5b,0xb8,0x4c,0x42,0x0,0xbe,0x48, + 0x74,0xea,0x49,0xf1,0xa4,0xdf,0x49,0x24,0xe9,0x7f,0xf6,0xd9,0x67,0x37,0x6e,0xdc, + 0x90,0xaa,0x48,0xff,0xfe,0xf7,0xbf,0xd7,0xaf,0x5f,0xf,0xcd,0x2c,0x49,0x81,0xad, + 0x9d,0xc9,0xd8,0x5f,0x72,0x5f,0x82,0x45,0x1f,0xd6,0xd7,0xb6,0x4e,0x1f,0x92,0x2c, + 0x24,0x4,0x48,0x69,0xa8,0x6a,0x19,0x1e,0x1a,0x77,0xd1,0xdd,0xdd,0x5d,0xf2,0xec, + 0x4d,0x24,0x12,0x7d,0xf3,0xcd,0x37,0xa7,0x4f,0x9f,0x96,0xaa,0x7a,0xbe,0xbe,0xbe, + 0x87,0xe,0x1d,0x82,0x66,0x9c,0x90,0x62,0x13,0x88,0x44,0x61,0xf7,0x32,0xf7,0x15, + 0xe7,0x2e,0xcf,0xa4,0x76,0x32,0x87,0x25,0x84,0x44,0x41,0xd0,0xd9,0x65,0xcb,0xed, + 0xb5,0x75,0xa7,0x1c,0x32,0x9,0xf8,0x27,0xaa,0xa,0x27,0xce,0xde,0x74,0x75,0x75, + 0x25,0xcd,0x1f,0x1e,0x3e,0x3c,0x70,0xe0,0x80,0x54,0x75,0x23,0x91,0x48,0xe7,0xcf, + 0x9f,0x7f,0x93,0xb9,0xfc,0xdf,0x1e,0xdb,0xe1,0x8a,0xfc,0xdb,0x1d,0x4d,0x10,0x4, + 0xdd,0xeb,0x6e,0x73,0x49,0x4b,0x7e,0xf4,0xac,0x4b,0x42,0x60,0x25,0x59,0xec,0x45, + 0x77,0x7f,0xa2,0xa2,0xf2,0x54,0x1,0x92,0xeb,0xab,0x7a,0xd9,0xcc,0x17,0xaf,0xe0, + 0x70,0x38,0x2b,0x2b,0x2b,0x9,0x69,0xd2,0xe9,0x74,0xa9,0x2a,0x6,0xf,0x43,0x34, + 0x35,0x35,0xa1,0x99,0x28,0x44,0xd8,0x1e,0xf6,0x76,0x7c,0x57,0x72,0x7f,0xec,0xdf, + 0x46,0xc6,0x20,0x25,0x3d,0x25,0xae,0xb6,0x5c,0x42,0x14,0x63,0x15,0xf5,0x4b,0x94, + 0x0,0xb9,0x29,0xde,0xf4,0x41,0x2e,0x67,0x62,0xf,0xe7,0xe5,0xe5,0x25,0x21,0x41, + 0x69,0x1b,0xcd,0xd9,0xb3,0x67,0x67,0xd8,0x30,0x44,0x3a,0x6c,0x6c,0x1,0x7f,0xdb, + 0xfd,0xdf,0xb8,0x42,0xe1,0x4b,0xa3,0x70,0x3e,0x6f,0xcb,0xbd,0x8c,0xdd,0x5,0xd9, + 0xa2,0xa9,0xfd,0xa2,0x9c,0x8,0xfa,0xc7,0x96,0x78,0x4c,0x75,0x37,0xbe,0xb6,0xa2, + 0x9f,0xf3,0xd2,0x4,0xd3,0xde,0xde,0x5e,0xaa,0xd9,0x9b,0x4,0x7d,0xf5,0xd5,0x57, + 0x6f,0xdb,0x2d,0xe7,0x5d,0xc7,0x16,0x59,0xf6,0x70,0xe2,0x90,0x1d,0xd6,0x91,0x8a, + 0x82,0xc0,0x3b,0xa9,0x7d,0x9c,0x29,0xd,0x1,0x1f,0x5b,0xd8,0x7d,0x6a,0xb1,0x70, + 0xd2,0x5b,0xbd,0x6c,0x66,0x72,0xc3,0xe3,0x17,0xaf,0x98,0x9a,0x9a,0xc2,0xfe,0x6b, + 0x6f,0x28,0x5f,0x5f,0x5f,0x69,0x7b,0xc1,0x99,0x86,0xad,0x8a,0xd6,0x77,0xa4,0x22, + 0x5f,0x42,0x80,0x5f,0x9b,0xeb,0x96,0x5d,0x4f,0x2a,0xe9,0xef,0x99,0x2a,0x40,0xf4, + 0x7b,0x1e,0x3e,0xfa,0x73,0x26,0xbd,0xf5,0x53,0x75,0xe9,0xa8,0x50,0xf0,0x67,0x8f, + 0xa8,0xa4,0xb4,0x74,0xe9,0xd2,0x37,0xac,0xf,0x99,0x4c,0xbe,0x78,0xf1,0xe2,0x5b, + 0x72,0x59,0xfc,0xdb,0x60,0xfb,0xaa,0x30,0x67,0xdc,0xe7,0x71,0xa2,0xea,0x86,0x6, + 0xdc,0xd3,0x92,0xaf,0x36,0xd7,0x4e,0x7a,0x17,0x83,0x46,0x27,0xb8,0xfa,0xcd,0x55, + 0xd3,0x9a,0x78,0xab,0x91,0x31,0x38,0x6e,0xf9,0xf4,0xcd,0xd7,0xde,0xb8,0x5c,0x2e, + 0x93,0xc9,0x84,0x66,0xba,0x24,0x61,0xbb,0xdf,0xdd,0xfe,0x5b,0xdb,0x53,0x24,0xa9, + 0x30,0x78,0xdc,0xc0,0xdb,0xa9,0x7,0x4b,0xf3,0x26,0xbd,0x8b,0xc7,0x29,0x24,0xbb, + 0xaf,0x52,0xc5,0x4e,0xb2,0x2c,0x79,0xb2,0xaa,0xf8,0xc5,0xd7,0x62,0xd1,0xa2,0x45, + 0x6f,0xd8,0x50,0xea,0xeb,0xeb,0x83,0x82,0x82,0xa4,0x32,0xcb,0xce,0x28,0x6c,0x5c, + 0xa1,0x70,0x57,0x41,0x16,0xf2,0x9f,0x9b,0x15,0x43,0xd0,0x9e,0xa2,0xdf,0x83,0xee, + 0x5c,0x9d,0x74,0xb1,0xd4,0xe,0x4f,0x88,0x77,0x59,0x39,0x71,0xb1,0x6d,0xdc,0xf2, + 0x29,0x99,0x4c,0x9e,0xb8,0xb6,0x24,0xad,0x72,0x73,0x73,0x3f,0xf9,0xe4,0x93,0x7f, + 0x28,0xb6,0x11,0x3e,0x57,0x6,0x25,0xf5,0x8b,0xff,0x4b,0x53,0x8d,0x57,0xc6,0x85, + 0x86,0x21,0xda,0xc4,0x5b,0xab,0x8d,0xcd,0xf7,0x4f,0x66,0xf7,0x3a,0x56,0xf9,0x68, + 0xcc,0x5f,0x1,0x8b,0xc5,0x22,0x34,0x4e,0x4a,0x56,0x42,0x42,0xc2,0xe1,0xc3,0x87, + 0xff,0x89,0xd8,0xb4,0xe4,0x15,0x72,0x57,0x85,0xde,0xf0,0xe,0x5a,0x6e,0x40,0x92, + 0x2a,0xc5,0xa2,0xbe,0x6e,0xe7,0x1b,0x49,0xe9,0xad,0x93,0xac,0xaa,0xec,0xb1,0x75, + 0xa,0x35,0xb3,0x1c,0x77,0xf1,0xd1,0xb3,0xae,0xac,0x8e,0xe6,0xb1,0x7f,0xa7,0x5a, + 0x6f,0x14,0x8,0x4,0xd2,0xce,0x1,0xae,0x5d,0xbb,0xf6,0x4f,0xec,0xdb,0x64,0xd1, + 0x68,0x5f,0x43,0xd3,0xc,0x9f,0xf,0x72,0xfd,0x42,0x3f,0x24,0x59,0x60,0x10,0xf7, + 0x3a,0x3d,0x6c,0xa6,0xff,0xad,0x5f,0x8e,0x56,0x14,0x4c,0xbc,0x15,0xb3,0xd4,0x7b, + 0xe1,0x2c,0xe2,0xb8,0x8b,0x2f,0xae,0xe6,0x4c,0x65,0x53,0xb6,0xb2,0xb2,0x32,0x31, + 0x31,0x41,0x5e,0x31,0x91,0x48,0xb4,0x69,0xd3,0xa6,0xda,0xda,0xda,0x7f,0xae,0x95, + 0x64,0x29,0x51,0xff,0xa2,0xbb,0x7f,0xd1,0xea,0x4d,0x9f,0x58,0xd8,0x69,0xca,0xe3, + 0x90,0x44,0x11,0x8a,0xc5,0xbb,0xa,0xb2,0xc3,0x72,0x33,0x59,0x2f,0x3b,0x7a,0x28, + 0x60,0x64,0xa9,0x94,0x0,0x3d,0xa5,0x97,0xf6,0xd7,0xdc,0xef,0x69,0x2f,0x78,0xf6, + 0x7c,0xf9,0xd4,0xcc,0xcc,0x6c,0x52,0x37,0x61,0x3,0x3,0x83,0xb4,0xb4,0x34,0xa9, + 0x26,0x76,0x74,0x3a,0x3d,0x28,0x28,0x68,0x60,0x60,0xe0,0x1f,0x8a,0xd,0x96,0xb5, + 0x96,0xce,0x29,0x27,0xef,0x92,0xf7,0x37,0x7f,0x6d,0xeb,0xa8,0x8d,0x53,0x44,0x12, + 0xe5,0x5c,0x4d,0x99,0x57,0xe6,0x85,0xe6,0xe1,0x97,0xcc,0x89,0x26,0x2a,0xea,0x17, + 0xdc,0xfc,0x5f,0xb4,0x7b,0x89,0xc4,0xe2,0xe8,0xca,0xe7,0xc6,0x65,0x65,0x65,0x65, + 0x27,0x27,0xa7,0x49,0x53,0x9b,0x37,0x6f,0xde,0xf5,0xeb,0xd7,0xa5,0xda,0xfe,0x54, + 0x55,0x55,0x15,0x1a,0x1a,0x2a,0xed,0x7,0x76,0x46,0x61,0x83,0x65,0xa8,0xac,0x76, + 0x60,0x91,0x4b,0xf9,0x9a,0xb0,0xc3,0xe,0xee,0xc6,0x2a,0xea,0xaf,0xc,0x9f,0xd7, + 0xd3,0xe1,0x7c,0x23,0xe9,0x5e,0x77,0xdb,0xb8,0xe6,0xfb,0xa3,0xe3,0x4b,0x16,0xc8, + 0x6b,0x2d,0x75,0xd5,0xf4,0xe7,0xcd,0x42,0x82,0x83,0xb7,0x8d,0x8d,0xcd,0xa5,0x4b, + 0x97,0x70,0x38,0x1c,0xf2,0x2,0xff,0xf6,0xdb,0x6f,0xff,0xfd,0xef,0x7f,0xff,0xe9, + 0xd8,0x60,0x11,0x14,0x94,0x76,0x59,0x39,0x94,0x5,0x6e,0x89,0x73,0x5e,0x61,0x8b, + 0x7f,0x85,0xcf,0x61,0x7,0x73,0x78,0x79,0x26,0x35,0xb6,0xba,0xf4,0xc5,0x8b,0x5b, + 0xe6,0xd9,0xbc,0xb8,0x31,0x40,0x20,0x12,0x1d,0xfe,0xa3,0x87,0xb3,0xb7,0xb7,0x97, + 0x30,0x7b,0xa3,0x50,0x28,0x54,0x2a,0x55,0x2a,0xaf,0x90,0xa8,0xa8,0xa8,0xf8,0xf8, + 0x78,0x80,0xed,0xb9,0x54,0xb1,0x72,0x9b,0xcc,0xad,0xf3,0x3,0xfe,0xf5,0xab,0x57, + 0xa0,0x23,0x41,0x52,0xaf,0x3,0xdb,0xa3,0x3f,0xcb,0xbb,0xcd,0x13,0xfd,0x39,0xb9, + 0xfe,0xde,0xde,0xd5,0x4b,0xff,0xcf,0x51,0x46,0x6a,0x53,0x6d,0xe3,0x30,0x1d,0x9e, + 0xbd,0x8d,0x8d,0x3e,0x26,0xc5,0xe3,0xe7,0xe7,0x17,0x1f,0x1f,0x2f,0xd5,0xc4,0x7c, + 0xc7,0x8e,0x1d,0x79,0x79,0x79,0x0,0xdb,0x9f,0xc2,0xa2,0x65,0xfc,0x8d,0xe6,0x3e, + 0x58,0xb5,0xe1,0xd6,0x8a,0xe0,0xe5,0x6,0x24,0x9,0x3,0xce,0x93,0x55,0x45,0x7e, + 0x37,0x2f,0x8f,0xad,0xb4,0xc9,0xa2,0xd1,0x89,0x2f,0xd8,0xbd,0xd8,0x2,0xfe,0xc9, + 0x27,0xc5,0x10,0x4,0xc9,0xc9,0xc9,0x8d,0xcd,0xde,0xa6,0x5a,0x13,0x8,0x9,0x9, + 0x91,0xca,0x89,0x9f,0xcd,0x66,0xaf,0x5d,0xbb,0x16,0xf9,0x5e,0xc5,0xbf,0x19,0xb6, + 0xb,0x4f,0xab,0x76,0x17,0x64,0xdf,0xeb,0x6e,0x7b,0xc6,0x61,0x49,0x9b,0x96,0xe7, + 0x6c,0x93,0xc,0x9f,0xf,0xa,0x2,0x36,0xae,0x33,0x25,0x2b,0x4e,0xb1,0x95,0xf6, + 0x56,0x7b,0xd3,0xb2,0x1b,0x49,0x85,0x7f,0xac,0xb2,0xce,0xc2,0x29,0x5e,0xf1,0x5c, + 0xad,0x21,0xf7,0xbc,0xaf,0x4a,0xaa,0xad,0x68,0x63,0xe,0x43,0xc8,0xf6,0xbd,0xed, + 0xd8,0xb1,0xe3,0xe0,0xc1,0x83,0xc8,0x8b,0xd7,0xde,0xde,0x1e,0x14,0x14,0x24,0x95, + 0x3b,0xec,0xdf,0x6,0x5b,0x52,0xfd,0xe3,0x23,0x15,0x5,0x2e,0x37,0x92,0xe6,0x5f, + 0xfa,0xc9,0x2d,0x2d,0x39,0xb2,0xec,0x61,0x76,0x67,0x4b,0x9f,0x34,0x8,0xed,0xf0, + 0x84,0x24,0x37,0xbf,0x92,0xf7,0x37,0x7f,0x6a,0xb1,0x70,0x8c,0xc7,0x8b,0x6a,0x18, + 0xa2,0x51,0xd2,0x53,0x2e,0x3c,0xad,0x82,0xff,0xb5,0xd0,0x98,0xf5,0xb3,0xab,0x2f, + 0xdc,0xa6,0x18,0x3c,0x6e,0xfc,0xd3,0xc7,0x10,0x4,0xb9,0xb8,0xb8,0x60,0x30,0xaf, + 0xf6,0x98,0xe,0xf,0xf,0xdf,0xbd,0x7b,0x37,0xf2,0xb2,0x3d,0x7a,0xf4,0xe8,0xe3, + 0x8f,0x3f,0x9e,0x69,0xd8,0x18,0x3c,0xee,0xe3,0x3f,0x96,0xd6,0x68,0xa3,0x9c,0x9c, + 0xae,0xd6,0xf0,0xc2,0x1c,0x4a,0x7a,0xca,0x82,0xcb,0x67,0x56,0xfe,0x76,0x29,0xa2, + 0xf4,0x41,0x4e,0x57,0xeb,0x38,0x67,0x82,0xa9,0x34,0x57,0x4d,0xeb,0x47,0x27,0xaf, + 0xe2,0xf7,0x37,0x7d,0x6d,0xeb,0xa8,0xaf,0xa4,0x3a,0xc1,0x72,0xc6,0xb,0xc9,0xbe, + 0xfe,0x4d,0xd1,0x3d,0x78,0x95,0xd5,0xd7,0xd0,0xf4,0xbb,0x45,0xce,0xf0,0xad,0x9f, + 0x6b,0xca,0x87,0x79,0x5c,0x33,0x33,0x33,0x7d,0x7d,0x7d,0x24,0x19,0x1d,0x3a,0x74, + 0xe8,0xa3,0x8f,0x3e,0x42,0x5e,0xe1,0xa4,0xa4,0x24,0xa9,0xb6,0x54,0xbd,0x9b,0x7a, + 0xe9,0x8d,0x6e,0x1b,0x19,0x9a,0xb4,0x61,0xf5,0x71,0x58,0x19,0x6d,0x4f,0x33,0xda, + 0x9e,0x42,0x10,0xa4,0x21,0x87,0xb3,0xd4,0xd2,0x76,0xd7,0x33,0xb2,0xc3,0x13,0x2d, + 0xb5,0xb4,0x25,0x4f,0xe0,0x8c,0x55,0xd4,0xf,0x2c,0x72,0xd9,0x69,0xe9,0x90,0x50, + 0x5f,0x79,0xae,0xa6,0xbc,0x86,0xfe,0x92,0xef,0xf7,0x81,0xd2,0x7,0x35,0xf4,0xfe, + 0xb3,0xcb,0x56,0x68,0xca,0xe3,0xf6,0xd8,0x3a,0x35,0xc,0xd,0x26,0x37,0x3c,0xee, + 0x1c,0x1e,0x8a,0x7b,0x5a,0xf5,0xe5,0x7c,0xbb,0x85,0xb,0x17,0x36,0x37,0x37,0x23, + 0xa9,0x43,0x4c,0x4c,0xc,0x9d,0x4e,0xbf,0x7c,0xf9,0x32,0xc2,0x3a,0xef,0xde,0xbd, + 0x9b,0x44,0x22,0xf9,0xfa,0xfa,0xce,0x90,0xd6,0xd6,0xce,0x1c,0x16,0xbd,0xea,0xf0, + 0x95,0x41,0x2e,0xe7,0xf7,0xae,0xd6,0xaf,0xb,0x7f,0xf7,0xcc,0xb8,0xb0,0xe0,0x72, + 0xec,0xf2,0x4c,0xea,0xbe,0xe2,0xdc,0xec,0xce,0x96,0xa1,0xa9,0x77,0x49,0xa9,0xc9, + 0xc9,0x7f,0x4e,0xb6,0x2f,0x7e,0x7f,0xd3,0x79,0x97,0x95,0xe3,0x2c,0x5b,0xbf,0x36, + 0xd7,0xb9,0xa5,0x25,0xc3,0xab,0xe7,0xb1,0xcb,0x7c,0x1c,0xb4,0xf5,0x20,0x8,0xfa, + 0xa9,0xb6,0x8c,0x2f,0x14,0x2e,0x5f,0xbe,0x1c,0x61,0x1d,0x50,0x28,0x54,0x42,0x42, + 0x82,0x64,0x57,0x94,0x71,0x76,0xaf,0x8d,0x1b,0x37,0x3e,0x79,0xf2,0x64,0x86,0x60, + 0xab,0x19,0xec,0x97,0x2a,0x72,0x3f,0x87,0xfd,0x5b,0x7b,0xe3,0xfe,0x92,0xfb,0x94, + 0xf4,0x94,0x5,0xbf,0x9c,0xf1,0xca,0xb8,0x18,0x51,0xfa,0xe0,0x76,0x47,0xd3,0xa4, + 0x1f,0x52,0x5,0x8c,0xec,0xbf,0xe6,0x5a,0x3d,0xf4,0xff,0xd7,0x55,0xcf,0x40,0x8f, + 0xd9,0x7f,0xee,0xbb,0xa9,0xa4,0x3d,0x73,0x4d,0x4b,0xbe,0xd6,0x52,0xa7,0x80,0x91, + 0xbd,0xe4,0x11,0x60,0xa0,0xac,0xda,0x48,0xeb,0x4b,0x6d,0xae,0x5d,0xe6,0xea,0x2, + 0x3f,0x62,0x24,0x25,0x91,0x97,0x97,0xbf,0x74,0xe9,0x92,0xb3,0xb3,0x33,0xc2,0x92, + 0xd3,0x68,0xb4,0xa0,0xa0,0x20,0xa9,0x76,0x7e,0xbc,0xbb,0xd8,0xea,0x26,0x5b,0x70, + 0x41,0xa8,0x4e,0xe6,0xf0,0xed,0x8e,0xa6,0xbd,0x45,0xf7,0xbc,0x32,0x2e,0x2e,0xb8, + 0x7c,0xc6,0x27,0x93,0xfa,0x6d,0x71,0x6e,0x56,0x67,0xf3,0xb8,0xe5,0x37,0x59,0x34, + 0x3a,0xc0,0x78,0xee,0xed,0x15,0x6b,0x73,0x7c,0xd7,0x5,0x9a,0xcc,0x83,0x3d,0xcf, + 0x7,0x46,0xd9,0xab,0x6f,0x5d,0x89,0x2c,0x7b,0xa8,0xaf,0xa4,0x7a,0xc1,0xdd,0x1f, + 0x3,0xa1,0x22,0x9e,0x14,0x69,0x6a,0x6a,0xe9,0xe8,0xe8,0x20,0xdf,0xbb,0xa6,0xaa, + 0xaa,0x7a,0xe5,0xca,0x15,0xe4,0x5b,0x8a,0x6b,0x6a,0x6a,0x36,0x6f,0xde,0x8c,0xf0, + 0xb5,0x78,0xa7,0xfb,0xb6,0x8e,0x97,0xf7,0x5c,0xbf,0xb6,0x6,0x46,0xd9,0x37,0xdb, + 0x1b,0x6f,0xb6,0x37,0x42,0x10,0x44,0x54,0x54,0x9e,0xa7,0xae,0xe5,0x44,0xd0,0x77, + 0xd3,0x33,0x9a,0xab,0xa6,0x35,0x66,0x89,0x76,0xd1,0x35,0x74,0xd1,0x35,0x2c,0xee, + 0xeb,0x8e,0xa9,0x2e,0x49,0x6d,0xaa,0x65,0xf2,0x79,0xe1,0x85,0x39,0xf5,0x43,0xb4, + 0x78,0x97,0x95,0x67,0x97,0x2d,0xdf,0xf8,0xf0,0xd6,0xef,0x6d,0x8d,0x8e,0x4e,0x4e, + 0x3c,0x1e,0xf,0x79,0xbe,0x5a,0x5a,0x5a,0xa9,0xa9,0xa9,0xee,0xee,0xee,0x4d,0x4d, + 0x4d,0x48,0xc2,0xa7,0xa5,0xa5,0x7d,0xfd,0xf5,0xd7,0x8,0xf7,0x9f,0xbd,0xa3,0xd8, + 0xc4,0x10,0x34,0xc8,0x9d,0xfe,0xcd,0xac,0xdd,0xac,0x91,0x6e,0xd6,0x48,0x76,0x67, + 0xcb,0xb7,0xc5,0xb9,0xda,0x38,0x45,0x4b,0x2d,0x6d,0xfb,0x59,0xba,0x4b,0x74,0x66, + 0x2f,0x9c,0x45,0xd4,0x94,0xc7,0x2d,0x9c,0x45,0xfc,0x79,0x96,0xef,0x5e,0xdb,0xa5, + 0x67,0x6b,0xca,0xe2,0x6a,0xcb,0x13,0xeb,0x2b,0xab,0x7,0xfb,0xd2,0x7c,0x3e,0xf8, + 0x8a,0x61,0xbf,0xaf,0xba,0xc8,0xcf,0xe9,0xbd,0xa6,0xd2,0x72,0xa9,0xb2,0x33,0x34, + 0x34,0x4c,0x4f,0x4f,0xf7,0xf2,0xf2,0x42,0x38,0xb3,0xfe,0xe1,0x87,0x1f,0x4c,0x4c, + 0x4c,0xde,0xc6,0x5e,0xc5,0xff,0x13,0x36,0xbe,0x48,0xc8,0x96,0x66,0x37,0xed,0x6b, + 0xe8,0x19,0x87,0x75,0xa7,0xa3,0xf9,0x4e,0x47,0x33,0x4,0x41,0x4,0x5,0xa5,0x79, + 0x1a,0x78,0x27,0x82,0xbe,0x9b,0xae,0x91,0xa5,0x96,0x76,0xe4,0x62,0xd7,0x70,0x5b, + 0xc7,0x84,0xba,0xca,0x43,0xe5,0xf,0xc9,0x97,0xcf,0xa4,0xb8,0xaf,0x6a,0xe7,0xb1, + 0x7,0x87,0x78,0x92,0x3d,0xcc,0x27,0x95,0xb9,0xb9,0xf9,0xf5,0xeb,0xd7,0x3d,0x3d, + 0x3d,0x11,0x76,0x5d,0xdb,0xb7,0x6f,0x37,0x35,0x35,0x7d,0x73,0xa7,0xb1,0xbf,0x6, + 0x9b,0x40,0x24,0x7a,0xd1,0xfd,0xed,0x6d,0xab,0x87,0xcd,0xec,0x61,0x33,0xef,0x76, + 0xb6,0xec,0x2b,0xce,0xc5,0xe3,0x14,0xac,0x34,0x75,0x1c,0x9,0xb3,0x97,0x12,0xd, + 0xee,0xfa,0xae,0xbb,0xdb,0xd9,0x12,0x55,0xf1,0xc8,0x5a,0x9b,0xd8,0xa3,0xae,0xac, + 0xa7,0xf5,0x3a,0xde,0xe0,0xd6,0xd6,0xd6,0xd7,0xaf,0x5f,0x5f,0xb1,0x62,0x5,0x12, + 0x17,0xf4,0xd1,0xd1,0xd1,0xe0,0xe0,0xe0,0xfc,0xfc,0x7c,0x84,0x33,0xc5,0xe7,0x1f, + 0x27,0xb1,0xf8,0x9d,0xc0,0xc6,0x11,0x8,0x18,0xbc,0xd1,0xbf,0xa4,0x10,0xfd,0x1c, + 0x76,0x56,0x67,0x73,0x56,0x67,0x33,0x4,0x41,0x9a,0xf2,0x38,0x5b,0x3c,0xc1,0x44, + 0x55,0xbd,0x8f,0xc5,0x1c,0x52,0xc0,0x8a,0x55,0x95,0x5f,0x2f,0xcd,0x25,0x4b,0x96, + 0x5c,0xba,0x74,0xc9,0xcf,0xcf,0xf,0xc9,0x31,0x6,0x5d,0x5d,0x5d,0xfe,0xfe,0xfe, + 0x59,0x59,0x59,0x1a,0x1a,0x1a,0xc2,0x57,0x39,0x18,0x8e,0xcd,0x22,0x90,0x90,0x43, + 0x98,0x9a,0x54,0x21,0x21,0x8,0x42,0x8d,0xe5,0xdd,0xcd,0x1a,0x79,0xf4,0xac,0x8b, + 0x2b,0x65,0x83,0xc3,0xa0,0xd1,0x98,0xe9,0xf3,0x25,0x45,0x43,0x28,0x31,0x4,0xc1, + 0xab,0x4,0x9a,0x72,0x38,0xc,0x6,0xa3,0x87,0x96,0x35,0x99,0xf5,0xfa,0xa7,0xe0, + 0x95,0x96,0x96,0x76,0x77,0x77,0x23,0xd9,0x3f,0xc0,0xe1,0x70,0x1c,0x1c,0x1c,0x88, + 0x44,0x62,0x77,0x77,0x77,0x59,0x59,0xd9,0x2b,0x8f,0x1,0x45,0xa3,0xd1,0x4e,0x4e, + 0x4e,0x4a,0x4a,0x4a,0xaf,0x78,0x23,0xfb,0xfb,0xb3,0xb3,0xb3,0x91,0xb4,0x5d,0x57, + 0x57,0x57,0xe4,0xe7,0xfd,0xa1,0xfe,0xda,0xc6,0xe,0x34,0xd,0xf3,0x36,0x20,0x80, + 0xd,0x8,0x60,0x3,0x42,0x88,0x8d,0xcb,0xe5,0x4a,0x18,0x44,0xe5,0xe7,0xe7,0x73, + 0x38,0x1c,0x24,0x19,0xd0,0xe9,0xf4,0xa2,0xa2,0xa2,0xe9,0x2d,0x34,0x83,0xc1,0x78, + 0x1b,0xeb,0xd4,0x99,0x99,0x99,0x9,0x9,0x9,0x63,0x75,0x84,0xfd,0xbd,0xc4,0x62, + 0xb1,0x40,0x20,0x90,0x30,0x2,0x28,0x2a,0x2a,0x7a,0xf6,0xec,0x19,0xf2,0x5c,0xda, + 0xdb,0xdb,0x1f,0x3f,0x7e,0x3c,0x6d,0xd8,0x6,0x7,0x7,0xb7,0x6c,0xd9,0x22,0x10, + 0x8,0x58,0x2c,0xd6,0x9a,0x35,0x6b,0x32,0x33,0x33,0x25,0xc,0x7b,0x76,0xef,0xde, + 0xdd,0xd7,0xd7,0x87,0x24,0x83,0xba,0xba,0x3a,0x24,0xc7,0xcf,0x55,0x57,0x57,0xbf, + 0x72,0x1,0xb3,0xb7,0xb7,0x17,0x7e,0x3,0xca,0xca,0xca,0xe2,0xe2,0xe2,0xe0,0xc4, + 0xa7,0x5a,0xdc,0x29,0x2e,0x2e,0xee,0xe9,0xe9,0x91,0x6a,0xcc,0xb9,0x77,0xef,0xde, + 0x31,0x6f,0xbe,0xab,0x57,0xaf,0x6,0x5,0x5,0xb9,0xb9,0xb9,0x79,0x7b,0x7b,0x7f, + 0xf0,0xc1,0x7,0x12,0x8e,0x41,0xf9,0xe6,0x9b,0x6f,0x4a,0x4a,0x4a,0x90,0x67,0x74, + 0xf3,0xe6,0xcd,0x1f,0x7f,0xfc,0x71,0xda,0xe6,0x6d,0x3c,0x1e,0xaf,0xb2,0xb2,0x92, + 0xcd,0x66,0x87,0x84,0x84,0x18,0x19,0x19,0xc1,0xcb,0x51,0x35,0x35,0x35,0xb5,0xb5, + 0xb5,0x36,0x36,0x36,0x46,0x46,0x46,0x74,0x3a,0x9d,0xcb,0xe5,0x3e,0x79,0xf2,0x84, + 0x44,0x22,0x29,0x2a,0x2a,0x62,0x30,0x18,0x1e,0x8f,0x77,0xe7,0xce,0x1d,0x3c,0x1e, + 0x6f,0x67,0x67,0xd7,0xdb,0xdb,0xdb,0xdb,0xdb,0x8b,0x46,0xa3,0x75,0x75,0x75,0x65, + 0x65,0x65,0xd5,0xd5,0xd5,0x87,0x86,0x86,0x4,0x2,0x81,0xac,0xac,0xac,0x92,0x92, + 0x52,0x65,0x65,0x65,0x57,0x57,0x97,0x87,0x87,0x7,0xbc,0x66,0x5d,0x50,0x50,0x30, + 0x30,0x30,0xe0,0xe1,0xe1,0x31,0x76,0x3a,0xe0,0xf0,0xf0,0x70,0x69,0x69,0x29,0xcc, + 0x46,0x20,0x10,0x94,0x94,0x94,0xd8,0xd9,0xd9,0xc1,0x7e,0xae,0xd9,0xd9,0xd9,0x58, + 0x2c,0xd6,0xdc,0xdc,0xfc,0xe8,0xd1,0xa3,0xe5,0xe5,0xe5,0xa7,0x4f,0x9f,0xb6,0xb3, + 0xb3,0x33,0x33,0x33,0xeb,0xe8,0xe8,0x8,0xf,0xf,0xd7,0xd5,0xd5,0xdd,0xbd,0x7b, + 0x37,0x16,0x8b,0xc5,0x62,0xb1,0xea,0xea,0xea,0x74,0x3a,0x9d,0xc7,0xe3,0x8d,0x8c, + 0x8c,0x7c,0xf2,0xc9,0x27,0x7e,0x7e,0x7e,0x61,0x61,0x61,0x78,0x3c,0x1e,0x6e,0x10, + 0x9e,0x9e,0x9e,0x2f,0x3a,0x14,0x8d,0x8e,0x8e,0xde,0xb9,0x73,0x47,0x4b,0x4b,0x6b, + 0xc9,0x92,0x25,0x34,0x1a,0xed,0xda,0xb5,0x6b,0xb3,0x67,0xcf,0x26,0x93,0xc9,0xf0, + 0x5d,0x6f,0x6f,0x6f,0x47,0x47,0xc7,0xad,0x5b,0xb7,0x5a,0x5a,0x5a,0x7e,0xfc,0xf1, + 0xc7,0x3a,0x3a,0x3a,0x95,0x95,0x95,0x2d,0x2d,0x2d,0x6e,0x6e,0x6e,0xca,0xca,0xca, + 0xf0,0x1b,0x53,0x5b,0x5b,0xfb,0xde,0x7b,0xef,0xa9,0xaa,0xaa,0xe,0xf,0xf,0xa7, + 0xa7,0xa7,0xcf,0x9d,0x3b,0x97,0x44,0x22,0xd,0xd,0xd,0x8d,0x8e,0x8e,0xb6,0xb4, + 0xb4,0x30,0x99,0x4c,0xa,0x85,0x2,0xa7,0x56,0x50,0x50,0xd0,0xd7,0xd7,0x47,0xa1, + 0x50,0x14,0x14,0x14,0x64,0x64,0x64,0xe0,0xc3,0xcf,0xc5,0x62,0x71,0x56,0x56,0x96, + 0x58,0x2c,0xf6,0xf0,0xf0,0x80,0x5d,0x66,0xaa,0xaa,0xaa,0x5a,0x5b,0x5b,0x6d,0x6d, + 0x6d,0xb1,0x58,0x2c,0x87,0xc3,0xd1,0xd0,0xd0,0x50,0x54,0x54,0x1c,0x1e,0x1e,0x66, + 0x30,0x18,0xe3,0xfc,0x7a,0xff,0x6c,0x6d,0x18,0xc,0x6,0x85,0x42,0x5,0x6,0x6, + 0xce,0x9d,0x3b,0xf7,0xc4,0x89,0x13,0x18,0xc,0x86,0x4e,0xa7,0xff,0xf2,0xcb,0x2f, + 0xcd,0xcd,0xcd,0xc1,0xc1,0xc1,0xd,0xd,0xd,0x77,0xef,0xde,0xb5,0xb3,0xb3,0xa3, + 0x52,0xa9,0xc,0x6,0x3,0x83,0xc1,0xc8,0xca,0xca,0x6e,0xdf,0xbe,0x3d,0x23,0x23, + 0xa3,0xbc,0xbc,0x9c,0x4e,0xa7,0xbb,0xb8,0xb8,0xfc,0xe7,0x3f,0xff,0x69,0x6f,0x6f, + 0x8f,0x8c,0x8c,0x4c,0x4d,0x4d,0x85,0x20,0x28,0x3d,0x3d,0x3d,0x2e,0x2e,0xe,0x8f, + 0xc7,0x17,0x14,0x14,0xc4,0xc7,0xc7,0x27,0x26,0x26,0x6e,0xdd,0xba,0x15,0x82,0xa0, + 0xc3,0x87,0xf,0xc7,0xc4,0xc4,0x3c,0x78,0xf0,0xe0,0xa3,0x8f,0x3e,0x1a,0x73,0x3c, + 0x45,0xa3,0xd1,0xb0,0xf7,0xe3,0xa6,0x4d,0x9b,0xc2,0xc2,0xc2,0xa,0xa,0xa,0x56, + 0xad,0x5a,0xd5,0xdf,0xdf,0xbf,0x67,0xcf,0x9e,0x98,0x98,0x98,0xea,0xea,0xea,0xe6, + 0xe6,0xe6,0xca,0xca,0xca,0x9e,0x9e,0x9e,0xc2,0xc2,0xc2,0xbc,0xbc,0xbc,0x88,0x88, + 0x88,0xba,0xba,0xba,0xd6,0xd6,0xd6,0x27,0x4f,0x9e,0xd4,0xd5,0xd5,0x7d,0xff,0xfd, + 0xf7,0xbf,0xfe,0xfa,0x2b,0xdc,0x4a,0x8e,0x1c,0x39,0x52,0x5e,0x5e,0x3e,0x30,0x30, + 0x50,0x54,0x54,0xd4,0xd3,0xd3,0x13,0x1b,0x1b,0x7b,0xfc,0xf8,0xf1,0xbc,0xbc,0xbc, + 0xd,0x1b,0x36,0x8c,0x4d,0xbd,0x9f,0x3d,0x7b,0xe6,0xe3,0xe3,0x93,0x93,0x93,0xf3, + 0xc3,0xf,0x3f,0xec,0xd9,0xb3,0xa7,0xaf,0xaf,0xaf,0xb4,0xb4,0xb4,0xb1,0xb1,0xf1, + 0xe6,0xcd,0x9b,0x70,0x0,0x25,0x25,0x25,0x2,0x81,0xa0,0xa1,0xa1,0xa1,0xa5,0xa5, + 0x45,0x20,0x10,0x52,0x52,0x52,0xf6,0xef,0xdf,0x5f,0x51,0x51,0xb1,0x6e,0xdd,0x3a, + 0x1e,0x8f,0x47,0xa5,0x52,0x37,0x6c,0xd8,0x50,0x52,0x52,0xd2,0xd5,0xd5,0x85,0xc1, + 0x60,0x8e,0x1d,0x3b,0x96,0x9f,0x9f,0xff,0xfe,0xfb,0xef,0xd7,0xd5,0xd5,0xe5,0xe7, + 0xe7,0xdb,0xdb,0xdb,0xa7,0xa5,0xa5,0x45,0x47,0x47,0x7f,0xfb,0xed,0xb7,0x70,0x73, + 0xfc,0xfe,0xfb,0xef,0xef,0xdf,0xbf,0xef,0xed,0xed,0x4d,0xa3,0xd1,0xb0,0x58,0xac, + 0x8c,0x8c,0x8c,0x58,0x2c,0x5e,0xbb,0x76,0x2d,0x95,0x4a,0xbd,0x72,0xe5,0x4a,0x50, + 0x50,0x90,0x48,0x24,0xba,0x76,0xed,0xda,0xc6,0x8d,0x1b,0xf3,0xf2,0xf2,0x5c,0x5d, + 0x5d,0xcf,0x9d,0x3b,0x47,0xa5,0x52,0x8f,0x1d,0x3b,0x6,0x41,0xd0,0xc1,0x83,0x7, + 0x27,0x6e,0x66,0xf8,0x13,0x1b,0xa,0x85,0x1a,0x19,0x19,0x29,0x2e,0x2e,0x1e,0xdb, + 0x1b,0xa8,0xae,0xae,0xee,0xec,0xec,0xac,0xa9,0xa9,0x89,0x42,0xa1,0x4a,0x4b,0x4b, + 0xf9,0x7c,0xbe,0x89,0x89,0x49,0x7c,0x7c,0xfc,0x82,0x5,0xb,0xb8,0x5c,0xae,0x58, + 0x2c,0xee,0xe8,0xe8,0x50,0x55,0x55,0xdd,0xb2,0x65,0xb,0x6,0x83,0x11,0x8,0x4, + 0xe7,0xce,0x9d,0xf3,0xf3,0xf3,0x63,0x32,0x99,0x63,0xab,0x21,0x42,0xa1,0x50,0x20, + 0x10,0x68,0x6a,0x6a,0x46,0x47,0x47,0xc7,0xc5,0xc5,0x95,0x97,0x97,0xb7,0xb6,0xb6, + 0xc6,0xc7,0xc7,0x93,0xc9,0x64,0x6b,0x6b,0xeb,0xdf,0x7f,0xff,0xbd,0xbe,0x7e,0xfc, + 0x21,0x93,0x2c,0x16,0x6b,0xfb,0xf6,0xed,0x87,0xe,0x1d,0xd2,0xd7,0xd7,0x2f,0x29, + 0x29,0xe9,0xeb,0xeb,0x93,0x91,0x91,0x9,0xa,0xa,0xb2,0xb7,0xb7,0x5f,0xbf,0x7e, + 0xbd,0x93,0x93,0x53,0x68,0x68,0x28,0x8f,0xc7,0x1b,0x1e,0x1e,0xa6,0x50,0x28,0x9e, + 0x9e,0x9e,0x21,0x21,0x21,0x14,0xa,0x85,0xc9,0x64,0xc2,0xdd,0x8f,0x58,0x2c,0xe6, + 0x70,0x38,0x81,0x81,0x81,0x36,0x36,0x36,0x5f,0x7c,0xf1,0x5,0x99,0x4c,0x3e,0x7c, + 0xf8,0xb0,0x85,0x85,0x85,0x95,0x95,0xd5,0xbd,0x7b,0xf7,0xaa,0xab,0xab,0xe1,0x5c, + 0xce,0x9d,0x3b,0xa7,0xaf,0xaf,0x7f,0xfc,0xf8,0xf1,0xcb,0x97,0x2f,0x5f,0xbd,0x7a, + 0x55,0x4d,0x4d,0xed,0xd3,0x4f,0x3f,0x5d,0xba,0x74,0xe9,0xb6,0x6d,0xdb,0xc6,0xf5, + 0xe2,0xf0,0x1f,0xc7,0x8f,0x1f,0x37,0x35,0x35,0x9d,0x37,0x6f,0x5e,0x43,0x43,0x43, + 0x76,0x76,0xf6,0x89,0x13,0x27,0xa2,0xa3,0xa3,0xf,0x1e,0x3c,0x68,0x6d,0x6d,0x4d, + 0xa3,0xd1,0x42,0x42,0x42,0x22,0x23,0x23,0x5d,0x5c,0x5c,0xf2,0xf2,0xf2,0xc4,0x62, + 0xb1,0xb6,0xb6,0x76,0x64,0x64,0xe4,0xd1,0xa3,0x47,0xf3,0xf2,0xf2,0x9a,0x9a,0x9a, + 0xae,0x5c,0xb9,0x92,0x92,0x92,0x12,0x15,0x15,0x65,0x6e,0x6e,0x7e,0xe6,0xcc,0x19, + 0x5,0x5,0x5,0x79,0x79,0x79,0xb8,0xfd,0xfd,0xfc,0xf3,0xcf,0x71,0x71,0x71,0x23, + 0x23,0x23,0x59,0x59,0x59,0xb1,0xb1,0xb1,0xfb,0xf6,0xed,0x3b,0x74,0xe8,0x90,0x8f, + 0x8f,0x4f,0x7f,0x7f,0xbf,0xbf,0xbf,0x7f,0x6e,0x6e,0x2e,0x9f,0xcf,0x2f,0x2f,0x2f, + 0x5f,0xb1,0x62,0xc5,0x94,0xd8,0x4,0x2,0x1,0x81,0x40,0xb8,0x71,0xe3,0xc6,0xce, + 0x9d,0x3b,0x6f,0xdf,0xbe,0xd,0x41,0x50,0x72,0x72,0x72,0x64,0x64,0xa4,0x86,0x86, + 0x86,0x8e,0x8e,0x8e,0x48,0x24,0x12,0xa,0x85,0xb0,0x1f,0x1c,0xbc,0x6,0x26,0x12, + 0x89,0x2e,0x5c,0xb8,0xc0,0x62,0xb1,0xdc,0xdc,0xdc,0x68,0x34,0x9a,0xae,0xae,0xae, + 0x96,0x96,0x16,0x7c,0x1d,0x6e,0xf2,0x43,0x43,0x43,0x70,0xc7,0x6e,0x62,0x62,0x2, + 0xdb,0x29,0x54,0x54,0x54,0xe0,0xad,0x9e,0x4a,0x4a,0x4a,0x28,0x14,0xea,0xc4,0x89, + 0x13,0x13,0x8f,0xe3,0xd4,0xd4,0xd4,0x84,0xb7,0xb8,0xe1,0xf1,0x78,0x16,0x8b,0x15, + 0x1b,0x1b,0x6b,0x63,0x63,0xe3,0xea,0xea,0x3a,0x30,0x30,0xc0,0xe7,0xf3,0x61,0x36, + 0x28,0x14,0xa,0xb6,0x62,0x8c,0xd,0x8b,0x84,0x42,0x21,0x7c,0x65,0x64,0x64,0x4, + 0xe,0x3,0xf,0xa9,0x84,0x42,0xa1,0x50,0x28,0x54,0x56,0x56,0x46,0xa1,0x50,0x3f, + 0xfd,0xf4,0x93,0x91,0x91,0xd1,0xd8,0xa0,0x6,0x3e,0xa3,0x19,0x87,0xc3,0x29,0x28, + 0x28,0x30,0x18,0xc,0x2e,0x97,0x2b,0x61,0x6d,0x8f,0xc7,0xe3,0xa9,0xa8,0xa8,0x88, + 0x44,0xa2,0xc8,0xc8,0x48,0x13,0x13,0x13,0x26,0x93,0x39,0x66,0xc0,0x94,0x93,0x93, + 0x33,0x33,0x33,0x83,0x20,0x48,0x4d,0x4d,0xd,0xce,0x71,0xfe,0xfc,0xf9,0x10,0x4, + 0x61,0xb1,0x58,0x15,0x15,0x95,0xe1,0xe1,0x61,0x39,0x39,0x39,0x55,0x55,0x55,0x8, + 0x82,0x8c,0x8d,0x8d,0xe9,0x74,0x3a,0x5c,0x78,0x3a,0x9d,0x8e,0xc7,0xe3,0xe1,0x14, + 0x88,0x44,0x62,0x7f,0x7f,0x3f,0x8b,0xc5,0x82,0xad,0x24,0x44,0x22,0x91,0xc7,0xe3, + 0x91,0x48,0x24,0x25,0x25,0xa5,0x53,0xa7,0x4e,0xe9,0xe9,0xe9,0x19,0x1b,0x1b,0x4f, + 0x89,0x4d,0x2c,0x16,0xf7,0xf5,0xf5,0x39,0x39,0x39,0x9d,0x39,0x73,0x66,0xed,0xda, + 0xb5,0xb9,0xb9,0xb9,0x9d,0x9d,0x9d,0x6a,0x6a,0x6a,0x78,0x3c,0xfe,0xe9,0xd3,0xa7, + 0x42,0xa1,0x90,0xcf,0xe7,0x8f,0xed,0xd2,0x64,0xb3,0xd9,0x3c,0x1e,0xaf,0xa1,0xa1, + 0xc1,0xcb,0xcb,0xab,0xa7,0xa7,0x87,0xc1,0x60,0xb0,0xd9,0x6c,0xd8,0xaa,0x66,0x61, + 0x61,0x91,0x9a,0x9a,0x7a,0xeb,0xd6,0xad,0xd8,0xd8,0x58,0x98,0x22,0x8c,0x4a,0x24, + 0x12,0x31,0x18,0xc,0x22,0x91,0x68,0x6f,0x6f,0xdf,0xd4,0xd4,0x64,0x68,0x68,0x28, + 0x2f,0x2f,0xf,0x57,0x15,0xae,0x2d,0xec,0xa,0xc7,0x62,0xb1,0xe0,0xc7,0xc7,0x66, + 0xb3,0xf9,0x7c,0x7e,0x59,0x59,0x99,0xa3,0xa3,0xa3,0x50,0x28,0x1c,0x1a,0x1a,0x22, + 0x10,0x8,0x45,0x45,0x45,0xc5,0xc5,0xc5,0x7c,0x3e,0x1f,0x6,0xa6,0xac,0xac,0x7c, + 0xe7,0xce,0x9d,0xea,0xea,0x6a,0x4b,0x4b,0x4b,0x2a,0x95,0x7a,0xeb,0xd6,0xad,0xf3, + 0xe7,0xcf,0xc3,0xd8,0x94,0x94,0x94,0xae,0x5e,0xbd,0xda,0xd5,0xd5,0x45,0xa1,0x50, + 0xea,0xeb,0xeb,0xd,0xd,0xd,0xd1,0x68,0xf4,0xd8,0x4f,0xb2,0x4,0x6,0x6,0xa6, + 0xa7,0xa7,0xa7,0xa7,0xa7,0x47,0x46,0x46,0xea,0xe8,0xe8,0x98,0x9a,0x9a,0x32,0x99, + 0xcc,0x89,0x63,0x63,0xe,0x87,0x3,0x7f,0x57,0xdd,0xdd,0xdd,0xeb,0xea,0xea,0x8c, + 0x8c,0x8c,0x64,0x64,0x64,0xcc,0xcc,0xcc,0x7c,0x7c,0x7c,0x76,0xed,0xda,0x75,0xfb, + 0xf6,0xed,0xb6,0xb6,0x36,0x81,0x40,0x0,0xbf,0x22,0x1c,0xe,0x87,0xcf,0xe7,0xb, + 0x4,0x2,0xb8,0xbe,0x42,0xa1,0x90,0x4e,0xa7,0x5b,0x58,0x58,0x18,0x1b,0x1b,0x47, + 0x44,0x44,0x64,0x66,0x66,0x5e,0xbe,0x7c,0x39,0x38,0x38,0x98,0xc9,0x64,0xd2,0xe9, + 0xf4,0x65,0xcb,0x96,0x75,0x76,0x76,0x26,0x25,0x25,0xa5,0xa4,0xa4,0xd4,0xd4,0xd4, + 0xac,0x58,0xb1,0xc2,0xdd,0xdd,0x3d,0x3c,0x3c,0x9c,0x4a,0xa5,0x26,0x26,0x26,0xc2, + 0x7d,0xf0,0xca,0x95,0x2b,0xc3,0xc3,0xc3,0xfd,0xfc,0xfc,0x26,0xbe,0x46,0x32,0xfb, + 0xf6,0xed,0x1b,0xeb,0x5d,0x74,0x75,0x75,0xe7,0xcc,0x99,0x43,0x22,0x91,0x6c,0x6d, + 0x6d,0x7b,0x7b,0x7b,0xd7,0xad,0x5b,0xd7,0xdb,0xdb,0xdb,0xd4,0xd4,0xe4,0xef,0xef, + 0xbf,0x68,0xd1,0xa2,0xd9,0xb3,0x67,0x1b,0x1b,0x1b,0x1b,0x18,0x18,0xa0,0x50,0x28, + 0x3c,0x1e,0x4f,0x26,0x93,0xb,0xb,0xb,0x8b,0x8b,0x8b,0x77,0xed,0xda,0x65,0x63, + 0x63,0x83,0xc7,0xe3,0x2d,0x2c,0x2c,0x64,0x64,0x64,0xac,0xad,0xad,0x99,0x4c,0x66, + 0x73,0x73,0xf3,0xba,0x75,0xeb,0x16,0x2f,0x5e,0x4c,0x24,0x12,0x75,0x75,0x75,0x4d, + 0x4d,0x4d,0xd1,0x68,0xb4,0x8e,0x8e,0xce,0x82,0x5,0xb,0xbc,0xbc,0xbc,0x9a,0x9b, + 0x9b,0x4b,0x4a,0x4a,0x54,0x55,0x55,0x2d,0x2c,0x2c,0xe0,0xa6,0x89,0xc5,0x62,0xd, + 0xd,0xd,0xcd,0xcd,0xcd,0x35,0x35,0x35,0xcd,0xcd,0xcd,0x71,0x38,0x9c,0xba,0xba, + 0x3a,0x99,0x4c,0xee,0xec,0xec,0xcc,0xca,0xca,0xa,0xd,0xd,0x75,0x70,0x70,0x30, + 0x30,0x30,0x10,0x8,0x4,0x83,0x83,0x83,0x8e,0x8e,0x8e,0xc6,0xc6,0xc6,0xc6,0xc6, + 0xc6,0xf3,0xe7,0xcf,0x6f,0x6f,0x6f,0xc7,0x60,0x30,0xeb,0xd7,0xaf,0x67,0x32,0x99, + 0x8d,0x8d,0x8d,0x1f,0x7e,0xf8,0xa1,0xa3,0xa3,0xa3,0x9e,0x9e,0x9e,0x9d,0x9d,0x5d, + 0x6d,0x6d,0x2d,0x81,0x40,0xd8,0xb4,0x69,0x53,0x47,0x47,0x47,0x71,0x71,0xb1,0x8a, + 0x8a,0xa,0x99,0x4c,0x86,0xb3,0xd3,0xd5,0xd5,0x5d,0xb8,0x70,0x61,0x4e,0x4e,0x8e, + 0xa2,0xa2,0xe2,0x77,0xdf,0x7d,0xa7,0xa0,0xa0,0x80,0xc3,0xe1,0xe6,0xcc,0x99,0x33, + 0xd6,0x1c,0x61,0x69,0x68,0x68,0xc0,0x3f,0xd,0xe2,0xea,0xea,0x3a,0x34,0x34,0x54, + 0x50,0x50,0x20,0x2b,0x2b,0x6b,0x65,0x65,0x5,0x7f,0x96,0xcb,0xca,0xca,0x48,0x24, + 0x92,0xa5,0xa5,0xa5,0xb9,0xb9,0xb9,0x9a,0x9a,0x9a,0x8a,0x8a,0xa,0x7c,0xd8,0x3, + 0x5c,0x36,0xc,0x6,0x43,0x24,0x12,0xe7,0xcd,0x9b,0xe7,0xed,0xed,0x5d,0x5d,0x5d, + 0xdd,0xd8,0xd8,0xf8,0xc5,0x17,0x5f,0xd8,0xd9,0xd9,0x61,0xb1,0x58,0x13,0x13,0x13, + 0x53,0x53,0x53,0xf8,0xa3,0x4a,0xa7,0xd3,0xf7,0xee,0xdd,0x4b,0x24,0x12,0x9d,0x9d, + 0x9d,0xd5,0xd5,0xd5,0x85,0x42,0x21,0xfc,0x65,0xf2,0xf2,0xf2,0x52,0x53,0x53,0xbb, + 0x7e,0xfd,0x7a,0x64,0x64,0xe4,0xc4,0x1f,0x4b,0x1,0x36,0xc9,0x77,0x45,0xd9,0xd9, + 0xd9,0x5d,0x5d,0x5d,0xaa,0xaa,0xaa,0x11,0x11,0x11,0x47,0x8f,0x1e,0xd5,0xd7,0xd7, + 0x3f,0x70,0xe0,0x80,0xbe,0xbe,0xfe,0xfe,0xfd,0xfb,0x81,0x29,0x19,0x18,0xb7,0x80, + 0x0,0x36,0x20,0x80,0xd,0x60,0x3,0x2,0xd8,0x80,0x0,0x36,0x80,0xd,0x8,0x60, + 0x3,0x2,0xd8,0x80,0x0,0x36,0x80,0xd,0x8,0x60,0x3,0x2,0xd8,0x0,0x36,0x20, + 0x80,0xd,0x8,0x60,0x3,0xd8,0xc0,0x23,0x0,0xd8,0x80,0x0,0x36,0x20,0x80,0xd, + 0x60,0x3,0x2,0xd8,0x80,0x0,0x36,0x80,0xd,0x8,0x60,0x3,0x2,0xd8,0x80,0x0, + 0x36,0x80,0xd,0x8,0x60,0x3,0x2,0xd8,0x0,0x36,0x20,0x80,0xd,0x8,0x60,0x3, + 0xd8,0x80,0x0,0x36,0x20,0x80,0xd,0x8,0x60,0x3,0xd8,0x80,0x0,0x36,0x20,0x80, + 0x6d,0x86,0xea,0x7f,0x1,0xcc,0x33,0xe5,0xcf,0x8b,0xba,0x2d,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/axe_box.png + 0x0,0x0,0x1,0x76, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x3d,0x49,0x44,0x41,0x54,0x58,0x85,0xdd,0x97,0xe9,0xad,0x83,0x30, + 0x10,0x84,0xc7,0x28,0xd5,0xb8,0x20,0x8a,0xa0,0x8a,0xd4,0x43,0x15,0xae,0xc2,0x74, + 0xc3,0xbe,0x1f,0x79,0x1b,0x99,0xc3,0x7b,0x5,0x5,0x29,0x23,0xa1,0x4,0x87,0xf5, + 0x7c,0x3e,0x76,0x63,0x12,0x11,0x11,0x6e,0xd4,0x3,0x0,0x96,0x65,0x71,0x5,0xe5, + 0x3c,0x6f,0xee,0x6b,0x1d,0x43,0xe6,0x39,0x67,0xc,0xfe,0xa0,0xd9,0xd4,0xa6,0xa9, + 0x94,0x2,0x0,0x3e,0x0,0x36,0x6a,0x47,0xcc,0xdf,0x23,0x10,0x2e,0x80,0x33,0xf3, + 0x2b,0x20,0x4c,0x0,0x92,0xf9,0xa7,0x10,0x2a,0x80,0xc5,0xfc,0x8,0x31,0x99,0x1, + 0x1e,0xd6,0x4e,0xad,0x7a,0x3d,0x6f,0x8f,0x51,0x1,0x58,0x79,0xce,0xdb,0x86,0x27, + 0xb7,0x3f,0xcd,0x66,0x75,0xac,0x31,0x0,0x36,0x6f,0x3b,0xf0,0x2c,0xcd,0x1,0xbe, + 0x91,0xbe,0x7,0xe6,0x7c,0x4a,0x6e,0x95,0x16,0x2f,0xce,0x0,0x93,0xef,0x3f,0x1, + 0x98,0x97,0x40,0x83,0xd7,0x37,0xe1,0x7f,0x7,0xfb,0x91,0x58,0x96,0x40,0x9a,0x7a, + 0x96,0xbb,0x14,0x5f,0xad,0xdf,0x5,0x58,0xd7,0xf5,0x5e,0x80,0x61,0xb0,0x75,0x6d, + 0x2e,0x44,0x40,0x2c,0xb,0xb4,0x8d,0x68,0x2e,0x44,0xef,0x6c,0xe8,0xfc,0xd9,0x9c, + 0x65,0x3,0xc7,0x49,0xb5,0xc0,0x55,0x88,0x5a,0xf3,0x5a,0xc7,0x8d,0x69,0xf,0x4c, + 0x2b,0x44,0x89,0x88,0xa8,0x3d,0x92,0xb5,0xf9,0x6d,0xc9,0x63,0x4d,0x3d,0xf3,0x52, + 0xa,0xa6,0x69,0x92,0x97,0xa0,0x37,0xf2,0x33,0x49,0xcf,0x48,0x45,0xcb,0x7c,0x1e, + 0x90,0xcc,0xf7,0xbf,0x79,0xe,0x25,0x22,0x80,0xd5,0xfc,0x13,0x88,0x2e,0x80,0xd7, + 0x3c,0xa,0xa1,0x2e,0x41,0xe4,0xcc,0xef,0x81,0x30,0xed,0x1,0xbe,0xa2,0x10,0x92, + 0x5c,0x95,0xd0,0x22,0x2f,0xe8,0x1,0x20,0xfa,0x9a,0x15,0xd5,0xe5,0x33,0xe0,0x1d, + 0xc0,0x1b,0x80,0xdf,0xd5,0xbe,0xad,0x44,0x44,0x94,0x52,0xba,0xc5,0x1c,0x0,0xfe, + 0x0,0xe2,0x90,0xad,0x5f,0x7f,0xa6,0x32,0x3,0x0,0x0,0x0,0x0,0x49,0x45,0x4e, + 0x44,0xae,0x42,0x60,0x82, + // /home/mccad/Desktop/images/ozoom.png + 0x0,0x0,0x1,0x8f, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x1,0x56,0x49,0x44,0x41,0x54,0x58,0x85,0xcd,0x96,0xdb,0x91,0x84,0x20, + 0x10,0x45,0x2f,0xd6,0xc4,0x60,0xe,0x90,0xc4,0x6a,0x3a,0x44,0x41,0x14,0x93,0x8e, + 0x6c,0x12,0x90,0x83,0x49,0xf4,0x7e,0x38,0x2d,0x83,0x62,0x21,0xe8,0xc,0x7b,0x7f, + 0xac,0xe2,0x61,0x1f,0xfb,0xa9,0x20,0x22,0x42,0x43,0x3d,0x0,0xc0,0x7b,0x5f,0x75, + 0x59,0x4a,0x59,0x7d,0x17,0x0,0x94,0x52,0xe8,0xaa,0x6f,0x5f,0x94,0xb5,0x16,0x0, + 0xda,0x1,0xb0,0x9a,0x3,0x3c,0x72,0x7,0x94,0xd2,0xbb,0x35,0xe7,0x9e,0x9f,0x7, + 0x8,0x86,0xcd,0xe1,0x1e,0xd1,0x74,0x3f,0xc0,0xd6,0x30,0xd1,0xcf,0xee,0x92,0x10, + 0xe6,0xf5,0xfc,0x5,0x60,0x2e,0x79,0x24,0x2,0x58,0x8c,0x1f,0x1b,0x66,0xf1,0x1e, + 0x3,0x28,0xa5,0xab,0x21,0x36,0x49,0x98,0x37,0x9e,0x2,0xb9,0xa2,0x15,0x20,0xc4, + 0xb5,0xec,0xa5,0xcb,0x79,0x93,0x4c,0xd6,0x22,0x80,0x56,0xea,0x80,0x10,0xfb,0x5a, + 0x97,0x5e,0xf1,0xc2,0xff,0xf0,0x40,0x4b,0x65,0x3b,0x61,0xa9,0xa4,0x94,0xa7,0xce, + 0xf1,0x30,0xba,0x1d,0xa0,0x74,0x3c,0x77,0x0,0xf7,0x76,0xf3,0x6a,0x2c,0xe5,0xba, + 0xd2,0x11,0x9b,0xe7,0xc0,0xa,0xc0,0xf4,0xa5,0x5e,0xe0,0xaf,0xb7,0xb6,0x6e,0x30, + 0x25,0x5b,0xf1,0x59,0x88,0xf7,0x73,0xc3,0x30,0x62,0x9e,0xcf,0x25,0xe0,0xbb,0xa2, + 0x24,0x74,0xee,0xb9,0x36,0x13,0x9e,0x78,0xe9,0x69,0xc8,0x86,0x4d,0xb4,0x3e,0xc, + 0x23,0xac,0x9d,0xd0,0xf7,0xe7,0x13,0x71,0x57,0x5,0x1c,0x8a,0x2d,0x48,0x2c,0x5e, + 0x63,0xb7,0x8f,0xd5,0x10,0x87,0x65,0xb8,0x5,0x49,0xed,0x49,0xb9,0x94,0x9d,0x52, + 0x53,0x35,0x44,0xb6,0xf,0x9c,0x29,0x2d,0xe7,0xea,0x21,0x6e,0x2b,0x43,0xe7,0x3c, + 0x42,0x48,0x2,0x44,0x2e,0x31,0x6f,0xed,0x3,0x35,0x10,0xf1,0x2f,0xd9,0xac,0xf2, + 0x46,0x7a,0x97,0x85,0x28,0x9,0xc7,0x47,0x3a,0x61,0x89,0x27,0xe2,0x3e,0x90,0xf9, + 0xba,0x52,0x88,0xad,0x27,0x52,0x1e,0x10,0x44,0x44,0xde,0xfb,0x75,0x3c,0x7e,0x53, + 0x5a,0xeb,0x5,0x40,0x8,0xf1,0x75,0xe3,0xac,0x3f,0x4,0x86,0xac,0xd2,0xf0,0x7, + 0xf3,0xd4,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + +}; + +static const unsigned char qt_resource_name[] = { + // images + 0x0,0x6, + 0x7,0x3,0x7d,0xc3, + 0x0,0x69, + 0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73, + // mouse.png + 0x0,0x9, + 0xc,0x98,0xbf,0x87, + 0x0,0x6d, + 0x0,0x6f,0x0,0x75,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // saveas.png + 0x0,0xa, + 0xb,0x8d,0x66,0xc7, + 0x0,0x73, + 0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x61,0x0,0x73,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // close.png + 0x0,0x9, + 0x6,0x98,0x83,0x27, + 0x0,0x63, + 0x0,0x6c,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // wireframe.png + 0x0,0xd, + 0xc,0x29,0x2d,0xa7, + 0x0,0x77, + 0x0,0x69,0x0,0x72,0x0,0x65,0x0,0x66,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // leftview.png + 0x0,0xc, + 0x1,0xa1,0xe0,0xc7, + 0x0,0x6c, + 0x0,0x65,0x0,0x66,0x0,0x74,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // open.png + 0x0,0x8, + 0x6,0xc1,0x59,0x87, + 0x0,0x6f, + 0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // redo.png + 0x0,0x8, + 0xb,0xb2,0x58,0x47, + 0x0,0x72, + 0x0,0x65,0x0,0x64,0x0,0x6f,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // backview.png + 0x0,0xc, + 0x2,0xc9,0x12,0xc7, + 0x0,0x62, + 0x0,0x61,0x0,0x63,0x0,0x6b,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // transparency.png + 0x0,0x10, + 0xf,0xfb,0xa4,0xc7, + 0x0,0x74, + 0x0,0x72,0x0,0x61,0x0,0x6e,0x0,0x73,0x0,0x70,0x0,0x61,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x63,0x0,0x79,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // cut.png + 0x0,0x7, + 0xa,0xc7,0x57,0x87, + 0x0,0x63, + 0x0,0x75,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // magic.png + 0x0,0x9, + 0xd,0xf6,0xb1,0xa7, + 0x0,0x6d, + 0x0,0x61,0x0,0x67,0x0,0x69,0x0,0x63,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // color.png + 0x0,0x9, + 0x3,0x65,0x83,0x87, + 0x0,0x63, + 0x0,0x6f,0x0,0x6c,0x0,0x6f,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // szoom.png + 0x0,0x9, + 0x6,0x60,0xa1,0x67, + 0x0,0x73, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // selected2ghost.png + 0x0,0x12, + 0xd,0xb8,0xe2,0x27, + 0x0,0x73, + 0x0,0x65,0x0,0x6c,0x0,0x65,0x0,0x63,0x0,0x74,0x0,0x65,0x0,0x64,0x0,0x32,0x0,0x67,0x0,0x68,0x0,0x6f,0x0,0x73,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e, + 0x0,0x67, + // save.png + 0x0,0x8, + 0x8,0xc8,0x58,0x67, + 0x0,0x73, + 0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // splash.png + 0x0,0xa, + 0x8,0x94,0x19,0x7, + 0x0,0x73, + 0x0,0x70,0x0,0x6c,0x0,0x61,0x0,0x73,0x0,0x68,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // line.png + 0x0,0x8, + 0x0,0x48,0x59,0x27, + 0x0,0x6c, + 0x0,0x69,0x0,0x6e,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // gotocell.png + 0x0,0xc, + 0x9,0xe2,0x3c,0x67, + 0x0,0x67, + 0x0,0x6f,0x0,0x74,0x0,0x6f,0x0,0x63,0x0,0x65,0x0,0x6c,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // rightarrow.png + 0x0,0xe, + 0x6,0xd9,0x18,0x47, + 0x0,0x72, + 0x0,0x69,0x0,0x67,0x0,0x68,0x0,0x74,0x0,0x61,0x0,0x72,0x0,0x72,0x0,0x6f,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // frontview.png + 0x0,0xd, + 0x4,0xe6,0xe1,0x67, + 0x0,0x66, + 0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x74,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // topview.png + 0x0,0xb, + 0xf,0x40,0x98,0xc7, + 0x0,0x74, + 0x0,0x6f,0x0,0x70,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // bringtofront.png + 0x0,0x10, + 0xf,0x9b,0x88,0x67, + 0x0,0x62, + 0x0,0x72,0x0,0x69,0x0,0x6e,0x0,0x67,0x0,0x74,0x0,0x6f,0x0,0x66,0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // panview.png + 0x0,0xb, + 0xf,0x27,0x5c,0xc7, + 0x0,0x70, + 0x0,0x61,0x0,0x6e,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // rotate.png + 0x0,0xa, + 0x8,0xab,0x7a,0x7, + 0x0,0x72, + 0x0,0x6f,0x0,0x74,0x0,0x61,0x0,0x74,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // bottomview.png + 0x0,0xe, + 0x2,0xc0,0x84,0x87, + 0x0,0x62, + 0x0,0x6f,0x0,0x74,0x0,0x74,0x0,0x6f,0x0,0x6d,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // decompose.png + 0x0,0xd, + 0x3,0xe4,0x9e,0x7, + 0x0,0x64, + 0x0,0x65,0x0,0x63,0x0,0x6f,0x0,0x6d,0x0,0x70,0x0,0x6f,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // openNew.png + 0x0,0xb, + 0x4,0x26,0x8f,0x27, + 0x0,0x6f, + 0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x4e,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // dzoom.png + 0x0,0x9, + 0x6,0x60,0x8f,0x67, + 0x0,0x64, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // convert.png + 0x0,0xb, + 0xc,0x43,0x9c,0xc7, + 0x0,0x63, + 0x0,0x6f,0x0,0x6e,0x0,0x76,0x0,0x65,0x0,0x72,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // print.png + 0x0,0x9, + 0x0,0x57,0xb8,0x67, + 0x0,0x70, + 0x0,0x72,0x0,0x69,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // sendtoback.png + 0x0,0xe, + 0xf,0xd,0x22,0x27, + 0x0,0x73, + 0x0,0x65,0x0,0x6e,0x0,0x64,0x0,0x74,0x0,0x6f,0x0,0x62,0x0,0x61,0x0,0x63,0x0,0x6b,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // shading.png + 0x0,0xb, + 0x0,0xbd,0x98,0x27, + 0x0,0x73, + 0x0,0x68,0x0,0x61,0x0,0x64,0x0,0x69,0x0,0x6e,0x0,0x67,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // rightview.png + 0x0,0xd, + 0xe,0x35,0xa1,0x27, + 0x0,0x72, + 0x0,0x69,0x0,0x67,0x0,0x68,0x0,0x74,0x0,0x76,0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // select.png + 0x0,0xa, + 0xb,0xa8,0x6f,0x7, + 0x0,0x73, + 0x0,0x65,0x0,0x6c,0x0,0x65,0x0,0x63,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // undo.png + 0x0,0x8, + 0x4,0xb2,0x58,0xc7, + 0x0,0x75, + 0x0,0x6e,0x0,0x64,0x0,0x6f,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // past.png + 0x0,0x8, + 0x8,0xa7,0x59,0x87, + 0x0,0x70, + 0x0,0x61,0x0,0x73,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // ghost2displayed.png + 0x0,0x13, + 0xe,0x79,0x2f,0x7, + 0x0,0x67, + 0x0,0x68,0x0,0x6f,0x0,0x73,0x0,0x74,0x0,0x32,0x0,0x64,0x0,0x69,0x0,0x73,0x0,0x70,0x0,0x6c,0x0,0x61,0x0,0x79,0x0,0x65,0x0,0x64,0x0,0x2e,0x0,0x70, + 0x0,0x6e,0x0,0x67, + // izoom.png + 0x0,0x9, + 0x6,0x60,0xb5,0x67, + 0x0,0x69, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // export.png + 0x0,0xa, + 0x6,0x9a,0xc9,0xa7, + 0x0,0x65, + 0x0,0x78,0x0,0x70,0x0,0x6f,0x0,0x72,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // draw.png + 0x0,0x8, + 0x8,0x8a,0x5a,0x27, + 0x0,0x64, + 0x0,0x72,0x0,0x61,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // document.png + 0x0,0xc, + 0x9,0x3c,0xf,0x27, + 0x0,0x64, + 0x0,0x6f,0x0,0x63,0x0,0x75,0x0,0x6d,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // scolor.png + 0x0,0xa, + 0x3,0x6a,0x63,0x87, + 0x0,0x73, + 0x0,0x63,0x0,0x6f,0x0,0x6c,0x0,0x6f,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // delete.png + 0x0,0xa, + 0xc,0xad,0xf,0x7, + 0x0,0x64, + 0x0,0x65,0x0,0x6c,0x0,0x65,0x0,0x74,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // copy.png + 0x0,0x8, + 0x6,0x7c,0x5a,0x7, + 0x0,0x63, + 0x0,0x6f,0x0,0x70,0x0,0x79,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // person.png + 0x0,0xa, + 0xa,0x6f,0x8e,0x67, + 0x0,0x70, + 0x0,0x65,0x0,0x72,0x0,0x73,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // fitall.png + 0x0,0xa, + 0x8,0x22,0xf6,0x7, + 0x0,0x66, + 0x0,0x69,0x0,0x74,0x0,0x61,0x0,0x6c,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // wzoom.png + 0x0,0x9, + 0x6,0x60,0xa9,0x67, + 0x0,0x77, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // material.png + 0x0,0xc, + 0x1,0xe,0xe,0x47, + 0x0,0x6d, + 0x0,0x61,0x0,0x74,0x0,0x65,0x0,0x72,0x0,0x69,0x0,0x61,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // leftarrow.png + 0x0,0xd, + 0xc,0x15,0x7,0xa7, + 0x0,0x6c, + 0x0,0x65,0x0,0x66,0x0,0x74,0x0,0x61,0x0,0x72,0x0,0x72,0x0,0x6f,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // VG.png + 0x0,0x6, + 0x5,0xaa,0x57,0x47, + 0x0,0x56, + 0x0,0x47,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // new.png + 0x0,0x7, + 0x4,0xca,0x57,0xa7, + 0x0,0x6e, + 0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // viewall.png + 0x0,0xb, + 0x8,0xd6,0xae,0xe7, + 0x0,0x76, + 0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x61,0x0,0x6c,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // find.png + 0x0,0x8, + 0x0,0x47,0x5a,0xe7, + 0x0,0x66, + 0x0,0x69,0x0,0x6e,0x0,0x64,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // viewselectedonly.png + 0x0,0x14, + 0xd,0x57,0x7f,0xc7, + 0x0,0x76, + 0x0,0x69,0x0,0x65,0x0,0x77,0x0,0x73,0x0,0x65,0x0,0x6c,0x0,0x65,0x0,0x63,0x0,0x74,0x0,0x65,0x0,0x64,0x0,0x6f,0x0,0x6e,0x0,0x6c,0x0,0x79,0x0,0x2e, + 0x0,0x70,0x0,0x6e,0x0,0x67, + // icon.png + 0x0,0x8, + 0xa,0x61,0x5a,0xa7, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // axe_box.png + 0x0,0xb, + 0x9,0xba,0x81,0xe7, + 0x0,0x61, + 0x0,0x78,0x0,0x65,0x0,0x5f,0x0,0x62,0x0,0x6f,0x0,0x78,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // ozoom.png + 0x0,0x9, + 0x6,0x60,0xb9,0x67, + 0x0,0x6f, + 0x0,0x7a,0x0,0x6f,0x0,0x6f,0x0,0x6d,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, + // :/images + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x39,0x0,0x0,0x0,0x2, + // :/images/find.png + 0x0,0x0,0x5,0xa4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x17,0x38, + // :/images/line.png + 0x0,0x0,0x1,0xc0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xce,0x89, + // :/images/print.png + 0x0,0x0,0x3,0x40,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xee,0xa, + // :/images/shading.png + 0x0,0x0,0x3,0x7a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf2,0x60, + // :/images/material.png + 0x0,0x0,0x5,0x24,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0xb,0x69, + // :/images/leftview.png + 0x0,0x0,0x0,0x7c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb,0x70, + // :/images/bottomview.png + 0x0,0x0,0x2,0xae,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xdc,0x1a, + // :/images/backview.png + 0x0,0x0,0x0,0xc6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x13,0x26, + // :/images/color.png + 0x0,0x0,0x1,0x36,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1f,0x91, + // :/images/scolor.png + 0x0,0x0,0x4,0x8e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x1,0x6b, + // :/images/decompose.png + 0x0,0x0,0x2,0xd0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xdd,0xaf, + // :/images/openNew.png + 0x0,0x0,0x2,0xf0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xe1,0xdb, + // :/images/undo.png + 0x0,0x0,0x3,0xd0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf5,0xa8, + // :/images/new.png + 0x0,0x0,0x5,0x74,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x13,0x94, + // :/images/frontview.png + 0x0,0x0,0x2,0x16,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd4,0xba, + // :/images/VG.png + 0x0,0x0,0x5,0x62,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0xf,0x4b, + // :/images/dzoom.png + 0x0,0x0,0x3,0xc,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xe7,0x32, + // :/images/szoom.png + 0x0,0x0,0x1,0x4e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x20,0x78, + // :/images/wzoom.png + 0x0,0x0,0x5,0xc,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x9,0xd8, + // :/images/izoom.png + 0x0,0x0,0x4,0x28,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf9,0xab, + // :/images/ozoom.png + 0x0,0x0,0x6,0x1a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x36,0x3f, + // :/images/copy.png + 0x0,0x0,0x4,0xc2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x5,0x4c, + // :/images/close.png + 0x0,0x0,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x8,0x92, + // :/images/export.png + 0x0,0x0,0x4,0x40,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xfb,0x4d, + // :/images/open.png + 0x0,0x0,0x0,0x9a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd,0xe, + // :/images/rightarrow.png + 0x0,0x0,0x1,0xf4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd2,0x1b, + // :/images/fitall.png + 0x0,0x0,0x4,0xf2,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x7,0x60, + // :/images/draw.png + 0x0,0x0,0x4,0x5a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xfd,0xc6, + // :/images/splash.png + 0x0,0x0,0x1,0xa6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x25,0xf9, + // :/images/past.png + 0x0,0x0,0x3,0xe6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf6,0x90, + // :/images/rotate.png + 0x0,0x0,0x2,0x94,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xda,0x64, + // :/images/save.png + 0x0,0x0,0x1,0x90,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x23,0xf3, + // :/images/viewall.png + 0x0,0x0,0x5,0x88,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x15,0xa6, + // :/images/document.png + 0x0,0x0,0x4,0x70,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xff,0x2e, + // :/images/axe_box.png + 0x0,0x0,0x5,0xfe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x34,0xc5, + // :/images/gotocell.png + 0x0,0x0,0x1,0xd6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xcf,0xc, + // :/images/icon.png + 0x0,0x0,0x5,0xe8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x1c,0x48, + // :/images/person.png + 0x0,0x0,0x4,0xd8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x6,0x80, + // :/images/cut.png + 0x0,0x0,0x1,0xa,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1a,0xa9, + // :/images/saveas.png + 0x0,0x0,0x0,0x2a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x4,0xf, + // :/images/select.png + 0x0,0x0,0x3,0xb6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf5,0x37, + // :/images/redo.png + 0x0,0x0,0x0,0xb0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x12,0x3d, + // :/images/leftarrow.png + 0x0,0x0,0x5,0x42,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0xc,0x92, + // :/images/wireframe.png + 0x0,0x0,0x0,0x5c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9,0xd3, + // :/images/convert.png + 0x0,0x0,0x3,0x24,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xe8,0xde, + // :/images/mouse.png + 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, + // :/images/delete.png + 0x0,0x0,0x4,0xa8,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x2,0x7, + // :/images/viewselectedonly.png + 0x0,0x0,0x5,0xba,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x1a,0x8c, + // :/images/selected2ghost.png + 0x0,0x0,0x1,0x66,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x22,0x2e, + // :/images/magic.png + 0x0,0x0,0x1,0x1e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1b,0x96, + // :/images/rightview.png + 0x0,0x0,0x3,0x96,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf3,0x98, + // :/images/ghost2displayed.png + 0x0,0x0,0x3,0xfc,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf7,0xd8, + // :/images/sendtoback.png + 0x0,0x0,0x3,0x58,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xf1,0x1a, + // :/images/panview.png + 0x0,0x0,0x2,0x78,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd9,0x22, + // :/images/topview.png + 0x0,0x0,0x2,0x36,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd6,0x65, + // :/images/bringtofront.png + 0x0,0x0,0x2,0x52,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xd7,0xf9, + // :/images/transparency.png + 0x0,0x0,0x0,0xe4,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x14,0xd3, + +}; + +QT_BEGIN_NAMESPACE + +extern Q_CORE_EXPORT bool qRegisterResourceData + (int, const unsigned char *, const unsigned char *, const unsigned char *); + +extern Q_CORE_EXPORT bool qUnregisterResourceData + (int, const unsigned char *, const unsigned char *, const unsigned char *); + +QT_END_NAMESPACE + + +int QT_MANGLE_NAMESPACE(qInitResources)() +{ + QT_PREPEND_NAMESPACE(qRegisterResourceData) + (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources)) + +int QT_MANGLE_NAMESPACE(qCleanupResources)() +{ + QT_PREPEND_NAMESPACE(qUnregisterResourceData) + (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources)) + diff --git a/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_AddToMGDialog.cxx b/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_AddToMGDialog.cxx new file mode 100644 index 0000000..77ce3a0 --- /dev/null +++ b/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_AddToMGDialog.cxx @@ -0,0 +1,50 @@ +/* + * QMcCadGeomeTree_AddToMGDialog.cxx + * + * Created on: Mar 4, 2009 + * Author: grosse + */ + +#include +#include + +QMcCadGeomeTree_AddToMGDialog::QMcCadGeomeTree_AddToMGDialog(QWidget* parent) : QDialog(parent) +{ + myAddDialog.setupUi(this); + myListWidget = myAddDialog.listWidget; +} + +void QMcCadGeomeTree_AddToMGDialog::PopulateList(QTreeWidgetItem* theTWI) +{ + myCurrentTWI = theTWI; + + for(int i=0; i < myCurrentTWI->childCount(); i++) + { + QTreeWidgetItem* curTWI = theTWI->child(i); + myListWidget->addItem(curTWI->text(0)); + connect(myListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(accept())); + } +} + + +QTreeWidgetItem* QMcCadGeomeTree_AddToMGDialog::GetSelected() +{ + QTreeWidgetItem* curTWI = NULL; + + for(int i=0; i < myCurrentTWI->childCount(); i++) + { + curTWI = myCurrentTWI->child(i); + + QList selectedItems = myListWidget->selectedItems(); + + if(selectedItems.count() < 1 ) + return NULL; + + QListWidgetItem* selected = selectedItems.at(0); + + if(curTWI->text(0) == selected->text()) + return curTWI; + } + + return curTWI; +} diff --git a/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_TreeView.ui b/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_TreeView.ui new file mode 100644 index 0000000..2e149a7 --- /dev/null +++ b/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_TreeView.ui @@ -0,0 +1,56 @@ + + + + + Form + + + + 0 + 0 + 241 + 761 + + + + Form + + + + + 0 + 0 + 241 + 761 + + + + true + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + true + + + true + + + QAbstractItemView::MultiSelection + + + QAbstractItemView::SelectItems + + + + + + + diff --git a/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_TreeWidget.cxx b/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_TreeWidget.cxx new file mode 100644 index 0000000..9bfdb6b --- /dev/null +++ b/src/MCCAD/QMcCadGeomeTree/QMcCadGeomeTree_TreeWidget.cxx @@ -0,0 +1,1241 @@ +/* + * QMcCadGeomeTree_TreeView.cxx + * + * Created on: Jan 21, 2009 + * Author: grosse + * + * Purpose : QMcCadGeomeTree_TreeWidget inherits QTreeWidget. It displays the shape names and additional information, like + * grouping, material and density numbers, surface and cell numbers after decomposition. + * + * One of the basic fields of QMcCadGeomeTree_TreeWidget is the QMap which maps an extended label to an QTreeWidgetItem* . + * Extended Labels are TCollection_AsciiStrings which store the information about the editor they belong to and the label + * they correspond to in the Editors TDocStd_Document. The root label of Editor five e.g. would look like this: + * 5_0:1:1:1:1. All digits in front of the '_' denote the Editor, all digits after the '_' corespond directly to the labels + * entry. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +TCollection_AsciiString SHAPEROOT("_0:1:1:1:1"); //Shapes Label in xml document : OCC Standard! +TCollection_AsciiString MCARDROOT("0:1:1:1:6"); + + +/** + * Creates an QMcCadGeomeTree_TreeWidget + */ +QMcCadGeomeTree_TreeWidget::QMcCadGeomeTree_TreeWidget(QWidget* theParent) : QWidget(theParent) +{ + theTreeWidget.setupUi(this); + myTreeWidget = theTreeWidget.myTreeWidget; + //myTreeWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + //myTreeWidget->setRootIsDecorated(false); + //myTreeWidget->setAlternatingRowColors(true); + + myTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); + + + myTreeWidget->setSortingEnabled(false); + //connect(myTreeWidget, SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(SlotOnClickRButton(const QPoint))); + + connect(myTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(SlotSelectionChanged())); + connect(myTreeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(SlotItemNameChanged(QTreeWidgetItem*, int))); + mySignalSelectionChangedLocked = false; + + //myAddMaterialMembershipIsLocked = false; + //connect(myTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(SlotEditMCard(QTreeWidgetItem*))); + + connect(myTreeWidget, SIGNAL(customContextMenuRequested(QPoint)),this, SLOT(SlotOnClickRButton(const QPoint))); + myItemDoubleClicked = false; + myLock = false; + + pMcDialog.reset(new McCadMatManageDlg()); +} + +void QMcCadGeomeTree_TreeWidget::SlotOnClickRButton(const QPoint &point) +{ + QMenu *rButtonMenu = new QMenu(myTreeWidget); + QModelIndex indexSelect = myTreeWidget->indexAt(point); + QModelIndex indexParent = indexSelect.parent(); + + QString QStrParentItem, QStrSelectItem; + QStrParentItem = indexParent.data().toString(); + QStrSelectItem = indexSelect.data().toString(); + + m_strSelectedItem = QStrSelectItem; + if (QStrParentItem == "Geometry") // Lei xiugai + { + QAction *showAction = new QAction("&Edit Material",this); + rButtonMenu->addAction(showAction); + connect(showAction,SIGNAL(triggered()),this,SLOT(SlotEditMaterialCards())); + rButtonMenu->addSeparator(); + QAction *showActionSave = new QAction("&Save Materials",this); + QAction *showActionLoad = new QAction("&Load Materials",this); + rButtonMenu->addAction(showActionSave); + rButtonMenu->addAction(showActionLoad); + connect(showActionSave,SIGNAL(triggered()),this,SLOT(SlotSaveMaterials())); + connect(showActionLoad,SIGNAL(triggered()),this,SLOT(SlotLoadMaterials())); + + rButtonMenu->exec(QCursor::pos()); + } +} + + +/** + * Register a new QMcCad_Editor. In this function a newly created Editor with the id theID is added to the treewidget + */ +void QMcCadGeomeTree_TreeWidget::AddEditor(int theID, QString theName) +{ + QTreeWidgetItem* newItem = new QTreeWidgetItem(myTreeWidget); + newItem->setText(0,theName); + newItem->setFlags(Qt::ItemIsSelectable); + newItem->setTextColor(0,Qt::black); + newItem->setFlags(Qt::ItemIsEnabled); + + QFont bigFont; + bigFont.setBold(true); + + QIcon editorIcon(":images/document.png"); + + newItem->setFont(0,bigFont); + newItem->setIcon(0,editorIcon); + myTreeWidget->setItemExpanded(newItem, true); + newItem->setBackgroundColor(0,Qt::darkCyan); + + /*QTreeWidgetItem* mCards = new QTreeWidgetItem(newItem); + mCards->setText(0,"Material Cards"); + mCards->setFont(0,bigFont); + mCards->setTextColor(0,Qt::gray);*/ + /*QTreeWidgetItem* mGroups = new QTreeWidgetItem(newItem); + mGroups->setText(0,"Material Groups"); + mGroups->setFont(0,bigFont); + mGroups->setTextColor(0,Qt::gray); + mGroups->setFlags(Qt::ItemIsEnabled); + QTreeWidgetItem* voids = new QTreeWidgetItem(mGroups); + voids->setText(0,"Void"); + voids->setTextColor(0,Qt::blue); + voids->setFlags(Qt::ItemIsEnabled);*/ + QTreeWidgetItem* geometry = new QTreeWidgetItem(newItem); + geometry->setText(0,"Geometry"); + geometry->setFont(0,bigFont); + geometry->setFlags(Qt::ItemIsEnabled); + myTreeWidget->setItemExpanded(geometry, true); + + TCollection_AsciiString id(theID); + id += SHAPEROOT; + m_EditorItemMap[id] = geometry; + myReadDocument = false; +} + + +/** + * Removes a registered Editor + */ +void QMcCadGeomeTree_TreeWidget::RemoveEditor(int theID) +{ + GetEditor(theID)->DeleteTreeItem(); + TCollection_AsciiString id(theID); + id += SHAPEROOT; + + QTreeWidgetItem * pItemPrt = NULL; + QTreeWidgetItem * pItemCld = NULL; + pItemPrt = (m_EditorItemMap[id])->parent(); + pItemCld = (m_EditorItemMap[id]); + delete pItemCld; + delete pItemPrt; + pItemPrt = NULL; + pItemCld = NULL; + + QMap::const_iterator iter; + m_EditorItemMap.erase(m_EditorItemMap.find(id)); + +} + + + +/** + * Load/Reload the TDocStd_Document from the QMcCad_Editor with the id theID. And show its content in the treewidget. + */ + + + +/** ******************************************************************** +* @brief +* @param +* @return +* +* @date 21/11/2013 +* @author Lei Lu +* @modify Lei Lu +***********************************************************************/ + +void QMcCadGeomeTree_TreeWidget::LoadDocument(int theID) +{ + TCollection_AsciiString id = TCollection_AsciiString(theID) + SHAPEROOT; + QTreeWidgetItem* shapeRoot = m_EditorItemMap[id]; + QTreeWidgetItem* currentRoot; + + //reload the document + QMcCad_Editor* theEditor = GetEditor(theID); + Handle(TDocStd_Document) theTDoc = theEditor->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + TCollection_AsciiString prefix(theID); + prefix += "_"; + + TDF_LabelSequence freeShapes; + sTool->GetFreeShapes(freeShapes); + + Standard_GUID theNameGUID = TDataStd_Name::GetID(); + Handle(TDataStd_Name) tmpName; + TCollection_AsciiString theName; + TCollection_AsciiString labelName; + + //Load MCards + //myReadDocument = true; + // LoadMCards(); // lei 11/10/2013 + myReadDocument = false; + + McCadXCAF_TDocShapeLabelIterator slIter(theTDoc); //iterate through all shapes in theTDoc + + QTreeWidgetItem* newRootItem = NULL; + for(;slIter.More(); slIter.Next()) + { + TDF_Label curL = slIter.Current(); + TDF_Tool::Entry(curL, labelName); + if(curL.FindAttribute(theNameGUID, tmpName)) + theName = tmpName->Get(); + else + theName = labelName; + id = prefix + labelName; + + //cout << labelName.ToCString() << endl; + if(sTool->IsTopLevel(curL)) // free shapes + { + currentRoot = shapeRoot; + } + else + { + TDF_Label father = curL.Father(); + TCollection_AsciiString extLab; + TDF_Tool::Entry(father, extLab); + extLab.Prepend(prefix); + currentRoot = myIDLabelItemMap[extLab]; + } + + TCollection_AsciiString strItemName("Solid "); + strItemName += theName; + QTreeWidgetItem* newItem = MakeNewTreeWidgetItem(strItemName, newRootItem); + theEditor->AddTreeItem(id,newItem); + } +} + +// Added by Lei 25.10.2013 +void QMcCadGeomeTree_TreeWidget::UpdateTreeWidget(int theID, int iBegin, int &iEnd, TCollection_AsciiString MatGroupName) +{ + TCollection_AsciiString id = TCollection_AsciiString(theID) + SHAPEROOT; + QTreeWidgetItem* shapeRoot = m_EditorItemMap[id]; + QTreeWidgetItem* currentRoot; + + //reload the document + QMcCad_Editor* theEditor = GetEditor(theID); + Handle(TDocStd_Document) theTDoc = theEditor->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + TCollection_AsciiString prefix(theID); + prefix += "_"; + + TDF_LabelSequence freeShapes; + sTool->GetFreeShapes(freeShapes); + + //Standard_GUID theNameGUID = TDataStd_Name::GetID(); + Handle(TDataStd_Name) tmpName; + //TCollection_AsciiString theName; + TCollection_AsciiString labelName; + myReadDocument = false; + + McCadXCAF_TDocShapeLabelIterator slIter(theTDoc); //iterate through all shapes in theTDoc + + QTreeWidgetItem* newGroupItem = MakeNewTreeWidgetItem(MatGroupName, shapeRoot); + QFont itemFont; + itemFont.setBold(true); + newGroupItem->setFont(0,itemFont); + + iEnd = slIter.NumberOfShapes(); + int index_solid = 0; + for(int i = iBegin+1; i <= iEnd; i++) + { + TDF_Label curL = slIter.GetAt(i); + TDF_Tool::Entry(curL, labelName); + id = prefix + labelName; + + TDataStd_Name::Set(curL, MatGroupName);// for color and tree item, Lei Lu 20/11/2013 + if(sTool->IsTopLevel(curL)) // free shapes + { + currentRoot = shapeRoot; + } + else + { + TDF_Label father = curL.Father(); + TCollection_AsciiString extLab; + TDF_Tool::Entry(father, extLab); + extLab.Prepend(prefix); + currentRoot = myIDLabelItemMap[extLab]; + } + + TCollection_AsciiString strItemName("Solid "); + strItemName += TCollection_AsciiString(++index_solid); + QTreeWidgetItem* newItem = MakeNewTreeWidgetItem(strItemName, newGroupItem); + theEditor->AddTreeItem(id,newItem); + } +} + + + +/** + * Updates the documet structure (deleted shapes will be removed, etc.) + */ +void QMcCadGeomeTree_TreeWidget::UpdateDocument(int theID, QList label_list) +{ + myLock=true; + + QMcCad_Editor *pEdit = GetEditor(theID); + for(int i = 0; i < label_list.size(); i++) + { + pEdit->DeleteSelectedItem(label_list.at(i)); + } + + myLock=false; + // LoadDocument(theID); +} + + +/** + * + */ +//void QMcCadGeomeTree_TreeWidget::RedisplaySelected() +void QMcCadGeomeTree_TreeWidget::GetSelected(AIS_ListOfInteractive& ioList) +{ + QList itemList; + itemList = myTreeWidget->selectedItems(); + + TCollection_AsciiString theExtendedEntry; + Handle(AIS_InteractiveContext) theIC; + + for(int i=0; iGetDocument()->GetContext(); + + AIS_ListOfInteractive colList; + theIC->ObjectsInCollector(colList); + + Handle(TDF_Data) theData = curEd->GetDocument()->GetTDoc()->GetData(); + //Handle(TPrsStd_AISPresentation) aPres; + TDF_Label curLab; + TDF_Tool::Label(theData, theExtendedEntry, curLab); + + Handle(TNaming_NamedShape) nShp; + + if(! curLab.FindAttribute(TNaming_NamedShape::GetID(), nShp)) + continue; + + TopoDS_Shape refShp = nShp->Get(); // workaround ... + + for(AIS_ListIteratorOfListOfInteractive it(colList); it.More(); it.Next()) + { + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(it.Value()); + TopoDS_Shape curShp = aisShp->Shape(); + + if(curShp.IsEqual(refShp)) + ioList.Append(it.Value()); + } + } +} + + + +/** + * Changes the Name of the Editor Node (QTreeWidgetItem) in myTreeWidget + */ +void QMcCadGeomeTree_TreeWidget::UpdateEditorName(int theID) +{ + TCollection_AsciiString id = TCollection_AsciiString(theID)+ SHAPEROOT; + QTreeWidgetItem* theQTWI = myIDLabelItemMap[id]; + + QMcCad_Editor* ed = GetEditor(); + TCollection_AsciiString theName = ed->GetDocument()->GetDocName(); + if(theName.Search("/")>0) + theName.Remove(1,theName.SearchFromEnd("/")); + if(theName.Search(".")>0) + theName.Remove(theName.SearchFromEnd("."), theName.Length()-theName.SearchFromEnd(".")+1); + + QString qName(theName.ToCString()); + + theQTWI->parent()->setText(0,qName); +} + + +/** + * Retrieves name of selected InteractiveObject + */ +Standard_Boolean QMcCadGeomeTree_TreeWidget::GetNameByIO(const Handle(AIS_InteractiveObject)& theIO, TCollection_AsciiString& theName) +{ + if(!theIO->HasOwner()) //no TPrsStd_AISPresentation, no link to the document, no name + return Standard_False; + + QMcCad_Editor* ed = GetEditor(); + TCollection_AsciiString edID(ed->ID()); + edID += "_"; + + Handle(TPrsStd_AISPresentation) prs = Handle(TPrsStd_AISPresentation::DownCast(theIO->GetOwner())); + + TDF_Label theLab = prs->Label(); + TCollection_AsciiString labEntry; + TDF_Tool::Entry(theLab, labEntry); + + labEntry.Prepend(edID); + + QTreeWidgetItem* curQTWI = myIDLabelItemMap[labEntry]; + QString qName = curQTWI->text(0); + theName = QS2AS(qName); + + return Standard_True; +} + + +/** + * Add a new Material Group, i.e., Name of Material, density and the MCard entry + */ +void QMcCadGeomeTree_TreeWidget::AddMaterialGroup(QString& qName, QString& densName, QString& theMCard) +{ + TCollection_AsciiString asciiMCard = QS2AS(theMCard); + TCollection_AsciiString mName = QS2AS(qName); + TCollection_AsciiString densString = QS2AS(densName); + + Standard_Real density(0.0); + if(mName.Length()<1) + mName= "Material Group"; + + if(densString.IsRealValue()) + density = densString.RealValue(); + else + Mcout("Density not a Real Value. Set to void!"); + + Standard_Integer edID = GetEditor()->ID(); + TCollection_AsciiString extLab(edID); + extLab+=SHAPEROOT; + + QTreeWidgetItem* geomTWI = myIDLabelItemMap[extLab]; + QTreeWidgetItem* matTWI = geomTWI->parent()->child(0); + + for(int i=0; i < matTWI->childCount(); i++) + { + if(qName == matTWI->child(i)->text(0)) + return; + } + + //QTreeWidgetItem* newMCard = MakeNewTreeWidgetItem(mName, matTWI); + //newMCard->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + + if(myReadDocument == true) + return; + + //Set new MCard + Handle(TDF_Data) theData = GetEditor()->GetDocument()->GetTDoc()->GetData(); + TDF_Label mLab; + TCollection_AsciiString newLab = MCARDROOT; + TDF_Tool::Label(theData, newLab, mLab, Standard_True); + + Standard_Integer newTag = mLab.NbChildren(); + newTag++; + newLab += TCollection_AsciiString(":"); + newLab += TCollection_AsciiString(newTag); + TDF_Tool::Label(theData, newLab, mLab, Standard_True); + + //add MCard to TDocument and register label in myIDLabelItemMap + Handle(TDataStd_Name) tMName; + tMName->Set(mLab,mName); + + TDataStd_AsciiString tMCard; + tMCard.Set(mLab, asciiMCard); + + TDataStd_Real theDensity; + theDensity.Set(mLab, density); +} + +/* + * //////////////////////////////////////////////////////////////////////////// + * SLOTS + */ + + +/** + * Report to QMcCad_Editor that the Selection has been changed. The shown items corespond to visualized shapes in the v3d_viewer + * This slot is the one way of adjustment between the v3d_viewer and the qtreewidget. QMcCad_Editor/View should have a slot to adapt + * the content of the QTreeWidget. That way there is only one valid selection of shapes. + * + * Modified by Lei lu at 22.11.2013 +*/ + +void QMcCadGeomeTree_TreeWidget::SlotSelectionChanged() +{ + if(mySignalSelectionChangedLocked || myLock) + { + return; + } + + QList itemList = myTreeWidget->selectedItems(); // Get the selected items + if(itemList.size()<1) + { + return; + } + + Handle(AIS_InteractiveContext) theIC; + TCollection_AsciiString strEntry; // Get the entry of selected solid + Standard_Boolean isFirst = Standard_True; + + if(myItemDoubleClicked == true) + { + myItemDoubleClicked = false; + return; + } + + QMcCad_Editor *pEdit = GetEditor(); // Get the actived editor + for(int i = 0; i < itemList.size(); i++) + { + QTreeWidgetItem* curTWI = itemList.value(i); + strEntry = pEdit->GetSolidFromItem(curTWI); + theIC = pEdit->GetDocument()->GetContext(); + + if(strEntry.IsEmpty()) + { + if(itemList.size()==1) + { + theIC->ClearSelected(Standard_True); + } + continue; + } + + strEntry = strEntry.Split(strEntry.Search("_")); + + // Fill list with Interactive Objects in Viewer (including Collector) + AIS_ListOfInteractive ioList; + AIS_ListOfInteractive tmpList; + + theIC->ObjectsInCollector(tmpList); + theIC->DisplayedObjects(ioList, 0); + ioList.Append(tmpList); + + Handle(TDF_Data) theData = pEdit->GetDocument()->GetTDoc()->GetData(); + + TDF_Label curLab; + TDF_Tool::Label(theData, strEntry, curLab); + + Handle(TNaming_NamedShape) nShp; + if(!curLab.FindAttribute(TNaming_NamedShape::GetID(), nShp)) + { + continue; + } + + TopoDS_Shape refShp = nShp->Get(); + + if(isFirst) + { + isFirst = Standard_False; + theIC->ClearSelected(Standard_False); + } + + for(AIS_ListIteratorOfListOfInteractive it(ioList); it.More(); it.Next()) + { + if(theIC->IsSelected(it.Value())) + { + continue; + } + + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(it.Value()); + TopoDS_Shape curShp = aisShp->Shape(); + + if(curShp.IsEqual(refShp)) + { + theIC->AddOrRemoveSelected(it.Value(), 0); + } + } + } + theIC->UpdateCurrentViewer(); +} + + +/** + * Make selection consistent with the visual selection in V3d_View + */ +void QMcCadGeomeTree_TreeWidget::SlotVisuSelectionChanged() +{ + LockSignalSelectionChanged(); //make sure no update-recursion begins + + QMcCad_Editor* ed = GetEditor(); + Handle(AIS_InteractiveContext) theIC = ed->GetDocument()->GetContext(); + +// int i = theIC->NbCurrents(); +// QMessageBox msg; +// msg.setText(QString::number(i)); +// msg.exec(); + + TCollection_AsciiString edID(ed->ID()); + edID += "_"; + + Handle(TDocStd_Document) theTDoc = ed->GetDocument()->GetTDoc(); + Handle(XCAFDoc_ShapeTool) _sTool = XCAFDoc_DocumentTool::ShapeTool(theTDoc->Main()); + + //deselect originaly selected items + QList initSelected = myTreeWidget->selectedItems(); + QList::const_iterator iter; + + for(iter = initSelected.constBegin(); iter != initSelected.constEnd(); ++iter) + myTreeWidget->setItemSelected(*iter,false); + + //select visual selected + for(theIC->InitCurrent(); theIC->MoreCurrent(); theIC->NextCurrent()) + { + Handle(AIS_InteractiveObject) curIO = theIC->Current(); + //Handle(TPrsStd_AISPresentation) curPres = Handle(TPrsStd_AISPresentation::DownCast(curIO->GetOwner())); + + Handle(AIS_Shape) aisShp = Handle(AIS_Shape)::DownCast(curIO); + TopoDS_Shape theShp = aisShp->Shape(); + TDF_Label theLab = _sTool->FindShape(theShp,1); + + //= curPres->Label(); + TCollection_AsciiString labEntry; + TDF_Tool::Entry(theLab, labEntry); + + labEntry.Prepend(edID); + + QTreeWidgetItem* curQTWI = ed->GetTreeItem(labEntry); + //QTreeWidgetItem* curQTWI = myIDLabelItemMap[labEntry]; + myTreeWidget->setItemSelected(curQTWI, true); + } + + UnlockSignalSelectionChanged(); +} + + +/** + * Forwards name changing from tree widget item to TDocument + */ +void QMcCadGeomeTree_TreeWidget::SlotItemNameChanged(QTreeWidgetItem * item, int column) +{ + TCollection_AsciiString extLab = GetItemLabelEntry(item); + if(extLab.Length() < 1 || extLab.Search('_') < 1) + return; + + QString qName = item->text(0); + + if(qName.isNull()) + return; + + TCollection_AsciiString newName = QS2AS(qName); + TCollection_AsciiString theNum = extLab; + //cout << theNum.ToCString() << endl; + extLab = theNum.Split(extLab.Search("_")); + theNum.RemoveAll('_'); + + if(!theNum.IsIntegerValue()) + Mcout("Not an integer value!!!"); + + Standard_Integer edID = theNum.IntegerValue(); + QMcCad_Editor* ed = GetEditor(edID); + + Handle(TDataStd_Name) curName; + Handle(TDF_Data) theData = ed->GetDocument()->GetTDoc()->GetData(); + TDF_Label theLab; + TDF_Tool::Label(theData, extLab, theLab); + + if(theLab.FindAttribute(TDataStd_Name::GetID(),curName)) + theLab.ForgetAttribute(curName); + + TCollection_ExtendedString extName(newName.ToCString()); + curName->Set(extName); + theLab.AddAttribute(curName); + + //update name in material section + /////////////////////////////////////////// +/* QString oldName = myDoubleClickedItemName; + oldName += " "; + qName += " "; + + TCollection_AsciiString shpRoot = TCollection_AsciiString(edID) + SHAPEROOT; + QTreeWidgetItem* matTWI = m_EditorItemMap[shpRoot]->parent()->child(0); + + int num = matTWI->childCount(); + + for(int i = 0; i < num; i++) + { + QTreeWidgetItem* curChild = matTWI->child(i); + for(int j = 0; j < curChild->childCount(); j++) + { + if(curChild->child(j)->text(0) == oldName) + { + curChild->child(j)->setText(0,qName); + return; + } + } + }*/ +} + +/** + * Add a new MCard to current Editor, see AddMaterialGroup() above + */ +void QMcCadGeomeTree_TreeWidget::SlotAddMaterialGroup() +{ + Ui::MCardDialog mcDialog; + QDialog *theDialog = new QDialog; + mcDialog.setupUi(theDialog); + theDialog->exec(); + + McCadMatManageDlg MatDlg(QMcCad_Application::GetAppMainWin()); + MatDlg.exec(); + + QString theMCard = mcDialog.mCardText->toPlainText(); + QString qName = mcDialog.nameEdit->text(); + QString densName = mcDialog.densityEdit->text(); + + AddMaterialGroup(qName, densName, theMCard); +} + + +/** + * Add selected geometries to material group + */ +void QMcCadGeomeTree_TreeWidget::SlotAddToMaterialGroup() +{ + QMcCadGeomeTree_AddToMGDialog theDialog(this); + + QTreeWidgetItem* matTWI = GetMaterialTWI(); + + theDialog.PopulateList(matTWI); + theDialog.exec(); + + // Selected Material + QTreeWidgetItem* selected = theDialog.GetSelected(); + if(selected == NULL) + return; + + QList itemList; + itemList = myTreeWidget->selectedItems(); + + // MCard-Label & Shape_Label + AddToMaterialGroup(selected, itemList); +} + + + +/** + * Load the material information, edit the detail composition. Lei 14/10/2013 + */ +void QMcCadGeomeTree_TreeWidget::SlotEditMaterialCards() +{ + /*Ui::MCardDialog mcDialog; + QDialog *theDialog = new QDialog; + mcDialog.setupUi(theDialog);*/ + // QTreeWidgetItem* itemCur = this-> + if (pMcDialog.get() == NULL) + { + //McCadMatManageDlg *pDlg = new McCadMatManageDlg(QMcCad_Application::GetAppMainWin()); + pMcDialog.reset(new McCadMatManageDlg()); + } + + pMcDialog->SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + pMcDialog->SetEditGroup(m_strSelectedItem); // Set which materia group being edited. + pMcDialog->LoadMaterials(m_strSelectedItem); // Load the material ID list. + pMcDialog->exec(); + + //QTreeWidgetItem* simItem = new QTreeWidgetItem(); + //simItem->setText(0,"TEST"); + //mcDialog.mMatTree->addTopLevelItem(simItem); + + //theDialog->exec(); + + //QString theMCard = mcDialog.mCardText->toPlainText(); + //QString qName = mcDialog.nameEdit->text(); + //QString densName = mcDialog.densityEdit->text(); + + //AddMaterialGroup(qName, densName, theMCard); +} + +/** ****************************************************** + * Save the materials into XML file. Lei Lu 18/11/2013 + *********************************************************/ +void QMcCadGeomeTree_TreeWidget::SlotSaveMaterials() +{ + if (pMcDialog.get() == NULL) + { + pMcDialog.reset(new McCadMatManageDlg()); + } + pMcDialog->SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + pMcDialog->SetEditGroup(m_strSelectedItem); // Set which materia group being edited. + QString strFileName; + pMcDialog->SaveXMLFile(strFileName); + + QString strMsg = QString("Material file: \"%1\" is saved").arg(strFileName); + Mcout(strMsg.toUtf8().constData()); +} + +/** ****************************************************** + * Load the materials into XML file. Lei Lu 18/11/2013 + *********************************************************/ +void QMcCadGeomeTree_TreeWidget::SlotLoadMaterials() +{ + if (pMcDialog.get() == NULL) + { + pMcDialog.reset(new McCadMatManageDlg()); + } + pMcDialog->SetCurrentEditor(QMcCad_Application::GetAppMainWin()->GetEditor()); + pMcDialog->SetEditGroup(m_strSelectedItem); // Set which materia group being edited. + QString strFileName; + pMcDialog->LoadXMLFile(strFileName); + pMcDialog->LoadMaterials(m_strSelectedItem); // Load the material ID list. + pMcDialog->exec(); + + QString strMsg = QString("Material file: \"%1\" is loaded").arg(strFileName); + Mcout(strMsg.toUtf8().constData()); +} + + +/** + * Edit the MCard entries + */ +void QMcCadGeomeTree_TreeWidget::SlotEditMCard(QTreeWidgetItem* theTWI) +{ + myDoubleClickedItemName = theTWI->text(0); + myItemDoubleClicked = true; + + Ui::MCardDialog mcDialog; + QDialog *theDialog = new QDialog; + mcDialog.setupUi(theDialog); + + QString qName = theTWI->text(0); + TCollection_AsciiString mCardName = QS2AS(qName); + + //check children of MCARDROOT for mCardName + Handle(TDF_Data) theData = GetEditor()->GetDocument()->GetTDoc()->GetData(); + + TDF_Label mLab; + TCollection_AsciiString newLab = MCARDROOT; + TDF_Tool::Label(theData, newLab, mLab, Standard_True); + + TCollection_AsciiString anEntry; + TDF_Tool::Entry(mLab, anEntry); + + for( TDF_ChildIterator it( mLab, Standard_False ); it.More(); it.Next() ) + { + TDF_Label curLab = it.Value(); + Handle(TDataStd_Name) curName; + + if(!curLab.FindAttribute(TDataStd_Name::GetID(), curName)) + continue; + + TCollection_AsciiString extName(curName->Get()); + + if(extName.IsEqual(mCardName)) + { + Handle(TDataStd_AsciiString) theMCard; + Handle(TDataStd_Real) theDensity; + + TCollection_AsciiString densStr; + + if(!curLab.FindAttribute(TDataStd_AsciiString::GetID(), theMCard)) + break; + if(!curLab.FindAttribute(TDataStd_Real::GetID(),theDensity)) + densStr = "0.0"; + else + densStr = TCollection_AsciiString(theDensity->Get()); + + + mcDialog.mCardText->setPlainText(theMCard->Get().ToCString()); + mcDialog.densityEdit->setText(densStr.ToCString()); + mcDialog.nameEdit->setText(qName); + theDialog->exec(); + + QString newQName = mcDialog.nameEdit->text(); + TCollection_AsciiString newName = QS2AS(newQName); + + QString qMCard = mcDialog.mCardText->toPlainText(); + TCollection_AsciiString asciiMCard = QS2AS(qMCard); + + QString qDens = mcDialog.densityEdit->text(); + TCollection_AsciiString aDens = QS2AS(qDens); + + if(!aDens.IsRealValue()) + aDens="0.0"; + + curLab.ForgetAttribute(TDataStd_Name::GetID()); + curName->Set(curLab, newName); + theTWI->setText(0,newQName); + + curLab.ForgetAttribute(TDataStd_AsciiString::GetID()); + theMCard->Set(curLab, asciiMCard); + + curLab.ForgetAttribute(TDataStd_Real::GetID()); + theDensity->Set(curLab, aDens.RealValue()); + + break; + } + } +} + +/** + * # //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + * Private Functions + */ +/** + * prohibits the update of visual selection due to change of Tree-selection + */ +void QMcCadGeomeTree_TreeWidget::LockSignalSelectionChanged() +{ + mySignalSelectionChangedLocked = true; +} + + +/** + * allows the update of visual selection due to change of Tree-selection + */ +void QMcCadGeomeTree_TreeWidget::UnlockSignalSelectionChanged() +{ + mySignalSelectionChangedLocked = false; +} + + +/** + * Load MCards from TDoc + */ +void QMcCadGeomeTree_TreeWidget::LoadMCards() +{ + Handle(TDF_Data) theData = GetEditor()->GetDocument()->GetTDoc()->GetData(); + TDF_Label mLab; + TCollection_AsciiString newLab = MCARDROOT; + TDF_Tool::Label(theData, newLab, mLab, Standard_True); + + for( TDF_ChildIterator it( mLab, Standard_False ); it.More(); it.Next() ) + { + TDF_Label curLab = it.Value(); + + QString qName; + QString qDens; + QString qMCard; + Handle(TDataStd_Name) theName; + Handle(TDataStd_Real) theDens; + Handle(TDataStd_AsciiString) theMCard; + + if(curLab.FindAttribute(TDataStd_Name::GetID(), theName)) + { + TCollection_AsciiString aName(theName->Get()); + qName = aName.ToCString(); + } + + if(curLab.FindAttribute(TDataStd_Real::GetID(), theDens)) + { + TCollection_AsciiString aDens(theDens->Get()); + qDens = aDens.ToCString(); + } + + if(curLab.FindAttribute(TDataStd_AsciiString::GetID(), theMCard)) + qMCard = theMCard->Get().ToCString(); + + AddMaterialGroup(qName, qDens, qMCard); + } +} + + +/** + * Returns the extended label entry of a given QTreeWidgetItem*. + */ +TCollection_AsciiString QMcCadGeomeTree_TreeWidget::GetItemLabelEntry(QTreeWidgetItem* theItem) +{ + //find the editor the item belongs to + //TCollection_AsciiString theID; +// QMcCad_Editor *pEdit = GetEditor(); +// TCollection_AsciiString Label = pEdit->GetSolidFromItem(theItem); + +// QMessageBox msg; +// msg.setText(Label.ToCString()); +// msg.exec(); + +// return Label; + + + //Lei Lu 21.11.2013 + QMap::const_iterator iter; + TCollection_AsciiString aLabelEntry; + for(iter = m_EditorItemMap.constBegin(); iter != m_EditorItemMap.constEnd(); ++iter) + { + if(iter.value() == theItem) + { + aLabelEntry = iter.key(); + return aLabelEntry; + } + } + + return aLabelEntry; +} + + +/** + * Create new TreeWidgetItem with the name theName as child of theParent. + */ +QTreeWidgetItem* QMcCadGeomeTree_TreeWidget::MakeNewTreeWidgetItem(const TCollection_AsciiString& theName, QTreeWidgetItem* theParent) +{ + QString qName(theName.ToCString()); + QTreeWidgetItem* newItem = new QTreeWidgetItem(theParent); + newItem->setText(0,qName); + newItem->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEditable|Qt::ItemIsEnabled); + newItem->setTextColor(0,Qt::black); + + return newItem; +} + + +/** + * Checks if an extended label is already mapped to a QTreeWidgetItem* + */ +Standard_Boolean QMcCadGeomeTree_TreeWidget::IsRegistered(TCollection_AsciiString& theID) +{ + if (myIDLabelItemMap.contains(theID)) + { + return Standard_True; + } + else + { + return Standard_False; + } + + //for(iter = myIDLabelItemMap.constBegin(); iter != myIDLabelItemMap.constEnd(); ++iter) + // if(iter.key() == theID) + // return Standard_True; + + //return Standard_False; +} + + +/** + * Calls QMcCad_Application::Mcout(). Prints information to the logwindow + */ +void QMcCadGeomeTree_TreeWidget::Mcout(QString theMessage) +{ + theMessage.prepend("QMcCadGeomeTree : "); + QMcCad_Application::GetAppMainWin()->Mcout(theMessage.toUtf8().constData()); +} + + +/** + * Returns Editor + */ +QMcCad_Editor* QMcCadGeomeTree_TreeWidget::GetEditor(int id) +{ + if(id == -1) + return QMcCad_Application::GetAppMainWin()->GetEditor(); + else + return QMcCad_Application::GetAppMainWin()->GetEditor(id); +} + + +/** + * Convert Qstring to TCollection_AsciiString + */ +TCollection_AsciiString QMcCadGeomeTree_TreeWidget::QS2AS(QString& qStr) +{ + char aStr[qStr.length()]; + QByteArray ba = qStr.toAscii(); + strcpy(aStr, ba.data()); + TCollection_AsciiString asciiStr(aStr); + + return asciiStr; +} + + +/** + * Set Link between registered shapes and material + */ +void QMcCadGeomeTree_TreeWidget::LoadMaterialLink(TDF_Label& theLab) +{ + myAddMaterialMembershipIsLocked = true; + + bool isVoid = true; + + QTreeWidgetItem* theMatTWI = NULL; + QTreeWidgetItem* materialRootTWI = GetMaterialTWI(); + QList listOfShapeTWI; + Handle(TDataStd_TreeNode) aTreeNode; + + //find shape TWI + TCollection_AsciiString prefix(GetEditor()->ID()); + prefix+="_"; + TCollection_AsciiString anEntry; + TDF_Tool::Entry(theLab, anEntry); + anEntry.Prepend(prefix); + listOfShapeTWI.append(myIDLabelItemMap[anEntry]); + + if(theLab.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), aTreeNode)) + { + if(aTreeNode->HasFather()) + { + TDF_Label matLab = aTreeNode->Father()->Label(); + Handle(TDataStd_Name) mName; + + //find material TWI + if(matLab.FindAttribute(TDataStd_Name::GetID(),mName)) + { + isVoid = false; + TCollection_AsciiString aName(mName->Get()); + QString qName = aName.ToCString(); + + for(int i=0; i < materialRootTWI->childCount(); i++) + { + if(materialRootTWI->child(i)->text(0) == qName) + theMatTWI = materialRootTWI->child(i); + } + } + } + } + + if(isVoid) + theMatTWI = materialRootTWI->child(0); + + if(theMatTWI!=NULL) + AddToMaterialGroup(theMatTWI, listOfShapeTWI); + + myAddMaterialMembershipIsLocked = false; +} + + +/** + * Add List Of Selected Shapes to the selected Material Group + */ +void QMcCadGeomeTree_TreeWidget::AddToMaterialGroup(QTreeWidgetItem* selected, QList itemList) +{ + QTreeWidgetItem* matTWI = GetMaterialTWI(); + + Handle(TDF_Data) theData = GetEditor()->GetDocument()->GetTDoc()->GetData(); + TDF_Label mRootLab, mLab, sLab; + TCollection_AsciiString newLab = MCARDROOT; + TDF_Tool::Label(theData, newLab, mRootLab, Standard_True); + + for(int i=0; itext(0); + simName += " "; + + for(int j=0; j < matTWI->childCount(); j++) // material groups + { + QTreeWidgetItem* curMatGrp = matTWI->child(j); + for(int k=0; k < curMatGrp->childCount(); k++) + { + QTreeWidgetItem* curMat = curMatGrp->child(k); + if(curMat->text(0) == simName) + delete curMat; + } + } + + QTreeWidgetItem* simItem = new QTreeWidgetItem(selected); + simItem->setText(0,simName); + simItem->setFlags(Qt::ItemIsEnabled); //not selectable + + //set material group membership to shapes in TDoc + if(!myAddMaterialMembershipIsLocked) + { + TCollection_AsciiString extSLab = GetItemLabelEntry(itemList.at(i)); + extSLab.Remove(1,extSLab.Search("_")); + TDF_Tool::Label(theData, extSLab, sLab, Standard_True); + + for(TDF_ChildIterator it(mRootLab, Standard_False); it.More(); it.Next()) + { + Handle(TDataStd_Name) tName; + if(it.Value().FindAttribute(TDataStd_Name::GetID(),tName)) + { + TCollection_ExtendedString extName = tName->Get(); + TCollection_AsciiString aName(extName); + QString qName = aName.ToCString(); + + if(qName == selected->text(0)) + mLab = it.Value(); + } + } + + if(!mLab.IsNull() && !sLab.IsNull()) // link shape label with MCard label + { + Handle(TDataStd_TreeNode) refNode, mainNode; + mainNode = TDataStd_TreeNode::Set ( mLab, TDataStd_TreeNode::GetDefaultTreeID()); + refNode = TDataStd_TreeNode::Set ( sLab, TDataStd_TreeNode::GetDefaultTreeID()); + refNode->Remove(); // abv: fix against bug in TreeNode::Append() + mainNode->Prepend(refNode); + } + } + } +} + +/** + * Recursively selects items with a specific name starting from theTWI + */ + +void QMcCadGeomeTree_TreeWidget::RecursiveSelection(QTreeWidgetItem* theTWI, const QString& theName, QList& theList) +{ + if(theTWI->childCount() > 0) + { + for(int i=0; ichildCount(); i++) + { + if(theTWI->child(i)->text(0) == theName) + { + // print rank in list of selected + //cout << i+1 << endl; + theList.append(theTWI->child(i)); + } + //myTreeWidget->setItemSelected(theTWI->child(i),true); + + RecursiveSelection(theTWI->child(i), theName, theList); + } + } +} + + +/** + * Returns Material Root QTreeWidgetItem of current Editor + */ +QTreeWidgetItem* QMcCadGeomeTree_TreeWidget::GetMaterialTWI() +{ + Standard_Integer edID = GetEditor()->ID(); + TCollection_AsciiString extLab(edID); + extLab+=SHAPEROOT; + + QTreeWidgetItem* geomTWI = myIDLabelItemMap[extLab]; + return geomTWI->parent()->child(0); +} + + + diff --git a/src/MCCAD/QMcCadMessenger/QMcCadMessenger_MainWindowMessage.cxx b/src/MCCAD/QMcCadMessenger/QMcCadMessenger_MainWindowMessage.cxx new file mode 100644 index 0000000..b65af78 --- /dev/null +++ b/src/MCCAD/QMcCadMessenger/QMcCadMessenger_MainWindowMessage.cxx @@ -0,0 +1,15 @@ +#include + +QMcCadMessenger_MainWindowMessage::QMcCadMessenger_MainWindowMessage(){ + +} + + +QMcCadMessenger_MainWindowMessage::~QMcCadMessenger_MainWindowMessage(){ + +} + + +void QMcCadMessenger_MainWindowMessage::PrintMessage(std::string message, McCadMessenger_MessageType type){ +//qiu remove gui, might be dangerous! QMcCad_Application::GetAppMainWin()->Mcout(message, type); +} diff --git a/src/MCCAD/icon.png b/src/MCCAD/icon.png new file mode 100644 index 0000000..3678ca7 Binary files /dev/null and b/src/MCCAD/icon.png differ diff --git a/src/MCCADGEN/CMakeLists.txt b/src/MCCADGEN/CMakeLists.txt new file mode 100644 index 0000000..2e3dacb --- /dev/null +++ b/src/MCCADGEN/CMakeLists.txt @@ -0,0 +1,102 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${CAS_INCLUDE_DIRS} + ${KERNEL_INCLUDE_DIRS} + ${VTK_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/idl + ${QT_INCLUDES} + + ${MED_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} + ${CPPUNIT_INCLUDE_DIRS} +# ${McCad_INCLUDE_DIRS} + ${PROJECT_SOURCE_DIR}/src/MCCAD/McCadHeaders #sorry, just temporary... + ${NETGEN_INCLUDE_DIRS} + ${TETGEN_INCLUDE_DIRS} + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${CAS_DEFINITIONS} + ${OMNIORB_DEFINITIONS} + -DTETLIBRARY + -DWITH_TETGEN + ) +#to advoid conflict with Windows max() and min() +IF(WIN32) + ADD_DEFINITIONS(-DNOMINMAX ) +ENDIF(WIN32) + +# libraries to link to +SET(_link_LIBRARIES + SalomeIDLMCCAD + ${KERNEL_OpUtil} + ${KERNEL_SalomeContainer} + ${MED_medcouplingclient} + ${MED_medcouplingcorba} + ${MED_medloader} + ${MED_SalomeIDLMED} +# ${MED_medcouplingremapper} + ${MEDFILE_C_LIBRARIES} + ${HDF5_LIBRARIES} + ${CPPUNIT_LIBRARIES} + ${CAS_KERNEL} + ${CAS_MODELER} + ${CAS_TKV3d} + ${CAS_TKBool} + ${CAS_TKBRep} + ${CAS_TKIGES} + ${CAS_TKSTEP} + ${CAS_TKSTL} +# TKMcCadMcVoid +# TKMcCadConvertTools + TKMcCad +# ${TETGEN_tet} + Tetgen + ${NETGEN_LIBRARIES} + ) + +# --- headers --- + +SET(MCCADEngine_HEADERS + MCCAD.hxx + MCMESHTRAN_AbaqusMeshWriter.hxx + ) + +# --- sources --- + +SET(MCCADEngine_SOURCES + MCCAD.cxx + MCMESHTRAN_AbaqusMeshWriter.cxx + ) + +# --- rules --- + +ADD_LIBRARY(MCCADEngine ${MCCADEngine_SOURCES}) +TARGET_LINK_LIBRARIES(MCCADEngine ${_link_LIBRARIES}) +INSTALL(TARGETS MCCADEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${MCCADEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + + diff --git a/src/MCCADGEN/MCCAD.cxx b/src/MCCADGEN/MCCAD.cxx new file mode 100644 index 0000000..20626cf --- /dev/null +++ b/src/MCCADGEN/MCCAD.cxx @@ -0,0 +1,3121 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + + +#include "MCCAD.hxx" +#include "MCMESHTRAN_AbaqusMeshWriter.hxx" + +//MEDCoupling +#include "MEDCouplingFieldDoubleClient.hxx" +#include "MEDCouplingFieldTemplateClient.hxx" +#include "MEDCouplingUMeshClient.hxx" +#include "MEDCouplingUMeshServant.hxx" +#include "MEDCouplingFieldDoubleServant.hxx" +#include "MEDCouplingFieldTemplateServant.hxx" +#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MEDCouplingMemArray.hxx" +#include "MEDCouplingUMesh.hxx" +#include "MEDCouplingRemapper.hxx" +#include "MEDLoader.hxx" +#include "MEDFileMesh.hxx" +#include "MEDFileField.hxx" + +//OCC inlucde +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include //no need to include this +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +//MCCAD includes +#include + + +//SALOME +#include "Utils_CorbaException.hxx" +#include "utilities.h" + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +//TETGEN +#ifdef WITH_TETGEN + #include "../TETGEN/tetgen.h" +#endif +//Netgen +namespace nglib { +#include "nglib.h" +} +/*! + * \brief convert the Shape stream to shape + * \param aShapeStream the octet stream with OCC shape + * \param theShape OCC shape + */ +TopoDS_Shape Stream2Shape(const SALOMEDS::TMPFile& aShapeStream) +{ + //the shape stream is a 8bit octet(similar with char) array, + //convert the stream to char and then read it + TopoDS_Shape tmpShape; + char* buf; + buf = (char*) &aShapeStream[0]; + std::istringstream streamBrep(buf); + BRep_Builder aBuilder; + BRepTools::Read(tmpShape, streamBrep, aBuilder); + return tmpShape; +} + + + +/*! + * \brief convert the Shape to octet stream + * \param aShape the shape to be convert + * \return return octet stream contains shape info + */ +SALOMEDS::TMPFile* Shape2Stream(const TopoDS_Shape& aShape) +{ + std::ostringstream streamShape; + //Write TopoDS_Shape in ASCII format to the stream + BRepTools::Write(aShape, streamShape); + //Returns the number of bytes that have been stored in the stream's buffer. + int size = streamShape.str().size(); + //Allocate octect buffer of required size + CORBA::Octet* OctetBuf = SALOMEDS::TMPFile::allocbuf(size); + //Copy ostrstream content to the octect buffer + memcpy(OctetBuf, streamShape.str().c_str(), size); + //Create and return TMPFile + SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size,size,OctetBuf,1); + return SeqFile._retn(); +} + +MCCAD::MCCAD(CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) : + Engines_Component_i(orb, poa, contId, instanceName, interfaceName) +{ + MESSAGE("activate object"); + _thisObj = this ; + _id = _poa->activate_object(_thisObj); + myMaxId = 0; + myShape = TopoDS_Shape(); + +} + +MCCAD::~MCCAD() +{ + //delete all the pointers. neccessary? + for (std::map::iterator it=myData.begin(); it!=myData.end(); ++it) + delete it->second; +} + +/*! + * \brief generate a new id + * \return new id + */ +CORBA::Long MCCAD::genId() +{ + return ++myMaxId ; +} + +/*! + * \brief set data to the specific study + * \param studyID study ID + * \param theData a List of Component + * \return \c true if success + */ +CORBA::Boolean MCCAD::setData ( CORBA::Long studyID, const MCCAD_ORB::ComponentList & theData) +{ + const int n = theData.length(); + if (n == 0) return false; + MCCAD_ORB::ComponentList_var aComponentList = new MCCAD_ORB::ComponentList(); + aComponentList->length(n); + + for (int i=0; i_this(); +} + +MCCAD_ORB::Group_ptr MCCAD::generateGroup(const char* Name) throw (SALOME::SALOME_Exception) +{ + if (Name[0] == 0) + THROW_SALOME_CORBA_EXCEPTION("Invalid Group name", SALOME::BAD_PARAM); + MESSAGE("Generate Group: " <_this(); +} + +/*! + * \brief generate a new part + * \param Name part name + * \return + */ +MCCAD_ORB::Part_ptr MCCAD::generatePart(const char* Name) throw (SALOME::SALOME_Exception) +{ + if (Name[0] == 0 ) + THROW_SALOME_CORBA_EXCEPTION("Invalid part name ", SALOME::BAD_PARAM); + MESSAGE("Generate Part: " <_this(); +} + +/*! + * \brief MCCAD::generateMaterial + * generate a material instance and return the reference + * \param Name material name + * \param MatID material id + * \return a new material with reference + */ +MCCAD_ORB::Material_ptr MCCAD::generateMaterial (const char* Name , const CORBA::Long MaterialID, const CORBA::Long studyID ) + throw (SALOME::SALOME_Exception) +{ + if (Name[0] == 0 ) + THROW_SALOME_CORBA_EXCEPTION("Invalid part name ", SALOME::BAD_PARAM); + MESSAGE("Generate Material: " <length(); + for (int i=0; i< n; i++) { + MCCAD_ORB::Material_var aMaterial = (*aMaterialList) [i]; + if (MaterialID == aMaterial->getID()) { + THROW_SALOME_CORBA_EXCEPTION("Already have a material with the same id! ", SALOME::BAD_PARAM); + return MCCAD_ORB::Material::_nil(); + } + } + + Material * aMaterial = new Material(Name, MaterialID); + return aMaterial->_this(); +} + +/*! + * \brief get a component from the study according to the \a ComponentID + * \param studyID + * \param ComponentID + * \return a Component, duplicated, should release outside + */ +MCCAD_ORB::Component_ptr MCCAD::getComponent(CORBA::Long studyID, CORBA::Long ComponentID) +{ + if ( myData.find( studyID ) != myData.end() ) //find the list according to the list + { + MCCAD_ORB::ComponentList * aComponentList = myData[studyID]; + const int n = aComponentList->length(); + for (int i = 0; i < n; i++) + { + MCCAD_ORB::Component_var aComponent = (*aComponentList)[i]; + if (ComponentID == aComponent->getID()) + return aComponent._retn(); //if find the Component, return the pointer + } + return MCCAD_ORB::Component::_nil(); //else return NULL + } + return MCCAD_ORB::Component::_nil(); +} + +/*! + * \brief get a Group from the component list of the study + * \param studyID + * \param ComponentId + * \param GroupID + * \return the group, duplicated, should release outside + */ +MCCAD_ORB::Group_ptr MCCAD::getGroup(CORBA::Long studyID, CORBA::Long GroupID) +{ + MCCAD_ORB::ComponentList* aComponentList = getData(studyID) ; + int n = aComponentList->length(); + for (int i=0; i< n; i++) { + MCCAD_ORB::Component_var aComponent = (*aComponentList) [i]; + MCCAD_ORB::Group_var aGroup = aComponent->getGroup(GroupID); + if (!aGroup->_is_nil()) return aGroup._retn(); //if the group is not nil return it. + } + return MCCAD_ORB::Group::_nil(); +} +/*! + * \brief get the part from the group + * \param studyID + * \param ComponentID + * \param GroupID + * \param PartID + * \return the part, duplicated, should release outside + */ +MCCAD_ORB::Part_ptr MCCAD::getPart(CORBA::Long studyID, CORBA::Long PartID) +{ + MCCAD_ORB::ComponentList* aComponentList = getData(studyID) ; + for (int i=0; i< aComponentList->length(); i++) { + MCCAD_ORB::Component_var aComponent = (*aComponentList) [i]; + MCCAD_ORB::GroupList* aGroupList = aComponent->getGroupList(); + for (int j=0; jlength(); j++) { + MCCAD_ORB::Group_var aGroup = (*aGroupList) [j]; + MCCAD_ORB::Part_var aPart = aGroup->getPart(PartID); + if (!aPart->_is_nil()) return aPart._retn(); + } + } + return MCCAD_ORB::Part::_nil(); +} + + +/*! + * \brief MCCAD::getMaterial + * get the material in this study + * \param studyID + * \param MaterialID + * \return a material, duplicated, should release outside + */ +MCCAD_ORB::Material_ptr MCCAD::getMaterial(CORBA::Long studyID, CORBA::Long MaterialID) +{ + if ( myMaterials.find( studyID ) != myMaterials.end() ) //find the list according to the list + { + MCCAD_ORB::MaterialList * aMaterialList = myMaterials[studyID]; + const int n = aMaterialList->length(); + for (int i = 0; i < n; i++) + { + MCCAD_ORB::Material_var aMaterial = (*aMaterialList)[i]; + if (MaterialID == aMaterial->getID()) + return aMaterial._retn(); //if find the Material, return the pointer + } + return MCCAD_ORB::Material::_nil(); //else return NULL + } + return MCCAD_ORB::Material::_nil(); +} + + +/*! + * \brief deep copy of a part + * \param aPart part to be copy + * \return a new part just different in ID + */ +MCCAD_ORB::Part_ptr MCCAD::deepCopyPart (MCCAD_ORB::Part_ptr aPart) +throw (SALOME::SALOME_Exception) +{ + if (aPart->_is_nil()) + THROW_SALOME_CORBA_EXCEPTION("Copy a nil part", SALOME::BAD_PARAM); + MESSAGE("Copy Part: " <getName()); + Part * aNewPart = new Part(aPart->getName(), genId()); + aNewPart->setShapeStream(*aPart->getShapeStream()); //getShapeStream() will return a pointer of TMPFile + aNewPart->setRemark(aPart->getRemark()); + aNewPart->setAdditive(aPart->getAdditive()); //write descriptions + MCCAD_ORB::MColor aMColor; + aPart->getColor(aMColor); + aNewPart->setColor(aMColor); + MCCAD_ORB::FixArray_var aIMP = aPart->getImportance(); + aNewPart->setImportance(aIMP); +// if (aPart->hasEnvelop()) aNewPart->setEnvelopStream(*aPart->getEnvelopStream()); + if (aPart->hasMesh()) aNewPart->setMesh(aPart->getMesh()); + return aNewPart->_this(); +} + +/*! + * \brief MCCAD::deepCopyGroup + * deep copy a group + * due to the MCCADGUI_DataObject mechanism, the object with the same id is consider as the same object + * deep copy it can avoid this problem. + * \param aGroup the group to be copy + * \return a new group + */ +MCCAD_ORB::Group_ptr MCCAD::deepCopyGroup (MCCAD_ORB::Group_ptr aGroup) throw (SALOME::SALOME_Exception) +{ + if (aGroup->_is_nil()) + THROW_SALOME_CORBA_EXCEPTION("Copy a nil group!", SALOME::BAD_PARAM); + MESSAGE("Copy Group: " <getName()); + Group * aNewGroup = new Group(aGroup->getName(), genId()); + if (aGroup->hasMaterial()) + aNewGroup->setMaterial(aGroup->getMaterial()); + if (aGroup->getPartList()->length() > 0) { + for (int i=0; igetPartList()->length(); i++) + aNewGroup->appendPart(deepCopyPart((*aGroup->getPartList())[i])); + } + MCCAD_ORB::MColor aMColor ; + aGroup->getColor(aMColor); + aNewGroup->setColor(aMColor); + return aNewGroup->_this(); +} + + +/*! + * \brief append new Component into the Component List + * \param aComponent + * \return + */ +CORBA::Boolean MCCAD::appendComponent(CORBA::Long studyID, MCCAD_ORB::Component_ptr aComponent)// throw (SALOME::SALOME_Exception) +{ + if (aComponent->_is_nil()) return false; + MESSAGE("Append a Component: " << aComponent->getName()); + if (myData.find(studyID) == myData.end()) //if no Componentlist in this study, create one + myData[studyID] = new MCCAD_ORB::ComponentList; + const int n = myData[studyID]->length() + 1; + myData[studyID]->length(n); + + //duplicate because the aComponent might be destroy outside + MCCAD_ORB::Component_var aComponent_var = MCCAD_ORB::Component::_duplicate(aComponent); + (*myData[studyID])[n-1] = aComponent_var._retn(); + return true; +} + +/*! + * \brief insert a Component into a study + * \param studyID the study ID + * \param aComponent the Component to be insert + * \param ComponentID insert before the Component with ID=ComponentID + * \return \c true if succeed + */ +CORBA::Boolean MCCAD::insertComponent(CORBA::Long studyID, MCCAD_ORB::Component_ptr aComponent, CORBA::Long ComponentID)// throw (SALOME::SALOME_Exception) +{ + if (aComponent->_is_nil()) return false; + MESSAGE("Insert a Component: " << aComponent->getName()); + //if no data in this study, create a Component list and append the Component into the list + if (myData.find(studyID) == myData.end()) + { + myData[studyID] = new MCCAD_ORB::ComponentList; + } + if (0 == myData[studyID]->length()) + { + appendComponent(studyID, aComponent); + return true; //just append + } + //if can not find the Component, then append it + if (getComponent(studyID, ComponentID)->_is_nil()) + { + appendComponent(studyID, aComponent); + return true; //just append + } + + const int n = myData[studyID]->length(); + myData[studyID]->length(n+1) ; //increase the length with one element + int i; + for (i=0; igetID()) + { + for (int j=n; j>i; j--) + { + (*myData[studyID])[j] = (*myData[studyID])[j-1]; //see the detail design documents + } + break; //important + } + } + } + if (i == n)// cannot find the part + { + myData[studyID]->length(n);//recover the length if not insert + return false; + } + + // duplicate because aComponent might be delete outside + (*myData[studyID])[i] = MCCAD_ORB::Component::_duplicate(aComponent); //copy the part to be insert into the list + return true; +} + +CORBA::Boolean MCCAD::deleteComponent(CORBA::Long studyID, CORBA::Long ComponentID) //throw (SALOME::SALOME_Exception) +{ + //similar with deletePart() + MCCAD_ORB::Component_var aTmpComponent = getComponent(studyID, ComponentID); + if (aTmpComponent->_is_nil()) return false; + MESSAGE("Delete Component: " << aTmpComponent->getName()); + + const int n = myData[studyID]->length(); + int i; + for (i=0; igetID()) + { + for (int j=i; jlength(n-1); //reduce the lenght therefore delete on item + return true; + +} + + +CORBA::Boolean MCCAD::clearComponent(CORBA::Long studyID) +{ + myData[studyID]->length(0); + return true; +} + +/*! + * \brief append new Material into the Material List + * \param aMaterial + * \return + */ +CORBA::Boolean MCCAD::appendMaterial(CORBA::Long studyID, MCCAD_ORB::Material_ptr aMaterial)// throw (SALOME::SALOME_Exception) +{ + if (aMaterial->_is_nil()) return false; + MESSAGE("Append a Material: " << aMaterial->getName()); + if (myMaterials.find(studyID) == myMaterials.end()) //if no Materiallist in this study, create one + myMaterials[studyID] = new MCCAD_ORB::MaterialList; + const int n = myMaterials[studyID]->length() + 1; + myMaterials[studyID]->length(n); + + //duplicate because the aMaterial might be destroy outside + MCCAD_ORB::Material_var aMaterial_var = MCCAD_ORB::Material::_duplicate(aMaterial); + (*myMaterials[studyID])[n-1] = aMaterial_var._retn(); + return true; +} + + +CORBA::Boolean MCCAD::deleteMaterial(CORBA::Long studyID, CORBA::Long MaterialID) //throw (SALOME::SALOME_Exception) +{ + //similar with deletePart() + MCCAD_ORB::Material_var aTmpMaterial = getMaterial(studyID, MaterialID); + if (aTmpMaterial->_is_nil()) return false; + MESSAGE("Delete Material: " << aTmpMaterial->getName()); + + const int n = myMaterials[studyID]->length(); + int i; + for (i=0; igetID()) + { + for (int j=i; jlength(n-1); //reduce the lenght therefore delete on item + return true; + +} + + +/*! + * \brief get all the shape in this component + * \return TopoDS_shape, as compound + */ +TopoDS_Shape MCCAD::getShape(CORBA::Long studyID) +{ + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + //make a compound and return + aBuilder.MakeCompound (aCompound); + + const int n = myData[studyID]->length(); + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myData[studyID])[i])) + { + TopoDS_Shape* aShape = (TopoDS_Shape*)( (*myData[studyID])[i]->getShapePointer()); + if (aShape != NULL) + aBuilder.Add (aCompound, *aShape); + } + } + return aCompound; //return compound as a shape +} + +/*! + * \brief return the shape as a memory pointer + * \return + */ +CORBA::LongLong MCCAD::getShapePointer(CORBA::Long studyID) +{ + myShape = getShape(studyID); + if (myShape.IsNull()) return NULL; + return (CORBA::LongLong)(&myShape) ; +} + +/*! + * \brief wrap the shape of the part into a stream + * \return the shape stream + */ +SALOMEDS::TMPFile* MCCAD::getShapeStream(CORBA::Long studyID) +{ + TopoDS_Shape aShape = getShape(studyID); + if (aShape.IsNull()) return NULL;//ok to return NULL? + return Shape2Stream(aShape); +} + +/*! + * \brief Import a OCC file, can be in brep, step and iges format + * \param FileName import file name + * \param ifExplode ifExplode is true , then explode the compound + * \return a list of parts, should be released after using the list + */ +MCCAD_ORB::PartList* MCCAD::ImportGeom(const char* FileName/*,CORBA::Boolean ifExplode*/) throw (SALOME::SALOME_Exception) +{ + if (*FileName == 0) + THROW_SALOME_CORBA_EXCEPTION("Invalid input file name", SALOME::BAD_PARAM); + + TopoDS_Shape aShape ; + +// QStringList aStringList = QString(FileName).split("/", QString::SkipEmptyParts); +// QString aTmpName = aStringList[aStringList.size() -1].split(".").at(0); //get the file name without path, only works in Linux +// QString aTmpExt = aStringList[aStringList.size() -1].split(".").last(); + + QFileInfo aGeomFile (FileName); +// if (!aGeomFile.open(QIODevice::ReadOnly)) { +// THROW_SALOME_CORBA_EXCEPTION("Cannot open file for reading", SALOME::BAD_PARAM); +// } + + QString aTmpName = aGeomFile.fileName(); + QString aTmpExt = aTmpName.split(".").last(); + +// int len = strlen( FileName ); + + +// strcpy( exten, FileName + (len - 4)); + if(aTmpExt == "brep" ){ + BRep_Builder aBuilder; + BRepTools::Read(aShape,FileName,aBuilder); + } + else if( aTmpExt == "iges" || aTmpExt == "igs"){ + IGESControl_Reader Reader; + Standard_Integer status = Reader.ReadFile( FileName ); + if (status != IFSelect_RetDone ) + THROW_SALOME_CORBA_EXCEPTION("Cannot read this file as iges format", SALOME::BAD_PARAM); + Reader.TransferRoots(); + aShape = Reader.OneShape(); + } + else if( aTmpExt == "step" || aTmpExt == "stp"){ + + STEPControl_Reader Reader; + Standard_Integer status = Reader.ReadFile( FileName ); + if (status != IFSelect_RetDone ) + THROW_SALOME_CORBA_EXCEPTION("Cannot read this file as step format", SALOME::BAD_PARAM); + Reader.TransferRoots(); + aShape = Reader.OneShape(); + } + else + THROW_SALOME_CORBA_EXCEPTION("Unrecognizable file with this extension", SALOME::BAD_PARAM); + +// //to see if explode +// if (ifExplode) +// { +// int cnt= 0; +// MCCAD_ORB::PartList * aPartList = new MCCAD_ORB::PartList; + +// TopExp_Explorer ex; +// for (ex.Init(aShape, TopAbs_SOLID); ex.More(); ex.Next()) +// { +// cnt ++; +// TopoDS_Solid tmpSol = TopoDS::Solid(ex.Current()); +// QString aTmpStr = aTmpName + QString("-Part%1").arg(cnt); +// Part * aPart = new Part(aTmpStr.toLatin1(), genId()); +// aPart->setShape(tmpSol); +//// aPart->setRemark(QString("Import from %1").arg(FileName).toLatin1()); //write descriptions +// aPartList->length(cnt); //increase +// (*aPartList)[cnt-1] = aPart->_this(); //append the part corba reference +// } +// if (cnt == 0) +// THROW_SALOME_CORBA_EXCEPTION("No solid inside this file", SALOME::BAD_PARAM); + +// return aPartList; +// } +// else +// { + int cnt= 0; + TopExp_Explorer ex; + for (ex.Init(aShape, TopAbs_SOLID); ex.More(); ex.Next()) //check if any solid + cnt ++; + if (cnt == 0) + THROW_SALOME_CORBA_EXCEPTION("No solid inside this file", SALOME::BAD_PARAM); + QString aTmpStr = aTmpName.split(".").first() ; + Part * aPart = new Part(aTmpStr.toLatin1(), genId()); + aPart->setShape(aShape); +// aPart->setRemark(QString("Import from %1").arg(FileName).toLatin1()); //write descriptions + MCCAD_ORB::PartList * aPartList = new MCCAD_ORB::PartList; + aPartList->length(1); //increase + (*aPartList)[0] = aPart->_this(); //append the part corba reference + return aPartList; +// } + +} + +/*! + * \brief MCCAD::explodePart + * explode the compound and comsolid in this part + * into parts with solids + * \param aPart part to be explode + * \return a list of part with a single solid + */ +MCCAD_ORB::PartList* MCCAD::explodePart(MCCAD_ORB::Part_ptr aPart) throw (SALOME::SALOME_Exception) +{ + MCCAD_ORB::PartList * aPartList = new MCCAD_ORB::PartList; + if (!aPart->isExplodible()) { //if not explodible, return this part + aPartList->length(1); //increase + (*aPartList)[0] = MCCAD_ORB::Part::_duplicate(aPart); //append the part corba reference + } + else { + int cnt= 0; + TopoDS_Shape * aShape = (TopoDS_Shape *)(aPart->getShapePointer()); + TopExp_Explorer ex; + for (ex.Init(*aShape, TopAbs_SOLID); ex.More(); ex.Next()) { + cnt ++; + TopoDS_Solid tmpSol = TopoDS::Solid(ex.Current()); + QString aTmpStr = QString(aPart->getName()) + QString("-Part%1").arg(cnt); + Part * aNewPart = new Part(aTmpStr.toLatin1(), genId()); +// MCCAD_ORB::Part_var aNewPart = deepCopyPart(aPart); + //deep copy the infomation from apart + aNewPart->setRemark(aPart->getRemark()); + aNewPart->setAdditive(aPart->getAdditive()); + MCCAD_ORB::MColor aMColor; + aPart->getColor(aMColor); + aNewPart->setColor(aMColor); + MCCAD_ORB::FixArray_var aIMP = aPart->getImportance(); + aNewPart->setImportance(aIMP); + aNewPart->setShape(tmpSol);; + + aPartList->length(cnt); //increase +// (*aPartList)[cnt-1] = aNewPart._retn(); //append the part corba reference + (*aPartList)[cnt-1] = aNewPart->_this(); //append the part corba reference + } + if (cnt == 0) { +// CORBA::release(aPartList); + delete aPartList; + THROW_SALOME_CORBA_EXCEPTION("No solid inside this file", SALOME::BAD_PARAM); + } + } + return aPartList; +} + + +/*! + * \brief MCCAD::fuseParts + * fuse several parts into one part + * \param aPartList a list of parts + * \return a new part which contains all shape of the part list + */ +MCCAD_ORB::Part_ptr MCCAD::fuseParts(const MCCAD_ORB::PartList& aPartList, const char* aName) throw (SALOME::SALOME_Exception) +{ + if (aPartList.length() <= 1) { + THROW_SALOME_CORBA_EXCEPTION("Need more than two parts to fuse!", SALOME::BAD_PARAM); + } + + MCCAD_ORB::Part_var aNewPart ; + if (aPartList[0]->_is_nil()) + aNewPart = generatePart(aName); + else + aNewPart = deepCopyPart(aPartList[0]); //deep copy the info in the first part + + //discard the non-appliable info + aNewPart->clearMesh(); + aNewPart->setName(aName); + + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + //make a compound and return + aBuilder.MakeCompound (aCompound); + for (int i = 0; i < aPartList.length(); i++) + { + if (!CORBA::is_nil(aPartList[i])) + { + TopoDS_Shape* aShape = (TopoDS_Shape*)( aPartList[i]->getShapePointer()); + if (aShape != NULL) + aBuilder.Add (aCompound, *aShape); + } + } + aNewPart->setShapeStream(*Shape2Stream(aCompound)); + return aNewPart._retn(); +} + + +/*! + * \brief MCCAD::decomposePart + * decompose a part using McCad functionalities, + * the shape of the part will be decomposed into convex solids + * these solid(s) is merge again as a compound and assign for this part, + * the old shape will be push to backup + * \param aPart the part to be decomposed + * \return false if error + */ + +CORBA::Boolean MCCAD::decomposePart(MCCAD_ORB::Part_ptr aPart) +{ + //check the part + if(aPart->_is_nil()) { + MESSAGE ("the Part is nil!") ; + return false; + } + if(aPart->getIsDecomposed()) //if already decomposed, do not decompose again + return true; + +// TopoDS_Shape aShape = * ((TopoDS_Shape *)aPart->getShapePointer()); //in the same host: get the shape pointer and then get the shape + TopoDS_Shape * aShape = (TopoDS_Shape *)aPart->getShapePointer(); + if (aShape == NULL || aShape->IsNull()) { + MESSAGE ("the shape in the part is nill!") ; + return false; + } + + //decompose the shape + Handle_TopTools_HSequenceOfShape aShapeList = new TopTools_HSequenceOfShape(); + aShapeList = decomposeShape(*aShape) ; + if (aShapeList == NULL) { + aPart->setIsDecomposed(false); + return false; + } + //make as a compound and set it for the part as new shape + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + //make a compound and return + aBuilder.MakeCompound (aCompound); + for(int i=1; i<=aShapeList->Length(); i++){ + aBuilder.Add (aCompound, aShapeList->Value(i)); + } + if (!aCompound.IsNull()) { + aPart->setShapeStream(*Shape2Stream(aCompound)); + } + //set the decomposed flag as true + aPart->setIsDecomposed(true); + return true; +} + + +/*! + * \brief MCCAD::decomposeEnvelop + * decompose the mesh envelop of the component + * \sa decomposePart + * \param aComponent a component reference + * \return false if error + */ +CORBA::Boolean MCCAD::decomposeEnvelop(MCCAD_ORB::Component_ptr aComponent) +{ + //check the Component + if(aComponent->_is_nil()) { + MESSAGE ("the Component is nil!") ; + return false; + } + + TopoDS_Shape * aShape = (TopoDS_Shape *)aComponent->getEnvelopPointer(); //in the same host: get the shape pointer and then get the shape + if (aShape == NULL || aShape->IsNull()) { + MESSAGE ("the shape in the Component is nill!") ; + return false; + } + + //decompose the shape + Handle_TopTools_HSequenceOfShape aShapeList = new TopTools_HSequenceOfShape(); + aShapeList = decomposeShape(*aShape) ; + //make as a compound and set it for the Component as new shape + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + //make a compound and return + aBuilder.MakeCompound (aCompound); + for(int i=1; i<=aShapeList->Length(); i++){ + aBuilder.Add (aCompound, aShapeList->Value(i)); + } + if (!aCompound.IsNull()) { + aComponent->setEnvelopStream(*Shape2Stream(aCompound)); + } + return true; +} + + +/*! + * \brief MCCAD::decomposeShape + * decompose a shape + * \param aShape a topods_shape + * \return a list of shape + */ +Handle_TopTools_HSequenceOfShape MCCAD::decomposeShape (const TopoDS_Shape & aShape) +{ + //put the shape into the Handle_squenceOfShape + Handle_TopTools_HSequenceOfShape aShapeList = new TopTools_HSequenceOfShape(); + aShapeList->Append(aShape); + //BEGIN####CALL THE MCCAD FOR DECOMPOSITION#### + McCadConvertTools_Convertor convertor(aShapeList); + convertor.Convert(); + if(!convertor.IsConverted()){ + MESSAGE ("decompose the shape failed!") ; + return NULL; + } + aShapeList = convertor.GetConvertedModel(); // get the list of decompose shape + return aShapeList; + //END #### +} + + +/*! + * \brief MCCAD::importMED + * import a MED mesh, generate a CORBA MEDCoupling + * \param MEDFileName + * \return + */ +SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr MCCAD::importMED(const char* MEDFileName) +throw (SALOME::SALOME_Exception) +{ + if (*MEDFileName == 0) + THROW_SALOME_CORBA_EXCEPTION("a empty FileName!", SALOME::BAD_PARAM); + MESSAGE ("Import Meshes from: " << MEDFileName); + QStringList atmpList = QString(MEDFileName).split('/'); + atmpList = atmpList.at(atmpList.size()-1).split('.'); + + //import the MED file + try + { + //first check the file + MEDLoader::CheckFileForRead(MEDFileName); + //get the mesh name + vector MeshNames = MEDLoader::GetMeshNames(MEDFileName); + if (MeshNames.size() > 1) + MESSAGE ("More than one mesh is discovered, only the first one will be used"); + + //using MEDloader Advance API for importing mesh + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aNewFileUMesh + = ParaMEDMEM::MEDFileUMesh::New(MEDFileName); + if (aNewFileUMesh ->getMeshDimension() != 3 ) //if not 3D mesh + THROW_SALOME_CORBA_EXCEPTION("Not a 3D mesh!", SALOME::BAD_PARAM); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aNewUMesh + = aNewFileUMesh ->getMeshAtLevel(0); + if (aNewUMesh->getType() != ParaMEDMEM::UNSTRUCTURED) + THROW_SALOME_CORBA_EXCEPTION("Not a Unstructured mesh!", SALOME::BAD_PARAM); + aNewUMesh->setName(atmpList.at(0).toStdString().c_str()); + //create field IOR + ParaMEDMEM::MEDCouplingUMeshServant *aUMeshI=new ParaMEDMEM::MEDCouplingUMeshServant(aNewUMesh); + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr myUMeshIOR = aUMeshI->_this(); + return myUMeshIOR; + + } + catch (INTERP_KERNEL::Exception &ex) + { + THROW_SALOME_CORBA_EXCEPTION( ex.what(), SALOME::BAD_PARAM); + } + return SALOME_MED::MEDCouplingUMeshCorbaInterface::_nil(); +} + +/*! + * \brief MCCAD::export2MED + * export a MEDCouplingUMesh to a MED file + * \param aMesh the MEDCouplingUmesh + * \param FileName file name + * \return false if error + */ +void MCCAD::export2MED(SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMesh, const char* FileName) +throw (SALOME::SALOME_Exception) +{ + if (aMesh->_is_nil()) + THROW_SALOME_CORBA_EXCEPTION("The mesh is nil!", SALOME::BAD_PARAM); + if (*FileName == 0) + THROW_SALOME_CORBA_EXCEPTION("a empty FileName!", SALOME::BAD_PARAM); + MESSAGE ("Write Mesh: " << aMesh->getName() << " to " << FileName); + + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aUMesh_ptr + = ParaMEDMEM::MEDCouplingUMeshClient::New(aMesh); + try + { + //see http://docs.salome-platform.org/salome_6_6_0/gui/MED/MEDLoaderAdvancedAPIPage.html#AdvMEDLoaderAPIFieldWC + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aFileUMesh + = ParaMEDMEM::MEDFileUMesh::New(); + aFileUMesh->setMeshAtLevel(0, aUMesh_ptr); + aFileUMesh->write(FileName, 2); + } + catch (INTERP_KERNEL::Exception &ex) + { + THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::BAD_PARAM); + } +} + +/*! + * \brief exportAllMesh2Abaqus + * export all mesh exist inside parts into a abaqus file + * \param FileName + */ +void MCCAD:: exportAllMesh2Abaqus(CORBA::Long studyID, const char* FileName) throw (SALOME::SALOME_Exception) +{ + if (*FileName == 0) + THROW_SALOME_CORBA_EXCEPTION("a empty FileName!", SALOME::BAD_PARAM); + vector aUMeshList ; + + //loop all part, if has mesh, append the mesh + if ( myData.find( studyID ) != myData.end() ) //find the list according to the list + { + MCCAD_ORB::ComponentList * aComponentList = myData[studyID]; + for (int i = 0; i < aComponentList->length(); i++) + { + MCCAD_ORB::Component_var aComponent = (*aComponentList)[i]; + if (!aComponent->_is_nil()) { + MCCAD_ORB::GroupList * aGroupList = aComponent->getGroupList(); + for (int j = 0; j < aGroupList->length(); j++) + { + MCCAD_ORB::Group_var aGroup = (*aGroupList)[j]; + if (!aGroup->_is_nil()) { + MCCAD_ORB::PartList * aPartList = aGroup->getPartList(); + for (int k = 0; k < aPartList->length(); k++) + { + MCCAD_ORB::Part_var aPart = (*aPartList)[k]; + if (!aPart->_is_nil()) { + if (aPart->hasMesh()) { + ParaMEDMEM::MEDCouplingUMesh * aUMesh = ParaMEDMEM::MEDCouplingUMeshClient::New(aPart->getMesh()); + aUMesh->setName(aPart->getName()); + aUMeshList.push_back(aUMesh); + } + } + } + } + } + } + } + + MCMESHTRAN_AbaqusMeshWriter aAbaqusWriter; + aAbaqusWriter.setMeshes(aUMeshList); + bool isOK = aAbaqusWriter.exportFile(FileName); + + for (int i=0; idecrRef(); //should increase reference + } + if (!isOK) + THROW_SALOME_CORBA_EXCEPTION("Export meshes to Abaqus file failed!", SALOME::BAD_PARAM); + } +} + +CORBA::Boolean MCCAD:: generateTetMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, + CORBA::Double aCoefficient, CORBA::Double aMeshQuality) throw (SALOME::SALOME_Exception) +{ + if (aPart->_is_nil()) { + MESSAGE("A nil part, we skip it!"); + return false; + } + bool isOk = false; +#ifdef WITH_TETGEN + isOk = generateTetgenMesh(aPart, aDeflection, aCoefficient, aMeshQuality); +#endif + if (!isOk) + { + //use Netgen for mesh generation + isOk = generateNetgenMesh(aPart, aDeflection, aCoefficient); + + } +} + +/*! + * \brief generateTetMesh + * generate tetrahedral mesh using Tetgen, + * the Solid is firstly tessellated and export to STL file + * and then import by Tetgen and generate the mesh, + * the mesh is then import into MED mesh + * \param aPartList a list of parts which would be meshed + * \return false if error + */ +//int op_decrease (int i) { return --i; } +//CORBA::Boolean MCCAD:: generateTetgenMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, +// CORBA::Double aCoefficient, CORBA::Double aMeshQuality) throw (SALOME::SALOME_Exception) +//{ +//#ifdef WITH_TETGEN +//// //check the list +//// if (aPartList.length() == 0) { +//// MESSAGE("No part to generate mesh!"); +//// return false; +//// } + +//// //for each part, +//// const int n = aPartList.length(); +//// for (int i=0; i_is_nil()) { +//// MESSAGE("A nil part, we skip it!"); +//// return false; +//// } +// if (aPart->_is_nil()) { +// MESSAGE("A nil part, we skip it!"); +// return false; +// } +// TopoDS_Shape * aShape = (TopoDS_Shape *)aPart->getShapePointer(); //we use this method in the same host +// if (aShape->IsNull()) { +// MESSAGE("This part contains no shape, we skip it!"); +// return false; +// } +// //write the shape into stl +// QString aTmpName = QString("tmp_") + QString(aPart->getName()) + QString(".stl"); +// StlAPI_Writer aSTLWriter ; +// aSTLWriter.ASCIIMode() = Standard_True; // if ASCII output +// aSTLWriter.RelativeMode() = Standard_True; //force to use user parameter +// aSTLWriter.SetDeflection((Standard_Real)aDeflection); //set parameters +// aSTLWriter.SetCoefficient((Standard_Real)aCoefficient);//set parameters +// aSTLWriter.Write(*aShape, aTmpName.toStdString().c_str()); + +// //load the file with tetgen +// //see also CADMesh source code +// tetgenio aTetgenIn, aTetgenOut ; +// aTetgenIn.load_stl(const_cast (aTmpName.toStdString().c_str())); //load the temp file +// QString aConfig = "pCCV";// +//// QString aConfig = "pY"; //qiu add Y to preserved the surface mesh +//// if (aMeshQuality > 0) //set the Tetgen meshing quality +//// aConfig = aConfig + QString("q") + QString("%1").arg(double (aMeshQuality)); + +// //we try to catch the exception, and safely skip this part. +// try { +// tetrahedralize(const_cast (aConfig.toStdString().c_str()), &aTetgenIn, &aTetgenOut); +// } +// catch(int & ) { //the tetgen throw an integer number +// MESSAGE("failed to generated mesh for "<< aPart->getName()<<" !"); +// STEPControl_Writer aWriter ; +// aWriter.Transfer(*aShape, STEPControl_AsIs); +// QString aTmpStepName = QString("tmp_") + QString(aPart->getName()) + QString(".stp"); +// aWriter.Write(aTmpStepName.toLatin1()); +// return false; +// } + +// //get the mesh from aTetgenOut, and make a MED mesh +// //see also http://docs.salome-platform.org/salome_6_6_0/gui/MED/medcouplingcppexamplesUmeshStdBuild1.html +// //first copy the node list +// ParaMEDMEM::DataArrayDouble *aCoords=ParaMEDMEM::DataArrayDouble::New(); +// aCoords->alloc(aTetgenOut.numberofpoints,3); +// std::copy(aTetgenOut.pointlist , aTetgenOut.pointlist + aTetgenOut.numberofpoints*3 , aCoords->getPointer()); +// ParaMEDMEM::MEDCouplingUMesh *aMesh=ParaMEDMEM::MEDCouplingUMesh::New(aPart->getName(),3); +// aMesh->setCoords(aCoords);//set the point list +// aCoords->decrRef(); + +// if (aTetgenOut.numberoftetrahedra == 0){ +// MESSAGE("The mesh "<getName()<<" has no cell!"); +// aMesh->decrRef(); +// STEPControl_Writer aWriter ; +// aWriter.Transfer(*aShape, STEPControl_AsIs); +// QString aTmpStepName = QString("tmp_") + QString(aPart->getName()) + QString(".stp"); +// aWriter.Write(aTmpStepName.toLatin1()); +// return false; +// } + +// //then copy the connectivities and insert cells +// aMesh->allocateCells(aTetgenOut.numberoftetrahedra); +// int atmpArray [10]; +// if (aTetgenOut.numberofcorners == 4) // if first-order tetrahedron +// { +// for (int j=0; jinsertNextCell(INTERP_KERNEL::NORM_TETRA4, 4,atmpArray ); +// } +// aMesh->finishInsertingCells(); +// } +// else if (aTetgenOut.numberofcorners == 10) // if second-order tetrahedron +// { +// for (int j=0; jinsertNextCell(INTERP_KERNEL::NORM_TETRA10, 10,atmpArray ); +// } +// aMesh->finishInsertingCells(); +// } + + +//// //reverse the nodal connectivities because MED mesh has inverted connectivities compared with Tetgen mesh! +//// ParaMEDMEM::DataArrayInt *revNodal=DataArrayInt::New(); +//// ParaMEDMEM::DataArrayInt *revNodalIndx=DataArrayInt::New(); +//// aMesh->getReverseNodalConnectivity(revNodal,revNodalIndx); +//// aMesh->setConnectivity(revNodal,revNodalIndx ); +//// revNodal->decrRef(); +//// revNodalIndx->decrRef(); +//// aMesh->rearrange2ConsecutiveCellTypes(); +//// vector aRevCellId; +//// for (int i=aTetgenOut.numberoftetrahedra-1; i>=0; i--) +//// aRevCellId.push_back(i); +//// aMesh->renumberCells(aRevCellId.data()); + +// //assign this mesh to the parat +// ParaMEDMEM::MEDCouplingUMeshServant *aMeshServant=new ParaMEDMEM::MEDCouplingUMeshServant(aMesh); +// SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMeshPtr = aMeshServant->_this(); +// aMesh->decrRef(); +// aPart->setMesh(aMeshPtr); +// QFile::remove(aTmpName); + + +//// //for testing +//// aTetgenOut.save_elements("/mnt/shared/Tessellated2Tetrahedral/Alite80/Problem_mesh"); +//// aTetgenOut.save_nodes("/mnt/shared/Tessellated2Tetrahedral/Alite80/Problem_mesh"); +//// aTetgenOut.save_poly("/mnt/shared/Tessellated2Tetrahedral/Alite80/Problem_mesh"); + + +//// } +//#endif +// return true; +//} + + +//!!!!!!!Experimental work!!!!!!!!!!!! +//! try to delete those cells with very small volume! +//! they might affect the simulation +int op_decrease (int i) { return --i; } +CORBA::Boolean MCCAD:: generateTetgenMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, + CORBA::Double aCoefficient, CORBA::Double aMeshQuality) throw (SALOME::SALOME_Exception) +{ +#ifdef WITH_TETGEN +// //check the list +// if (aPartList.length() == 0) { +// MESSAGE("No part to generate mesh!"); +// return false; +// } + +// //for each part, +// const int n = aPartList.length(); +// for (int i=0; i_is_nil()) { +// MESSAGE("A nil part, we skip it!"); +// return false; +// } + if (aPart->_is_nil()) { + MESSAGE("A nil part, we skip it!"); + return false; + } + TopoDS_Shape * aShape = (TopoDS_Shape *)aPart->getShapePointer(); //we use this method in the same host + if (aShape->IsNull()) { + MESSAGE("This part contains no shape, we skip it!"); + return false; + } + + //comment out because we use OCC tessellation to replace STL file + //STL has only 32 bit, this might cause problems + /* + //write the shape into stl + QString aTmpName = QString("tmp_") + QString(aPart->getName()) + QString(".stl"); + StlAPI_Writer aSTLWriter ; + aSTLWriter.ASCIIMode() = Standard_True; // if ASCII output + aSTLWriter.RelativeMode() = Standard_True; //force to use user parameter + aSTLWriter.SetDeflection((Standard_Real)aDeflection); //set parameters + aSTLWriter.SetCoefficient((Standard_Real)aCoefficient);//set parameters + aSTLWriter.Write(*aShape, aTmpName.toStdString().c_str()); + + //load the file with tetgen + //see also CADMesh source code + tetgenio aTetgenIn, aTetgenOut ; + aTetgenIn.load_stl(const_cast (aTmpName.toStdString().c_str())); //load the temp file + */ + + //USING OCC TESSELLATION TO REPLACE STL FILE + vector aPointList; + vector aFacetList; + //get the tessellation + TessellateShape(*aShape, aPointList, aFacetList,aDeflection); + //put the points and facets into the tetgen + tetgenio aTetgenIn, aTetgenOut ; + tetgenio::facet *f; + tetgenio::polygon *p; + //copy from tetgenio::load_stl + aTetgenIn.numberofpoints = aPointList.size()/3; + aTetgenIn.pointlist = new REAL[aPointList.size()]; +// cout <<"size of a point: "<numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + aTetgenIn.init(p); + // Each polygon has three vertices. + p->numberofvertices = 3; + p->vertexlist = new int[p->numberofvertices]; + p->vertexlist[0] = aFacetList[i*3]; + p->vertexlist[1] = aFacetList[i*3 + 1]; + p->vertexlist[2] = aFacetList[i*3 + 2]; + +// cout<<"Point\t"<vertexlist[0]<<"\t"<vertexlist[1]<<"\t"<vertexlist[2]<<"\t"< 0) //set the Tetgen meshing quality +// aConfig = aConfig + QString("q") + QString("%1").arg(double (aMeshQuality)); + + //we try to catch the exception, and safely skip this part. + try { + tetrahedralize(const_cast (aConfig.toStdString().c_str()), &aTetgenIn, &aTetgenOut); + } + catch(int & ) { //the tetgen throw an integer number + MESSAGE("failed to generated mesh for "<< aPart->getName()<<" !"); + STEPControl_Writer aWriter ; + aWriter.Transfer(*aShape, STEPControl_AsIs); + QString aTmpStepName = QString("tmp_") + QString(aPart->getName()) + QString(".stp"); + aWriter.Write(aTmpStepName.toLatin1()); + return false; + } + + //get the mesh from aTetgenOut, and make a MED mesh + //see also http://docs.salome-platform.org/salome_6_6_0/gui/MED/medcouplingcppexamplesUmeshStdBuild1.html + //first copy the node list + ParaMEDMEM::DataArrayDouble *aCoords=ParaMEDMEM::DataArrayDouble::New(); + aCoords->alloc(aTetgenOut.numberofpoints,3); + std::copy(aTetgenOut.pointlist , aTetgenOut.pointlist + aTetgenOut.numberofpoints*3 , aCoords->getPointer()); + ParaMEDMEM::MEDCouplingUMesh *aMesh=ParaMEDMEM::MEDCouplingUMesh::New(aPart->getName(),3); + aMesh->setCoords(aCoords);//set the point list + + if (aTetgenOut.numberoftetrahedra == 0){ + MESSAGE("The mesh "<getName()<<" has no cell!"); + aMesh->decrRef(); + STEPControl_Writer aWriter ; + aWriter.Transfer(*aShape, STEPControl_AsIs); + QString aTmpStepName = QString("tmp_") + QString(aPart->getName()) + QString(".stp"); + aWriter.Write(aTmpStepName.toLatin1()); + return false; + } + + //then copy the connectivities and insert cells + aMesh->allocateCells(aTetgenOut.numberoftetrahedra); + int atmpArray [10]; + if (aTetgenOut.numberofcorners == 4) // if first-order tetrahedron + { + for (int j=0; jinsertNextCell(INTERP_KERNEL::NORM_TETRA4, 4,atmpArray ); + } + aMesh->finishInsertingCells(); + } + else if (aTetgenOut.numberofcorners == 10) // if second-order tetrahedron + { + for (int j=0; jinsertNextCell(INTERP_KERNEL::NORM_TETRA10, 10,atmpArray ); + } + aMesh->finishInsertingCells(); + } + + //try to filter those cells with small volume + ParaMEDMEM::MEDCouplingUMesh *bMesh=ParaMEDMEM::MEDCouplingUMesh::New(aPart->getName(),3); + bMesh->setCoords(aCoords);//set the point list + bMesh->allocateCells(aTetgenOut.numberoftetrahedra); //can be more than the actually cells + //get the volume field of the aMesh + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aArray = + aMesh->getMeasureField(true)->getArray(); + vector aTupe; + aTupe.resize(1); + const double VolThreshold = 1.0; //volume less than 1 mm3 is remove. unit mm3 !!! only for experimental + if (aTetgenOut.numberofcorners == 4) // if first-order tetrahedron + { + for (int j=0; jgetTuple(j, aTupe.data()); + if (aTupe[0] < VolThreshold) { + cout <<"Found cell\t"<insertNextCell(INTERP_KERNEL::NORM_TETRA4, 4,atmpArray ); + } + bMesh->finishInsertingCells(); + } + else if (aTetgenOut.numberofcorners == 10) // if second-order tetrahedron + { + for (int j=0; jgetTuple(j, aTupe.data()); + if (aTupe[0] < VolThreshold) { + cout <<"Found cell\t"<insertNextCell(INTERP_KERNEL::NORM_TETRA10, 10,atmpArray ); + } + bMesh->finishInsertingCells(); + } + + + +// //reverse the nodal connectivities because MED mesh has inverted connectivities compared with Tetgen mesh! +// ParaMEDMEM::DataArrayInt *revNodal=DataArrayInt::New(); +// ParaMEDMEM::DataArrayInt *revNodalIndx=DataArrayInt::New(); +// aMesh->getReverseNodalConnectivity(revNodal,revNodalIndx); +// aMesh->setConnectivity(revNodal,revNodalIndx ); +// revNodal->decrRef(); +// revNodalIndx->decrRef(); +// aMesh->rearrange2ConsecutiveCellTypes(); +// vector aRevCellId; +// for (int i=aTetgenOut.numberoftetrahedra-1; i>=0; i--) +// aRevCellId.push_back(i); +// aMesh->renumberCells(aRevCellId.data()); + + //assign this mesh to the part + ParaMEDMEM::MEDCouplingUMeshServant *aMeshServant=new ParaMEDMEM::MEDCouplingUMeshServant(bMesh); + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMeshPtr = aMeshServant->_this(); + aCoords->decrRef(); + aMesh->decrRef(); + bMesh->decrRef(); + aPart->setMesh(aMeshPtr); +// QFile::remove(aTmpName); + + +// //for testing +// aTetgenOut.save_elements("/mnt/shared/Tessellated2Tetrahedral/Alite80/Problem_mesh"); +// aTetgenOut.save_nodes("/mnt/shared/Tessellated2Tetrahedral/Alite80/Problem_mesh"); +// aTetgenOut.save_poly("/mnt/shared/Tessellated2Tetrahedral/Alite80/Problem_mesh"); + + +// } +#endif + return true; +} + +//CORBA::Boolean MCCAD:: generateNetgenMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, +// CORBA::Double aCoefficient) throw (SALOME::SALOME_Exception) +//{ +// if (aPart->_is_nil()) { +// MESSAGE("A nil part, we skip it!"); +// return false; +// } +// TopoDS_Shape * aShape = (TopoDS_Shape *)aPart->getShapePointer(); //we use this method in the same host +// if (aShape->IsNull()) { +// MESSAGE("This part contains no shape, we skip it!"); +// return false; +// } +// //write the shape into stl +// QString aTmpName = QString("tmp_") + QString(aPart->getName()) + QString(".stl"); +// StlAPI_Writer aSTLWriter ; +// aSTLWriter.ASCIIMode() = Standard_True; // if ASCII output +// // aSTLWriter.RelativeMode() = Standard_True; //force to use user parameter +// aSTLWriter.SetDeflection((Standard_Real)aDeflection); //set parameters +// aSTLWriter.SetCoefficient((Standard_Real)aCoefficient);//set parameters +// aSTLWriter.Write(*aShape, aTmpName.toStdString().c_str()); + +// //load the file with Netgen +// //http://netgen.sourcearchive.com/documentation/4.4-9/ng__vol_8cpp-source.html +// //http://netgen.sourcearchive.com/documentation/4.4-9/ng__stl_8cpp-source.html +// nglib::Ng_Mesh * aNetgenMesh; +// nglib::Ng_Init(); +// //create mesh +// aNetgenMesh = nglib::Ng_NewMesh(); +// nglib::Ng_STL_Geometry * aNetgenGeom; +// nglib::Ng_Meshing_Parameters mp; +// mp.maxh=100000; +// mp.fineness = 0.5; +// mp.secondorder = 0; + +// aNetgenGeom = nglib::Ng_STL_LoadGeometry (aTmpName.toStdString().c_str()); +//// aNetgenGeom = nglib::Ng_STL_LoadGeometry ("/home/qiu/Desktop/beryllium_1.stl"); +// if (!aNetgenGeom) { +// MESSAGE("Cannot read the STL geometry!"); +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// return false; +// } + +// nglib::Ng_Result aRsltCode; +// aRsltCode = nglib::Ng_STL_InitSTLGeometry(aNetgenGeom); +// if ( aRsltCode != nglib::NG_OK) { +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// MESSAGE("Initiating STL geometry failed! Ng_result code: " << aRsltCode ); +// return false; +// } +// aRsltCode = nglib::Ng_STL_MakeEdges (aNetgenGeom, aNetgenMesh, &mp); +// if ( aRsltCode != nglib::NG_OK) { +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// MESSAGE("Error making edge from STL! Ng_result code: " << aRsltCode); +// return false; +// } +// aRsltCode = nglib::Ng_STL_GenerateSurfaceMesh (aNetgenGeom, aNetgenMesh, &mp); +// if ( aRsltCode != nglib::NG_OK) { +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// MESSAGE("Error Generating surface mesh from STL! Ng_result code: " << aRsltCode); +// return false; +// } +// aRsltCode = nglib::Ng_GenerateVolumeMesh(aNetgenMesh,&mp); +// if ( aRsltCode != nglib::NG_OK) { +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// MESSAGE("Error Generating volume mesh! Ng_result code: " << aRsltCode); +// return false; +// } + +// //get the mesh from netgen mesh, and make a MED mesh +// int NbPoints = nglib::Ng_GetNP(aNetgenMesh); +// int NbElements = nglib::Ng_GetNE(aNetgenMesh); +// vector aCoordsVec ; +// double aPoint[3]; +// int aTetElm[4]; +// for (int i=1; i <= NbPoints; i++) { //should start from 1 +// nglib::Ng_GetPoint(aNetgenMesh, i, aPoint); +// aCoordsVec.push_back(aPoint[0]); +// aCoordsVec.push_back(aPoint[1]); +// aCoordsVec.push_back(aPoint[2]); +// } +// ParaMEDMEM::DataArrayDouble *aCoords=ParaMEDMEM::DataArrayDouble::New(); +// aCoords->alloc(NbPoints,3); +// std::copy(aCoordsVec.begin() , aCoordsVec.end() , aCoords->getPointer()); + +// ParaMEDMEM::MEDCouplingUMesh *aMesh=ParaMEDMEM::MEDCouplingUMesh::New(aPart->getName(),3); +// aMesh->setCoords(aCoords);//set the point list +// aCoords->decrRef(); +// aCoordsVec.clear(); + +// if (NbElements == 0){ +// MESSAGE("The mesh has no cell!"); +// aMesh->decrRef(); +// STEPControl_Writer aWriter ; +// aWriter.Transfer(*aShape, STEPControl_AsIs); +// QString aTmpStepName = QString("tmp_") + QString(aPart->getName()) + QString(".stp"); +// aWriter.Write(aTmpStepName.toLatin1()); +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// return false; +// } + +// //then copy the connectivities and insert cells +// aMesh->allocateCells(NbElements); + +// for (int i=1; i< NbElements; i++) { +// nglib::Ng_GetVolumeElement(aNetgenMesh, i, aTetElm); + +// //because in connectivities, Tetgen start from 1, MED start from 0 +//// std::transform(aTetgenOut.tetrahedronlist + j*4, aTetgenOut.tetrahedronlist + j*4 + 4, atmpArray, op_decrease); +// aMesh->insertNextCell(INTERP_KERNEL::NORM_TETRA4, 4,aTetElm ); +// } +// aMesh->finishInsertingCells(); + +// //assign this mesh to the parat +// ParaMEDMEM::MEDCouplingUMeshServant *aMeshServant=new ParaMEDMEM::MEDCouplingUMeshServant(aMesh); +// SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMeshPtr = aMeshServant->_this(); +// aMesh->decrRef(); +// aPart->setMesh(aMeshPtr); +// QFile::remove(aTmpName); +// nglib::Ng_DeleteMesh(aNetgenMesh); +// nglib::Ng_Exit(); +// return true; +//} + + +//this version try to using trianglization function of OpenCASCADE +// The problem is that some edge is repeated so the meshing are not success + +void MCCAD:: MeshShape(const TopoDS_Shape theShape, double & theDeflection) +{ + + Standard_Real aDeflection = theDeflection <= 0 ? 0.0001 : theDeflection; + + //If deflection <= 0, than return default deflection + if(theDeflection <= 0) + theDeflection = aDeflection; + + // Is shape triangulated? + Standard_Boolean alreadymeshed = Standard_True; + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + alreadymeshed = Standard_False; + break; + } + } + + if(!alreadymeshed) { + Bnd_Box B; + BRepBndLib::Add(theShape, B); + if ( B.IsVoid() ) + return; // NPAL15983 (Bug when displaying empty groups) + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + + // This magic line comes from Prs3d_ShadedShape.gxx in OCCT + aDeflection = max(aXmax-aXmin, max( aYmax-aYmin, aZmax-aZmin)) * aDeflection * 4; + + //Clean triangulation before compute incremental mesh + BRepTools::Clean(theShape); + + //Compute triangulation + BRepMesh_IncrementalMesh MESH(theShape,aDeflection); + } +} + +/*! + * \brief TessellateShape + * Tessellated the solid into many facets for meshing + * this function is used for replacing the STL file, since the + * STL file have only float (32bit) precision. + * \param theShape a opencascade CAD solid + * \param PointList a list of points (x1,y1,z1,x2,y2,z2,...) for returning + * \param FacetList a list of facets (va1,vb1,vc1, va2,vb2,vc2,... ) for returning + */ +void MCCAD::TessellateShape(const TopoDS_Shape aShape, vector &PointList, vector &FacetList + , double & theDeflection) +{ + //clear the lists + PointList.clear(); + FacetList.clear(); + + //mesh the solid + int NodeTotal=0; //each time a face is mesh, the total node will be updated + + TopoDS_Shape theShape = aShape; + MeshShape(theShape, theDeflection); + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + cout<<"MCCAD::TessellateShape: error when tessellating the solid!!"; + return; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + + //get the nodes + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //append a node + PointList.push_back(P.X()); + PointList.push_back(P.Y()); + PointList.push_back(P.Z()); + } + + //get the facets + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++) // i start with 1 ?? + { + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); //node id here start with 1 + N1 += NodeTotal ; //node id should start from 1 for Netgen! + N2 += NodeTotal ; + N3 += NodeTotal ; + + //add a facet + //IMPORTANT!! this must do otherwise the visualization will be wrong! + if (aFace.Orientation() == TopAbs_REVERSED) { + + FacetList.push_back(N3);//reverse node order + FacetList.push_back(N2); + FacetList.push_back(N1); + } + else { + FacetList.push_back(N1); + FacetList.push_back(N2); + FacetList.push_back(N3); + } + } + NodeTotal += nbNodesInFace; //MUST DO!! + + } + +} + + + +CORBA::Boolean MCCAD:: generateNetgenMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, + CORBA::Double aCoefficient) throw (SALOME::SALOME_Exception) +{ + if (aPart->_is_nil()) { + MESSAGE("A nil part, we skip it!"); + return false; + } + TopoDS_Shape * aShape = (TopoDS_Shape *)aPart->getShapePointer(); //we use this method in the same host + if (aShape->IsNull()) { + MESSAGE("This part contains no shape, we skip it!"); + return false; + } + //mesh the solid + TopoDS_Shape theShape = *aShape; + MeshShape(theShape, aDeflection); + + //load the file with Netgen + //http://netgen.sourcearchive.com/documentation/4.4-9/ng__vol_8cpp-source.html + //http://netgen.sourcearchive.com/documentation/4.4-9/ng__stl_8cpp-source.html + nglib::Ng_Mesh * aNetgenMesh; + nglib::Ng_Init(); + //create mesh + aNetgenMesh = nglib::Ng_NewMesh(); + + //parameters ---- to be optimized + nglib::Ng_Meshing_Parameters mp; + mp.uselocalh= 0; //1; + mp.maxh= 1000.0; + mp.fineness= 0.5;//0.5; + mp.grading= 0.3;//0.3; + mp.elementsperedge= 2.0;//2.0; + mp.elementspercurve= 2.0;//2.0; + mp.closeedgeenable= 0; + mp.closeedgefact= 1.0;//2.0; + mp.secondorder= 0.0; +// mp.meshsize_filename= null; + mp.quad_dominated= 0; + mp.optsurfmeshenable= 1;//1; + mp.optvolmeshenable= 1;//1; + mp.optsteps_2d= 3;//3; + mp.optsteps_3d= 3;//3; + + //create STL geometry + nglib::Ng_STL_Geometry * aNetgenGeom; + aNetgenGeom = nglib::Ng_STL_NewGeometry(); + +// int NodeTotal=0; //each time a face is mesh, the total node will be updated + TopExp_Explorer ex; + TopLoc_Location aLoc; + //the thing comment out is old way, which is not working + /* + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return false; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + //get the nodes and facets + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //add a node + double aPoint [3]; + aPoint [0] = P.X(); + aPoint [1] = P.Y(); + aPoint [2] = P.Z(); + nglib::Ng_AddPoint (aNetgenMesh, aPoint); + } + + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++){ // i start with 1 ?? + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); //node id here start with 1 + N1 += NodeTotal ; //node id should start from 1 for Netgen! + N2 += NodeTotal ; + N3 += NodeTotal ; + + //add a facet + int aFacet [3]; + //IMPORTANT!! this must do otherwise the visualization will be wrong! + if (aFace.Orientation() == TopAbs_REVERSED) { + aFacet[0] = N3; //reverse node order + aFacet[1] = N2; + aFacet[2] = N1; + nglib::Ng_AddSurfaceElement(aNetgenMesh, nglib::NG_TRIG, aFacet); + } + else { + aFacet[0] = N1; + aFacet[1] = N2; + aFacet[2] = N3; + nglib::Ng_AddSurfaceElement(aNetgenMesh, nglib::NG_TRIG, aFacet); + } + + } + NodeTotal += nbNodesInFace; //MUST DO!! + } + */ + + //faceting all surfaces + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return false; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + + //get the nodes + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + + //get the facets + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++) // i start with 1 ?? + { + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); //node id here start with 1 + //no need N1 += NodeTotal ; //node id should start from 1 for Netgen! + //no need N2 += NodeTotal ; + //no need N3 += NodeTotal ; + + //add a facet + int aFacet [3]; + //IMPORTANT!! this must do otherwise the visualization will be wrong! + if (aFace.Orientation() == TopAbs_REVERSED) { + aFacet[0] = N3; //reverse node order + aFacet[1] = N2; + aFacet[2] = N1; + //no need nglib::Ng_AddSurfaceElement(aNetgenMesh, nglib::NG_TRIG, aFacet); + } + else { + aFacet[0] = N1; + aFacet[1] = N2; + aFacet[2] = N3; + //no need nglib::Ng_AddSurfaceElement(aNetgenMesh, nglib::NG_TRIG, aFacet); + } + + //get the points of a triangle according to the node index + double aTriangle[3][3]; + vector aPointList; + for (int i=0; i<3; i++) { + if (aFacet[i] > nbNodesInFace) { + MESSAGE("Node index exceed number of nodes in this face!"); + return false; + } + gp_Pnt P = Nodes(aFacet[i]); + if(!identity) + P.Transform(myTransf); + aTriangle [i][0] =P.X(); + aTriangle [i][1] =P.Y(); + aTriangle [i][2] =P.Z(); + aPointList.push_back(P); + } + + //calculate the normal + //from http://www.opencascade.org/org/forum/thread_25750/?forum=3 + //V1: P1->P2 V2: P2->P3 + gp_Vec aVec = gp_Vec(aPointList.at(1).XYZ()) - gp_Vec(aPointList.at(0).XYZ()); + gp_Vec bVec = gp_Vec(aPointList.at(2).XYZ()) - gp_Vec(aPointList.at(1).XYZ()); + gp_Vec aNormal; + aNormal.SetX(aVec.Y()*bVec.Z() - aVec.Z()*bVec.Y()); + aNormal.SetY(aVec.Z()*bVec.X() - aVec.X()*bVec.Z()); + aNormal.SetZ(aVec.X()*bVec.Y() - aVec.Y()*bVec.X()); + aNormal.Normalize(); + double aNorm [3]; + aNorm[0] = aNormal.X(); + aNorm[1] = aNormal.Y(); + aNorm[2] = aNormal.Z(); + + //add a facet into the netgen + nglib::Ng_STL_AddTriangle(aNetgenGeom, aTriangle[0], aTriangle[1], aTriangle[2],aNorm); + } + } + + +//process the STL geometry and generated the mesh + nglib::Ng_Result aRsltCode; + aRsltCode = nglib::Ng_STL_InitSTLGeometry(aNetgenGeom); + if ( aRsltCode != nglib::NG_OK) { + nglib::Ng_DeleteMesh(aNetgenMesh); + nglib::Ng_Exit(); + MESSAGE("Initiating STL geometry failed! Ng_result code: " << aRsltCode ); + return false; + } + aRsltCode = nglib::Ng_STL_MakeEdges (aNetgenGeom, aNetgenMesh, &mp); + if ( aRsltCode != nglib::NG_OK) { + nglib::Ng_DeleteMesh(aNetgenMesh); + nglib::Ng_Exit(); + MESSAGE("Error making edge from STL! Ng_result code: " << aRsltCode); + return false; + } + aRsltCode = nglib::Ng_STL_GenerateSurfaceMesh (aNetgenGeom, aNetgenMesh, &mp); + if ( aRsltCode != nglib::NG_OK) { + nglib::Ng_DeleteMesh(aNetgenMesh); + nglib::Ng_Exit(); + MESSAGE("Error Generating surface mesh from STL! Ng_result code: " << aRsltCode); + return false; + } + aRsltCode = nglib::Ng_GenerateVolumeMesh(aNetgenMesh,&mp); + if ( aRsltCode != nglib::NG_OK) { + nglib::Ng_DeleteMesh(aNetgenMesh); + nglib::Ng_Exit(); + MESSAGE("Error Generating volume mesh! Ng_result code: " << aRsltCode); + return false; + } + + //get the mesh from netgen mesh, and make a MED mesh + int NbPoints = nglib::Ng_GetNP(aNetgenMesh); + int NbElements = nglib::Ng_GetNE(aNetgenMesh); + vector aCoordsVec ; + double aPoint[3]; + for (int i=1; i <= NbPoints; i++) { //should start from 1 + nglib::Ng_GetPoint(aNetgenMesh, i, aPoint); + aCoordsVec.push_back(aPoint[0]); + aCoordsVec.push_back(aPoint[1]); + aCoordsVec.push_back(aPoint[2]); + } + ParaMEDMEM::DataArrayDouble *aCoords=ParaMEDMEM::DataArrayDouble::New(); + aCoords->alloc(NbPoints,3); + std::copy(aCoordsVec.begin() , aCoordsVec.end() , aCoords->getPointer()); + + ParaMEDMEM::MEDCouplingUMesh *aMesh=ParaMEDMEM::MEDCouplingUMesh::New(aPart->getName(),3); + aMesh->setCoords(aCoords);//set the point list + aCoords->decrRef(); + aCoordsVec.clear(); + + if (NbElements == 0){ + MESSAGE("The mesh "<getName()<<" has no cell!"); + aMesh->decrRef(); + STEPControl_Writer aWriter ; + aWriter.Transfer(*aShape, STEPControl_AsIs); + QString aTmpStepName = QString("tmp_") + QString(aPart->getName()) + QString(".stp"); + aWriter.Write(aTmpStepName.toLatin1()); + nglib::Ng_DeleteMesh(aNetgenMesh); + nglib::Ng_Exit(); + return false; + } + + //then copy the connectivities and insert cells + aMesh->allocateCells(NbElements); + + int aTetElm[4]; + int atmpArray [4]; + for (int i=1; i< NbElements; i++) { + nglib::Ng_GetVolumeElement(aNetgenMesh, i, aTetElm); + + //because in connectivities, Netgen start from 1, MED start from 0 + std::transform(aTetElm, aTetElm + 4, atmpArray, op_decrease); + aMesh->insertNextCell(INTERP_KERNEL::NORM_TETRA4, 4,atmpArray ); + } + aMesh->finishInsertingCells(); + + //assign this mesh to the parat + ParaMEDMEM::MEDCouplingUMeshServant *aMeshServant=new ParaMEDMEM::MEDCouplingUMeshServant(aMesh); + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMeshPtr = aMeshServant->_this(); + aMesh->decrRef(); + aPart->setMesh(aMeshPtr); + nglib::Ng_DeleteMesh(aNetgenMesh); + nglib::Ng_Exit(); + return true; +} + + +void MCCAD::exportGeom(const MCCAD_ORB::BaseObjList & aBaseObjList, const char* FileName) +{ + if (*FileName == 0) return ; + if (aBaseObjList.length() == 0) return; + + //obtain the geom and make a compound + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + aBuilder.MakeCompound (aCompound); + for (int i = 0; i < aBaseObjList.length(); i++) + { + if (!CORBA::is_nil(aBaseObjList[i])) + { + TopoDS_Shape* aShape = (TopoDS_Shape*)( aBaseObjList[i]->getShapePointer()); + if (aShape != NULL) + aBuilder.Add (aCompound, *aShape); + } + } + + //output the shape into the file + QString aFileName = QString(FileName); + + QFile aGeomFile (FileName); + + QString aTmpName = aGeomFile.fileName(); + QString aTmpExt = aTmpName.split(".").last(); + +// QStringList aStringList = aFileName.split("/", QString::SkipEmptyParts); +// QString aTmpName = aStringList[aStringList.size() -1].split(".").at(0); //get the file name without path, only works in Linux +// QString aTmpExt = aStringList[aStringList.size() -1].split(".").last(); + + if (aTmpExt.isEmpty()) { //if no extention, add one + aFileName += ".stp"; + aTmpExt = "stp"; + } + + if(aTmpExt == "brep" ){ + + BRepTools::Write(aCompound, aFileName.toLatin1()); + } + else if( aTmpExt == "iges" || aTmpExt == "igs"){ +// new IGESControl_Controller().init(); //?? + IGESControl_Writer aWriter ("MM", 0); //unit : mm + aWriter.AddShape(aCompound); + aWriter.ComputeModel(); + aWriter.Write(aFileName.toLatin1()); + } + else if( aTmpExt == "step" || aTmpExt == "stp"){ + STEPControl_Writer aWriter ; + aWriter.Transfer(aCompound, STEPControl_AsIs); + aWriter.Write(aFileName.toLatin1()); + } + else { //other case + aFileName += ".stp"; + STEPControl_Writer aWriter ; + aWriter.Transfer(aCompound, STEPControl_AsIs); + aWriter.Write(aFileName.toLatin1()); + } +} + + + +//void MCCAD::unittest() +//{ +// if (test()) +// cout <<"Unit Test Failed!!"<length(0); + myList->length(n); + + for (int i = 0; i < n; i++ ) + (*myList)[i] = aGroupList[i]; + + return true; +} + +//MCCAD_ORB::Group_ptr Component::generateGroup(const char* Name) +//{ +// if (Name[0] == 0) +// THROW_SALOME_CORBA_EXCEPTION("Invalid Group name", SALOME::BAD_PARAM); +// MESSAGE("Generate Group: " <_this(); +//} + +/*! + * \brief get the group according to the \a id + * \param id group id, + * \return Group pointer, a duplicate pointer, should release outside + */ +MCCAD_ORB::Group_ptr Component::getGroup(CORBA::Long GroupID) +{ + const int n = myList->length(); + + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + MCCAD_ORB::Group_var aGroup = (*myList)[i]; + if (GroupID == aGroup->getID()) + return aGroup._retn(); //if find the Group, return the pointer + } + } + return MCCAD_ORB::Group::_nil(); //else return NULL +} + +/*! + * \brief Component::getNumParts + * calculate how many parts + * \return + */ +CORBA::Long Component::getNumParts() +{ + const int n = myList->length(); + int count = 0; + + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + MCCAD_ORB::Group_var aGroup = (*myList)[i]; + count += aGroup->getNumParts(); + } + } + return count; +} + + +/*! + * \brief append a new group into the end of the Group Component + * \param aGroup group to be append, should take care of release outside + * \return \c true if is success + */ +CORBA::Boolean Component::appendGroup(MCCAD_ORB::Group_ptr aGroup) +{ + if(aGroup->_is_nil()) return false; + MESSAGE("Append a group : " << aGroup->getName()); + int n = myList->length() + 1; + myList->length(n); + //should use duplicate, other wise segment fault when aGroup is delete outside + (*myList)[n-1] = MCCAD_ORB::Group::_duplicate(aGroup); + return true; +} + +/*! + * \brief delete one group from the list + * see the detail design documents for details + * \param GroupID the group with \a GroupID to be delete + * \return \c true is succeed + */ +CORBA::Boolean Component::deleteGroup(CORBA::Long GroupID) +{ + const int n = myList->length(); + int i; + for (i=0; igetID()) + { + for (int j=i; jlength(n-1); //reduce the lenght therefore delete on item + return true; +} + +/*! + * \brief insert a Group into the list before the group with \a GroupID + * \param aGroup the group to be inserted, duplicated, should take care outside for release + * \param GroupID put the \a aGroup before this group + * \return \c true if succeed + */ +CORBA::Boolean Component::insertGroup(MCCAD_ORB::Group_ptr aGroup, CORBA::Long GroupID) +{ + if (aGroup->_is_nil()) return false; + MESSAGE("Insert a group : " << aGroup->getName()); + const int n = myList->length(); + //if no group in the Component , just append it + if (n ==0 ) + { + appendGroup(aGroup); + return true; //just append + } + //if the group with GroupID could not be found, append it + if (getGroup(GroupID)->_is_nil()) + { + appendGroup(aGroup); + return true; //just append + } + //normal situation + myList->length(n+1) ; //increase the length with one elemetn + int i; + for (i=0; igetID()) + { + for (int j=n; j>i; j--) + { + (*myList)[j] = (*myList)[j-1]; //see the detail design documents + } + break; //important + } + } + } + if (i == n)// cannot find the group + { + myList->length(n);//recover the length if not insert + return false; + } + + //2013-03-22 should use duplicate, other wise segment fault when aGroup is delete outside + (*myList)[i] = MCCAD_ORB::Group::_duplicate(aGroup); //copy the group to be insert into the list + return true; + +} +/*! + * \brief clear all Groups + * \return + */ +CORBA::Boolean Component::clearGroups() +{ + myList->length(0); + return true; +} + +/*! + * \brief append all Groups In another Component + * \param aComponent + */ +void Component::appendGroupInComponent(MCCAD_ORB::Component_ptr aComponent) +{ + if (aComponent->_is_nil() || aComponent->getGroupList()->length() == 0) + return; + const int n = aComponent->getGroupList()->length(); + for (int i=0; iappendGroup((*aComponent->getGroupList())[i]); +} + + + + +/*! + * \brief get all the shape in this component + * \return TopoDS_shape, as compound + */ +TopoDS_Shape Component::getShape() +{ + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + //make a compound and return + aBuilder.MakeCompound (aCompound); + + const int n = myList->length(); + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + TopoDS_Shape* aShape = (TopoDS_Shape*)( (*myList)[i]->getShapePointer()); + if (aShape != NULL) + aBuilder.Add (aCompound, *aShape); + } + } + return aCompound; //return compound as a shape +} + +void Component::setColor(const MCCAD_ORB::MColor aColor) +{ + //first copy the color for myself + myColor[0] = aColor[0];myColor[1] = aColor[1];myColor[2] = aColor[2]; + + //set the color for all child + const int n = myList->length(); + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + (*myList)[i]->setColor(aColor); + } + } +} + +/*! + * \brief set the shape in the stream file as envelop for the part + * \param aShape the stream file which include OCC shape + */ +void Component::setEnvelopStream(const SALOMEDS::TMPFile& aShapeStream) +{ + if(aShapeStream.length() == 0) return; //if emtpy, return; + myEnvelop = Stream2Shape(aShapeStream); +} + +/*! + * \brief wrap the envelop of the part into a stream + * \return the shape stream + */ +SALOMEDS::TMPFile* Component::getEnvelopStream() +{ + if(myEnvelop.IsNull()) return NULL; + return Shape2Stream(myEnvelop); +} + +/*! + * \brief return the pointer of the envelop shape + * \return + */ +CORBA::LongLong Component::getEnvelopPointer() +{ + if (myEnvelop.IsNull()) return NULL; + return (CORBA::LongLong)(&myEnvelop) ; +} + + +//void Component::getColor(MCCAD_ORB::MColor aColor) +//{ +// aColor[0] = myColor[0]; aColor[1] = myColor[1]; aColor[2] = myColor[2]; +//} + + +///*! +// * \brief return the shape as a memory pointer +// * \return +// */ +//CORBA::LongLong Component::getShapePointer() +//{ +// myShape = getShape(); +// if (myShape.IsNull()) return NULL; +// return (CORBA::LongLong)(&myShape) ; +//} + +///*! +// * \brief wrap the shape of the part into a stream +// * \return the shape stream +// */ +//SALOMEDS::TMPFile* Component::getShapeStream() +//{ +// TopoDS_Shape aShape = getShape(); +// if (aShape.IsNull()) return NULL;//ok to return NULL? +// return Shape2Stream(aShape); +//} + +//############### Group #################### + + +Group::Group(const char *Name, CORBA::Long id) +{ + + myName = CORBA::string_dup(Name); + myID = id; + myList = new MCCAD_ORB::PartList (); + myShape = TopoDS_Shape(); + myColor[0] = 255; + myColor[1] = 255; + myColor[2] = 0; + myMaterial = MCCAD_ORB::Material::_nil(); + myRemark = CORBA::string_dup(""); + + +} + +Group::~Group() +{ + CORBA::string_free(myName); + CORBA::string_free(myRemark); + + // no need to delete????? + delete myList; + if (!myMaterial->_is_nil()) + CORBA::release(myMaterial); +} + + +///*! +// * \brief get Name +// * \return the name of the Group +// */ +//char* Group::getName() +//{ +// //duplicate in case destroy outside +// return CORBA::string_dup(myName); +//} +///*! +// * \brief set the Group Name +// * \param Name +// */ +//void Group::setName(const char *Name) +//{ +// CORBA::string_free(myName); +// myName = CORBA::string_dup(Name); +//} + + +/*! + * \brief set a list of Part into this group + * \param Parts a list of part, this aprt list is just make a copy of reference! + * \return \c true if success + */ +CORBA::Boolean Group::setPartList(const MCCAD_ORB::PartList & aPartList) +{ + const int n = aPartList.length(); + if (n == 0) return false; + myList->length(0); + myList->length(n); + + for (int i = 0; i < n; i++ ) + (*myList)[i] = aPartList[i]; + + return true; +} + +/*! + * \brief get Material info + * \return a duplicate of reference, should be released outside! + */ +MCCAD_ORB::Material_ptr Group::getMaterial() +{ + if (!myMaterial->_is_nil()) + return MCCAD_ORB::Material::_duplicate(myMaterial); + else return MCCAD_ORB::Material::_nil(); +} + +CORBA::Long Group::getMaterialID() +{ + if (!myMaterial->_is_nil()) + return myMaterial->getID(); + else return -1; +} + +/*! + * \brief set Material info + * the material will be duplicated! + * \return + */ +void Group::setMaterial(MCCAD_ORB::Material_ptr aMaterial) +{ + + + if(aMaterial->_is_nil()) return; + if (!myMaterial->_is_nil()) + CORBA::release(myMaterial); //??? + myMaterial = MCCAD_ORB::Material::_duplicate(aMaterial); // aMaterial should not be remove reference outside +} + + +/*! + * \brief get the part according to the \a id + * \param id part id + * \return Part pointer, should be release outside!! + */ +MCCAD_ORB::Part_ptr Group::getPart(CORBA::Long PartID) +{ + const int n = myList->length(); + + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + MCCAD_ORB::Part_var aPart = (*myList)[i]; + if (PartID == aPart->getID()) + return aPart._retn(); //if find the Part, return the pointer + } + } + return MCCAD_ORB::Part::_nil(); //else return NULL +} + +/*! + * \brief append a new part into the end of the Part group + * \param aPart part to be append, the aPart is duplicate, should be release outside! + * \return \c true if is success + */ +CORBA::Boolean Group::appendPart(MCCAD_ORB::Part_ptr aPart) +{ + if(aPart->_is_nil()) return false; + MESSAGE("Append a part : " << aPart->getName()); + int n = myList->length() + 1; + myList->length(n); + //should use duplicate, other wise segment fault when aPart is delete outside + (*myList)[n-1] = MCCAD_ORB::Part::_duplicate(aPart); + return true; +} + +/*! + * \brief delete one part from the list + * see the detail design documents for details + * \param PartID the part with \a PartID to be delete + * \return \c true is succeed + */ +CORBA::Boolean Group::deletePart(CORBA::Long PartID) +{ + const int n = myList->length(); + int i; + for (i=0; igetID()) + { +// CORBA::release((*myList)[i]);//for testing + for (int j=i; jlength(n-1); //reduce the lenght therefore delete on item + return true; +} + +/*! + * \brief insert a Part into the list before the part with \a PartID + * \param aPart the part to be inserted, it is dupicate, should be released outside + * \param PartID put the \a aPart before this part + * \return \c true if succeed + */ +CORBA::Boolean Group::insertPart(MCCAD_ORB::Part_ptr aPart, CORBA::Long PartID) +{ + if (aPart->_is_nil()) return false; + MESSAGE("Insert a part : " << aPart->getName()); + const int n = myList->length(); + //if no part in the group , just append it + if (n ==0 ) + { + appendPart(aPart); + return true; //just append + } + //if the part with PartID could not be found, append it + if (getPart(PartID)->_is_nil()) + { + appendPart(aPart); + return true; //just append + } + //normal situation + myList->length(n+1) ; //increase the length with one elemetn + int i; + for (i=0; igetID()) + { + for (int j=n; j>i; j--) + { + (*myList)[j] = (*myList)[j-1]; //see the detail design documents + } + break; //important + } + } + } + if (i == n)// cannot find the part + { + myList->length(n);//recover the length if not insert + return false; + } + + //2013-03-22 should use duplicate, other wise segment fault when aPart is delete outside + (*myList)[i] = MCCAD_ORB::Part::_duplicate(aPart); //copy the part to be insert into the list + return true; + +} +/*! + * \brief clear all Parts + * \return + */ +CORBA::Boolean Group::clearParts() +{ + myList->length(0); + return true; +} + +/*! + * \brief append all Parts In another Group + * \param aGroup, only the parts are duplicate reference, the group is not take cared + */ +void Group::appendPartInGroup(MCCAD_ORB::Group_ptr aGroup) +{ + if (aGroup->_is_nil() || aGroup->getPartList()->length() == 0) + return; + const int n = aGroup->getPartList()->length(); + for (int i=0; iappendPart((*aGroup->getPartList())[i]); +} + +/*! + * \brief get all the shape in this group + * \return TopoDS_shape, as compound + */ +TopoDS_Shape Group::getShape() +{ + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + //make a compound and return + aBuilder.MakeCompound (aCompound); + + const int n = myList->length(); + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + TopoDS_Shape* aShape = (TopoDS_Shape*)( (*myList)[i]->getShapePointer()); + if (aShape != NULL) + aBuilder.Add (aCompound, *aShape); + } + } + return aCompound; //return compound as a shape +} + +void Group::setColor(const MCCAD_ORB::MColor aColor) +{ + //first copy the color for myself + myColor[0] = aColor[0];myColor[1] = aColor[1];myColor[2] = aColor[2]; + + //set the color for all child + const int n = myList->length(); + for (int i = 0; i < n; i++) + { + if (!CORBA::is_nil((*myList)[i])) + { + (*myList)[i]->setColor(aColor); + } + } +} + +//void Group::getColor(MCCAD_ORB::MColor aColor) +//{ +// aColor[0] = myColor[0]; aColor[1] = myColor[1]; aColor[2] = myColor[2]; +//} + +///*! +// * \brief return the shape as a memory pointer +// * \return +// */ +//CORBA::LongLong Group::getShapePointer() +//{ +// myShape = getShape(); +// if (myShape.IsNull()) return NULL; +// return (CORBA::LongLong)(&myShape) ; +//} + +///*! +// * \brief wrap the shape of the part into a stream +// * \return the shape stream +// */ +//SALOMEDS::TMPFile* Group::getShapeStream() +//{ +// TopoDS_Shape aShape = getShape(); +// if (aShape.IsNull()) return NULL;//ok to return NULL? +// return Shape2Stream(aShape); +//} + + +//############### Material #################### +Material::Material(const char * Name, const CORBA::Long id) +{ + myName = CORBA::string_dup(Name); + myID = id; + myDensity = 0; + myMatCard=0; + myColor[0] = 255; + myColor[1] = 170; + myColor[2] = 0; + +} + +Material::~Material() +{ + CORBA::string_free(myName) ; + CORBA::string_free(myMatCard) ; +} + +void Material::setName(const char *Name) +{ + + CORBA::string_free(myName); + myName = CORBA::string_dup(Name); +} + +void Material::setID(CORBA::Long id) +{ + myID = id; +} + +void Material::setDensity(CORBA::Double aDensity) +{ + myDensity = aDensity; +} + +void Material::setMatCard(const char * MatCard) +{ + + CORBA::string_free(myMatCard); + myMatCard = CORBA::string_dup(MatCard); +} + +void Material:: getColor(MCCAD_ORB::MColor aColor) +{ + aColor[0] = myColor[0]; + aColor[1] = myColor[1]; + aColor[2] = myColor[2]; +} + +void Material::setColor(const MCCAD_ORB::MColor aColor) +{ + myColor[0] = aColor[0]; + myColor[1] = aColor[1]; + myColor[2] = aColor[2]; +} + + +//############### Part #################### + + +Part::Part(const char * Name, const CORBA::Long id) +{ + myName = CORBA::string_dup(Name); + myRemark = CORBA::string_dup(""); + myShape = TopoDS_Shape(); + myShapeBackup = TopoDS_Shape(); + myIsDecomposed = false; //default no decomposed + myID = id; + myMesh = SALOME_MED::MEDCouplingUMeshCorbaInterface::_nil();//initialize with nill mesh + myColor[0] = 255; + myColor[1] = 255; + myColor[2] = 0; + myImportance[0] = -1; //-1 using default value + myImportance[1] = -1; + myImportance[2] = -1; + myAdditive = CORBA::string_dup(""); + +} + +Part::~Part() +{ + CORBA::string_free(myName) ; + CORBA::string_free(myRemark) ; + CORBA::string_free(myAdditive) ; + + + if (!myMesh->_is_nil()) + { + myMesh->UnRegister(); + CORBA::release(myMesh); + } +} + +/*! + * \brief Part::recoverShape + * recover the myShape to myShapeBackup, + * in case of after decomposed, people want to undo the operation + */ +void Part::recoverShape() +{ + if (!myShapeBackup.IsNull()) { + myShape = myShapeBackup; + myShapeBackup = TopoDS_Shape(); //assign a nill shape + myIsDecomposed = false; //consider the original shape not being decomposed + } +} + + + +///*! +// * \brief set the part Name +// * \param Name +// */ +//void Part::setName(const char *Name) +//{ + +// CORBA::string_free(myName); +// myName = CORBA::string_dup(Name); +//} + +///*! +// * \brief set the description of the part +// * \param aDescription +// */ +//void Part::setDescription(const char *aDescription) +//{ + +// CORBA::string_free(myDescription); +// myDescription = CORBA::string_dup(aDescription); +//} + + +void Part::setShape(TopoDS_Shape & aShape) +{ + myShapeBackup = myShape; //backup + myShape = aShape; + myIsDecomposed = false; //if set new shape, consider as not decompsed + +} + + +/*! + * \brief set the shape in the stream file into the part + * \param aShape the stream file which include OCC shape + */ +void Part::setShapeStream(const SALOMEDS::TMPFile& aShapeStream) +{ + if(aShapeStream.length() == 0) return; //if emtpy, return; + //backup the shape //2013-12-1 + myShapeBackup = myShape; //do this even myShape is nill + myShape = Stream2Shape(aShapeStream); + myIsDecomposed = false; //if set new shape, consider as not decompsed +} + +///*! +// * \brief wrap the shape of the part into a stream +// * \return the shape stream +// */ +//SALOMEDS::TMPFile* Part::getShapeStream() +//{ +// if(myShape.IsNull()) return NULL; //ok to return NULL? +// return Shape2Stream(myShape); +//} + + +/*! + * \brief set a unstrcutred mesh for the part + * \param aMesh a MED mesh to be set + */ +void Part::setMesh(SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMesh) +{ + if (!myMesh->_is_nil()) { + myMesh->UnRegister(); + CORBA::release(myMesh); //2013-11-29 + } + + if(!aMesh->_is_nil()) //if not nil + myMesh = aMesh; //directly assign, not copy, thus aMesh should not be destroy outside +// else //assign a nil Mesh +// myMesh = SALOME_MED::MEDCouplingUMeshCorbaInterface::_nil(); +} +/*! + * \brief get the unstructured mesh of the + * + * \param aMesh a MED mesh to be set + */ +SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr Part::getMesh() +{ + if (!myMesh->_is_nil()) //if not nil + return SALOME_MED::MEDCouplingUMeshCorbaInterface::_duplicate(myMesh); + return SALOME_MED::MEDCouplingUMeshCorbaInterface::_nil(); +} + +/*! + * \brief Part::clearMesh clear mesh data + */ +void Part::clearMesh() +{ + if (!myMesh->_is_nil()) { + myMesh->UnRegister(); + CORBA::release(myMesh); //2013-11-29 + } + myMesh = SALOME_MED::MEDCouplingUMeshCorbaInterface::_nil(); +} + +/*! + * \brief Part::setImportance set importance + * \param aIMP + */ +void Part::setImportance(const MCCAD_ORB::FixArray aIMP) +{ + myImportance[0] = aIMP[0]; + myImportance[1] = aIMP[1]; + myImportance[2] = aIMP[2]; +} + +/*! + * \brief Part::getImportance + * return a pointer to a array which include importances + * \return FixArray_slice, should use FixArray_var to get this return! + */ +MCCAD_ORB::FixArray_slice* Part::getImportance() +{ + MCCAD_ORB::FixArray_slice* aIMP = MCCAD_ORB::FixArray_alloc();//allocate the array + aIMP[0] = myImportance[0] ; + aIMP[1] = myImportance[1] ; + aIMP[2] = myImportance[2] ; + return aIMP; +} + +char* Part::getAdditive() +{ + return CORBA::string_dup(myAdditive); +} + +void Part::setAdditive(const char* aAdditive) +{ + CORBA::string_free(myAdditive); + myAdditive = CORBA::string_dup(aAdditive); +} + + +/*! + * \brief Part::getVolume + * return the volume size of the CAD model + * \return + */ + +CORBA::Double Part::getVolume() +{ + GProp_GProps aShapeProp; + BRepGProp::VolumeProperties(myShape, aShapeProp); + return aShapeProp.Mass(); +} + +/*! + * \brief Part::getVolume + * return the volume size of the mesh + * \return + */ + +CORBA::Double Part::getMeshVolume() +{ + double Volume = 0.; + + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aUMesh = + ParaMEDMEM::MEDCouplingUMeshClient::New(myMesh); +// ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aVolumeField = +// aUMesh->getMeasureField(true); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aArray = + aUMesh->getMeasureField(true)->getArray(); + vector aTupe; + aTupe.resize(1); + + for (int i=0; igetNumberOfTuples(); i++) + { + aArray->getTuple(i, aTupe.data()); + Volume += aTupe[0]; + } + return Volume; +} + +void Part::setColor(const MCCAD_ORB::MColor aColor) +{ + myColor[0] = aColor[0];myColor[1] = aColor[1];myColor[2] = aColor[2]; +} + +//void Part::getColor(MCCAD_ORB::MColor aColor) +//{ +// aColor[0] = myColor[0]; aColor[1] = myColor[1]; aColor[2] = myColor[2]; +//} + +CORBA::Boolean Part::isExplodible() +{ + if( getShape().ShapeType() == TopAbs_COMPSOLID || getShape().ShapeType() == TopAbs_COMPOUND ) + return true; + else + return false; +} + + +/*! + * \brief set the BaseObj Name + * \param Name + */ +void BaseObj::setName(const char *Name) +{ + + CORBA::string_free(myName); + myName = CORBA::string_dup(Name); +} + +/*! + * \brief set the Remark of the BaseObj + * \param aRemark + */ +void BaseObj::setRemark(const char *aRemark) +{ + + CORBA::string_free(myRemark); + myRemark = CORBA::string_dup(aRemark); +} + +/*! + * \brief BaseObj::getShape virtual method to avoid salome error + * \return + */ +TopoDS_Shape BaseObj::getShape() +{ + return TopoDS_Shape(); //return a nil shape +} + +/*! + * \brief return the shape as a memory pointer + * \return + */ +CORBA::LongLong BaseObj::getShapePointer() +{ + myShape = getShape(); + if (myShape.IsNull()) return NULL; + return (CORBA::LongLong)(&myShape) ; +} + +/*! + * \brief wrap the shape of the part into a stream + * \return the shape stream + */ +SALOMEDS::TMPFile* BaseObj::getShapeStream() +{ + TopoDS_Shape aShape = getShape(); + if (aShape.IsNull()) return NULL;//ok to return NULL? + return Shape2Stream(aShape); +} + +void BaseObj::getColor(MCCAD_ORB::MColor aColor) +{ + aColor[0] = myColor[0]; aColor[1] = myColor[1]; aColor[2] = myColor[2]; +} + + +extern "C" +{ +Standard_EXPORT PortableServer::ObjectId * MCCADEngine_factory( + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) +{ + cout << "PortableServer::ObjectId * MCCADEngine_factory()"<getId() ; +} +} diff --git a/src/MCCADGEN/MCCAD.hxx b/src/MCCADGEN/MCCAD.hxx new file mode 100644 index 0000000..0434922 --- /dev/null +++ b/src/MCCADGEN/MCCAD.hxx @@ -0,0 +1,359 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#ifndef _MCCAD_HXX_ +#define _MCCAD_HXX_ + +#include +#include CORBA_SERVER_HEADER(MCCAD) +#include CORBA_CLIENT_HEADER(MEDCouplingCorbaServant) +#include CORBA_CLIENT_HEADER(SALOMEDS) +#include +#include +#include + +//to defined EXPORT for these class +//#ifdef WIN32 +//# ifdef CONTAINER_EXPORT +//# define MCCADGEN_EXPORT CONTAINER_EXPORT +//# else +//# define MCCADGEN_EXPORT Standard_EXPORT +//# endif +//#endif + + +#include +#include +using namespace std; + +class BaseObj; +class Part; +class Material; +class Group; +class Component; + + +//############### Base object #################### + + +class Standard_EXPORT BaseObj: public virtual POA_MCCAD_ORB::BaseObj +{ +protected: + + int myID; // an unique integer for identification, assign when part instance is generated + char * myName; //Name for displaying in the GUI + char * myRemark; //description for this part + TopoDS_Shape myShape; //OCC instance for this part + MCCAD_ORB::MColor myColor; + +public: + virtual char* getName() {return CORBA::string_dup(myName);} + virtual void setName(const char* Name) ; + virtual CORBA::Long getID() {return myID ; } + virtual char* getRemark() {return CORBA::string_dup(myRemark);} + virtual void setRemark(const char* aRemark) ; + virtual TopoDS_Shape getShape(); + virtual CORBA::LongLong getShapePointer(); //in the same host + virtual SALOMEDS::TMPFile* getShapeStream(); + virtual void getColor(MCCAD_ORB::MColor aColor); +// virtual void setColor(const MCCAD_ORB::MColor aColor); + +}; + + +//############### Part #################### + +class Standard_EXPORT Part: public virtual BaseObj, public virtual POA_MCCAD_ORB::Part +{ + +public: + + Part (const char * Name,const CORBA::Long id); + virtual ~Part(); + +// char* getName() {return CORBA::string_dup(myName);} +// void setName(const char* Name) ; +// CORBA::Long getID() {return myID ; } +// char* getDescription() {return CORBA::string_dup(myDescription);} +// void setRemark(const char* aDescription) ; + void setShape(TopoDS_Shape & aShape) ; + void setShapeStream(const SALOMEDS::TMPFile& aShapeStream) ; + virtual TopoDS_Shape getShape() {return myShape;} + void recoverShape(); + void setIsDecomposed (CORBA::Boolean isDecomposed) {myIsDecomposed = isDecomposed;} + CORBA::Boolean getIsDecomposed () {return myIsDecomposed ;} + + +// CORBA::LongLong getShapePointer() {return (CORBA::LongLong)(&myShape) ;} //in the same host +// SALOMEDS::TMPFile* getShapeStream(); + void setMesh(SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMesh) ; + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr getMesh() ; + void clearMesh(); + + void setImportance(const ::MCCAD_ORB::FixArray aIMP) ; + MCCAD_ORB::FixArray_slice* getImportance() ; + char* getAdditive() ; + void setAdditive(const char* aAdditive) ; + + CORBA::Double getVolume(); + CORBA::Double getMeshVolume(); + + CORBA::Boolean hasBackupShape() { return myShapeBackup.IsNull() ? false : true;} + CORBA::Boolean hasMesh() {return myMesh->_is_nil()? false : true; } + // SALOMEDS::TMPFile * getShapeStream(); + void setColor(const MCCAD_ORB::MColor aColor); +// void getColor(MCCAD_ORB::MColor aColor); + CORBA::Boolean isExplodible(); + + +private: + +// int myID; // an unique integer for identification, assign when part instance is generated +// char * myName; //Name for displaying in the GUI +// char * myDescription; //description for this part +// TopoDS_Shape myShape; //OCC instance for this part + MCCAD_ORB::FixArray myImportance; //importances N,P,S: -1:empty, no importance + char * myAdditive; //additive card + bool myIsDecomposed; + TopoDS_Shape myShapeBackup; //Backup of last modification + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr myMesh; // MED unstrcutred mesh for MCNP6 +}; + + +//############### Material #################### +//material property, not yet implement + +class Standard_EXPORT Material: public virtual POA_MCCAD_ORB::Material +{ +public: + + Material (const char * Name,const CORBA::Long id); + virtual ~Material(); + + char* getName() {return CORBA::string_dup(myName);} + void setName(const char* Name) ; + CORBA::Long getID() {return myID ; } + void setID(CORBA::Long id) ; + + CORBA::Double getDensity() {return myDensity ; } + void setDensity(CORBA::Double aDensity) ; + + char* getMatCard() {return CORBA::string_dup(myMatCard);} + void setMatCard(const char* MatCard) ; + + void getColor(MCCAD_ORB::MColor aColor); + void setColor(const MCCAD_ORB::MColor aColor); + + +private: + + int myID; // an unique integer for identification. difference is that this ID is given by User, each time should check + char * myName; //name of the material + double myDensity; //atom or mass density + char * myMatCard; //MCNP material card or TRIPOLI card + MCCAD_ORB::MColor myColor; + +}; + + + +//############### Group #################### +//Group of parts which have ethe same material +class Standard_EXPORT Group: public virtual BaseObj, public virtual POA_MCCAD_ORB::Group +{ +public: + + Group(const char * Name, const CORBA::Long id); + virtual ~Group(); + +// char* getName() ; +// void setName(const char* Name) ; +// CORBA::Long getID() {return myID; } + MCCAD_ORB::PartList* getPartList() {return myList; } + CORBA::Boolean setPartList(const MCCAD_ORB::PartList& aPartList) ; + CORBA::Long getNumParts() {return myList->length();} + MCCAD_ORB::Material_ptr getMaterial(); + CORBA::Long getMaterialID(); + void setMaterial(MCCAD_ORB::Material_ptr aMaterial); + MCCAD_ORB::Part_ptr getPart(CORBA::Long PartID) ; + CORBA::Boolean appendPart(MCCAD_ORB::Part_ptr aPart) ; + CORBA::Boolean deletePart(CORBA::Long PartID) ; + CORBA::Boolean insertPart(MCCAD_ORB::Part_ptr aPart, CORBA::Long PartID) ; + CORBA::Boolean clearParts() ; + void appendPartInGroup(MCCAD_ORB::Group_ptr aGroup); + virtual TopoDS_Shape getShape(); +// CORBA::LongLong getShapePointer(); +// SALOMEDS::TMPFile * getShapeStream(); + void setColor(const MCCAD_ORB::MColor aColor); +// void getColor(MCCAD_ORB::MColor aColor); + CORBA::Boolean hasMaterial() {return myMaterial->_is_nil() ? false : true ;} + + + +private: + +// CORBA::Long myID; +// char * myName; +// TopoDS_Shape myShape; + MCCAD_ORB::PartList * myList; //PartList is a CORBA sequence of Part type + MCCAD_ORB::Material_ptr myMaterial;// material + + +}; + + + +//############### Component #################### +//Component of Groups which have the same material +//Naming to Component (McCad Component) because the +//word Component clashed with CORBA key word +class Standard_EXPORT Component: public virtual BaseObj, public virtual POA_MCCAD_ORB::Component +{ +public: + + Component(const char * Name, const CORBA::Long id); + virtual ~Component(); + +// char* getName() ; +// void setName(const char* Name) ; +// CORBA::Long getID() {return myID; } + MCCAD_ORB::GroupList* getGroupList() {return myList; } + CORBA::Boolean setGroupList(const MCCAD_ORB::GroupList& aGroupList) ; +// MCCAD_ORB::Group_ptr generateGroup(const char* Name); + MCCAD_ORB::Group_ptr getGroup(CORBA::Long GroupID) ; + CORBA::Long getNumGroups() {return myList->length();} + CORBA::Long getNumParts() ; + CORBA::Boolean appendGroup(MCCAD_ORB::Group_ptr aGroup) ; + CORBA::Boolean deleteGroup(CORBA::Long GroupID) ; + CORBA::Boolean insertGroup(MCCAD_ORB::Group_ptr aGroup, CORBA::Long GroupID) ; + CORBA::Boolean clearGroups() ; + void appendGroupInComponent(MCCAD_ORB::Component_ptr aComponent); + virtual TopoDS_Shape getShape(); +// CORBA::LongLong getShapePointer(); +// SALOMEDS::TMPFile * getShapeStream(); + void setColor(const MCCAD_ORB::MColor aColor); +// void getColor(MCCAD_ORB::MColor aColor); + void setEnvelop(TopoDS_Shape & aShape){myEnvelop = aShape;} + void setEnvelopStream(const SALOMEDS::TMPFile& aShapeStream); + TopoDS_Shape getEnvelop(){return myEnvelop;} + SALOMEDS::TMPFile* getEnvelopStream(); + CORBA::LongLong getEnvelopPointer(); + CORBA::Boolean hasEnvelop() {return myEnvelop.IsNull() ? false : true ;} + void clearEnvelop() {myEnvelop = TopoDS_Shape();} + + +private: + +// CORBA::Long myID; +// char * myName; +// TopoDS_Shape myShape; + MCCAD_ORB::GroupList * myList; //GroupList is a CORBA sequence of Group type + TopoDS_Shape myEnvelop; //Envelop of this part, simplest case is the boundary box, for MCNP6 + + +}; + + +//############### Engine #################### + +class Standard_EXPORT MCCAD: public virtual POA_MCCAD_ORB::MCCAD_Gen, + public Engines_Component_i +{ + +public: + MCCAD(CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName); + MCCAD(); + virtual ~MCCAD(); + CORBA::Long genId (); + + CORBA::Boolean setData(CORBA::Long studyID, const MCCAD_ORB::ComponentList& theData) ; + MCCAD_ORB::ComponentList* getData(CORBA::Long studyID) ; + MCCAD_ORB::MaterialList* getMaterialList(CORBA::Long studyID) ; + + MCCAD_ORB::Component_ptr generateComponent(const char* Name) throw (SALOME::SALOME_Exception) ; + MCCAD_ORB::Group_ptr generateGroup(const char* Name) throw (SALOME::SALOME_Exception) ; + MCCAD_ORB::Part_ptr generatePart(const char* Name ) throw (SALOME::SALOME_Exception); + MCCAD_ORB::Material_ptr generateMaterial (const char* Name , const CORBA::Long MaterialID , const CORBA::Long studyID) throw (SALOME::SALOME_Exception) ; + MCCAD_ORB::Component_ptr getComponent(CORBA::Long studyID, CORBA::Long ComponentID) ; + MCCAD_ORB::Group_ptr getGroup(CORBA::Long studyID, CORBA::Long GroupID) ; + MCCAD_ORB::Part_ptr getPart(CORBA::Long studyID, CORBA::Long PartID) ; + MCCAD_ORB::Material_ptr getMaterial(CORBA::Long studyID, CORBA::Long MaterialID) ; + + MCCAD_ORB::Part_ptr deepCopyPart (MCCAD_ORB::Part_ptr aPart) throw (SALOME::SALOME_Exception); + MCCAD_ORB::Group_ptr deepCopyGroup (MCCAD_ORB::Group_ptr aGroup) throw (SALOME::SALOME_Exception); + CORBA::Boolean appendComponent(CORBA::Long studyID, + MCCAD_ORB::Component_ptr aComponent) ;// throw (SALOME::SALOME_Exception); + CORBA::Boolean insertComponent(CORBA::Long studyID, + MCCAD_ORB::Component_ptr aComponent, CORBA::Long ComponentID);// throw (SALOME::SALOME_Exception); + CORBA::Boolean deleteComponent(CORBA::Long studyID, + CORBA::Long ComponentID);// throw (SALOME::SALOME_Exception) ; + CORBA::Boolean clearComponent(CORBA::Long studyID) ; + CORBA::Boolean appendMaterial(CORBA::Long studyID, + MCCAD_ORB::Material_ptr aMaterial) ;// throw (SALOME::SALOME_Exception); + CORBA::Boolean deleteMaterial(CORBA::Long studyID, + CORBA::Long MaterialID);// + + void unittest(); + TopoDS_Shape getShape(CORBA::Long studyID); + CORBA::LongLong getShapePointer(CORBA::Long studyID); + SALOMEDS::TMPFile * getShapeStream(CORBA::Long studyID); + MCCAD_ORB::PartList* ImportGeom(const char* FileName/*,CORBA::Boolean ifExplode*/) throw (SALOME::SALOME_Exception); + MCCAD_ORB::PartList* explodePart(MCCAD_ORB::Part_ptr aPart) throw (SALOME::SALOME_Exception); + MCCAD_ORB::Part_ptr fuseParts(const MCCAD_ORB::PartList& aPartList, const char* aName) throw (SALOME::SALOME_Exception); + + CORBA::Boolean decomposePart(MCCAD_ORB::Part_ptr aPart); + CORBA::Boolean decomposeEnvelop(MCCAD_ORB::Component_ptr aComponent); + Handle_TopTools_HSequenceOfShape decomposeShape (const TopoDS_Shape & aShape); + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr importMED(const char* MEDFileName) throw (SALOME::SALOME_Exception); + void export2MED(SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aMesh, const char* FileName) throw (SALOME::SALOME_Exception); + void exportAllMesh2Abaqus(CORBA::Long studyID, const char* FileName) throw (SALOME::SALOME_Exception); + CORBA::Boolean generateTetMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, CORBA::Double aCoefficient, CORBA::Double aMeshQuality) throw (SALOME::SALOME_Exception); + CORBA::Boolean generateTetgenMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, CORBA::Double aCoefficient, CORBA::Double aMeshQuality) throw (SALOME::SALOME_Exception); + CORBA::Boolean generateNetgenMesh(MCCAD_ORB::Part_ptr aPart, CORBA::Double aDeflection, CORBA::Double aCoefficient) throw (SALOME::SALOME_Exception); + void MeshShape(const TopoDS_Shape aShape, double & theDeflection); + void TessellateShape(const TopoDS_Shape theShape, vector &PointList, vector &FacetList, double & theDeflection); + + + void exportGeom(const MCCAD_ORB::BaseObjList & aBaseObjList, const char* FileName) ; + + + + +private: + std::map myData; + std::map myMaterials; + + CORBA::Long myMaxId; + TopoDS_Shape myShape; +}; + + + +extern "C" +Standard_EXPORT PortableServer::ObjectId * MCCADEngine_factory(CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName); + +#endif diff --git a/src/MCCADGEN/MCMESHTRAN_AbaqusMeshWriter.cxx b/src/MCCADGEN/MCMESHTRAN_AbaqusMeshWriter.cxx new file mode 100644 index 0000000..8a9b130 --- /dev/null +++ b/src/MCCADGEN/MCMESHTRAN_AbaqusMeshWriter.cxx @@ -0,0 +1,231 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "MCMESHTRAN_AbaqusMeshWriter.hxx" +#include "utilities.h" +#include + +MCMESHTRAN_AbaqusMeshWriter::MCMESHTRAN_AbaqusMeshWriter() +{ + myOutFileName = ""; + ElementType[INTERP_KERNEL::NORM_TETRA4] = "C3D4"; + ElementType[INTERP_KERNEL::NORM_TETRA10] = "C3D10"; + ElementType[INTERP_KERNEL::NORM_PENTA6] = "C3D6"; + ElementType[INTERP_KERNEL::NORM_PENTA15] = "C3D15"; + ElementType[INTERP_KERNEL::NORM_HEXA8] = "C3D8"; + ElementType[INTERP_KERNEL::NORM_HEXA20] = "C3D20"; + ElementType[INTERP_KERNEL::NORM_HEXA27] = "C3D27"; +} + +MCMESHTRAN_AbaqusMeshWriter::~MCMESHTRAN_AbaqusMeshWriter() +{ + // don't need to release the MEDCouplingUmesh Pointers + //they are still in use outside +} + +/*! + * \brief set the mesh list into the class + * \param myMeshList list of MEDCouplingUMesh to be set + */ +void MCMESHTRAN_AbaqusMeshWriter::setMeshes(vector & MeshList) +{ + myMeshList = MeshList; +} + +/*! + * \brief export the meshes into abaqus file + * \param OutFileName file path and name to be output + * \return false if error + */ +bool MCMESHTRAN_AbaqusMeshWriter::exportFile (const QString & OutFileName) +{ + //#######open the file + myOutFileName = OutFileName; + myOutFile.open( myOutFileName.toLatin1(), ios_base::trunc); //to overide the + if(myOutFile.is_open()) + cout << "File " << myOutFileName.toStdString() << " is open to export Abaqus mesh.\n"; + else { + cout << "Error opening " << myOutFileName.toStdString() << ".\n"; + return false; + } + + //#######write the file heading ######## + myOutFile << "*Heading" < outputedMeshes; //to append the index which meshes are outputed as a part, in case some mesh failed + for (int i=0; i( myMeshList[i]); //don't decrRef() + //check mesh first + if (aMesh->getNumberOfCells() == 0) { + MESSAGE("Mesh " <getName() <<" has no cell!"); + continue; //next mesh + } + //MCNP6 allow mesh only using tetra, hexa, penta or combination of hexa and penta + //here does not consider situations such as HEXA8 and HEXA20 exist in a same mesh +// set ElmTypes = aMesh->getAllTypes(); + set ElmTypes = aMesh->getAllGeoTypes(); //change to salome 7.4.0 + if (ElmTypes.size() > 2) { + MESSAGE("Mesh contain more than two element types!"); + continue; + } + else if (ElmTypes.size() == 2) { + for (set::iterator it=ElmTypes.begin(); it != ElmTypes.end(); ++it) { + if (*it != INTERP_KERNEL::NORM_HEXA8 && + *it != INTERP_KERNEL::NORM_HEXA20 && + *it != INTERP_KERNEL::NORM_PENTA6 && + *it != INTERP_KERNEL::NORM_PENTA15) { + MESSAGE("Only hexa and penta can exist in a hybrid mesh!"); + continue; + } + } + } + else if (ElmTypes.size() == 1) { + set::const_iterator it = ElmTypes.begin(); + if (*it != INTERP_KERNEL::NORM_HEXA8 && + *it != INTERP_KERNEL::NORM_HEXA20 && + *it != INTERP_KERNEL::NORM_PENTA6 && + *it != INTERP_KERNEL::NORM_PENTA15 && + *it != INTERP_KERNEL::NORM_TETRA4 && + *it != INTERP_KERNEL::NORM_TETRA10) { + MESSAGE("should contain only one of hexa, penta or tetra element!"); + continue; + } + } + else { + MESSAGE("Error in getting element type of this mesh!"); + continue; + } + + //print the part and its name + QString aTmpName; + if (aMesh->getName().c_str() == 0) //if no name +// if (aMesh->getName().empty()) //if no name + aTmpName = QString("Mesh-") + QString("%1").arg(i+1); + else + aTmpName = aMesh->getName().c_str(); +// aTmpName = aMesh->getName().c_str(); + myOutFile <<"*Part, name=Part-" <getCoordinatesAndOwner(); //need to call decrRef() + if (aCoord->getNumberOfComponents() != 3) { + MESSAGE("Coordinate array should contain x, y, z!"); + continue; + } + myOutFile.setf( std::ios::fixed, std:: ios::floatfield ); +// myOutFile.precision(5); //set the precision + myOutFile.precision(12); //set the precision to be higher + for (int j= 0; j< aCoord->getNumberOfTuples(); j++) { + myOutFile << j+1 << ", " //+1 because the node id starts with 1 in abaqus + <<*(aCoord->getPointer()+j*3) <<", " //X be careful about the pointer + <<*(aCoord->getPointer()+j*3+1) <<", " //Y + <<*(aCoord->getPointer()+j*3+2) <checkConsecutiveCellTypes()) { //check if the mesh is sorted by type + DataArrayInt * aTmpArr = aMesh->sortCellsInMEDFileFrmt(); //sort the mesh element by type + aTmpArr->decrRef(); + } + DataArrayInt * aConn = aMesh->getNodalConnectivity(); //no need to decrRef() + DataArrayInt * aConnIdx = aMesh->getNodalConnectivityIndex(); //no need to decrRef() + int ElmType = 0; //for catch element type change + for (int j =0; jgetNumberOfTuples()-1; j++) { //-1: aConnIdx size = Nb of cells +1; + int begin = *(aConnIdx->getPointer()+j); + int end = *(aConnIdx->getPointer()+j+1); + if (*(aConn->getPointer()+begin) != ElmType) //if the element type is changed + myOutFile << "*Element, type="<< ElementType.value(*(aConn->getPointer()+begin), "Unknown").toStdString() <getPointer()+begin); + myOutFile << j+1 ; //+1: element id start with 1; + for (int k = begin+1; k < end; k++) { + myOutFile << ", "<< *(aConn->getPointer()+k) +1 ; //+1 : node id in abaqus start with 1 + } + myOutFile <getNumberOfTuples()<< ", 1" <getNumberOfCells()<< ", 1" <getNumberOfTuples()<< ", 1" <getNumberOfCells()<< ", 1" <decrRef(); + } + + //#######write assembly ######## + if (outputedMeshes.size() == 0) { + MESSAGE("No mesh has been ouptuted!"); + return false; + } + myOutFile << "*Assembly, name=Assembly" <( myMeshList[outputedMeshes[i]]); //pick the outputed mesh + QString aTmpName; +// if (aMesh->getName().empty()) //if no name + if (aMesh->getName().c_str() == 0) //if no name + aTmpName = QString("Mesh-") + QString("%1").arg(i+1); + else +// aTmpName = aMesh->getName().c_str(); + aTmpName = aMesh->getName().c_str(); + QString bTmpName = aTmpName + "-1"; //instance name + + myOutFile <<"*Instance, name=Part-" <( myMeshList[outputedMeshes[i]]); //pick the outputed mesh + QString aTmpName; +// if (aMesh->getName().empty()) //if no name + if (aMesh->getName().c_str() == 0) //if no name + aTmpName = QString("Mesh-") + QString("%1").arg(i+1); + else + aTmpName = aMesh->getName().c_str(); + // aTmpName = aMesh->getName().c_str(); + myOutFile << "*Material, name=material_" << aTmpName.toStdString() <<"_"< +#include +#include +#include +#include +#include + +using namespace std; +using namespace ParaMEDMEM; + + +class MCMESHTRAN_AbaqusMeshWriter +{ +public: + MCMESHTRAN_AbaqusMeshWriter(); + ~MCMESHTRAN_AbaqusMeshWriter(); + + void setMeshes(vector & MeshList) ; + bool exportFile (const QString & OutFileName); + + +private: + vector myMeshList; + QString myOutFileName; + ofstream myOutFile; + QMap ElementType; + + + +}; + +#endif // MCMESHTRAN_ABAQUSMESHWRITER_HXX diff --git a/src/MCCADGEN/Makefile.am b/src/MCCADGEN/Makefile.am new file mode 100644 index 0000000..c0e5a8c --- /dev/null +++ b/src/MCCADGEN/Makefile.am @@ -0,0 +1,70 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# Library target +lib_LTLIBRARIES = libMCCADEngine.la + +# Library sources +dist_libMCCADEngine_la_SOURCES = \ + MCCAD.hxx \ + MCCAD.cxx \ + MCMESHTRAN_AbaqusMeshWriter.cxx \ + MCMESHTRAN_AbaqusMeshWriter.hxx + +libMCCADEngine_la_CPPFLAGS = \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + -I$(top_builddir)/idl \ + $(QT_INCLUDES) \ + $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(MED3_INCLUDES) \ + @CPPUNIT_INCLUDES@ \ + $(CAS_CPPFLAGS) \ + $(MCCAD_INCLUDES) \ + $(TETGEN_INCLUDES) \ + $(NETGEN_INCLUDES) + + +libMCCADEngine_la_LDFLAGS = \ + ../../idl/libMCCADIDL.la \ + $(KERNEL_LDFLAGS) \ + -lSalomeContainer \ + -lOpUtil \ + $(MED_LDFLAGS) \ + -lmedcouplingclient \ + -lmedcouplingcorba \ + -lmedloader \ + -lSalomeIDLMED \ + -lmedcouplingremapper \ + $(HDF5_LIBS) \ + @CPPUNIT_LIBS@ \ + $(MED3_LIBS_C_ONLY) \ + $(CAS_LDFLAGS) \ + $(MCCAD_LIBS) -lTKMcCadMcVoid -lTKMcCadConvertTools \ + $(CAS_LDPATH) -lTKSTL \ + $(TETGEN_LIBS) \ + $(NETGEN_LIBS) +# $(CAS_DATAEXCHANGE) + + diff --git a/src/MCCADGUI/CMakeLists.txt b/src/MCCADGUI/CMakeLists.txt new file mode 100644 index 0000000..18cbbaf --- /dev/null +++ b/src/MCCADGUI/CMakeLists.txt @@ -0,0 +1,170 @@ +# Copyright (C) 2014-2015 KIT-INR/NK +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${CAS_INCLUDE_DIRS} + ${KERNEL_INCLUDE_DIRS} + ${VTK_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_SOURCE_DIR}/src/MCCAD/McCadHeaders #sorry, just temporary... +# ${IDL_INCLUDE_DIRS} + ${QT_INCLUDES} + ${MED_INCLUDE_DIRS} +# ${CPPUNIT_INCLUDE_DIRS} + ${GUI_INCLUDE_DIRS} # + ${SMESH_INCLUDE_DIRS} + ${GEOM_INCLUDE_DIRS} + ${McCad_INCLUDE_DIRS} + + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${CAS_DEFINITIONS} + ${OMNIORB_DEFINITIONS} + -DWITH_TETGEN + ) +#to advoid conflict with Windows max() and min() +IF(WIN32) + ADD_DEFINITIONS(-DNOMINMAX -DNOGDI) +ENDIF(WIN32) + +MESSAGE ("VTK_LIBS: ${VTK_LIBRARIES}") +# libraries to link to +SET(_link_LIBRARIES + SalomeIDLMCCAD + ${KERNEL_OpUtil} + ${KERNEL_SalomeContainer} + ${KERNEL_SalomeIDLKernel} + ${MED_medcouplingclient} + ${MED_medcouplingcorba} + ${MED_medloader} + ${MED_SalomeIDLMED} + ${HDF5_LIBRARIES} + ${CPPUNIT_LIBRARIES} + ${CAS_KERNEL} + ${CAS_MODELER} + ${CAS_TKV3d} + ${CAS_TKBool} + ${CAS_TKBRep} + ${CAS_TKIGES} + ${CAS_TKSTEP} + ${CAS_TKSTL} +# TKMcCadMcVoid +# TKMcCadConvertTools + TKMcCad + ${TETGEN_tet} + ${NETGEN_LIBRARIES} + ${GUI_LightApp} + ${GUI_SalomeApp} + ${VTK_LIBRARIES} + ${SMESH_SMESHimpl} + ${SMESH_SMESHEngine} + ${SMESH_StdMeshers} + ${SMESH_StdMeshersEngine} + ${SMESH_SMDS} + ${SMESH_SMESHDS} + ${SMESH_SMESH} + ${GEOM_GEOMBase} + ${GEOM_GEOMFiltersSelection} + ${GEOM_GEOMObject} + ${GEOM_GEOMClient} + ${GEOM_GEOM} + ) + +# --- headers --- + +SET(MCCAD_HEADERS + MCCADGUI.h + MCCADGUI_DataModel.h + MCCADGUI_DataObject.h + MCCADGUI_Operation.h + MCCADGUI_Selection.h + MCCADGUI_OperationImpl.h + MCCADGUI_Dialogs.h + MCCADGUI_Displayer.h + S_McCadSolid.hxx + S_McCadVoidCellManager.hxx + S_McCadMcnpWriter.hxx + S_McCadGeomData.hxx + S_McCadTripoliWriter.hxx + S_McCadGDMLWriter.hxx + ) + + + +# uic files / to be processed by pyuic +SET(_pyuic_files + MCardDialog.ui + SetPropertyDialog.ui + ImportObjDialog.ui + TransformDialog.ui +) + +# scripts / pyuic wrappings +QT4_WRAP_UI(_uic_HEADERS ${_pyuic_files}) + +# --- headers --- + +# header files / to be processed by moc +SET(_moc_HEADERS + MCCADGUI.h + MCCADGUI_Operation.h + MCCADGUI_OperationImpl.h + MCCADGUI_Dialogs.h +) +# sources / moc wrappings +QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS}) + +# sources / to compile + +# --- sources --- + +SET(MCCAD_SOURCES + MCCADGUI.cxx + MCCADGUI_DataModel.cxx + MCCADGUI_DataObject.cxx + MCCADGUI_Operation.cxx + MCCADGUI_Selection.cxx + MCCADGUI_OperationImpl.cxx + MCCADGUI_Dialogs.cxx + MCCADGUI_Displayer.cxx + MCCAD_AISShape.cxx + MCCAD_Constants.cxx + S_McCadSolid.cxx + S_McCadVoidCellManager.cxx + S_McCadMcnpWriter.cxx + S_McCadGeomData.cxx + S_McCadTripoliWriter.cxx + S_McCadGDMLWriter.cxx + ${_moc_SOURCES} + ${_rcc_SOURCES} + ) +# --- rules --- + +ADD_LIBRARY(MCCAD ${MCCAD_SOURCES}) +TARGET_LINK_LIBRARIES(MCCAD ${_link_LIBRARIES}) +INSTALL(TARGETS MCCAD EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${MCCAD_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) + + diff --git a/src/MCCADGUI/Handle_MCCAD_AISShape.hxx b/src/MCCADGUI/Handle_MCCAD_AISShape.hxx new file mode 100644 index 0000000..813abc8 --- /dev/null +++ b/src/MCCADGUI/Handle_MCCAD_AISShape.hxx @@ -0,0 +1,100 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// GEOM OBJECT : interactive object for Geometry entities visualization +// File : Handle_MCCAD_AISShape.hxx +// Module : GEOM +// +#ifndef _Handle_MCCAD_AISShape_HeaderFile +#define _Handle_MCCAD_AISShape_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_SALOME_AISShape_HeaderFile +#include "Handle_SALOME_AISShape.hxx" +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(SALOME_AISShape); +class MCCAD_AISShape; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(MCCAD_AISShape); + +class Handle(MCCAD_AISShape) : public Handle(SALOME_AISShape) { + public: + inline void* operator new(size_t,void* anAddress) + { + return anAddress; + } + inline void* operator new(size_t size) + { + return Standard::Allocate(size); + } + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } +// inline void operator delete(void *anAddress, size_t size) +// { +// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); +// } + Handle(MCCAD_AISShape)():Handle(SALOME_AISShape)() {} + Handle(MCCAD_AISShape)(const Handle(MCCAD_AISShape)& aHandle) : Handle(SALOME_AISShape)(aHandle) + { + } + + Handle(MCCAD_AISShape)(const MCCAD_AISShape* anItem) : Handle(SALOME_AISShape)((SALOME_AISShape *)anItem) + { + } + + Handle(MCCAD_AISShape)& operator=(const Handle(MCCAD_AISShape)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(MCCAD_AISShape)& operator=(const MCCAD_AISShape* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + MCCAD_AISShape* operator->() + { + return (MCCAD_AISShape *)ControlAccess(); + } + + MCCAD_AISShape* operator->() const + { + return (MCCAD_AISShape *)ControlAccess(); + } + + Standard_EXPORT ~Handle(MCCAD_AISShape)(); + + Standard_EXPORT static const Handle(MCCAD_AISShape) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/MCCADGUI/ImportObjDialog.ui b/src/MCCADGUI/ImportObjDialog.ui new file mode 100644 index 0000000..4f2ba32 --- /dev/null +++ b/src/MCCADGUI/ImportObjDialog.ui @@ -0,0 +1,138 @@ + + + MCCADGUI_ImportObjDialog + + + + 0 + 0 + 349 + 184 + + + + + 0 + 0 + + + + + 0 + 0 + + + + Import objects + + + + + 40 + 30 + 291 + 41 + + + + + 11 + + + + Please select a group or a part to assign +the geometry/mesh: + + + + + + 40 + 80 + 62 + 17 + + + + From: + + + + + + 120 + 80 + 62 + 17 + + + + + true + + + + No name + + + + + + 120 + 100 + 111 + 17 + + + + + true + + + + No selected + + + + + + 40 + 100 + 62 + 17 + + + + To: + + + + + + 40 + 130 + 93 + 27 + + + + OK + + + + + + 180 + 130 + 93 + 27 + + + + Cancel + + + + + + diff --git a/src/MCCADGUI/MCCADGUI.cxx b/src/MCCADGUI/MCCADGUI.cxx new file mode 100644 index 0000000..5e86319 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI.cxx @@ -0,0 +1,2087 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +//myself +#include "MCCADGUI.h" +#include "MCCADGUI_DataModel.h" +#include "MCCADGUI_Displayer.h" +#include "MCCADGUI_Selection.h" +#include "MCCADGUI_Dialogs.h" +#include "MCCADGUI_OperationImpl.h" + +//MEDCoupling +#include "MEDCouplingFieldDoubleClient.hxx" +#include "MEDCouplingMeshClient.hxx" +#include "MEDCouplingMeshServant.hxx" +#include "MEDCouplingFieldDoubleServant.hxx" +#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MEDCouplingMemArray.hxx" +#include "MEDLoader.hxx" + +//SALOME +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +//#include +#include +#include +#include +#include +#include +#include + +#include "SALOME_InteractiveObject.hxx" +#include "SALOMEDSClient_SObject.hxx" +#include "SALOMEDS_SObject.hxx" + + +// QT includes +#include +#include +#include +#include +#include +#include + +// VTK includes +#include +#include + +//GEOM +#include +#include + +//stardart c++ +#include +#include + + +using namespace std; + +MCCAD_ORB::MCCAD_Gen_var MCCADGUI::myEngine = MCCAD_ORB::MCCAD_Gen::_nil(); + +// Constructor +MCCADGUI::MCCADGUI() : + SalomeApp_Module( "MCCAD" ), // default name +// LightApp_Module( "MCCAD" ), // default name //2013-05-23 modif to adapt change in SALOME 7.2.0 + + LastDir("~/"), + LastGroupName("newGroup"), + LastComponentName("newComponent") + +{ +} + + + +void MCCADGUI::createPreferences() +{ + int tabId = addPreference( "McCad Settings" ); + + int genGroup = addPreference( "Graphic", tabId ); + setPreferenceProperty( genGroup, "columns", 2 ); + + int dispmode = addPreference( "Default dispaly mode", genGroup, + LightApp_Preferences::Selector, + "MCCAD", "display_mode" ); + + addPreference( "Default dispaly color", genGroup, + LightApp_Preferences::Color, "MCCAD", "shading_color" ); + + addPreference( "Edge in shading" , genGroup, + LightApp_Preferences::Color, "MCCAD", "edges_in_shading_color" ); + + addPreference( "Default wireframe color", genGroup, + LightApp_Preferences::Color, "MCCAD", "wireframe_color" ); + + addPreference( "Color for free boundary" , genGroup, + LightApp_Preferences::Color, "MCCAD", "free_bound_color" ); + + addPreference( "Color for lines" , genGroup, + LightApp_Preferences::Color, "MCCAD", "line_color" ); + + addPreference( "Color for points", genGroup, + LightApp_Preferences::Color, "MCCAD", "point_color" ); + + addPreference( "Color for isolines", genGroup, + LightApp_Preferences::Color, "MCCAD", "isos_color" ); + + addPreference( "Top level color", genGroup, + LightApp_Preferences::Color, "MCCAD", "toplevel_color" ); + + int top_lev_dm = addPreference( "Top level display mode", genGroup, + LightApp_Preferences::Selector, "MCCAD", "toplevel_dm" ); + + const int nb = 2; + int wd[nb]; + int iter=0; + + wd[iter++] = addPreference("Edge width", genGroup, + LightApp_Preferences::IntSpin, "MCCAD", "edge_width" ); + + wd[iter++] = addPreference( "Isolines width", genGroup, + LightApp_Preferences::IntSpin, "MCCAD", "isolines_width" ); + + + for (int i = 0; i < nb; i++) { + setPreferenceProperty( wd[i], "min", 1 ); + setPreferenceProperty( wd[i], "max", 5 ); + } + + int isoU = addPreference( "Isoline long U", genGroup, + LightApp_Preferences::IntSpin, "MCCAD", "iso_number_u" ); + setPreferenceProperty( isoU, "min", 0 ); + setPreferenceProperty( isoU, "max", 100000 ); + int isoV = addPreference("Isoline long V", genGroup, + LightApp_Preferences::IntSpin, "MCCAD", "iso_number_v" ); + setPreferenceProperty( isoV, "min", 0 ); + setPreferenceProperty( isoV, "max", 100000 ); + + // Set property for default display mode + QStringList aModesList; + aModesList.append( "Wireframe" ); + aModesList.append( "Shading" ); + aModesList.append( "Shading with edges" ); + + QList anIndexesList; + anIndexesList.append(0); + anIndexesList.append(1); + anIndexesList.append(2); + + setPreferenceProperty( dispmode, "strings", aModesList ); + setPreferenceProperty( dispmode, "indexes", anIndexesList ); + + + // Set property for top level display mode + QStringList aTopModesList; + aTopModesList.append( "Show additional wireframe" ); + aTopModesList.append( "Keep current mode" ); + aTopModesList.append( "Wireframe"); + aTopModesList.append( "Shading" ); + aTopModesList.append( "Shading with edges" ); + + QList aTopIndexesList; + aTopIndexesList.append(0); + aTopIndexesList.append(1); + aTopIndexesList.append(2); + aTopIndexesList.append(3); + aTopIndexesList.append(4); + setPreferenceProperty( top_lev_dm, "strings", aTopModesList ); + setPreferenceProperty( top_lev_dm, "indexes", aTopIndexesList ); + + //#######prefrence for MCCAD conversion #### + int ConvertGroup = addPreference( "General conversion", tabId ); + setPreferenceProperty( ConvertGroup, "columns", 1 ); + + int targetCode = addPreference( "Target MC code", ConvertGroup, + LightApp_Preferences::Selector, + "MCCAD", "target_code" ); + QStringList aCodesList; + aCodesList.append( "MCNP5" ); + aCodesList.append( "MCNP6" ); + aCodesList.append( "TRIPOLI" ); + aCodesList.append( "GDML" ); + QList aCodeIdxList; + aCodeIdxList.append(0); + aCodeIdxList.append(1); + aCodeIdxList.append(2); + aCodeIdxList.append(3); + setPreferenceProperty( targetCode, "strings", aCodesList ); + setPreferenceProperty( targetCode, "indexes", aCodeIdxList ); + + //initial cell and surface No. + int init_cell_no = addPreference("Start number cell with ", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "init_cell_no" ); + int init_surf_no = addPreference("Start number Surface with ", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "init_surf_no" ); + setPreferenceProperty( init_cell_no, "min", 1 ); + setPreferenceProperty( init_cell_no, "max", 99999 ); + setPreferenceProperty( init_surf_no, "min", 1 ); + setPreferenceProperty( init_surf_no, "max", 99999 ); + + + int min_solid_vol = addPreference( "Minimum solid volume", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "min_solid_vol" ); + setPreferenceProperty( min_solid_vol, "min", 0.001 ); + setPreferenceProperty( min_solid_vol, "max", 10 ); + setPreferenceProperty( min_solid_vol, "step", 1.0e-03 ); + setPreferenceProperty( min_solid_vol, "precision", 6 ); + + int min_void_vol = addPreference( "Minimum void volume", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "min_void_vol" ); + setPreferenceProperty( min_void_vol, "min", 0.1 ); + setPreferenceProperty( min_void_vol, "max", 10000 ); + setPreferenceProperty( min_void_vol, "step", 1.0e-01 ); + setPreferenceProperty( min_void_vol, "precision", 6 ); + + int min_dec_face_area = addPreference( "Minimum Size Of Decomposition Face Area", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "min_dec_face_area" ); + setPreferenceProperty( min_dec_face_area, "min", 0.1 ); + setPreferenceProperty( min_dec_face_area, "max", 1000 ); + setPreferenceProperty( min_dec_face_area, "step", 1.0e-01 ); + setPreferenceProperty( min_dec_face_area, "precision", 6 ); + + int min_compl_cell = addPreference( "Maximum Number Of Complemented Cells ", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "min_compl_cell" ); + setPreferenceProperty( min_compl_cell, "min", 0 ); + setPreferenceProperty( min_compl_cell, "max", 100000 ); + setPreferenceProperty( min_compl_cell, "step", 1 ); + + int min_pre_dec_cell = addPreference( "Maximum Number Of Pre-Decomposition Cells", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "min_pre_dec_cell" ); + setPreferenceProperty( min_pre_dec_cell, "min", 0 ); + setPreferenceProperty( min_pre_dec_cell, "max", 100000 ); + setPreferenceProperty( min_pre_dec_cell, "step", 1 ); + + int min_redec_face_area = addPreference( "Minimum Size Of Redecomposition Face Area", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "min_redec_face_area" ); + setPreferenceProperty( min_redec_face_area, "min", 0.1 ); + setPreferenceProperty( min_redec_face_area, "max", 1000 ); + setPreferenceProperty( min_redec_face_area, "step", 1.0e-01 ); + setPreferenceProperty( min_redec_face_area, "precision", 6 ); + + int min_sample_points = addPreference( "Minimum Number Of Sample Points", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "min_sample_points" ); + setPreferenceProperty( min_sample_points, "min", 1 ); + setPreferenceProperty( min_sample_points, "max", 10000 ); + setPreferenceProperty( min_sample_points, "step", 1 ); + + int max_sample_points = addPreference( "Maximum Number Of Sample Points", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "max_sample_points" ); + setPreferenceProperty( max_sample_points, "max", 1 ); + setPreferenceProperty( max_sample_points, "max", 10000 ); + setPreferenceProperty( max_sample_points, "step", 1 ); + + int x_resl = addPreference( "Resolution in X direction", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "x_resl" ); + setPreferenceProperty( x_resl, "min", 0.00001 ); + setPreferenceProperty( x_resl, "max", 10 ); + setPreferenceProperty( x_resl, "step", 1.0e-05 ); + setPreferenceProperty( x_resl, "precision", 6 ); + + + int y_resl = addPreference( "Resolution in Y direction", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "y_resl" ); + setPreferenceProperty( y_resl, "min", 0.00001 ); + setPreferenceProperty( y_resl, "max", 10 ); + setPreferenceProperty( y_resl, "step", 1.0e-05 ); + setPreferenceProperty( y_resl, "precision", 6 ); + + int r_resl = addPreference( "Resolution in R direction", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "r_resl" ); + setPreferenceProperty( r_resl, "min", 0.00001 ); + setPreferenceProperty( r_resl, "max", 10 ); + setPreferenceProperty( r_resl, "step", 1.0e-05 ); + setPreferenceProperty( r_resl, "precision", 6 ); + + int max_dec_depth = addPreference( "Max Decompose Depth", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "max_dec_depth" ); + setPreferenceProperty( max_dec_depth, "max", 1 ); + setPreferenceProperty( max_dec_depth, "max", 1000 ); + setPreferenceProperty( max_dec_depth, "step", 1 ); + + int max_cell_exp_depth = addPreference( "Max Cell Expression Length", ConvertGroup, + LightApp_Preferences::IntSpin, "MCCAD", "max_cell_exp_depth" ); + setPreferenceProperty( max_cell_exp_depth, "max", 1 ); + setPreferenceProperty( max_cell_exp_depth, "max", 1000 ); + setPreferenceProperty( max_cell_exp_depth, "step", 1 ); + + int Tolerance = addPreference( "Tolerance", ConvertGroup, + LightApp_Preferences::DblSpin, "MCCAD", "Tolerance" ); + setPreferenceProperty( Tolerance, "min", 1.0e-7 ); + setPreferenceProperty( Tolerance, "max", 0.1 ); + setPreferenceProperty( Tolerance, "step", 1.0e-07 ); + setPreferenceProperty( Tolerance, "precision", 7 ); + + addPreference("Write discrete files ", ConvertGroup, + LightApp_Preferences::Bool, "MCCAD", "write_disc_file" ); + addPreference("Write discrete model ", ConvertGroup, + LightApp_Preferences::Bool, "MCCAD", "write_disc_model" ); + addPreference("Generate void ", ConvertGroup, + LightApp_Preferences::Bool, "MCCAD", "gen_void" ); + addPreference("Force decompose ", ConvertGroup, + LightApp_Preferences::Bool, "MCCAD", "force_decomp" ); + + + //#######prefrence for MCNP6 conversion #### + int MCNP6Group = addPreference( "MCNP6", tabId ); + setPreferenceProperty( MCNP6Group, "columns", 1 ); + + int init_pseudo_cell_no = addPreference("Start pseudo cell number with ", MCNP6Group, + LightApp_Preferences::IntSpin, "MCCAD", "init_pseudo_cell_no" ); + int embed_card_no = addPreference("MCNP6 Embed card with number", MCNP6Group, + LightApp_Preferences::IntSpin, "MCCAD", "embed_card_no" ); + setPreferenceProperty( init_pseudo_cell_no, "min", 1 ); + setPreferenceProperty( init_pseudo_cell_no, "max", 99999 ); + setPreferenceProperty( embed_card_no, "min", 1 ); + setPreferenceProperty( embed_card_no, "max", 99999 ); + + //input mesh type + int MeshType = addPreference( "Input mesh type", MCNP6Group, + LightApp_Preferences::Selector, + "MCCAD", "MeshType" ); + QStringList aMeshTypeList; + aMeshTypeList.append( "abaqus" ); + QList aMeshTypeIdxList; + aMeshTypeIdxList.append(0); + setPreferenceProperty( MeshType, "strings", aMeshTypeList ); + setPreferenceProperty( MeshType, "indexes", aMeshTypeIdxList ); + + //EEOUT result output type + int EeoutFileType = addPreference( "EEOUT file output type", MCNP6Group, + LightApp_Preferences::Selector, + "MCCAD", "EeoutFileType" ); + QStringList aEeoutFileTypeList; + aEeoutFileTypeList.append( "binary" ); + aEeoutFileTypeList.append( "ascii" ); + QList aEeoutFileTypeIdxList; + aEeoutFileTypeIdxList.append(0); + aEeoutFileTypeIdxList.append(1); + setPreferenceProperty( EeoutFileType, "strings", aEeoutFileTypeList ); + setPreferenceProperty( EeoutFileType, "indexes", aEeoutFileTypeIdxList ); + + //overlap treament + int OverlapTreat = addPreference( "Overlap treament", MCNP6Group, + LightApp_Preferences::Selector, + "MCCAD", "OverlapTreat" ); + QStringList aOverlapTreatList; + aOverlapTreatList.append( "EXIT" ); + aOverlapTreatList.append( "ENTRY" ); + aOverlapTreatList.append( "AVERAGE" ); + QList aOverlapTreatIdxList; + aOverlapTreatIdxList.append(0); + aOverlapTreatIdxList.append(1); + aOverlapTreatIdxList.append(2); + setPreferenceProperty( OverlapTreat, "strings", aOverlapTreatList ); + setPreferenceProperty( OverlapTreat, "indexes", aOverlapTreatIdxList ); + + //length conversion factor + int LengthFactor = addPreference( "Length conversion factor", MCNP6Group, + LightApp_Preferences::DblSpin, "MCCAD", "LengthFactor" ); + setPreferenceProperty( LengthFactor, "min", 0 ); + setPreferenceProperty( LengthFactor, "step", 1.0 ); + setPreferenceProperty( LengthFactor, "precision", 6 ); + + //#######prefrence for Tetgen mesh generation #### + int TetMeshGroup = addPreference( "Mesh generation", tabId ); + setPreferenceProperty( TetMeshGroup, "columns", 1 ); + + int Mesher = addPreference( "Meshing engine", TetMeshGroup, + LightApp_Preferences::Selector, + "MCCAD", "meshing_engine" ); + QStringList aMesherList; + aMesherList.append( "Tetgen" ); + aMesherList.append( "Netgen" ); + QList aMesherIdxList; + aMesherIdxList.append(0); + aMesherIdxList.append(1); + setPreferenceProperty( Mesher, "strings", aMesherList ); + setPreferenceProperty( Mesher, "indexes", aMesherIdxList ); + + + int STL_Deflection = addPreference( "Surface triangulation deflection", TetMeshGroup, + LightApp_Preferences::DblSpin, "MCCAD", "STL_Deflection" ); + setPreferenceProperty( STL_Deflection, "min", 0.00005 ); + setPreferenceProperty( STL_Deflection, "max", 0.001 ); + setPreferenceProperty( STL_Deflection, "step", 0.0001 ); + setPreferenceProperty( STL_Deflection, "precision", 5 ); + + int STL_Coefficient = addPreference( "Surface triangulation coefficient", TetMeshGroup, + LightApp_Preferences::DblSpin, "MCCAD", "STL_Coefficient" ); + setPreferenceProperty( STL_Coefficient, "min", 0.00005 ); + setPreferenceProperty( STL_Coefficient, "max", 0.001 ); + setPreferenceProperty( STL_Coefficient, "step", 0.0001 ); + setPreferenceProperty( STL_Coefficient, "precision", 5 ); + + int Tet_MeshQuality = addPreference( "Tetgen mesh quality control", TetMeshGroup, + LightApp_Preferences::DblSpin, "MCCAD", "Tet_MeshQuality" ); + setPreferenceProperty( Tet_MeshQuality, "min", 1.01 ); + setPreferenceProperty( Tet_MeshQuality, "max", 2.0 ); + setPreferenceProperty( Tet_MeshQuality, "step", 0.05 ); + setPreferenceProperty( Tet_MeshQuality, "precision", 3 ); + + int Mesh_Volume_Diff = addPreference( "Allow volume difference from CAD model", TetMeshGroup, + LightApp_Preferences::DblSpin, "MCCAD", "Mesh_Volume_Diff" ); + setPreferenceProperty( Mesh_Volume_Diff, "min", 0.00001 ); + setPreferenceProperty( Mesh_Volume_Diff, "max", 1.0 ); + setPreferenceProperty( Mesh_Volume_Diff, "step", 0.005 ); + setPreferenceProperty( Mesh_Volume_Diff, "precision", 5 ); +} + + +void MCCADGUI::preferencesChanged( const QString& section, const QString& param ) +{ + if (section == "MCCAD") { + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + if (param == QString("toplevel_color")) { + QColor c = aResourceMgr->colorValue( "MCCAD", "toplevel_color", QColor( 170, 85, 0 ) ); + MCCAD_AISShape::setTopLevelColor(SalomeApp_Tools::color(c)); + } + else if (param == QString("toplevel_dm")) { + MCCAD_AISShape::setTopLevelDisplayMode((MCCAD_AISShape::TopLevelDispMode)aResourceMgr->integerValue("MCCAD", "toplevel_dm", 0)); + } + } +} + + + +// returns a custom displayer object +LightApp_Displayer* MCCADGUI::displayer() +{ + return new MCCADGUI_Displayer();; +} + +// Module's initialization +void MCCADGUI::initialize( CAM_Application* app ) +{ + + SalomeApp_Module::initialize( app ); + + InitMCCADGen( dynamic_cast( app ) ); + if (CORBA::is_nil( myEngine )) + cout <<"initialize() load engine failed! "<desktop(); + // SUIT_ResourceMgr* aResourceMgr = app->resourceMgr(); + + //create the dock panel for property dialog + myInputPanel = new QDockWidget(aParent); + QLayout* inputLayout = new QVBoxLayout(aParent); + myInputPanel->setLayout(inputLayout); + myInputPanel->setVisible(true); + myInputPanel->setWindowTitle("Input Panel"); + myInputPanel->setMinimumWidth(220); // --- force a minimum until display + aParent->addDockWidget( Qt::LeftDockWidgetArea, myInputPanel ); + + + createAction( unittest,"UnitTest", QIcon(), "UnitTest", + "UnitTest", 0, aParent, false, this, SLOT( OnUnitTest() ) ); + + createAction( lgImportGeom,"Import OCC file", QIcon(), "Import OCC file", + "Import OCC file", 0, aParent, false, this, SLOT( onImportExport()) ); + + createAction( lgCreateComponent,"Create Component", QIcon(), "Create Component", + "Create Component", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgDeleteComponents,"Delete Component(s)", QIcon(), "Delete Component(s)", + "Delete Component(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgRenameComponent,"Rename Component", QIcon(), "Rename ", + "Rename Component", 0, aParent, false, this, SLOT( onOperation() ) ); + + createAction( lgCreateGroup,"Create Group", QIcon(), "Create Group", + "Create Group", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgDeleteGroups,"Delete Group(s)", QIcon(), "Delete Group(s)", + "Delete Group(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgDeleteParts,"Delete part(s)", QIcon(), "Delete part(s)", + "Delete part(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + + createAction( lgRenameGroup,"Rename Group", QIcon(), "Rename ", + "Rename Group", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgRenamePart,"Rename Part", QIcon(), "Rename ", + "Rename Part", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgCopyParts,"Copy part(s)", QIcon(), "Copy parts", + "Copy part(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgCutParts,"Cut part(s)", QIcon(), "Cut parts", + "Cut part(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgPasteParts,"Paste part(s)", QIcon(), "Paste parts", + "Paste part(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgRecoverShape,"Recover Shape", QIcon(), "Recover", + "Recover Shape", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgDecompose,"Decompose shape", QIcon(), "Decompose", + "Decompose shape", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgSend2GEOM,"Sent to GEOM ", QIcon(), "Sent to GEOM", + "Sent to GEOM ", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgImportGEOMObj,"Import GEOM Object", QIcon(), "Import GEOM Object", + "Import GEOM Object ", 0, aParent, false, this, SLOT( onImportGEOMObj() ) ); + createAction( lgSendMesh2SMESH,"Send mesh to SMESH ", QIcon(), "Send to SMESH", + "Send mesh to SMESH ", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgImportSMESHObj,"Import SMESH Object", QIcon(), "Import SMESH Object", + "Import SMESH Object ", 0, aParent, false, this, SLOT( onImportSMESHObj() ) ); + createAction( lgClearMesh,"Clear mesh", QIcon(), "Clear mesh", + "Clear mesh ", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgExportMesh2Abaqus,"Export Mesh to Abaqus", QIcon(), "Export Mesh to Abaqus", + "Export Mesh to Abaqus", 0, aParent, false, this, SLOT( onImportExport() ) ); + createAction( lgClearEnvelop,"Clear Envelop", QIcon(), "Clear Envelop", + "Clear Envelop ", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgCheckBeforeConvert,"Check before convert", QIcon(), "Check before convert", + "Check before convert ", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgConvert2MCInput,"Convert to MC Input", QIcon(), "Convert to MC Input", + "Convert to MC Input ", 0, aParent, false, this, SLOT( onImportExport() ) ); + + createAction( lgFormNewGroup,"Form New Group", QIcon(), "Form new group ", + "Form New Group", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgFormNewComponent,"Form New Component", QIcon(), "Form new Component ", + "Form New Component", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgCopyGroups,"Copy Group(s)", QIcon(), "Copy groups", + "Copy Group(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgCutGroups,"Cut Group(s)", QIcon(), "Cut groups", + "Cut Group(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgPasteGroups,"Paste Group(s)", QIcon(), "Paste groups", + "Paste Group(s)", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgExplodePart,"Explode Part", QIcon(), "Explode Part", + "Explode Part", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgFuseParts,"Fuse Parts", QIcon(), "Fuse Parts", + "Fuse Parts", 0, aParent, false, this, SLOT( onOperation() ) ); +#ifdef WITH_TETGEN + createAction( lgGenerateTetMesh,"Generate Tetrahedral mesh ", QIcon(), "Generate Tetrahedral mesh", + "Generate Tetrahedral mesh ", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgGenerateAllMesh,"Generate all meshes", QIcon(), "Generate all meshes", + "Generate Meshes", 0, aParent, false, this, SLOT( onOperation() ) ); +#endif + createAction( lgExportGeom,"Export geometry", QIcon(), "Export geometry", + "Export geometry", 0, aParent, false, this, SLOT( onImportExport() ) ); + + + createAction( lgDisplayGEOMObjInPV,"Display GEOM Object in Paraview", QIcon(), "Display GEOM Object in Paraview", + "Display GEOM Object in Paraview", 0, aParent, false, this, SLOT( onDisplayGEOMObjInPVIS() ) ); + createAction( lgDisplay,"Show", QIcon(), "Show", + "Show", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + createAction( lgErase,"Hide", QIcon(), "Hide", + "Hide", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + createAction( lgDisplayOnly,"Show only", QIcon(), "Show only", + "Show only", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + createAction( lgShading,"Shading", QIcon(), "Shading", + "Shading", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + createAction( lgWireframe,"Wireframe", QIcon(), "Wireframe", + "Wireframe", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + createAction( lgShadingWithWireFrame,"ShadingWithWireFrame", QIcon(), "Shading With WireFrame", + "Shading With WireFrame", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + createAction( lgTransparency,"Transparency", QIcon(), "Transparency", + "Transparency", 0, aParent, false, this, SLOT( OnDisplayerCommand() ) ); + + createAction( lgExperiment,"Experiment", QIcon(), "Experiment", + "Experiment", 0, aParent, false, this, SLOT( OnExperiment() ) ); + + createAction( lgEditMaterial,"Edit Material", QIcon(), "Edit Material", + "Edit Material", 0, aParent, false, this, SLOT( onEditMaterial() ) ); + createAction( lgSetProperties,"Set Properties", QIcon(), "Set Properties", + "Set Properties", 0, aParent, false, this, SLOT( onSetProproties() ) ); + createAction( lgTransform,"Transform", QIcon(), "Transform", + "Transform", 0, aParent, false, this, SLOT( onTransform()) ); + createAction( lgMarkAsDecomposed,"Mark as Decomposed", QIcon(), "Mark as Decomposed", + "Mark as Decomposed", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgMarkAsUndecomposed,"Mark as Undecomposed", QIcon(), "Mark as Undecomposed", + "Mark as Undecomposed", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgMarkAllAsDecomposed,"Mark all as Decomposed", QIcon(), "Mark all as Decomposed", + "Mark all as Decomposed", 0, aParent, false, this, SLOT( onOperation() ) ); + createAction( lgMarkAllAsUndecomposed,"Mark all as Undecomposed", QIcon(), "Mark all as Undecomposed", + "Mark all as Undecomposed", 0, aParent, false, this, SLOT( onOperation() ) ); + + + // create menus + int aFileMnu = createMenu( tr( "File" ), -1, -1 ); + createMenu( lgImportGeom, aFileMnu, 10 ); + createMenu( lgExportMesh2Abaqus, aFileMnu, 10 ); + createMenu( lgCheckBeforeConvert, aFileMnu, 10 ); + createMenu( lgConvert2MCInput, aFileMnu, 10 ); + +// int aImportMCMnu = createMenu( tr( "Import MC Data" ), aFileMnu, -1, 10 ); +// int aImportExtDataMnu = createMenu( tr( "Import External Data" ), aFileMnu, -1, 10 ); +// int aImportExtPartMnu = createMenu( tr( "Import External Part" ), aFileMnu, -1, 10 ); +// int aExportMnu = createMenu( tr( "Export Data" ), aFileMnu, -1, 10 ); + int aMenuId = createMenu( "McCad", -1, -1, 30 ); + +// createMenu( unittest, aMenuId, 10 ); + +// createMenu( lgExperiment, aMenuId, 10 ); + createMenu( lgEditMaterial, aMenuId, 10 ); + createMenu( lgSetProperties, aMenuId, 10 ); + createMenu( lgTransform, aMenuId, 10 ); +#ifdef WITH_TETGEN + createMenu( lgGenerateAllMesh, aMenuId, 10 ); +#endif + createMenu( lgMarkAllAsDecomposed, aMenuId, 10 ); + createMenu( lgMarkAllAsUndecomposed, aMenuId, 10 ); + + QtxPopupMgr* mgr = popupMgr(); + + mgr->insert( action( lgRenameComponent ), -1, 0 ); + mgr->insert( action( lgRenameGroup ), -1, 0 ); + mgr->insert( action( lgRenamePart ), -1, 0 ); + mgr->insert( action( lgCopyParts ), -1, 0 ); + mgr->insert( action( lgCutParts ), -1, 0 ); + mgr->insert( action( lgPasteParts ), -1, 0 ); + mgr->insert( action( lgCopyGroups ), -1, 0 ); + mgr->insert( action( lgCutGroups ), -1, 0 ); + mgr->insert( action( lgPasteGroups ), -1, 0 ); + mgr->insert( action( lgDeleteComponents ), -1, 0 ); + mgr->insert( action( lgDeleteGroups ), -1, 0 ); + mgr->insert( action( lgDeleteParts ), -1, 0 ); + mgr->insert( separator(), -1, 0 ); + mgr->insert( action( lgFormNewGroup ), -1, 0 ); + mgr->insert( action( lgFormNewComponent), -1, 0 ); + mgr->insert( action( lgExplodePart), -1, 0 ); + mgr->insert( action( lgFuseParts), -1, 0 ); + mgr->insert( action( lgClearMesh ), -1, 0 ); + mgr->insert( action( lgClearEnvelop ), -1, 0 ); + + mgr->insert( separator(), -1, 0 ); + mgr->insert( action( lgCreateComponent ), -1, 0 ); + mgr->insert( action( lgCreateGroup ), -1, 0 ); + mgr->insert( separator(), -1, 0 ); + mgr->insert( action( lgDisplay ), -1, 0 ); + mgr->insert( action( lgDisplayOnly ), -1, 0 ); + mgr->insert( action( lgErase ), -1, 0 ); + int dispmodeId = mgr->insert( tr( "Display Mode" ), -1, -1 ); // display mode menu + mgr->insert( action( lgShadingWithWireFrame ), dispmodeId, -1 ); + mgr->insert( action( lgWireframe ), dispmodeId, -1 ); + mgr->insert( action( lgShading ), dispmodeId, -1 ); + mgr->insert( action( lgTransparency ), -1, 0 ); + +// mgr->insert( action( lgDisplayInPV ), -1, 0 ); +// mgr->insert( action( lgDisplayGEOMObjInPV), -1, 0 ); + mgr->insert( separator(), -1, 0 ); + mgr->insert( action( lgDecompose ), -1, 0 ); + mgr->insert( action( lgRecoverShape ), -1, 0 ); + mgr->insert( action( lgMarkAsDecomposed ), -1, 0 ); + mgr->insert( action( lgMarkAsUndecomposed ), -1, 0 ); + + mgr->insert( separator(), -1, 0 ); + + mgr->insert( action( lgSend2GEOM ), -1, 0 ); + mgr->insert( action( lgSendMesh2SMESH ), -1, 0 ); + mgr->insert( action( lgExportGeom ), -1, 0 ); + mgr->insert( action( lgImportGEOMObj ), -1, 0 ); + mgr->insert( action( lgImportSMESHObj ), -1, 0 ); + mgr->insert( separator(), -1, 0 ); + + mgr->insert( action( lgSetProperties), -1, 0 ); + mgr->insert( action( lgTransform), -1, 0 ); + #ifdef WITH_TETGEN + mgr->insert( action( lgGenerateTetMesh ), -1, 0 ); + #endif + + +// int aOpId = mgr->insert("Operation", -1, -1); + +// int aExpId = mgr->insert("Export", -1, -1); + + + QString rule = "(client='ObjectBrowser') and activeModule='MCCAD' "; + mgr->setRule( action( lgCreateComponent ), rule + + " and selcount=1 and isMCCADRootObj"); + mgr->setRule( action( lgCreateGroup ), rule + + " and selcount=1 and isComponent"); + mgr->setRule( action( lgDeleteComponents ), rule + + " and isComponent and selcount>0"); + mgr->setRule( action( lgDeleteGroups ), rule + + " and isGroup and selcount>0"); + mgr->setRule( action( lgRenameComponent ), rule + + " and isComponent and selcount=1"); + mgr->setRule( action( lgRenameGroup ), rule + + " and isGroup and selcount=1"); + + rule = "(client='ObjectBrowser' or client='OCCViewer') and activeModule='MCCAD' "; +// mgr->setRule( action( lgDisplayInPV ), rule + +// " and isPart and selcount=1 and true in $canBeDisplayed"); + mgr->setRule( action( lgRenamePart ), rule + + " and isPart and selcount=1"); + mgr->setRule( action( lgCopyParts ), rule + + " and isPart and selcount>0"); + mgr->setRule( action( lgCutParts ), rule + + " and isPart and selcount>0"); + mgr->setRule( action( lgPasteParts ), rule + + " and selcount=1 and ( isPart or isGroup ) and isPartPastable"); + mgr->setRule( action( lgDeleteParts ), rule + + " and isPart and selcount>0"); + mgr->setRule( action( lgCopyGroups ), rule + + " and isGroup and selcount>0"); + mgr->setRule( action( lgCutGroups ), rule + + " and isGroup and selcount>0"); + mgr->setRule( action( lgPasteGroups ), rule + + " and selcount=1 and ( isGroup or isComponent ) and isGroupPastable"); + + mgr->setRule( action( lgDisplay ), rule + + " and selcount>0 and isMCCADObj and true in $canBeDisplayed and !isVisible"); + mgr->setRule( action( lgDisplayOnly ), rule + + " and selcount>0 and isMCCADObj and true in $canBeDisplayed "); + mgr->setRule( action( lgErase ), rule + + " and selcount>0 and isMCCADObj and ( isVisible or isGroup or isComponent ) "); + mgr->setRule( action( lgShading ), rule + + " and selcount>0 and true in $canBeDisplayed and (isVisible or isGroup or isComponent)"); + mgr->setRule( action( lgWireframe ), rule + + " and selcount>0 and true in $canBeDisplayed and (isVisible or isGroup or isComponent)"); + mgr->setRule( action( lgShadingWithWireFrame ), rule + + " and selcount>0 and true in $canBeDisplayed and (isVisible or isGroup or isComponent)"); + mgr->setRule( action( lgTransparency ), rule + + " and selcount>0 and true in $canBeDisplayed and (isVisible or isGroup or isComponent)"); +// mgr->setRule( action( lgDisplayGEOMObjInPV ), rule + +// " and (!isPart and !isGroup) and selcount=1 "); + mgr->setRule( action( lgSetProperties ), rule + + " and selcount>0 and (isPart or isGroup or isComponent)"); + mgr->setRule( action( lgTransform ), rule + + " and selcount>0 and isPart"); + mgr->setRule( action( lgRecoverShape ), rule + + " and selcount>0 and isPart and hasBackup"); + mgr->setRule( action( lgDecompose ), rule + + " and selcount>0 and (!isDecomposed or isGroup or isComponent)"); + mgr->setRule( action( lgSend2GEOM ), rule + + " and selcount>0 and (isPart or isGroup or isComponent)"); + mgr->setRule( action( lgImportGEOMObj ), rule + + " and selcount=1 and isGEOMObj"); + mgr->setRule( action( lgSendMesh2SMESH ), rule + + " and selcount>0 and isPart and hasMesh"); + mgr->setRule( action( lgImportSMESHObj ), rule + + " and selcount=1 and isSMESHObj"); + mgr->setRule( action( lgClearMesh ), rule + + " and selcount>0 and isPart and hasMesh"); + mgr->setRule( action( lgClearEnvelop ), rule + + " and selcount>0 and isComponent and hasEnvelop"); + + mgr->setRule( action( lgFormNewGroup ), rule + + " and selcount>0 and isPart"); + mgr->setRule( action( lgFormNewComponent ), rule + + " and selcount>0 and isGroup"); + mgr->setRule( action( lgExplodePart ), rule + + " and selcount=1 and isPart and isExplodible"); + mgr->setRule( action( lgFuseParts ), rule + + " and selcount>1 and isPart"); +#ifdef WITH_TETGEN + mgr->setRule( action( lgGenerateTetMesh ), rule + + " and selcount>0 and isPart"); +#endif + mgr->setRule( action( lgExportGeom ), rule + + " and selcount>0 and (isPart or isGroup or isComponent)"); + mgr->setRule( action( lgMarkAsDecomposed ), rule + + " and selcount>0 and ((isPart and !isDecomposed) or isGroup or isComponent)"); + mgr->setRule( action( lgMarkAsUndecomposed ), rule + + " and selcount>0 and ((isPart and isDecomposed) or isGroup or isComponent)"); + +} + +//reimplement to avoid calling dm->build() +void MCCADGUI::updateObjBrowser(bool isUpdate, SUIT_DataObject *) +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) + { + MESSAGE("get Data Model failed"); + return; + } + dm->buildTree(); + SalomeApp_Module::updateObjBrowser(isUpdate); +} + +// Default windows +void MCCADGUI::windows( QMap& theMap ) const +{ + theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea ); +// theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); +} + +/*! Returns list of entities of selected objects. */ +void MCCADGUI::selected( QStringList& entries, const bool multiple ) +{ + LightApp_Application* app = getApp(); + LightApp_SelectionMgr* mgr = app ? app->selectionMgr() : 0; + if( !mgr ) return; + + SUIT_DataOwnerPtrList anOwnersList; + mgr->selected( anOwnersList ); + + for ( int i = 0; i < anOwnersList.size(); i++ ) + { + const LightApp_DataOwner* owner = dynamic_cast( anOwnersList[ i ].get() ); + QStringList es = owner->entry().split( "_" ); + if ( es.count() > 1 && es[ 0 ] == "MCCADGUI" && es[ 1 ] != "root" ) + { + if ( !entries.contains( owner->entry() ) ) + entries.append( owner->entry() ); + if( !multiple ) + break; + } + } +} + +// Module's engine IOR +QString MCCADGUI::engineIOR() const +{ + cout <<"****first call of engineIOR()"<orb()->object_to_string( GetMCCADGen() ); + return QString( anIOR.in() ); +} + +// Initialize a reference to the module's engine +void MCCADGUI::InitMCCADGen( SalomeApp_Application* app ) +{ + if ( !app ) + { + myEngine = MCCAD_ORB::MCCAD_Gen::_nil(); + } + else + { + Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer", "MCCAD" ); + if ( CORBA::is_nil(comp ) ) + cout << "InitMCCADGen(): the Component is nil!"<activeApplication(); + SalomeApp_Application* app = dynamic_cast( suitApp ); + InitMCCADGen( app ); + } + return myEngine; +} + + +// Default view managers +void MCCADGUI::viewManagers( QStringList& theViewMgrs ) const +{ + theViewMgrs.append( OCCViewer_Viewer::Type() ); +} + +// Create custom data model +CAM_DataModel* MCCADGUI::createDataModel() +{ + return new MCCADGUI_DataModel( this ); +} + +/*! Instantiation of a custom Operation object - component's action manager. */ +LightApp_Operation* MCCADGUI::createOperation( const int id ) const +{ + switch( id ) + { +// case lgEditMaterial: +// return new MCCADGUI_EditMaterialOp(); + default: + return 0; + } +} + +// Create custom selection object +LightApp_Selection* MCCADGUI::createSelection() const +{ + return new MCCADGUI_Selection(); +} + +// Module's deactivation +bool MCCADGUI::deactivateModule( SUIT_Study* theStudy ) +{ + setMenuShown( false ); + setToolShown( false ); + if (myInputPanel) myInputPanel->close(); //close the widget + + + return SalomeApp_Module::deactivateModule( theStudy ); +} + +// Module's activation +bool MCCADGUI::activateModule( SUIT_Study* theStudy ) +{ + bool bOk = SalomeApp_Module::activateModule( theStudy ); + + setMenuShown( true ); + setToolShown( true ); + + return bOk; +} + +// Study closed callback +void MCCADGUI::studyClosed( SUIT_Study* theStudy ) +{ + SalomeApp_Module::studyClosed( theStudy ); +} + +//emit selection change signal for use +void MCCADGUI::selectionChanged() +{ + emit selectChg(); +} + +void MCCADGUI::OnUnitTest() +{ + MCCAD_ORB::MCCAD_Gen_var engine = GetMCCADGen(); +// engine->unittest(); + + +} + +/*! + * \brief generate a new part + */ +void MCCADGUI::onProcess() +{ + if( sender() && sender()->inherits( "QAction" ) ) + { + int id = actionId( ( QAction* )sender() ); + startOperation( id ); + } +} + +void MCCADGUI::onOperation() +{ + if( sender() && sender()->inherits( "QAction" ) ) + { + int id = actionId( ( QAction* )sender() ); + //get selected objects + QStringList aList ; + selected(aList, true); + + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + MCCADGUI_Displayer * d = dynamic_cast (displayer()); + + if (!dm) { + MESSAGE("get Data Model failed"); + return; + } + switch ( id ) + { + case lgCreateComponent : + { + bool bOk; + QString aName = QInputDialog::getText( getApp()->desktop(),tr( "Create Component" ),tr( "Component Name"), + QLineEdit::Normal,LastComponentName, &bOk); + if (aName.trimmed().isEmpty() || bOk == false) { + SUIT_MessageBox::warning( getApp()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + LastComponentName = aName; + if (!dm->generateComponent(aName ) ) MESSAGE("Create new component failed!"); + } break; + case lgDeleteComponents : + { + if (aList.size() == 0) return; + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(),QString("Warning"),QString( "Delete item(s)?"),QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::No) return; + + //first erase then delete + erase(d); + dm->deleteComponents(aList); + } break; + case lgRenameComponent : + { + if (aList.size() == 0) return; + + bool bOk; + QString aName = QInputDialog::getText( application()->desktop(),tr( "Rename Component" ),tr( "Component Name"), + QLineEdit::Normal,dm->findObject(aList[0])->name(), &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + dm->renameComponent(aList.at(0), aName); + + } break; + case lgCreateGroup : + { //see if any thing selected + if (aList.size() == 0) { + SUIT_MessageBox::warning( getApp()->desktop(), QString("Warning"), + QString( "You should select a place to insert a group!")); + return; + } + bool bOk; + QString aName = QInputDialog::getText( getApp()->desktop(),tr( "Create Group" ),tr( "Group Name"), + QLineEdit::Normal, LastGroupName, &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( getApp()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + LastGroupName = aName; + if (dm->generateGroup(aName, dm->getComponentID(aList.at(0)) )) + MESSAGE("Generate a group failed!"); + + }break; + case lgDeleteGroups : + { + if (aList.size() == 0) return; + + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(),QString("Warning"),QString( "Delete item(s)?"),QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::No) return; + + //first erase then delete + erase(d); + dm->deleteGroups(aList); + } break; + case lgRenameGroup : + { + if (aList.size() == 0) return; + + bool bOk; + QString aName = QInputDialog::getText( application()->desktop(),tr( "Rename Group" ),tr( "Group Name"), + QLineEdit::Normal,dm->findObject(aList[0])->name(), &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + dm->renameGroup(aList.at(0), aName); + + } break; + case lgDeleteParts : + { + if (aList.size() == 0) return; + //for confirmation + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(),QString("Warning"),QString( "Delete item(s)?"),QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::No) return; + //first erase then delete + erase(d); + dm->deleteParts(aList); + } break; + case lgRenamePart : + { + if (aList.size() == 0) return; + + bool bOk; + QString aName = QInputDialog::getText( application()->desktop(),tr( "Rename Part" ),tr( "Part Name"), + QLineEdit::Normal,dm->findObject(aList[0])->name(), &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + dm->renamePart(aList.at(0), aName); + } break; + case lgCopyParts : + { + if (aList.size() == 0) return; + bool emptyList = false; //if the PasteParts should be empty or not + if (dm->getPastePartsSize() > 0) { //if has some part in the list + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Overide previous copied/cut parts? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) emptyList = true; + } + dm->copyParts(aList, emptyList); + } break; + case lgCutParts : + { + if (aList.size() == 0) return; + bool emptyList = false; //if the PasteParts should be empty or not + if (dm->getPastePartsSize() > 0) { //if has some part in the list + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Overide previous copied/cut parts? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) emptyList = true; + } + //first erase then cut + erase(d); + dm->cutParts(aList,emptyList); + } break; + case lgPasteParts : + { + if (aList.size() == 0) return; + dm->pasteParts(aList.at(0)); +// updateObjBrowser(true); + } break; + case lgCopyGroups : + { + if (aList.size() == 0) return; + bool emptyList = false; //if the PasteGroups should be empty or not + if (dm->getPasteGroupsSize() > 0) { //if has some Group in the list + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Overide previous copied/cut Groups? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) emptyList = true; + } + dm->copyGroups(aList, emptyList); + } break; + case lgCutGroups : + { + if (aList.size() == 0) return; + bool emptyList = false; //if the PasteGroups should be empty or not + if (dm->getPasteGroupsSize() > 0) { //if has some Group in the list + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Overide previous copied/cut Groups? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) emptyList = true; + } + //first erase then cut + erase(d); + dm->cutGroups(aList,emptyList); + } break; + case lgPasteGroups : + { + if (aList.size() == 0) return; + dm->pasteGroups(aList.at(0)); +// updateObjBrowser(true); + } break; + + case lgRecoverShape : + { + if (aList.size() == 0) return; + dm->recoverShapeInParts(aList); +// updateObjBrowser(true); + redisplay(displayer()); + } break; + case lgDecompose : + { + if (aList.size() == 0) return; + dm->decomposeShapes(aList); +// updateObjBrowser(true); + redisplay(displayer()); + } break; + case lgSend2GEOM : + { + if (aList.size() == 0) return; + dm->send2GEOM(aList); + + } break; + case lgSendMesh2SMESH : + { + if (aList.size() == 0) return; + dm->sendMesh2SMESH(aList); + + } break; + case lgClearMesh : + { + if (aList.size() == 0) return; + dm->clearMesh(aList); + + } break; + + case lgCheckBeforeConvert : + { + if (dm->checkBeforeConvert()) + SUIT_MessageBox::information(application()->desktop(), QString("Check Before Convert"), QString("Check OK!")); + else + SUIT_MessageBox::information(application()->desktop(), QString("Check Before Convert"), QString("Check failed!\nPlease find the screen message for more information!")); + + } break; + + case lgFormNewGroup : + { + if (aList.size() == 0) return; + bool bOk; + QString aName = QInputDialog::getText( application()->desktop(),tr( "Form new group" ),tr( "Group name"), + QLineEdit::Normal,"NewGroup", &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + erase(displayer());// erase before form new group + dm->formNewGroup(aList, aName); + + } break; + case lgFormNewComponent : + { + if (aList.size() == 0) return; + bool bOk; + QString aName = QInputDialog::getText( application()->desktop(),tr( "Form new Component" ),tr( "Component name"), + QLineEdit::Normal,"NewComponent", &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + erase(displayer());// erase before form new component + dm->formNewComponent(aList, aName); + + } break; + + case lgExplodePart : + { + if (aList.size() == 0) return; + erase(displayer()); //erase the selected because it will be deleted + dm->explodePart(aList[0]); + + } break; + case lgFuseParts : + { + if (aList.size() <= 1) return; + bool bOk; + QString aName = QInputDialog::getText( application()->desktop(),tr( "Fuse parts" ),tr( "New part name"), + QLineEdit::Normal,"FusedPart", &bOk); + if (aName.trimmed().isEmpty() || bOk == false) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Name invalid or empty!")); + return; + } + erase(displayer());// erase before form new component + dm->fuseParts(aList, aName); + } break; +#ifdef WITH_TETGEN + case lgGenerateTetMesh : + { + if (aList.size() == 0) return; + if (!dm->generateTetMesh(aList)) + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Mesh generation for this part (or some of these parts) failed!")); + + } break; + case lgGenerateAllMesh : + { + if (!dm->generateMesh()) + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "Mesh generation for might failed for some parts")); + + } break; +#endif + case lgMarkAsDecomposed : + { + if (aList.size() == 0) return; + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Mark these parts as decomposed? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) + dm->markIfDecomposed(aList, true); + else return; + } break; + case lgMarkAsUndecomposed: + { + if (aList.size() == 0) return; + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Mark these parts as undecomposed? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) + dm->markIfDecomposed(aList, false); + else return; + } break; + case lgMarkAllAsDecomposed: + { + if (aList.size() == 0) return; + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Mark all parts as decomposed? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) + dm->markAllIfDecomposed(true); + else return; + } break; + case lgMarkAllAsUndecomposed: + { + if (aList.size() == 0) return; + QMessageBox::StandardButton aBtn = SUIT_MessageBox::warning(application()->desktop(), + QString("Warning"),QString( "Mark all parts as undecomposed? "), + QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) + dm->markAllIfDecomposed(false); + else return; + } break; + default: MESSAGE ("Action not found!"); break; + + } + updateObjBrowser(); + } +} + +void MCCADGUI:: onImportExport() +{ + if( sender() && sender()->inherits( "QAction" ) ) + { + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) + { + MESSAGE("get Data Model failed"); + return; + } + + //get selected group + QStringList aList ; + selected(aList, true); + int id = actionId( ( QAction* )sender() ); + + //switch actions + switch ( id ) + { + case lgImportGeom: + { + //create component and get group id + int aComponentID = -1; + int aGroupID = -1; + + MCCAD_ORB::MCCAD_Gen_var engine = GetMCCADGen(); + const int studyID = application()->activeStudy()->id(); + if ( !studyID || CORBA::is_nil( engine ) ) return; + + if (aList.size() > 0) { + aComponentID = dm->getComponentID(aList.at(0)); + aGroupID = dm->getGroupID(aList.at(0)); + if (aComponentID == -1) { + //create a new component + MCCAD_ORB::Component_var aComponent = engine->generateComponent("NewComponent"); + aComponentID = aComponent->getID(); + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + aComponentList->length(aComponentList->length() + 1); //increase one space + (*aComponentList)[aComponentList->length() -1] = aComponent._retn(); + } + } + else { // nothing selected, create a new component + MCCAD_ORB::Component_var aComponent = engine->generateComponent("NewComponent"); + aComponentID = aComponent->getID(); + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + aComponentList->length(aComponentList->length() + 1); //increase one space + (*aComponentList)[aComponentList->length() -1] = aComponent._retn(); + } + + //get all the selected files +// QString fileName = "/mnt/shared/tmp/CoolingPlate.stp"; //for testing + QStringList fileNames = QFileDialog::getOpenFileNames(getApp()->desktop(), + tr("Open OCC File"), + LastDir, + // tr("STEP (*.stp, *.step);;All(*.*)")); + tr("STEP (*.stp *.step);;BREP (*.brep);;IGES (*.iges *.igs);;All(*.*)")); + + + if (fileNames.size() == 0) return; + //ask if explode +// bool isExplode = false; +// QMessageBox::StandardButton aBtn = SUIT_MessageBox::information(application()->desktop(),QString("Message"), +// QString( "If model contains compound(s), explode them?"),QMessageBox::Yes, QMessageBox::No); + +// if (aBtn == QMessageBox::Yes) isExplode = true; + if (fileNames.size() > 1 ) { + QMessageBox::StandardButton aBtn = SUIT_MessageBox::information(application()->desktop(),QString("Message"), + QString( "Put these files into one group?"),QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) { + MCCAD_ORB::Group_var aGroup = engine->generateGroup("NewGroup"); + aGroupID = aGroup->getID(); + MCCAD_ORB::Component_var aComponent = engine->getComponent(studyID, aComponentID); + aComponent->appendGroup(aGroup); + } + + } + bool isExplode = false; //for explode + for (int i=0; idesktop(), QString("Warning"), + QString( "File directory invalid or name empty!")); + return; + } + + if (!dm->importGeom(fileNames[i], isExplode, aComponentID, aGroupID)) { + MESSAGE("Import failed!"); + return; + } + } + LastDir = SUIT_Tools::dir(fileNames[0]); //save the dir + + + } break; + case lgExportMesh2Abaqus: + { + QString fileName = QFileDialog::getSaveFileName(application()->desktop(), + tr("Save to Abaqus inp file"), + LastDir, + tr("Abaqus (*.inp);;All(*.*)")); + if (fileName.trimmed().isEmpty() || SUIT_Tools::file(fileName).trimmed().isEmpty()) + return; + + if (SUIT_Tools::extension(fileName).toLower() != "inp") + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "The extension will be changed to *.inp")); + fileName = SUIT_Tools::addSlash(SUIT_Tools::dir(fileName)) + SUIT_Tools::file(fileName, false); //get a filename without extension + fileName += ".inp"; + } + if (dm->exportAllMesh2Abaqus(fileName)) + SUIT_MessageBox::information(application()->desktop(), QString("Export Abaqus Mesh"), QString("Export done!")); + else + SUIT_MessageBox::information(application()->desktop(), QString("Export Abaqus Mesh"), QString("Export failed!")); + + } break; + case lgConvert2MCInput: + { + QString fileName = QFileDialog::getSaveFileName(application()->desktop(), + tr("Save to file"), + LastDir, + tr("All(*.*)")); + if (fileName.trimmed().isEmpty() || SUIT_Tools::file(fileName).trimmed().isEmpty()) + return; + + if (dm->convert2MC(fileName)) + SUIT_MessageBox::information(application()->desktop(), QString("Convert to MC input"), QString("Conversion done!")); + else + SUIT_MessageBox::information(application()->desktop(), QString("Convert to MC input"), QString("Conversion failed!")); + + } break; + case lgExportGeom: + { + QString fileName = QFileDialog::getSaveFileName(application()->desktop(), + tr("Save geometry"), + LastDir, + tr("STEP (*.stp *.step);;BREP (*.brep);;IGES (*.iges *.igs);;All(*.*)")); + if (fileName.trimmed().isEmpty() || SUIT_Tools::file(fileName).trimmed().isEmpty()) + return; + + if (SUIT_Tools::extension(fileName).toLower() != "stp" && + SUIT_Tools::extension(fileName).toLower() != "step" && + SUIT_Tools::extension(fileName).toLower() != "brep" && + SUIT_Tools::extension(fileName).toLower() != "iges" && + SUIT_Tools::extension(fileName).toLower() != "igs" ) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"), + QString( "The extension will be changed to *.stp")); + fileName = SUIT_Tools::addSlash(SUIT_Tools::dir(fileName)) + SUIT_Tools::file(fileName, false); //get a filename without extension + fileName += ".stp"; + } + if (dm->exportGeom(aList, fileName)) + SUIT_MessageBox::information(application()->desktop(), QString("Export geometry"), QString("Export done!")); + else + SUIT_MessageBox::information(application()->desktop(), QString("Export geometry"), QString("Export failed!")); + + } break; + + default: MESSAGE ("Action not found!"); break; + } + updateObjBrowser(); + } + +} + + +//find http://www.salome-platform.org/forum/forum_12/842743364 for detail introduction +//this function is changed because it cause trouble loading ParaVIS libraries preceed ParaVIS loading them by itself. +/*void MCCADGUI::onDisplayPVIS() +{ + //get A selected objects + QStringList aList ; + selected(aList, false); + if (aList.size() == 0) + { + MESSAGE("No object selected"); + return; + } + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) + { + MESSAGE("get Data Model failed"); + return; + } + + MCCADGUI_DataObject * aObj = dm->findObject(aList.at(0)); + if (aObj && aObj->isPart()) + { + Engines::EngineComponent_var comp = getApp()->lcc()->FindOrLoad_Component("FactoryServer", "PARAVIS" ); + PARAVIS::PARAVIS_Gen_var aPVGen = PARAVIS::PARAVIS_Gen::_narrow(comp); + if (!aPVGen->_is_nil()) + { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + std::ostringstream aScript; + char *IOR; + if (strcmp(aPart->getType(), "EmptyPart") == 0) + { + SALOME_MED::MEDCouplingFieldTemplateCorbaInterface_var aFieldTemplate = + aPart->getFieldTemplate(); + if (!aFieldTemplate->_is_nil()) + IOR = getApp()->orb()->object_to_string(aFieldTemplate); + } + else + { + SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_var aField = + aPart->getField(); + if (!aField->_is_nil()) + IOR =getApp()->orb()->object_to_string(aField); + } + if (*IOR == 0) + { + MESSAGE("Emtpy IOR!") + return; + } + aScript << "src1 = ParaMEDCorbaPluginSource()\nsrc1.IORCorba = '" << IOR + << "'\nasc=GetAnimationScene()\nrw=GetRenderView()\ndr=Show()\ndr.Visibility = 1\nRender()"; + CORBA::string_free(IOR); + aPVGen->ExecuteScript(aScript.str().c_str()); + return; + } + MESSAGE("Please open ParaVIS before this operation!"); + return; + } + MESSAGE("Cannot find object, or object is not a part!"); +} +*/ + +//copy from SMESH_NumberFilter::getGeom +GEOM::GEOM_Object_ptr MCCADGUI::getGeom (const SUIT_DataOwner* theDataOwner, const bool extractReference ) +{ + const LightApp_DataOwner* owner = + dynamic_cast(theDataOwner); + SalomeApp_Study* appStudy = dynamic_cast + (SUIT_Session::session()->activeApplication()->activeStudy()); + + GEOM::GEOM_Object_var anObj; + + if (!owner || !appStudy) + return GEOM::GEOM_Object::_nil(); + + _PTR(Study) study = appStudy->studyDS(); + QString entry = owner->entry(); + + _PTR(SObject) aSO( study->FindObjectID( entry.toLatin1().data() ) ), aRefSO; + if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) ) + aSO = aRefSO; + + if (!aSO) + return GEOM::GEOM_Object::_nil(); + + CORBA::Object_var anObject = _CAST(SObject,aSO)->GetObject(); + anObj = GEOM::GEOM_Object::_narrow(anObject); + if (!CORBA::is_nil(anObj)) + return anObj._retn(); + + return GEOM::GEOM_Object::_nil(); +} + + +//copy from SMESH_NumberFilter::getGeom +SMESH::SMESH_Mesh_var MCCADGUI::getSmesh (const SUIT_DataOwner* theDataOwner, const bool extractReference ) +{ + const LightApp_DataOwner* owner = + dynamic_cast(theDataOwner); + SalomeApp_Study* appStudy = dynamic_cast + (SUIT_Session::session()->activeApplication()->activeStudy()); + + SMESH::SMESH_Mesh_var anObj; + + if (!owner || !appStudy) + return SMESH::SMESH_Mesh::_nil(); + + _PTR(Study) study = appStudy->studyDS(); + QString entry = owner->entry(); + + _PTR(SObject) aSO( study->FindObjectID( entry.toLatin1().data() ) ), aRefSO; + if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) ) + aSO = aRefSO; + + if (!aSO) + return SMESH::SMESH_Mesh::_nil(); + + CORBA::Object_var anObject = _CAST(SObject,aSO)->GetObject(); + anObj = SMESH::SMESH_Mesh::_narrow(anObject); + if (!CORBA::is_nil(anObj)) + return anObj._retn(); + + return SMESH::SMESH_Mesh::_nil(); +} + +//display GEOM object in PVIS +//A OCC2VTK Plugin is programed for this application +void MCCADGUI::onDisplayGEOMObjInPVIS() +{ + //get a selected objects + LightApp_Application* app = getApp(); + LightApp_SelectionMgr* SltMgr = app ? app->selectionMgr() : 0; + if( !SltMgr ) + return; + SUIT_DataOwnerPtrList anOwnersList; + SltMgr->selected( anOwnersList ); + if (anOwnersList.size() == 0 || anOwnersList.size() > 1) + { + MESSAGE("No or more than one object selected!"); + return; + } + + const LightApp_DataOwner* owner = dynamic_cast( anOwnersList[ 0 ].get() ); + // Get geom object from IO + GEOM::GEOM_Object_var aGeomObj = getGeom(owner, true); + if (aGeomObj->_is_nil()) + { + MESSAGE("the GEOM object is nil!"); + return; + } + + //Get paraVIS_Gen + int argc=0; + CORBA::ORB_var orb=CORBA::ORB_init(argc,0); + CORBA::Object_var obj=orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa=PortableServer::POA::_narrow(obj); + PortableServer::POAManager_var mgr=poa->the_POAManager(); + mgr->activate(); + SALOME_NamingService ns(orb); + ns.Change_Directory("/Containers"); + //search for the ParaVIS Gen + vector aPathList = ns.list_directory_recurs(); + std::ostringstream path; + for (int i=0; i= 0 && atmpStr.find("PARAVIS") _request("ExecuteScript"); + CORBA::NVList_ptr args=req->arguments(); + CORBA::Any ob; + std::ostringstream script; + + char *IOR; + IOR = orb->object_to_string(aGeomObj); + if (*IOR == 0){ + MESSAGE("Emtpy IOR!") + return; + } +// cout <add_value("script",ob,CORBA::ARG_IN); + req->set_return_type(CORBA::_tc_void); + req->invoke(); + cout <<"Invoked."<inherits( "QAction" ) ) { + + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) { + MESSAGE("Get data model failed!"); + return ; + } + + const int id = actionId ( (QAction*)obj ); + MCCADGUI_Displayer * d = dynamic_cast (displayer()); + QStringList entries; + selected ( entries, true ); + + switch ( id ) { + case lgDisplayOnly: { + d->EraseAll(/*force*/true); + display(d); + d->UpdateViewer(); + } break; + case lgDisplay : { + display(d); + } break; + case lgErase : { + erase(d); + } break; + case lgShading : { + setProperty(entries, MCCAD::DisplayMode, 1); + d->SetDisplayMode(1 /*shading mode*/); + redisplay(d); + } break; + case lgWireframe : { + setProperty(entries, MCCAD::DisplayMode, 0); + d->SetDisplayMode(0 /*wireframe mode*/); + redisplay(d); + } break; + case lgShadingWithWireFrame : { + setProperty(entries, MCCAD::DisplayMode, 2); + d->SetDisplayMode(2 /*shading with wireframe*/); + redisplay(d); + } break; + case lgTransparency : { + MCCADGUI_TransparencyDlg( getApp()->desktop(), entries ).exec(); + } break; + default: printf( "ERROR: Action with ID = %d was not found in MCCADGUI\n", id ); break; + } + } +} + +void MCCADGUI::OnExperiment() +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + dm->buildTree(); + updateObjBrowser(); +} + +void MCCADGUI::onEditMaterial() +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) return; + + MCCADGUI_MCardDialog aMatDialog (application()->desktop(),dm ); + aMatDialog.Refresh(); + aMatDialog.exec(); +} + +void MCCADGUI::onSetProproties() +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) return; + + MCCADGUI_SetPropertyDialog * aPropertyDialog = new MCCADGUI_SetPropertyDialog(myInputPanel, dm); + myInputPanel->setWidget(aPropertyDialog); + aPropertyDialog->exec(); + delete aPropertyDialog; +} + +void MCCADGUI::onTransform() +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) return; + + MCCADGUI_TransformDialog * aPropertyDialog = new MCCADGUI_TransformDialog(application()->desktop(), dm); + aPropertyDialog->exec(); + delete aPropertyDialog; +} + +void MCCADGUI::onImportGEOMObj() +{ + //get a selected objects + LightApp_Application* app = getApp(); + LightApp_SelectionMgr* SltMgr = app ? app->selectionMgr() : 0; + if( !SltMgr ) + return; + SUIT_DataOwnerPtrList anOwnersList; + SltMgr->selected( anOwnersList ); + if (anOwnersList.size() == 0 || anOwnersList.size() > 1) { + MESSAGE("No or more than one object selected!"); + return; + } + const LightApp_DataOwner* owner = dynamic_cast( anOwnersList[ 0 ].get() ); + // Get geom object from IO + GEOM::GEOM_Object_var aGeomObj = getGeom(owner, true); + if (aGeomObj->_is_nil()) { + MESSAGE("the GEOM object is nil!"); + return; + } + + // Get shape from geom object and verify its parameters + GEOM_Client aGeomClient; + if ( CORBA::is_nil( GeometryGUI::GetGeomGen() ) && !GeometryGUI::InitGeomGen() ) { + MESSAGE("Could not get the GEOM Engine!"); + return ; + } + TopoDS_Shape aShape = aGeomClient.GetShape(GeometryGUI::GetGeomGen(), aGeomObj); + if (aShape.IsNull()) { + MESSAGE("The Shape is Nil!"); + return ; + } + + //call the dialog + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) return; + MCCADGUI_ImportObjDialog aImportDialog (myInputPanel, dm); //!!! temporary. the parent of this dialog should be application->destop() + myInputPanel->setWidget(&aImportDialog); + aImportDialog.SetSourceObjName(aGeomObj->GetName()); + if (aImportDialog.exec() == 1) //if canceled + return; + + QStringList aList ; + selected(aList, /*multiple*/false); + QString aEntry; + if (aList.isEmpty() ) + aEntry = ""; //push a empty object, to invoke dm to create a new component and group + else + aEntry = aList[0]; + if (dm->assignShape(aEntry, aShape, aGeomObj->GetName())) + SUIT_MessageBox::information(application()->desktop(), QString("Import GEOM Object"), QString("Import done!")); + else + SUIT_MessageBox::information(application()->desktop(), QString("Import GEOM Object"), QString("Import failed!")); + redisplay(displayer()); + updateObjBrowser(); +} + + +/*! + * \brief MCCADGUI::onImportSMESHObj + * import SMESH Object for parts + */ +void MCCADGUI::onImportSMESHObj() +{ + //get a selected objects + LightApp_Application* app = getApp(); + LightApp_SelectionMgr* SltMgr = app ? app->selectionMgr() : 0; + if( !SltMgr ) + return; + SALOME_ListIO aListIO; +// SUIT_DataOwnerPtrList anOwnersList; +// SltMgr->selected( anOwnersList ); + SltMgr->selectedObjects(aListIO); + if (aListIO.IsEmpty()) { + MESSAGE("No object selected!"); + return; + } +// const LightApp_DataOwner* owner = dynamic_cast( anOwnersList[ 0 ].get() ); + + Handle(SALOME_InteractiveObject) anIO = aListIO.First(); + + //call the dialog + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) return; + MCCADGUI_ImportObjDialog aImportDialog (myInputPanel, dm); //!!! temporary. the parent of this dialog should be application->destop() + myInputPanel->setWidget(&aImportDialog); + aImportDialog.SetSourceObjName(anIO->getName()); + if (aImportDialog.exec() == 1) //if canceled + return; + + QStringList aList ; + selected(aList, /*multiple*/false); + if (dm->assignMesh(aList[0], anIO->getEntry(), anIO->getName())) + SUIT_MessageBox::information(application()->desktop(), QString("Import SMESH Object"), QString("Import done!")); + else + SUIT_MessageBox::information(application()->desktop(), QString("Import SMESH Object"), QString("Import failed!")); + updateObjBrowser(); +} + + +/*! + * \brief display selected items + */ +void MCCADGUI::display( LightApp_Displayer* aDisplayer) +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) { + MESSAGE("Get data model failed!"); + return ; + } + QStringList entries; + selected ( entries, true ); + MCCADGUI_Displayer * d = dynamic_cast (aDisplayer); + + for ( QStringList::const_iterator it = entries.begin(), last = entries.end(); it != last; it++ ) + { + MCCADGUI_DataObject * aObj = dm->findObject(*it); + if (!aObj) { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return ; + } + //to see what it is the object + if (aObj->isPart()) + d->Display( aObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + else if (aObj->isGroup() ) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + if (!d->isVisible(bObj->entry())) + d->Display( bObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else if (aObj->isComponent()) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + MCCADGUI_DataObject * cObj = dynamic_cast (bObj->firstChild()); + for (int j=0; jchildCount(); j++) { + if (!d->isVisible(cObj->entry())) + d->Display( cObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + cObj = dynamic_cast (cObj->nextBrother()); + } + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else + MESSAGE("Cannot display this object!"); + } + d->UpdateViewer(); +} + +/*! + * \brief erase selected items + */ +void MCCADGUI::erase(LightApp_Displayer* aDisplayer) +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) { + MESSAGE("Get data model failed!"); + return ; + } + QStringList entries; + selected ( entries, true ); + MCCADGUI_Displayer * d = dynamic_cast (aDisplayer); + for ( QStringList::const_iterator it = entries.begin(), last = entries.end(); it != last; it++ ) { + MCCADGUI_DataObject * aObj = dm->findObject(*it); + if (!aObj) { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return ; + } + //to see what it is the object + if (aObj->isPart()) + d->Erase( aObj->entry().toLatin1(),/*forced=*/true, /*updateviewer=*/true, 0 ); + else if (aObj->isGroup() ) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + if (d->isVisible(bObj->entry())) + d->Erase( bObj->entry().toLatin1(),/*forced=*/true, /*updateviewer=*/false, 0 ); + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else if (aObj->isComponent()) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + MCCADGUI_DataObject * cObj = dynamic_cast (bObj->firstChild()); + for (int j=0; jchildCount(); j++) { + if (d->isVisible(cObj->entry())) + d->Erase( cObj->entry().toLatin1(),/*forced=*/true, /*updateviewer=*/false, 0 ); + cObj = dynamic_cast (cObj->nextBrother()); + } + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else + MESSAGE("Cannot display this object!"); + } + d->UpdateViewer(); +} + +/*! + * \brief Redisplay selected items + */ +void MCCADGUI::redisplay(LightApp_Displayer* aDisplayer) +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) { + MESSAGE("Get data model failed!"); + return ; + } + QStringList entries; + selected ( entries, true ); + MCCADGUI_Displayer * d = dynamic_cast (aDisplayer); + for ( QStringList::const_iterator it = entries.begin(), last = entries.end(); it != last; it++ ) + { + MCCADGUI_DataObject * aObj = dm->findObject(*it); + if (!aObj) + { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return ; + } + //to see what it is the object + if (aObj->isPart()) { + if (d->isVisible(aObj->entry())) + d->Redisplay( aObj->entry().toLatin1(), /*updateviewer=*/false ); + //2013-12-1 no need to display +// else +// d->Display( aObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + } + else if (aObj->isGroup() ) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + if (d->isVisible(bObj->entry())) + d->Redisplay( bObj->entry().toLatin1(), /*updateviewer=*/false ); + //2013-12-1 no need to display +// else +// d->Display( bObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else if (aObj->isComponent()) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + MCCADGUI_DataObject * cObj = dynamic_cast (bObj->firstChild()); + for (int j=0; jchildCount(); j++) { + if (d->isVisible(cObj->entry())) + d->Redisplay( cObj->entry().toLatin1(), /*updateviewer=*/false ); + //2013-12-1 no need to display +// else +// d->Display( cObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + + cObj = dynamic_cast (cObj->nextBrother()); + } + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else + MESSAGE("Cannot Redisplay this object!"); + } + d->UpdateViewer(); +} + +void MCCADGUI::setProperty (const QStringList & entries, MCCAD::Property aProp, QVariant aValue ) +{ + MCCADGUI_DataModel * dm = dynamic_cast (dataModel()); + if (!dm) { + MESSAGE("Get data model failed!"); + return ; + } + + SALOME_View * aView = MCCADGUI_Displayer::GetActiveView(); + SalomeApp_Study* study = dynamic_cast (application()->activeStudy()); + if ( study && aView) { + SUIT_ViewModel* viewModel = dynamic_cast( aView ); + SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0; + int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1; + + if ( viewModel && viewId != -1 ) { + // get properties from the study + + for ( QStringList::const_iterator it = entries.begin(), last = entries.end(); it != last; it++ ) + { + MCCADGUI_DataObject * aObj = dm->findObject(*it); + if (!aObj) { + SUIT_MessageBox::warning( application()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return ; + } + //to see what it is the object + if (aObj->isPart()) { + PropMap aPropMap = study->getObjectPropMap( viewId, aObj->entry() ); +// if ( aPropMap.contains( MCCAD::propertyName( aProp ) ) ) + study->setObjectProperty(viewId,aObj->entry() , propertyName( aProp ), aValue); + } + else if (aObj->isGroup() ) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + PropMap aPropMap = study->getObjectPropMap( viewId, bObj->entry() ); +// if ( aPropMap.contains( MCCAD::propertyName( aProp ) ) ) + study->setObjectProperty(viewId,bObj->entry() , propertyName( aProp ), aValue); + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else if (aObj->isComponent()) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + MCCADGUI_DataObject * cObj = dynamic_cast (bObj->firstChild()); + for (int j=0; jchildCount(); j++) { + + PropMap aPropMap = study->getObjectPropMap( viewId, cObj->entry() ); +// if ( aPropMap.contains( MCCAD::propertyName( aProp ) ) ) + study->setObjectProperty(viewId,cObj->entry() , propertyName( aProp ), aValue); + cObj = dynamic_cast (cObj->nextBrother()); + } + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else + MESSAGE("Cannot set this object property!"); + } + } + } +} + + + +// Export the module +extern "C" { +// this function should be EXPORT in order to be call in Windows +Standard_EXPORT CAM_Module* createModule() +{ + return new MCCADGUI(); +} +} diff --git a/src/MCCADGUI/MCCADGUI.h b/src/MCCADGUI/MCCADGUI.h new file mode 100644 index 0000000..e6c3f35 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI.h @@ -0,0 +1,170 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + +#ifndef _MCCADGUI_H_ +#define _MCCADGUI_H_ + +#include +#include +#include +#include CORBA_CLIENT_HEADER(MCCAD) +#include CORBA_CLIENT_HEADER(GEOM_Gen) +#include CORBA_CLIENT_HEADER(SMESH_Gen) +#include CORBA_CLIENT_HEADER(MEDCouplingCorbaServant) +#include "MCCAD_Constants.h" +#include +#include +#include + +class SalomeApp_Application; + +class MCCADGUI: public SalomeApp_Module +{ + Q_OBJECT + +public: + MCCADGUI(); + + void initialize( CAM_Application* ); + void windows( QMap& ) const; + void viewManagers( QStringList& ) const; + + void selected( QStringList&, const bool multiple); + + virtual QString engineIOR() const; + + static void InitMCCADGen( SalomeApp_Application* ); + static MCCAD_ORB::MCCAD_Gen_var GetMCCADGen(); + void createPreferences(); + void preferencesChanged( const QString& section, const QString& param ); + + virtual LightApp_Displayer* displayer(); + virtual void updateObjBrowser(bool isUpdate = false, SUIT_DataObject* = 0 ); + GEOM::GEOM_Object_ptr getGeom(const SUIT_DataOwner* theDataOwner, const bool extractReference ); + SMESH::SMESH_Mesh_var getSmesh(const SUIT_DataOwner* theDataOwner, const bool extractReference ); + + +protected: + enum { unittest = 901, + + lgImportGeom = 902, + lgCreateGroup = 1001, + lgDeleteGroups = 1002, + lgDeleteParts = 1003, + lgRenameGroup = 1004, + lgRenamePart = 1005, + lgCopyParts = 1006, + lgCutParts =1007, + lgPasteParts =1008, + lgCreateComponent = 1009, + lgDeleteComponents = 1010, + lgRenameComponent = 1011, + lgRecoverShape = 1012, + lgDecompose = 1013, + lgSend2GEOM = 1014, + lgImportGEOMObj = 1015, + lgSendMesh2SMESH = 1016, + lgImportSMESHObj = 1017, + lgClearMesh = 1018, + lgExportMesh2Abaqus = 1019, + lgClearEnvelop = 1020, + lgCheckBeforeConvert = 1021, + lgConvert2MCInput = 1022, + + lgFormNewGroup = 1023, + lgFormNewComponent = 1024, + lgCopyGroups = 1025, + lgCutGroups =1026, + lgPasteGroups =1027, + lgExplodePart =1028, + lgFuseParts =1029, + #ifdef WITH_TETGEN + lgGenerateTetMesh =1030, + lgGenerateAllMesh =1031, + #endif + lgExportGeom = 1032, + +// lgDisplayInPV =1101, + lgDisplay =1102, + lgErase =1103, + lgShading =1104, + lgWireframe =1105, + lgShadingWithWireFrame =1106, + lgTransparency =1107, + lgDisplayGEOMObjInPV =1108, + lgDisplayOnly =1109, + + lgEditMaterial =1110, + lgSetProperties =1111, + lgTransform =1112, + lgMarkAsDecomposed =1113, + lgMarkAsUndecomposed =1114, + lgMarkAllAsDecomposed =1115, + lgMarkAllAsUndecomposed =1116, + + + lgExperiment =1999 + + }; + + virtual CAM_DataModel* createDataModel(); + virtual LightApp_Operation* createOperation( const int ) const; + virtual LightApp_Selection* createSelection() const; + +public slots: + virtual bool deactivateModule( SUIT_Study* ); + virtual bool activateModule( SUIT_Study* ); + virtual void studyClosed( SUIT_Study* ); + virtual void selectionChanged(); + +signals: + void selectChg(); + +protected slots: + void OnUnitTest(); + void onProcess(); + void onOperation(); + void onImportExport(); + void onDisplayGEOMObjInPVIS(); + + void OnDisplayerCommand(); + void OnExperiment(); + void onEditMaterial(); + void onSetProproties(); + void onImportGEOMObj(); + void onImportSMESHObj(); + void onTransform(); + + +public: + void display( LightApp_Displayer * aDisplayer); + void erase(LightApp_Displayer * aDisplayer); + void redisplay( LightApp_Displayer * aDisplayer); + void setProperty (const QStringList & entries, MCCAD::Property aProp , QVariant aValue); + +private: + + static MCCAD_ORB::MCCAD_Gen_var myEngine; + QString LastDir; + QString LastGroupName; + QString LastComponentName; + QDockWidget *myInputPanel; // for property dialog + +}; + +#endif diff --git a/src/MCCADGUI/MCCADGUI_DataModel.cxx b/src/MCCADGUI/MCCADGUI_DataModel.cxx new file mode 100644 index 0000000..437cc6b --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_DataModel.cxx @@ -0,0 +1,2927 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#include "MCCADGUI_DataModel.h" +//#include "MCCADGUI_DataObject.h" +//#include "MCCADGUI.h" +//SALOME includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utilities.h" +#include CORBA_SERVER_HEADER(SALOMEDS) +#include CORBA_CLIENT_HEADER(MEDCouplingCorbaServant) +#include CORBA_CLIENT_HEADER(GEOM_Gen) +#include CORBA_CLIENT_HEADER(SMESH_Gen) +#include CORBA_CLIENT_HEADER(MCCAD) +#include +#include +#include +#include + +//QT includes +#include +#include +#include +#include +#include +#include + +#include +#include + +//MEDCoupling +#include "MEDCouplingMeshClient.hxx" +#include "MEDCouplingMeshServant.hxx" +#include "MEDCouplingMemArray.hxx" +#include "MEDCouplingUMesh.hxx" +#include "MEDCouplingUMeshServant.hxx" +#include "MEDCouplingUMeshClient.hxx" +#include "MEDCouplingAutoRefCountObjectPtr.hxx" + +//MCCAD and OCC +#include +#include +#include +#include +#include +#include +#include "../MCCAD/McCadTool/McCadConvertConfig.hxx" +#include "S_McCadVoidCellManager.hxx" +#include "S_McCadMcnpWriter.hxx" +#include +#include +#include +#include +#include + +#include + +/*! Constructor */ +MCCADGUI_DataModel::MCCADGUI_DataModel( CAM_Module* module ) + : LightApp_DataModel( module ), + myStudyURL("") +{ + PasteParts = new MCCAD_ORB::PartList; + PasteGroups = new MCCAD_ORB::GroupList; +} + +/*! Destructor */ +MCCADGUI_DataModel::~MCCADGUI_DataModel() +{ + PasteParts->length(0); + PasteGroups->length(0); +} + +/*! + \brief Open data model (read data from the files). This method is load + when a saved study is loaded + \param url study file path + \param study study pointer + \param listOfFiles list of the (temporary) files with data + \return operation status (\c true on success and \c false on error) +*/ +bool MCCADGUI_DataModel::open( const QString& url, CAM_Study* study, QStringList listOfFiles ) +{ + LightApp_Study* aDoc = dynamic_cast( study ); + if ( !aDoc ) + return false; + + LightApp_DataModel::open( url, aDoc, listOfFiles ); + + return true; +} + +/*! + \brief Save data model (write data to the files). + \param listOfFiles returning list of the (temporary) files with saved data + \return operation status (\c true on success and \c false on error) +*/ +bool MCCADGUI_DataModel::save( QStringList& theListOfFiles ) +{ +// bool isMultiFile = true; + + LightApp_DataModel::save( theListOfFiles ); + return true; +} + +/*! + \brief Save data model (write data to the files). + \param url study file path + \param study study pointer + \param listOfFiles returning list of the (temporary) files with saved data + \return operation status (\c true on success and \c false on error) +*/ +bool MCCADGUI_DataModel::saveAs( const QString& url, CAM_Study* study, QStringList& theListOfFiles ) +{ + myStudyURL = url; + return save( theListOfFiles ); +} + +/*! + \brief Close data model (remove all relevant data). + \return operation status (\c true on success and \c false on error) +*/ +bool MCCADGUI_DataModel::close() +{ + return LightApp_DataModel::close(); +} + +/*! + \brief Create empty data model. + \param study study pointer + \return operation status (\c true on success and \c false on error) +*/ +bool MCCADGUI_DataModel::create( CAM_Study* study ) +{ + return true; +} + +/*! + \brief Get 'modified' flag. + \return \c true if data is changed from the last saving +*/ +bool MCCADGUI_DataModel::isModified() const +{ + // return false to avoid masking study's isModified() + return false; +} + +/*! + \brief Get 'saved' flag. + \return \c true if data has been saved +*/ +bool MCCADGUI_DataModel::isSaved() const +{ + // return true to avoid masking study's isSaved() + return true; +} + +/*! + \brief Update data model. + \param obj data object (starting for the update) + \param study study pointer +*/ +void MCCADGUI_DataModel::update( LightApp_DataObject* /*obj*/, LightApp_Study* /*study*/ ) +{ + // Nothing to do here: we always keep the data tree in the up-to-date state + // The only goal of this method is to hide default behavior from LightApp_DataModel + return; +} + +bool MCCADGUI_DataModel::generateComponent(const QString& aComponentName) +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + //generate a component inside the engine + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + if (!aComponentList) + { + MESSAGE("Component list is emtpy"); + return false; + } + aComponentList->length(aComponentList->length()+1);// increase a space for new component + MCCAD_ORB::Component_var aComponent = engine->generateComponent(aComponentName.toLatin1()); + (*aComponentList)[aComponentList->length()-1] = aComponent; + return true; + } + return false; +} + +bool MCCADGUI_DataModel::generateGroup(const QString& aGroupName, const int & ComponentID) +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + //generate a group + MCCAD_ORB::Group_var aGroup = engine->generateGroup(aGroupName.toLatin1()); + MCCAD_ORB::Component_var aComponent = engine->getComponent(studyID, ComponentID); //2013-11-29, take care of the release + if (!aComponent->_is_nil()) + { + aComponent->appendGroup(aGroup._retn()) ; + return true; + } + else { + MESSAGE("Cannot find the Component to append the group"); + return false; + } + } + return false; +} + +int MCCADGUI_DataModel::getStudyID() +{ +// LightApp_Study* study = getStudy(); + LightApp_Study* study = dynamic_cast( + module()->application()->activeStudy() ); //obtain the current study + if (study) + return study->id(); + else + return 0; +} +/*! + * \brief get the component id from the entry + * \param aEntry + * \return component id + */ +int MCCADGUI_DataModel::getComponentID(const QString& aEntry ) +{ + QString aIdStr = aEntry.split("_").at(1); // + if (aIdStr == "root") + return -1; //not a group id + + bool isOK; + int aId = aIdStr.toInt(&isOK); + if (!isOK) + return -1; + return aId; +} + +/*! + * \brief get the group id from the entry + * \param aEntry + * \return group id + */ +int MCCADGUI_DataModel::getGroupID(const QString& aEntry ) +{ + if (aEntry.split("_").size() < 3) + return -1; + + bool isOK; + int aId = aEntry.split("_").at(2).toInt(&isOK); + if (!isOK) + return -1; + return aId; +} +/*! + * \brief get the part id from the entry + * \param aEntry + * \return part id + */ +int MCCADGUI_DataModel::getPartID (const QString& aEntry ) +{ + + QStringList aStrList = aEntry.split("_"); + if (aStrList.size() < 4) //has no part id + return -1; //indicate a group or the root + + bool isOK; + int aId = aStrList.at(3).toInt(& isOK); + if (!isOK) + return -1; + return aId; +} + +/*! + * \brief convert the Shape stream to shape + * \param aShapeStream the octet stream with OCC shape + * \param theShape OCC shape + */ +TopoDS_Shape MCCADGUI_DataModel::Stream2Shape(const SALOMEDS::TMPFile& aShapeStream) +{ + //the shape stream is a 8bit octet(similar with char) array, + //convert the stream to char and then read it + TopoDS_Shape tmpShape; + char* buf; + buf = (char*) &aShapeStream[0]; + std::istringstream streamBrep(buf); + BRep_Builder aBuilder; + BRepTools::Read(tmpShape, streamBrep, aBuilder); + return tmpShape; +} + +/*! + * \brief convert the Shape to octet stream + * \param aShape the shape to be convert + * \return return octet stream contains shape info + */ +SALOMEDS::TMPFile* MCCADGUI_DataModel::Shape2Stream(const TopoDS_Shape& aShape) +{ + std::ostringstream streamShape; + //Write TopoDS_Shape in ASCII format to the stream + BRepTools::Write(aShape, streamShape); + //Returns the number of bytes that have been stored in the stream's buffer. + int size = streamShape.str().size(); + //Allocate octect buffer of required size + CORBA::Octet* OctetBuf = SALOMEDS::TMPFile::allocbuf(size); + //Copy ostrstream content to the octect buffer + memcpy(OctetBuf, streamShape.str().c_str(), size); + //Create and return TMPFile + SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size,size,OctetBuf,1); + return SeqFile._retn(); +} + +/*! + * \brief return the last component for appending group + * \return the last Component + */ +MCCADGUI_DataObject * MCCADGUI_DataModel::lastComponent () +{ +// for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthRight ); it.current(); it-- ) +// { +// MCCADGUI_DataObject* obj = dynamic_cast( it.current() ); +// if (obj->isComponent()) return obj; +// } +// return 0; + MCCADGUI_ModuleObject* modelRoot = dynamic_cast( root() ); + if( !modelRoot ) { // root is not set yet + modelRoot = new MCCADGUI_ModuleObject( this, 0 ); + setRoot( modelRoot ); + } + + if (!modelRoot->lastChild()) return 0; + MCCADGUI_DataObject * aObj = dynamic_cast (modelRoot->lastChild()); + if (aObj->isComponent() ) { + return aObj; + } + else if (aObj->isGroup()) { + return dynamic_cast (aObj->parent()); + } + else if (aObj->isPart()) { + return dynamic_cast (aObj->parent()->parent()); + } + else return 0; + +} + +/*! + * \brief return the last group for appending parts + * \return the last group + */ +MCCADGUI_DataObject * MCCADGUI_DataModel::lastGroup() +{ +// for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthRight ); it.current(); it-- ) +// { +// MCCADGUI_DataObject* obj = dynamic_cast( it.current() ); +// if (obj->isGroup()) return obj; +// } + return 0; + + /* + MCCADGUI_DataObject * aObj = dynamic_cast (root()->lastChild()); + if (aObj->isGroup()) { + return dynamic_cast (aObj->parent()); + } + else if (aObj->isPart()) { + return dynamic_cast (aObj->parent()->parent()); + } + else return 0; + */ +} + + +/*! + * \brief find the data object according to the entry + * \param aEntry + * \return data object + */ +MCCADGUI_DataObject * MCCADGUI_DataModel::findObject(const QString& aEntry) +{ + for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) + { + MCCADGUI_DataObject* obj = dynamic_cast( it.current() ); + if (obj && obj->entry() == aEntry) + return obj; + } + return 0; +} + +/*! + * \brief get the SALOME_InteractiveOject of this Object + * \param aEntry + * \return the SALOME_InteractiveOject representing this object + */ +Handle(SALOME_InteractiveObject) MCCADGUI_DataModel::findObjectIO(const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + Handle( SALOME_InteractiveObject ) anIO; + anIO = new SALOME_InteractiveObject( aObj->entry().toLatin1(), "MCCAD", aObj->name().toLatin1() ); + return anIO; +} + + +void MCCADGUI_DataModel::deleteComponent(const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + if(aEntry.trimmed().isEmpty() || !aObj || !aObj->isComponent()) + { + MESSAGE("Error in Entry"); + return; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + if (!engine->deleteComponent(studyID, getComponentID(aEntry))) + { + MESSAGE("Delete group failed!"); + } + else //remove the object + aObj->parent()->removeChild(aObj); + return; + } + MESSAGE("Error in study or engine!"); +} + +void MCCADGUI_DataModel::deleteComponents(const QStringList& aList) +{ + if (aList.size() == 0) + { + MESSAGE("No group to be deleted"); + return; + } + for (int i=0; iisComponent()) + { + MESSAGE("Error in Entry or name!"); + return; + } + MCCAD_ORB::Component_var aComponent = aObj->getComponent();//2013-11-29, take care of the release + aComponent->setName(newName.toLatin1()); +} + +void MCCADGUI_DataModel::deleteGroup(const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + if(aEntry.trimmed().isEmpty() || !aObj || !aObj->isGroup()) + { + MESSAGE("Error in Entry"); + return; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + MCCAD_ORB::Component_var aComponent = aObj->getComponent();//2013-11-29, take care of the release + if (!aComponent->deleteGroup(getGroupID(aEntry))) { + MESSAGE("Delete group failed!"); + } + //remove the object + else + aObj->parent()->removeChild(aObj); + return; + } + MESSAGE("Error in study or engine!"); +} + +void MCCADGUI_DataModel::deleteGroups(const QStringList& aList) +{ + if (aList.size() == 0) + { + MESSAGE("No group to be deleted"); + return; + } + for (int i=0; iisGroup()) + { + MESSAGE("Error in Entry or name!"); + return; + } + MCCAD_ORB::Group_var aGroup = aObj->getGroup();//2013-11-29, take care of the release + aGroup->setName(newName.toLatin1()); +} + +void MCCADGUI_DataModel::deletePart (const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + if(aEntry.trimmed().isEmpty() || !aObj || !aObj->isPart()) + { + MESSAGE("Error in Entry"); + return; + } + MCCAD_ORB::Group_var aGroup = aObj->getGroup();//2013-11-29, take care of the release + if(!aGroup->deletePart( getPartID(aEntry ))) + MESSAGE("Delete part failed!"); + //remove the object from the tree + aObj->parent()->removeChild(aObj); + +} + +void MCCADGUI_DataModel::deleteParts (const QStringList& aList) +{ + if (aList.size() == 0) + { + MESSAGE("No part to be deleted"); + return; + } + for (int i=0; iisPart()) + { + MESSAGE("Error in Entry or Name!"); + return; + } + MCCAD_ORB::Part_var aPart = aObj->getPart(); + aPart->setName(newName.toLatin1()); +} + +void MCCADGUI_DataModel::copyPart(const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + if(aEntry.trimmed().isEmpty() || !aObj || !aObj->isPart()) + { + MESSAGE("Error in Entry !"); + return; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if (!CORBA::is_nil(engine)) + { + try + { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + PasteParts->length(PasteParts->length()+1); //increase a space + PasteParts[PasteParts->length()-1] = + engine->deepCopyPart((aPart)); + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("Copy failed: " << ex.details.text) ; + } + return; + } + MESSAGE("Error in engine !"); +} + +void MCCADGUI_DataModel::copyParts (const QStringList& aList, const bool & emptyList) +{ + if (emptyList) + PasteParts->length(0); //clear + if (aList.size() == 0) + { + MESSAGE("No part to be copy"); + return; + } + for (int i=0; iisPart()) + { + MESSAGE("Error in Entry !"); + return; + } + PasteParts->length(PasteParts->length()+1); //increase a space + PasteParts[PasteParts->length()-1] = aObj->getPart(); + + deletePart(aEntry); //delete after cut +} + +void MCCADGUI_DataModel::cutParts(const QStringList& aList, const bool &emptyList) +{ + if (emptyList) + PasteParts->length(0); //clear + if (aList.size() == 0) + { + MESSAGE("No part to be cut"); + return; + } + for (int i=0; iisGroup()) + { + for (int i=0; ilength(); i++) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + aGroup->appendPart(PasteParts[i]); + } + PasteParts->length(0); + } + else if(aObj->isPart()) + { + for (int i=0; ilength(); i++) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + aGroup->insertPart(PasteParts[i], aObj->getPartID()); + } + PasteParts->length(0); + } + else + MESSAGE("Unable to paste here!"); +} + +void MCCADGUI_DataModel::copyGroup(const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + if(aEntry.trimmed().isEmpty() || !aObj || !aObj->isGroup()) + { + MESSAGE("Error in Entry !"); + return; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if (!CORBA::is_nil(engine)) + { + try + { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + PasteGroups->length(PasteGroups->length()+1); //increase a space + PasteGroups[PasteGroups->length()-1] = + engine->deepCopyGroup(aGroup); //try to copy the reference + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("Copy failed: " << ex.details.text) ; + } + return; + } + MESSAGE("Error in engine !"); +} + +void MCCADGUI_DataModel::copyGroups (const QStringList& aList, const bool & emptyList) +{ + if (emptyList) + PasteGroups->length(0); //clear + if (aList.size() == 0) + { + MESSAGE("No Group to be copy"); + return; + } + for (int i=0; iisGroup()) + { + MESSAGE("Error in Entry !"); + return; + } + PasteGroups->length(PasteGroups->length()+1); //increase a space + PasteGroups[PasteGroups->length()-1] = aObj->getGroup(); + + deleteGroup(aEntry); //delete after cut +} + +void MCCADGUI_DataModel::cutGroups(const QStringList& aList, const bool &emptyList) +{ + if (emptyList) + PasteGroups->length(0); //clear + if (aList.size() == 0) + { + MESSAGE("No Group to be cut"); + return; + } + for (int i=0; iisComponent()) + { + for (int i=0; ilength(); i++) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + aComponent->appendGroup(PasteGroups[i]); + } + PasteGroups->length(0); + } + else if(aObj->isGroup()) + { + for (int i=0; ilength(); i++) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + aComponent->insertGroup(PasteGroups[i], aObj->getGroupID()); + } + PasteGroups->length(0); + } + else + MESSAGE("Unable to paste here!"); +} + + +/*! + * \brief MCCADGUI_DataModel::generateMaterial + * generate new material and append to the study material list + * \param MaterialID unique id for this material + * \param Name material name + * \param Density atom density (positive double) or mass density (nagative double) + * \param MaterialCard material description in MCNP or TRIPOLI format + * \return false if error + */ +bool MCCADGUI_DataModel::generateMaterial(const int & MaterialID, const QString & Name, const double & Density, const QString & MaterialCard, const QColor & aColor) +{ + //check the input + if (MaterialID < 1) return false; + if (Name.trimmed().isEmpty()) return false; + + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return false; + } + MCCAD_ORB::Material_var aMaterial; + try { + aMaterial = engine->generateMaterial(Name.toLatin1(), MaterialID, studyID); + } + catch (SALOME::SALOME_Exception &ex) { + MESSAGE("generate failed: " << ex.details.text) ; + return false; + } + + if (aMaterial->_is_nil() ) return false; + aMaterial->setDensity(Density); + aMaterial->setMatCard(MaterialCard.toLatin1()); + if (aColor.isValid()) { + MCCAD_ORB::MColor aMColor; + aMColor[0] = aColor.red(); + aMColor[1] = aColor.green(); + aMColor[2] = aColor.blue(); + aMaterial->setColor(aMColor); + } +// aMaterial->setColor(); //to be implement + //append the new material + engine->appendMaterial(studyID, aMaterial._retn()); + return true; +} + + +/*! + * \brief MCCADGUI_DataModel::updateMaterial + * update the material with new parameters + * \param MaterialID the material to be modify + * \param newMaterialID new id for this material + * \param Name material name + * \param Density atom density (positive double) or mass density (nagative double) + * \param MaterialCard MaterialCard material description in MCNP or TRIPOLI format + * \return false if error + */ +bool MCCADGUI_DataModel::updateMaterial(const int & MaterialID, const int & newMaterialID,const QString & Name, + const double & Density, const QString & MaterialCard, const QColor & aColor) +{ + //check the input + if (MaterialID < 1) return false; + if (Name.trimmed().isEmpty()) return false; + + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return false; + } + + //get the original material, and check the newID if ok + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, MaterialID); + if (aMaterial->_is_nil()) { + MESSAGE("Could not find the material in the list!"); + return false; + } + MCCAD_ORB::Material_var bMaterial = engine->getMaterial(studyID, newMaterialID); + if (MaterialID != newMaterialID && !bMaterial->_is_nil()) { + MESSAGE("Material with this ID is already exist!"); + return false; + } + + //assign new parameters + aMaterial->setID(newMaterialID); + aMaterial->setName(Name.toLatin1()); + aMaterial->setDensity(Density); + aMaterial->setMatCard(MaterialCard.toLatin1()); + if (aColor.isValid()) { //because the default color of this function is QColor(), which is not invalid + MCCAD_ORB::MColor aMColor; + aMColor[0] = aColor.red(); + aMColor[1] = aColor.green(); + aMColor[2] = aColor.blue(); + aMaterial->setColor(aMColor); + } + return true; +} + +bool MCCADGUI_DataModel::deleteMaterial(const int & MaterialID) +{ + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return false; + } + return engine->deleteMaterial(studyID, MaterialID); +} + + +/*! + * \brief MCCADGUI_DataModel::assignMaterial + * assign the material property for groups + * \param aList a list of entry link to the groups + * \param MaterialID the material to be assign + * \param isReColor if true, the group and parts belonging to it will be recolor + * \return false if error + */ +bool MCCADGUI_DataModel::assignMaterial (const QStringList& aList, const int & MaterialID, const bool & isReColor) +{ + if (aList.size() == 0) { + MESSAGE("No group in this list"); + return false; + } + + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return false; + } + //get the material, and check the newID if ok + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, MaterialID); + if (aMaterial->_is_nil()) { + MESSAGE("Could not find the material in the list!"); + return false; + } + + for (int i=0; iisGroup()) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + if (isReColor) { //do this because assign material, because aMaterial will be release later + MCCAD_ORB::MColor aColor ; + aMaterial->getColor(aColor); + aGroup->setColor(aColor); + } + aGroup->setMaterial(aMaterial); // do not use the _retn() method because the aMaterial is duplicated inside + } + } + return true; +} + +bool MCCADGUI_DataModel::saveMaterial2Xml(const QString &FileName) +{ + if (FileName.isEmpty() ) { + MESSAGE ("Filename is Empty"); + return false; + } + + QFile *file = new QFile(FileName); + if(!file->open(QFile::WriteOnly|QFile::Truncate)) + { + return false; + } + //obtain engine and study id + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in engine!"); + return false; + } + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); //don't delete! + int MatCnt = aMaterialList->length(); + if (!MatCnt){ + MESSAGE("No material data!"); + return false; + } + + QDomDocument domDoc; + QDomProcessingInstruction instruction; + instruction = domDoc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\""); + domDoc.appendChild(instruction); + + QDomElement prntItem=domDoc.createElement(("Material")); + domDoc.appendChild(prntItem); + + //Output the Material Info + QDomElement materialItem = domDoc.createElement(("MaterialMap")); + + + for(int i = 0; i < MatCnt; i++) { + + MCCAD_ORB::Material_var aMaterial = (*aMaterialList)[i]; + + QDomElement materialIDNode = domDoc.createElement("MaterialID"); + materialIDNode.setAttribute("number",QString::number(i+1)); //here MaterialID is a sequential integer, not aMaterial->getID() + + QDomElement idNode = domDoc.createElement("id"); + QDomElement nameNode = domDoc.createElement("name"); + QDomElement densityNode = domDoc.createElement("density"); + QDomElement mcardNode = domDoc.createElement("card"); + + QDomText txtID = domDoc.createTextNode(QString::number(aMaterial->getID())); + QDomText txtName = domDoc.createTextNode(aMaterial->getName()); + QDomText txtDensity = domDoc.createTextNode(QString::number(aMaterial->getDensity())); + QDomText txtMatcard = domDoc.createTextNode(aMaterial->getMatCard()); + + idNode.appendChild(txtID); + nameNode.appendChild(txtName); + densityNode.appendChild(txtDensity); + mcardNode.appendChild(txtMatcard); + + materialIDNode.appendChild(idNode); + materialIDNode.appendChild(nameNode); + materialIDNode.appendChild(densityNode); + materialIDNode.appendChild(mcardNode); + + materialItem.appendChild(materialIDNode); + } + + prntItem.appendChild(materialItem); + + + QTextStream out(file); + domDoc.save(out,4); + file->close(); + return true; +} + +bool MCCADGUI_DataModel::loadMaterialXml(const QString &FileName) +{ + //obtain engine and study id + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in engine!"); + return false; + } + + QFile file(FileName); + if(!file.open(QFile::ReadOnly)) + { + return false; + } + + QDomDocument doc; + if(!doc.setContent(&file)) + { + file.close(); + return false; + } + + // Store the mateirals map + QDomNodeList theList = doc.elementsByTagName("MaterialMap"); + bool isOK = false; + if (theList.size() != 0) + { + + QDomNodeList materialList = theList.at(0).childNodes(); + + bool yestoall = false; // for interactive + bool notoall = false;// for interactive + QMessageBox::StandardButton aBtn ; + isOK = true; // default think all is ok + for(int i = 0; i < materialList.size(); i++) + { + QDomNode materialNode = materialList.at(i).firstChild(); + + int iID = 0; // Serienumer of aterial + double fDensity = 0; // Density of material + QString strName = ""; // Material name + QString strMatCard = ""; // Material card includes the composition + + while(!materialNode.isNull()) + { + QDomElement materialElem = materialNode.toElement(); // convert the node to an element. + if(!materialElem.isNull()) + { + if (materialElem.tagName() == "id") + { + iID = materialElem.text().toInt(); + } + else if(materialElem.tagName() == "name") + { + strName = materialElem.text(); + } + else if(materialElem.tagName() == "density") + { + fDensity = materialElem.text().toDouble(); + } + else if(materialElem.tagName() == "card") + { + strMatCard = materialElem.text(); + } + } + materialNode = materialNode.nextSibling(); + } + + //check if material ID repeat + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, iID); + bool YesOrNo = false; //default not override + if (!aMaterial->_is_nil()) + { + if (!yestoall && !notoall){ + aBtn = SUIT_MessageBox::question(getMCCADGUImodule()->application()->desktop(), + QString("Question"), + QString( "Material %1 is already exist, Override it?").arg(iID), + QMessageBox::Yes| QMessageBox::YesToAll| QMessageBox::No| QMessageBox::NoToAll); + if (aBtn == QMessageBox::Yes) + YesOrNo = true; + else if (aBtn == QMessageBox::YesToAll) + yestoall = true; + else if (aBtn == QMessageBox::NoToAll) + notoall = true; + } + if (YesOrNo || yestoall) { + updateMaterial(iID, iID, strName, fDensity,strMatCard); //override + } + else + continue; //not override + } + else { //create new material + if (!generateMaterial(iID, strName, fDensity,strMatCard)) + isOK = false; + } + } + } + return isOK; +} + + +/*! + * \brief MCCADGUI_DataModel::formNewGroup + * form selected part as a new group + * \param aList a list of entries of parts + * \param aName name for the new group + * \return false if error + */ +bool MCCADGUI_DataModel::formNewGroup(const QStringList& aList, const QString &aName) +{ + if (aList.isEmpty()) return false; + if (aName.trimmed().isEmpty()) { + MESSAGE("Name should not be empty!"); + return false; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in engine!"); + return false; + } + MCCAD_ORB::Group_var aNewGroup = engine->generateGroup(aName.trimmed().toLatin1()); + // append to a component + MCCAD_ORB::Component_var aComponent = findObject(aList[0])->getComponent(); + if (aComponent->_is_nil()) { + MESSAGE("Cannot append the new group to the component!"); + return false; + } + + //loop for all objects + for (int i=0; iisPart()) continue; + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil() ) { + aNewGroup->appendPart(aPart); //the part reference is duplicate inside + deletePart(aList[i]); //delete the part reference, + } + } + //check the new group + if (aNewGroup->getPartList()->length() == 0) { + MESSAGE("No part in the new group!"); + return false; + } + + aComponent->appendGroup(aNewGroup); //duplicated + return true; +} + +/*! + * \brief MCCADGUI_DataModel::formNewComponent + * form selected group as a new component + * \param aList a list of entries of groups + * \param aName name for the new component + * \return false if error + */ +bool MCCADGUI_DataModel::formNewComponent(const QStringList& aList, const QString &aName) +{ + if (aList.isEmpty()) return false; + if (aName.trimmed().isEmpty()) { + MESSAGE("Name should not be empty!"); + return false; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in engine!"); + return false; + } + MCCAD_ORB::Component_var aNewComponent = engine->generateComponent(aName.trimmed().toLatin1()); + //loop for all objects + for (int i=0; iisGroup()) continue; + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + if (!aGroup->_is_nil() ) { + aNewComponent->appendGroup(aGroup); //the Group reference is duplicate inside + deleteGroup(aList[i]); //delete the Group reference, + } + } + //check the new group + if (aNewComponent->getGroupList()->length() == 0) { + MESSAGE("No part in the new group!"); + return false; + } + engine->appendComponent(studyID, aNewComponent); //duplicated + return true; +} + +/*! + * \brief MCCADGUI_DataModel::explodePart + * explode a part with compound to parts with a single solid; + * them will be insert to the group which the part belongs to + * \param aEntry a part to be explode + * \return false if error + */ +bool MCCADGUI_DataModel::explodePart(const QString& aEntry) +{ + MCCADGUI_DataObject * aObj = findObject(aEntry); + if (!aObj || !aObj->isPart()) { + MESSAGE("Cannot find the object, or it is not a Part!"); + return false; + } + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + MESSAGE("The part is nil!"); + return false; + } + if (!aPart->isExplodible()) { + MESSAGE("The part is not explodible!"); + return false; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + MCCAD_ORB::PartList_var aPartList; + try { + aPartList= engine->explodePart(aPart); + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("explode failed:" << ex.details.text); + return false; + } + if (aPartList->length() == 0) { + MESSAGE("Nothing return after explode!"); + return false; + } + for (int i=0; ilength(); i++) + aGroup->insertPart(aPartList[i], aPart->getID()); + aGroup->deletePart(aPart->getID()); //after explode, delete the original one + aObj->parent()->removeChild(aObj); + return true; +} + +/*! + * \brief MCCADGUI_DataModel::fuseParts + * fuse several parts into one part, + * append to the first group which part is selected + * \param aList a list of enties of parts + * \param aName a name for the new part + * \return false if error + */ +bool MCCADGUI_DataModel::fuseParts (const QStringList& aList, const QString &aName ) +{ + if (aList.isEmpty()) return false; + if (aName.trimmed().isEmpty()) { + MESSAGE("Name should not be empty!"); + return false; + } + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + MCCAD_ORB::PartList_var aPartList = new MCCAD_ORB::PartList; + MCCAD_ORB::Group_var aGroup ; //!!here is not very regious, because it consider all the selected objects are parts + //for test + if (aGroup->_is_nil()) + cout <<"agroup is nil!" <isPart()) continue; + else { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + MCCAD_ORB::Group_var bGroup = aObj->getGroup(); + if (aGroup->_is_nil()) aGroup = bGroup; //obtain the first group + if (!aPart->_is_nil()) { + aPartList->length(aPartList->length() + 1); //increase a space + aPartList[aPartList->length()-1] = MCCAD_ORB::Part::_duplicate( aPart); + if (!bGroup->_is_nil()) { //delete the part + bGroup->deletePart(aPart->getID()); + aObj->parent()->removeChild(aObj); + } + } + } + } + + //call the engine to fuse + MCCAD_ORB::Part_var aNewPart ; + try { + aNewPart = engine->fuseParts(aPartList, aName.toLatin1()); + } + catch (SALOME::SALOME_Exception &ex) { + MESSAGE("Fuse failed:" << ex.details.text); + return false; + } + aGroup->appendPart(aNewPart); + return true; +} + + +/*! + * \brief MCCADGUI_DataModel::recoverShapeInPart + * recover the shape of the part to backup shape + * the part has no backup will be skipped, but not report error + * \param aList a entry list of parts + * \return false if error + */ +bool MCCADGUI_DataModel::recoverShapeInParts (const QStringList& aList) +{ + if (aList.size() == 0) { + MESSAGE("No part in this list"); + return false; + } + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return false; + } + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->hasBackupShape()) + aPart->recoverShape(); + } + } + return true; +} + +/*! + * \brief decomposeShapes + * decomposed the shape of the parts, + * if group or component, decomposed all parts included + * parts already been decomposed will be skip without error + * \param aList a list of entry for object to be decomposed + * \return false if error + */ +bool MCCADGUI_DataModel::decomposeShapes(const QStringList& aList) +{ + //check + if (aList.size() == 0) return false; + //append all the object into the list + DataObjectList aObjList ; + for (int i=0; i (aObjList[i]); + //decompose all parts + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + if (engine->decomposePart(aPart)) //not using _retn() method because apart is not release inside. do not care about failed or not + MESSAGE("Part: "<< aPart->getName() <<" is decomposed."); + } + } + //recursively decompose the parts in + else if (aObj->isGroup() ) { + DataObjectList aNewObjList = aObj->children(); + if (!aNewObjList.isEmpty()) + decomposeShapes(aNewObjList); + } + else if (aObj->isComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (aComponent->_is_nil()) continue; + if (aComponent->hasEnvelop()) //add step to decompose envelop + engine->decomposeEnvelop(aComponent); + else { + DataObjectList aNewObjList = aObj->children(); + if (!aNewObjList.isEmpty()) + decomposeShapes(aNewObjList); + } + } + else { + MESSAGE("Unable to decompose this type of object!"); + return false; + } + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::send2GEOM + * send Shapes in parts to GEOM module, for modifying geometry + * only working for parts + * \param aList a list of entries for parts + * \return false if error + */ +bool MCCADGUI_DataModel::send2GEOM(const QStringList& aList) +{ + //checking + if (aList.isEmpty()) return false; + + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return false; + } + + //###loop all parts and get shape and make new GEOM object### + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + sendShape2GEOM(*aPart->getShapeStream(), aPart->getName()); + } + else MESSAGE("the Part in the "<isGroup()) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + if (!aGroup->_is_nil()) { + sendShape2GEOM(*aGroup->getShapeStream(), aGroup->getName()); + } + else MESSAGE("the Group in the "<isComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (!aComponent->_is_nil()) { + QMessageBox::StandardButton aBtn = QMessageBox::No; + if (aComponent->hasEnvelop()) + aBtn = SUIT_MessageBox::information + (getMCCADGUImodule()->application()->desktop(),QString("Message"), + QString( "Send the Envelop?"),QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) + sendShape2GEOM(*aComponent->getEnvelopStream(), aComponent->getName()); + else + sendShape2GEOM(*aComponent->getShapeStream(), aComponent->getName()); + } + else MESSAGE("the Component in the "<GetIInsertOperations(studyID); + SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy()); + _PTR(Study) studyDS; + if ( study ) { + studyDS = study->studyDS(); + GEOM::GEOM_Object_var aGEOMObj = aGEOMOp->RestoreShape(aShapeStream); + if(!aGEOMObj->_is_nil()) { + aGEOMObj->SetName(aName.toLatin1()); + aGEOMGen->PublishInStudy(GeometryGUI::ClientStudyToStudy( studyDS ), SALOMEDS::SObject::_nil(), aGEOMObj, aName.toLatin1()); + return true; + } + else { + MESSAGE("the GEOM object is nil!"); + return false; + } + } + return false; +} + + + +/*! + * \brief MCCADGUI_DataModel::assignShape + * assign the new shape to a part, or make a new part for a group + * the shape is possibly come from GEOM module + * \param aEntry , entry of the part or group, + * \param aShape ashape to be assign + * \return false if error + */ +bool MCCADGUI_DataModel::assignShape(const QString& aEntry, const TopoDS_Shape& aShape, const QString & aName) +{ + bool isNew = false; + MCCADGUI_DataObject * aObj = findObject(aEntry); + if (!aObj ) { +// MESSAGE("object is empty!"); +// return false; + isNew = true; + } + if (aShape.IsNull() || (aShape.ShapeType() != TopAbs_COMPSOLID && + aShape.ShapeType() != TopAbs_COMPOUND && aShape.ShapeType() != TopAbs_SOLID ) ) { + MESSAGE("the shape is invalid!"); + return false; + } + + //create a new component and group for this object + if (isNew) { + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) return false; + //new component + MCCAD_ORB::Component_var aComponent = engine->generateComponent(aName.toLatin1()); + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + aComponentList->length(aComponentList->length() + 1); //increase one space + (*aComponentList)[aComponentList->length() -1] = MCCAD_ORB::Component::_duplicate(aComponent); + //new group + MCCAD_ORB::Group_var aGroup = engine->generateGroup(aName.toLatin1()); +// MCCAD_ORB::Component_var aComponent = engine->getComponent(studyID, aComponentID); + aComponent->appendGroup(aGroup); + MCCAD_ORB::Part_var aPart = engine->generatePart(aName.toLatin1()); + aPart->setShapeStream(*Shape2Stream(aShape)); + MCCAD_ORB::MColor aColor ; //assignt the same color as group + aGroup->getColor(aColor); + aPart->setColor(aColor); + aGroup->appendPart(aPart) ; //not using _retn(), because the part is copy inside + } + //assign the shape to the part + else if(!isNew && aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + aPart->setShapeStream(*Shape2Stream(aShape)); + } + else { + MESSAGE ("the Part is nil!"); + return false; + } + } + else if (!isNew && aObj->isGroup()) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + if (!aGroup->_is_nil()) { + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + MCCAD_ORB::Part_var aPart = engine->generatePart(aName.toLatin1()); + aPart->setShapeStream(*Shape2Stream(aShape)); + MCCAD_ORB::MColor aColor ; //assignt the same color as group + aGroup->getColor(aColor); + aPart->setColor(aColor); + aGroup->appendPart(aPart) ; //not using _retn(), because the part is copy inside + } + else { + MESSAGE ("the Part is nil!"); + return false; + } + } + else if (!isNew && aObj->isComponent()) { //######assigned shape are consider as Mesh Envelop + //new group + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (aComponent->_is_nil()) { + MESSAGE("The Component is nil") + return false; + } + QMessageBox::StandardButton aBtn = SUIT_MessageBox::information + (getMCCADGUImodule()->application()->desktop(),QString("Message"), + QString( "Set the shape as mesh envelop?"),QMessageBox::Yes, QMessageBox::No); + if (aBtn == QMessageBox::Yes) { + aComponent->setEnvelopStream(*Shape2Stream(aShape)); + } + else { + MCCAD_ORB::Group_var aGroup = engine->generateGroup(aName.toLatin1()); + aComponent->appendGroup(aGroup); + MCCAD_ORB::Part_var aPart = engine->generatePart(aName.toLatin1()); + aPart->setShapeStream(*Shape2Stream(aShape)); + MCCAD_ORB::MColor aColor ; //assignt the same color as group + aGroup->getColor(aColor); + aPart->setColor(aColor); + aGroup->appendPart(aPart) ; //not using _retn(), because the part is copy inside + } + } + else { + MESSAGE ("cannot assign shape to this object!"); + return false; + } + return true; +} + + +bool MCCADGUI_DataModel::sendMesh2SMESH(const QStringList& aList) +{ + //checking + if (aList.isEmpty()) { + MESSAGE("the list of part is empty!"); + return false; + } + //get the smesh engine + SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen() ; + if (aSMESHGen->_is_nil()) { + MESSAGE("Please open the SMESH module before this operation!"); + return false; + } + //get mccad engine + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) return false; + + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + MESSAGE("This object has a nil part!"); + continue; + } + if (!aPart->hasMesh()) { + MESSAGE("The part" <getName() <<" has no mesh!"); + continue; + } + //get the mesh +// ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr aUMesh +// =ParaMEDMEM::MEDCouplingUMeshClient::New(aUMeshIOR); + //write the mesh into a temp file + QString aTempDir = "tmpfilemccad2smesh.med"; + QFile::remove(aTempDir); //remove the file first if any + try { + SALOME_MED::MEDCouplingUMeshCorbaInterface_var aUMeshIOR = aPart->getMesh(); //using _var to release the duplicate mesh + engine->export2MED(aUMeshIOR, aTempDir.toLatin1()); + + SMESH::DriverMED_ReadStatus aStatus; + aSMESHGen->CreateMeshesFromMED(aTempDir.toLatin1(), aStatus); + if (aStatus != SMESH::DRS_OK ) + { + MESSAGE("problems in reading!" << aStatus); + QFile::remove(aTempDir); //remove if any + return false; + } + } + catch (SALOME::SALOME_Exception &ex) + { + QFile::remove(aTempDir); //remove if any + MESSAGE("Export failed: " << ex.details.text); + return false; + } + QFile::remove(aTempDir); //remove if any + } + else { + MESSAGE("This object type has no mesh!"); + continue; + } + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::assignMesh + * assign a mesh for a part + * \param aEntry entry for the part + * \param aMesh a MEDCouplingUMesh CORBA interface, please give the reference, dont release outside! + * \return + */ +bool MCCADGUI_DataModel::assignMesh(const QString& aEntry, const QString &aSMESHEntry , const QString & aName ) +{ + + //checking + MCCADGUI_DataObject * aObj = findObject( aEntry); + if (!aObj) { + MESSAGE("Cannot find this object!"); + return false; + } + + //get the smesh object + const LightApp_DataOwner* owner = new LightApp_DataOwner (aSMESHEntry); + // Get geom object from IO + SMESH::SMESH_Mesh_var aSMESHObj = getMCCADGUImodule()->getSmesh(owner, true); + if (aSMESHObj->_is_nil()) { + MESSAGE("the SMESH object is nil!"); + return false; + } + + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) return false; + + //export mesh to a med file + try { + QString aTmpDir = aName + QString(".med") ; + QFile::remove(aTmpDir); + aSMESHObj->ExportMED(aTmpDir.toLatin1(), true); //first export to MED mesh file + //import the file + SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr aUMesh = + engine->importMED(aTmpDir.toLatin1()); + if (aUMesh->_is_nil()) { + MESSAGE("the read mesh is nil!"); + return false; + } + //find the part + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + MESSAGE("the Part is nil!"); + QFile::remove(aTmpDir); + return false; + } + aPart->setMesh(aUMesh); + } + else { + MESSAGE("Cannot assign mesh to this kind of object!"); + QFile::remove(aTmpDir); + return false; + } + QFile::remove(aTmpDir); + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("assign mesh failed: " << ex.details.text); + return false; + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::clearMesh + * clear mesh data on this geometry + * \param aList a list of entry which are parts + * \return false if error + */ +bool MCCADGUI_DataModel::clearMesh (const QStringList& aList) +{ + //checking + if (aList.isEmpty()) return false; + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) continue; + aPart->clearMesh(); + } + else continue; + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::clearEnvelop + * clear envelop in the component + * \param aList a list of entry for components + * \return false if error + */ +bool MCCADGUI_DataModel::clearEnvelop (const QStringList& aList) +{ + if (aList.isEmpty()) return false; + for (int i=0; iisComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (aComponent->_is_nil()) continue; + aComponent->clearEnvelop(); + } + else continue; + } + return true; +} + + +/*! + * \brief MCCADGUI_DataModel::assignImportance + * assign importance for selected part + * if group or component is selected, then the part inside it will be changed + * \param aList a object entry list + * \param aIMP a importance array : FixArray[3] + * \return false if error + */ +bool MCCADGUI_DataModel::assignImportance(const QStringList& aList, MCCAD_ORB::FixArray aIMP) +{ + //check + if (aList.size() == 0) return false; + //append all the object into the list + DataObjectList aObjList ; + for (int i=0; i (aObjList[i]); + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + aPart->setImportance(aIMP); + } + } + //recursively assign the parts IMP + else if (aObj->isGroup() || aObj->isComponent()) { + DataObjectList aNewObjList = aObj->children(); + if (!aNewObjList.isEmpty()) + assignImportance(aNewObjList, aIMP); + } + else { + MESSAGE("Unable to assign importance this type of object!"); + return false; + } + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::assignRemark + * assign remark for parts, groups, or components + * the remark for part will not override by group or component + * \param aList a list of object entry + * \param aRemark a remark + * \return false if error + */ +bool MCCADGUI_DataModel::assignRemark(const QStringList& aList, const QString & aRemark) +{ + //check + if (aList.size() == 0) return false; + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) continue; + aPart->setRemark(aRemark.toLatin1()); + } + else if (aObj->isGroup()) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + if (aGroup->_is_nil()) continue; + aGroup->setRemark(aRemark.toLatin1()); + } + else if (aObj->isComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (aComponent->_is_nil()) continue; + aComponent->setRemark(aRemark.toLatin1()); + } + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::assignAdditive + * assign additive for parts, groups, components + * the additive of parts will override by its group + * \param aList aList a list of object entry + * \param aAdditive a additive card + * \return false if error + */ +bool MCCADGUI_DataModel::assignAdditive(const QStringList& aList, const QString & aAdditive) +{ + //check + if (aList.size() == 0) return false; + //append all the object into the list + DataObjectList aObjList ; + for (int i=0; i (aObjList[i]); + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + aPart->setAdditive(aAdditive.toLatin1()); + } + } + //recursively assign the parts IMP + else if (aObj->isGroup() || aObj->isComponent()) { + DataObjectList aNewObjList = aObj->children(); + if (!aNewObjList.isEmpty()) + assignAdditive(aNewObjList, aAdditive); + } + else { + MESSAGE("Unable to assign this type of object!"); + return false; + } + } + return true; +} + +bool MCCADGUI_DataModel::exportAllMesh2Abaqus(const QString & FileName) +{ + if (FileName.trimmed().isEmpty()) { + MESSAGE("File name is empty!"); + return false; + } + + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + try { + engine->exportAllMesh2Abaqus(studyID, FileName.toLatin1()); + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("export failed: " << ex.details.text) ; + return false; + } + return true; + } + MESSAGE("Errors in study or in engine!"); + return false; +} + + + +bool MCCADGUI_DataModel::importGeom(const QString & FileName, bool & isExplode, const int &ComponentID, const int &GroupID) +{ + if (FileName.trimmed().isEmpty() ) + { + MESSAGE("File name is empty!"); + return false; + } + //get engine and studyID + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + MCCAD_ORB::PartList_var aPartList; //automatic release + try + { + aPartList = engine->ImportGeom(FileName.toLatin1()); + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("Import failed: " << ex.details.text) ; + return false; + } + //check if explodible and ask + bool isExplodible = false; + for (int i=0; ilength(); i++) { + if (aPartList[i]->isExplodible()) { + isExplodible = true; + break; //if one is explodible, quit + } + } + if (isExplodible && !isExplode) { + QMessageBox::StandardButton aBtn = SUIT_MessageBox::information(getMCCADGUImodule()->application()->desktop(),QString("Message"), + QString( "Model contains compound(s) or comsolid(s), \nexplode them?"),QMessageBox::Yes, QMessageBox::No); + + if (aBtn == QMessageBox::Yes) + isExplode = true; + else isExplode = false; + } + //if explode, append all the explode part into new group + MCCAD_ORB::Group_var aGroup = engine->generateGroup(SUIT_Tools::file(FileName,false).toLatin1()); + if (isExplode) { + try { + for (int i=0; ilength(); i++) { + MCCAD_ORB::PartList_var bPartList; //automatic release + bPartList = engine->explodePart(aPartList[i]); + for (int j=0; jlength(); j++) { + aGroup->appendPart(bPartList[j]); + } + } + } + catch (SALOME::SALOME_Exception &ex) { + MESSAGE("Explode failed: " << ex.details.text) ; + return false; + } + } + else { + aGroup->setPartList(aPartList); //set the part list to the group + } + if (GroupID < 0) //create new group + { + MCCAD_ORB::Component_var aComponent = engine->getComponent(studyID, ComponentID); + aComponent->appendGroup(aGroup._retn()); + } + else //append to a exist group + { + MCCAD_ORB::Group_var bGroup = engine->getGroup(studyID, GroupID); + if (bGroup->_is_nil()) { + MESSAGE("Cannot found the group to append!") + return false; + } + bGroup->appendPartInGroup(aGroup); + } + return true; + } + MESSAGE("Errors in study or in engine!"); + return false; +} + + +/*! + * \brief MCCADGUI_DataModel::checkBeforeConvert + * check if the object in this study meets conversion requriement + * surface check, decomposition check, material check, envelop check + * \return false if check failed + */ +bool MCCADGUI_DataModel:: checkBeforeConvert() +{ + //get the target MC code + SUIT_Session* session = SUIT_Session::session(); + SUIT_ResourceMgr* resMgr = session->resourceMgr(); + bool isMCNP6 = false; + if (resMgr->integerValue("MCCAD", "target_code", 0) == 1) //if MCNP6 is chosen + isMCNP6 = true; + double AllowDiff = resMgr->doubleValue("MCCAD", "Mesh_Volume_Diff", 0.01); + double aTotalVol = 0, bTotalVol = 0; //for calculating the total volume + + //check all the Components groups and parts + bool isOK = true; + + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in engine!"); + return false; + } + + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + if (!aComponentList) { + MESSAGE("component list is emtpy!") + return false; + } + //*********LOOP for Components***** + cout <<"O######################O" <length(); i++) + { + MCCAD_ORB::Component_var aComponent = (*aComponentList)[i]; + if (aComponent->_is_nil()) { + cout <<"ERROR: The "<getName() <<": "; + if (isMCNP6 && aComponent->hasEnvelop()) //if target code is MCNP6, and the component has the envelop + { + //check envelop shape surface + cout << "A meshed component. "; + TopoDS_Shape aTmpShape = Stream2Shape(*aComponent->getEnvelopStream()); + if (aTmpShape.IsNull()) { + cout << "ERROR: Cannot get the envelop!"<getName())) { + cout << "ERROR: Contain invalid surfaces!"<getGroupList(); + //*********LOOP for Groups***** + for (int j=0; jlength(); j++) + { + + MCCAD_ORB::Group_var aGroup = (*aGroupList)[j]; + if (aGroup->_is_nil()) { + cout <<"ERROR: The "<getName() <<": "; + if (!aGroup->hasMaterial()) + cout << "INFO: This Group has no material, consider as void."<getPartList(); + //*********LOOP for Parts***** + for (int k=0; klength(); k++) + { + MCCAD_ORB::Part_var aPart = (*aPartList)[k]; + if (aPart->_is_nil()) { + cout <<"ERROR: The "<getName() <<": "; + double aVol; + aVol = aPart->getVolume(); + cout <<"\t Volume:\t"<hasEnvelop()) { //if convert to MCNP6, check mesh + if (!aPart->hasMesh()) { + cout << "ERROR: Should contain a mesh!"<getMeshVolume(); + aTotalVol += aVol; + bTotalVol += bVol; + double tmpDouble = fabs(aVol-bVol)/aVol; + cout <<"\t Mesh Volume: "< AllowDiff){ + cout << "ERROR: Mesh volume not much with CAD volume! \t"<getShapeStream()); + if (aTmpShape.IsNull()) { + cout << "ERROR: Cannot get the shape!"<getName())) { + cout << "ERROR: Contain invalid surfaces!"<getIsDecomposed()) { + cout << "INFO: This Part is not decomposed, will be done during conversion."<Append(aShape); + McCadCSGTool_SurfaceChecker surfCheck; + TCollection_AsciiString aSolidName = aName.toStdString().c_str(); + if (!surfCheck.printSurfaceInfo(aShapeList,aSolidName)) { + QString aTmpName = aName + QString("-invalid.stp"); + QFile::rename("invalidSurfaces.stp", aTmpName); + STEPControl_Reader Reader; + Standard_Integer status = Reader.ReadFile( aTmpName.toLatin1() ); + if (status != IFSelect_RetDone ) //if faild, return and leave the file + return false; + Reader.TransferRoots(); + TopoDS_Shape aTmpShape = Reader.OneShape(); + if (sendShape2GEOM(*Shape2Stream(aTmpShape),aName + QString("-invalid") )) + QFile::remove(aTmpName); //remove the file after sending this shape + return false; + } + else return true; +} + +/*! + * \brief MCCADGUI_DataModel::checkSolid + * check if the shape has solid + * \param aShape + * \return false if has no solid + */ +bool MCCADGUI_DataModel::checkSolid(const TopoDS_Shape & aShape) +{ + + if( aShape.ShapeType() == TopAbs_COMPSOLID || aShape.ShapeType() == TopAbs_COMPOUND ) + { + int cnt = 0; + TopExp_Explorer exp; + for(exp.Init(aShape,TopAbs_SOLID); exp.More(); exp.Next()) + cnt ++; + if (cnt == 0) + return false; + else return true; + + } + else if( aShape.ShapeType() == TopAbs_SOLID) + return true; + else return false; +} + + +/*! + * \brief MCCADGUI_DataModel::convert2MC + * call McCad to generate MC description + * \return + */ +bool MCCADGUI_DataModel::convert2MC(const QString & FileName) +{ + if (FileName.trimmed().isEmpty()) { + MESSAGE("the file name is empty!"); + return false; + } + //#### 1. check the geometry #### + if (!checkBeforeConvert()) { + MESSAGE("Check geometry failed! "); + SUIT_MessageBox::information(getMCCADGUImodule()->application()->desktop(), QString("Convert to MC input"), QString("Check geometry failed! \nPlease check the output info.")); + return false; + } + + //#### 2. decompose all objects### + SUIT_Session* session = SUIT_Session::session(); + SUIT_ResourceMgr* resMgr = session->resourceMgr(); + bool isForceDecompose = resMgr->booleanValue("MCCAD","force_decomp" , true ); + if (isForceDecompose) + { + MCCADGUI_ModuleObject* modelRoot = dynamic_cast( root() ); + if( !modelRoot ) { // root is not set yet + modelRoot = new MCCADGUI_ModuleObject( this, 0 ); + setRoot( modelRoot ); + } + DataObjectList aObjectList = modelRoot->children(false); //get all components + if (!decomposeShapes(aObjectList)) { + MESSAGE("Decomposition failed!"); + // SUIT_MessageBox::information(getMCCADGUImodule()->application()->desktop(), QString("Convert to MC input"), QString("Decomposition failed!")); + return false; + } + } + + + //#### 3. set the conversion parameters from preference ### + setConvertPara(); + + //#### 4. if MCNP6, output the mesh ### +// SUIT_Session* session = SUIT_Session::session(); +// SUIT_ResourceMgr* resMgr = session->resourceMgr(); + int codeOption = resMgr->integerValue("MCCAD", "target_code", 0) ; + if (codeOption == 1) //if MCNP6 selected + if (!exportAllMesh2Abaqus(FileName + QString(".inp"))) { + MESSAGE("export mesh failed!"); + return false; + } + + //#### 5.perform conversion and write to file + S_McCadVoidCellManager * aSVoidCellManager = new S_McCadVoidCellManager(); + aSVoidCellManager->S_ReadGeomData(getStudyID()); + if (codeOption == 0 || codeOption == 1) { + aSVoidCellManager->SetConvetor("MCNP"); + } + else if (codeOption == 2) { + aSVoidCellManager->SetConvetor("TRIPOLI"); + } + else if (codeOption == 3) { + aSVoidCellManager->SetConvetor("GDML"); + } + aSVoidCellManager->SetOutFileName(FileName.toStdString().c_str()); + aSVoidCellManager->S_Process(); + + delete aSVoidCellManager; + aSVoidCellManager = NULL; + return true; + +} + +/*! + * \brief MCCADGUI_DataModel::setConvertPara + * set the conversion parameters into the McCadConvertConfig + * McCadConvertConfig has static member which can be assess everywhere + * \return fa + */ +void MCCADGUI_DataModel::setConvertPara() +{ + SUIT_Session* session = SUIT_Session::session(); + SUIT_ResourceMgr* resMgr = session->resourceMgr(); + + McCadConvertConfig::SetInitCellNum (resMgr->integerValue("MCCAD","init_cell_no" , 1 )); + McCadConvertConfig::SetInitSurfNum (resMgr->integerValue("MCCAD","init_surf_no" , 1 )); + McCadConvertConfig::SetMinIptSolidVod (resMgr->doubleValue("MCCAD","min_solid_vol" , 1.00 )); + McCadConvertConfig::SetMinVoidVol (resMgr->doubleValue("MCCAD","min_void_vol" , 1.25e2 )); + McCadConvertConfig::SetMinDecomFaceArea (resMgr->doubleValue("MCCAD","min_dec_face_area" , 50 )); + + + + McCadConvertConfig::SetMinSmplPntNum (resMgr->integerValue("MCCAD","min_sample_points" , 50 )); + McCadConvertConfig::SetMaxSmplPntNum (resMgr->integerValue("MCCAD","max_sample_points" , 100 )); + McCadConvertConfig::SetXResolution (resMgr->doubleValue("MCCAD","x_resl" , 0.001 )); + McCadConvertConfig::SetYResolution (resMgr->doubleValue("MCCAD","y_resl" , 0.001 )); + McCadConvertConfig::SetRResolution (resMgr->doubleValue("MCCAD","r_resl" , 0.00314)); + McCadConvertConfig::SetVoidDecomposeDepth (resMgr->integerValue("MCCAD","max_dec_depth" , 15 )); + McCadConvertConfig::SetMaxDiscLength (resMgr->integerValue("MCCAD","max_cell_exp_depth" , 500 )); + McCadConvertConfig::SetTolerence (resMgr->doubleValue("MCCAD","Tolerance" , 1.0e-4 )); + McCadConvertConfig::SetWriteCollisionFile (resMgr->booleanValue("MCCAD","write_disc_file" , true )); + + McCadConvertConfig::SetGenerateVoid (resMgr->booleanValue("MCCAD","gen_void" , true )); +// McCadConvertConfig::SetInitPseudoCellNum (resMgr->integerValue("MCCAD","init_pseudo_cell_no" , 90000 )); +// McCadConvertConfig::SetInitEmbedCardNum (resMgr->integerValue("MCCAD","embed_card_no" , 2 )); + + +} + + +bool MCCADGUI_DataModel::generateTetMesh(const QStringList& aList) +{ + if (aList.isEmpty()) { + MESSAGE("the list of part is empty!"); + return false; + } + + DataObjectList aObjList ; + for (int i=0; iresourceMgr(); + int aMeshEngineOpt = resMgr->integerValue("MCCAD", "meshing_engine", 0); + double aDeflection = resMgr->doubleValue("MCCAD","STL_Deflection" , 0.001 ); + double aCoefficient = resMgr->doubleValue("MCCAD","STL_Coefficient" , 0.01 ); + double aMeshQuality = resMgr->doubleValue("MCCAD","Tet_MeshQuality" , 2.0 ); + + bool isOK = true; + stringstream failedMsg; +// QDir atmpDir("problem_Geom"); +// if (!atmpDir.exists()) atmpDir.mkdir("problem_Geom"); + for (int i=0; i (aObjList[i]); + if (!aObj) continue; //if cannot get the object, next + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { +// MESSAGE("This object has a nil part!"); + isOK = false; + failedMsg << aObj->name().toStdString() << " is a nill part!\n"; + continue; + } + if (aPart->isExplodible()) { //if compound, it is most possibility to be failed in mesh generation. +// MESSAGE("The part" <getName() <<" contains compound solid, please Explode it before meshing! Skip it."); + failedMsg << "The part" <getName() <<" contains compound solid, please Explode it before meshing! Skip it. \n"; + isOK = false; + continue; + } + if (aPart->hasMesh()) { +// MESSAGE("The mesh in the part" <getName() <<" will be overrided!"); + failedMsg << "The mesh in the part" <getName() <<" will be overrided! \n"; + } + //generatet he mesh + if (aMeshEngineOpt == 0){ + if (!engine->generateTetgenMesh(aPart,aDeflection, aCoefficient,aMeshQuality )) { + // MESSAGE("The part" <getName() <<" is failed in generating tetrahedral mesh!"); + failedMsg << "The part" <getName() <<" is failed in generating tetrahedral mesh! \n"; + isOK = false; + } + } + else if (aMeshEngineOpt == 1) { + if (!engine->generateNetgenMesh(aPart,aDeflection, aCoefficient )) { + // MESSAGE("The part" <getName() <<" is failed in generating tetrahedral mesh!"); + failedMsg << "The part" <getName() <<" is failed in generating tetrahedral mesh! \n"; + isOK = false; + } + } + + } + else { + MESSAGE("Skip the object " <name().toStdString() <<" because it is not a Part!"); + } + } +// MESSAGE("Summary info:\n"<( it.current() ); + if (!aObj) continue; //if cannot get the object, next + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + isOK = false; + failedMsg << aObj->name().toStdString() << " is a nill part!\n"; + continue; + } + if (aPart->isExplodible()) { //if compound, it is most possibility to be failed in mesh generation. + failedMsg << "The part" <getName() <<" contains compound solid, please Explode it before meshing! Skip it. \n"; + isOK = false; + continue; + } + if (aPart->hasMesh()) + MeshedObjList.append(aObj); + else + unMeshedObjList.append(aObj); + } + } + //ask if override meshes + if (!MeshedObjList.empty()) + { + bool yestoall = false; + bool notoall = false; + QMessageBox::StandardButton aBtn ; + for (int i=0; i (MeshedObjList[i]); + if (!yestoall) { //only ask if neccessary + aBtn = SUIT_MessageBox::question(getMCCADGUImodule()->application()->desktop(), + QString("Question"), + QString( "%1 has mesh already, Override the mesh?").arg(aObj->name()), + QMessageBox::Yes| QMessageBox::YesToAll| QMessageBox::No| QMessageBox::NoToAll); + if (aBtn == QMessageBox::Yes) + YesOrNo = true; + else if (aBtn == QMessageBox::YesToAll) + yestoall = true; + else if (aBtn == QMessageBox::NoToAll) + notoall = true; + } + + if (YesOrNo || yestoall) { + unMeshedObjList.append(aObj); + } + else if (notoall) + break; + else + continue; + } + } + //generated the mesh + if (!generateTetMesh(unMeshedObjList)) + isOK = false; + MESSAGE(failedMsg.str()); + return isOK; +} + + +bool MCCADGUI_DataModel::exportGeom(const QStringList& aList, const QString &FileName) +{ + //checking + if (aList.isEmpty()) return false; + + //obtain a list of BaseObj + MCCAD_ORB::BaseObjList_var aBaseObjList = new MCCAD_ORB::BaseObjList; + for (int i=0; ilength(aBaseObjList->length() + 1); //increase a space + aBaseObjList[aBaseObjList->length()-1] = aObj->getBaseObj(); + } + } + + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + try { + engine->exportGeom(aBaseObjList, FileName.toLatin1()); + } + catch (SALOME::SALOME_Exception &ex) + { + MESSAGE("export failed: " << ex.details.text) ; + return false; + } + return true; + } + MESSAGE("Errors in study or in engine!"); + return false; +} + +/*! + * \brief MCCADGUI_DataModel::translateShapes + * translate (move) the shape + * \param aList a list of part, + * \param aVector the translation vector + * \return false if failed + */ +bool MCCADGUI_DataModel::translateShapes(const QStringList& aList,MCCAD_ORB::FixArray aVector ) +{ + //checking + if (aList.isEmpty()) { + MESSAGE("the list of part is empty!"); + return false; + } + + //get mccad engine + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) return false; + + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + MESSAGE("This object has a nil part!"); + continue; + } + //get the shape and translate it + TopoDS_Shape aTmpShape = Stream2Shape(*aPart->getShapeStream()); + gp_Vec aVec (aVector[0], aVector[1], aVector[2]); + gp_Trsf aTranslate; + aTranslate.SetTranslation(aVec); + BRepBuilderAPI_Transform aBuilder (aTmpShape, aTranslate, true /*make a copy*/); + aPart->setShapeStream(*Shape2Stream(aBuilder.Shape())); + } + else { + MESSAGE("This object type has no mesh!"); + continue; + } + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::rotateShapes + * Rotate the shapes + * \param aList a list of parts + * \param aOrigin the origin of the axis + * \param aDir vector of the axis + * \param aAngle rotate angle + * \return false if failed + */ + +bool MCCADGUI_DataModel::rotateShapes(const QStringList& aList,MCCAD_ORB::FixArray aOrigin, + MCCAD_ORB::FixArray aDir, const double & aAngle) +{ + //checking + if (aList.isEmpty()) { + MESSAGE("the list of part is empty!"); + return false; + } + + //get mccad engine + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) return false; + + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + MESSAGE("This object has a nil part!"); + continue; + } + //get the shape and translate it + TopoDS_Shape aTmpShape = Stream2Shape(*aPart->getShapeStream()); + gp_Pnt Origin (aOrigin[0], aOrigin[1], aOrigin[2]); + gp_Dir Dir (aDir[0], aDir[1], aDir[2]); + gp_Ax1 aAx (Origin,Dir ); + gp_Trsf aRotation; + aRotation.SetRotation(aAx, aAngle * 3.14159265359 / 180); //convert degree to radian + BRepBuilderAPI_Transform aBuilder (aTmpShape, aRotation, true /*make a copy*/); + aPart->setShapeStream(*Shape2Stream(aBuilder.Shape())); + } + else { + MESSAGE("This object type has no mesh!"); + continue; + } + } + return true; +} + +/*! + * \brief MCCADGUI_DataModel::scaleShapes + * scale the shapes + * \param aList a list of parts + * \param aFactor scaling factor + * \return false if failed + */ +bool MCCADGUI_DataModel::scaleShapes(const QStringList& aList,const double & aFactor ) +{ + //checking + if (aList.isEmpty()) { + MESSAGE("the list of part is empty!"); + return false; + } + + //get mccad engine + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( !studyID || CORBA::is_nil( engine ) ) return false; + + for (int i=0; iisPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) { + MESSAGE("This object has a nil part!"); + continue; + } + //get the shape and translate it + TopoDS_Shape aTmpShape = Stream2Shape(*aPart->getShapeStream()); + gp_Trsf aScaling; + aScaling.SetScaleFactor(aFactor); + BRepBuilderAPI_Transform aBuilder (aTmpShape, aScaling, true /*make a copy*/); + aPart->setShapeStream(*Shape2Stream(aBuilder.Shape())); + } + else { + MESSAGE("This object type has no mesh!"); + continue; + } + } + return true; +} +/*! + * \brief MCCADGUI_DataModel::markIfDecomposed + * manually mark those part as decomposed or undecomposed part + * this is useful for import decompsed parts + * \param aList a entry list + * \return false if error + */ + +bool MCCADGUI_DataModel::markIfDecomposed(const QStringList& aList, const bool & isDecomposed) +{ + //check + if (aList.size() == 0) return false; + //append all the object into the list + DataObjectList aObjList ; + for (int i=0; i (aObjList[i]); + //decompose all parts + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + aPart->setIsDecomposed(isDecomposed); + } + } + //recursively decompose the parts in + else if (aObj->isGroup() ) { + DataObjectList aNewObjList = aObj->children(); + if (!aNewObjList.isEmpty()) + markIfDecomposed(aNewObjList, isDecomposed); + } + else if (aObj->isComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (aComponent->_is_nil()) continue; + DataObjectList aNewObjList = aObj->children(); + if (!aNewObjList.isEmpty()) + markIfDecomposed(aNewObjList, isDecomposed); + } + else { + MESSAGE("Unable to operate this type of object!"); + return false; + } + } + return true; +} + +bool MCCADGUI_DataModel::markAllIfDecomposed(const bool & isDecomposed) +{ + for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) + { + MCCADGUI_DataObject* aObj = dynamic_cast( it.current() ); + if (!aObj) continue; //if cannot get the object, next + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (aPart->_is_nil()) + continue; + aPart->setIsDecomposed(isDecomposed); + } + } + return true; +} + + +/*! Called on update of the structure of Data Objects */ +void MCCADGUI_DataModel::build() +{ + MCCADGUI_ModuleObject* modelRoot = dynamic_cast( root() ); + if( !modelRoot ) { // root is not set yet + modelRoot = new MCCADGUI_ModuleObject( this, 0 ); + setRoot( modelRoot ); + } + + // create 'molecule' objects under model root object and 'atom' objects under 'molecule'-s + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + if (!aComponentList) + { + MESSAGE("component list is emtpy!") + return; + } + //*********LOOP for Components***** + for (int i=0; i< aComponentList->length(); i++) + { + MCCAD_ORB::Component_var aComponent = (*aComponentList)[i]; + MCCADGUI_DataObject * aComponentObject = new MCCADGUI_DataObject (modelRoot,aComponent->getID()); + + MCCAD_ORB::GroupList * aGroupList = aComponent->getGroupList(); + //*********LOOP for Groups***** + for (int j=0; jlength(); j++) + { + MCCAD_ORB::Group_var aGroup = (*aGroupList)[j]; + MCCADGUI_DataObject * aGroupObject = new MCCADGUI_DataObject(aComponentObject,aComponent->getID(), aGroup->getID() ); + + MCCAD_ORB::PartList * aPartList = aGroup->getPartList(); + //*********LOOP for Parts***** + for (int k=0; klength(); k++) + { + MCCAD_ORB::Part_var aPart = (*aPartList)[k]; + new MCCADGUI_DataObject(aGroupObject,aComponent->getID(), aGroup->getID(), aPart->getID() ); + } + } + } + } + modelRoot->setDataModel( this ); + setRoot( modelRoot ); + return; +} + +void MCCADGUI_DataModel::buildTree() + +{ +// if (count != 5) { + MCCADGUI_ModuleObject* modelRoot = dynamic_cast( root() ); + if( !modelRoot ) { // root is not set yet + modelRoot = new MCCADGUI_ModuleObject( this, 0 ); + setRoot( modelRoot ); + } + + // create 'molecule' objects under model root object and 'atom' objects under 'molecule'-s + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = getStudyID(); + if ( studyID && !CORBA::is_nil( engine ) ) + { + + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + if (!aComponentList) + { + MESSAGE("component list is emtpy!") + return; + } + const int n = aComponentList->length(); + //*********LOOP for Components***** + for (int i=0; i( it.current() ); + if (obj && obj->isComponent() && obj->getComponentID() == aComponent->getID()) + { + aComponentObject = obj; + break; + } + } + if (aComponentObject == NULL) + aComponentObject = new MCCADGUI_DataObject (modelRoot,aComponent->getID()); + + MCCAD_ORB::GroupList * aGroupList = aComponent->getGroupList(); + const int m = aGroupList->length(); + //*********LOOP for Groups***** + for (int j=0; j( it.current() ); + if (obj && obj->isGroup() && obj->getGroupID() == aGroup->getID()) + { + aGroupObject = obj; + break; + } + } + if (aGroupObject == NULL) + aGroupObject = new MCCADGUI_DataObject(aComponentObject,aComponent->getID(), aGroup->getID() ); + + MCCAD_ORB::PartList * aPartList = aGroup->getPartList(); + const int m = aPartList->length(); + //*********LOOP for Parts***** + for (int k=0; k( it.current() ); + if (obj && obj->isPart() && obj->getPartID() == aPart->getID()) + { + aPartObject = obj; + break; + } + } + if (aPartObject == NULL) + aPartObject = new MCCADGUI_DataObject(aGroupObject,aComponent->getID(), aGroup->getID(), aPart->getID() ); + } + } + } + } + modelRoot->setDataModel( this ); + setRoot( modelRoot ); + return; +} + + diff --git a/src/MCCADGUI/MCCADGUI_DataModel.h b/src/MCCADGUI/MCCADGUI_DataModel.h new file mode 100644 index 0000000..64a0032 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_DataModel.h @@ -0,0 +1,167 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#if !defined(MCCADGUI_DATAMODEL_H) +#define MCCADGUI_DATAMODEL_H +#include "MCCADGUI.h" +#include "MCCADGUI_DataObject.h" +#include +#include +#include +#include +#include +#include + +#include + +#include + + +//OCC include files +#include + + +using namespace std; + +class CAM_Module; + + +class MCCADGUI_DataModel : public LightApp_DataModel +{ +public: + MCCADGUI_DataModel ( CAM_Module* ); + virtual ~MCCADGUI_DataModel(); + + virtual bool open(const QString&url, CAM_Study*study, QStringList listOfFiles); + virtual bool save(QStringList& theListOfFiles); + virtual bool saveAs(const QString&url, CAM_Study*study, QStringList& theListOfFiles); + virtual bool close(); + virtual bool create(CAM_Study* study); + virtual bool isModified() const; + virtual bool isSaved() const; + virtual void update( LightApp_DataObject* = 0, LightApp_Study* = 0 ); + + int getStudyID(); + static int getComponentID(const QString& aEntry ); + static int getGroupID(const QString& aEntry ); + static int getPartID (const QString& aEntry ); + static TopoDS_Shape Stream2Shape(const SALOMEDS::TMPFile& aShapeStream); + static SALOMEDS::TMPFile* Shape2Stream(const TopoDS_Shape& aShape); + MCCADGUI_DataObject * lastComponent (); + MCCADGUI_DataObject * lastGroup(); + + + + MCCADGUI_DataObject * findObject(const QString& aEntry); + Handle(SALOME_InteractiveObject) findObjectIO(const QString& aEntry); + + SUIT_Desktop* desktop() { return module()->application()->desktop(); } + MCCADGUI * getMCCADGUImodule() { return dynamic_cast< MCCADGUI*> ( module() );} + int getPastePartsSize() { return PasteParts->length() ;} + int getPasteGroupsSize() { return PasteGroups->length() ;} + + bool generateComponent(const QString& aComponentName); + bool generateGroup(const QString& aGroupName, const int &ComponentID); + void deleteComponent(const QString& aEntry); + void deleteComponents(const QStringList& aList); + void renameComponent(const QString& aEntry, const QString& newName); + void deleteGroup(const QString& aEntry); + void deleteGroups(const QStringList& aList); + void renameGroup(const QString& aEntry, const QString& newName); + void deletePart (const QString& aEntry); + void deleteParts (const QStringList& aList); + void renamePart(const QString& aEntry, const QString& newName); + void copyPart(const QString& aEntry); + void copyParts(const QStringList& aList, const bool &emptyList); + void cutPart(const QString& aEntry); + void cutParts(const QStringList& aList, const bool &emptyList); + void pasteParts(const QString& aEntry); + void copyGroup(const QString& aEntry); + void copyGroups(const QStringList& aList, const bool &emptyList); + void cutGroup(const QString& aEntry); + void cutGroups(const QStringList& aList, const bool &emptyList); + void pasteGroups(const QString& aEntry); + bool generateMaterial(const int & MaterialID, const QString & Name, const double & Density, + const QString & MaterialCard, const QColor & aColor= QColor() ); + bool updateMaterial(const int & MaterialID, const int & newMaterialID,const QString & Name, + const double & Density, const QString & MaterialCard, const QColor & aColor= QColor()); + bool deleteMaterial(const int & MaterialID); + bool assignMaterial (const QStringList& aList, const int & MaterialID, const bool & isReColor); + bool saveMaterial2Xml(const QString &FileName); + bool loadMaterialXml(const QString &FileName); + bool formNewGroup(const QStringList& aList, const QString &aName); + bool formNewComponent(const QStringList& aList, const QString &aName); + bool explodePart(const QString& aEntry); + bool fuseParts (const QStringList& aList, const QString &aName ); + + bool recoverShapeInParts (const QStringList& aList); + bool decomposeShapes(const QStringList& aList); + bool decomposeShapes(const DataObjectList & aObjList); + bool send2GEOM(const QStringList& aList); + bool sendShape2GEOM(const SALOMEDS::TMPFile& aShapeStream, const QString &aName); + bool assignShape(const QString& aEntry, const TopoDS_Shape& aShape, const QString &aName = QString()); + bool sendMesh2SMESH(const QStringList& aList); + bool assignMesh(const QString& aEntry, const QString & aSMESHEntry , const QString &aName); + bool clearMesh (const QStringList& aList); + bool clearEnvelop (const QStringList& aList); + bool assignImportance(const QStringList& aList, MCCAD_ORB::FixArray aIMP); + bool assignImportance(const DataObjectList & aObjList, MCCAD_ORB::FixArray aIMP); + bool assignRemark(const QStringList& aList, const QString & aRemark); + bool assignAdditive(const QStringList& aList, const QString & aAdditive); + bool assignAdditive(const DataObjectList & aObjList, const QString & aAdditive); + bool exportAllMesh2Abaqus(const QString & FileName); + bool importGeom(const QString & FileName, bool & isExplode,const int & ComponentID, const int & GroupID); + bool checkBeforeConvert(); + bool checkSurface(const TopoDS_Shape & aShape, const QString &aName); + bool checkSolid(const TopoDS_Shape & aShape); + bool convert2MC(const QString &FileName); + void setConvertPara(); + + bool translateShapes(const QStringList& aList,MCCAD_ORB::FixArray aVector ); + bool rotateShapes(const QStringList& aList,MCCAD_ORB::FixArray aOrigin, MCCAD_ORB::FixArray aDir, const double & aAngle); + bool scaleShapes(const QStringList& aList,const double & aFactor ); + + + bool generateTetMesh(const DataObjectList & aObjList); + bool generateTetMesh(const QStringList& aList); + bool generateMesh(); + bool exportGeom(const QStringList& aList, const QString &FileName); + + bool markAllIfDecomposed(const bool & isDecomposed); + bool markIfDecomposed(const QStringList& aList, const bool & isDecomposed); + bool markIfDecomposed(const DataObjectList & aObjList, const bool & isDecomposed); + + + + +public: + virtual void build(); + void buildTree(); + +private: + MCCAD_ORB::PartList_var PasteParts ; + MCCAD_ORB::GroupList_var PasteGroups; + + QString myStudyURL; //store the path of the study + + + +}; + +#endif // MCCADGUI_DATAMODEL_H diff --git a/src/MCCADGUI/MCCADGUI_DataObject.cxx b/src/MCCADGUI/MCCADGUI_DataObject.cxx new file mode 100644 index 0000000..ea5903b --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_DataObject.cxx @@ -0,0 +1,234 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#include "MCCADGUI_DataObject.h" +#include "MCCADGUI.h" + +#include +#include +#include +#include +#include +#include + +/*! Constructor */ +MCCADGUI_DataObject::MCCADGUI_DataObject(SUIT_DataObject* parent, int ComponentIndex, int GroupIndex, int PartIndex ) + : LightApp_DataObject( parent ), + CAM_DataObject( parent), + myComponentID( ComponentIndex ), + myGroupID( GroupIndex ), + myPartID( PartIndex ) +{ +} + +/*! Destructor */ +MCCADGUI_DataObject::~MCCADGUI_DataObject() +{ +} + + + +/*! Returns unique object ID */ +QString MCCADGUI_DataObject::entry() const +{ + QString id = "root"; + if (myComponentID > -1) { + id = QString::number(myComponentID); + if ( myGroupID > -1 ) { + id += QString( "_%1" ).arg(myGroupID); + if ( myPartID >= 0 ) + id += QString( "_%1" ).arg( myPartID); + } + } + + QString aEntry = QString( "MCCADGUI_%1" ).arg( id ); + return aEntry; +} + +/*! Returns a name of the Data Object. */ +QString MCCADGUI_DataObject::name() const +{ + if (isPart()) + { + MCCAD_ORB::Part_var aPart = getPart(); + if (!aPart->_is_nil()) + return aPart->getName(); + else + return QString("-Error-"); + } + else if (isGroup()) + { + MCCAD_ORB::Group_var aGroup = getGroup(); + if (!aGroup->_is_nil()) + return aGroup->getName(); + else + return QString("-Error-"); + } + else if (isComponent()) + { + MCCAD_ORB::Component_var aComponent = getComponent(); + if (!aComponent->_is_nil()) + return aComponent->getName(); + else + return QString("-Error-"); + } + else + return QString("-Error-"); +} + +/*! Returns an icon of the Data Object. */ +QPixmap MCCADGUI_DataObject::icon(const int) const +{ + static QPixmap IconPart = SUIT_Session::session()->resourceMgr()->loadPixmap( "MCCAD","Part.png", false ); + static QPixmap IconGroup = SUIT_Session::session()->resourceMgr()->loadPixmap( "MCCAD","Group.png", false ); + static QPixmap IconComponent = SUIT_Session::session()->resourceMgr()->loadPixmap( "MCCAD","Component.png", false ); + if (isPart()) return IconPart; + else if (isGroup()) return IconGroup; + else if (isComponent()) return IconComponent; + else return QPixmap(); +} + +/*! Returns a tooltip for the object (to be displayed in the Object Browser). */ +QString MCCADGUI_DataObject::toolTip(const int) const +{ + if ( isComponent() ) + return QString( QObject::tr( "Component" ) + ": %1" ).arg( getComponent()->getName()); + else if ( isGroup() ) + return QString( QObject::tr( "Group" ) + ": %1" ).arg( getGroup()->getName()); + else if (isPart()) + return QString( QObject::tr( "Part" ) + ": %1" ).arg( getPart()->getName() ); + else + return QString(); +} + +MCCAD_ORB::Component_ptr MCCADGUI_DataObject::getComponent() const +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); +// LightApp_RootObject* rootObj = dynamic_cast ( root() ); + if ( /*rootObj && */!CORBA::is_nil( engine ) ) + { +// const int studyID = rootObj->study()->id(); + const int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + if ( studyID > 0 ) + { + if (myComponentID > -1) + { + MCCAD_ORB::Component_var aComponent; + aComponent = engine->getComponent(studyID, myComponentID); + if (!CORBA::is_nil(aComponent)) + return aComponent._retn(); + } + } + } + return MCCAD_ORB::Component::_nil(); +} + + +MCCAD_ORB::Group_ptr MCCADGUI_DataObject::getGroup() const +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + // LightApp_RootObject* rootObj = dynamic_cast ( root() ); + if ( /*rootObj && */!CORBA::is_nil( engine ) ) + { + // const int studyID = rootObj->study()->id(); + const int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + if ( studyID > 0 ) + { + if (myGroupID > -1) + { + MCCAD_ORB::Group_var aGroup; + aGroup = engine->getGroup(studyID, myGroupID); + if (!CORBA::is_nil(aGroup)) + return aGroup._retn(); + } + } + } + return MCCAD_ORB::Group::_nil(); +} + +MCCAD_ORB::Part_ptr MCCADGUI_DataObject::getPart() const +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + // LightApp_RootObject* rootObj = dynamic_cast ( root() ); + if ( /*rootObj && */!CORBA::is_nil( engine ) ) + { + // const int studyID = rootObj->study()->id(); + const int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + if ( studyID > 0 ) + { + if (myPartID > -1) //if myPartID > -1, myGroupID should >-1 + { + MCCAD_ORB::Part_var aPart; + aPart = engine->getPart(studyID, myPartID); + if (!CORBA::is_nil(aPart)) + return aPart._retn(); + } + } + } + return MCCAD_ORB::Part::_nil(); +} + + +/*! + * \brief MCCADGUI_DataObject::getBaseObj + * get the base of this part/group/component + * \return the base + */ +MCCAD_ORB::BaseObj_ptr MCCADGUI_DataObject::getBaseObj() const +{ + if (isPart()) + return dynamic_cast (getPart()) ; + else if (isGroup()) + return dynamic_cast (getGroup()) ; + else if (isComponent()) + return dynamic_cast (getComponent()) ; + else + return MCCAD_ORB::BaseObj::_nil(); +} + + +/*! Constructor */ +MCCADGUI_ModuleObject::MCCADGUI_ModuleObject( CAM_DataModel* dm, SUIT_DataObject* parent ) + : MCCADGUI_DataObject( parent, -1 ), + LightApp_ModuleObject( dm, parent ), + CAM_DataObject( parent ) +{ +} + +/*! Returns a name of the root object. */ +QString MCCADGUI_ModuleObject::name() const +{ + return CAM_ModuleObject::name(); +} + +/*! Returns an icon of the root object. */ +QPixmap MCCADGUI_ModuleObject::icon(const int) const +{ + QPixmap px; + px = SUIT_Session::session()->resourceMgr()->loadPixmap( "MCCAD", "MCCAD.png", false ); + + return px; +} + +/*! Returns a tooltip of the root object. */ +QString MCCADGUI_ModuleObject::toolTip(const int) const +{ + return QObject::tr( "MCCAD" ); +} + diff --git a/src/MCCADGUI/MCCADGUI_DataObject.h b/src/MCCADGUI/MCCADGUI_DataObject.h new file mode 100644 index 0000000..062fb94 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_DataObject.h @@ -0,0 +1,77 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#if !defined(MCCADGUI_DATAOBJECT_H) +#define MCCADGUI_DATAOBJECT_H + +#include +#include +#include +#include CORBA_CLIENT_HEADER(MCCAD) + +/*! + * Class : MCCADGUI_DataObject + * Description : Data Object for data of MCCAD component + */ +class MCCADGUI_DataObject : public virtual LightApp_DataObject +{ +public: + MCCADGUI_DataObject ( SUIT_DataObject*,int ComponentIndex = -1, int GroupIndex = -1, int PartIndex = -1 ); + virtual ~MCCADGUI_DataObject(); + + virtual QString entry() const; + + QString name() const; + QPixmap icon(const int = NameId) const; + QString toolTip(const int = NameId) const; + + //these function is cheaper than getGroup()->getID() + int getComponentID() const { return myComponentID; } + int getGroupID() const { return myGroupID; } + int getPartID() const { return myPartID; } + + bool isComponent() const { return !isPart() && !isGroup() && myComponentID > 0; } + bool isGroup() const { return !isPart() && myGroupID > -1; } + bool isPart() const { return myPartID > -1; } + + MCCAD_ORB::Component_ptr getComponent() const; + MCCAD_ORB::Group_ptr getGroup() const; + MCCAD_ORB::Part_ptr getPart() const; + MCCAD_ORB::BaseObj_ptr getBaseObj() const; + + virtual QString componentDataType() {return "MCCAD_DATA";} //a type for identifying data for this module + +private: + int myComponentID; + int myGroupID; + int myPartID; +}; + +class MCCADGUI_ModuleObject : public MCCADGUI_DataObject, + public LightApp_ModuleObject +{ +public: + MCCADGUI_ModuleObject ( CAM_DataModel*, SUIT_DataObject* = 0 ); + + virtual QString name() const; + QPixmap icon(const int = NameId) const; + QString toolTip(const int = NameId) const; +}; + +#endif // MCCADGUI_DATAOBJECT_H diff --git a/src/MCCADGUI/MCCADGUI_Dialogs.cxx b/src/MCCADGUI/MCCADGUI_Dialogs.cxx new file mode 100644 index 0000000..358ff93 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Dialogs.cxx @@ -0,0 +1,1212 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "MCCADGUI_Dialogs.h" +#include "MCCADGUI.h" +#include "MCCADGUI_DataModel.h" +#include "MCCADGUI_Displayer.h" +#include +#include +#include +#include +#include "MCCAD_Constants.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include CORBA_CLIENT_HEADER(MCCAD) + + + + +MCCADGUI_MCardDialog::MCCADGUI_MCardDialog(QWidget*parent, MCCADGUI_DataModel *dm ) :QDialog(parent) +// : LightApp_Dialog( parent, /*name */ "Material Property" +// , /*modal */false, /*allow resize */ false, /*buttons*/ None) +{ + //configure the dialog box + setupUi(this); + QIntValidator *vInt = new QIntValidator(1,1000,this); + IDEdit->setValidator(vInt); + QDoubleValidator *vDbl = new QDoubleValidator(-10000.0,10000.0,4,this); + densityEdit->setValidator(vDbl); + m_Color = QColor(255, 170, 0); + m_isFresh = false; + + + this->dm = dm; + + connect(okButton, SIGNAL(clicked()), this, SLOT(onOK())); //qiu + connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancel())); //qiu + connect(applyButton, SIGNAL(clicked()), this, SLOT(onApply())); + connect(colorButton, SIGNAL(clicked()), this, SLOT(onColorButton())); + + connect(btnDelMat, SIGNAL(clicked()), this, SLOT(DelMaterial())); + //connect(btnMdfMat, SIGNAL(clicked()), this, SLOT(ModifyMaterial())); +// connect(okButton, SIGNAL(clicked()), this, SLOT(SaveMaterial())); + connect(saveXMLButton, SIGNAL(clicked()), this, SLOT(SaveXMLFile())); + connect(loadXMLButton, SIGNAL(clicked()), this, SLOT(LoadXMLFile())); + connect(mMatTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(ShowSelectedMaterial(QTreeWidgetItem*,int))); + + //if material are modified, then they are not up-to-date and need to be Refresh() + connect(IDEdit, SIGNAL(textEdited(QString)), this, SLOT(onMatEdited())); + connect(densityEdit, SIGNAL(textEdited(QString)), this, SLOT(onMatEdited())); + connect(nameEdit, SIGNAL(textEdited(QString)), this, SLOT(onMatEdited())); + connect(mCardText, SIGNAL(textEdited(QString)), this, SLOT(onMatEdited())); + + +} + + +///** ******************************************************************** +//* @brief Load Materials and display them +//* +//* @param +//* @return void +//* +//* @date 28/10/2013 +//* @author Lei Lu +//************************************************************************/ +//void MCCADGUI_MCardDialog::LoadMaterials() +//{ +// QString strInfo = QString("Material Group \"%1\" is being edited").arg(m_EditGroupName); +// label_1->setText(strInfo); + +// int iMatNum = m_Editor->GetMatManager()->GetMatNum(strSelectedGrp); // The material number of selected group + +// vector MatIDList = m_Editor->GetMatManager()->GetMatIDList(); +// for(int i = 0; i< MatIDList.size(); i++) +// { +// QTreeWidgetItem* itemAdd = new QTreeWidgetItem(); +// QString itemText = "M " + QString::number(MatIDList.at(i)); +// itemAdd->setText(0,itemText); +// itemAdd->setText(1,QString::number(MatIDList.at(i))); +// mMatTree->addTopLevelItem(itemAdd); + +// if (iMatNum == MatIDList.at(i)) +// { +// mMatTree->setItemSelected(itemAdd,true); // Select the material number of being edited group +// DisplayMaterial(iMatNum); +// } +// } +//} + + + +/** ******************************************************************** +* @brief Update and refresh the displayed material information +* +* @param +* @return void +* +* @date 14/11/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::Refresh() +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = dm->getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return ; + } + + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); + int n = aMaterialList->length(); + if (n == 0) return; +// vector MatIDList = m_Editor->GetMatManager()->GetMatIDList(); + for(int i = 0; i< n; i++) + { + QTreeWidgetItem* itemAdd = new QTreeWidgetItem(); +// QString itemText = "M " + QString::number(MatIDList.at(i)); + QString itemText = "M " + QString::number((*aMaterialList)[i]->getID()); + itemAdd->setText(0,itemText); + itemAdd->setText(1,QString::number((*aMaterialList)[i]->getID())); + mMatTree->addTopLevelItem(itemAdd); + } + + if (n != 0 ) { + DisplayMaterial((int)(*aMaterialList)[0]->getID()); // Load the detail information of the first material + } + m_isFresh = true; //material is up-to-date +} + + + +/** ******************************************************************** +* @brief Add material in the map and a item on the tree +* +* @param +* @return void +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::AddMaterial() +{ + int iOrgID; // Record the selected material id and compared with the new one + QTreeWidgetItem* itemCur = mMatTree->currentItem(); + if (NULL != itemCur) + { + iOrgID = itemCur->text(1).toInt(); // Get the material ID in the second column + } + else + { + iOrgID = 0; + } + + if(m_ID == iOrgID) // if the new material id is same as selected material, then modify it. + { + ModifyMaterial(); + } // else add a new material + else if(dm->generateMaterial(m_ID,m_Name,m_Density,m_Card, m_Color)) + { + QTreeWidgetItem* itemAdd = new QTreeWidgetItem(); + QString itemText = "M " + IDEdit->text(); + itemAdd->setText(0,itemText); + itemAdd->setText(1,IDEdit->text()); + mMatTree->addTopLevelItem(itemAdd); + ClearData(); + } + else // if the material has already existed, popup the massage box. + { + QMessageBox msg; + + QString strMsg = QString("Material %1 has been already existed").arg(m_ID); + msg.setText(strMsg); + msg.exec(); + } +} + + +/** ******************************************************************** +* @brief Check the input data, make sure they are not empty +* +* @param strErrorMsg +* @return bool, strErrorMsg +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +bool MCCADGUI_MCardDialog::CheckInput(QString &strErrorMsg) +{ + if ( IDEdit->text().isEmpty() ) + { + strErrorMsg = "Material ID is missing"; + return false; + } + + if ( densityEdit->text().isEmpty() ) + { + strErrorMsg = "Density is missing"; + return false; + } + + if ( nameEdit->text().isEmpty() ) + { + strErrorMsg = "Material name is missing"; + return false; + } + + m_Name = nameEdit->text(); + m_ID = IDEdit->text().toInt(); + m_Density = densityEdit->text().toDouble(); + m_Card = mCardText->toPlainText(); + + if( m_ID == 0 ) + { + strErrorMsg = "Material ID should be between 1 and 1000"; + return false; + } + + if( m_Density == 0 ) + { + strErrorMsg = "Value of density is wrong"; + return false; + } + + return true; +} + + +/** ******************************************************************** +* @brief Delete the selected item and the related material in map +* +* @param +* @return void +* +* @date 21/10/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::DelMaterial() +{ + QTreeWidgetItem* itemCur = mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + int index = mMatTree->indexOfTopLevelItem(itemCur); + int iDelItem = itemCur->text(1).toInt(); // Get the material ID + + if(dm->deleteMaterial(iDelItem)) + { + mMatTree->takeTopLevelItem(index); // Delete the item on the tree + + delete itemCur; // Delete the iterCur pointer + itemCur = NULL; + + ClearData(); // Clear the edit box + } + + return; +} + + + +/** ******************************************************************** +* @brief Modify the selected item and the related material in map +* +* @param +* @return void +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::ModifyMaterial() +{ + QTreeWidgetItem* itemCur = mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + m_Card = mCardText->toPlainText(); + m_Name = nameEdit->text(); + m_ID = IDEdit->text().toInt(); + m_Density = densityEdit->text().toDouble(); + + int index = itemCur->text(1).toInt(); // Get the material ID + if (dm->updateMaterial(index,m_ID,m_Name,m_Density,m_Card, m_Color)) //!!!! + { + QString itemText = "M " + IDEdit->text(); + itemCur->setText(0,itemText); + itemCur->setText(1,IDEdit->text()); + } + else + { + return; + } +} + +/*! + * \brief when okButton is click, save and close + */ +void MCCADGUI_MCardDialog::onOK() +{ + QString strMessage; + if(!CheckInput(strMessage)) { //check if no data , just quit + this->done(0); + return ; + } + if (m_isFresh == false) //only if the material is not up-to-date + AddMaterial(); + this->done(0); +} + +/*! + * \brief when applyButton is click, save + */ +void MCCADGUI_MCardDialog::onApply() +{ + QString strMessage; + if(!CheckInput(strMessage)) // Check the input data and their formats + { + QMessageBox msg; + msg.setText(strMessage); + msg.exec(); + return; + } + if (m_isFresh == false) //only if the material is not up-to-date + AddMaterial(); + +} + +/*! + * \brief when cancelButton is click, close + */ +void MCCADGUI_MCardDialog::onCancel() +{ + this->done(0); +} + + +/*! + * \brief MCCADGUI_MCardDialog::onColorButton + * open a color dialog to select color + */ +void MCCADGUI_MCardDialog::onColorButton() +{ + QColor aColor = QColorDialog::getColor(Qt::white, this); + m_Color = aColor; + + colorButton->setStyleSheet(QString("QPushButton { background:rgb(%1, %2, %3) }").arg(aColor.red()).arg(aColor.green()).arg(aColor.blue())); + +} + + + +/** ******************************************************************** +* @brief Reponse to the item click, update the edit box +* with the selected material. +* +* @param +* @return void +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::ShowSelectedMaterial(QTreeWidgetItem* item,int colume) +{ + QTreeWidgetItem* itemCur = mMatTree->currentItem(); + if (NULL == itemCur) + { + return; + } + + int iItem = item->text(1).toInt(); // Get the material ID + DisplayMaterial(iItem); // Display the material whose ID is iItem + + return; +} + + +/** ******************************************************************** +* @brief Display the deteil selected material. +* +* @param +* @return void +* +* @date 13/11/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::DisplayMaterial(int iItem) +{ +// Material *pMaterial = NULL; +// pMaterial = m_Editor->GetMatManager()->GetMaterial(iItem); + //get the engine and study + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = dm->getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return ; + } + + //get the original material, and check the newID if ok + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, iItem); + if (aMaterial->_is_nil()) { + MESSAGE("Could not find the material in the list!"); + return ; + } + +// if (NULL != pMaterial) +// { + QString strID = QString::number(aMaterial->getID()); + QString strDensity = QString::number(aMaterial->getDensity()); + QString strName = aMaterial->getName(); + QString strMatCard = aMaterial->getMatCard(); + + IDEdit->setText(strID); + densityEdit->setText(strDensity); + nameEdit->setText(strName); + mCardText->setText(strMatCard); +// } + return; +} + + + +///** ******************************************************************** +//* @brief Add material in the map and a item on the tree +//* +//* @param +//* @return void +//* +//* @date 21/10/2013 +//* @author Lei Lu +//************************************************************************/ +//void MCCADGUI_MCardDialog::SaveMaterial() +//{ +// QTreeWidgetItem* itemCur = mMatTree->currentItem(); +// if (NULL == itemCur) +// { +// return; +// } + +// int iItem = itemCur->text(1).toInt(); // Get the material ID +// m_Editor->GetMatManager()->InsertMatGroup(m_EditGroupName,iItem); +// //m_Editor->GetMatManager()->SaveXMLfile(); +//} + + + +/** ******************************************************************** +* @brief Clear the edit box +* +* @param +* @return void +* +* @date 23/10/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::ClearData() +{ + mCardText->clear(); + nameEdit->clear(); + IDEdit->clear(); + densityEdit->clear(); +} + + +///** ******************************************************************** +//* @brief Set the material group now being edited +//* +//* @param +//* @return void +//* +//* @date 28/10/2013 +//* @author Lei Lu +//************************************************************************/ +//void MCCADGUI_MCardDialog::SetEditGroup(QString theGroupName) +//{ +// m_EditGroupName = theGroupName; +//} + + +///** ******************************************************************** +//* @brief Set the editor, connect the editor with material manager +//* +//* @param +//* @return void +//* +//* @date 28/10/2013 +//* @author Lei Lu +//************************************************************************/ +//void MCCADGUI_MCardDialog::SetCurrentEditor(QMcCad_Editor* theEditor) +//{ +// m_Editor = theEditor; +//} + + +/*! + * \brief MCCADGUI_MCardDialog::SaveXMLFile + * Save the material to XML file, as the DataModel to do this + * If the current material edit is no empty, add this material and then save + */ +void MCCADGUI_MCardDialog::SaveXMLFile() +{ + + QString strMessage; + if(CheckInput(strMessage)) //if check ok, save current material first + AddMaterial(); + + QString fileFilters("*.xml"); + QString theFileName = QFileDialog::getSaveFileName(this, tr("Save As"), ".", fileFilters ); + + if (!theFileName.isEmpty()) + { + if(!theFileName.endsWith(".xml")) + { + theFileName.append(".xml"); + } + dm->saveMaterial2Xml(theFileName); + } +} + + + +/** ******************************************************************** +* @brief Load the material information as a xml file +* +* @param +* @return void +* +* @date 04/11/2013 +* @author Lei Lu +************************************************************************/ +void MCCADGUI_MCardDialog::LoadXMLFile() +{ + QString fileFilters("*.xml"); + QString theFileName = QFileDialog::getOpenFileName(this, tr("Load"), ".", fileFilters ); + + if (!theFileName.isEmpty()) + { + if(!theFileName.endsWith(".xml")) + { + theFileName.append(".xml"); + } + dm->loadMaterialXml(theFileName); + Refresh(); + } +} + + +MCCADGUI_SetPropertyDialog::MCCADGUI_SetPropertyDialog(QWidget*parent, MCCADGUI_DataModel * dm ): QDialog(parent) +{ + setupUi(this); + QIntValidator *vInt = new QIntValidator(0,1000000,this); + le_imp_n->setValidator(vInt); + le_imp_p->setValidator(vInt); + le_imp_e->setValidator(vInt); + + this->dm = dm; //assign the data model + isMultipleSelect = false; + isAllGroup = true; + + connect(Btn_close, SIGNAL(clicked()), this, SLOT(onClose())); //qiu + connect(Btn_apply, SIGNAL(clicked()), this, SLOT(onApply())); + connect(Btn_edit_mat, SIGNAL(clicked()), this, SLOT(onEditMaterial())); + connect(Btn_color, SIGNAL(clicked()), this, SLOT(onColorButton())); + connect(dm->getMCCADGUImodule(),SIGNAL(selectChg()),this,SLOT(onSelectChg()) ); + + + Refresh(); //refresh the dialog +} + + + + + +/*! + * \brief MCCADGUI_SetPropertyDialog::Refresh + * refresh the dialog box to update the shown info + */ +void MCCADGUI_SetPropertyDialog:: Refresh() +{ + MCCADGUI * theGUI = dm->getMCCADGUImodule(); + QStringList aSelectedList; + theGUI->selected(aSelectedList, /*multiple objects*/ true); + + if (aSelectedList.size() > 1) + isMultipleSelect = true; + else if (aSelectedList.size() == 1) + isMultipleSelect = false; + else return; + + //check if all groups + isAllGroup = false; //default false for case of no selection + for (int i=0; ifindObject(aSelectedList[i])->isGroup()) { //when one of the object is not a group + isAllGroup = false; + break; + } + else isAllGroup = true; + } + + //get the material list, and update the combox box + if (isAllGroup) { + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = dm->getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return ; + } + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); + int n = aMaterialList->length(); + cmb_mat_id->clear(); //clear the old data + cmb_mat_id->addItem("-----",0 ); + for(int i = 0; i< n; i++) + { + //style: M1--name + QString aTmpStr = QString("M") + QString("%1--").arg((*aMaterialList)[i]->getID()) + QString ((*aMaterialList)[i]->getName()); + cmb_mat_id->addItem(aTmpStr,(*aMaterialList)[i]->getID() ); + } + } + + //display the property of the first object + DisplayProperty(aSelectedList[0]); +} + +/*! + * \brief DisplayProperty + * display the property of this object + * \param aEntry + */ +void MCCADGUI_SetPropertyDialog::DisplayProperty(const QString & aEntry) +{ + + //####first display the properties #### + //combo box + MCCADGUI_DataObject * aObj = dm->findObject(aEntry); + if (!aObj) return; + //for material group box +// if (!isMultipleSelect) { + if (aObj->isGroup()) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup() ; + MCCAD_ORB::Material_var aMaterial = aGroup->getMaterial(); + if (!aMaterial->_is_nil()) { + int aIndex = cmb_mat_id->findData(aMaterial->getID()); //find the index of the material in the combox according to ID + cmb_mat_id->setCurrentIndex(aIndex); + } + } +// } +// else { +// int aIndex = cmb_mat_id->findData(0); //find the ---- +// cmb_mat_id->setCurrentIndex(aIndex); +// } + + //for color + MCCAD_ORB::BaseObj_var aBaseObj = aObj->getBaseObj(); +// if (!isMultipleSelect) { + if (!aBaseObj->_is_nil()) { + MCCAD_ORB::MColor aMColor; + aBaseObj->getColor(aMColor); + QColor aColor = QColor(aMColor[0], aMColor[1], aMColor[2]); + m_Color = aColor; + Btn_color->setStyleSheet(QString("QPushButton { background:rgb(%1, %2, %3) }").arg(aColor.red()).arg(aColor.green()).arg(aColor.blue())); + } +// } +// else { +// m_Color = QColor(0,0,0) ; //use black color to indecate the no change on the color +// } + + + + //for importances +// if (isMultipleSelect) { +// le_imp_n->clear(); //clear the data, to show that the data is not set +// le_imp_p->clear(); +// le_imp_e->clear(); +// } + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + MCCAD_ORB::FixArray_var aIMP = aPart->getImportance(); + le_imp_n->setText(aIMP[0] == -1 ? "" :QString("%1").arg(aIMP[0])); + le_imp_p->setText(aIMP[1] == -1 ? "" :QString("%1").arg(aIMP[1])); + le_imp_e->setText(aIMP[2] == -1 ? "" :QString("%1").arg(aIMP[2])); + } + } + + //for the remark +// if (!isMultipleSelect) { + tb_remark->setText(aBaseObj->getRemark()); //set the remark +// } +// else { +// tb_remark->clear(); +// } + + //for additive card + +// if (isMultipleSelect) { +// tb_add_card->clear(); +// } + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) { + tb_add_card->setText(QString(aPart->getAdditive())); + } + } + + + //####second controld the enable/disable checkable/ of groupboxes#### + //material group box + if (!isAllGroup) + gb_Material->setEnabled(false); //deactivate the group box + else { + gb_Material->setEnabled(true); //activate the group box + + if (isMultipleSelect) //if multiple groups, default not checked + gb_Material->setChecked(false); + else gb_Material->setChecked(true); //if single group, default checked + } + //important group box + if (isMultipleSelect) { + gb_Imp->setChecked(false); + gb_Graphic->setChecked(false); + gb_Remark->setChecked(false); + gb_Additive->setChecked(false); + } + else if (aObj->isComponent()) { + gb_Imp->setChecked(false); + gb_Graphic->setChecked(false); + gb_Remark->setChecked(true); + gb_Additive->setChecked(false); + } + else if (aObj->isGroup()) { + gb_Imp->setChecked(false); + gb_Graphic->setChecked(false); + gb_Remark->setChecked(true); + gb_Additive->setChecked(false); + } + else if (aObj->isPart()) { + gb_Imp->setChecked(true); + gb_Graphic->setChecked(false); + gb_Remark->setChecked(true); + gb_Additive->setChecked(true); + } + +} + + +/*! + * \brief MCCADGUI_SetPropertyDialog::checkInput + * for checking the inputs + */ +void MCCADGUI_SetPropertyDialog::checkInput() +{ + //check if material are change + if (isAllGroup) { //if all are groups, check the material group box + if (isMultipleSelect) { //if more than one group + if (!gb_Material->isChecked()) //if the material group box is not check + isMaterialChg = false; + } + else isMaterialChg = true; // to force updating material of this single group + } + else isMaterialChg = false; // material not edit + //check if importance changed +// if (isMultipleSelect) + isImpChg = gb_Imp->isChecked()? true : false; +// else isImpChg = true; //force update the importance + + //check color changed +// if (isMultipleSelect) + isColorChg = gb_Graphic->isChecked()? true : false; +// else isColorChg = true; //force update + + //check remark changed +// if (isMultipleSelect) + isRemarkChg = gb_Remark->isChecked()? true : false; +// else isRemarkChg = true; + //check Additive changed +// if (isMultipleSelect) + isAddCardChg = gb_Additive->isChecked()? true : false; +// else isAddCardChg = true; + +} + + + +/*! + * \brief MCCADGUI_SetPropertyDialog::onClose + * close the dialog without any action + */ +void MCCADGUI_SetPropertyDialog::onClose() +{ + this->done(0); +} + +/*! + * \brief MCCADGUI_SetPropertyDialog::onApply + * take all necessary actions + */ +void MCCADGUI_SetPropertyDialog::onApply() +{ + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + const int studyID = dm->getStudyID(); + if ( !studyID && CORBA::is_nil( engine ) ) + { + MESSAGE("Errors in study or in engine!"); + return ; + } + + checkInput(); //first check the input + + MCCADGUI * theGUI = dm->getMCCADGUImodule(); + QStringList aSelectedList; + theGUI->selected(aSelectedList, /*multiple objects*/ true); + + + //for material + if (isAllGroup && isMaterialChg) { + int aIndex = cmb_mat_id->currentIndex(); + int MaterialID = cmb_mat_id->itemData(aIndex).toInt(); + if ( MaterialID != 0) { +// MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, MaterialID); +// MCCAD_ORB::MColor aMColor ; +// aMaterial->getColor(aMColor); +// for (int i=0; ifindObject(aSelectedList[i]); +// MCCAD_ORB::Group_var aGroup = aObj->getGroup(); +// aGroup->setMaterial(aMaterial); //duplciate the material reference for the group +// if (chk_recolor->isChecked()) { //if assign the material color for the group +// aGroup->setColor(aMColor); +// } +// } + + dm->assignMaterial(aSelectedList, MaterialID, chk_recolor->isChecked()); // call the dm to finish this work + if (chk_recolor->isChecked()) { + //invoke the GUI to update the color of these objects + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, MaterialID); + if (!aMaterial->_is_nil()) { + MCCAD_ORB::MColor aMColor ; + aMaterial->getColor(aMColor); + QColor aColor = QColor(aMColor[0], aMColor[1],aMColor[2]); + theGUI->setProperty(aSelectedList, MCCAD::Color, aColor ); + MCCADGUI_Displayer * d = dynamic_cast (theGUI->displayer()); + theGUI->redisplay(d); + } + } + } + } + + //for graphic + if(isColorChg) { + MCCAD_ORB::MColor aMColor ; + aMColor[0]= m_Color.red(); + aMColor[1] = m_Color.green(); + aMColor[2] = m_Color.blue(); + for (int i=0; ifindObject(aSelectedList[i]); + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + aPart->setColor(aMColor); + } + else if (aObj->isGroup()) { + MCCAD_ORB::Group_var aGroup = aObj->getGroup(); + aGroup->setColor(aMColor); + } + else if (aObj->isComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + aComponent->setColor(aMColor); + } + else continue; + } + //set the color property for the GUI + theGUI->setProperty(aSelectedList, MCCAD::Color, m_Color ); + MCCADGUI_Displayer * d = dynamic_cast (theGUI->displayer()); + theGUI->redisplay(d); + } + + if (isImpChg) { + MCCAD_ORB::FixArray aIMP ; + aIMP[0] = le_imp_n->text().trimmed().isEmpty() ? -1 : le_imp_n->text().trimmed().toInt(); // -1: no importance + aIMP[1] = le_imp_p->text().trimmed().isEmpty() ? -1 : le_imp_p->text().trimmed().toInt(); + aIMP[2] = le_imp_e->text().trimmed().isEmpty() ? -1 : le_imp_e->text().trimmed().toInt(); + dm->assignImportance(aSelectedList, aIMP); //dont get the return bool, not useful + } + if (isRemarkChg) { + dm->assignRemark(aSelectedList, tb_remark->toPlainText()); + } + if (isAddCardChg) { + dm->assignAdditive(aSelectedList, tb_add_card->toPlainText()); + } + +// this->done(0); + +} + + + +/*! + * \brief MCCADGUI_SetPropertyDialog::onEditMaterial + * open the edit material dialog + */ +void MCCADGUI_SetPropertyDialog::onEditMaterial() +{ + MCCADGUI_MCardDialog aMatDialog (dm->getMCCADGUImodule()->application()->desktop(),dm ); + aMatDialog.Refresh(); + aMatDialog.exec(); + + Refresh(); //refresh the material +} + +/*! + * \brief MCCADGUI_SetPropertyDialog::onColorButton + * open a color dialog to select color + */ +void MCCADGUI_SetPropertyDialog::onColorButton() +{ + QColor aColor = QColorDialog::getColor(Qt::white, this); + m_Color = aColor; + Btn_color->setStyleSheet(QString("QPushButton { background:rgb(%1, %2, %3) }").arg(aColor.red()).arg(aColor.green()).arg(aColor.blue())); + +} + +void MCCADGUI_SetPropertyDialog::onSelectChg() +{ + Refresh(); +} + + + + +MCCADGUI_ImportObjDialog::MCCADGUI_ImportObjDialog(QWidget*parent, MCCADGUI_DataModel * dm ): QDialog(parent) +{ + setupUi(this); + this->dm = dm; //assign the data model +// isOK = false; + connect(Btn_ok, SIGNAL(clicked()), this, SLOT(onOK())); //qiu + connect(Btn_cancel, SIGNAL(clicked()), this, SLOT(onCancel())); + connect(dm->getMCCADGUImodule(),SIGNAL(selectChg()),this,SLOT(onSelectChg()) ); +} + +void MCCADGUI_ImportObjDialog::SetSourceObjName(const QString & aName) +{ + if (aName.trimmed().isEmpty()) return; + lb_geom_name->setText(aName); +} + +void MCCADGUI_ImportObjDialog::SetMCCADObjName(const QString & aName) +{ + if (aName.trimmed().isEmpty()) return; + lb_mccad_name->setText(aName); +} + +/*! + * \brief invoke the change of showing the name + */ +void MCCADGUI_ImportObjDialog::onSelectChg() +{ + MCCADGUI * theGUI = dm->getMCCADGUImodule(); + QStringList aSelectedList; + theGUI->selected(aSelectedList, /*multiple objects*/ false); +// if (aSelectedList.isEmpty()) { +// isOK = false; +// return; +// } + + + MCCADGUI_DataObject * aObj = dm->findObject(aSelectedList[0]); +// if (!aObj) { +// isOK = false; +// return; +// } + QString aTmpName; + if (aObj->isPart()) + aTmpName = QString("Part ") + QString(aObj->name()); + else if (aObj->isGroup()) + aTmpName = QString("Group ") + QString(aObj->name()); + else if (aObj->isComponent()) + aTmpName = QString("Component ") + QString(aObj->name()); + else + aTmpName = QString("MCCAD"); + + //set the name for mccad object label + SetMCCADObjName(aTmpName); +// isOK = true; +} + +void MCCADGUI_ImportObjDialog::onOK() +{ +// if (!isOK) { +// SUIT_MessageBox::warning( this, QString("Warning"), +// QString( "Please selecte the correct object!")); +// return ; +// } +// else { +// this->done(0); +// } + this->done(0); +} + +void MCCADGUI_ImportObjDialog::onCancel() +{ + this->done(1); +} + + + +//###########MCMEHSTRANGUI_TransparencyDlg###############// +MCCADGUI_TransparencyDlg::MCCADGUI_TransparencyDlg( QWidget* parent, const QStringList& entries ) + :QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) +{ + myEntries = entries; + + resize(152, 107); + setWindowTitle(tr("Transparency")); + setSizeGripEnabled(TRUE); + QGridLayout* lay = new QGridLayout(this); + lay->setSpacing(6); + lay->setMargin(11); + + /*************************************************************************/ + QGroupBox* GroupButtons = new QGroupBox( this ); + QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons ); + GroupButtonsLayout->setAlignment( Qt::AlignTop ); + GroupButtonsLayout->setSpacing( 6 ); + GroupButtonsLayout->setMargin( 11 ); + + QPushButton* buttonApply = new QPushButton( GroupButtons ); + buttonApply->setText( tr( "Apply" ) ); + buttonApply->setAutoDefault( TRUE ); + buttonApply->setDefault( TRUE ); + + QPushButton* buttonCancel = new QPushButton( GroupButtons ); + buttonCancel->setText( tr( "Cancel" ) ); + buttonCancel->setAutoDefault( TRUE ); + buttonCancel->setDefault( TRUE ); + + GroupButtonsLayout->addWidget( buttonApply, 0, 0 ); + GroupButtonsLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1 ); + GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + + /*************************************************************************/ + QGroupBox* GroupC1 = new QGroupBox( this ); + QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 ); + GroupC1Layout->setAlignment( Qt::AlignTop ); + GroupC1Layout->setSpacing( 6 ); + GroupC1Layout->setMargin( 11 ); + GroupC1Layout->setColumnMinimumWidth(1, 100); + + QLabel* TextLabelOpaque = new QLabel( GroupC1 ); + TextLabelOpaque->setText( tr( "Transparent" ) ); + TextLabelOpaque->setAlignment( Qt::AlignLeft ); + GroupC1Layout->addWidget( TextLabelOpaque, 0, 0 ); + GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); + + QLabel* TextLabelTransparent = new QLabel( GroupC1 ); + TextLabelTransparent->setText( tr( "Opaque" ) ); + TextLabelTransparent->setAlignment( Qt::AlignRight ); + GroupC1Layout->addWidget( TextLabelTransparent, 0, 2 ); + + mySlider = new QSlider( Qt::Horizontal, GroupC1 ); + mySlider->setMinimum( 0 ); + mySlider->setMaximum( 10 ); + GroupC1Layout->addWidget( mySlider, 0, 1 ); + /*************************************************************************/ + + lay->addWidget(GroupC1, 0, 0); + lay->addWidget(GroupButtons, 1, 0); + + if ( myEntries.count() == 1 ) { + int value = (int)(MCCADGUI_Displayer().getTransparency( myEntries[ 0 ] ) * 10.); + if ( value > 0 ) + mySlider->setValue( value ); + ValueHasChanged(mySlider->value()); + } + + // signals and slots connections : after ValueHasChanged() + connect(buttonApply, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); +// connect(mySlider, SIGNAL(valueChanged(int)), this, SLOT(ValueHasChanged(int))); +} + +//================================================================================= +// function : ClickOnCancel() +// purpose : +//================================================================================= +void MCCADGUI_TransparencyDlg::ClickOnCancel() +{ + done(0); +} + +//================================================================================= +// function : ValueHasChanged() +// purpose : Called when value of slider change +// : or the first time as initilisation +//================================================================================= +void MCCADGUI_TransparencyDlg::ValueHasChanged( int newValue ) +{ + MCCADGUI_Displayer().setTransparency( myEntries, (double)mySlider->value() * 0.1 ); +} + +void MCCADGUI_TransparencyDlg::accept() +{ + MCCADGUI_Displayer().setTransparency( myEntries, (double)mySlider->value() * 0.1 ); +} + + + + + + +//###########MCMEHSTRANGUI_TransformDialog###############// + +MCCADGUI_TransformDialog::MCCADGUI_TransformDialog(QWidget*parent, MCCADGUI_DataModel * dm ) +{ + setupUi(this); + QDoubleValidator * vFactor= new QDoubleValidator(1e-9, 1e15,10,this ); + le_scl_ft->setValidator(vFactor); + + QDoubleValidator * vDouble= new QDoubleValidator(-1e99, 1e99,14,this ); + le_rt_ang->setValidator(vDouble); + le_rt_dir_x->setValidator(vDouble); + le_rt_dir_y->setValidator(vDouble); + le_rt_dir_z->setValidator(vDouble); + le_rt_org_x->setValidator(vDouble); + le_rt_org_y->setValidator(vDouble); + le_rt_org_z->setValidator(vDouble); + le_tsl_x->setValidator(vDouble); + le_tsl_y->setValidator(vDouble); + le_tsl_z->setValidator(vDouble); + + this->dm = dm; //assign the data model + + connect(Btn_apply, SIGNAL(clicked()), this, SLOT(onApply())); + connect(Btn_close, SIGNAL(clicked()), this, SLOT(onClose())); + +} + +void MCCADGUI_TransformDialog::onApply() +{ + MCCADGUI * theGUI = dm->getMCCADGUImodule(); + QStringList aSelectedList; + theGUI->selected(aSelectedList, /*multiple objects*/ true); + + if(gb_tsl->isChecked()) { + MCCAD_ORB::FixArray aVec ; + //default 0,0,0 + aVec[0] = le_tsl_x->text().trimmed().isEmpty() ? 0 : le_tsl_x->text().trimmed().toDouble(); + aVec[1] = le_tsl_y->text().trimmed().isEmpty() ? 0 : le_tsl_y->text().trimmed().toDouble(); + aVec[2] = le_tsl_z->text().trimmed().isEmpty() ? 0 : le_tsl_z->text().trimmed().toDouble(); + dm->translateShapes(aSelectedList, aVec); + } + if (gb_rt->isChecked()){ + MCCAD_ORB::FixArray aOrigin ; + MCCAD_ORB::FixArray aDir ; + double aAngle = 0.; + aOrigin[0] = le_rt_org_x->text().trimmed().isEmpty() ? 0 : le_rt_org_x->text().trimmed().toDouble(); + aOrigin[1] = le_rt_org_y->text().trimmed().isEmpty() ? 0 : le_rt_org_y->text().trimmed().toDouble(); + aOrigin[2] = le_rt_org_z->text().trimmed().isEmpty() ? 0 : le_rt_org_z->text().trimmed().toDouble(); + aDir[0] = le_rt_dir_x->text().trimmed().isEmpty() ? 0 : le_rt_dir_x->text().trimmed().toDouble(); + aDir[1] = le_rt_dir_y->text().trimmed().isEmpty() ? 0 : le_rt_dir_y->text().trimmed().toDouble(); + aDir[2] = le_rt_dir_z->text().trimmed().isEmpty() ? 0 : le_rt_dir_z->text().trimmed().toDouble(); + aAngle = le_rt_ang->text().trimmed().isEmpty() ? 0 : le_rt_ang->text().trimmed().toDouble(); + dm->rotateShapes(aSelectedList, aOrigin, aDir, aAngle); + } + if (gb_scl->isChecked()){ + double aFactor = 1.; + aFactor = le_scl_ft->text().trimmed().isEmpty() ? 1. : le_scl_ft->text().trimmed().toDouble(); + dm->scaleShapes(aSelectedList, aFactor); + } + MCCADGUI_Displayer * d = dynamic_cast (theGUI->displayer()); + theGUI->redisplay(d); +} + +void MCCADGUI_TransformDialog:: onClose() +{ + this->done(0); +} + diff --git a/src/MCCADGUI/MCCADGUI_Dialogs.h b/src/MCCADGUI/MCCADGUI_Dialogs.h new file mode 100644 index 0000000..b9195d0 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Dialogs.h @@ -0,0 +1,207 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#ifndef MCCADGUI_DIALOGS_H +#define MCCADGUI_DIALOGS_H +#include +#include "MCCADGUI_DataModel.h" +#include "ui_MCardDialog.h" +#include "ui_SetPropertyDialog.h" +#include "ui_ImportObjDialog.h" +#include "ui_TransformDialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +const double Null = 4.44444444444e34; + +class MCCADGUI_MCardDialog: public QDialog, Ui::MCCADGUI_MCardDialog//public LightApp_Dialog, +{ + Q_OBJECT + +public: + MCCADGUI_MCardDialog(QWidget*parent, MCCADGUI_DataModel * dm ); + void LoadMatData(); +// void SetCurrentEditor(QMcCad_Editor* theEditor); + bool CheckInput(QString &strErrorMsg); + void ClearData(); +// void SetEditGroup(QString theGroupName); +// void LoadMaterials(); + void DisplayMaterial(int iItem); + void Refresh(); + +public slots: + void AddMaterial(); + void DelMaterial(); + void ModifyMaterial(); + void onOK(); + void onApply(); + void onCancel(); + void onColorButton(); + +// void SaveMaterial(); + void SaveXMLFile(); + void LoadXMLFile(); + void ShowSelectedMaterial(QTreeWidgetItem*item, int colume); + + void onMatEdited() {m_isFresh = false;}; //tringer then material is edited + +private: + +// Ui::MCardDialog m_MatDialog; +// QMcCad_Editor* m_Editor; + + unsigned int m_ID; + double m_Density; + QString m_Name; + QString m_Card; + QColor m_Color; + + QString m_EditGroupName; // The group name of being edited group + + Standard_Integer m_NumOfMat; // Number of Materials + vector m_MatIDList; // The list stores the ID of materials. + MCCADGUI_DataModel * dm ; + //for recording if the Materials are consistent with that in the library, + //if Refresh is called, m_isFresh is true; if the inputs are modified, then false + bool m_isFresh; + +}; + + +/*! + * \brief The MCCADGUI_SetPropertyDialog class + * for setting property of + */ +class MCCADGUI_SetPropertyDialog: public QDialog, Ui::MCCADGUI_SetPropertyDialog +{ + Q_OBJECT + +public: + MCCADGUI_SetPropertyDialog(QWidget*parent, MCCADGUI_DataModel * dm ); + + + + void Refresh(); + void DisplayProperty(const QString & aEntry) ; + void checkInput(); + + +private slots: + void onClose(); + void onApply(); + void onEditMaterial(); + void onColorButton() ; + void onSelectChg(); + + +private: + MCCADGUI_DataModel * dm ; + QColor m_Color; + //for checking and associate actions + bool isMultipleSelect; + bool isAllGroup; + bool isMaterialChg; + bool isImpChg ; //is importance changed + bool isColorChg; + bool isRemarkChg; + bool isAddCardChg; + + +}; + +/*! + * \brief The MCCADGUI_ImportObjDialog class + * for setting property of + */ +class MCCADGUI_ImportObjDialog: public QDialog, Ui::MCCADGUI_ImportObjDialog +{ + Q_OBJECT + +public: + MCCADGUI_ImportObjDialog(QWidget*parent, MCCADGUI_DataModel * dm ); + void SetSourceObjName(const QString & aName); + void SetMCCADObjName(const QString & aName); + +private slots: + void onOK(); + void onCancel(); + void onSelectChg(); + + +private: + MCCADGUI_DataModel * dm ; +// bool isOK; +}; + + +class QSlider; +//================================================================================= +// class : MCMEHSTRANGUI_TransparencyDlg +// purpose : dialog box that allows to modify transparency of displayed objects +//================================================================================= +class MCCADGUI_TransparencyDlg : public QDialog +{ + Q_OBJECT + +public: + MCCADGUI_TransparencyDlg( QWidget* parent, const QStringList& entries ); + +private: + QSlider* mySlider; + QStringList myEntries; + +private slots: + void ClickOnCancel(); + void ValueHasChanged( int ) ; + void accept(); + +}; + +/*! + * \brief The MCCADGUI_SetPropertyDialog class + * for setting property of + */ +class MCCADGUI_TransformDialog: public QDialog, Ui::MCCADGUI_TransformDialog +{ + Q_OBJECT + +public: + MCCADGUI_TransformDialog(QWidget*parent, MCCADGUI_DataModel * dm ); + + +private slots: + void onClose(); + void onApply(); + + + +private: + MCCADGUI_DataModel * dm ; + + + +}; + + + +#endif //MCCADGUI_DIALOGS_H diff --git a/src/MCCADGUI/MCCADGUI_Dialogs_moc.cxx b/src/MCCADGUI/MCCADGUI_Dialogs_moc.cxx new file mode 100644 index 0000000..38350e2 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Dialogs_moc.cxx @@ -0,0 +1,444 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'MCCADGUI_Dialogs.h' +** +** Created: Mon Aug 3 15:58:18 2015 +** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "MCCADGUI_Dialogs.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'MCCADGUI_Dialogs.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MCCADGUI_MCardDialog[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 11, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 22, 21, 21, 21, 0x0a, + 36, 21, 21, 21, 0x0a, + 50, 21, 21, 21, 0x0a, + 67, 21, 21, 21, 0x0a, + 74, 21, 21, 21, 0x0a, + 84, 21, 21, 21, 0x0a, + 95, 21, 21, 21, 0x0a, + 111, 21, 21, 21, 0x0a, + 125, 21, 21, 21, 0x0a, + 151, 139, 21, 21, 0x0a, + 194, 21, 21, 21, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_MCardDialog[] = { + "MCCADGUI_MCardDialog\0\0AddMaterial()\0" + "DelMaterial()\0ModifyMaterial()\0onOK()\0" + "onApply()\0onCancel()\0onColorButton()\0" + "SaveXMLFile()\0LoadXMLFile()\0item,colume\0" + "ShowSelectedMaterial(QTreeWidgetItem*,int)\0" + "onMatEdited()\0" +}; + +void MCCADGUI_MCardDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI_MCardDialog *_t = static_cast(_o); + switch (_id) { + case 0: _t->AddMaterial(); break; + case 1: _t->DelMaterial(); break; + case 2: _t->ModifyMaterial(); break; + case 3: _t->onOK(); break; + case 4: _t->onApply(); break; + case 5: _t->onCancel(); break; + case 6: _t->onColorButton(); break; + case 7: _t->SaveXMLFile(); break; + case 8: _t->LoadXMLFile(); break; + case 9: _t->ShowSelectedMaterial((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; + case 10: _t->onMatEdited(); break; + default: ; + } + } +} + +const QMetaObjectExtraData MCCADGUI_MCardDialog::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI_MCardDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_MCCADGUI_MCardDialog, + qt_meta_data_MCCADGUI_MCardDialog, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_MCardDialog::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_MCardDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_MCardDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_MCardDialog)) + return static_cast(const_cast< MCCADGUI_MCardDialog*>(this)); + if (!strcmp(_clname, "Ui::MCCADGUI_MCardDialog")) + return static_cast< Ui::MCCADGUI_MCardDialog*>(const_cast< MCCADGUI_MCardDialog*>(this)); + return QDialog::qt_metacast(_clname); +} + +int MCCADGUI_MCardDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 11) + qt_static_metacall(this, _c, _id, _a); + _id -= 11; + } + return _id; +} +static const uint qt_meta_data_MCCADGUI_SetPropertyDialog[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 5, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 28, 27, 27, 27, 0x08, + 38, 27, 27, 27, 0x08, + 48, 27, 27, 27, 0x08, + 65, 27, 27, 27, 0x08, + 81, 27, 27, 27, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_SetPropertyDialog[] = { + "MCCADGUI_SetPropertyDialog\0\0onClose()\0" + "onApply()\0onEditMaterial()\0onColorButton()\0" + "onSelectChg()\0" +}; + +void MCCADGUI_SetPropertyDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI_SetPropertyDialog *_t = static_cast(_o); + switch (_id) { + case 0: _t->onClose(); break; + case 1: _t->onApply(); break; + case 2: _t->onEditMaterial(); break; + case 3: _t->onColorButton(); break; + case 4: _t->onSelectChg(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +const QMetaObjectExtraData MCCADGUI_SetPropertyDialog::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI_SetPropertyDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_MCCADGUI_SetPropertyDialog, + qt_meta_data_MCCADGUI_SetPropertyDialog, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_SetPropertyDialog::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_SetPropertyDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_SetPropertyDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_SetPropertyDialog)) + return static_cast(const_cast< MCCADGUI_SetPropertyDialog*>(this)); + if (!strcmp(_clname, "Ui::MCCADGUI_SetPropertyDialog")) + return static_cast< Ui::MCCADGUI_SetPropertyDialog*>(const_cast< MCCADGUI_SetPropertyDialog*>(this)); + return QDialog::qt_metacast(_clname); +} + +int MCCADGUI_SetPropertyDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 5) + qt_static_metacall(this, _c, _id, _a); + _id -= 5; + } + return _id; +} +static const uint qt_meta_data_MCCADGUI_ImportObjDialog[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 26, 25, 25, 25, 0x08, + 33, 25, 25, 25, 0x08, + 44, 25, 25, 25, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_ImportObjDialog[] = { + "MCCADGUI_ImportObjDialog\0\0onOK()\0" + "onCancel()\0onSelectChg()\0" +}; + +void MCCADGUI_ImportObjDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI_ImportObjDialog *_t = static_cast(_o); + switch (_id) { + case 0: _t->onOK(); break; + case 1: _t->onCancel(); break; + case 2: _t->onSelectChg(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +const QMetaObjectExtraData MCCADGUI_ImportObjDialog::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI_ImportObjDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_MCCADGUI_ImportObjDialog, + qt_meta_data_MCCADGUI_ImportObjDialog, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_ImportObjDialog::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_ImportObjDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_ImportObjDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_ImportObjDialog)) + return static_cast(const_cast< MCCADGUI_ImportObjDialog*>(this)); + if (!strcmp(_clname, "Ui::MCCADGUI_ImportObjDialog")) + return static_cast< Ui::MCCADGUI_ImportObjDialog*>(const_cast< MCCADGUI_ImportObjDialog*>(this)); + return QDialog::qt_metacast(_clname); +} + +int MCCADGUI_ImportObjDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } + return _id; +} +static const uint qt_meta_data_MCCADGUI_TransparencyDlg[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 26, 25, 25, 25, 0x08, + 42, 25, 25, 25, 0x08, + 63, 25, 25, 25, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_TransparencyDlg[] = { + "MCCADGUI_TransparencyDlg\0\0ClickOnCancel()\0" + "ValueHasChanged(int)\0accept()\0" +}; + +void MCCADGUI_TransparencyDlg::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI_TransparencyDlg *_t = static_cast(_o); + switch (_id) { + case 0: _t->ClickOnCancel(); break; + case 1: _t->ValueHasChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 2: _t->accept(); break; + default: ; + } + } +} + +const QMetaObjectExtraData MCCADGUI_TransparencyDlg::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI_TransparencyDlg::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_MCCADGUI_TransparencyDlg, + qt_meta_data_MCCADGUI_TransparencyDlg, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_TransparencyDlg::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_TransparencyDlg::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_TransparencyDlg::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_TransparencyDlg)) + return static_cast(const_cast< MCCADGUI_TransparencyDlg*>(this)); + return QDialog::qt_metacast(_clname); +} + +int MCCADGUI_TransparencyDlg::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } + return _id; +} +static const uint qt_meta_data_MCCADGUI_TransformDialog[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 2, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 26, 25, 25, 25, 0x08, + 36, 25, 25, 25, 0x08, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_TransformDialog[] = { + "MCCADGUI_TransformDialog\0\0onClose()\0" + "onApply()\0" +}; + +void MCCADGUI_TransformDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI_TransformDialog *_t = static_cast(_o); + switch (_id) { + case 0: _t->onClose(); break; + case 1: _t->onApply(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +const QMetaObjectExtraData MCCADGUI_TransformDialog::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI_TransformDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_MCCADGUI_TransformDialog, + qt_meta_data_MCCADGUI_TransformDialog, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_TransformDialog::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_TransformDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_TransformDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_TransformDialog)) + return static_cast(const_cast< MCCADGUI_TransformDialog*>(this)); + if (!strcmp(_clname, "Ui::MCCADGUI_TransformDialog")) + return static_cast< Ui::MCCADGUI_TransformDialog*>(const_cast< MCCADGUI_TransformDialog*>(this)); + return QDialog::qt_metacast(_clname); +} + +int MCCADGUI_TransformDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 2) + qt_static_metacall(this, _c, _id, _a); + _id -= 2; + } + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/MCCADGUI/MCCADGUI_Displayer.cxx b/src/MCCADGUI/MCCADGUI_Displayer.cxx new file mode 100644 index 0000000..392fd71 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Displayer.cxx @@ -0,0 +1,1273 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + +// + +#include "MCCADGUI_Displayer.h" +#include "MCCADGUI.h" +#include "MCCAD_Constants.h" + +#include +#include +#include +#include +#include +#include "utilities.h" +#include + +#include +#include +#include +#include + +#include +#include +#include CORBA_CLIENT_HEADER(MCCAD) +#include "MCCADGUI_DataObject.h" +#include +#include +#include + + + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + + + +// OCCT Includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +static inline int getViewManagerId( SALOME_View* theViewFrame) { + SUIT_ViewModel* aModel = dynamic_cast(theViewFrame); + SUIT_ViewManager* aViewMgr = 0; + if (aModel != 0) + aViewMgr = aModel->getViewManager(); + return ((aViewMgr == 0) ? -1 :aViewMgr->getGlobalId()); +} + + +MCCADGUI_Displayer::MCCADGUI_Displayer(/*SalomeApp_Study *st*/) +{ +// if( st ) +// myApp = dynamic_cast( st->application() ); +// else +// myApp = 0; + + /* Shading Color */ + SUIT_Session* session = SUIT_Session::session(); + SUIT_ResourceMgr* resMgr = session->resourceMgr(); + + QColor col = resMgr->colorValue( "MCCAD", "shading_color", QColor( 255, 0, 0 ) ); + myShadingColor = SalomeApp_Tools::color( col ); + + myDisplayMode = resMgr->integerValue("MCCAD", "display_mode", 0); + myHasDisplayMode = false; + +// int aType = resMgr->integerValue("MCCAD", "type_of_marker", (int)Aspect_TOM_PLUS); + myWidth = resMgr->integerValue("MCCAD", "edge_width", -1); + myIsosWidth = resMgr->integerValue("MCCAD", "isolines_width", -1); + +// myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType))); +// myScaleOfMarker = (resMgr->integerValue("MCCAD", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0; +// myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker)); + + myColor = -1; + // This color is used for shape displaying. If it is equal -1 then + // default color is used. +// myTexture = ""; + + myWidth = -1; +// myType = -1; + + myToActivate = true; + myTransparency = 0.0; + + // This parameter is used for activisation/deactivisation of objects to be displayed + +// #if OCC_VERSION_LARGE > 0x06050100 // Functionnality available only in OCCT 6.5.2 +// // Activate parallel vizualisation only for testing purpose +// // and if the corresponding env variable is set to 1 +// char* parallel_visu = getenv("PARALLEL_VISU"); +// if (parallel_visu && atoi(parallel_visu)) +// { +// MESSAGE("Parallel visualisation on"); +// BRepMesh_IncrementalMesh::SetParallelDefault(Standard_True); +// } +// #endif + + myViewFrame = 0; +} + +MCCADGUI_Displayer::~MCCADGUI_Displayer() +{ +} + +bool MCCADGUI_Displayer::canBeDisplayed( const QString& aEntry, const QString& viewer_type ) const +{ + QStringList es = aEntry.split( "_" ); + bool result = ( es[ 0 ] == "MCCADGUI" && es[ 1 ] != "root" &&viewer_type == SOCC_Viewer::Type() ); + return result; // Entry of an atom for sure +} + +//================================================================= +/*! + * MCCADGUI_Displayer::Display + * Display interactive object in the current viewer + */ +//================================================================= +void MCCADGUI_Displayer::Display( const QString& aEntry, + const bool updateViewer, + SALOME_View* theViewFrame ) +{ + SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); + if ( vf ) + { + SALOME_Prs* prs = buildPresentation( aEntry, vf ); + + if ( prs ) + { + vf->BeforeDisplay( this, prs ); + vf->Display( prs ); + vf->AfterDisplay( this, prs ); + + if ( updateViewer ) + vf->Repaint(); + + int aMgrId = getViewManagerId(vf); + SalomeApp_Study* aStudy = getStudy(); + aStudy->setObjectProperty(aMgrId, aEntry, MCCAD::propertyName( MCCAD::Visibility ), 1 ); + setVisibilityState(aEntry, Qtx::ShownState); + + delete prs; // delete presentation because displayer is its owner + } + } +} + + +//================================================================= +/*! + * MCCADGUI_Displayer::Erase + * Erase interactive object in the current viewer + */ +//================================================================= +void MCCADGUI_Displayer::Erase( const QString& aEntry, + const bool forced, + const bool updateViewer, + SALOME_View* theViewFrame ) +{ +// if ( theIO.IsNull() ) +// return; + + SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView(); + + if ( vf ) { + SALOME_Prs* prs = vf->CreatePrs( aEntry.toLatin1() ); + if ( prs ) { + vf->BeforeErase( this, prs ); + vf->Erase( prs, forced ); + vf->AfterErase( this, prs ); + if ( updateViewer ) + vf->Repaint(); + delete prs; // delete presentation because displayer is its owner + + int aMgrId = getViewManagerId(vf); + SalomeApp_Study* aStudy = getStudy(); + aStudy->setObjectProperty(aMgrId, aEntry,MCCAD:: propertyName( MCCAD::Visibility ), 0 ); + + setVisibilityState(aEntry, Qtx::HiddenState); + } + } +} + +//================================================================= +/*! + * MCCADGUI_Displayer::Redisplay + * Redisplay (erase and then display again) interactive object + * in the current viewer + */ +//================================================================= +void MCCADGUI_Displayer::Redisplay(const QString& aEntry, + const bool updateViewer ) +{ + // Remove the object permanently ( == true) + SUIT_Session* ses = SUIT_Session::session(); + SUIT_Application* app = ses->activeApplication(); + if ( app ) + { + SUIT_Desktop* desk = app->desktop(); + QList wnds = desk->windows(); + SUIT_ViewWindow* wnd; + QListIterator it( wnds ); + while ( it.hasNext() && (wnd = it.next()) ) + { + SUIT_ViewManager* vman = wnd->getViewManager(); + if ( vman ) + { + SUIT_ViewModel* vmodel = vman->getViewModel(); + if ( vmodel ) + { + SALOME_View* view = dynamic_cast(vmodel); + if ( view ) + { + if ( view->isVisible( datamodel()->findObjectIO(aEntry) ) || view == GetActiveView() ) + { + Erase( aEntry, true, false, view ); + Display( aEntry, updateViewer, view ); + } + } + } + } + } + } +} + +//================================================================= +/*! + * MCCADGUI_Displayer::BeforeDisplay + * Called before displaying of pars. Close local context + * [ Reimplemented from SALOME_Displayer ] + */ +//================================================================= +void MCCADGUI_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* ) +{ + SOCC_Viewer* vf = dynamic_cast( v ); + + if ( vf ) + { + Handle(AIS_InteractiveContext) ic = vf->getAISContext(); + if ( !ic.IsNull() ) + { + if ( ic->HasOpenedContext() ) + ic->CloseAllContexts(); + } + } +} + + + +void MCCADGUI_Displayer::AfterDisplay( SALOME_View* v, const SALOME_OCCPrs* p ) +{ + SalomeApp_Study* aStudy = getStudy(); + if (!aStudy) return; + SOCC_Viewer* vf = dynamic_cast( v ); + if ( vf && !p->IsNull() ) { + int aMgrId = getViewManagerId( vf ); + Handle(AIS_InteractiveContext) ic = vf->getAISContext(); + const SOCC_Prs* prs = dynamic_cast( p ); + if ( !ic.IsNull() && prs ) { + AIS_ListOfInteractive objects; + prs->GetObjects( objects ); + AIS_ListIteratorOfListOfInteractive it( objects ); + for ( ; it.More(); it.Next() ) { + Handle(MCCAD_AISShape) sh = Handle(MCCAD_AISShape)::DownCast( it.Value() ); + if ( sh.IsNull() ) continue; + Handle(SALOME_InteractiveObject) IO = sh->getIO(); + if ( IO.IsNull() ) continue; + PropMap aPropMap = aStudy->getObjectPropMap( aMgrId, IO->getEntry() ); + if ( aPropMap.contains( MCCAD::propertyName( MCCAD::Transparency ) ) ) { + double transparency = aPropMap.value(MCCAD:: propertyName( MCCAD:: Transparency )).toDouble(); + ic->SetTransparency( sh, transparency, true ); + } + } + } + } +} + +bool MCCADGUI_Displayer::isVisible(const QString & aEntry) +{ + bool res = false; + SALOME_View* view = MCCADGUI_Displayer::GetActiveView(); + if ( view ) + res = view->isVisible( datamodel()->findObjectIO(aEntry ) ); + return res; +} + + +//================================================================= +/*! + * MCCADGUI_Displayer::Update + * Update OCC presentaion + * [ Reimplemented from SALOME_Displayer ] + */ +//================================================================= +void MCCADGUI_Displayer::Update( SALOME_OCCPrs* prs ) +{ + SOCC_Prs* occPrs = dynamic_cast( prs ); + SalomeApp_Study* study = getStudy(); + + if ( !occPrs || myShape.IsNull() || !study ) + return; + + //from MCCADGUI_Displayer::update() + // processing for usual geometry presentation + // + + // if presentation is empty we try to create new one + if ( occPrs->IsNull() ) + { + // create presentation (specific for vectors) + Handle(MCCAD_AISShape) AISShape = /*( myType == GEOM_VECTOR ) ? new GEOM_AISVector( myShape, "" ) + :*/ new MCCAD_AISShape ( myShape, "" ); + // update shape properties + updateShapeProperties( AISShape, true ); + + // add shape to the presentation + occPrs->AddObject( AISShape ); + + // In accordance with ToActivate() value object will be activated/deactivated + // when it will be displayed + occPrs->SetToActivate( ToActivate() ); + + /* + * if ( AISShape->isTopLevel() && MCCAD_AISShape::topLevelDisplayMode() == MCCAD_AISShape::TopShowAdditionalWActor ) { + // 21671: EDF 1829 GEOM : Bring to front selected objects (continuation): + + // create additional wireframe shape + Handle(GEOM_TopWireframeShape) aWirePrs = new GEOM_TopWireframeShape(myShape); + aWirePrs->SetWidth(AISShape->Width()); + if ( !myIO.IsNull() ) { + aWirePrs->setIO( myIO ); + aWirePrs->SetOwner( myIO ); + } + + // add shape to the presentation + occPrs->AddObject( aWirePrs ); + } + */ + + } + // if presentation is found -> set again shape for it + else + { + AIS_ListOfInteractive IOList; + occPrs->GetObjects( IOList ); + AIS_ListIteratorOfListOfInteractive Iter( IOList ); + for ( ; Iter.More(); Iter.Next() ) + { + Handle(MCCAD_AISShape) AISShape = Handle(MCCAD_AISShape)::DownCast( Iter.Value() ); + if ( AISShape.IsNull() ) + continue; + + // re-set shape (it might be changed) + if ( AISShape->Shape() != myShape ) + AISShape->Set( myShape ); + + // update shape properties + updateShapeProperties( AISShape, false ); + + // force updating + AISShape->UpdateSelection(); + AISShape->SetToUpdate(); + } + } + +} + +SalomeApp_Study* MCCADGUI_Displayer::getStudy() const +{ + return dynamic_cast( app()->activeStudy() ); +} + +//================================================================= +/*! + * MCCADGUI_Displayer::SetColor + * Set color for shape displaying. If it is equal -1 then default color is used. + * Available values are from Quantity_NameOfColor enumeration + */ +//================================================================= +void MCCADGUI_Displayer::SetColor( const int color ) +{ + if ( color == -1 ) + UnsetColor(); + else + { + myColor = color; + myShadingColor = Quantity_Color( (Quantity_NameOfColor)color ); + } +} + +int MCCADGUI_Displayer::GetColor() const +{ + return myColor; +} + +bool MCCADGUI_Displayer::HasColor() const +{ + return myColor != -1; +} + +void MCCADGUI_Displayer::UnsetColor() +{ + myColor = -1; + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QColor col = resMgr->colorValue( "MCCAD", "shading_color", QColor( 255, 0, 0 ) ); + myShadingColor = SalomeApp_Tools::color( col ); +} + + +//================================================================= +/*! + * MCCADGUI_Displayer::SetWidth + * Set width of shape displaying. If it is equal -1 then default width is used. + */ +//================================================================= +void MCCADGUI_Displayer::SetWidth( const double width ) +{ + myWidth = width; +} + +double MCCADGUI_Displayer::GetWidth() const +{ + return myWidth; +} + +bool MCCADGUI_Displayer::HasWidth() const +{ + return myWidth != -1; +} + +void MCCADGUI_Displayer::UnsetWidth() +{ + myWidth = -1; +} + + +int MCCADGUI_Displayer::GetIsosWidth() const +{ + return myIsosWidth; +} + +void MCCADGUI_Displayer::SetIsosWidth(const int width) +{ + myIsosWidth = width; +} + +bool MCCADGUI_Displayer::HasIsosWidth() const +{ + return myIsosWidth != -1; +} + + +int MCCADGUI_Displayer::SetDisplayMode( const int theMode ) +{ + int aPrevMode = myDisplayMode; + if ( theMode != -1 ) { + myDisplayMode = theMode; + myHasDisplayMode = true; + } + else { + UnsetDisplayMode(); + } + return aPrevMode; +} + +int MCCADGUI_Displayer::GetDisplayMode() const +{ + return myDisplayMode; +} + +int MCCADGUI_Displayer::UnsetDisplayMode() +{ + int aPrevMode = myDisplayMode; + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + myDisplayMode = resMgr->integerValue( "MCCAD", "display_mode", 0 ); + myHasDisplayMode = false; + return aPrevMode; +} + +bool MCCADGUI_Displayer::HasDisplayMode() const +{ + return myHasDisplayMode; +} + +////================================================================= +///*! +// * MCCADGUI_Displayer::SetTransparency +// * Set Transparency of shape displaying. If it is equal 0.0 then default Transparency is used. +// */ +////================================================================= +//void MCCADGUI_Displayer::SetTransparency( const double Transparency ) +//{ +// myTransparency = Transparency; +//} + +//double MCCADGUI_Displayer::GetTransparency() const +//{ +// return myTransparency; +//} + +//bool MCCADGUI_Displayer::HasTransparency() const +//{ +// return myTransparency != 0.0; +//} + +//void MCCADGUI_Displayer::UnsetTransparency() +//{ +// myTransparency = 0.0; +//} + + + +void MCCADGUI_Displayer::setTransparency(const QStringList& entries, const double transparency ) +{ + myViewFrame = MCCADGUI_Displayer::GetActiveView(); + SalomeApp_Study* study = getStudy(); + if ( study && myViewFrame) { + SUIT_ViewModel* viewModel = dynamic_cast( myViewFrame ); + SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0; + int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1; + + if ( viewModel && viewId != -1 ) { + // get properties from the study + + for ( QStringList::const_iterator it = entries.begin(), last = entries.end(); it != last; it++ ) + { + MCCADGUI_DataObject * aObj = datamodel()->findObject(*it); + if (!aObj) { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return ; + } + //to see what it is the object + if (aObj->isPart()) { + PropMap aPropMap = study->getObjectPropMap( viewId, aObj->entry() ); + if ( aPropMap.contains( MCCAD::propertyName( MCCAD::Transparency ) ) ) + study->setObjectProperty(viewId,aObj->entry() , MCCAD::propertyName( MCCAD:: Transparency ), transparency); + Redisplay( aObj->entry().toLatin1(), /*updateviewer=*/true ); + } + else if (aObj->isGroup() ) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + PropMap aPropMap = study->getObjectPropMap( viewId, bObj->entry() ); + if ( aPropMap.contains( MCCAD::propertyName( MCCAD:: Transparency ) ) ) + study->setObjectProperty(viewId,bObj->entry() , MCCAD::propertyName( MCCAD:: Transparency ), transparency); + if (isVisible(bObj->entry())) + Redisplay( bObj->entry().toLatin1(), /*updateviewer=*/false ); + else + Display( bObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else if (aObj->isComponent()) { + MCCADGUI_DataObject * bObj = dynamic_cast (aObj->firstChild()); + for (int i=0; ichildCount(); i++) { + MCCADGUI_DataObject * cObj = dynamic_cast (bObj->firstChild()); + for (int j=0; jchildCount(); j++) { + + PropMap aPropMap = study->getObjectPropMap( viewId, cObj->entry() ); + if ( aPropMap.contains( MCCAD::propertyName( MCCAD:: Transparency ) ) ) + study->setObjectProperty(viewId,cObj->entry() , MCCAD::propertyName( MCCAD:: Transparency ), transparency); + if (isVisible(cObj->entry())) + Redisplay( cObj->entry().toLatin1(), /*updateviewer=*/false ); + else + Display( cObj->entry().toLatin1(), /*updateviewer=*/false, 0 ); + + cObj = dynamic_cast (cObj->nextBrother()); + } + bObj = dynamic_cast (bObj->nextBrother()); + } + } + else + MESSAGE("Cannot Redisplay this object!"); + } + } + } + +} + +/*! + * \brief MCCADGUI_Displayer::getTransparency + * get the transparency value of the object + * \param entry + * \return + */ +double MCCADGUI_Displayer::getTransparency( const QString& entry ) +{ + MCCADGUI_DataObject * aObj = datamodel()->findObject(entry); + if (aObj->isGroup()) return -1.0; + else if (aObj->isComponent()) return -1.0; + else { + myViewFrame = GetActiveView(); + SalomeApp_Study* study = getStudy(); + if ( study && myViewFrame) { + SUIT_ViewModel* viewModel = dynamic_cast( myViewFrame ); + SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0; + int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1; + + if ( viewModel && viewId != -1 ) { + // get properties from the study + PropMap aPropMap = study->getObjectPropMap( viewId, entry ); + if ( aPropMap.contains( MCCAD::propertyName( MCCAD:: Transparency ) ) ) { + return aPropMap.value(MCCAD::propertyName( MCCAD:: Transparency )).toDouble(); + } + } + } + return -1.; + } +} + + +//================================================================= +/*! + * MCCADGUI_Displayer::SetToActivate + * This method is used for activisation/deactivisation of objects to be displayed + */ +//================================================================= +void MCCADGUI_Displayer::SetToActivate( const bool toActivate ) +{ + myToActivate = toActivate; +} +bool MCCADGUI_Displayer::ToActivate() const +{ + return myToActivate; +} + +//================================================================= +/*! + * MCCADGUI_Displayer::clearTemporary + * Removes from selection temporary objects + */ +//================================================================= +void MCCADGUI_Displayer::clearTemporary( LightApp_SelectionMgr* theSelMgr ) +{ + SALOME_ListIO selected, toSelect; + theSelMgr->selectedObjects( selected ); + + for ( SALOME_ListIteratorOfListIO it( selected ) ; it.More(); it.Next() ) { + Handle(SALOME_InteractiveObject) io = it.Value(); + if ( !io.IsNull() && io->hasEntry() && strncmp( io->getEntry(), "TEMP_", 5 ) != 0 ) + toSelect.Append( it.Value() ); + } + + theSelMgr->setSelectedObjects( toSelect, true ); +} + +void MCCADGUI_Displayer::SetName( const char* theName ) +{ + myName = theName; +} + +void MCCADGUI_Displayer::UnsetName() +{ + myName = ""; +} + + + +/*! + * \brief build a Presentation of this object + * \param aEntry the object entry + * \param view the viewframe + * \return the presentations + */ +SALOME_Prs* MCCADGUI_Displayer::buildPresentation( const QString& aEntry, SALOME_View* theViewFrame ) +{ + /* + const int studyID = app()->studyId(); + if ( studyID == -1 ) + return NULL; + SOCC_Prs * prs = dynamic_cast ( LightApp_Displayer::buildPresentation( aEntry, view )); +// SALOME_Prs * prs = dynamic_cast ( LightApp_Displayer::buildPresentation( aEntry, view )); + if (!prs) return 0; + + //first obtain the shape + MCCADGUI_DataObject * aObj = datamodel()->findObject(aEntry); + if (!aObj) { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return NULL; + } + TopoDS_Shape aShape; + if (aObj->isPart()) + aShape = MCCADGUI_DataModel::Stream2Shape(*aObj->getPart()->getShapeStream()); + else + { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "Cannot display this object!")); + return NULL; + } + if (aShape.IsNull()) + { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "No shape to display!")); + return NULL; + } + + Handle(AIS_InteractiveObject) aAISshape = new AIS_Shape(aShape); + prs->AddObject(aAISshape); + return prs; + */ + + SALOME_Prs* prs = 0; + internalReset(); + myViewFrame = theViewFrame ? theViewFrame : GetActiveView(); + if ( !myViewFrame ) { + MESSAGE("cannot get activeview!") + return 0; + } + + prs = LightApp_Displayer::buildPresentation( aEntry, theViewFrame ); + if (!prs) { + MESSAGE("cannot generate presentation!") + return 0; + } + + Handle( SALOME_InteractiveObject ) theIO = new SALOME_InteractiveObject(); + theIO->setEntry( aEntry.toLatin1().constData() ); + + if ( !theIO.IsNull() ) + { + // set interactive object + setIO( theIO ); + // obtain the shape + MCCADGUI_DataObject * aObj = datamodel()->findObject(aEntry); + if (!aObj) { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "Cannot find the object in this study!")); + return NULL; + } + TopoDS_Shape aShape; + if (aObj->isPart()) + aShape = MCCADGUI_DataModel::Stream2Shape(*aObj->getPart()->getShapeStream()); + else + { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "Cannot display this object!")); + return NULL; + } + if (aShape.IsNull()) + { + SUIT_MessageBox::warning( app()->desktop(), QString("Warning"),QString( "No shape to display!")); + return NULL; + } + SetName(aObj->name().toLatin1()); + setShape( aShape ); +// myType = GeomObject->GetType(); + } + UpdatePrs( prs ); // Update presentation by using of the double dispatch + return prs; + +} + +//================================================================= +/*! + * MCCADGUI_Displayer::internalReset + * Resets internal data + * [internal] + */ +//================================================================= +void MCCADGUI_Displayer::internalReset() +{ + myIO.Nullify(); + myShape.Nullify(); +} + +void MCCADGUI_Displayer::setIO( const Handle(SALOME_InteractiveObject)& theIO ) +{ + myIO = theIO; +} + +//void MCCADGUI_Displayer::updateActor( SALOME_Actor* actor ) +//{ +// const int studyID = app()->studyId(); +// if ( actor && actor->hasIO() && studyID >= 0 ) { +// actor->Update(); +// } +//} + +void MCCADGUI_Displayer::setShape( const TopoDS_Shape& theShape ) +{ + myShape = theShape; +} + + +void MCCADGUI_Displayer::updateShapeProperties( const Handle(MCCAD_AISShape)& AISShape, bool create ) +{ + // check that shape is not null + if ( AISShape.IsNull() ) return; + + // check that study is active + SalomeApp_Study* study = getStudy(); + if ( !study ) return; + +// if ( myShape.ShapeType() != TopAbs_VERTEX && // fix pb with not displayed points +// !TopoDS_Iterator(myShape).More() ) +// return; // NPAL15983 (Bug when displaying empty groups) + + // set interactive object + + Handle( SALOME_InteractiveObject ) anIO; + + if ( !myIO.IsNull() ) { + AISShape->setIO( myIO ); + AISShape->SetOwner( myIO ); + anIO = myIO; + } + else if ( !myName.empty() ) { + // workaround to allow selection of temporary objects + static int tempId = 0; + anIO = new SALOME_InteractiveObject( QString( "TEMP_%1" ).arg( tempId++ ).toLatin1().data(), "MCCAD", myName.c_str() ); + AISShape->setIO( anIO ); + AISShape->SetOwner( anIO ); + } + + // flag: only vertex or compound of vertices is processed (specific handling) +// bool onlyVertex = myShape.ShapeType() == TopAbs_VERTEX || isCompoundOfVertices( myShape ); + // presentation study entry (empty for temporary objects like preview) + QString entry = !anIO.IsNull() ? QString( anIO->getEntry() ) : QString(); + // flag: temporary object + bool isTemporary = entry.isEmpty() || entry.startsWith( "TEMP_" ); + // currently active view window's ID (-1 if no active view) + int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1; + + // get presentation properties + PropMap propMap = getObjectProperties( study, entry, myViewFrame ); + + // Temporary staff: vertex must be infinite for correct visualization + AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines) + + // set material +// Material_Model material; + // if predefined color isn't set in displayer(via MCCADGUI_Displayer::SetColor() function) +// if( !HasColor() ) +// material.fromProperties( propMap.value( GEOM::MCCAD::propertyName( GEOM::Material ) ).toString() ); + // - set front material properties +// AISShape->SetCurrentFacingModel( Aspect_TOFM_FRONT_SIDE ); +// AISShape->SetMaterial( material.getMaterialOCCAspect( true ) ); + // - set back material properties +// AISShape->SetCurrentFacingModel( Aspect_TOFM_BACK_SIDE ); +// AISShape->SetMaterial( material.getMaterialOCCAspect( false ) ); + // - switch to default (both sides) facing mode +// AISShape->SetCurrentFacingModel( Aspect_TOFM_BOTH_SIDE ); + + // set colors + + // - shading color + if ( HasColor() ) { + // predefined color, manually set to displayer via MCCADGUI_Displayer::SetColor() function; + // we set it to the shape not taking into account material properties + AISShape->SetShadingColor( (Quantity_NameOfColor)GetColor() ); + } + else +// AISShape->SetShadingColor( Quantity_Color( Quantity_NOC_GOLDENROD )); + +// else if ( !material.isPhysical() ) + { + // shading color from properties is used only for non-physical materials + AISShape->SetShadingColor( SalomeApp_Tools::color( propMap.value( MCCAD::propertyName( MCCAD:: ShadingColor ) ).value() ) ); + } + + // - wireframe color + Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect(); + anAspect->SetColor( HasColor() ? (Quantity_NameOfColor)GetColor() : /*Quantity_Color( Quantity_NOC_GOLDENROD )*/ + SalomeApp_Tools::color( propMap.value( MCCAD::propertyName( MCCAD:: WireframeColor ) ).value() ) ); + AISShape->Attributes()->SetLineAspect( anAspect ); + + // - unfree boundaries color + anAspect = AISShape->Attributes()->UnFreeBoundaryAspect(); + anAspect->SetColor( HasColor() ? (Quantity_NameOfColor)GetColor() : /* Quantity_Color( Quantity_NOC_GOLDENROD )*/ + SalomeApp_Tools::color( propMap.value( MCCAD::propertyName( MCCAD:: WireframeColor ) ).value() ) ); + AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect ); + + // - free boundaries color + anAspect = AISShape->Attributes()->FreeBoundaryAspect(); + anAspect->SetColor( HasColor() ? (Quantity_NameOfColor)GetColor():/*Quantity_Color( Quantity_NOC_RED ) */ + SalomeApp_Tools::color( propMap.value( MCCAD::propertyName( MCCAD:: FreeBndColor ) ).value() ) ); + AISShape->Attributes()->SetFreeBoundaryAspect( anAspect ); + + // - standalone edges color + anAspect = AISShape->Attributes()->WireAspect(); + anAspect->SetColor( HasColor() ? (Quantity_NameOfColor)GetColor() : /*Quantity_Color( Quantity_NOC_GOLDENROD ) */ + SalomeApp_Tools::color( propMap.value( MCCAD::propertyName( MCCAD:: LineColor ) ).value() ) ); + AISShape->Attributes()->SetWireAspect( anAspect ); + + // - color for edges in shading+edges mode + AISShape->SetEdgesInShadingColor( SalomeApp_Tools::color( propMap.value( MCCAD::propertyName( MCCAD::OutlineColor ) ).value() ) ); + + // ??? + AISShape->storeBoundaryColors(); + + // set display mode + AISShape->SetDisplayMode( HasDisplayMode() ? + // predefined display mode, manually set to displayer via MCCADGUI_Displayer::SetDisplayMode() function + GetDisplayMode() : /*0 wireframe*/ + // display mode from properties + propMap.value( MCCAD::propertyName(MCCAD:: DisplayMode ) ).toInt() ); + + // set display vectors flag + AISShape->SetDisplayVectors( propMap.value( MCCAD::propertyName( MCCAD:: EdgesDirection ) ).toBool() ); + + + + // set iso properties + int uIsos = propMap.value( MCCAD::propertyName( MCCAD:: NbIsos ) ).toString().split( /*subSectionSeparator()*/ ":")[0].toInt(); + int vIsos = propMap.value( MCCAD::propertyName( MCCAD:: NbIsos ) ).toString().split(/* subSectionSeparator()*/":" )[1].toInt(); + Quantity_Color isosColor = SalomeApp_Tools::color( propMap.value( MCCAD::propertyName(MCCAD:: IsosColor ) ).value() ); + int isosWidth = propMap.value( MCCAD::propertyName( MCCAD:: IsosWidth ) ).toInt(); + Handle(Prs3d_IsoAspect) uIsoAspect = AISShape->Attributes()->UIsoAspect(); + Handle(Prs3d_IsoAspect) vIsoAspect = AISShape->Attributes()->VIsoAspect(); + uIsoAspect->SetColor( isosColor ); + uIsoAspect->SetWidth( isosWidth ); + uIsoAspect->SetNumber( uIsos ); + vIsoAspect->SetColor( isosColor ); + vIsoAspect->SetWidth( isosWidth ); + vIsoAspect->SetNumber( vIsos ); + AISShape->Attributes()->SetUIsoAspect( uIsoAspect ); + AISShape->Attributes()->SetVIsoAspect( vIsoAspect ); + + // set deflection coefficient + // ... to avoid to small values of the coefficient, its lower value is limited +// AISShape->SetOwnDeviationCoefficient( qMax( propMap.value( MCCAD::propertyName( Deflection ) ).toDouble(), minDeflection() ) ); + + // set texture +// if ( HasTexture() ) { +// // predefined display texture, manually set to displayer via MCCADGUI_Displayer::SetTexture() function +// AISShape->SetTextureFileName( TCollection_AsciiString( GetTexture().c_str() ) ); +// AISShape->SetTextureMapOn(); +// AISShape->DisableTextureModulate(); +// AISShape->SetDisplayMode( 3 ); +// } + + // set line width + AISShape->SetWidth( HasWidth() ? + // predefined line width, manually set to displayer via MCCADGUI_Displayer::SetLineWidth() function + GetWidth() : /*1*/ + // libe width from properties + propMap.value( MCCAD::propertyName( MCCAD:: LineWidth ) ).toInt() ); + + // set top-level flag + AISShape->setTopLevel( propMap.value( MCCAD::propertyName( MCCAD:: TopLevel ) ).toBool() ); + + // set point marker (for vertex / compound of vertices only) + /* if ( onlyVertex ) { + QStringList aList = propMap.value( GEOM::MCCAD::propertyName( GEOM::PointMarker ) ).toString().split( GEOM::subSectionSeparator() ); + if ( aList.size() == 2 ) { + // standard marker string contains "TypeOfMarker:ScaleOfMarker" + int aTypeOfMarker = aList[0].toInt(); + double aScaleOfMarker = (aList[1].toInt() + 1) * 0.5; + Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect(); + anAspect->SetScale( aScaleOfMarker ); + anAspect->SetTypeOfMarker( (Aspect_TypeOfMarker)( aTypeOfMarker-1 ) ); + anAspect->SetColor( HasColor() ? + // predefined color, manually set to displayer via MCCADGUI_Displayer::SetColor() function + (Quantity_NameOfColor)GetColor() : + // color from properties + SalomeApp_Tools::color( propMap.value( GEOM::MCCAD::propertyName( GEOM::PointColor ) ).value() ) ); + AISShape->Attributes()->SetPointAspect( anAspect ); + } + else if ( aList.size() == 1 ) { + // custom marker string contains "IdOfTexture" + int textureId = aList[0].toInt(); + Standard_Integer aWidth, aHeight; +#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1 + Handle(TColStd_HArray1OfByte) aTexture = +#else + Handle(Graphic3d_HArray1OfBytes) aTexture = +#endif + GeometryGUI::getTexture( study, textureId, aWidth, aHeight ); + if ( !aTexture.IsNull() ) { + static int TextureId = 0; + Handle(Prs3d_PointAspect) aTextureAspect = + new Prs3d_PointAspect( HasColor() ? + // predefined color, manually set to displayer via MCCADGUI_Displayer::SetColor() function + (Quantity_NameOfColor)GetColor() : + // color from properties + SalomeApp_Tools::color( propMap.value( GEOM::MCCAD::propertyName( GEOM::PointColor ) ).value() ), + ++TextureId, + aWidth, aHeight, + aTexture ); + AISShape->Attributes()->SetPointAspect( aTextureAspect ); + } + } + } + + +*/ + if ( create && !isTemporary && aMgrId != -1 ) { + // set properties to the study + study->setObjectPropMap( aMgrId, entry, propMap ); + } + + // AISShape->SetName(???); ??? necessary to set name ??? +} + + + + +PropMap MCCADGUI_Displayer::getObjectProperties( SalomeApp_Study* study, + const QString& entry, + SALOME_View* view ) +{ + // get default properties for the explicitly specified default view type + PropMap propMap = getDefaultPropertyMap(); + + if ( study && view ) { + SUIT_ViewModel* viewModel = dynamic_cast( view ); + SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0; + int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1; + + if ( viewModel && viewId != -1 ) { + // get properties from the study + PropMap storedMap = study->getObjectPropMap( viewId, entry ); + // overwrite default properties from stored ones (that are specified) + for ( int prop = MCCAD::Visibility; prop <= MCCAD::LastProperty; prop++ ) { + if ( storedMap.contains( MCCAD::propertyName( (MCCAD::Property)prop ) ) ) + propMap.insert( MCCAD::propertyName( (MCCAD::Property)prop ), + storedMap.value( MCCAD::propertyName( (MCCAD::Property)prop ) ) ); + } + // ... specific processing for color + // ... current implementation is to use same stored color for all aspects + // ... (TODO) possible future improvements about free boundaries, standalone edges etc colors can be here + if ( storedMap.contains( MCCAD::propertyName( MCCAD:: Color ) ) ) { + propMap.insert( MCCAD::propertyName( MCCAD:: ShadingColor ), storedMap.value( MCCAD::propertyName(MCCAD:: Color ) ) ); + propMap.insert( MCCAD::propertyName(MCCAD:: WireframeColor ), storedMap.value( MCCAD::propertyName( MCCAD:: Color ) ) ); + propMap.insert( MCCAD::propertyName(MCCAD:: LineColor ), storedMap.value( MCCAD::propertyName(MCCAD:: Color ) ) ); + propMap.insert( MCCAD::propertyName(MCCAD:: FreeBndColor ), storedMap.value( MCCAD::propertyName(MCCAD:: Color ) ) ); + propMap.insert( MCCAD::propertyName(MCCAD:: PointColor ), storedMap.value( MCCAD::propertyName(MCCAD:: Color ) ) ); + } + +/* if ( !entry.isEmpty() ) { + // get CORBA reference to geom object + _PTR(SObject) SO( study->studyDS()->FindObjectID( entry.toStdString() ) ); + if ( SO ) { + CORBA::Object_var object = GeometryGUI::ClientSObjectToObject( SO ); + if ( !CORBA::is_nil( object ) ) { + GEOM_Object_var geomObject = GEOM_Object::_narrow( object ); + // check that geom object has color properly set + bool hasColor = false; + SALOMEDS::Color aSColor = getColor( geomObject, hasColor ); + // set color from geometry object (only once, if it is not yet set in GUI) + // current implementation is to use same color for all aspects + // (TODO) possible future improvements about free boundaries, standalone edges etc colors can be here + if ( hasColor && !storedMap.contains( propertyName( Color ) ) ) { + QColor objColor = QColor::fromRgbF( aSColor.R, aSColor.G, aSColor.B ); + propMap.insert( propertyName( ShadingColor ), objColor ); + propMap.insert( propertyName( WireframeColor ), objColor ); + propMap.insert( propertyName( LineColor ), objColor ); + propMap.insert( propertyName( FreeBndColor ), objColor ); + propMap.insert( propertyName( PointColor ), objColor ); + } + + } + } + }*/ + } + } + return propMap; +} + +PropMap MCCADGUI_Displayer::getDefaultPropertyMap() +{ + PropMap propMap; + + // get resource manager + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + + // fill in the properties map with default values + + // - visibility (false by default) + propMap.insert( MCCAD::propertyName( MCCAD:: Visibility ), false ); + + // - nb isos (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: NbIsos ), + QString( "%1%2%3" ). + arg( resMgr->integerValue( "MCCAD", "iso_number_u", 1 ) ). + arg( /*subSectionSeparator()*/ ":"). + arg( resMgr->integerValue( "MCCAD", "iso_number_v", 1 ) ) ); + + // - transparency (opacity = 1-transparency) + propMap.insert( MCCAD::propertyName( MCCAD:: Transparency ), 0.0 ); + + // - display mode (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: DisplayMode ), + resMgr->integerValue( "MCCAD", "display_mode", 0 ) ); + + // - show edges direction flag (false by default) + propMap.insert( MCCAD::propertyName( MCCAD:: EdgesDirection ), false ); + + // - shading color (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: ShadingColor ), + colorFromResources( "shading_color", QColor( 255, 255, 0 ) ) ); + + // - wireframe color (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: WireframeColor ), + colorFromResources( "wireframe_color", QColor( 255, 255, 0 ) ) ); + + // - standalone edges color (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: LineColor ), + colorFromResources( "line_color", QColor( 255, 0, 0 ) ) ); + + // - free boundaries color (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: FreeBndColor ), + colorFromResources( "free_bound_color", QColor( 0, 255, 0 ) ) ); + + // - points color (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: PointColor ), + colorFromResources( "point_color", QColor( 255, 255, 0 ) ) ); + + // - isos color (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: IsosColor ), + colorFromResources( "isos_color", QColor( 200, 200, 200 ) ) ); + + // - outlines color (take default value from preferences) + propMap.insert( MCCAD::propertyName(MCCAD:: OutlineColor ), + colorFromResources( "edges_in_shading_color", QColor( 180, 180, 180 ) ) ); + + // - deflection coefficient (take default value from preferences) + propMap.insert( MCCAD::propertyName(MCCAD:: Deflection ), + resMgr->doubleValue( "MCCAD", "deflection_coeff", 0.001 ) ); + +// // - material (take default value from preferences) +// Material_Model material; +// material.fromResources( resMgr->stringValue( "MCCAD", "material", "Plastic" ) ); +// propMap.insert( MCCAD::propertyName( Material ), material.toProperties() ); + + // - edge width (take default value from preferences) + propMap.insert( MCCAD::propertyName( MCCAD:: LineWidth ), + resMgr->integerValue( "MCCAD", "edge_width", 1 ) ); + + // - isos width (take default value from preferences) + propMap.insert( MCCAD::propertyName(MCCAD:: IsosWidth ), + resMgr->integerValue( "MCCAD", "isolines_width", 1 ) ); + +// // - point marker (take default value from preferences) +// propMap.insert( MCCAD::propertyName(MCCAD:: PointMarker ), +// QString( "%1%2%3" ). +// arg( resMgr->integerValue( "MCCAD", "type_of_marker", 1 ) + 1 ). +// arg( subSectionSeparator() ). +// arg( resMgr->integerValue( "MCCAD", "marker_scale", 1 ) ) ); + + // - top-level flag (false by default) + propMap.insert( MCCAD::propertyName( MCCAD:: TopLevel ), false ); + + return propMap; +} + +QColor MCCADGUI_Displayer::colorFromResources( const QString& property, const QColor& defColor ) +{ + // VSR: this method can be improved in future: + // to improve performance, the default values from resource manager should be cached in the displayer + return SUIT_Session::session()->resourceMgr()->colorValue( "MCCAD", property, defColor ); +} + + + +//QString MCCADGUI_Displayer::MCCAD::propertyName( Property type ) +//{ +// static const char* names[] = { +// // visibility +// "Visibility", // VISIBILITY_PROP +// // transparency +// "Transparency", // TRANSPARENCY_PROP +// // display mode +// "DisplayMode", // DISPLAY_MODE_PROP +// // number of the iso lines (along u and v directions) +// "Isos", // ISOS_PROP +// // main / shading color +// "Color", // COLOR_PROP +// // "show edges direction" flag +// "VectorMode", // VECTOR_MODE_PROP +// // deflection coefficient +// "DeflectionCoeff", // DEFLECTION_COEFF_PROP +//// // point marker data +//// "MarkerType", // MARKER_TYPE_PROP +//// // material +//// "Material", // MATERIAL_PROP +// // general line width +// "EdgeWidth", // EDGE_WIDTH_PROP +// // isos width +// "IsosWidth", // ISOS_WIDTH_PROP +// // top-level flag +// "TopLevelFlag", // TOP_LEVEL_PROP +// // opacity +// "Opacity", // OPACITY_PROP +// // shading color +// "ShadingColor", // - +// // wireframe color +// "WireframeColor", // - +// // standalone edges color +// "LineColor", // - +// // free boundaries color +// "FreeBndColor", // - +// // points color +// "PointColor", // - +// // isos color +// "IsosColor", // - +// // outlines color +// "OutlineColor", // - +// }; +// return ( type >= Visibility && type <= LastProperty ) ? names[type] : QString(); +//} + + +LightApp_Application * MCCADGUI_Displayer::app() const +{ + return dynamic_cast( SUIT_Session::session()->activeApplication() ); //works?? +} + +MCCADGUI_DataModel * MCCADGUI_Displayer::datamodel() const +{ + if (app()) + return dynamic_cast (app()->activeModule()->dataModel()); + return 0; +} + diff --git a/src/MCCADGUI/MCCADGUI_Displayer.h b/src/MCCADGUI/MCCADGUI_Displayer.h new file mode 100644 index 0000000..4b80e90 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Displayer.h @@ -0,0 +1,167 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + +#ifndef MCCADGUI_DISPLAYER_HEADER +#define MCCADGUI_DISPLAYER_HEADER + +#include +#include +#include "MCCADGUI_DataModel.h" +#include +//#include +#include + +#include +#include + +#include "MCCAD_AISShape.hxx" + +class SALOME_View; +class SALOME_Prs; +class SALOME_OCCPrs; +class SALOME_OCCViewType; +class SALOME_ListIO; + + +class MCCADGUI_Displayer : public LightApp_Displayer +{ +public: + MCCADGUI_Displayer(/*SalomeApp_Study* st*/); + virtual ~MCCADGUI_Displayer(); + + virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const; +// void updateActor( SALOME_Actor* ); +// GEOM_Displayer * getGEOMDispalyer(); + + /* Display/Erase object methods */ + void Display ( const QString& aEntry, + const bool updateViewer = true, + SALOME_View* theViewFrame = 0 ); + void Erase ( const QString& aEntry, + const bool forced = false, + const bool updateViewer = true, + SALOME_View* theViewFrame = 0 ); + void Redisplay ( const QString& aEntry, + const bool updateViewer = true ); + + + + /* Reimplemented from SALOME_Displayer */ + virtual void Update( SALOME_OCCPrs* ); + SalomeApp_Study* getStudy() const; + + + + /* Set color for shape displaying. If it is equal -1 then default color is used. + Available values are from Quantity_NameOfColor enumeration */ + void SetColor ( const int ); + void UnsetColor(); + int GetColor () const; + bool HasColor () const; + + /* Set width for shape displaying. If it is equal -1 then default width is used. */ + void SetWidth ( const double ); + void UnsetWidth(); + double GetWidth () const; + bool HasWidth () const; + + /* Set width for iso-lines displaying. If it is equal -1 then default width is used. */ + void SetIsosWidth ( const int ); + int GetIsosWidth () const; + bool HasIsosWidth () const; + + /* Set display mode shape displaying. If it is equal -1 then display mode is used. */ + int SetDisplayMode( const int ); + int GetDisplayMode() const; + int UnsetDisplayMode(); + bool HasDisplayMode() const; + +// /* Set Transparency for shape displaying. If it is equal -1 then default Transparency is used. */ +// void SetTransparency ( const double ); +// void UnsetTransparency(); +// double GetTransparency () const; +// bool HasTransparency () const; + + void setTransparency(const QStringList& entries, const double transparency ); + double getTransparency( const QString& entry ); + + + /* Sets name - for temporary objects only */ + void SetName( const char* theName ); + void UnsetName(); + + /* This methos is used for activisation/deactivisation of objects to be displayed*/ + void SetToActivate( const bool ); + bool ToActivate() const; + + virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* ); + virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* ); + + bool isVisible (const QString & aEntry); + + +protected: + + virtual SALOME_Prs* buildPresentation(const QString& entry, SALOME_View* theViewFrame = 0 ); + + /* Resets internal data */ + void internalReset(); + + void clearTemporary( LightApp_SelectionMgr* theSelMgr ); + + /* Sets interactive object */ + void setIO( const Handle(SALOME_InteractiveObject)& theIO ); + /* Sets shape */ + void setShape( const TopoDS_Shape& theShape ); + void updateShapeProperties( const Handle(MCCAD_AISShape)&, bool ); + PropMap getObjectProperties( SalomeApp_Study*, const QString&, SALOME_View* = 0 ); + PropMap getDefaultPropertyMap(); + QColor colorFromResources( const QString&, const QColor& ); +// QString propertyName( Property ); + +protected: + + Handle(SALOME_InteractiveObject) myIO; + TopoDS_Shape myShape; + std::string myName; +// std::string myTexture; +// int myType; + SALOME_View* myViewFrame; + + // Attributes + Quantity_Color myShadingColor; + int myColor; + double myWidth; + int myIsosWidth; + bool myToActivate; + int myDisplayMode; + bool myHasDisplayMode; + double myTransparency; +// Aspect_TypeOfMarker myTypeOfMarker; +// double myScaleOfMarker; + +private: +// SalomeApp_Application* myApp; + +// GEOM_Displayer * myGEOM_Displayer; + LightApp_Application * app() const; + MCCADGUI_DataModel * datamodel() const; + +}; + +#endif diff --git a/src/MCCADGUI/MCCADGUI_Operation.cxx b/src/MCCADGUI/MCCADGUI_Operation.cxx new file mode 100644 index 0000000..2c07b8f --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Operation.cxx @@ -0,0 +1,113 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "MCCADGUI_Operation.h" +#include "MCCADGUI_DataModel.h" +#include "MCCADGUI.h" + +#include +#include +#include + +MCCADGUI_Operation::MCCADGUI_Operation() +: LightApp_Operation(), +// myDlg(0), + LastName("NewPart") +{ +} + +MCCADGUI_Operation::~MCCADGUI_Operation() +{ +// if ( myDlg ) +// delete myDlg; +} + +/*! Called when Operation is started. */ +void MCCADGUI_Operation::startOperation() +{ +// cout <<"run here!!!" <show(); +// MCCADGUI_TemplateDlg * aDlg = dynamic_cast (dlg()); +// aDlg->updateNameList(); +// } +} + +/*! Called when Operation is aborted. */ +void MCCADGUI_Operation::abortOperation() +{ + finish(); +} + +/*! Called when Operation is committed (normally ended). */ +void MCCADGUI_Operation::commitOperation() +{ + SUIT_MessageBox::information( module()->getApp()->desktop(), QString("Message"), + QString( "Operation Done.")); + finish(); +} + +/*! Called when Operation is done. Finalization steps. */ +void MCCADGUI_Operation::finish() +{ + if( dlg() ) + dlg()->hide(); + +// module()->getApp()->updateObjectBrowser(); //this method force updating datamodel, not used + +// module()->updateObjBrowser(false); + MCCADGUIModule()->updateObjBrowser(); +} + + +/*! Returns a Data Model. */ +MCCADGUI_DataModel* MCCADGUI_Operation::dataModel() const +{ + return dynamic_cast( module()->dataModel() ); +} + +/*! Returns MCCADGUI class instance. */ +MCCADGUI* MCCADGUI_Operation::MCCADGUIModule() const +{ + return dynamic_cast( module() ); +} + +/*! slot. Called when user presses OK button of the dialog (if it was set). */ +void MCCADGUI_Operation::onOk() +{ + onApply(); + commit(); +} + +/*! slot. Called when user presses Apply button of the dialog (if it was set). */ +void MCCADGUI_Operation::onApply() +{ +} + +/*! slot. Called when user presses Close button of the dialog (if it was set). */ +void MCCADGUI_Operation::onClose() +{ + commit(); +} diff --git a/src/MCCADGUI/MCCADGUI_Operation.h b/src/MCCADGUI/MCCADGUI_Operation.h new file mode 100644 index 0000000..cbb2d57 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Operation.h @@ -0,0 +1,55 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#ifndef MCCADGUI_OPERATION_H +#define MCCADGUI_OPERATION_H +#include +#include "MCCADGUI_Dialogs.h" + +class MCCADGUI_DataModel; +class MCCADGUI; + +class MCCADGUI_Operation: public LightApp_Operation +{ + Q_OBJECT + +public: + MCCADGUI_Operation(); + virtual ~MCCADGUI_Operation(); + +protected: + virtual void startOperation(); + virtual void abortOperation(); + virtual void commitOperation(); + virtual void finish(); + + MCCADGUI_DataModel* dataModel() const; + MCCADGUI* MCCADGUIModule() const; + +protected slots: + virtual void onOk(); + virtual void onApply(); + virtual void onClose(); + +protected: +// LightApp_Dialog* myDlg; +// MCCADGUI_TemplateDlg * myDlg; + QString LastName; + +}; + +#endif // MCCADGUI_OPERATION_H diff --git a/src/MCCADGUI/MCCADGUI_OperationImpl.cxx b/src/MCCADGUI/MCCADGUI_OperationImpl.cxx new file mode 100644 index 0000000..b46e060 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_OperationImpl.cxx @@ -0,0 +1,74 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "MCCADGUI_OperationImpl.h" +#include "MCCADGUI_Dialogs.h" +#include "MCCADGUI_DataModel.h" +#include "MCCADGUI.h" +#include "MCCADGUI_DataObject.h" + +#include +#include +#include +#include +#include +#include "utilities.h" + +#include + +////###############EditMaterialOp#############// + +//MCCADGUI_EditMaterialOp::MCCADGUI_EditMaterialOp() +//: MCCADGUI_Operation() +//// LastDir("/home/untitled.inp") + +//{ +// myDlg = 0; +//} + +//MCCADGUI_EditMaterialOp::~MCCADGUI_EditMaterialOp() +//{ +// if ( myDlg ) +// delete myDlg; +//} + +///*! Returns Operation dialog */ +//LightApp_Dialog* MCCADGUI_EditMaterialOp::dlg() const +//{ +// if ( !myDlg ) +// const_cast( this )->myDlg +// = new MCCADGUI_MCardDialog( module()->getApp()->desktop(), dataModel() ); +// return myDlg; +//} + +///*! Operation itself. */ +//void MCCADGUI_EditMaterialOp::startOperation() +//{ +// if( dlg() ) +// { +// disconnect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) ); +// disconnect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onClose() ) ); + +// connect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) ); +// connect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onClose() ) ); +// } + +// MCCADGUI_Operation::startOperation(); +// MCCADGUI_MCardDialog * aDialog = dynamic_cast (dlg()); +// aDialog->Refresh(); //load the existing material in this study +// aDialog->show(); +//} diff --git a/src/MCCADGUI/MCCADGUI_OperationImpl.h b/src/MCCADGUI/MCCADGUI_OperationImpl.h new file mode 100644 index 0000000..5c9416d --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_OperationImpl.h @@ -0,0 +1,45 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#ifndef MCCADGUI_OPERATIONIMPL_HXX +#define MCCADGUI_OPERATIONIMPL_HXX +#include "MCCADGUI_Operation.h" +#include "MCCADGUI_Dialogs.h" + + +////###############EditMaterialOp#############// +//class MCCADGUI_EditMaterialOp: public MCCADGUI_Operation +//{ +// Q_OBJECT +//public: +// MCCADGUI_EditMaterialOp(); +// virtual ~MCCADGUI_EditMaterialOp(); +// virtual LightApp_Dialog * dlg() const; + + +//protected: +// virtual void startOperation(); +//private: +// LightApp_Dialog * myDlg; +//// QString LastDir; +//}; + + + + + +#endif // MCCADGUI_OPERATIONIMPL_HXX diff --git a/src/MCCADGUI/MCCADGUI_OperationImpl_moc.cxx b/src/MCCADGUI/MCCADGUI_OperationImpl_moc.cxx new file mode 100644 index 0000000..e69de29 diff --git a/src/MCCADGUI/MCCADGUI_Operation_moc.cxx b/src/MCCADGUI/MCCADGUI_Operation_moc.cxx new file mode 100644 index 0000000..60a75f8 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Operation_moc.cxx @@ -0,0 +1,99 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'MCCADGUI_Operation.h' +** +** Created: Mon Aug 3 15:40:06 2015 +** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "MCCADGUI_Operation.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'MCCADGUI_Operation.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MCCADGUI_Operation[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 3, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 20, 19, 19, 19, 0x09, + 27, 19, 19, 19, 0x09, + 37, 19, 19, 19, 0x09, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_Operation[] = { + "MCCADGUI_Operation\0\0onOk()\0onApply()\0" + "onClose()\0" +}; + +void MCCADGUI_Operation::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI_Operation *_t = static_cast(_o); + switch (_id) { + case 0: _t->onOk(); break; + case 1: _t->onApply(); break; + case 2: _t->onClose(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +const QMetaObjectExtraData MCCADGUI_Operation::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI_Operation::staticMetaObject = { + { &LightApp_Operation::staticMetaObject, qt_meta_stringdata_MCCADGUI_Operation, + qt_meta_data_MCCADGUI_Operation, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_Operation::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_Operation::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_Operation::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_Operation)) + return static_cast(const_cast< MCCADGUI_Operation*>(this)); + return LightApp_Operation::qt_metacast(_clname); +} + +int MCCADGUI_Operation::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = LightApp_Operation::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 3) + qt_static_metacall(this, _c, _id, _a); + _id -= 3; + } + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/MCCADGUI/MCCADGUI_Selection.cxx b/src/MCCADGUI/MCCADGUI_Selection.cxx new file mode 100644 index 0000000..89c67d7 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Selection.cxx @@ -0,0 +1,280 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#include "MCCADGUI_Selection.h" +#include "MCCADGUI_Displayer.h" +#include "MCCADGUI.h" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + + +// VTK Includes +#include + +MCCADGUI_Selection::MCCADGUI_Selection() +{ +} + +MCCADGUI_Selection::~MCCADGUI_Selection() +{ +} + +QVariant MCCADGUI_Selection::parameter( const int index, const QString& p ) const +{ + if ( p == "isComponent" ) + return isComponent(index) ; + else if ( p == "isGroup" ) + return isGroup(index) ; + else if ( p == "isPart" ) + return isPart( index ); + else if (p == "isPartPastable") + return isPartPastable(); + else if (p == "isGroupPastable") + return isGroupPastable(); + else if (p == "hasBackup") + return hasBackup(index); + else if (p == "isDecomposed") + return isDecomposed(index); + else if (p == "isGEOMObj") + return isGEOMObj(index); + else if (p == "hasMesh") + return hasMesh(index); + else if (p == "isSMESHObj") + return isSMESHObj(index); + else if (p == "hasEnvelop") + return hasEnvelop(index); + else if (p == "isExplodible") + return isExplodible(index); + else if (p == "isMCCADObj") + return isMCCADObj(index); + else if (p == "isMCCADRootObj") + return isMCCADRootObj(index); + return LightApp_Selection::parameter( index, p ); +} + +bool MCCADGUI_Selection::isComponent( const int index) const +{ + //too slow!! +// if (!datamodel()->findObject(entry(index))) +// return false; +// if(datamodel()) +// return datamodel()->findObject(entry(index))->isComponent(); +// return false; + + QString aEntry = entry(index); + if (aEntry.contains("MCCADGUI") && (aEntry != "MCCADGUI_root") ) { + if (aEntry.count('_') == 1) return true; // component has entry like "MCCADGUI_1" + } + return false; +} + +bool MCCADGUI_Selection::isGroup( const int index) const +{ + //too slow!! +// if (!datamodel()->findObject(entry(index))) +// return false; +// if(datamodel()) +// return datamodel()->findObject(entry(index))->isGroup(); +// return false; + QString aEntry = entry(index); + if (aEntry.contains("MCCADGUI") && (aEntry.count('_') == 2) ) + return true; // group has entry like "MCCADGUI_1_1" + + return false; +} + +bool MCCADGUI_Selection::isPart ( const int index) const +{ + //too slow!! +// if (!datamodel()->findObject(entry(index))) +// return false; +// if (datamodel()) +// return datamodel()->findObject(entry(index))->isPart(); +// return false; + + QString aEntry = entry(index); + if (aEntry.contains("MCCADGUI") && (aEntry.count('_') == 3) ) + return true; // Part has entry like "MCCADGUI_1_1_1" + + return false; +} + +bool MCCADGUI_Selection::isPartPastable () const +{ + if(datamodel()) + return datamodel()->getPastePartsSize(); //0:false; >0 true + return 0; +} + +bool MCCADGUI_Selection::isGroupPastable () const +{ + if(datamodel()) + return datamodel()->getPasteGroupsSize(); //0:false; >0 true + return 0; +} + +bool MCCADGUI_Selection::isVisible( const int index ) const +{ + bool res = false; + SALOME_View* view = MCCADGUI_Displayer::GetActiveView(); + if ( view ) + res = view->isVisible( datamodel()->findObjectIO(entry(index)) ); + + return res; +} + + +bool MCCADGUI_Selection::hasBackup (const int index) const +{ + bool res = false; + MCCADGUI_DataObject * aObj = datamodel()->findObject(entry(index)); + if (!aObj) return false; + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil() ) + res = aPart->hasBackupShape(); + } + return res; +} + +bool MCCADGUI_Selection::isDecomposed (const int index ) const +{ + bool res = true; + MCCADGUI_DataObject * aObj = datamodel()->findObject(entry(index)); + if (!aObj) return true; + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil()) + res = aPart->getIsDecomposed(); + } + return res; +} + +bool MCCADGUI_Selection::isGEOMObj(const int index ) const +{ + const LightApp_DataOwner* owner = new LightApp_DataOwner (entry(index)); //get the owner + GEOM::GEOM_Object_var aGeomObj = datamodel()->getMCCADGUImodule()->getGeom(owner, true); + if (aGeomObj->_is_nil()) + return false; + else return true; +} + +bool MCCADGUI_Selection::hasMesh(const int index) const +{ + bool res = false; + MCCADGUI_DataObject * aObj = datamodel()->findObject(entry(index)); + if (!aObj) return false; + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil() ) + res = aPart->hasMesh(); + } + return res; +} + +bool MCCADGUI_Selection::isSMESHObj(const int index ) const +{ + const LightApp_DataOwner* owner = new LightApp_DataOwner (entry(index)); //get the owner + SMESH::SMESH_Mesh_var aSMESHObj = datamodel()->getMCCADGUImodule()->getSmesh(owner, true); + if (aSMESHObj->_is_nil()) + return false; + else return true; +} + +bool MCCADGUI_Selection::hasEnvelop(const int index) const +{ + bool res = false; + MCCADGUI_DataObject * aObj = datamodel()->findObject(entry(index)); + if (!aObj) return false; + if (aObj->isComponent()) { + MCCAD_ORB::Component_var aComponent = aObj->getComponent(); + if (!aComponent->_is_nil() ) + res = aComponent->hasEnvelop(); + } + return res; +} + +bool MCCADGUI_Selection::isExplodible (const int index) const +{ + bool res = false; + MCCADGUI_DataObject * aObj = datamodel()->findObject(entry(index)); + if (!aObj) return false; + if (aObj->isPart()) { + MCCAD_ORB::Part_var aPart = aObj->getPart(); + if (!aPart->_is_nil() ) + res = aPart->isExplodible(); + } + return res; +} + +bool MCCADGUI_Selection::isMCCADObj (const int index) const +{ + // it make things slow!! + //MCCADGUI_DataObject * aObj = datamodel()->findObject(entry(index)); + // if (!aObj) return false; + //else return true; + + if (entry(index).contains("MCCADGUI")) + return true; + else return false; +} + +bool MCCADGUI_Selection::isMCCADRootObj (const int index) const +{ + QString aEntry = entry(index); + if (aEntry == "MCCADGUI_root") return true; + else return false; +} + + LightApp_Application * MCCADGUI_Selection::app() const +{ + //header file should be included + return dynamic_cast( study()->application() ); +} + + MCCADGUI_DataModel * MCCADGUI_Selection::datamodel() const +{ + if (app()) + return dynamic_cast (app()->activeModule()->dataModel()); + return 0; +} + + diff --git a/src/MCCADGUI/MCCADGUI_Selection.h b/src/MCCADGUI/MCCADGUI_Selection.h new file mode 100644 index 0000000..1d27894 --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_Selection.h @@ -0,0 +1,55 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#ifndef MCCADGUI_SELECTION_HeaderFile +#define MCCADGUI_SELECTION_HeaderFile + +#include +#include "MCCADGUI_DataModel.h" + +class MCCADGUI_Selection : public LightApp_Selection +{ +public: + MCCADGUI_Selection(); + virtual ~MCCADGUI_Selection(); + QVariant parameter( const int index, const QString& ) const; + bool isComponent( const int index) const; + bool isGroup( const int index ) const; + bool isPart ( const int index) const; + bool isPartPastable () const; + bool isGroupPastable () const; + bool isVisible( const int index) const; + bool hasBackup (const int index ) const; + bool isDecomposed (const int index) const; + bool isGEOMObj (const int index ) const; + bool hasMesh (const int index) const; + bool isSMESHObj (const int index) const; + bool hasEnvelop (const int index) const; + bool isExplodible (const int index) const; + bool isMCCADObj (const int index) const; + bool isMCCADRootObj (const int index) const; + +private: + LightApp_Application * app() const; + MCCADGUI_DataModel * datamodel() const; + + +}; + +#endif diff --git a/src/MCCADGUI/MCCADGUI_moc.cxx b/src/MCCADGUI/MCCADGUI_moc.cxx new file mode 100644 index 0000000..0c51c6f --- /dev/null +++ b/src/MCCADGUI/MCCADGUI_moc.cxx @@ -0,0 +1,144 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'MCCADGUI.h' +** +** Created: Mon Aug 3 15:40:05 2015 +** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "MCCADGUI.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'MCCADGUI.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MCCADGUI[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 17, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: signature, parameters, type, tag, flags + 10, 9, 9, 9, 0x05, + + // slots: signature, parameters, type, tag, flags + 27, 9, 22, 9, 0x0a, + 57, 9, 22, 9, 0x0a, + 85, 9, 9, 9, 0x0a, + 110, 9, 9, 9, 0x0a, + 129, 9, 9, 9, 0x09, + 142, 9, 9, 9, 0x09, + 154, 9, 9, 9, 0x09, + 168, 9, 9, 9, 0x09, + 185, 9, 9, 9, 0x09, + 210, 9, 9, 9, 0x09, + 231, 9, 9, 9, 0x09, + 246, 9, 9, 9, 0x09, + 263, 9, 9, 9, 0x09, + 281, 9, 9, 9, 0x09, + 299, 9, 9, 9, 0x09, + 318, 9, 9, 9, 0x09, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI[] = { + "MCCADGUI\0\0selectChg()\0bool\0" + "deactivateModule(SUIT_Study*)\0" + "activateModule(SUIT_Study*)\0" + "studyClosed(SUIT_Study*)\0selectionChanged()\0" + "OnUnitTest()\0onProcess()\0onOperation()\0" + "onImportExport()\0onDisplayGEOMObjInPVIS()\0" + "OnDisplayerCommand()\0OnExperiment()\0" + "onEditMaterial()\0onSetProproties()\0" + "onImportGEOMObj()\0onImportSMESHObj()\0" + "onTransform()\0" +}; + +void MCCADGUI::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MCCADGUI *_t = static_cast(_o); + switch (_id) { + case 0: _t->selectChg(); break; + case 1: { bool _r = _t->deactivateModule((*reinterpret_cast< SUIT_Study*(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; + case 2: { bool _r = _t->activateModule((*reinterpret_cast< SUIT_Study*(*)>(_a[1]))); + if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; + case 3: _t->studyClosed((*reinterpret_cast< SUIT_Study*(*)>(_a[1]))); break; + case 4: _t->selectionChanged(); break; + case 5: _t->OnUnitTest(); break; + case 6: _t->onProcess(); break; + case 7: _t->onOperation(); break; + case 8: _t->onImportExport(); break; + case 9: _t->onDisplayGEOMObjInPVIS(); break; + case 10: _t->OnDisplayerCommand(); break; + case 11: _t->OnExperiment(); break; + case 12: _t->onEditMaterial(); break; + case 13: _t->onSetProproties(); break; + case 14: _t->onImportGEOMObj(); break; + case 15: _t->onImportSMESHObj(); break; + case 16: _t->onTransform(); break; + default: ; + } + } +} + +const QMetaObjectExtraData MCCADGUI::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MCCADGUI::staticMetaObject = { + { &SalomeApp_Module::staticMetaObject, qt_meta_stringdata_MCCADGUI, + qt_meta_data_MCCADGUI, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI)) + return static_cast(const_cast< MCCADGUI*>(this)); + return SalomeApp_Module::qt_metacast(_clname); +} + +int MCCADGUI::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = SalomeApp_Module::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 17) + qt_static_metacall(this, _c, _id, _a); + _id -= 17; + } + return _id; +} + +// SIGNAL 0 +void MCCADGUI::selectChg() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} +QT_END_MOC_NAMESPACE diff --git a/src/MCCADGUI/MCCAD_AISShape.cxx b/src/MCCADGUI/MCCAD_AISShape.cxx new file mode 100644 index 0000000..35fe4c7 --- /dev/null +++ b/src/MCCADGUI/MCCAD_AISShape.cxx @@ -0,0 +1,490 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + +// GEOM OBJECT : interactive object for Geometry entities visualization +// File : MCCAD_AISShape.cxx +// Author : Nicolas REJNERI +// Module : GEOM + +/*! + \class MCCAD_AISShape MCCAD_AISShape.hxx + \brief .... +*/ + +#include "MCCAD_AISShape.ixx" +#include "SALOME_InteractiveObject.hxx" +//#include "GEOM_AISVector.hxx" + +// Open CASCADE Includes +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include + +MCCAD_AISShape::TopLevelDispMode MCCAD_AISShape::myTopLevelDm = MCCAD_AISShape::TopKeepCurrent; +Quantity_Color MCCAD_AISShape::myTopLevelColor; + + +static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj, + const Handle(AIS_InteractiveContext)& theIC, + SelectMgr_IndexedMapOfOwner& theMap ) +{ + if ( theObj.IsNull() || theIC.IsNull() ) + return; + + TColStd_ListOfInteger modes; + theIC->ActivatedModes( theObj, modes ); + + TColStd_ListIteratorOfListOfInteger itr( modes ); + for (; itr.More(); itr.Next() ) { + int m = itr.Value(); + if ( !theObj->HasSelection( m ) ) + continue; + + Handle(SelectMgr_Selection) sel = theObj->Selection( m ); + + for ( sel->Init(); sel->More(); sel->Next() ) { + Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive(); + if ( entity.IsNull() ) + continue; + + Handle(SelectMgr_EntityOwner) owner = + Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId()); + if ( !owner.IsNull() ) + theMap.Add( owner ); + } + } +} + +static void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap, + const TopoDS_Shape& aMainShape, + const SelectMgr_IndexedMapOfOwner& anAllMap, + SelectMgr_IndexedMapOfOwner& aToHiliteMap ) +{ + TopTools_IndexedMapOfShape aMapOfShapes; + TopExp::MapShapes(aMainShape, aMapOfShapes); + + for ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) { + Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(anAllMap( i )); + if ( anOwner.IsNull() || !anOwner->HasShape() ) + continue; + + const TopoDS_Shape& aSubShape = anOwner->Shape(); + Standard_Integer aSubShapeId = aMapOfShapes.FindIndex( aSubShape ); + if ( !aSubShapeId || !aIndexMap.Contains( aSubShapeId ) ) + continue; + + if ( !aToHiliteMap.Contains( anOwner ) ) + aToHiliteMap.Add( anOwner ); + } +} + +MCCAD_AISShape::MCCAD_AISShape(const TopoDS_Shape& shape, + const Standard_CString aName) + : SALOME_AISShape(shape), myName(aName), myDisplayVectors(false) +{ + myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD ); + myPrevDisplayMode = 0; + storeBoundaryColors(); + + + myEdgesInShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD ); + + myUIsoNumber = -1; + myVIsoNumber = -1; + + myTopLevel = Standard_False; + Graphic3d_MaterialAspect aMatAspect; + if ( !HasMaterial() ) { + aMatAspect.SetAmbient( 0.5 ); + aMatAspect.SetDiffuse( 0.5 ); + aMatAspect.SetEmissive( 0.5 ); + aMatAspect.SetShininess(0.5 ); + aMatAspect.SetSpecular( 0.5 ); + + myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(aMatAspect); + myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(aMatAspect); + } +} + +void MCCAD_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){ + SetOwner( io ); +} + +Handle(SALOME_InteractiveObject) MCCAD_AISShape::getIO(){ + Handle(SALOME_InteractiveObject) IO; + if ( !GetOwner().IsNull() ) + IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() ); + return IO; +} + +Standard_Boolean MCCAD_AISShape::hasIO(){ + return !getIO().IsNull(); +} + +void MCCAD_AISShape::setName(const Standard_CString aName) +{ + myName = aName; + + Handle(SALOME_InteractiveObject) IO = getIO(); + if ( !IO.IsNull() ) + IO->setName(aName); +} + +Standard_CString MCCAD_AISShape::getName(){ + return myName.ToCString(); +} + +void MCCAD_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, + const Handle(Prs3d_Presentation)& aPrs, + const Standard_Integer aMode) +{ + if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL + + Handle(AIS_InteractiveContext) anIC = GetContext(); + + // StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode; + bool isTopLev = isTopLevel() && switchTopLevel(); + switch (aMode) { + case 0://StdSelect_DM_Wireframe: + { + restoreIsoNumbers(); + // Restore wireframe edges colors + restoreBoundaryColors(); + if(isTopLev) { + SetColor(topLevelColor()); + Handle(Prs3d_LineAspect) anAspect = Attributes()->WireAspect(); + anAspect->SetColor( topLevelColor() ); + Attributes()->SetWireAspect( anAspect ); + } + StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer); + break; + } + case 1://StdSelect_DM_Shading: + { + restoreIsoNumbers(); + shadingMode(aPresentationManager, aPrs, aMode); + // Store wireframe edges colors + storeBoundaryColors(); + break; + } + case 3: //StdSelect_DM_HLR: + { + if(!isTopLev) + AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode); + else + shadingMode(aPresentationManager, aPrs, AIS_Shaded); + break; + } + } + + if ( aMode == ShadingWithEdges ) { + // Temporary store number of iso lines in order to recover its later + // when display mode is achnged to 'Wirefame' or 'Shading'. + // Iso lines are not displayed in 'Shading with edges' mode. + storeIsoNumbers(); + + // Reset number of iso lines to 0 + resetIsoNumbers(); + + //Shaded faces + shadingMode(aPresentationManager, aPrs, AIS_Shaded); + + // Store wireframe edges colors + storeBoundaryColors(); + + // Coloring edges + Handle(Prs3d_LineAspect) anAspect = myDrawer->UnFreeBoundaryAspect(); + anAspect->SetColor( myEdgesInShadingColor ); + myDrawer->SetUnFreeBoundaryAspect( anAspect ); + + anAspect = myDrawer->FreeBoundaryAspect(); + anAspect->SetColor( myEdgesInShadingColor ); + myDrawer->SetFreeBoundaryAspect( anAspect ); + + // Add edges to presentation + StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer); + } + +// if (isShowVectors()) +// { +// const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector)); +// TopExp_Explorer Exp ( myshape, TopAbs_EDGE ); +// for ( ; Exp.More(); Exp.Next() ) { +// TopoDS_Vertex aV1, aV2; +// TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current()); +// if ( !isVector ) +// // draw curve direction (issue 0021087) +// anEdgeE.Orientation( TopAbs_FORWARD ); + +// if ( anEdgeE.IsNull() ) continue; + +// TopExp::Vertices(anEdgeE, aV1, aV2); +// gp_Pnt aP1 = BRep_Tool::Pnt(aV1); +// gp_Pnt aP2 = BRep_Tool::Pnt(aV2); + +// double fp,lp; +// gp_Vec aDirVec; +// Handle(Geom_Curve) C = BRep_Tool::Curve(anEdgeE,fp,lp); + +// if ( C.IsNull() ) continue; + +// if ( anEdgeE.Orientation() == TopAbs_FORWARD ) +// C->D1(lp, aP2, aDirVec); +// else { +// C->D1(fp, aP1, aDirVec); +// aP2 = aP1; +// } + +// GeomAdaptor_Curve aAdC; +// aAdC.Load(C, fp, lp); +// Standard_Real aDist = GCPnts_AbscissaPoint::Length(aAdC, fp, lp); + +// if (aDist > gp::Resolution()) { +// gp_Dir aDir; +// if ( anEdgeE.Orientation() == TopAbs_FORWARD ) +// aDir = aDirVec; +// else +// aDir = -aDirVec; + +// Prs3d_Arrow::Draw(aPrs, aP2, aDir, M_PI/180.*5., aDist/10.); +// } +// } +// } + // aPrs->ReCompute(); // for hidden line recomputation if necessary... +} + +void MCCAD_AISShape::SetShadingColor(const Quantity_Color &aCol) +{ + myShadingColor = aCol; +} + +void MCCAD_AISShape::SetEdgesInShadingColor(const Quantity_Color &aCol) +{ + myEdgesInShadingColor = aCol; +} + +void MCCAD_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, + const Standard_Boolean aHighlight ) +{ + Handle(AIS_InteractiveObject) anObj = this; + Handle(AIS_InteractiveContext) anIC = GetContext(); + if ( anIC.IsNull() || !anIC->HasOpenedContext() ) + return; + + Standard_Boolean isAutoHilight = anIC->AutomaticHilight(); + anIC->SetAutomaticHilight( false ); + + anIC->ClearSelected( false ); + + if ( aHighlight ) { + SelectMgr_IndexedMapOfOwner anAllMap, aToHiliteMap; + + // Get entity owners for all activated selection modes + getEntityOwners( anObj, anIC, anAllMap ); + + // Convert into the map of owners to highlight/unhighlight + indicesToOwners( aIndexMap, Shape(), anAllMap, aToHiliteMap ); + + + for ( Standard_Integer i = 1, n = aToHiliteMap.Extent(); i <= n; i++ ) + anIC->AddOrRemoveSelected( aToHiliteMap( i ), false ); + } + + anIC->SetAutomaticHilight( isAutoHilight ); + anIC->HilightSelected( false ); +} + +void MCCAD_AISShape::SetDisplayVectors(bool isDisplayed) +{ + myDisplayVectors = isDisplayed; +} + +void MCCAD_AISShape::shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, + const Handle(Prs3d_Presentation)& aPrs, + const Standard_Integer aMode) +{ + myDrawer->ShadingAspect()->Aspect()->SetDistinguishOn(); + + Graphic3d_MaterialAspect aMatAspect(Graphic3d_NOM_PLASTIC); + aMatAspect.SetTransparency(Transparency()); + Graphic3d_MaterialAspect currentFrontMaterial = myDrawer->ShadingAspect()->Aspect()->FrontMaterial(); + Graphic3d_MaterialAspect currentBackMaterial = myDrawer->ShadingAspect()->Aspect()->BackMaterial(); + myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial( isTopLevel() ? aMatAspect : currentFrontMaterial ); + myDrawer->ShadingAspect()->Aspect()->SetBackMaterial ( isTopLevel() ? aMatAspect : currentBackMaterial ); + + if( isTopLevel() && switchTopLevel() ) + myDrawer->ShadingAspect()->SetColor( topLevelColor() ); + else { + if(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().MaterialType( Graphic3d_MATERIAL_ASPECT )) + myDrawer->ShadingAspect()->SetColor(myShadingColor); + else + myDrawer->ShadingAspect()->SetColor(myDrawer->ShadingAspect()->Aspect()->FrontMaterial().AmbientColor()); + } + + // PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces + //StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer); + AIS_Shape::Compute(aPresentationManager, aPrs, aMode); +} + +void MCCAD_AISShape::storeIsoNumbers() +{ + myUIsoNumber = myDrawer->UIsoAspect()->Number(); + myVIsoNumber = myDrawer->VIsoAspect()->Number(); +} + +void MCCAD_AISShape::restoreIsoNumbers() +{ + if ( myUIsoNumber > 0 ) { + // Restore number of U iso lines + Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect(); + anAspect->SetNumber( myUIsoNumber ); + myDrawer->SetUIsoAspect( anAspect ); + } + + if ( myVIsoNumber > 0 ) { + // Restore number of V iso lines + Handle(Prs3d_IsoAspect) anAspect = myDrawer->VIsoAspect(); + anAspect->SetNumber( myVIsoNumber ); + myDrawer->SetVIsoAspect( anAspect ); + } +} + +void MCCAD_AISShape::resetIsoNumbers() +{ + Handle(Prs3d_IsoAspect) anAspect = myDrawer->UIsoAspect(); + anAspect->SetNumber( 0 ); + myDrawer->SetUIsoAspect( anAspect ); + + anAspect = myDrawer->VIsoAspect(); + anAspect->SetNumber( 0 ); + myDrawer->SetVIsoAspect( anAspect ); +} + +void MCCAD_AISShape::storeBoundaryColors() +{ + Aspect_TypeOfLine aLT; + Standard_Real aW; + + myDrawer->FreeBoundaryAspect()->Aspect()->Values( myFreeBoundaryColor, aLT, aW); + myDrawer->UnFreeBoundaryAspect()->Aspect()->Values( myUnFreeBoundaryColor, aLT, aW); +} + +void MCCAD_AISShape::restoreBoundaryColors() +{ + Handle(Prs3d_LineAspect) anAspect = myDrawer->FreeBoundaryAspect(); + anAspect->SetColor( myFreeBoundaryColor ); + myDrawer->SetFreeBoundaryAspect( anAspect ); + + anAspect = myDrawer->UnFreeBoundaryAspect(); + anAspect->SetColor( myUnFreeBoundaryColor ); + myDrawer->SetUnFreeBoundaryAspect( anAspect ); +} + + +Standard_Boolean MCCAD_AISShape::isTopLevel() { + return myTopLevel; +} + +void MCCAD_AISShape::setTopLevel(Standard_Boolean f) { + if(f) { + if(f != myTopLevel) + myPrevDisplayMode = DisplayMode(); + Standard_Integer dm; + switch(topLevelDisplayMode()) { + case TopKeepCurrent : dm = myPrevDisplayMode; break; + case TopWireFrame : dm = AIS_WireFrame; break; + case TopShadingWithEdges : dm = ShadingWithEdges; break; + default : dm = AIS_Shaded; break; + } + SetDisplayMode(dm); + } else { + if(f != myTopLevel) + SetDisplayMode(myPrevDisplayMode); + } + myTopLevel = f; +} + +void MCCAD_AISShape::setPrevDisplayMode(const Standard_Integer mode) { + myPrevDisplayMode = mode; +} + +Quantity_Color MCCAD_AISShape::topLevelColor() { + return myTopLevelColor; +} + +void MCCAD_AISShape::setTopLevelColor(const Quantity_Color c) { + myTopLevelColor = c; +} + +MCCAD_AISShape::TopLevelDispMode MCCAD_AISShape::topLevelDisplayMode() { + return myTopLevelDm; +} +void MCCAD_AISShape::setTopLevelDisplayMode(const MCCAD_AISShape::TopLevelDispMode dm) { + myTopLevelDm = dm; +} + +Standard_Boolean MCCAD_AISShape::switchTopLevel() { + return myTopLevelDm != TopShowAdditionalWActor; +} + +Standard_Boolean MCCAD_AISShape::toActivate() { + return Standard_True; +} diff --git a/src/MCCADGUI/MCCAD_AISShape.hxx b/src/MCCADGUI/MCCAD_AISShape.hxx new file mode 100644 index 0000000..b0a1959 --- /dev/null +++ b/src/MCCADGUI/MCCAD_AISShape.hxx @@ -0,0 +1,178 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + +// +#ifndef _MCCAD_AISShape_HeaderFile +#define _MCCAD_AISShape_HeaderFile + +#include "GEOM_OBJECT_defs.hxx" + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_MCCAD_AISShape_HeaderFile +#include "Handle_MCCAD_AISShape.hxx" +#endif + +#ifndef _Handle_SALOME_InteractiveObject_HeaderFile +#include "Handle_SALOME_InteractiveObject.hxx" +#endif +#ifndef _Standard_CString_HeaderFile +#include +#endif +#ifndef _SALOME_AISShape_HeaderFile +#include "SALOME_AISShape.hxx" +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _Handle_PrsMgr_PresentationManager3d_HeaderFile +#include +#endif +#ifndef _Handle_Prs3d_Presentation_HeaderFile +#include +#endif + +#include + +#include +#include + +class PrsMgr_PresentationManager3d; +class Prs3d_Presentation; +class SALOME_InteractiveObject; +class TopoDS_Shape; + +class MCCAD_AISShape : public SALOME_AISShape { + +public: + + //! Enumeration of display modes + typedef enum { + //WireFrame, //!< the same as AIS_WireFrame + //Shading, //!< the same as AIS_Shaded + ShadingWithEdges = AIS_Shaded+1, //!< shading with edges + TexturedShape = ShadingWithEdges+1 //!< the same as AIS_ExactHLR + } DispMode; + + //! Enumeration of top level display modes + typedef enum { + TopShowAdditionalWActor = 0, + TopKeepCurrent, //!< Keep current display mode + TopWireFrame, + TopShading, + TopShadingWithEdges, + } TopLevelDispMode; + + + inline void* operator new(size_t,void* anAddress) + { + return anAddress; + } + inline void* operator new(size_t size) + { + return Standard::Allocate(size); + } + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } +// inline void operator delete(void *anAddress, size_t size) +// { +// if (anAddress) Standard::Free((Standard_Address&)anAddress,size); +// } + // Methods PUBLIC + // + MCCAD_AISShape(const TopoDS_Shape& shape, const Standard_CString aName); + Standard_Boolean hasIO() ; + void setIO(const Handle(SALOME_InteractiveObject)& name) ; + void setName(const Standard_CString aName) ; + Standard_CString getName() ; + Standard_Boolean isTopLevel(); + void setTopLevel(Standard_Boolean); + Handle_SALOME_InteractiveObject getIO() ; + void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight ); + ~MCCAD_AISShape(); + + void SetShadingColor(const Quantity_Color &aCol); + void SetEdgesInShadingColor(const Quantity_Color &aCol); + void SetDisplayVectors(bool isShow); + + virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, + const Handle(Prs3d_Presentation)& aPresentation, + const Standard_Integer aMode = 0) ; + + virtual bool isShowVectors () { return myDisplayVectors; } + virtual Standard_Boolean switchTopLevel(); + virtual Standard_Boolean toActivate(); + + // Type management + // + friend Handle_Standard_Type& MCCAD_AISShape_Type_(); + const Handle(Standard_Type)& DynamicType() const; + Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + + void storeIsoNumbers(); + void restoreIsoNumbers(); + void resetIsoNumbers(); + + void storeBoundaryColors(); + + static Quantity_Color topLevelColor(); + static void setTopLevelColor(const Quantity_Color c); + + static TopLevelDispMode topLevelDisplayMode(); + static void setTopLevelDisplayMode(const TopLevelDispMode dm); + + void setPrevDisplayMode(const Standard_Integer mode); + Standard_Integer prevDisplayMode() const {return myPrevDisplayMode;} + + +protected: + void shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, + const Handle(Prs3d_Presentation)& aPrs, + const Standard_Integer aMode); + + void restoreBoundaryColors(); + + Quantity_Color myShadingColor; + + Quantity_Color myFreeBoundaryColor; + Quantity_Color myUnFreeBoundaryColor; + + Quantity_Color myEdgesInShadingColor; + + int myUIsoNumber; + int myVIsoNumber; + +private: + TCollection_AsciiString myName; + bool myDisplayVectors; + Standard_Boolean myTopLevel; + Standard_Integer myPrevDisplayMode; + + static TopLevelDispMode myTopLevelDm; + static Quantity_Color myTopLevelColor; +}; + + +// other inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/MCCADGUI/MCCAD_AISShape.ixx b/src/MCCADGUI/MCCAD_AISShape.ixx new file mode 100644 index 0000000..127240a --- /dev/null +++ b/src/MCCADGUI/MCCAD_AISShape.ixx @@ -0,0 +1,91 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// GEOM OBJECT : interactive object for Geometry entities visualization +// File : MCCAD_AISShape.ixx +// Module : GEOM +// +#include "MCCAD_AISShape.jxx" + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +MCCAD_AISShape::~MCCAD_AISShape() {} + + + +Standard_EXPORT Handle_Standard_Type& MCCAD_AISShape_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(SALOME_AISShape); + if ( aType1.IsNull()) aType1 = STANDARD_TYPE(SALOME_AISShape); + static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_Shape); + if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_Shape); + static Handle_Standard_Type aType3 = STANDARD_TYPE(AIS_InteractiveObject); + if ( aType3.IsNull()) aType3 = STANDARD_TYPE(AIS_InteractiveObject); + static Handle_Standard_Type aType4 = STANDARD_TYPE(SelectMgr_SelectableObject); + if ( aType4.IsNull()) aType4 = STANDARD_TYPE(SelectMgr_SelectableObject); + static Handle_Standard_Type aType5 = STANDARD_TYPE(PrsMgr_PresentableObject); + if ( aType5.IsNull()) aType5 = STANDARD_TYPE(PrsMgr_PresentableObject); + static Handle_Standard_Type aType6 = STANDARD_TYPE(MMgt_TShared); + if ( aType6.IsNull()) aType6 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType7 = STANDARD_TYPE(Standard_Transient); + if ( aType7.IsNull()) aType7 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,aType7,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("MCCAD_AISShape", + sizeof(MCCAD_AISShape), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(MCCAD_AISShape) Handle(MCCAD_AISShape)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(MCCAD_AISShape) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(MCCAD_AISShape))) { + _anOtherObject = Handle(MCCAD_AISShape)((Handle(MCCAD_AISShape)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& MCCAD_AISShape::DynamicType() const +{ + return STANDARD_TYPE(MCCAD_AISShape) ; +} +Standard_Boolean MCCAD_AISShape::IsKind(const Handle(Standard_Type)& AType) const +{ + return (STANDARD_TYPE(MCCAD_AISShape) == AType || SALOME_AISShape::IsKind(AType)); +} +Handle_MCCAD_AISShape::~Handle_MCCAD_AISShape() {} + diff --git a/src/MCCADGUI/MCCAD_AISShape.jxx b/src/MCCADGUI/MCCAD_AISShape.jxx new file mode 100644 index 0000000..54c59ac --- /dev/null +++ b/src/MCCADGUI/MCCAD_AISShape.jxx @@ -0,0 +1,41 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// GEOM OBJECT : interactive object for Geometry entities visualization +// File : MCCAD_AISShape.jxx +// Module : GEOM +// +#ifndef _GEOM_InteractiveObject_HeaderFile +#include "GEOM_InteractiveObject.hxx" +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _MCCAD_AISShape_HeaderFile +#include "MCCAD_AISShape.hxx" +#endif +#ifndef _PrsMgr_PresentationManager3d_HeaderFile +#include +#endif +#ifndef _Prs3d_Presentation_HeaderFile +#include +#endif diff --git a/src/MCCADGUI/MCCAD_Constants.cxx b/src/MCCADGUI/MCCAD_Constants.cxx new file mode 100644 index 0000000..fb48fa2 --- /dev/null +++ b/src/MCCADGUI/MCCAD_Constants.cxx @@ -0,0 +1,98 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#include "MCCAD_Constants.h" + + +namespace MCCAD +{ + /*! + \brief Get minimal allowed value for deflection coefficient + */ + double minDeflection() + { + return 1e-06; // DEFLECTION_MIN + } + + /*! + \brief Get character used to separate parameter names + */ + QString sectionSeparator() + { + return "_"; // NAME_SEPARATOR + } + + /*! + \brief Get character used to separate numeric parameter values (color = r:g:b) + */ + QString subSectionSeparator() + { + return ":"; // DIGIT_SEPARATOR + } + + + QString propertyName( Property type ) + { + static const char* names[] = { + // visibility + "Visibility", // VISIBILITY_PROP + // transparency + "Transparency", // TRANSPARENCY_PROP + // display mode + "DisplayMode", // DISPLAY_MODE_PROP + // number of the iso lines (along u and v directions) + "Isos", // ISOS_PROP + // main / shading color + "Color", // COLOR_PROP + // "show edges direction" flag + "VectorMode", // VECTOR_MODE_PROP + // deflection coefficient + "DeflectionCoeff", // DEFLECTION_COEFF_PROP + // // point marker data + // "MarkerType", // MARKER_TYPE_PROP + // // material + // "Material", // MATERIAL_PROP + // general line width + "EdgeWidth", // EDGE_WIDTH_PROP + // isos width + "IsosWidth", // ISOS_WIDTH_PROP + // top-level flag + "TopLevelFlag", // TOP_LEVEL_PROP + // opacity + "Opacity", // OPACITY_PROP + // shading color + "ShadingColor", // - + // wireframe color + "WireframeColor", // - + // standalone edges color + "LineColor", // - + // free boundaries color + "FreeBndColor", // - + // points color + "PointColor", // - + // isos color + "IsosColor", // - + // outlines color + "OutlineColor", // - + }; + return ( type >= Visibility && type <= LastProperty ) ? names[type] : QString(); + } + + +} //namespace diff --git a/src/MCCADGUI/MCCAD_Constants.h b/src/MCCADGUI/MCCAD_Constants.h new file mode 100644 index 0000000..e9446fc --- /dev/null +++ b/src/MCCADGUI/MCCAD_Constants.h @@ -0,0 +1,64 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// + + +#ifndef MCCAD_CONSTANTS_H +#define MCCAD_CONSTANTS_H + +#include + +//#include "GEOM_OBJECT_defs.hxx" + +namespace MCCAD +{ + +enum Property { + Visibility, + Transparency, + DisplayMode, + NbIsos, + Color, + EdgesDirection, + Deflection, + // PointMarker, + // Material, + LineWidth, + IsosWidth, + TopLevel, + LastStudyProperty = TopLevel, + Opacity, + ShadingColor, + WireframeColor, + LineColor, + FreeBndColor, + PointColor, + IsosColor, + OutlineColor, + LastProperty = OutlineColor, +}; + +double minDeflection(); + +QString sectionSeparator(); +QString subSectionSeparator(); + +QString propertyName( Property ); + +} //namespace + +#endif // diff --git a/src/MCCADGUI/MCCAD_icons.qm b/src/MCCADGUI/MCCAD_icons.qm new file mode 100644 index 0000000..f8008a5 Binary files /dev/null and b/src/MCCADGUI/MCCAD_icons.qm differ diff --git a/src/MCCADGUI/MCCAD_msg_en.qm b/src/MCCADGUI/MCCAD_msg_en.qm new file mode 100644 index 0000000..f96a9dc Binary files /dev/null and b/src/MCCADGUI/MCCAD_msg_en.qm differ diff --git a/src/MCCADGUI/MCardDialog.ui b/src/MCCADGUI/MCardDialog.ui new file mode 100644 index 0000000..9c2acb0 --- /dev/null +++ b/src/MCCADGUI/MCardDialog.ui @@ -0,0 +1,293 @@ + + + MCCADGUI_MCardDialog + + + + 0 + 0 + 895 + 624 + + + + + 0 + 0 + + + + + 895 + 624 + + + + + 0 + 0 + + + + Material management + + + + + 10 + 40 + 180 + 510 + + + + false + + + 1 + + + true + + + false + + + false + + + + Material + + + + + + + 240 + 40 + 71 + 27 + + + + + + + 390 + 40 + 91 + 27 + + + + + + + 560 + 40 + 161 + 27 + + + + + + + 210 + 40 + 31 + 31 + + + + + 10 + + + + ID: + + + + + + 320 + 40 + 81 + 31 + + + + + 10 + + + + Density: + + + + + + 500 + 40 + 61 + 31 + + + + + 10 + + + + Name: + + + + + + 200 + 75 + 671 + 475 + + + + + + + 520 + 580 + 81 + 27 + + + + Delete + + + + + + 10 + 580 + 93 + 27 + + + + Import + + + + + + 120 + 580 + 93 + 27 + + + + Export + + + + + + 610 + 580 + 81 + 27 + + + + Apply + + + + + + 700 + 580 + 81 + 27 + + + + OK + + + + + + 790 + 580 + 81 + 27 + + + + Cancel + + + + + + 730 + 40 + 61 + 31 + + + + + 10 + + + + Color: + + + + + + 780 + 40 + 51 + 27 + + + + QPushButton { +background:rgb(255, 255, 0) +} + + + + + + + + + 200 + 560 + 361 + 16 + + + + + 10 + + + + *Fill the above box to add or edit material properties. + + + + + + diff --git a/src/MCCADGUI/S_McCadGDMLWriter.cxx b/src/MCCADGUI/S_McCadGDMLWriter.cxx new file mode 100644 index 0000000..5825931 --- /dev/null +++ b/src/MCCADGUI/S_McCadGDMLWriter.cxx @@ -0,0 +1,473 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "S_McCadGDMLWriter.hxx" +#include "S_McCadSolid.hxx" +#include "MCCADGUI.h" +#include "MCCADGUI_DataModel.h" +#include "utilities.h" +//SALOME +#include +#include +#include +#include + +//OCC +#include +#include +#include +#include +#include +#include +#include +#include +#include + +S_McCadGDMLWriter::S_McCadGDMLWriter() +{ +} +S_McCadGDMLWriter::~S_McCadGDMLWriter() +{ +} +void S_McCadGDMLWriter:: PrintDefine(QDomElement & ParentElement) +{ + //print the define element + QDomElement theElement = m_Doc.createElement(("define")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + + //check if decomposed, if not don't need to decomposed it + if (!pSolid->GetisDecomposed()) + continue; + + QString aName (pSolid->GetName().ToCString()) ; //get the solid name + //print the polyhedron for the whole pSolid + PrintPolyhedron(theElement, pSolid, aName); + + int ConvexSolidCnt = pSolid->GetConvexSolidList().size(); + if (ConvexSolidCnt == 1) continue; //only one convex solid: print only once + for(int j = 0; j < ConvexSolidCnt; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName /*; + if (ConvexSolidCnt == 1) bName = aName; + else bName*/ = aName + QString("_%1").arg(j); + PrintPolyhedron(theElement, pConvexSolid, bName); + } + } + + //print the world box polyhedron + //!! COMMENT OUT because the worldBox is failed in genearted surface in McCad + //!! Using a hug box instead! +// McCadVoidCell * pVoid = getWholeBntBox(); +// PrintPolyhedron(theElement,pVoid, "WorldBox"); + +} + + +void S_McCadGDMLWriter::PrintMaterial(QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("materials")); + ParentElement.appendChild(theElement); + + //get the studyID and engine + int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); + int n = aMaterialList->length(); + if (!n){ + MESSAGE("No material data!"); + return ; + } + + for(int i = 0; i < n; i++) + { + MCCAD_ORB::Material_var aMaterial = (*aMaterialList)[i]; + + //create a Material element + QDomElement MaterialElement = m_Doc.createElement(("material")); + MaterialElement.setAttribute("name", QString("Mat_%1").arg(aMaterial->getName())); //add "Mat_" to avoid repeated name in GDML + //create the density element + QDomElement DensityElement = m_Doc.createElement(("D")); + DensityElement.setAttribute("value", aMaterial->getDensity()); + DensityElement.setAttribute("unit", "g/cm3"); //We use g/cm3 as defaut unit, in future should be selectable. + MaterialElement.appendChild(DensityElement); +// QDomText txtMatcard = m_Doc.createTextNode(aMaterial->GetMatCard()); +// MaterialElement.appendChild(txtMatcard); + theElement.appendChild(MaterialElement); + } + +} + + +void S_McCadGDMLWriter::PrintSolids (QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("solids")); + ParentElement.appendChild(theElement); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + //print convex solid + QString aName (pSolid->GetName().ToCString()) ; //get the solid name + int SubSolidCount =0; + + //if undecomposed solid, print as tessellated solid + //if has compound, explode it and make a union solid at the end + if (!pSolid->GetisDecomposed()) + { + TopoDS_Shape aTmpShape = pSolid->GetUndecompsedSolid(); + if( aTmpShape.ShapeType() == TopAbs_COMPSOLID || aTmpShape.ShapeType() == TopAbs_COMPOUND ) + { + + TopExp_Explorer exp; + //first we want to see how many solid inside + for(exp.Init(aTmpShape,TopAbs_SOLID); exp.More(); exp.Next()) + SubSolidCount ++; + //then print the solids + int j=0; + for(exp.Init(aTmpShape,TopAbs_SOLID); exp.More(); exp.Next()) { + TopoDS_Shape bTmpShape = TopoDS::Solid(exp.Current()); + QString bName; + if (SubSolidCount == 1) bName = aName; + else bName = aName + QString("_%1").arg(j); + PrintTessellatedSolid(theElement, bTmpShape, bName); + j++; + } + + //make boolean operation to Union + if ( SubSolidCount == 1) + continue; //no need for the union + else { + PrintHalfSpaceBoolean(theElement, aName, SubSolidCount, false); //don't print polyhedron + } + + } + else if (aTmpShape.ShapeType() == TopAbs_SOLID){ + PrintTessellatedSolid(theElement, aTmpShape, aName); + } + else { + MESSAGE("The part "<GetName().ToCString()<<"contains no solid!!"); + continue; + } + } + // for decomposed solid, normal procedures + else + { + SubSolidCount = pSolid->GetConvexSolidList().size(); + for(int j = 0; j < SubSolidCount; j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); + //name for the convex solid, if only one convex solid, using the aName without surfix + QString bName; + if (SubSolidCount == 1) bName = aName; + else bName = aName + QString("_%1").arg(j); + PrintHalfSpaceSolid(theElement, pConvexSolid, bName); + } + //make boolean operation to Union + if ( SubSolidCount == 1) + continue; //no need for the union + else { + PrintHalfSpaceBoolean(theElement, aName, SubSolidCount); + } + } + } + + //print the world solid + //first we make this box + //!! COMMENT OUT because the worldBox is failed in genearted surface in McCad + //!! Using a hug box instead! +// McCadVoidCell * pVoid = getWholeBntBox(); +// PrintHalfSpaceSolid(theElement, pVoid, "WorldBox"); +// delete pVoid; + + PrintWorldBox(theElement); + +} + + +void S_McCadGDMLWriter::PrintTessellatedSolid(QDomElement & ParentElement, const TopoDS_Shape & aShape, const QString aName) +{ + //creat the Tessellated solid node + QDomElement theElement = m_Doc.createElement(("tessellated")); + ParentElement.appendChild(theElement); + + theElement.setAttribute("name", aName); + theElement.setAttribute("lunit", "cm"); + +/* These are not working because m_Doc does not append the "gdml" element yet! + //get the node + QDomElement docElem = m_Doc.documentElement(); +// QDomNodeList DefineNodeList = docElem.elementsByTagName("define"); //get the list of node with tag name "define", actually only one + QDomNodeList DefineNodeList = docElem.elementsByTagName("gdml"); + if (DefineNodeList.size() == 0) { + cout<<"cannot find gdml node!"<resourceMgr(); + Standard_Real aDeflection= resMgr->doubleValue("MCCAD","STL_Coefficient", 0.001); + + TopoDS_Shape theShape = aShape; + double theDeflection = aDeflection;//temperory + MeshShape(theShape, theDeflection); + + //get the node list and facet list + //we create the nodes and facets element for the gdml directly here + + int NodeTotal=0; //each time a face is mesh, the total node will be updated + TopExp_Explorer ex; + TopLoc_Location aLoc; + for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) + { + const TopoDS_Face& aFace = TopoDS::Face(ex.Current()); + Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); + if(aPoly.IsNull()) { + return; + } + //get the transformation + gp_Trsf myTransf; + Standard_Boolean identity = true; + if(!aLoc.IsIdentity()){ + identity = false; + myTransf = aLoc.Transformation(); + } + //get the nodes and facets + const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); + Standard_Integer nbNodesInFace = aPoly->NbNodes(); + for( int i = 1; i <= nbNodesInFace; i++) { // i start with 1 ?? + gp_Pnt P = Nodes(i); + if(!identity) + P.Transform(myTransf); + //make a position element under the node + + QDomElement aNodeElement = m_Doc.createElement(("position")); + aNodeElement.setAttribute("name", aName + QString("_v%1").arg(i + NodeTotal)); + aNodeElement.setAttribute("unit", "cm"); + aNodeElement.setAttribute("x",P.X()/10); //unit cm + aNodeElement.setAttribute("y",P.Y()/10); + aNodeElement.setAttribute("z",P.Z()/10); + DefineElement.appendChild(aNodeElement); + } + + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); + Standard_Integer nbTriInFace = aPoly->NbTriangles(); + for( int i = 1; i <= nbTriInFace; i++){ // i start with 1 ?? + // Get the triangle + Standard_Integer N1,N2,N3; + Triangles(i).Get(N1,N2,N3); + N1 += NodeTotal ; //node id should start from 1 + N2 += NodeTotal ; + N3 += NodeTotal ; + + QDomElement aFacetElement = m_Doc.createElement(("triangular")); + //IMPORTANT!! this must do otherwise the visualization will be wrong! + if (aFace.Orientation() == TopAbs_REVERSED) + { + aFacetElement.setAttribute("vertex1",aName + QString("_v%1").arg(N3));// reverse the order if face is reversed!! + aFacetElement.setAttribute("vertex2",aName + QString("_v%1").arg(N2)); + aFacetElement.setAttribute("vertex3",aName + QString("_v%1").arg(N1)); + } + else + { + aFacetElement.setAttribute("vertex1",aName + QString("_v%1").arg(N1)); + aFacetElement.setAttribute("vertex2",aName + QString("_v%1").arg(N2)); + aFacetElement.setAttribute("vertex3",aName + QString("_v%1").arg(N3)); + } + + theElement.appendChild(aFacetElement); + } + NodeTotal += nbNodesInFace; //MUST DO!! + } + +} + +McCadVoidCell * S_McCadGDMLWriter::getWholeBntBox() +{ + Bnd_Box bnd_box; + McCadGeomData * pData = m_pManager->GetGeomData(); + + for (unsigned int i = 0; i < pData->m_ConvexSolidList.size(); i++) + { + McCadConvexSolid *pSolid = pData->m_ConvexSolidList[i]; + assert(pSolid); + BRepBndLib::Add((TopoDS_Shape)(*pSolid),bnd_box); // Add each convex solid into bundary box + } + + //also add the undecomposed solid + for (unsigned int i=0; im_SolidList.size(); i++) + { + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + if (!pSolid->GetisDecomposed()) + BRepBndLib::Add(pSolid->GetUndecompsedSolid(),bnd_box); // Add each convex solid into bundary box + } + + bnd_box.SetGap(1.0); // Set the gap between the boundary box and material solids + Standard_Real dXmin, dYmin, dZmin, dXmax, dYmax, dZmax; + bnd_box.Get(dXmin, dYmin, dZmin, dXmax, dYmax, dZmax); + + gp_Pnt bnd_max_pnt(dXmax,dYmax,dZmax); + gp_Pnt bnd_min_pnt(dXmin,dYmin,dZmin); + + // Create the boundary box. + McCadVoidCell *pVoid = new McCadVoidCell(BRepPrimAPI_MakeBox(bnd_min_pnt,bnd_max_pnt).Solid()); + pVoid->SetBntBox(dXmin,dYmin,dZmin,dXmax,dYmax,dZmax); + return pVoid; +} + + +void S_McCadGDMLWriter::CheckMaterialNames() +{ + + //get the studyID and engine + int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); + int n = aMaterialList->length(); + if (!n){ + MESSAGE("No material data!"); + return ; + } + + vector aNameList; + + for(int i = 0; i < n; i++) + { + MCCAD_ORB::Material_var aMaterial = (*aMaterialList)[i]; + aNameList.push_back(aMaterial->getName()); + } + CheckNames(aNameList); + for(int i = 0; i < n; i++) + { + MCCAD_ORB::Material_var aMaterial = (*aMaterialList)[i]; + aMaterial->setName(aNameList.at(i).toStdString().c_str()); + } + +} + + +void S_McCadGDMLWriter::PrintStructure(QDomElement & ParentElement) +{ + QDomElement theElement = m_Doc.createElement(("structure")); + + //get the data + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + //get the studyID and engine + int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + + + //loop the solid list + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + QString aSolidName (pSolid->GetName().ToCString()) ; //get the solid name + + //get the material name + QString aMatName = "unknown"; //if cannot find the material or no material, set name to "unknown" + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, pSolid->GetID()); + if (!aMaterial->_is_nil()) + aMatName = aMaterial->getName(); //using the mat id in the solid to get mat name + //create the volume element + PrintVolume(theElement, aMatName, aSolidName); + } + + //create the world volume + QDomElement WorldVolElement = m_Doc.createElement(("volume")); + WorldVolElement.setAttribute("name", QString("World")); + QDomElement MaterialRefElement = m_Doc.createElement(("materialref")); + MaterialRefElement.setAttribute("ref", "Air"); + QDomElement SolidRefElement = m_Doc.createElement("solidref"); + SolidRefElement.setAttribute("ref","WorldBox"); //ref to the solid named "WorldBox" + WorldVolElement.appendChild(MaterialRefElement); + WorldVolElement.appendChild(SolidRefElement); + + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + McCadSolid * pSolid = pData->m_SolidList.at(i); + assert(pSolid); + QString aSolidName (pSolid->GetName().ToCString()) ; //get the solid name + + //create the physcial volume element + PrintPhysicalVolume(WorldVolElement, aSolidName); + } + + theElement.appendChild(WorldVolElement); + ParentElement.appendChild(theElement); +} + + diff --git a/src/MCCADGUI/S_McCadGDMLWriter.hxx b/src/MCCADGUI/S_McCadGDMLWriter.hxx new file mode 100644 index 0000000..6b4fa5f --- /dev/null +++ b/src/MCCADGUI/S_McCadGDMLWriter.hxx @@ -0,0 +1,50 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#ifndef S_MCCADGDMLWRITER_HXX +#define S_MCCADGDMLWRITER_HXX +#include "../MCCAD/McCadMcVoid/McCadGDMLWriter.hxx" + +class S_McCadGDMLWriter : public McCadGDMLWriter +{ +public: + S_McCadGDMLWriter(); + ~S_McCadGDMLWriter(); + + //Print element, means print the polyhedron for visualization purpose + //here it check if the solid is undecomposed, then jump it. + virtual void PrintDefine(QDomElement & ParentElement); + + + virtual void PrintMaterial(QDomElement & ParentElement); + + virtual void PrintSolids (QDomElement & ParentElement); + + void PrintTessellatedSolid(QDomElement & ParentElement, const TopoDS_Shape & aShape, const QString aName); + + virtual McCadVoidCell * getWholeBntBox(); + + virtual void CheckMaterialNames(); + + virtual void PrintStructure(QDomElement & ParentElement); + + + + +}; + +#endif // S_MCCADGDMLWRITER_HXX diff --git a/src/MCCADGUI/S_McCadGeomData.cxx b/src/MCCADGUI/S_McCadGeomData.cxx new file mode 100644 index 0000000..747ab22 --- /dev/null +++ b/src/MCCADGUI/S_McCadGeomData.cxx @@ -0,0 +1,290 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "S_McCadGeomData.hxx" +#include "S_McCadSolid.hxx" +#include "MCCADGUI.h" +#include "MCCADGUI_DataModel.h" +#include "utilities.h" +#include "../MCCAD/McCadTool/McCadConvertConfig.hxx" + +//OCC +#include +#include +#include +#include +#include +#include +#include +#include + + +//SALOME +#include +#include +#include +#include + +S_McCadGeomData::S_McCadGeomData() +{ + m_iNumSolid = 0; // Initial the number of convex solid. +} + +S_McCadGeomData::S_McCadGeomData(const int & studyID, Standard_Boolean bGenVoid) +{ + m_iNumSolid = 0; // Initial the number of convex solid. + m_bGenerateVoid = bGenVoid; + S_InputData(studyID); +} + +/** ******************************************************************** +* @brief get the geometry data from MCCAD engine, geneate new S_McCadSolid +* and append them to the list +* +* @param[in] StudyID : ID to find data from which study +* @return void +* +* @date 06/12/2013 +* @author Yuefeng Qiu +*********************************************************************/ +void S_McCadGeomData::S_InputData(const int & studyID) +{ + cout<resourceMgr(); + bool isMCNP6 = false, isGDML = false; + if (resMgr->integerValue("MCCAD", "target_code", 0) == 1) //if MCNP6 is chosen + isMCNP6 = true; + else if (resMgr->integerValue("MCCAD", "target_code", 0) == 3) //if GDML is chosen + isGDML = true; + + //work should do for McCadGeomData + m_bGenerateVoid = McCadConvertConfig::GenerateVoid(); // Turn on/off the void generating switch + m_listConvexSolid = new TopTools_HSequenceOfShape; // create a shape list to store the convex material solids + m_listVoidCell = new TopTools_HSequenceOfShape; // create a shape list to store the void solids + Standard_Integer iNumMatSolid = 0; + + //get component list + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + MCCAD_ORB::ComponentList * aComponentList = engine->getData(studyID); + if (!aComponentList) { + MESSAGE("component list is emtpy!"); + return ; + } + + //loop all component, group and part to generate data + //!!!since all the object is checked before conversion start, here is not check again! + for (int i=0; i< aComponentList->length(); i++) + { + //*********LOOP for Components***** + MCCAD_ORB::Component_var aComponent = (*aComponentList)[i]; + + if (isMCNP6 && aComponent->hasEnvelop()) {//if target code is MCNP6, and the component has the envelop + TopoDS_Shape aTmpShape = MCCADGUI_DataModel::Stream2Shape(*aComponent->getEnvelopStream()); //get the envelop shape + S_McCadSolid * pSolidList = S_GenSMcCadSolid(aTmpShape); //generate a S_McCadSolid with envelop shape + if (pSolidList == NULL) { + MESSAGE("Component: " << aComponent->getName() << " contain not valid shape!"); + delete pSolidList; + continue; + } + //set property + pSolidList->SetMaterial(0, 0.0); //set the material to be 0, density to be 0.0 + pSolidList->SetName(aComponent->getName()); + pSolidList->SetComponentID(aComponent->getID()); //only set the component id + pSolidList->SetisEnvelop(true); //!!!IMPORTANT, the solid will be consider as envelop +// pSolidList->SetImportances() //no need , use default value + int aImp[3] = {1,1,1}; + pSolidList->SetImportances(aImp); + pSolidList->SetRemark(aComponent->getRemark()); +// pSolidList->SetAdditive() //no need + //Push the solid to the list + m_SolidList.push_back(static_cast (pSolidList)); //need to cast because m_SolidList accepts only McCadSolid. + iNumMatSolid ++; + continue; //jump to next component and skip all the group and part + } + + MCCAD_ORB::GroupList * aGroupList = aComponent->getGroupList(); + //*********LOOP for Groups***** + for (int j=0; jlength(); j++) + { + MCCAD_ORB::Group_var aGroup = (*aGroupList)[j]; + int MaterialID = 0; + double Density = 0.0; + if ( aGroup->hasMaterial()) { + MCCAD_ORB::Material_var aMaterial = aGroup->getMaterial(); //this material should not be nil + MaterialID = aMaterial->getID(); + Density = aMaterial->getDensity(); + } + MCCAD_ORB::PartList * aPartList = aGroup->getPartList(); + //*********LOOP for Parts***** + for (int k=0; klength(); k++) + { + MCCAD_ORB::Part_var aPart = (*aPartList)[k]; + //add a judgement to deal with parts without being decomposed + S_McCadSolid * pSolidList; + TopoDS_Shape aTmpShape = MCCADGUI_DataModel::Stream2Shape(*aPart->getShapeStream()); + if (aPart->getIsDecomposed()) + { + pSolidList = S_GenSMcCadSolid(aTmpShape); //generate a S_McCadSolid with this shape + if (pSolidList == NULL) { + MESSAGE("Part: " << aPart->getName() << " contain not valid shape!"); + delete pSolidList; + continue; + } + } + else if (isGDML) + { + //this code is for those undecomposed solid, they will be + pSolidList = new S_McCadSolid; + pSolidList->SetisDecomposed(false); + pSolidList->SetUnDecomposedSolid(aTmpShape); + } + else { + MESSAGE("Part: " << aPart->getName() << " is not decomposed!"); + continue; + } + + //set property + pSolidList->SetMaterial(MaterialID, Density); //set the material id and density + pSolidList->SetName(aPart->getName()); + pSolidList->SetPartID(aPart->getID()); + pSolidList->SetGroupID(aGroup->getID()); + pSolidList->SetComponentID(aComponent->getID()); //only set the component id + MCCAD_ORB::FixArray_var aIMP_var = aPart->getImportance(); + int aIMP [3] = {aIMP_var[0], aIMP_var[1], aIMP_var[2]}; + pSolidList->SetImportances(aIMP); //set importance + pSolidList->SetRemark(aPart->getRemark()); + pSolidList->SetAdditive(aPart->getAdditive()) ; + //Push the solid to the list + m_SolidList.push_back(static_cast (pSolidList)); //need to cast because m_SolidList accepts only McCadSolid. + iNumMatSolid ++; + } + } + } + cout<< iNumMatSolid << " Solids are read." << endl; + +} + + + + +/** ******************************************************************** +* @brief Get a material solid from the shape, and generate the surfaces list. +* and return a new S_McCadSolid +* +* @param[in] TopoDS_Shape & aShape OCC shape +* @return S_McCadSolid a new S_McCadSolid +* +* @date 31/8/2012 +* @author Lei Lu +* 2013-12-05 Modified by Yuefeng Qiu +*********************************************************************/ +S_McCadSolid * S_McCadGeomData::S_GenSMcCadSolid( const TopoDS_Shape & aShape) +{ + TopoDS_Shape theShape = aShape; + TopExp_Explorer exp; +// double aMinSolidVol = McCadConvertConfig::GetMinIptSolidVod(); + // If the solid is compound solid, explode each its lumps into solids firstly + if( theShape.ShapeType() == TopAbs_COMPSOLID || theShape.ShapeType() == TopAbs_COMPOUND ) + { + cout<<"yes. it is compoundsolid;"<GetVolume() >= -0.01) // Set the minimum volume tolerance +//qiu if(pConvexSolid->GetVolume() >= aMinSolidVol) +//qiu { +//qiu pConvexSolid = new McCadConvexSolid(tmpSolid); +//qiu } +//qiu else +//qiu { +//qiu cout<<"Detected a solid with small volume: "<GetVolume()<GenDescPoints(m_bGenerateVoid); + } + + AddGeomSurfList(pConvexSolid->GetSTLFaceList()); // Travelse the boundary faces, add in face list + AddGeomAuxSurfList(pConvexSolid->GetSTLFaceList()); // Judge whether need add auxiliary faces + pSolidList->AddConvexSolid(pConvexSolid); // Add the convex solid into a complicate solid + + pConvexSolid->DeleteRepeatFaces(m_bGenerateVoid); // Delete the repeated faces of solid + m_ConvexSolidList.push_back(pConvexSolid); // Add the convex solid in the solid list + m_iNumSolid++; + } +//qiu m_SolidList.push_back(pSolidList); + return pSolidList; + } + // If the solid is single solid, add to convex solid list directly + else if( theShape.ShapeType() == TopAbs_SOLID) + { +// TopoDS_Solid tmpSolid = TopoDS::Solid(solid_list->Value(i)); + TopoDS_Solid tmpSolid = TopoDS::Solid(theShape); + McCadConvexSolid *pConvexSolid = NULL; +//qiu McCadSolid * pSolidList = new McCadSolid(); + S_McCadSolid * pSolidList = new S_McCadSolid(); //qiu +//qiu if(pConvexSolid->GetVolume() >= -0.01) // Set the minimum volume tolerance +//qiu if(pConvexSolid->GetVolume() >= -0.01) // Set the minimum volume tolerance +//qiu if(pConvexSolid->GetVolume() >= aMinSolidVol) +//qiu { +//qiu pConvexSolid = new McCadConvexSolid(tmpSolid); +//qiu } +//qiu else +//qiu { +//qiu cout<<"Detected a solid with small volume: "<GetVolume()<GenDescPoints(m_bGenerateVoid); + } + + AddGeomSurfList(pConvexSolid->GetSTLFaceList()); // Travelse the boundary faces, add in face list + AddGeomAuxSurfList(pConvexSolid->GetSTLFaceList()); // Judge whether need add auxiliary faces + pSolidList->AddConvexSolid(pConvexSolid); // Add the convex solid into a complicate solid + + pConvexSolid->DeleteRepeatFaces(1); // Delete the repeated faces of solid + m_ConvexSolidList.push_back(pConvexSolid); // Add the convex solid in the solid list + m_iNumSolid++; +//qiu m_SolidList.push_back(pSolidList); + return pSolidList; + } + else return NULL; +} diff --git a/src/MCCADGUI/S_McCadGeomData.hxx b/src/MCCADGUI/S_McCadGeomData.hxx new file mode 100644 index 0000000..dcf44ef --- /dev/null +++ b/src/MCCADGUI/S_McCadGeomData.hxx @@ -0,0 +1,40 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#ifndef S_MCCADGEOMDATA_HXX +#define S_MCCADGEOMDATA_HXX + +#include "../MCCAD/McCadMcVoid/McCadGeomData.hxx" +#include "S_McCadSolid.hxx" + +class S_McCadGeomData : public McCadGeomData +{ +public: + S_McCadGeomData(); + S_McCadGeomData(const int & studyID, Standard_Boolean bGenVoid); + + void S_InputData(const int & studyID); + /** genreate a new S_McCadSolid using a shape. */ + S_McCadSolid * S_GenSMcCadSolid( const TopoDS_Shape & aShape); + + +private: + Standard_Boolean m_bGenerateVoid; /**< The switch of void generation */ + +}; + +#endif // S_MCCADGEOMDATA_HXX diff --git a/src/MCCADGUI/S_McCadMcnpWriter.cxx b/src/MCCADGUI/S_McCadMcnpWriter.cxx new file mode 100644 index 0000000..8380636 --- /dev/null +++ b/src/MCCADGUI/S_McCadMcnpWriter.cxx @@ -0,0 +1,538 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "S_McCadMcnpWriter.hxx" +#include "S_McCadSolid.hxx" +#include "MCCADGUI.h" +#include "MCCADGUI_DataModel.h" +#include "utilities.h" +#include "../MCCAD/McCadTool/McCadConvertConfig.hxx" + +//OCC +#include +#include +#include +#include +#include +#include +#include +#include + +//SALOME +#include +#include +#include +#include + + +S_McCadMcnpWriter::S_McCadMcnpWriter() +{ +// m_iNumSolid = 0; // Initial the number of convex solid. + m_bHaveMaterial = Standard_False; + myFileName = ""; +} + +S_McCadMcnpWriter::~S_McCadMcnpWriter() +{ +// ReleaseMemory(); +} + + +/** ******************************************************************** +* @brief Print the geometry data into a file ,include head, cells, +* surface and transform card. +* +* @param TCollection_AsciiString theFileName +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +* 2013-12-06 Modified by Yuefeng Qiu +***********************************************************************/ +void S_McCadMcnpWriter::PrintFile() +{ +// myFileName = aFileName; + if (m_OutputFileName.IsEmpty()) + { + cout<<"File Name is empty!"<resourceMgr(); + bool isMCNP6 = resMgr->integerValue("MCCAD", "target_code", 0) == 1 ? true : false; + if (isMCNP6) { + S_PrintEmbedCard(theStream); + } + + theFile.Close(); + } +} + + +/** ******************************************************************** +* @brief Print the cell geometry description +* +* @param Standard_OStream & theStream +* @return void +* +* @date 31/8/2012 +* @author Lei Lu +* 2013-12-06 modified by Yuefeng Qiu +***********************************************************************/ +void S_McCadMcnpWriter::PrintCellDesc(Standard_OStream& theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream<<"c "<<"o---------------------------- Cells Card ----------------------------------o"<resourceMgr(); +// Standard_Integer iPseudoCellNum =McCadConvertConfig::GetInitPseudoCellNum(); //get the initial pseudo cell number +// Standard_Integer iEmbedCardNum =McCadConvertConfig::GetInitEmbedCardNum(); + Standard_Integer iPseudoCellNum = resMgr->integerValue("MCCAD","init_pseudo_cell_no", 90000); + Standard_Integer iEmbedCardNum = resMgr->integerValue("MCCAD","embed_card_no", 2); + + int tmpComponentID = -1; //to get componentID, initial with a non-possible id + int tmpGroupID = -1; + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { +//qiu McCadSolid * pSolid = m_SolidList.at(i); + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + +//qiu if (m_bHaveMaterial) +//qiu { +//qiu PrintlGroupInfo(i+1,theStream); +//qiu } + //qiu print Component info + if (pSolid->GetComponentID() != tmpComponentID) { + tmpComponentID = pSolid->GetComponentID(); + S_PrintComponentInfo(tmpComponentID, theStream); + } + //qiu print Group info, if envelop cell the groupID is wrong! avoid it. + if (!pSolid->GetisEnvelop() && pSolid->GetGroupID() != tmpGroupID) { + tmpGroupID = pSolid->GetGroupID(); + PrintGroupInfo(tmpGroupID, theStream); + } + + //output name and remark + theStream<<"c Part:"<GetName(); //qiu Output the solid name + if (!pSolid->GetRemark().trimmed().isEmpty()) //qiu Output remark + theStream<<" $"<GetRemark().trimmed().toStdString()<GetID(); // Output the material number. +//qiu if(!m_bHaveMaterial) + if (pSolid->GetID() == 0) //if no material + { + theStream<GetDensity(); // Output the density. + } + + //output cell description + for(int j = 0; j < pSolid->GetConvexSolidList().size(); j++) + { + McCadConvexSolid *pConvexSolid = pSolid->GetConvexSolidList().at(j); + assert(pConvexSolid); +// pConvexSolid->ChangeFaceNum(pData); // Update the face number after sorting + +// TCollection_AsciiString strCellDesc = pConvexSolid->GetExpression(); + TCollection_AsciiString strCellDesc = GetCellExpn(pConvexSolid);// qiu using the new updates + strCellDesc.LeftAdjust(); // Trim the left and right space characters of string + strCellDesc.RightAdjust(); + + if ( j == 0 ) + { + theStream<<"("<GetID() == 0) + theStream<GetImportances()[0]; + int aIMPp = pSolid->GetImportances()[1]; +// int aIMPe = pSolid->GetImportances()[2]; + theStream <<"imp:n="<<(aIMPn == -1 ? 1 : aIMPn) <<" imp:p="<<(aIMPp == -1 ? 1 : aIMPp) /*<<" imp:e="<<(aIMPe == -1 ? 1 : aIMPe)*/; + if (pSolid->GetisEnvelop()) + theStream <<" fill="<GetAdditive().trimmed().toStdString()<GetisEnvelop()) { + S_PrintPseudoCellDesc(theStream, pSolid->GetComponentID(),iPseudoCellNum, iEmbedCardNum); + iEmbedCardNum ++; + } + iCellNum ++; + } +} + + +/*! + * \brief S_McCadMcnpWriter::S_PrintPseudoCellDesc + * print MCNP6 pseudo cell description + * if one S_McCadSolid is marked as envelop, then this method will be call + * \param theStream the output file stream + * \param ComponentID the component which is fully meshed + * \param iPseudoCellNum the current pseudo cell number, increase all the way + * \param iEmbedCardNum the current Embed card no + */ +void S_McCadMcnpWriter::S_PrintPseudoCellDesc(Standard_OStream& theStream, const int &ComponentID, + int & iPseudoCellNum, const int & iEmbedCardNum) +{ + int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + //find the component + MCCAD_ORB::Component_var aComponent = engine->getComponent(studyID, ComponentID); + if (aComponent->_is_nil()) { + MESSAGE("This component is nil!"); + return ; + } + MCCAD_ORB::GroupList * aGroupList = aComponent->getGroupList(); + //*********LOOP for Groups***** + for (int j=0; jlength(); j++) + { + MCCAD_ORB::Group_var aGroup = (*aGroupList)[j]; + PrintGroupInfo(aGroup->getID(), theStream); //print group info + + int MaterialID = 0; + double Density = 0.0; + if ( aGroup->hasMaterial()) { + MCCAD_ORB::Material_var aMaterial = aGroup->getMaterial(); //this material should not be nil + MaterialID = aMaterial->getID(); + Density = aMaterial->getDensity(); + } + MCCAD_ORB::PartList * aPartList = aGroup->getPartList(); + //*********LOOP for Parts***** + for (int k=0; klength(); k++) + { + MCCAD_ORB::Part_var aPart = (*aPartList)[k]; + //output name and remark + theStream<<"c Part:"<getName(); //qiu Output the solid name + if (!QString(aPart->getRemark()).trimmed().isEmpty()) //qiu Output remark + theStream<<" $"<getRemark()).trimmed().toStdString()<getImportance(); //get importance + theStream <<" imp:n="<<(aIMP[0] == -1 ? 1 : aIMP[0]) <<" imp:p="<<(aIMP[1] == -1 ? 1 : aIMP[1]) /*<<" imp:e="<<(aIMP[2] == -1 ? 1 : aIMP[2])*/; + theStream <<" u="<getAdditive()).trimmed().isEmpty()) + theStream <<" "<< QString(aPart->getAdditive()).trimmed().toStdString()<activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); //don't delete! + int n = aMaterialList->length(); + if (!n){ + MESSAGE("No material data!"); + return ; + } + for(int i = 0; i < n; i++) + { + MCCAD_ORB::Material_var aMaterial = (*aMaterialList)[i]; + QString strMatCard = aMaterial->getMatCard(); + QStringList list; + list = strMatCard.split("\n"); + + bool bPrintMatID = false; // The material id has been printed or not + + for (int j = 0; j < list.size()-1; j++) + { + QString str = list.at(j).trimmed(); + if (str.startsWith("c ")||(str == "c") + ||str.startsWith("C ")||(str == "C")) + { + theStream<getID()<GetGeomData(); + assert(pData); + + //get initial number +// Standard_Integer iPseudoCellNum = McCadConvertConfig::GetInitPseudoCellNum(); //get the initial pseudo cell number +// Standard_Integer iEmbedCardNum = McCadConvertConfig::GetInitEmbedCardNum(); + + //get the preference for MCNP6 conversion + SUIT_Session* session = SUIT_Session::session(); + SUIT_ResourceMgr* resMgr = session->resourceMgr(); + Standard_Integer iPseudoCellNum = resMgr->integerValue("MCCAD","init_pseudo_cell_no", 90000); + Standard_Integer iEmbedCardNum = resMgr->integerValue("MCCAD","embed_card_no", 2); + int iMeshType = resMgr->integerValue("MCCAD", "MeshType", 0); //actually only one option. + int iFileType = resMgr->integerValue("MCCAD", "EeoutFileType", 1); //default ascii + int iOverlap = resMgr->integerValue("MCCAD", "OverlapTreat", 2); //default AVERAGE + double dLengthFactor = resMgr->doubleValue("MCCAD", "LengthFactor", 1.0); //default 1 + + //get the studyID and engine + int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + //Loop all the solid to check if some are envelop cells + for (unsigned int i = 0; i < pData->m_SolidList.size(); i++) + { + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + if (pSolid->GetisEnvelop()) { + int ComponentID = pSolid->GetComponentID(); + MCCAD_ORB::Component_var aComponent = engine->getComponent(studyID, ComponentID); + if (aComponent->_is_nil()) { + MESSAGE("The Component is nill!"); + return ; + } + //###start to print + //print he card and mesh type + theStream.setf(ios::left); + theStream<<"c Embed Card for Component: " <getName()<getName()) + QString(".eeout"); + theStream<activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + //find the component + MCCAD_ORB :: Component_var aComponent = engine->getComponent(studyID, ComponentID); + if (aComponent->_is_nil()) { + MESSAGE("Component is nil!"); + return ; + } + //get infomation + theStream<<"c "<<"=============================================================================="<getName()<getRemark()).trimmed().isEmpty()) + theStream<<"c "<getRemark()).trimmed().toStdString()<getGroupList()->length(); + for (int i=0; igetGroupList())[i]->getName()<activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + //find the Group + MCCAD_ORB :: Group_var aGroup = engine->getGroup(studyID, GroupID); + if (aGroup->_is_nil()) { + MESSAGE("Group is nil!"); + return ; + } + //get infomation + theStream<<"c "<<" ====================================================== "<getName()<getRemark()).trimmed().isEmpty()) + theStream<<"c "<getRemark()).trimmed().toStdString()<hasMaterial()) { + MCCAD_ORB::Material_var aMaterial = aGroup->getMaterial(); +// theStream<<"c "<getName()<getID()<getDensity()<getPartList()->length() << " cells."< + +class S_McCadSolid : public McCadSolid +{ +public: + S_McCadSolid(); + ~S_McCadSolid(); + int GetPartID () {return myPartID;} + int GetGroupID () {return myGroupID;} + int GetComponentID() {return myComponentID;} + bool GetisEnvelop() {return myisEnvelop;} + int * GetImportances() {return myImportances;} + QString GetRemark () {return myRemark;} + QString GetAdditive() {return myAdditive;} + bool GetisDecomposed() {return myisDecomposed;} + TopoDS_Shape GetUndecompsedSolid () {return myUndecompsedSolid; } + + void SetPartID (const int & aPartID) {myPartID = aPartID;} + void SetGroupID (const int & aGroupID) {myGroupID = aGroupID;} + void SetComponentID(const int & aComponentID) {myComponentID = aComponentID;} + void SetisEnvelop(const bool & isEnvelop) {myisEnvelop = isEnvelop;} + void SetImportances(const int * Importances ) {myImportances[0] = Importances[0]; myImportances[1] = Importances[1]; myImportances[2] = Importances[2]; } + void SetRemark (const QString & aRemark ) {myRemark = aRemark;} + void SetAdditive (const QString &aAdditive) {myAdditive = aAdditive;} + void SetisDecomposed(const bool & isDecomposed) {myisDecomposed = isDecomposed;} + void SetUnDecomposedSolid(const TopoDS_Shape & aSolid) {myUndecompsedSolid = aSolid ;} + +private: + int myPartID ; // belongs to which group + int myGroupID ; // belongs to which group + int myComponentID; //belongs to which + bool myisEnvelop; // to see if it is the envelop for mesh + int myImportances[3];// importance, if -1, then use default (1) + QString myRemark; //remark for this part + QString myAdditive; //additive card for this part + + //to see if it is decomposed or not, solid which decomposed failed can be converted into tessellated solid for GDML + bool myisDecomposed; + TopoDS_Shape myUndecompsedSolid; //if decomposed failed, mySolid stores the undecomposed solid + + +}; + +#endif // S_MCCADSOLID_H diff --git a/src/MCCADGUI/S_McCadTripoliWriter.cxx b/src/MCCADGUI/S_McCadTripoliWriter.cxx new file mode 100644 index 0000000..ab4a994 --- /dev/null +++ b/src/MCCADGUI/S_McCadTripoliWriter.cxx @@ -0,0 +1,349 @@ +// Copyright (C) 2014-2015 KIT-INR/NK +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// +#include "S_McCadTripoliWriter.hxx" +#include "S_McCadSolid.hxx" +#include "MCCADGUI.h" +#include "MCCADGUI_DataModel.h" +#include "utilities.h" +#include +#include +#include + +#include + + +S_McCadTripoliWriter::S_McCadTripoliWriter() +{ +} + +/*! + * \brief S_McCadTripoliWriter::PrintCellDesc + * print the cell discription + * \param theStream output file stream + */ +void S_McCadTripoliWriter::PrintCellDesc(Standard_OStream& theStream) +{ + McCadGeomData *pData = m_pManager->GetGeomData(); + assert(pData); + + theStream.setf(ios::left); + theStream<<"/* ============================= Volume Data Definitions ========================= */"<m_SolidList.size(); i++) + { +//qiu McCadSolid * pSolid = m_SolidList.at(i); + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + + //skip the envelop solid, because it is a meshed component which works only for MCNP6! + //Keeping in mind that the cell id m_iCellNum is not increase with i now, + //It should be very careful when printing the Relation between Volume and Material in PrintMatCard! + if (pSolid->GetisEnvelop()) continue; + + //qiu print Component info + if (pSolid->GetComponentID() != tmpComponentID) { + tmpComponentID = pSolid->GetComponentID(); + S_PrintComponentInfo(tmpComponentID, theStream); + } + //qiu print Group info + if (pSolid->GetGroupID() != tmpGroupID) { + tmpGroupID = pSolid->GetGroupID(); + PrintGroupInfo(tmpGroupID, theStream); + } + + //output name and remark + theStream<<"// Part: "<GetName(); //qiu Output the solid name + if (!pSolid->GetRemark().trimmed().isEmpty()) //qiu Output remark + theStream<<" :"<GetRemark().trimmed().toStdString()< cell_list = GenTripoliCellList(pSolid); + + vector union_list; + int iNumEpn = cell_list.size(); // The number of virtual solids + + for(int j = 0; j < iNumEpn; j++) + { + McCadTripoliCell *pCell = cell_list.at(j); + //if (pCell->hasVirtualCell()) + vector sub_list; + int iNumVirCell = pCell->GetNumVirCell(); + for (int iVirCell = 0; iVirCell < iNumVirCell; iVirCell++) + { + McCadTripoliCell *pVirCell = pCell->GetVirtualCell(iVirCell); + theStream<GetEqua(); + theStream<GetEqua(); + theStream<GetEqua(); + theStream< 1) + { + theStream<activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + MCCAD_ORB::MaterialList * aMaterialList = engine->getMaterialList(studyID); //don't delete! + int n = aMaterialList->length(); + if (!n){ + MESSAGE("No material data!"); + return ; + } + + /** Print all the material included */ + theStream<<"COMPOSITION "<< n <getMatCard(); + //Because material name might be identical or empty, we use ID+Name + QString aMatName = QString("%1_").arg(aMaterial->getID()) + aMaterial->getName(); + theStream<GetGeomData(); + assert(pData); + + map > mapMat2Solid; + /** Print the material name and the solids belong to this material group */ + for (unsigned int i = 0; i < (pData->m_SolidList).size(); i++) + { + S_McCadSolid * pSolid = static_cast (pData->m_SolidList.at(i)); //qiu cast to S_McCadSolid + assert(pSolid); + + //get the Mat ID of this solid + if (pSolid->GetisEnvelop()) continue; //skip the envelop solid, which used only for MCNP6 + + MCCAD_ORB::Group_var aGroup = engine->getGroup(studyID, pSolid->GetGroupID()); + int aMatID = aGroup->getMaterialID(); + + map >::iterator iter; + iter = mapMat2Solid.find(aMatID); + if (iter != mapMat2Solid.end()) { + iter->second.push_back(iCellNum); + } + else { + vector cell_list; + cell_list.push_back(iCellNum); + mapMat2Solid.insert(pair >(aMatID,cell_list)); + } + iCellNum ++; + } + + //print the relation + theStream<<"GEOMCOMP"< >::iterator iter; + iter = mapMat2Solid.begin(); + while (iter != mapMat2Solid.end()) + { + //skip when material ID == 0, because Material ID should > 0 + if (iter->first == 0) continue; + + int iNum = (iter->second).size(); //contain solids + MCCAD_ORB::Material_var aMaterial = engine->getMaterial(studyID, iter->first); + //Because material name might be identical or empty, we use ID+Name + QString aMatName = QString("%1_").arg(aMaterial->getID()) + aMaterial->getName(); + theStream<second).at(i)<<" "; + } + theStream<activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + //find the component + MCCAD_ORB :: Component_var aComponent = engine->getComponent(studyID, ComponentID); + if (aComponent->_is_nil()) { + MESSAGE("Component is nil!"); + return ; + } + //get infomation + theStream <<"/*"<getName()<getRemark()).trimmed().isEmpty()) + theStream<<" "<getRemark()).trimmed().toStdString()<getGroupList()->length(); + for (int i=0; igetGroupList())[i]->getName()<activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + //find the Group + MCCAD_ORB :: Group_var aGroup = engine->getGroup(studyID, GroupID); + if (aGroup->_is_nil()) { + MESSAGE("Group is nil!"); + return ; + } + //get infomation + theStream <<"/*"<getName()<getRemark()).trimmed().isEmpty()) + theStream<<" "<getRemark()).trimmed().toStdString()<hasMaterial()) { + MCCAD_ORB::Material_var aMaterial = aGroup->getMaterial(); +// theStream<<"// "<getName()<getID()<getDensity()<getPartList()->length() << " cells."< +#include +//#include +//#include +#include + +#include "../MCCAD/McCadTool/McCadMathTool.hxx" +#include "../MCCAD/McCadTool/McCadConvertConfig.hxx" +#include "../MCCAD/McCadTool/McCadGeneTool.hxx" +//SALOME +#include +#include +#include "MCCADGUI.h" +#include "utilities.h" + +S_McCadVoidCellManager::S_McCadVoidCellManager() +{ + m_bHaveMaterial = Standard_False; + +} + + +void S_McCadVoidCellManager::S_ReadGeomData(const int & studyID) +{ + //change SolidList to studyID, compared with original McCad + McCadGeomData *pData = static_cast (new S_McCadGeomData(studyID,m_bGenerateVoid)); + m_pGeomData.reset(pData); + m_pGeomData->SetManager(this); +} + + +void S_McCadVoidCellManager::S_Process() +{ + // Add by Lei 12/11/2013 Load the material XML file. + //qiu skip because we load the material already inside S_McCadGeomData and S_McCad***Writer +// TCollection_AsciiString material_file = "material.xml"; +// ReadMatData(material_file); + + //get the studyID and engine + int studyID = SUIT_Session::session()->activeApplication()->activeStudy()->id(); + MCCAD_ORB::MCCAD_Gen_var engine = MCCADGUI::GetMCCADGen(); + if ( !studyID || CORBA::is_nil( engine ) ) { + MESSAGE("Errors in study or in MCCAD engine!"); + return ; + } + if (engine->getMaterialList(studyID)->length() > 0) + m_bHaveMaterial = Standard_True; //make sure if have materials + + McCadVoidGenerator *pVoidGen = new McCadVoidGenerator(this); + pVoidGen->Process(); + + m_pGeomData->SortSurface(); + m_pGeomData->UpdateFaceNum(); + + IMcCadWriter * pWriter = NULL; + if (m_Convertor == "TRIPOLI") + { + pWriter = new S_McCadTripoliWriter(); + ((S_McCadTripoliWriter *)pWriter)->SetVirtCellNum(10000); + } + else if (m_Convertor == "MCNP") + { + pWriter = new S_McCadMcnpWriter(); + } + else if (m_Convertor == "GDML") + { + pWriter = new S_McCadGDMLWriter(); + } + + if (pWriter != NULL) + { + pWriter->SetMaterial(m_bHaveMaterial); //no need any more + pWriter->SetVoid(m_bGenerateVoid); + pWriter->SetManager(this); + pWriter->SetFileName(m_OutFileName); + pWriter->PrintFile(); + } + + cout< + + MCCADGUI_SetPropertyDialog + + + + 0 + 0 + 250 + 642 + + + + + 0 + 0 + + + + + 220 + 10 + + + + + 0 + 0 + + + + Properties + + + + true + + + + 20 + 20 + 180 + 131 + + + + Material + + + true + + + false + + + + + 10 + 35 + 41 + 21 + + + + + 11 + + + + ID: + + + + + + 40 + 30 + 130 + 27 + + + + + + + 40 + 60 + 141 + 22 + + + + Replace Color + + + + + + 40 + 90 + 130 + 27 + + + + Edit Material + + + + + + + 20 + 160 + 180 + 131 + + + + Importance + + + true + + + false + + + + + 10 + 30 + 41 + 21 + + + + + 11 + + + + N: + + + + + + 10 + 60 + 41 + 31 + + + + + 11 + + + + P: + + + + + + 10 + 90 + 41 + 21 + + + + + 11 + + + + E: + + + + + + 40 + 30 + 130 + 24 + + + + + + + 40 + 60 + 130 + 24 + + + + + + + 40 + 90 + 130 + 24 + + + + + + + + 30 + 590 + 80 + 27 + + + + Apply + + + + + + 130 + 590 + 80 + 27 + + + + Close + + + + + + 20 + 360 + 201 + 111 + + + + Remark + + + true + + + false + + + + + 10 + 30 + 181 + 71 + + + + + + + + 20 + 480 + 201 + 101 + + + + Additive Cards: + + + true + + + false + + + + + 10 + 20 + 181 + 71 + + + + + + + + 20 + 290 + 181 + 61 + + + + Graphic + + + true + + + false + + + + + 70 + 30 + 81 + 27 + + + + QPushButton { +background:rgb(255, 170, 0) +} + + + + + + + + + 20 + 30 + 61 + 31 + + + + + 11 + + + + Color: + + + + + + + diff --git a/src/MCCADGUI/TransformDialog.ui b/src/MCCADGUI/TransformDialog.ui new file mode 100644 index 0000000..b1cab2d --- /dev/null +++ b/src/MCCADGUI/TransformDialog.ui @@ -0,0 +1,320 @@ + + + MCCADGUI_TransformDialog + + + + 0 + 0 + 416 + 368 + + + + + 0 + 0 + + + + + 220 + 10 + + + + + 0 + 0 + + + + Transformation + + + + + 30 + 30 + 361 + 61 + + + + Translation + + + true + + + false + + + + + 30 + 30 + 51 + 21 + + + + + 11 + + + + Vector + + + + + + 100 + 30 + 61 + 24 + + + + + + + 180 + 30 + 61 + 24 + + + + + + + 260 + 30 + 61 + 24 + + + + + + + + 200 + 320 + 80 + 27 + + + + Apply + + + + + + 300 + 320 + 80 + 27 + + + + Close + + + + + + 30 + 250 + 361 + 61 + + + + Scaling + + + true + + + false + + + + + 30 + 30 + 111 + 31 + + + + + 11 + + + + Factor + + + + + + 140 + 30 + 81 + 24 + + + + + + + + 30 + 100 + 361 + 141 + + + + Rotation + + + true + + + false + + + + + 30 + 30 + 61 + 31 + + + + + 11 + + + + Origin + + + + + + 260 + 30 + 61 + 24 + + + + + + + 180 + 30 + 61 + 24 + + + + + + + 100 + 30 + 61 + 24 + + + + + + + 180 + 70 + 61 + 24 + + + + + + + 260 + 70 + 61 + 24 + + + + + + + 100 + 70 + 61 + 24 + + + + + + + 30 + 70 + 71 + 31 + + + + + 11 + + + + Direction + + + + + + 30 + 110 + 111 + 31 + + + + + 11 + + + + Angle(Degree) + + + + + + 140 + 110 + 81 + 24 + + + + + + + + diff --git a/src/MCCADGUI/resources/MCCAD_icons.ts b/src/MCCADGUI/resources/MCCAD_icons.ts new file mode 100644 index 0000000..809f426 --- /dev/null +++ b/src/MCCADGUI/resources/MCCAD_icons.ts @@ -0,0 +1,31 @@ + + + + + @default + + ICON_ATOM + atom.png + + + ICON_DISPLAY + display.png + + + ICON_ERASE + erase.png + + + ICON_IMPORT_DATA + import.xpm + + + ICON_MOLECULE + molecule.png + + + ICON_PROCESS_DATA + run.png + + + diff --git a/src/MCCADGUI/resources/MCCAD_msg_en.ts b/src/MCCADGUI/resources/MCCAD_msg_en.ts new file mode 100644 index 0000000..efc7e81 --- /dev/null +++ b/src/MCCADGUI/resources/MCCAD_msg_en.ts @@ -0,0 +1,159 @@ + + + + + @default + + ATOM + Atom + + + MCCAD_PREFERENCES + MCCAD + + + DISPLAY_MODE_PREF + Default display mode + + + MEN_MCCAD + MCCAD + + + MEN_COLOR + Color + + + MEN_DISPLAY + Display + + + MEN_DISPLAY_MODE + Display mode + + + MEN_ERASE + Erase + + + MEN_POINTSMODE + Points + + + MEN_PROCESS_DATA + Process data + + + MEN_RETRIEVE_DATA + Retrieve data + + + MEN_SHADING + Surface + + + MEN_TRANSPARENCY + Transparency + + + MEN_WIREFRAME + Wireframe + + + MOLECULE + Molecule + + + PRESENTATION_PREF_GROUP + Atoms presentation + + + STS_COLOR + Set color + + + STS_DISPLAY + Display atom + + + STS_ERASE + Erase atom + + + STS_POINTSMODE + Set Points representation mode + + + STS_PROCESS_DATA + Process data + + + STS_RETRIEVE_DATA + Retrieve data + + + STS_SHADING + Set Surface representation mode + + + STS_TRANSPARENCY + Set transparency + + + STS_WIREFRAME + Set Wireframe representation mode + + + TLT_COLOR + Color + + + TLT_DISPLAY + Display atom + + + TLT_ERASE + Erase atom + + + TLT_POINTSMODE + Points + + + TLT_PROCESS_DATA + Process data + + + TLT_RETRIEVE_DATA + Retrieve data + + + TLT_SHADING + Surface + + + TLT_TRANSPARENCY + Transparency + + + TLT_WIREFRAME + Wireframe + + + TOOL_MCCAD + MCCAD + + + TRANSPARENCY_DLG_TITLE + Set transparency + + + TRANSPARENCY_OPAQUE + Opaque + + + TRANSPARENCY_TRANSPARENT + Transparent + + + diff --git a/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp.cxx b/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp.cxx new file mode 100644 index 0000000..dcc520b --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp.cxx @@ -0,0 +1,36 @@ +#include "MCCADGUI_CreateGroupOp.h" +#include +#include +#include +#include +#include "MCCADGUI_DataObject.h" + +#include + +MCCADGUI_CreateGroupOp::MCCADGUI_CreateGroupOp() +: MCCADGUI_Operation() +{ +} + +MCCADGUI_CreateGroupOp::~MCCADGUI_CreateGroupOp() +{ +} +/*! Operation itself. */ +void MCCADGUI_CreateGroupOp::startOperation() +{ + MCCADGUI_DataModel* dm = dataModel(); + + bool bOk; + QString aName = QInputDialog::getText( module()->getApp()->desktop(), + tr( "Create Part Group" ), + tr( "Group Name"), + QLineEdit::Normal, + "NewGroup", + &bOk); + + if (dm->generateGroup(aName)) + commit(); + else + abort(); + return; +} diff --git a/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp.h b/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp.h new file mode 100644 index 0000000..8ffa103 --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp.h @@ -0,0 +1,20 @@ +#ifndef MCCADGUI_CREATEGROUPOP_H +#define MCCADGUI_CREATEGROUPOP_H +#include + + +class MCCADGUI_CreateGroupOp: public MCCADGUI_Operation +{ + + Q_OBJECT + +public: + MCCADGUI_CreateGroupOp(); + virtual ~MCCADGUI_CreateGroupOp(); + +protected: + virtual void startOperation(); + +}; + +#endif // MCCADGUI_CREATEGROUPOP_H diff --git a/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp_moc.cxx b/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp_moc.cxx new file mode 100644 index 0000000..0aefc1d --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_CreateGroupOp_moc.cxx @@ -0,0 +1,69 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'MCCADGUI_CreateGroupOp.h' +** +** Created: Wed Feb 27 09:41:13 2013 +** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "MCCADGUI_CreateGroupOp.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'MCCADGUI_CreateGroupOp.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 62 +#error "This file was generated using the moc from 4.6.2. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MCCADGUI_CreateGroupOp[] = { + + // content: + 4, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_CreateGroupOp[] = { + "MCCADGUI_CreateGroupOp\0" +}; + +const QMetaObject MCCADGUI_CreateGroupOp::staticMetaObject = { + { &MCCADGUI_Operation::staticMetaObject, qt_meta_stringdata_MCCADGUI_CreateGroupOp, + qt_meta_data_MCCADGUI_CreateGroupOp, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_CreateGroupOp::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_CreateGroupOp::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_CreateGroupOp::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_CreateGroupOp)) + return static_cast(const_cast< MCCADGUI_CreateGroupOp*>(this)); + return MCCADGUI_Operation::qt_metacast(_clname); +} + +int MCCADGUI_CreateGroupOp::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = MCCADGUI_Operation::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/MCCADGUI/tmp/MCCADGUI_CreateMeshOp.cxx b/src/MCCADGUI/tmp/MCCADGUI_CreateMeshOp.cxx new file mode 100644 index 0000000..3c64334 --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_CreateMeshOp.cxx @@ -0,0 +1,84 @@ +#include "MCCADGUI_CreatePartOp.h" +#include "MCCADGUI_GenPartDialog.h" +#include "MCCADGUI_DataModel.h" +#include "MCCADGUI.h" +#include "MCCADGUI_DataObject.h" + +#include +#include +#include +#include + +using namespace std; + + +MCCADGUI_CreatePartOp::MCCADGUI_CreatePartOp() + : MCCADGUI_Operation(), + myDlg( 0 ) +{ + +} + +/*! Destructor */ +MCCADGUI_CreatePartOp::~MCCADGUI_CreatePartOp() +{ + if ( myDlg ) + delete myDlg; +} + +/*! Returns Operation dialog */ +LightApp_Dialog* MCCADGUI_CreatePartOp::dlg() const +{ + if ( !myDlg ) + const_cast( this )->myDlg = new MCCADGUI_GenPartDialog( module()->getApp()->desktop() ); + + return myDlg; +} + +void MCCADGUI_CreatePartOp::onApply() +{ +// cout << "on Apply() !!"<getStudyId(); + + vector XDim; + vector YDim; + vector ZDim; + + MCCADGUI_GenPartDialog * Dialog = dynamic_cast (dlg()) ; + if (!Dialog->getData(XDim, YDim, ZDim)) + abort(); + if (Dialog->getName().isEmpty()) + abort(); + + //get part group id +// MCCADGUI * theModule = dynamic_cast (module()) ; //obtain the XYSMESHGUI module +// if (!theModule) +// abort(); + + //for debug +// MCCADGUI_DataObject * aObj = dataModel()->findObject("MCCADGUI_1"); +// QString atmpEntry = aObj->entry(); +// int atmp = aObj->getPartGroupIndex(); +// int btmp = aObj->getPartIndex(); +// QString atmpName = aObj->name(); + + QStringList aEntryList; +// theModule->selected(aEntryList,false); //only one seleted item + MCCADGUIModule()->selected(aEntryList,false); + if (aEntryList.size() != 1) + { + cout << "seletion is invalid!!"<getGroupID(aEntry); + + if (!dataModel()->generatePart(Dialog->getName(), aGroupId, XDim, YDim, ZDim)) + { + cout << "generate part failed!"< + + +class MCCADGUI_GenPartDialog; + + + +class MCCADGUI_CreatePartOp: public MCCADGUI_Operation +{ + + Q_OBJECT + +public: + MCCADGUI_CreatePartOp(); + virtual ~MCCADGUI_CreatePartOp(); + + virtual LightApp_Dialog* dlg() const; + +protected slots: + virtual void onApply(); + +private: + + MCCADGUI_GenPartDialog* myDlg; + +}; + +#endif // MCCADGUI_CREATEMESHOP_H diff --git a/src/MCCADGUI/tmp/MCCADGUI_CreateMeshOp_moc.cxx b/src/MCCADGUI/tmp/MCCADGUI_CreateMeshOp_moc.cxx new file mode 100644 index 0000000..b913155 --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_CreateMeshOp_moc.cxx @@ -0,0 +1,79 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'MCCADGUI_CreatePartOp.h' +** +** Created: Wed Feb 27 09:41:13 2013 +** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "MCCADGUI_CreatePartOp.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'MCCADGUI_CreatePartOp.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 62 +#error "This file was generated using the moc from 4.6.2. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MCCADGUI_CreatePartOp[] = { + + // content: + 4, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: signature, parameters, type, tag, flags + 28, 27, 27, 27, 0x09, + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_CreatePartOp[] = { + "MCCADGUI_CreatePartOp\0\0onApply()\0" +}; + +const QMetaObject MCCADGUI_CreatePartOp::staticMetaObject = { + { &MCCADGUI_Operation::staticMetaObject, qt_meta_stringdata_MCCADGUI_CreatePartOp, + qt_meta_data_MCCADGUI_CreatePartOp, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_CreatePartOp::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_CreatePartOp::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_CreatePartOp::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_CreatePartOp)) + return static_cast(const_cast< MCCADGUI_CreatePartOp*>(this)); + return MCCADGUI_Operation::qt_metacast(_clname); +} + +int MCCADGUI_CreatePartOp::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = MCCADGUI_Operation::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: onApply(); break; + default: ; + } + _id -= 1; + } + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog.cxx b/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog.cxx new file mode 100644 index 0000000..fac0e9a --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog.cxx @@ -0,0 +1,115 @@ +#include "MCCADGUI_GenPartDialog.h" + +MCCADGUI_GenPartDialog::MCCADGUI_GenPartDialog(QWidget* parent) +: LightApp_Dialog( parent, 0, false, true, OK | Apply | Close ) +{ + aName = ""; + setupUi(this); +} + +MCCADGUI_GenPartDialog::~MCCADGUI_GenPartDialog() +{ +} + +///*! +// * \brief this method is inherited from acceptData() in QtxDialog. +// * this method is called when Dialog box is accepted, for checking +// * data correctness and so on +// * \return \c true if checking pass +// */ +//bool MCCADGUI_GenPartDialog::acceptData() +//{ + +// aName = Gen_le_name->text(); +// QStringList Xstring = Gen_le_X->text().split(" "); +// QStringList Ystring = Gen_le_Y->text().split(" "); +// QStringList Zstring = Gen_le_Z->text().split(" "); + +// XDim.clear(); +// YDim.clear(); +// ZDim.clear(); + + +// //check and load the intervals into member +// for (int i = 0; i < Xstring.size(); i++) +// { +// XDim.push_back(QString(Xstring.at(i)).toFloat(isOK)); +// if (!(*isOK)) +// return false; +// } +// for (int i = 0; i < Ystring.size(); i++) +// { +// YDim.push_back(QString(Ystring.at(i)).toFloat(isOK)); +// if (!(*isOK)) +// return false; +// } +// for (int i = 0; i < Zstring.size(); i++) +// { +// ZDim.push_back(QString(Zstring.at(i)).toFloat(isOK)); +// if (!(*isOK)) +// return false; +// } +// return true; +//} + +/*! + * \brief get Name + * \return the name + */ +QString MCCADGUI_GenPartDialog::getName() +{ + aName = Gen_le_name->text(); + return aName; +} + +/*! + * \brief return the intervals + * \param xDim + * \param yDim + * \param zDim + * \return + */ +bool MCCADGUI_GenPartDialog::getData (vector & xDim, vector & yDim, vector & zDim) +{ + + + + QStringList Xstring = Gen_le_X->text().trimmed().split(" "); + QStringList Ystring = Gen_le_Y->text().trimmed().split(" "); + QStringList Zstring = Gen_le_Z->text().trimmed().split(" "); + + XDim.clear(); + YDim.clear(); + ZDim.clear(); + + bool isOK; + //check and load the intervals into member + for (int i = 0; i < Xstring.size(); i++) + { +// XDim.push_back(QString(Xstring.at(i)).toFloat(isOK)); + XDim.push_back(Xstring.at(i).toFloat(&isOK)); + if (!isOK) + return false; + } + for (int i = 0; i < Ystring.size(); i++) + { +// YDim.push_back(QString(Ystring.at(i)).toFloat(isOK)); + YDim.push_back(Ystring.at(i).toFloat(&isOK)); + if (!isOK) + return false; + } + for (int i = 0; i < Zstring.size(); i++) + { +// ZDim.push_back(QString(Zstring.at(i)).toFloat(isOK)); + ZDim.push_back(Zstring.at(i).toFloat(&isOK)); + if (!isOK) + return false; + } + + xDim = XDim; + yDim = YDim; + zDim = ZDim; + return true; +} + + diff --git a/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog.h b/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog.h new file mode 100644 index 0000000..2a46543 --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog.h @@ -0,0 +1,37 @@ +#ifndef MCCADGUI_GENMESHDIALOG_H +#define MCCADGUI_GENMESHDIALOG_H +#include +#include "ui_GenPartDialog.h" +#include +#include + +using namespace std; + + + +class MCCADGUI_GenPartDialog: public LightApp_Dialog , public Ui::GenPartDialog +{ + Q_OBJECT + +public: + MCCADGUI_GenPartDialog(QWidget* ); + virtual ~MCCADGUI_GenPartDialog(); + +// virtual bool acceptData(); +// bool isOk() {return *isOK; } + bool getData (vector & xDim, vector & yDim, vector & zDim); + QString getName(); + + + +private: + QString aName ; + vector XDim; + vector YDim; + vector ZDim; + + + +}; + +#endif // MCCADGUI_GENMESHDIALOG_H diff --git a/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog_moc.cxx b/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog_moc.cxx new file mode 100644 index 0000000..034e171 --- /dev/null +++ b/src/MCCADGUI/tmp/MCCADGUI_GenMeshDialog_moc.cxx @@ -0,0 +1,71 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'MCCADGUI_GenPartDialog.h' +** +** Created: Wed Feb 27 09:41:14 2013 +** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "MCCADGUI_GenPartDialog.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'MCCADGUI_GenPartDialog.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 62 +#error "This file was generated using the moc from 4.6.2. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MCCADGUI_GenPartDialog[] = { + + // content: + 4, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +static const char qt_meta_stringdata_MCCADGUI_GenPartDialog[] = { + "MCCADGUI_GenPartDialog\0" +}; + +const QMetaObject MCCADGUI_GenPartDialog::staticMetaObject = { + { &LightApp_Dialog::staticMetaObject, qt_meta_stringdata_MCCADGUI_GenPartDialog, + qt_meta_data_MCCADGUI_GenPartDialog, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MCCADGUI_GenPartDialog::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MCCADGUI_GenPartDialog::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MCCADGUI_GenPartDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MCCADGUI_GenPartDialog)) + return static_cast(const_cast< MCCADGUI_GenPartDialog*>(this)); + if (!strcmp(_clname, "Ui::GenPartDialog")) + return static_cast< Ui::GenPartDialog*>(const_cast< MCCADGUI_GenPartDialog*>(this)); + return LightApp_Dialog::qt_metacast(_clname); +} + +int MCCADGUI_GenPartDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = LightApp_Dialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/MCCADGUI/tmp/ui_GenMeshDialog.h b/src/MCCADGUI/tmp/ui_GenMeshDialog.h new file mode 100644 index 0000000..a9d2e88 --- /dev/null +++ b/src/MCCADGUI/tmp/ui_GenMeshDialog.h @@ -0,0 +1,94 @@ +/******************************************************************************** +** Form generated from reading UI file 'GenMeshDialog.ui' +** +** Created: Wed Feb 6 10:26:05 2013 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_GENMESHDIALOG_H +#define UI_GENMESHDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_GenMeshDialog +{ +public: + QLineEdit *Gen_le_Y; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QLineEdit *Gen_le_X; + QLineEdit *Gen_le_Z; + QLabel *label_4; + QLineEdit *Gen_le_name; + + void setupUi(QDialog *GenMeshDialog) + { + if (GenMeshDialog->objectName().isEmpty()) + GenMeshDialog->setObjectName(QString::fromUtf8("GenMeshDialog")); + GenMeshDialog->resize(400, 230); + QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(GenMeshDialog->sizePolicy().hasHeightForWidth()); + GenMeshDialog->setSizePolicy(sizePolicy); + GenMeshDialog->setMinimumSize(QSize(400, 230)); + Gen_le_Y = new QLineEdit(GenMeshDialog); + Gen_le_Y->setObjectName(QString::fromUtf8("Gen_le_Y")); + Gen_le_Y->setGeometry(QRect(110, 100, 261, 27)); + label = new QLabel(GenMeshDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(20, 70, 81, 17)); + label_2 = new QLabel(GenMeshDialog); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(20, 110, 81, 17)); + label_3 = new QLabel(GenMeshDialog); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(20, 150, 81, 17)); + Gen_le_X = new QLineEdit(GenMeshDialog); + Gen_le_X->setObjectName(QString::fromUtf8("Gen_le_X")); + Gen_le_X->setGeometry(QRect(110, 60, 261, 27)); + Gen_le_Z = new QLineEdit(GenMeshDialog); + Gen_le_Z->setObjectName(QString::fromUtf8("Gen_le_Z")); + Gen_le_Z->setGeometry(QRect(110, 140, 261, 27)); + label_4 = new QLabel(GenMeshDialog); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(20, 30, 91, 17)); + Gen_le_name = new QLineEdit(GenMeshDialog); + Gen_le_name->setObjectName(QString::fromUtf8("Gen_le_name")); + Gen_le_name->setGeometry(QRect(110, 20, 113, 27)); + + retranslateUi(GenMeshDialog); + + QMetaObject::connectSlotsByName(GenMeshDialog); + } // setupUi + + void retranslateUi(QDialog *GenMeshDialog) + { + GenMeshDialog->setWindowTitle(QApplication::translate("GenMeshDialog", "Dialog", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("GenMeshDialog", "X intervals:", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("GenMeshDialog", "Y intervals:", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("GenMeshDialog", "Z intervals:", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("GenMeshDialog", "Mesh Name:", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class GenMeshDialog: public Ui_GenMeshDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_GENMESHDIALOG_H diff --git a/src/MCCADGUI/ui_ImportGEOMObjDialog.h b/src/MCCADGUI/ui_ImportGEOMObjDialog.h new file mode 100644 index 0000000..ad13ae7 --- /dev/null +++ b/src/MCCADGUI/ui_ImportGEOMObjDialog.h @@ -0,0 +1,101 @@ +/******************************************************************************** +** Form generated from reading UI file 'ImportGEOMObjDialog.ui' +** +** Created: Mon Dec 2 13:28:36 2013 +** by: Qt User Interface Compiler version 4.8.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_IMPORTGEOMOBJDIALOG_H +#define UI_IMPORTGEOMOBJDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MCCADGUI_ImportGEOMObjDialog +{ +public: + QLabel *label; + QLabel *label_2; + QLabel *lb_geom_name; + QLabel *lb_mccad_name; + QLabel *label_5; + QPushButton *Btn_ok; + QPushButton *Btn_cancel; + + void setupUi(QDialog *MCCADGUI_ImportGEOMObjDialog) + { + if (MCCADGUI_ImportGEOMObjDialog->objectName().isEmpty()) + MCCADGUI_ImportGEOMObjDialog->setObjectName(QString::fromUtf8("MCCADGUI_ImportGEOMObjDialog")); + MCCADGUI_ImportGEOMObjDialog->resize(349, 184); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MCCADGUI_ImportGEOMObjDialog->sizePolicy().hasHeightForWidth()); + MCCADGUI_ImportGEOMObjDialog->setSizePolicy(sizePolicy); + MCCADGUI_ImportGEOMObjDialog->setMinimumSize(QSize(0, 0)); + label = new QLabel(MCCADGUI_ImportGEOMObjDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(40, 30, 291, 41)); + QFont font; + font.setPointSize(11); + label->setFont(font); + label_2 = new QLabel(MCCADGUI_ImportGEOMObjDialog); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(40, 80, 62, 17)); + lb_geom_name = new QLabel(MCCADGUI_ImportGEOMObjDialog); + lb_geom_name->setObjectName(QString::fromUtf8("lb_geom_name")); + lb_geom_name->setGeometry(QRect(120, 80, 62, 17)); + QFont font1; + font1.setItalic(true); + lb_geom_name->setFont(font1); + lb_mccad_name = new QLabel(MCCADGUI_ImportGEOMObjDialog); + lb_mccad_name->setObjectName(QString::fromUtf8("lb_mccad_name")); + lb_mccad_name->setGeometry(QRect(120, 100, 111, 17)); + lb_mccad_name->setFont(font1); + label_5 = new QLabel(MCCADGUI_ImportGEOMObjDialog); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(40, 100, 62, 17)); + Btn_ok = new QPushButton(MCCADGUI_ImportGEOMObjDialog); + Btn_ok->setObjectName(QString::fromUtf8("Btn_ok")); + Btn_ok->setGeometry(QRect(40, 130, 93, 27)); + Btn_cancel = new QPushButton(MCCADGUI_ImportGEOMObjDialog); + Btn_cancel->setObjectName(QString::fromUtf8("Btn_cancel")); + Btn_cancel->setGeometry(QRect(180, 130, 93, 27)); + + retranslateUi(MCCADGUI_ImportGEOMObjDialog); + + QMetaObject::connectSlotsByName(MCCADGUI_ImportGEOMObjDialog); + } // setupUi + + void retranslateUi(QDialog *MCCADGUI_ImportGEOMObjDialog) + { + MCCADGUI_ImportGEOMObjDialog->setWindowTitle(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "Averaging Mesh", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "Please select a group or a part to assign\n" +"the geometry:", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "From:", 0, QApplication::UnicodeUTF8)); + lb_geom_name->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "No name", 0, QApplication::UnicodeUTF8)); + lb_mccad_name->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "No selected", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "To:", 0, QApplication::UnicodeUTF8)); + Btn_ok->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "OK", 0, QApplication::UnicodeUTF8)); + Btn_cancel->setText(QApplication::translate("MCCADGUI_ImportGEOMObjDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MCCADGUI_ImportGEOMObjDialog: public Ui_MCCADGUI_ImportGEOMObjDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_IMPORTGEOMOBJDIALOG_H diff --git a/src/MCCADGUI/ui_ImportObjDialog.h b/src/MCCADGUI/ui_ImportObjDialog.h new file mode 100644 index 0000000..4fe7834 --- /dev/null +++ b/src/MCCADGUI/ui_ImportObjDialog.h @@ -0,0 +1,101 @@ +/******************************************************************************** +** Form generated from reading UI file 'ImportObjDialog.ui' +** +** Created: Tue Apr 28 15:52:26 2015 +** by: Qt User Interface Compiler version 4.8.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_IMPORTOBJDIALOG_H +#define UI_IMPORTOBJDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MCCADGUI_ImportObjDialog +{ +public: + QLabel *label; + QLabel *label_2; + QLabel *lb_geom_name; + QLabel *lb_mccad_name; + QLabel *label_5; + QPushButton *Btn_ok; + QPushButton *Btn_cancel; + + void setupUi(QDialog *MCCADGUI_ImportObjDialog) + { + if (MCCADGUI_ImportObjDialog->objectName().isEmpty()) + MCCADGUI_ImportObjDialog->setObjectName(QString::fromUtf8("MCCADGUI_ImportObjDialog")); + MCCADGUI_ImportObjDialog->resize(349, 184); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MCCADGUI_ImportObjDialog->sizePolicy().hasHeightForWidth()); + MCCADGUI_ImportObjDialog->setSizePolicy(sizePolicy); + MCCADGUI_ImportObjDialog->setMinimumSize(QSize(0, 0)); + label = new QLabel(MCCADGUI_ImportObjDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(40, 30, 291, 41)); + QFont font; + font.setPointSize(11); + label->setFont(font); + label_2 = new QLabel(MCCADGUI_ImportObjDialog); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(40, 80, 62, 17)); + lb_geom_name = new QLabel(MCCADGUI_ImportObjDialog); + lb_geom_name->setObjectName(QString::fromUtf8("lb_geom_name")); + lb_geom_name->setGeometry(QRect(120, 80, 62, 17)); + QFont font1; + font1.setItalic(true); + lb_geom_name->setFont(font1); + lb_mccad_name = new QLabel(MCCADGUI_ImportObjDialog); + lb_mccad_name->setObjectName(QString::fromUtf8("lb_mccad_name")); + lb_mccad_name->setGeometry(QRect(120, 100, 111, 17)); + lb_mccad_name->setFont(font1); + label_5 = new QLabel(MCCADGUI_ImportObjDialog); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(40, 100, 62, 17)); + Btn_ok = new QPushButton(MCCADGUI_ImportObjDialog); + Btn_ok->setObjectName(QString::fromUtf8("Btn_ok")); + Btn_ok->setGeometry(QRect(40, 130, 93, 27)); + Btn_cancel = new QPushButton(MCCADGUI_ImportObjDialog); + Btn_cancel->setObjectName(QString::fromUtf8("Btn_cancel")); + Btn_cancel->setGeometry(QRect(180, 130, 93, 27)); + + retranslateUi(MCCADGUI_ImportObjDialog); + + QMetaObject::connectSlotsByName(MCCADGUI_ImportObjDialog); + } // setupUi + + void retranslateUi(QDialog *MCCADGUI_ImportObjDialog) + { + MCCADGUI_ImportObjDialog->setWindowTitle(QApplication::translate("MCCADGUI_ImportObjDialog", "Import objects", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "Please select a group or a part to assign\n" +"the geometry/mesh:", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "From:", 0, QApplication::UnicodeUTF8)); + lb_geom_name->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "No name", 0, QApplication::UnicodeUTF8)); + lb_mccad_name->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "No selected", 0, QApplication::UnicodeUTF8)); + label_5->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "To:", 0, QApplication::UnicodeUTF8)); + Btn_ok->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "OK", 0, QApplication::UnicodeUTF8)); + Btn_cancel->setText(QApplication::translate("MCCADGUI_ImportObjDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MCCADGUI_ImportObjDialog: public Ui_MCCADGUI_ImportObjDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_IMPORTOBJDIALOG_H diff --git a/src/MCCADGUI/ui_MCardDialog.h b/src/MCCADGUI/ui_MCardDialog.h new file mode 100644 index 0000000..3289415 --- /dev/null +++ b/src/MCCADGUI/ui_MCardDialog.h @@ -0,0 +1,159 @@ +/******************************************************************************** +** Form generated from reading UI file 'MCardDialog.ui' +** +** Created: Tue Apr 28 15:52:26 2015 +** by: Qt User Interface Compiler version 4.8.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_MCARDDIALOG_H +#define UI_MCARDDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MCCADGUI_MCardDialog +{ +public: + QTreeWidget *mMatTree; + QLineEdit *IDEdit; + QLineEdit *densityEdit; + QLineEdit *nameEdit; + QLabel *label; + QLabel *label_2; + QLabel *label_3; + QTextEdit *mCardText; + QPushButton *btnDelMat; + QPushButton *loadXMLButton; + QPushButton *saveXMLButton; + QPushButton *applyButton; + QPushButton *okButton; + QPushButton *cancelButton; + QLabel *label_4; + QPushButton *colorButton; + QLabel *label_5; + + void setupUi(QDialog *MCCADGUI_MCardDialog) + { + if (MCCADGUI_MCardDialog->objectName().isEmpty()) + MCCADGUI_MCardDialog->setObjectName(QString::fromUtf8("MCCADGUI_MCardDialog")); + MCCADGUI_MCardDialog->resize(895, 624); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MCCADGUI_MCardDialog->sizePolicy().hasHeightForWidth()); + MCCADGUI_MCardDialog->setSizePolicy(sizePolicy); + MCCADGUI_MCardDialog->setMinimumSize(QSize(895, 624)); + MCCADGUI_MCardDialog->setBaseSize(QSize(0, 0)); + mMatTree = new QTreeWidget(MCCADGUI_MCardDialog); + mMatTree->setObjectName(QString::fromUtf8("mMatTree")); + mMatTree->setGeometry(QRect(10, 40, 180, 510)); + mMatTree->setHeaderHidden(false); + mMatTree->setColumnCount(1); + mMatTree->header()->setVisible(true); + mMatTree->header()->setCascadingSectionResizes(false); + mMatTree->header()->setProperty("showSortIndicator", QVariant(false)); + IDEdit = new QLineEdit(MCCADGUI_MCardDialog); + IDEdit->setObjectName(QString::fromUtf8("IDEdit")); + IDEdit->setGeometry(QRect(240, 40, 71, 27)); + densityEdit = new QLineEdit(MCCADGUI_MCardDialog); + densityEdit->setObjectName(QString::fromUtf8("densityEdit")); + densityEdit->setGeometry(QRect(390, 40, 91, 27)); + nameEdit = new QLineEdit(MCCADGUI_MCardDialog); + nameEdit->setObjectName(QString::fromUtf8("nameEdit")); + nameEdit->setGeometry(QRect(560, 40, 161, 27)); + label = new QLabel(MCCADGUI_MCardDialog); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(210, 40, 31, 31)); + QFont font; + font.setPointSize(10); + label->setFont(font); + label_2 = new QLabel(MCCADGUI_MCardDialog); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(320, 40, 81, 31)); + label_2->setFont(font); + label_3 = new QLabel(MCCADGUI_MCardDialog); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(500, 40, 61, 31)); + label_3->setFont(font); + mCardText = new QTextEdit(MCCADGUI_MCardDialog); + mCardText->setObjectName(QString::fromUtf8("mCardText")); + mCardText->setGeometry(QRect(200, 75, 671, 475)); + btnDelMat = new QPushButton(MCCADGUI_MCardDialog); + btnDelMat->setObjectName(QString::fromUtf8("btnDelMat")); + btnDelMat->setGeometry(QRect(520, 580, 81, 27)); + loadXMLButton = new QPushButton(MCCADGUI_MCardDialog); + loadXMLButton->setObjectName(QString::fromUtf8("loadXMLButton")); + loadXMLButton->setGeometry(QRect(10, 580, 93, 27)); + saveXMLButton = new QPushButton(MCCADGUI_MCardDialog); + saveXMLButton->setObjectName(QString::fromUtf8("saveXMLButton")); + saveXMLButton->setGeometry(QRect(120, 580, 93, 27)); + applyButton = new QPushButton(MCCADGUI_MCardDialog); + applyButton->setObjectName(QString::fromUtf8("applyButton")); + applyButton->setGeometry(QRect(610, 580, 81, 27)); + okButton = new QPushButton(MCCADGUI_MCardDialog); + okButton->setObjectName(QString::fromUtf8("okButton")); + okButton->setGeometry(QRect(700, 580, 81, 27)); + cancelButton = new QPushButton(MCCADGUI_MCardDialog); + cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setGeometry(QRect(790, 580, 81, 27)); + label_4 = new QLabel(MCCADGUI_MCardDialog); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(730, 40, 61, 31)); + label_4->setFont(font); + colorButton = new QPushButton(MCCADGUI_MCardDialog); + colorButton->setObjectName(QString::fromUtf8("colorButton")); + colorButton->setGeometry(QRect(780, 40, 51, 27)); + colorButton->setStyleSheet(QString::fromUtf8("QPushButton {\n" +"background:rgb(255, 255, 0)\n" +"}")); + label_5 = new QLabel(MCCADGUI_MCardDialog); + label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setGeometry(QRect(200, 560, 361, 16)); + label_5->setFont(font); + + retranslateUi(MCCADGUI_MCardDialog); + + QMetaObject::connectSlotsByName(MCCADGUI_MCardDialog); + } // setupUi + + void retranslateUi(QDialog *MCCADGUI_MCardDialog) + { + MCCADGUI_MCardDialog->setWindowTitle(QApplication::translate("MCCADGUI_MCardDialog", "Material management", 0, QApplication::UnicodeUTF8)); + QTreeWidgetItem *___qtreewidgetitem = mMatTree->headerItem(); + ___qtreewidgetitem->setText(0, QApplication::translate("MCCADGUI_MCardDialog", "Material", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MCCADGUI_MCardDialog", "ID:", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MCCADGUI_MCardDialog", "Density:", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("MCCADGUI_MCardDialog", "Name:", 0, QApplication::UnicodeUTF8)); + btnDelMat->setText(QApplication::translate("MCCADGUI_MCardDialog", "Delete", 0, QApplication::UnicodeUTF8)); + loadXMLButton->setText(QApplication::translate("MCCADGUI_MCardDialog", "Import", 0, QApplication::UnicodeUTF8)); + saveXMLButton->setText(QApplication::translate("MCCADGUI_MCardDialog", "Export", 0, QApplication::UnicodeUTF8)); + applyButton->setText(QApplication::translate("MCCADGUI_MCardDialog", "Apply", 0, QApplication::UnicodeUTF8)); + okButton->setText(QApplication::translate("MCCADGUI_MCardDialog", "OK", 0, QApplication::UnicodeUTF8)); + cancelButton->setText(QApplication::translate("MCCADGUI_MCardDialog", "Cancel", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("MCCADGUI_MCardDialog", "Color:", 0, QApplication::UnicodeUTF8)); + colorButton->setText(QString()); + label_5->setText(QApplication::translate("MCCADGUI_MCardDialog", "*Fill the above box to add or edit material properties.", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MCCADGUI_MCardDialog: public Ui_MCCADGUI_MCardDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MCARDDIALOG_H diff --git a/src/MCCADGUI/ui_SetPropertyDialog.h b/src/MCCADGUI/ui_SetPropertyDialog.h new file mode 100644 index 0000000..b10470d --- /dev/null +++ b/src/MCCADGUI/ui_SetPropertyDialog.h @@ -0,0 +1,184 @@ +/******************************************************************************** +** Form generated from reading UI file 'SetPropertyDialog.ui' +** +** Created: Tue Apr 28 15:52:26 2015 +** by: Qt User Interface Compiler version 4.8.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_SETPROPERTYDIALOG_H +#define UI_SETPROPERTYDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MCCADGUI_SetPropertyDialog +{ +public: + QGroupBox *gb_Material; + QLabel *label; + QComboBox *cmb_mat_id; + QCheckBox *chk_recolor; + QPushButton *Btn_edit_mat; + QGroupBox *gb_Imp; + QLabel *label_2; + QLabel *label_3; + QLabel *label_4; + QLineEdit *le_imp_n; + QLineEdit *le_imp_p; + QLineEdit *le_imp_e; + QPushButton *Btn_apply; + QPushButton *Btn_close; + QGroupBox *gb_Remark; + QTextEdit *tb_remark; + QGroupBox *gb_Additive; + QTextEdit *tb_add_card; + QGroupBox *gb_Graphic; + QPushButton *Btn_color; + QLabel *label_7; + + void setupUi(QDialog *MCCADGUI_SetPropertyDialog) + { + if (MCCADGUI_SetPropertyDialog->objectName().isEmpty()) + MCCADGUI_SetPropertyDialog->setObjectName(QString::fromUtf8("MCCADGUI_SetPropertyDialog")); + MCCADGUI_SetPropertyDialog->resize(250, 642); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MCCADGUI_SetPropertyDialog->sizePolicy().hasHeightForWidth()); + MCCADGUI_SetPropertyDialog->setSizePolicy(sizePolicy); + MCCADGUI_SetPropertyDialog->setMinimumSize(QSize(220, 10)); + MCCADGUI_SetPropertyDialog->setBaseSize(QSize(0, 0)); + gb_Material = new QGroupBox(MCCADGUI_SetPropertyDialog); + gb_Material->setObjectName(QString::fromUtf8("gb_Material")); + gb_Material->setEnabled(true); + gb_Material->setGeometry(QRect(20, 20, 180, 131)); + gb_Material->setCheckable(true); + gb_Material->setChecked(false); + label = new QLabel(gb_Material); + label->setObjectName(QString::fromUtf8("label")); + label->setGeometry(QRect(10, 35, 41, 21)); + QFont font; + font.setPointSize(11); + label->setFont(font); + cmb_mat_id = new QComboBox(gb_Material); + cmb_mat_id->setObjectName(QString::fromUtf8("cmb_mat_id")); + cmb_mat_id->setGeometry(QRect(40, 30, 130, 27)); + chk_recolor = new QCheckBox(gb_Material); + chk_recolor->setObjectName(QString::fromUtf8("chk_recolor")); + chk_recolor->setGeometry(QRect(40, 60, 141, 22)); + Btn_edit_mat = new QPushButton(gb_Material); + Btn_edit_mat->setObjectName(QString::fromUtf8("Btn_edit_mat")); + Btn_edit_mat->setGeometry(QRect(40, 90, 130, 27)); + gb_Imp = new QGroupBox(MCCADGUI_SetPropertyDialog); + gb_Imp->setObjectName(QString::fromUtf8("gb_Imp")); + gb_Imp->setGeometry(QRect(20, 160, 180, 131)); + gb_Imp->setCheckable(true); + gb_Imp->setChecked(false); + label_2 = new QLabel(gb_Imp); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(10, 30, 41, 21)); + label_2->setFont(font); + label_3 = new QLabel(gb_Imp); + label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setGeometry(QRect(10, 60, 41, 31)); + label_3->setFont(font); + label_4 = new QLabel(gb_Imp); + label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setGeometry(QRect(10, 90, 41, 21)); + label_4->setFont(font); + le_imp_n = new QLineEdit(gb_Imp); + le_imp_n->setObjectName(QString::fromUtf8("le_imp_n")); + le_imp_n->setGeometry(QRect(40, 30, 130, 24)); + le_imp_p = new QLineEdit(gb_Imp); + le_imp_p->setObjectName(QString::fromUtf8("le_imp_p")); + le_imp_p->setGeometry(QRect(40, 60, 130, 24)); + le_imp_e = new QLineEdit(gb_Imp); + le_imp_e->setObjectName(QString::fromUtf8("le_imp_e")); + le_imp_e->setGeometry(QRect(40, 90, 130, 24)); + Btn_apply = new QPushButton(MCCADGUI_SetPropertyDialog); + Btn_apply->setObjectName(QString::fromUtf8("Btn_apply")); + Btn_apply->setGeometry(QRect(30, 590, 80, 27)); + Btn_close = new QPushButton(MCCADGUI_SetPropertyDialog); + Btn_close->setObjectName(QString::fromUtf8("Btn_close")); + Btn_close->setGeometry(QRect(130, 590, 80, 27)); + gb_Remark = new QGroupBox(MCCADGUI_SetPropertyDialog); + gb_Remark->setObjectName(QString::fromUtf8("gb_Remark")); + gb_Remark->setGeometry(QRect(20, 360, 201, 111)); + gb_Remark->setCheckable(true); + gb_Remark->setChecked(false); + tb_remark = new QTextEdit(gb_Remark); + tb_remark->setObjectName(QString::fromUtf8("tb_remark")); + tb_remark->setGeometry(QRect(10, 30, 181, 71)); + gb_Additive = new QGroupBox(MCCADGUI_SetPropertyDialog); + gb_Additive->setObjectName(QString::fromUtf8("gb_Additive")); + gb_Additive->setGeometry(QRect(20, 480, 201, 101)); + gb_Additive->setCheckable(true); + gb_Additive->setChecked(false); + tb_add_card = new QTextEdit(gb_Additive); + tb_add_card->setObjectName(QString::fromUtf8("tb_add_card")); + tb_add_card->setGeometry(QRect(10, 20, 181, 71)); + gb_Graphic = new QGroupBox(MCCADGUI_SetPropertyDialog); + gb_Graphic->setObjectName(QString::fromUtf8("gb_Graphic")); + gb_Graphic->setGeometry(QRect(20, 290, 181, 61)); + gb_Graphic->setCheckable(true); + gb_Graphic->setChecked(false); + Btn_color = new QPushButton(gb_Graphic); + Btn_color->setObjectName(QString::fromUtf8("Btn_color")); + Btn_color->setGeometry(QRect(70, 30, 81, 27)); + Btn_color->setStyleSheet(QString::fromUtf8("QPushButton {\n" +"background:rgb(255, 170, 0)\n" +"}")); + label_7 = new QLabel(gb_Graphic); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(20, 30, 61, 31)); + label_7->setFont(font); + + retranslateUi(MCCADGUI_SetPropertyDialog); + + QMetaObject::connectSlotsByName(MCCADGUI_SetPropertyDialog); + } // setupUi + + void retranslateUi(QDialog *MCCADGUI_SetPropertyDialog) + { + MCCADGUI_SetPropertyDialog->setWindowTitle(QApplication::translate("MCCADGUI_SetPropertyDialog", "Properties", 0, QApplication::UnicodeUTF8)); + gb_Material->setTitle(QApplication::translate("MCCADGUI_SetPropertyDialog", "Material", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "ID:", 0, QApplication::UnicodeUTF8)); + chk_recolor->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "Replace Color", 0, QApplication::UnicodeUTF8)); + Btn_edit_mat->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "Edit Material", 0, QApplication::UnicodeUTF8)); + gb_Imp->setTitle(QApplication::translate("MCCADGUI_SetPropertyDialog", "Importance", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "N:", 0, QApplication::UnicodeUTF8)); + label_3->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "P:", 0, QApplication::UnicodeUTF8)); + label_4->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "E:", 0, QApplication::UnicodeUTF8)); + Btn_apply->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "Apply", 0, QApplication::UnicodeUTF8)); + Btn_close->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "Close", 0, QApplication::UnicodeUTF8)); + gb_Remark->setTitle(QApplication::translate("MCCADGUI_SetPropertyDialog", "Remark", 0, QApplication::UnicodeUTF8)); + gb_Additive->setTitle(QApplication::translate("MCCADGUI_SetPropertyDialog", "Additive Cards:", 0, QApplication::UnicodeUTF8)); + gb_Graphic->setTitle(QApplication::translate("MCCADGUI_SetPropertyDialog", "Graphic", 0, QApplication::UnicodeUTF8)); + Btn_color->setText(QString()); + label_7->setText(QApplication::translate("MCCADGUI_SetPropertyDialog", "Color:", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MCCADGUI_SetPropertyDialog: public Ui_MCCADGUI_SetPropertyDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_SETPROPERTYDIALOG_H diff --git a/src/MCCADGUI/ui_TransformDialog.h b/src/MCCADGUI/ui_TransformDialog.h new file mode 100644 index 0000000..948b3cc --- /dev/null +++ b/src/MCCADGUI/ui_TransformDialog.h @@ -0,0 +1,168 @@ +/******************************************************************************** +** Form generated from reading UI file 'TransformDialog.ui' +** +** Created: Tue Apr 28 15:52:26 2015 +** by: Qt User Interface Compiler version 4.8.4 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_TRANSFORMDIALOG_H +#define UI_TRANSFORMDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MCCADGUI_TransformDialog +{ +public: + QGroupBox *gb_tsl; + QLabel *label_2; + QLineEdit *le_tsl_x; + QLineEdit *le_tsl_y; + QLineEdit *le_tsl_z; + QPushButton *Btn_apply; + QPushButton *Btn_close; + QGroupBox *gb_scl; + QLabel *label_10; + QLineEdit *le_scl_ft; + QGroupBox *gb_rt; + QLabel *label_7; + QLineEdit *le_rt_org_z; + QLineEdit *le_rt_org_y; + QLineEdit *le_rt_org_x; + QLineEdit *le_rt_dir_y; + QLineEdit *le_rt_dir_z; + QLineEdit *le_rt_dir_x; + QLabel *label_8; + QLabel *label_9; + QLineEdit *le_rt_ang; + + void setupUi(QDialog *MCCADGUI_TransformDialog) + { + if (MCCADGUI_TransformDialog->objectName().isEmpty()) + MCCADGUI_TransformDialog->setObjectName(QString::fromUtf8("MCCADGUI_TransformDialog")); + MCCADGUI_TransformDialog->resize(416, 368); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MCCADGUI_TransformDialog->sizePolicy().hasHeightForWidth()); + MCCADGUI_TransformDialog->setSizePolicy(sizePolicy); + MCCADGUI_TransformDialog->setMinimumSize(QSize(220, 10)); + MCCADGUI_TransformDialog->setBaseSize(QSize(0, 0)); + gb_tsl = new QGroupBox(MCCADGUI_TransformDialog); + gb_tsl->setObjectName(QString::fromUtf8("gb_tsl")); + gb_tsl->setGeometry(QRect(30, 30, 361, 61)); + gb_tsl->setCheckable(true); + gb_tsl->setChecked(false); + label_2 = new QLabel(gb_tsl); + label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setGeometry(QRect(30, 30, 51, 21)); + QFont font; + font.setPointSize(11); + label_2->setFont(font); + le_tsl_x = new QLineEdit(gb_tsl); + le_tsl_x->setObjectName(QString::fromUtf8("le_tsl_x")); + le_tsl_x->setGeometry(QRect(100, 30, 61, 24)); + le_tsl_y = new QLineEdit(gb_tsl); + le_tsl_y->setObjectName(QString::fromUtf8("le_tsl_y")); + le_tsl_y->setGeometry(QRect(180, 30, 61, 24)); + le_tsl_z = new QLineEdit(gb_tsl); + le_tsl_z->setObjectName(QString::fromUtf8("le_tsl_z")); + le_tsl_z->setGeometry(QRect(260, 30, 61, 24)); + Btn_apply = new QPushButton(MCCADGUI_TransformDialog); + Btn_apply->setObjectName(QString::fromUtf8("Btn_apply")); + Btn_apply->setGeometry(QRect(200, 320, 80, 27)); + Btn_close = new QPushButton(MCCADGUI_TransformDialog); + Btn_close->setObjectName(QString::fromUtf8("Btn_close")); + Btn_close->setGeometry(QRect(300, 320, 80, 27)); + gb_scl = new QGroupBox(MCCADGUI_TransformDialog); + gb_scl->setObjectName(QString::fromUtf8("gb_scl")); + gb_scl->setGeometry(QRect(30, 250, 361, 61)); + gb_scl->setCheckable(true); + gb_scl->setChecked(false); + label_10 = new QLabel(gb_scl); + label_10->setObjectName(QString::fromUtf8("label_10")); + label_10->setGeometry(QRect(30, 30, 111, 31)); + label_10->setFont(font); + le_scl_ft = new QLineEdit(gb_scl); + le_scl_ft->setObjectName(QString::fromUtf8("le_scl_ft")); + le_scl_ft->setGeometry(QRect(140, 30, 81, 24)); + gb_rt = new QGroupBox(MCCADGUI_TransformDialog); + gb_rt->setObjectName(QString::fromUtf8("gb_rt")); + gb_rt->setGeometry(QRect(30, 100, 361, 141)); + gb_rt->setCheckable(true); + gb_rt->setChecked(false); + label_7 = new QLabel(gb_rt); + label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setGeometry(QRect(30, 30, 61, 31)); + label_7->setFont(font); + le_rt_org_z = new QLineEdit(gb_rt); + le_rt_org_z->setObjectName(QString::fromUtf8("le_rt_org_z")); + le_rt_org_z->setGeometry(QRect(260, 30, 61, 24)); + le_rt_org_y = new QLineEdit(gb_rt); + le_rt_org_y->setObjectName(QString::fromUtf8("le_rt_org_y")); + le_rt_org_y->setGeometry(QRect(180, 30, 61, 24)); + le_rt_org_x = new QLineEdit(gb_rt); + le_rt_org_x->setObjectName(QString::fromUtf8("le_rt_org_x")); + le_rt_org_x->setGeometry(QRect(100, 30, 61, 24)); + le_rt_dir_y = new QLineEdit(gb_rt); + le_rt_dir_y->setObjectName(QString::fromUtf8("le_rt_dir_y")); + le_rt_dir_y->setGeometry(QRect(180, 70, 61, 24)); + le_rt_dir_z = new QLineEdit(gb_rt); + le_rt_dir_z->setObjectName(QString::fromUtf8("le_rt_dir_z")); + le_rt_dir_z->setGeometry(QRect(260, 70, 61, 24)); + le_rt_dir_x = new QLineEdit(gb_rt); + le_rt_dir_x->setObjectName(QString::fromUtf8("le_rt_dir_x")); + le_rt_dir_x->setGeometry(QRect(100, 70, 61, 24)); + label_8 = new QLabel(gb_rt); + label_8->setObjectName(QString::fromUtf8("label_8")); + label_8->setGeometry(QRect(30, 70, 71, 31)); + label_8->setFont(font); + label_9 = new QLabel(gb_rt); + label_9->setObjectName(QString::fromUtf8("label_9")); + label_9->setGeometry(QRect(30, 110, 111, 31)); + label_9->setFont(font); + le_rt_ang = new QLineEdit(gb_rt); + le_rt_ang->setObjectName(QString::fromUtf8("le_rt_ang")); + le_rt_ang->setGeometry(QRect(140, 110, 81, 24)); + + retranslateUi(MCCADGUI_TransformDialog); + + QMetaObject::connectSlotsByName(MCCADGUI_TransformDialog); + } // setupUi + + void retranslateUi(QDialog *MCCADGUI_TransformDialog) + { + MCCADGUI_TransformDialog->setWindowTitle(QApplication::translate("MCCADGUI_TransformDialog", "Transformation", 0, QApplication::UnicodeUTF8)); + gb_tsl->setTitle(QApplication::translate("MCCADGUI_TransformDialog", "Translation", 0, QApplication::UnicodeUTF8)); + label_2->setText(QApplication::translate("MCCADGUI_TransformDialog", "Vector", 0, QApplication::UnicodeUTF8)); + Btn_apply->setText(QApplication::translate("MCCADGUI_TransformDialog", "Apply", 0, QApplication::UnicodeUTF8)); + Btn_close->setText(QApplication::translate("MCCADGUI_TransformDialog", "Close", 0, QApplication::UnicodeUTF8)); + gb_scl->setTitle(QApplication::translate("MCCADGUI_TransformDialog", "Scaling", 0, QApplication::UnicodeUTF8)); + label_10->setText(QApplication::translate("MCCADGUI_TransformDialog", "Factor", 0, QApplication::UnicodeUTF8)); + gb_rt->setTitle(QApplication::translate("MCCADGUI_TransformDialog", "Rotation", 0, QApplication::UnicodeUTF8)); + label_7->setText(QApplication::translate("MCCADGUI_TransformDialog", "Origin", 0, QApplication::UnicodeUTF8)); + label_8->setText(QApplication::translate("MCCADGUI_TransformDialog", "Direction", 0, QApplication::UnicodeUTF8)); + label_9->setText(QApplication::translate("MCCADGUI_TransformDialog", "Angle(Degree)", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MCCADGUI_TransformDialog: public Ui_MCCADGUI_TransformDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_TRANSFORMDIALOG_H diff --git a/src/TETGEN/CMakeLists.txt b/src/TETGEN/CMakeLists.txt new file mode 100644 index 0000000..d0be2e0 --- /dev/null +++ b/src/TETGEN/CMakeLists.txt @@ -0,0 +1,32 @@ +# Set the minimum required version of cmake for a project. +#qiu cmake_minimum_required(VERSION 2.6) +#qiu SET(CMAKE_BUILD_TYPE Release) +# Add an executable to the project using the specified source files. +#qiu add_executable(tetgen tetgen.cxx predicates.cxx) + +#Add a library to the project using the specified source files. +# In Linux/Unix, it will creates the libtet.a + +ADD_DEFINITIONS( + -DTETLIBRARY + ) +IF(WIN32) +##qiu##ATTENTION:: we consider WIN64 by default, if not remove "-D_WIN64" in the following line + + ADD_DEFINITIONS(-D_MSC_VER -D_WIN64) +ENDIF(WIN32) + +add_library(Tetgen SHARED tetgen.cxx predicates.cxx) + +#Set properties on a target. +#We use this here to set -DTETLIBRARY for when compiling the +#library +#qiu set_target_properties(tet PROPERTIES "COMPILE_DEFINITIONS" TETLIBRARY) + +#qiu integrate TETGEN into the compilation of McCad +INSTALL(TARGETS Tetgen EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES tetgen.h DESTINATION ${SALOME_INSTALL_HEADERS}) + + + diff --git a/src/TETGEN/LICENSE b/src/TETGEN/LICENSE new file mode 100644 index 0000000..65e5262 --- /dev/null +++ b/src/TETGEN/LICENSE @@ -0,0 +1,66 @@ +TetGen License +-------------- + +The software (TetGen) is licensed under the terms of the MIT license +with the following exceptions: + +Distribution of modified versions of this code is permissible UNDER +THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT IN THE +SAME SOURCE FILES tetgen.h AND tetgen.cxx REMAIN UNDER COPYRIGHT OF +THE ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE MADE FREELY +AVAILABLE WITHOUT CHARGE, AND CLEAR NOTICE IS GIVEN OF THE +MODIFICATIONS. + +Distribution of this code for any commercial purpose is permissible +ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNER. + +The full license text is reproduced below. + +This means that TetGen is no free software, but for private, research, +and educational purposes it can be used at absolutely no cost and +without further arrangements. + + +For details, see http://tetgen.berlios.de + +============================================================================== + +TetGen +A Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator +Version 1.4 (Released on January 14, 2006). + +Copyright 2002, 2004, 2005, 2006 +Hang Si +Rathausstr. 9, 10178 Berlin, Germany +si@wias-berlin.de + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +Distribution of modified versions of this code is permissible UNDER +THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT IN THE +SAME SOURCE FILES tetgen.h AND tetgen.cxx REMAIN UNDER COPYRIGHT OF +THE ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE MADE FREELY +AVAILABLE WITHOUT CHARGE, AND CLEAR NOTICE IS GIVEN OF THE +MODIFICATIONS. + +Distribution of this code for any commercial purpose is permissible +ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNER. + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +============================================================================== \ No newline at end of file diff --git a/src/TETGEN/README b/src/TETGEN/README new file mode 100644 index 0000000..a9805ca --- /dev/null +++ b/src/TETGEN/README @@ -0,0 +1,25 @@ +This is TetGen version 1.4.3 (released on September 6, 2009, updated on December 13, 2010, updated on January 19, 2011, updated on April 15, 2011) + +Please see the documentation of TetGen for compiling and using TetGen. +It is available at the following link: + + http://tetgen.berlios.de/index.html + +TetGen may be freely copied, modified, and redistributed under the +copyright notices stated in the file LICENSE. + +Please send bugs/comments to Hang Si + +Thank you and enjoy! + +Hang Si +January 19, 2011 + + +###### ATTENTION ####### +This version of tetgen is changed slightly for McCad mesh genration. +Using of official Tetgen distribution would cause error. + +Yuefeng Qiu +27.08.2015 +Karlsruhe Institute of Technology diff --git a/src/TETGEN/predicates.cxx b/src/TETGEN/predicates.cxx new file mode 100644 index 0000000..bc0bd39 --- /dev/null +++ b/src/TETGEN/predicates.cxx @@ -0,0 +1,4187 @@ +/*****************************************************************************/ +/* */ +/* Routines for Arbitrary Precision Floating-point Arithmetic */ +/* and Fast Robust Geometric Predicates */ +/* (predicates.c) */ +/* */ +/* May 18, 1996 */ +/* */ +/* Placed in the public domain by */ +/* Jonathan Richard Shewchuk */ +/* School of Computer Science */ +/* Carnegie Mellon University */ +/* 5000 Forbes Avenue */ +/* Pittsburgh, Pennsylvania 15213-3891 */ +/* jrs@cs.cmu.edu */ +/* */ +/* This file contains C implementation of algorithms for exact addition */ +/* and multiplication of floating-point numbers, and predicates for */ +/* robustly performing the orientation and incircle tests used in */ +/* computational geometry. The algorithms and underlying theory are */ +/* described in Jonathan Richard Shewchuk. "Adaptive Precision Floating- */ +/* Point Arithmetic and Fast Robust Geometric Predicates." Technical */ +/* Report CMU-CS-96-140, School of Computer Science, Carnegie Mellon */ +/* University, Pittsburgh, Pennsylvania, May 1996. (Submitted to */ +/* Discrete & Computational Geometry.) */ +/* */ +/* This file, the paper listed above, and other information are available */ +/* from the Web page http://www.cs.cmu.edu/~quake/robust.html . */ +/* */ +/*****************************************************************************/ + +/*****************************************************************************/ +/* */ +/* Using this code: */ +/* */ +/* First, read the short or long version of the paper (from the Web page */ +/* above). */ +/* */ +/* Be sure to call exactinit() once, before calling any of the arithmetic */ +/* functions or geometric predicates. Also be sure to turn on the */ +/* optimizer when compiling this file. */ +/* */ +/* */ +/* Several geometric predicates are defined. Their parameters are all */ +/* points. Each point is an array of two or three floating-point */ +/* numbers. The geometric predicates, described in the papers, are */ +/* */ +/* orient2d(pa, pb, pc) */ +/* orient2dfast(pa, pb, pc) */ +/* orient3d(pa, pb, pc, pd) */ +/* orient3dfast(pa, pb, pc, pd) */ +/* incircle(pa, pb, pc, pd) */ +/* incirclefast(pa, pb, pc, pd) */ +/* insphere(pa, pb, pc, pd, pe) */ +/* inspherefast(pa, pb, pc, pd, pe) */ +/* */ +/* Those with suffix "fast" are approximate, non-robust versions. Those */ +/* without the suffix are adaptive precision, robust versions. There */ +/* are also versions with the suffices "exact" and "slow", which are */ +/* non-adaptive, exact arithmetic versions, which I use only for timings */ +/* in my arithmetic papers. */ +/* */ +/* */ +/* An expansion is represented by an array of floating-point numbers, */ +/* sorted from smallest to largest magnitude (possibly with interspersed */ +/* zeros). The length of each expansion is stored as a separate integer, */ +/* and each arithmetic function returns an integer which is the length */ +/* of the expansion it created. */ +/* */ +/* Several arithmetic functions are defined. Their parameters are */ +/* */ +/* e, f Input expansions */ +/* elen, flen Lengths of input expansions (must be >= 1) */ +/* h Output expansion */ +/* b Input scalar */ +/* */ +/* The arithmetic functions are */ +/* */ +/* grow_expansion(elen, e, b, h) */ +/* grow_expansion_zeroelim(elen, e, b, h) */ +/* expansion_sum(elen, e, flen, f, h) */ +/* expansion_sum_zeroelim1(elen, e, flen, f, h) */ +/* expansion_sum_zeroelim2(elen, e, flen, f, h) */ +/* fast_expansion_sum(elen, e, flen, f, h) */ +/* fast_expansion_sum_zeroelim(elen, e, flen, f, h) */ +/* linear_expansion_sum(elen, e, flen, f, h) */ +/* linear_expansion_sum_zeroelim(elen, e, flen, f, h) */ +/* scale_expansion(elen, e, b, h) */ +/* scale_expansion_zeroelim(elen, e, b, h) */ +/* compress(elen, e, h) */ +/* */ +/* All of these are described in the long version of the paper; some are */ +/* described in the short version. All return an integer that is the */ +/* length of h. Those with suffix _zeroelim perform zero elimination, */ +/* and are recommended over their counterparts. The procedure */ +/* fast_expansion_sum_zeroelim() (or linear_expansion_sum_zeroelim() on */ +/* processors that do not use the round-to-even tiebreaking rule) is */ +/* recommended over expansion_sum_zeroelim(). Each procedure has a */ +/* little note next to it (in the code below) that tells you whether or */ +/* not the output expansion may be the same array as one of the input */ +/* expansions. */ +/* */ +/* */ +/* If you look around below, you'll also find macros for a bunch of */ +/* simple unrolled arithmetic operations, and procedures for printing */ +/* expansions (commented out because they don't work with all C */ +/* compilers) and for generating random floating-point numbers whose */ +/* significand bits are all random. Most of the macros have undocumented */ +/* requirements that certain of their parameters should not be the same */ +/* variable; for safety, better to make sure all the parameters are */ +/* distinct variables. Feel free to send email to jrs@cs.cmu.edu if you */ +/* have questions. */ +/* */ +/*****************************************************************************/ + +#include +#include +#include +#ifdef CPU86 +#include +#endif /* CPU86 */ +#ifdef LINUX +#include +#endif /* LINUX */ + +#include "tetgen.h" // Defines the symbol REAL (float or double). + +/* On some machines, the exact arithmetic routines might be defeated by the */ +/* use of internal extended precision floating-point registers. Sometimes */ +/* this problem can be fixed by defining certain values to be volatile, */ +/* thus forcing them to be stored to memory and rounded off. This isn't */ +/* a great solution, though, as it slows the arithmetic down. */ +/* */ +/* To try this out, write "#define INEXACT volatile" below. Normally, */ +/* however, INEXACT should be defined to be nothing. ("#define INEXACT".) */ + +#define INEXACT /* Nothing */ +/* #define INEXACT volatile */ + +/* #define REAL double */ /* float or double */ +#define REALPRINT doubleprint +#define REALRAND doublerand +#define NARROWRAND narrowdoublerand +#define UNIFORMRAND uniformdoublerand + +/* Which of the following two methods of finding the absolute values is */ +/* fastest is compiler-dependent. A few compilers can inline and optimize */ +/* the fabs() call; but most will incur the overhead of a function call, */ +/* which is disastrously slow. A faster way on IEEE machines might be to */ +/* mask the appropriate bit, but that's difficult to do in C. */ + +#define Absolute(a) ((a) >= 0.0 ? (a) : -(a)) +/* #define Absolute(a) fabs(a) */ + +/* Many of the operations are broken up into two pieces, a main part that */ +/* performs an approximate operation, and a "tail" that computes the */ +/* roundoff error of that operation. */ +/* */ +/* The operations Fast_Two_Sum(), Fast_Two_Diff(), Two_Sum(), Two_Diff(), */ +/* Split(), and Two_Product() are all implemented as described in the */ +/* reference. Each of these macros requires certain variables to be */ +/* defined in the calling routine. The variables `bvirt', `c', `abig', */ +/* `_i', `_j', `_k', `_l', `_m', and `_n' are declared `INEXACT' because */ +/* they store the result of an operation that may incur roundoff error. */ +/* The input parameter `x' (or the highest numbered `x_' parameter) must */ +/* also be declared `INEXACT'. */ + +#define Fast_Two_Sum_Tail(a, b, x, y) \ + bvirt = x - a; \ + y = b - bvirt + +#define Fast_Two_Sum(a, b, x, y) \ + x = (REAL) (a + b); \ + Fast_Two_Sum_Tail(a, b, x, y) + +#define Fast_Two_Diff_Tail(a, b, x, y) \ + bvirt = a - x; \ + y = bvirt - b + +#define Fast_Two_Diff(a, b, x, y) \ + x = (REAL) (a - b); \ + Fast_Two_Diff_Tail(a, b, x, y) + +#define Two_Sum_Tail(a, b, x, y) \ + bvirt = (REAL) (x - a); \ + avirt = x - bvirt; \ + bround = b - bvirt; \ + around = a - avirt; \ + y = around + bround + +#define Two_Sum(a, b, x, y) \ + x = (REAL) (a + b); \ + Two_Sum_Tail(a, b, x, y) + +#define Two_Diff_Tail(a, b, x, y) \ + bvirt = (REAL) (a - x); \ + avirt = x + bvirt; \ + bround = bvirt - b; \ + around = a - avirt; \ + y = around + bround + +#define Two_Diff(a, b, x, y) \ + x = (REAL) (a - b); \ + Two_Diff_Tail(a, b, x, y) + +#define Split(a, ahi, alo) \ + c = (REAL) (splitter * a); \ + abig = (REAL) (c - a); \ + ahi = c - abig; \ + alo = a - ahi + +#define Two_Product_Tail(a, b, x, y) \ + Split(a, ahi, alo); \ + Split(b, bhi, blo); \ + err1 = x - (ahi * bhi); \ + err2 = err1 - (alo * bhi); \ + err3 = err2 - (ahi * blo); \ + y = (alo * blo) - err3 + +#define Two_Product(a, b, x, y) \ + x = (REAL) (a * b); \ + Two_Product_Tail(a, b, x, y) + +/* Two_Product_Presplit() is Two_Product() where one of the inputs has */ +/* already been split. Avoids redundant splitting. */ + +#define Two_Product_Presplit(a, b, bhi, blo, x, y) \ + x = (REAL) (a * b); \ + Split(a, ahi, alo); \ + err1 = x - (ahi * bhi); \ + err2 = err1 - (alo * bhi); \ + err3 = err2 - (ahi * blo); \ + y = (alo * blo) - err3 + +/* Two_Product_2Presplit() is Two_Product() where both of the inputs have */ +/* already been split. Avoids redundant splitting. */ + +#define Two_Product_2Presplit(a, ahi, alo, b, bhi, blo, x, y) \ + x = (REAL) (a * b); \ + err1 = x - (ahi * bhi); \ + err2 = err1 - (alo * bhi); \ + err3 = err2 - (ahi * blo); \ + y = (alo * blo) - err3 + +/* Square() can be done more quickly than Two_Product(). */ + +#define Square_Tail(a, x, y) \ + Split(a, ahi, alo); \ + err1 = x - (ahi * ahi); \ + err3 = err1 - ((ahi + ahi) * alo); \ + y = (alo * alo) - err3 + +#define Square(a, x, y) \ + x = (REAL) (a * a); \ + Square_Tail(a, x, y) + +/* Macros for summing expansions of various fixed lengths. These are all */ +/* unrolled versions of Expansion_Sum(). */ + +#define Two_One_Sum(a1, a0, b, x2, x1, x0) \ + Two_Sum(a0, b , _i, x0); \ + Two_Sum(a1, _i, x2, x1) + +#define Two_One_Diff(a1, a0, b, x2, x1, x0) \ + Two_Diff(a0, b , _i, x0); \ + Two_Sum( a1, _i, x2, x1) + +#define Two_Two_Sum(a1, a0, b1, b0, x3, x2, x1, x0) \ + Two_One_Sum(a1, a0, b0, _j, _0, x0); \ + Two_One_Sum(_j, _0, b1, x3, x2, x1) + +#define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0) \ + Two_One_Diff(a1, a0, b0, _j, _0, x0); \ + Two_One_Diff(_j, _0, b1, x3, x2, x1) + +#define Four_One_Sum(a3, a2, a1, a0, b, x4, x3, x2, x1, x0) \ + Two_One_Sum(a1, a0, b , _j, x1, x0); \ + Two_One_Sum(a3, a2, _j, x4, x3, x2) + +#define Four_Two_Sum(a3, a2, a1, a0, b1, b0, x5, x4, x3, x2, x1, x0) \ + Four_One_Sum(a3, a2, a1, a0, b0, _k, _2, _1, _0, x0); \ + Four_One_Sum(_k, _2, _1, _0, b1, x5, x4, x3, x2, x1) + +#define Four_Four_Sum(a3, a2, a1, a0, b4, b3, b1, b0, x7, x6, x5, x4, x3, x2, \ + x1, x0) \ + Four_Two_Sum(a3, a2, a1, a0, b1, b0, _l, _2, _1, _0, x1, x0); \ + Four_Two_Sum(_l, _2, _1, _0, b4, b3, x7, x6, x5, x4, x3, x2) + +#define Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b, x8, x7, x6, x5, x4, \ + x3, x2, x1, x0) \ + Four_One_Sum(a3, a2, a1, a0, b , _j, x3, x2, x1, x0); \ + Four_One_Sum(a7, a6, a5, a4, _j, x8, x7, x6, x5, x4) + +#define Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, x9, x8, x7, \ + x6, x5, x4, x3, x2, x1, x0) \ + Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b0, _k, _6, _5, _4, _3, _2, \ + _1, _0, x0); \ + Eight_One_Sum(_k, _6, _5, _4, _3, _2, _1, _0, b1, x9, x8, x7, x6, x5, x4, \ + x3, x2, x1) + +#define Eight_Four_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b4, b3, b1, b0, x11, \ + x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0) \ + Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, _l, _6, _5, _4, _3, \ + _2, _1, _0, x1, x0); \ + Eight_Two_Sum(_l, _6, _5, _4, _3, _2, _1, _0, b4, b3, x11, x10, x9, x8, \ + x7, x6, x5, x4, x3, x2) + +/* Macros for multiplying expansions of various fixed lengths. */ + +#define Two_One_Product(a1, a0, b, x3, x2, x1, x0) \ + Split(b, bhi, blo); \ + Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \ + Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x1); \ + Fast_Two_Sum(_j, _k, x3, x2) + +#define Four_One_Product(a3, a2, a1, a0, b, x7, x6, x5, x4, x3, x2, x1, x0) \ + Split(b, bhi, blo); \ + Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \ + Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x1); \ + Fast_Two_Sum(_j, _k, _i, x2); \ + Two_Product_Presplit(a2, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x3); \ + Fast_Two_Sum(_j, _k, _i, x4); \ + Two_Product_Presplit(a3, b, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, x5); \ + Fast_Two_Sum(_j, _k, x7, x6) + +#define Two_Two_Product(a1, a0, b1, b0, x7, x6, x5, x4, x3, x2, x1, x0) \ + Split(a0, a0hi, a0lo); \ + Split(b0, bhi, blo); \ + Two_Product_2Presplit(a0, a0hi, a0lo, b0, bhi, blo, _i, x0); \ + Split(a1, a1hi, a1lo); \ + Two_Product_2Presplit(a1, a1hi, a1lo, b0, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _k, _1); \ + Fast_Two_Sum(_j, _k, _l, _2); \ + Split(b1, bhi, blo); \ + Two_Product_2Presplit(a0, a0hi, a0lo, b1, bhi, blo, _i, _0); \ + Two_Sum(_1, _0, _k, x1); \ + Two_Sum(_2, _k, _j, _1); \ + Two_Sum(_l, _j, _m, _2); \ + Two_Product_2Presplit(a1, a1hi, a1lo, b1, bhi, blo, _j, _0); \ + Two_Sum(_i, _0, _n, _0); \ + Two_Sum(_1, _0, _i, x2); \ + Two_Sum(_2, _i, _k, _1); \ + Two_Sum(_m, _k, _l, _2); \ + Two_Sum(_j, _n, _k, _0); \ + Two_Sum(_1, _0, _j, x3); \ + Two_Sum(_2, _j, _i, _1); \ + Two_Sum(_l, _i, _m, _2); \ + Two_Sum(_1, _k, _i, x4); \ + Two_Sum(_2, _i, _k, x5); \ + Two_Sum(_m, _k, x7, x6) + +/* An expansion of length two can be squared more quickly than finding the */ +/* product of two different expansions of length two, and the result is */ +/* guaranteed to have no more than six (rather than eight) components. */ + +#define Two_Square(a1, a0, x5, x4, x3, x2, x1, x0) \ + Square(a0, _j, x0); \ + _0 = a0 + a0; \ + Two_Product(a1, _0, _k, _1); \ + Two_One_Sum(_k, _1, _j, _l, _2, x1); \ + Square(a1, _j, _1); \ + Two_Two_Sum(_j, _1, _l, _2, x5, x4, x3, x2) + +/* splitter = 2^ceiling(p / 2) + 1. Used to split floats in half. */ +static REAL splitter; +static REAL epsilon; /* = 2^(-p). Used to estimate roundoff errors. */ +/* A set of coefficients used to calculate maximum roundoff errors. */ +static REAL resulterrbound; +static REAL ccwerrboundA, ccwerrboundB, ccwerrboundC; +static REAL o3derrboundA, o3derrboundB, o3derrboundC; +static REAL iccerrboundA, iccerrboundB, iccerrboundC; +static REAL isperrboundA, isperrboundB, isperrboundC; + +/*****************************************************************************/ +/* */ +/* doubleprint() Print the bit representation of a double. */ +/* */ +/* Useful for debugging exact arithmetic routines. */ +/* */ +/*****************************************************************************/ + +/* +void doubleprint(number) +double number; +{ + unsigned long long no; + unsigned long long sign, expo; + int exponent; + int i, bottomi; + + no = *(unsigned long long *) &number; + sign = no & 0x8000000000000000ll; + expo = (no >> 52) & 0x7ffll; + exponent = (int) expo; + exponent = exponent - 1023; + if (sign) { + printf("-"); + } else { + printf(" "); + } + if (exponent == -1023) { + printf( + "0.0000000000000000000000000000000000000000000000000000_ ( )"); + } else { + printf("1."); + bottomi = -1; + for (i = 0; i < 52; i++) { + if (no & 0x0008000000000000ll) { + printf("1"); + bottomi = i; + } else { + printf("0"); + } + no <<= 1; + } + printf("_%d (%d)", exponent, exponent - 1 - bottomi); + } +} +*/ + +/*****************************************************************************/ +/* */ +/* floatprint() Print the bit representation of a float. */ +/* */ +/* Useful for debugging exact arithmetic routines. */ +/* */ +/*****************************************************************************/ + +/* +void floatprint(number) +float number; +{ + unsigned no; + unsigned sign, expo; + int exponent; + int i, bottomi; + + no = *(unsigned *) &number; + sign = no & 0x80000000; + expo = (no >> 23) & 0xff; + exponent = (int) expo; + exponent = exponent - 127; + if (sign) { + printf("-"); + } else { + printf(" "); + } + if (exponent == -127) { + printf("0.00000000000000000000000_ ( )"); + } else { + printf("1."); + bottomi = -1; + for (i = 0; i < 23; i++) { + if (no & 0x00400000) { + printf("1"); + bottomi = i; + } else { + printf("0"); + } + no <<= 1; + } + printf("_%3d (%3d)", exponent, exponent - 1 - bottomi); + } +} +*/ + +/*****************************************************************************/ +/* */ +/* expansion_print() Print the bit representation of an expansion. */ +/* */ +/* Useful for debugging exact arithmetic routines. */ +/* */ +/*****************************************************************************/ + +/* +void expansion_print(elen, e) +int elen; +REAL *e; +{ + int i; + + for (i = elen - 1; i >= 0; i--) { + REALPRINT(e[i]); + if (i > 0) { + printf(" +\n"); + } else { + printf("\n"); + } + } +} +*/ + +/*****************************************************************************/ +/* */ +/* doublerand() Generate a double with random 53-bit significand and a */ +/* random exponent in [0, 511]. */ +/* */ +/*****************************************************************************/ + +/* +double doublerand() +{ + double result; + double expo; + long a, b, c; + long i; + + a = random(); + b = random(); + c = random(); + result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8); + for (i = 512, expo = 2; i <= 131072; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* narrowdoublerand() Generate a double with random 53-bit significand */ +/* and a random exponent in [0, 7]. */ +/* */ +/*****************************************************************************/ + +/* +double narrowdoublerand() +{ + double result; + double expo; + long a, b, c; + long i; + + a = random(); + b = random(); + c = random(); + result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8); + for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* uniformdoublerand() Generate a double with random 53-bit significand. */ +/* */ +/*****************************************************************************/ + +/* +double uniformdoublerand() +{ + double result; + long a, b; + + a = random(); + b = random(); + result = (double) (a - 1073741824) * 8388608.0 + (double) (b >> 8); + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* floatrand() Generate a float with random 24-bit significand and a */ +/* random exponent in [0, 63]. */ +/* */ +/*****************************************************************************/ + +/* +float floatrand() +{ + float result; + float expo; + long a, c; + long i; + + a = random(); + c = random(); + result = (float) ((a - 1073741824) >> 6); + for (i = 512, expo = 2; i <= 16384; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* narrowfloatrand() Generate a float with random 24-bit significand and */ +/* a random exponent in [0, 7]. */ +/* */ +/*****************************************************************************/ + +/* +float narrowfloatrand() +{ + float result; + float expo; + long a, c; + long i; + + a = random(); + c = random(); + result = (float) ((a - 1073741824) >> 6); + for (i = 512, expo = 2; i <= 2048; i *= 2, expo = expo * expo) { + if (c & i) { + result *= expo; + } + } + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* uniformfloatrand() Generate a float with random 24-bit significand. */ +/* */ +/*****************************************************************************/ + +/* +float uniformfloatrand() +{ + float result; + long a; + + a = random(); + result = (float) ((a - 1073741824) >> 6); + return result; +} +*/ + +/*****************************************************************************/ +/* */ +/* exactinit() Initialize the variables used for exact arithmetic. */ +/* */ +/* `epsilon' is the largest power of two such that 1.0 + epsilon = 1.0 in */ +/* floating-point arithmetic. `epsilon' bounds the relative roundoff */ +/* error. It is used for floating-point error analysis. */ +/* */ +/* `splitter' is used to split floating-point numbers into two half- */ +/* length significands for exact multiplication. */ +/* */ +/* I imagine that a highly optimizing compiler might be too smart for its */ +/* own good, and somehow cause this routine to fail, if it pretends that */ +/* floating-point arithmetic is too much like real arithmetic. */ +/* */ +/* Don't change this routine unless you fully understand it. */ +/* */ +/*****************************************************************************/ + +REAL exactinit() +{ + REAL half; + REAL check, lastcheck; + int every_other; +#ifdef LINUX + int cword; +#endif /* LINUX */ + +#ifdef CPU86 +#ifdef SINGLE + _control87(_PC_24, _MCW_PC); /* Set FPU control word for single precision. */ +#else /* not SINGLE */ + _control87(_PC_53, _MCW_PC); /* Set FPU control word for double precision. */ +#endif /* not SINGLE */ +#endif /* CPU86 */ +#ifdef LINUX +#ifdef SINGLE + /* cword = 4223; */ + cword = 4210; /* set FPU control word for single precision */ +#else /* not SINGLE */ + /* cword = 4735; */ + cword = 4722; /* set FPU control word for double precision */ +#endif /* not SINGLE */ + _FPU_SETCW(cword); +#endif /* LINUX */ + + every_other = 1; + half = 0.5; + epsilon = 1.0; + splitter = 1.0; + check = 1.0; + /* Repeatedly divide `epsilon' by two until it is too small to add to */ + /* one without causing roundoff. (Also check if the sum is equal to */ + /* the previous sum, for machines that round up instead of using exact */ + /* rounding. Not that this library will work on such machines anyway. */ + do { + lastcheck = check; + epsilon *= half; + if (every_other) { + splitter *= 2.0; + } + every_other = !every_other; + check = 1.0 + epsilon; + } while ((check != 1.0) && (check != lastcheck)); + splitter += 1.0; + + /* Error bounds for orientation and incircle tests. */ + resulterrbound = (3.0 + 8.0 * epsilon) * epsilon; + ccwerrboundA = (3.0 + 16.0 * epsilon) * epsilon; + ccwerrboundB = (2.0 + 12.0 * epsilon) * epsilon; + ccwerrboundC = (9.0 + 64.0 * epsilon) * epsilon * epsilon; + o3derrboundA = (7.0 + 56.0 * epsilon) * epsilon; + o3derrboundB = (3.0 + 28.0 * epsilon) * epsilon; + o3derrboundC = (26.0 + 288.0 * epsilon) * epsilon * epsilon; + iccerrboundA = (10.0 + 96.0 * epsilon) * epsilon; + iccerrboundB = (4.0 + 48.0 * epsilon) * epsilon; + iccerrboundC = (44.0 + 576.0 * epsilon) * epsilon * epsilon; + isperrboundA = (16.0 + 224.0 * epsilon) * epsilon; + isperrboundB = (5.0 + 72.0 * epsilon) * epsilon; + isperrboundC = (71.0 + 1408.0 * epsilon) * epsilon * epsilon; + + return epsilon; /* Added by H. Si 30 Juli, 2004. */ +} + +/*****************************************************************************/ +/* */ +/* grow_expansion() Add a scalar to an expansion. */ +/* */ +/* Sets h = e + b. See the long version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the strongly nonoverlapping and nonadjacent */ +/* properties as well. (That is, if e has one of these properties, so */ +/* will h.) */ +/* */ +/*****************************************************************************/ + +int grow_expansion(int elen, REAL *e, REAL b, REAL *h) +/* e and h can be the same. */ +{ + REAL Q; + INEXACT REAL Qnew; + int eindex; + REAL enow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + + Q = b; + for (eindex = 0; eindex < elen; eindex++) { + enow = e[eindex]; + Two_Sum(Q, enow, Qnew, h[eindex]); + Q = Qnew; + } + h[eindex] = Q; + return eindex + 1; +} + +/*****************************************************************************/ +/* */ +/* grow_expansion_zeroelim() Add a scalar to an expansion, eliminating */ +/* zero components from the output expansion. */ +/* */ +/* Sets h = e + b. See the long version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the strongly nonoverlapping and nonadjacent */ +/* properties as well. (That is, if e has one of these properties, so */ +/* will h.) */ +/* */ +/*****************************************************************************/ + +int grow_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h) +/* e and h can be the same. */ +{ + REAL Q, hh; + INEXACT REAL Qnew; + int eindex, hindex; + REAL enow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + + hindex = 0; + Q = b; + for (eindex = 0; eindex < elen; eindex++) { + enow = e[eindex]; + Two_Sum(Q, enow, Qnew, hh); + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + if ((Q != 0.0) || (hindex == 0)) { + h[hindex++] = Q; + } + return hindex; +} + +/*****************************************************************************/ +/* */ +/* expansion_sum() Sum two expansions. */ +/* */ +/* Sets h = e + f. See the long version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the nonadjacent property as well. (That is, */ +/* if e has one of these properties, so will h.) Does NOT maintain the */ +/* strongly nonoverlapping property. */ +/* */ +/*****************************************************************************/ + +int expansion_sum(int elen, REAL *e, int flen, REAL *f, REAL *h) +/* e and h can be the same, but f and h cannot. */ +{ + REAL Q; + INEXACT REAL Qnew; + int findex, hindex, hlast; + REAL hnow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + + Q = f[0]; + for (hindex = 0; hindex < elen; hindex++) { + hnow = e[hindex]; + Two_Sum(Q, hnow, Qnew, h[hindex]); + Q = Qnew; + } + h[hindex] = Q; + hlast = hindex; + for (findex = 1; findex < flen; findex++) { + Q = f[findex]; + for (hindex = findex; hindex <= hlast; hindex++) { + hnow = h[hindex]; + Two_Sum(Q, hnow, Qnew, h[hindex]); + Q = Qnew; + } + h[++hlast] = Q; + } + return hlast + 1; +} + +/*****************************************************************************/ +/* */ +/* expansion_sum_zeroelim1() Sum two expansions, eliminating zero */ +/* components from the output expansion. */ +/* */ +/* Sets h = e + f. See the long version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the nonadjacent property as well. (That is, */ +/* if e has one of these properties, so will h.) Does NOT maintain the */ +/* strongly nonoverlapping property. */ +/* */ +/*****************************************************************************/ + +int expansion_sum_zeroelim1(int elen, REAL *e, int flen, REAL *f, REAL *h) +/* e and h can be the same, but f and h cannot. */ +{ + REAL Q; + INEXACT REAL Qnew; + int index, findex, hindex, hlast; + REAL hnow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + + Q = f[0]; + for (hindex = 0; hindex < elen; hindex++) { + hnow = e[hindex]; + Two_Sum(Q, hnow, Qnew, h[hindex]); + Q = Qnew; + } + h[hindex] = Q; + hlast = hindex; + for (findex = 1; findex < flen; findex++) { + Q = f[findex]; + for (hindex = findex; hindex <= hlast; hindex++) { + hnow = h[hindex]; + Two_Sum(Q, hnow, Qnew, h[hindex]); + Q = Qnew; + } + h[++hlast] = Q; + } + hindex = -1; + for (index = 0; index <= hlast; index++) { + hnow = h[index]; + if (hnow != 0.0) { + h[++hindex] = hnow; + } + } + if (hindex == -1) { + return 1; + } else { + return hindex + 1; + } +} + +/*****************************************************************************/ +/* */ +/* expansion_sum_zeroelim2() Sum two expansions, eliminating zero */ +/* components from the output expansion. */ +/* */ +/* Sets h = e + f. See the long version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the nonadjacent property as well. (That is, */ +/* if e has one of these properties, so will h.) Does NOT maintain the */ +/* strongly nonoverlapping property. */ +/* */ +/*****************************************************************************/ + +int expansion_sum_zeroelim2(int elen, REAL *e, int flen, REAL *f, REAL *h) +/* e and h can be the same, but f and h cannot. */ +{ + REAL Q, hh; + INEXACT REAL Qnew; + int eindex, findex, hindex, hlast; + REAL enow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + + hindex = 0; + Q = f[0]; + for (eindex = 0; eindex < elen; eindex++) { + enow = e[eindex]; + Two_Sum(Q, enow, Qnew, hh); + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + h[hindex] = Q; + hlast = hindex; + for (findex = 1; findex < flen; findex++) { + hindex = 0; + Q = f[findex]; + for (eindex = 0; eindex <= hlast; eindex++) { + enow = h[eindex]; + Two_Sum(Q, enow, Qnew, hh); + Q = Qnew; + if (hh != 0) { + h[hindex++] = hh; + } + } + h[hindex] = Q; + hlast = hindex; + } + return hlast + 1; +} + +/*****************************************************************************/ +/* */ +/* fast_expansion_sum() Sum two expansions. */ +/* */ +/* Sets h = e + f. See the long version of my paper for details. */ +/* */ +/* If round-to-even is used (as with IEEE 754), maintains the strongly */ +/* nonoverlapping property. (That is, if e is strongly nonoverlapping, h */ +/* will be also.) Does NOT maintain the nonoverlapping or nonadjacent */ +/* properties. */ +/* */ +/*****************************************************************************/ + +int fast_expansion_sum(int elen, REAL *e, int flen, REAL *f, REAL *h) +/* h cannot be e or f. */ +{ + REAL Q; + INEXACT REAL Qnew; + INEXACT REAL bvirt; + REAL avirt, bround, around; + int eindex, findex, hindex; + REAL enow, fnow; + + enow = e[0]; + fnow = f[0]; + eindex = findex = 0; + if ((fnow > enow) == (fnow > -enow)) { + Q = enow; + enow = e[++eindex]; + } else { + Q = fnow; + fnow = f[++findex]; + } + hindex = 0; + if ((eindex < elen) && (findex < flen)) { + if ((fnow > enow) == (fnow > -enow)) { + Fast_Two_Sum(enow, Q, Qnew, h[0]); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, Q, Qnew, h[0]); + fnow = f[++findex]; + } + Q = Qnew; + hindex = 1; + while ((eindex < elen) && (findex < flen)) { + if ((fnow > enow) == (fnow > -enow)) { + Two_Sum(Q, enow, Qnew, h[hindex]); + enow = e[++eindex]; + } else { + Two_Sum(Q, fnow, Qnew, h[hindex]); + fnow = f[++findex]; + } + Q = Qnew; + hindex++; + } + } + while (eindex < elen) { + Two_Sum(Q, enow, Qnew, h[hindex]); + enow = e[++eindex]; + Q = Qnew; + hindex++; + } + while (findex < flen) { + Two_Sum(Q, fnow, Qnew, h[hindex]); + fnow = f[++findex]; + Q = Qnew; + hindex++; + } + h[hindex] = Q; + return hindex + 1; +} + +/*****************************************************************************/ +/* */ +/* fast_expansion_sum_zeroelim() Sum two expansions, eliminating zero */ +/* components from the output expansion. */ +/* */ +/* Sets h = e + f. See the long version of my paper for details. */ +/* */ +/* If round-to-even is used (as with IEEE 754), maintains the strongly */ +/* nonoverlapping property. (That is, if e is strongly nonoverlapping, h */ +/* will be also.) Does NOT maintain the nonoverlapping or nonadjacent */ +/* properties. */ +/* */ +/*****************************************************************************/ + +int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h) +/* h cannot be e or f. */ +{ + REAL Q; + INEXACT REAL Qnew; + INEXACT REAL hh; + INEXACT REAL bvirt; + REAL avirt, bround, around; + int eindex, findex, hindex; + REAL enow, fnow; + + enow = e[0]; + fnow = f[0]; + eindex = findex = 0; + if ((fnow > enow) == (fnow > -enow)) { + Q = enow; + enow = e[++eindex]; + } else { + Q = fnow; + fnow = f[++findex]; + } + hindex = 0; + if ((eindex < elen) && (findex < flen)) { + if ((fnow > enow) == (fnow > -enow)) { + Fast_Two_Sum(enow, Q, Qnew, hh); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, Q, Qnew, hh); + fnow = f[++findex]; + } + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + while ((eindex < elen) && (findex < flen)) { + if ((fnow > enow) == (fnow > -enow)) { + Two_Sum(Q, enow, Qnew, hh); + enow = e[++eindex]; + } else { + Two_Sum(Q, fnow, Qnew, hh); + fnow = f[++findex]; + } + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + } + while (eindex < elen) { + Two_Sum(Q, enow, Qnew, hh); + enow = e[++eindex]; + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + while (findex < flen) { + Two_Sum(Q, fnow, Qnew, hh); + fnow = f[++findex]; + Q = Qnew; + if (hh != 0.0) { + h[hindex++] = hh; + } + } + if ((Q != 0.0) || (hindex == 0)) { + h[hindex++] = Q; + } + return hindex; +} + +/*****************************************************************************/ +/* */ +/* linear_expansion_sum() Sum two expansions. */ +/* */ +/* Sets h = e + f. See either version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. (That is, if e is */ +/* nonoverlapping, h will be also.) */ +/* */ +/*****************************************************************************/ + +int linear_expansion_sum(int elen, REAL *e, int flen, REAL *f, REAL *h) +/* h cannot be e or f. */ +{ + REAL Q, q; + INEXACT REAL Qnew; + INEXACT REAL R; + INEXACT REAL bvirt; + REAL avirt, bround, around; + int eindex, findex, hindex; + REAL enow, fnow; + REAL g0; + + enow = e[0]; + fnow = f[0]; + eindex = findex = 0; + if ((fnow > enow) == (fnow > -enow)) { + g0 = enow; + enow = e[++eindex]; + } else { + g0 = fnow; + fnow = f[++findex]; + } + if ((eindex < elen) && ((findex >= flen) + || ((fnow > enow) == (fnow > -enow)))) { + Fast_Two_Sum(enow, g0, Qnew, q); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, g0, Qnew, q); + fnow = f[++findex]; + } + Q = Qnew; + for (hindex = 0; hindex < elen + flen - 2; hindex++) { + if ((eindex < elen) && ((findex >= flen) + || ((fnow > enow) == (fnow > -enow)))) { + Fast_Two_Sum(enow, q, R, h[hindex]); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, q, R, h[hindex]); + fnow = f[++findex]; + } + Two_Sum(Q, R, Qnew, q); + Q = Qnew; + } + h[hindex] = q; + h[hindex + 1] = Q; + return hindex + 2; +} + +/*****************************************************************************/ +/* */ +/* linear_expansion_sum_zeroelim() Sum two expansions, eliminating zero */ +/* components from the output expansion. */ +/* */ +/* Sets h = e + f. See either version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. (That is, if e is */ +/* nonoverlapping, h will be also.) */ +/* */ +/*****************************************************************************/ + +int linear_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, + REAL *h) +/* h cannot be e or f. */ +{ + REAL Q, q, hh; + INEXACT REAL Qnew; + INEXACT REAL R; + INEXACT REAL bvirt; + REAL avirt, bround, around; + int eindex, findex, hindex; + int count; + REAL enow, fnow; + REAL g0; + + enow = e[0]; + fnow = f[0]; + eindex = findex = 0; + hindex = 0; + if ((fnow > enow) == (fnow > -enow)) { + g0 = enow; + enow = e[++eindex]; + } else { + g0 = fnow; + fnow = f[++findex]; + } + if ((eindex < elen) && ((findex >= flen) + || ((fnow > enow) == (fnow > -enow)))) { + Fast_Two_Sum(enow, g0, Qnew, q); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, g0, Qnew, q); + fnow = f[++findex]; + } + Q = Qnew; + for (count = 2; count < elen + flen; count++) { + if ((eindex < elen) && ((findex >= flen) + || ((fnow > enow) == (fnow > -enow)))) { + Fast_Two_Sum(enow, q, R, hh); + enow = e[++eindex]; + } else { + Fast_Two_Sum(fnow, q, R, hh); + fnow = f[++findex]; + } + Two_Sum(Q, R, Qnew, q); + Q = Qnew; + if (hh != 0) { + h[hindex++] = hh; + } + } + if (q != 0) { + h[hindex++] = q; + } + if ((Q != 0.0) || (hindex == 0)) { + h[hindex++] = Q; + } + return hindex; +} + +/*****************************************************************************/ +/* */ +/* scale_expansion() Multiply an expansion by a scalar. */ +/* */ +/* Sets h = be. See either version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the strongly nonoverlapping and nonadjacent */ +/* properties as well. (That is, if e has one of these properties, so */ +/* will h.) */ +/* */ +/*****************************************************************************/ + +int scale_expansion(int elen, REAL *e, REAL b, REAL *h) +/* e and h cannot be the same. */ +{ + INEXACT REAL Q; + INEXACT REAL sum; + INEXACT REAL product1; + REAL product0; + int eindex, hindex; + REAL enow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + + Split(b, bhi, blo); + Two_Product_Presplit(e[0], b, bhi, blo, Q, h[0]); + hindex = 1; + for (eindex = 1; eindex < elen; eindex++) { + enow = e[eindex]; + Two_Product_Presplit(enow, b, bhi, blo, product1, product0); + Two_Sum(Q, product0, sum, h[hindex]); + hindex++; + Two_Sum(product1, sum, Q, h[hindex]); + hindex++; + } + h[hindex] = Q; + return elen + elen; +} + +/*****************************************************************************/ +/* */ +/* scale_expansion_zeroelim() Multiply an expansion by a scalar, */ +/* eliminating zero components from the */ +/* output expansion. */ +/* */ +/* Sets h = be. See either version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), maintains the strongly nonoverlapping and nonadjacent */ +/* properties as well. (That is, if e has one of these properties, so */ +/* will h.) */ +/* */ +/*****************************************************************************/ + +int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h) +/* e and h cannot be the same. */ +{ + INEXACT REAL Q, sum; + REAL hh; + INEXACT REAL product1; + REAL product0; + int eindex, hindex; + REAL enow; + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + + Split(b, bhi, blo); + Two_Product_Presplit(e[0], b, bhi, blo, Q, hh); + hindex = 0; + if (hh != 0) { + h[hindex++] = hh; + } + for (eindex = 1; eindex < elen; eindex++) { + enow = e[eindex]; + Two_Product_Presplit(enow, b, bhi, blo, product1, product0); + Two_Sum(Q, product0, sum, hh); + if (hh != 0) { + h[hindex++] = hh; + } + Fast_Two_Sum(product1, sum, Q, hh); + if (hh != 0) { + h[hindex++] = hh; + } + } + if ((Q != 0.0) || (hindex == 0)) { + h[hindex++] = Q; + } + return hindex; +} + +/*****************************************************************************/ +/* */ +/* compress() Compress an expansion. */ +/* */ +/* See the long version of my paper for details. */ +/* */ +/* Maintains the nonoverlapping property. If round-to-even is used (as */ +/* with IEEE 754), then any nonoverlapping expansion is converted to a */ +/* nonadjacent expansion. */ +/* */ +/*****************************************************************************/ + +int compress(int elen, REAL *e, REAL *h) +/* e and h may be the same. */ +{ + REAL Q, q; + INEXACT REAL Qnew; + int eindex, hindex; + INEXACT REAL bvirt; + REAL enow, hnow; + int top, bottom; + + bottom = elen - 1; + Q = e[bottom]; + for (eindex = elen - 2; eindex >= 0; eindex--) { + enow = e[eindex]; + Fast_Two_Sum(Q, enow, Qnew, q); + if (q != 0) { + h[bottom--] = Qnew; + Q = q; + } else { + Q = Qnew; + } + } + top = 0; + for (hindex = bottom + 1; hindex < elen; hindex++) { + hnow = h[hindex]; + Fast_Two_Sum(hnow, Q, Qnew, q); + if (q != 0) { + h[top++] = q; + } + Q = Qnew; + } + h[top] = Q; + return top + 1; +} + +/*****************************************************************************/ +/* */ +/* estimate() Produce a one-word estimate of an expansion's value. */ +/* */ +/* See either version of my paper for details. */ +/* */ +/*****************************************************************************/ + +REAL estimate(int elen, REAL *e) +{ + REAL Q; + int eindex; + + Q = e[0]; + for (eindex = 1; eindex < elen; eindex++) { + Q += e[eindex]; + } + return Q; +} + +/*****************************************************************************/ +/* */ +/* orient2dfast() Approximate 2D orientation test. Nonrobust. */ +/* orient2dexact() Exact 2D orientation test. Robust. */ +/* orient2dslow() Another exact 2D orientation test. Robust. */ +/* orient2d() Adaptive exact 2D orientation test. Robust. */ +/* */ +/* Return a positive value if the points pa, pb, and pc occur */ +/* in counterclockwise order; a negative value if they occur */ +/* in clockwise order; and zero if they are collinear. The */ +/* result is also a rough approximation of twice the signed */ +/* area of the triangle defined by the three points. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In orient2d() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, orient2d() is usually quite */ +/* fast, but will run more slowly when the input points are collinear or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +REAL orient2dfast(REAL *pa, REAL *pb, REAL *pc) +{ + REAL acx, bcx, acy, bcy; + + acx = pa[0] - pc[0]; + bcx = pb[0] - pc[0]; + acy = pa[1] - pc[1]; + bcy = pb[1] - pc[1]; + return acx * bcy - acy * bcx; +} + +REAL orient2dexact(REAL *pa, REAL *pb, REAL *pc) +{ + INEXACT REAL axby1, axcy1, bxcy1, bxay1, cxay1, cxby1; + REAL axby0, axcy0, bxcy0, bxay0, cxay0, cxby0; + REAL aterms[4], bterms[4], cterms[4]; + INEXACT REAL aterms3, bterms3, cterms3; + REAL v[8], w[12]; + int vlength, wlength; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + Two_Product(pa[0], pb[1], axby1, axby0); + Two_Product(pa[0], pc[1], axcy1, axcy0); + Two_Two_Diff(axby1, axby0, axcy1, axcy0, + aterms3, aterms[2], aterms[1], aterms[0]); + aterms[3] = aterms3; + + Two_Product(pb[0], pc[1], bxcy1, bxcy0); + Two_Product(pb[0], pa[1], bxay1, bxay0); + Two_Two_Diff(bxcy1, bxcy0, bxay1, bxay0, + bterms3, bterms[2], bterms[1], bterms[0]); + bterms[3] = bterms3; + + Two_Product(pc[0], pa[1], cxay1, cxay0); + Two_Product(pc[0], pb[1], cxby1, cxby0); + Two_Two_Diff(cxay1, cxay0, cxby1, cxby0, + cterms3, cterms[2], cterms[1], cterms[0]); + cterms[3] = cterms3; + + vlength = fast_expansion_sum_zeroelim(4, aterms, 4, bterms, v); + wlength = fast_expansion_sum_zeroelim(vlength, v, 4, cterms, w); + + return w[wlength - 1]; +} + +REAL orient2dslow(REAL *pa, REAL *pb, REAL *pc) +{ + INEXACT REAL acx, acy, bcx, bcy; + REAL acxtail, acytail; + REAL bcxtail, bcytail; + REAL negate, negatetail; + REAL axby[8], bxay[8]; + INEXACT REAL axby7, bxay7; + REAL deter[16]; + int deterlen; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL a0hi, a0lo, a1hi, a1lo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j, _k, _l, _m, _n; + REAL _0, _1, _2; + + Two_Diff(pa[0], pc[0], acx, acxtail); + Two_Diff(pa[1], pc[1], acy, acytail); + Two_Diff(pb[0], pc[0], bcx, bcxtail); + Two_Diff(pb[1], pc[1], bcy, bcytail); + + Two_Two_Product(acx, acxtail, bcy, bcytail, + axby7, axby[6], axby[5], axby[4], + axby[3], axby[2], axby[1], axby[0]); + axby[7] = axby7; + negate = -acy; + negatetail = -acytail; + Two_Two_Product(bcx, bcxtail, negate, negatetail, + bxay7, bxay[6], bxay[5], bxay[4], + bxay[3], bxay[2], bxay[1], bxay[0]); + bxay[7] = bxay7; + + deterlen = fast_expansion_sum_zeroelim(8, axby, 8, bxay, deter); + + return deter[deterlen - 1]; +} + +REAL orient2dadapt(REAL *pa, REAL *pb, REAL *pc, REAL detsum) +{ + INEXACT REAL acx, acy, bcx, bcy; + REAL acxtail, acytail, bcxtail, bcytail; + INEXACT REAL detleft, detright; + REAL detlefttail, detrighttail; + REAL det, errbound; + REAL B[4], C1[8], C2[12], D[16]; + INEXACT REAL B3; + int C1length, C2length, Dlength; + REAL u[4]; + INEXACT REAL u3; + INEXACT REAL s1, t1; + REAL s0, t0; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + acx = (REAL) (pa[0] - pc[0]); + bcx = (REAL) (pb[0] - pc[0]); + acy = (REAL) (pa[1] - pc[1]); + bcy = (REAL) (pb[1] - pc[1]); + + Two_Product(acx, bcy, detleft, detlefttail); + Two_Product(acy, bcx, detright, detrighttail); + + Two_Two_Diff(detleft, detlefttail, detright, detrighttail, + B3, B[2], B[1], B[0]); + B[3] = B3; + + det = estimate(4, B); + errbound = ccwerrboundB * detsum; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pc[0], acx, acxtail); + Two_Diff_Tail(pb[0], pc[0], bcx, bcxtail); + Two_Diff_Tail(pa[1], pc[1], acy, acytail); + Two_Diff_Tail(pb[1], pc[1], bcy, bcytail); + + if ((acxtail == 0.0) && (acytail == 0.0) + && (bcxtail == 0.0) && (bcytail == 0.0)) { + return det; + } + + errbound = ccwerrboundC * detsum + resulterrbound * Absolute(det); + det += (acx * bcytail + bcy * acxtail) + - (acy * bcxtail + bcx * acytail); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Product(acxtail, bcy, s1, s0); + Two_Product(acytail, bcx, t1, t0); + Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]); + u[3] = u3; + C1length = fast_expansion_sum_zeroelim(4, B, 4, u, C1); + + Two_Product(acx, bcytail, s1, s0); + Two_Product(acy, bcxtail, t1, t0); + Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]); + u[3] = u3; + C2length = fast_expansion_sum_zeroelim(C1length, C1, 4, u, C2); + + Two_Product(acxtail, bcytail, s1, s0); + Two_Product(acytail, bcxtail, t1, t0); + Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]); + u[3] = u3; + Dlength = fast_expansion_sum_zeroelim(C2length, C2, 4, u, D); + + return(D[Dlength - 1]); +} + +REAL orient2d(REAL *pa, REAL *pb, REAL *pc) +{ + REAL detleft, detright, det; + REAL detsum, errbound; + + detleft = (pa[0] - pc[0]) * (pb[1] - pc[1]); + detright = (pa[1] - pc[1]) * (pb[0] - pc[0]); + det = detleft - detright; + + if (detleft > 0.0) { + if (detright <= 0.0) { + return det; + } else { + detsum = detleft + detright; + } + } else if (detleft < 0.0) { + if (detright >= 0.0) { + return det; + } else { + detsum = -detleft - detright; + } + } else { + return det; + } + + errbound = ccwerrboundA * detsum; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + return orient2dadapt(pa, pb, pc, detsum); +} + +/*****************************************************************************/ +/* */ +/* orient3dfast() Approximate 3D orientation test. Nonrobust. */ +/* orient3dexact() Exact 3D orientation test. Robust. */ +/* orient3dslow() Another exact 3D orientation test. Robust. */ +/* orient3d() Adaptive exact 3D orientation test. Robust. */ +/* */ +/* Return a positive value if the point pd lies below the */ +/* plane passing through pa, pb, and pc; "below" is defined so */ +/* that pa, pb, and pc appear in counterclockwise order when */ +/* viewed from above the plane. Returns a negative value if */ +/* pd lies above the plane. Returns zero if the points are */ +/* coplanar. The result is also a rough approximation of six */ +/* times the signed volume of the tetrahedron defined by the */ +/* four points. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In orient3d() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, orient3d() is usually quite */ +/* fast, but will run more slowly when the input points are coplanar or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +REAL orient3dfast(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + REAL adx, bdx, cdx; + REAL ady, bdy, cdy; + REAL adz, bdz, cdz; + + adx = pa[0] - pd[0]; + bdx = pb[0] - pd[0]; + cdx = pc[0] - pd[0]; + ady = pa[1] - pd[1]; + bdy = pb[1] - pd[1]; + cdy = pc[1] - pd[1]; + adz = pa[2] - pd[2]; + bdz = pb[2] - pd[2]; + cdz = pc[2] - pd[2]; + + return adx * (bdy * cdz - bdz * cdy) + + bdx * (cdy * adz - cdz * ady) + + cdx * (ady * bdz - adz * bdy); +} + +REAL orient3dexact(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + INEXACT REAL axby1, bxcy1, cxdy1, dxay1, axcy1, bxdy1; + INEXACT REAL bxay1, cxby1, dxcy1, axdy1, cxay1, dxby1; + REAL axby0, bxcy0, cxdy0, dxay0, axcy0, bxdy0; + REAL bxay0, cxby0, dxcy0, axdy0, cxay0, dxby0; + REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4]; + REAL temp8[8]; + int templen; + REAL abc[12], bcd[12], cda[12], dab[12]; + int abclen, bcdlen, cdalen, dablen; + REAL adet[24], bdet[24], cdet[24], ddet[24]; + int alen, blen, clen, dlen; + REAL abdet[48], cddet[48]; + int ablen, cdlen; + REAL deter[96]; + int deterlen; + int i; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + Two_Product(pa[0], pb[1], axby1, axby0); + Two_Product(pb[0], pa[1], bxay1, bxay0); + Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]); + + Two_Product(pb[0], pc[1], bxcy1, bxcy0); + Two_Product(pc[0], pb[1], cxby1, cxby0); + Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]); + + Two_Product(pc[0], pd[1], cxdy1, cxdy0); + Two_Product(pd[0], pc[1], dxcy1, dxcy0); + Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]); + + Two_Product(pd[0], pa[1], dxay1, dxay0); + Two_Product(pa[0], pd[1], axdy1, axdy0); + Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]); + + Two_Product(pa[0], pc[1], axcy1, axcy0); + Two_Product(pc[0], pa[1], cxay1, cxay0); + Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]); + + Two_Product(pb[0], pd[1], bxdy1, bxdy0); + Two_Product(pd[0], pb[1], dxby1, dxby0); + Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]); + + templen = fast_expansion_sum_zeroelim(4, cd, 4, da, temp8); + cdalen = fast_expansion_sum_zeroelim(templen, temp8, 4, ac, cda); + templen = fast_expansion_sum_zeroelim(4, da, 4, ab, temp8); + dablen = fast_expansion_sum_zeroelim(templen, temp8, 4, bd, dab); + for (i = 0; i < 4; i++) { + bd[i] = -bd[i]; + ac[i] = -ac[i]; + } + templen = fast_expansion_sum_zeroelim(4, ab, 4, bc, temp8); + abclen = fast_expansion_sum_zeroelim(templen, temp8, 4, ac, abc); + templen = fast_expansion_sum_zeroelim(4, bc, 4, cd, temp8); + bcdlen = fast_expansion_sum_zeroelim(templen, temp8, 4, bd, bcd); + + alen = scale_expansion_zeroelim(bcdlen, bcd, pa[2], adet); + blen = scale_expansion_zeroelim(cdalen, cda, -pb[2], bdet); + clen = scale_expansion_zeroelim(dablen, dab, pc[2], cdet); + dlen = scale_expansion_zeroelim(abclen, abc, -pd[2], ddet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, cdlen, cddet, deter); + + return deter[deterlen - 1]; +} + +REAL orient3dslow(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + INEXACT REAL adx, ady, adz, bdx, bdy, bdz, cdx, cdy, cdz; + REAL adxtail, adytail, adztail; + REAL bdxtail, bdytail, bdztail; + REAL cdxtail, cdytail, cdztail; + REAL negate, negatetail; + INEXACT REAL axby7, bxcy7, axcy7, bxay7, cxby7, cxay7; + REAL axby[8], bxcy[8], axcy[8], bxay[8], cxby[8], cxay[8]; + REAL temp16[16], temp32[32], temp32t[32]; + int temp16len, temp32len, temp32tlen; + REAL adet[64], bdet[64], cdet[64]; + int alen, blen, clen; + REAL abdet[128]; + int ablen; + REAL deter[192]; + int deterlen; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL a0hi, a0lo, a1hi, a1lo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j, _k, _l, _m, _n; + REAL _0, _1, _2; + + Two_Diff(pa[0], pd[0], adx, adxtail); + Two_Diff(pa[1], pd[1], ady, adytail); + Two_Diff(pa[2], pd[2], adz, adztail); + Two_Diff(pb[0], pd[0], bdx, bdxtail); + Two_Diff(pb[1], pd[1], bdy, bdytail); + Two_Diff(pb[2], pd[2], bdz, bdztail); + Two_Diff(pc[0], pd[0], cdx, cdxtail); + Two_Diff(pc[1], pd[1], cdy, cdytail); + Two_Diff(pc[2], pd[2], cdz, cdztail); + + Two_Two_Product(adx, adxtail, bdy, bdytail, + axby7, axby[6], axby[5], axby[4], + axby[3], axby[2], axby[1], axby[0]); + axby[7] = axby7; + negate = -ady; + negatetail = -adytail; + Two_Two_Product(bdx, bdxtail, negate, negatetail, + bxay7, bxay[6], bxay[5], bxay[4], + bxay[3], bxay[2], bxay[1], bxay[0]); + bxay[7] = bxay7; + Two_Two_Product(bdx, bdxtail, cdy, cdytail, + bxcy7, bxcy[6], bxcy[5], bxcy[4], + bxcy[3], bxcy[2], bxcy[1], bxcy[0]); + bxcy[7] = bxcy7; + negate = -bdy; + negatetail = -bdytail; + Two_Two_Product(cdx, cdxtail, negate, negatetail, + cxby7, cxby[6], cxby[5], cxby[4], + cxby[3], cxby[2], cxby[1], cxby[0]); + cxby[7] = cxby7; + Two_Two_Product(cdx, cdxtail, ady, adytail, + cxay7, cxay[6], cxay[5], cxay[4], + cxay[3], cxay[2], cxay[1], cxay[0]); + cxay[7] = cxay7; + negate = -cdy; + negatetail = -cdytail; + Two_Two_Product(adx, adxtail, negate, negatetail, + axcy7, axcy[6], axcy[5], axcy[4], + axcy[3], axcy[2], axcy[1], axcy[0]); + axcy[7] = axcy7; + + temp16len = fast_expansion_sum_zeroelim(8, bxcy, 8, cxby, temp16); + temp32len = scale_expansion_zeroelim(temp16len, temp16, adz, temp32); + temp32tlen = scale_expansion_zeroelim(temp16len, temp16, adztail, temp32t); + alen = fast_expansion_sum_zeroelim(temp32len, temp32, temp32tlen, temp32t, + adet); + + temp16len = fast_expansion_sum_zeroelim(8, cxay, 8, axcy, temp16); + temp32len = scale_expansion_zeroelim(temp16len, temp16, bdz, temp32); + temp32tlen = scale_expansion_zeroelim(temp16len, temp16, bdztail, temp32t); + blen = fast_expansion_sum_zeroelim(temp32len, temp32, temp32tlen, temp32t, + bdet); + + temp16len = fast_expansion_sum_zeroelim(8, axby, 8, bxay, temp16); + temp32len = scale_expansion_zeroelim(temp16len, temp16, cdz, temp32); + temp32tlen = scale_expansion_zeroelim(temp16len, temp16, cdztail, temp32t); + clen = fast_expansion_sum_zeroelim(temp32len, temp32, temp32tlen, temp32t, + cdet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, clen, cdet, deter); + + return deter[deterlen - 1]; +} + +REAL orient3dadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL permanent) +{ + INEXACT REAL adx, bdx, cdx, ady, bdy, cdy, adz, bdz, cdz; + REAL det, errbound; + + INEXACT REAL bdxcdy1, cdxbdy1, cdxady1, adxcdy1, adxbdy1, bdxady1; + REAL bdxcdy0, cdxbdy0, cdxady0, adxcdy0, adxbdy0, bdxady0; + REAL bc[4], ca[4], ab[4]; + INEXACT REAL bc3, ca3, ab3; + REAL adet[8], bdet[8], cdet[8]; + int alen, blen, clen; + REAL abdet[16]; + int ablen; + REAL *finnow, *finother, *finswap; + REAL fin1[192], fin2[192]; + int finlength; + + //////////////////////////////////////////////////////// + // To avoid uninitialized warnings reported by valgrind. + int i; + for (i = 0; i < 8; i++) { + adet[i] = bdet[i] = cdet[i] = 0.0; + } + for (i = 0; i < 16; i++) { + abdet[i] = 0.0; + } + //////////////////////////////////////////////////////// + + REAL adxtail, bdxtail, cdxtail; + REAL adytail, bdytail, cdytail; + REAL adztail, bdztail, cdztail; + INEXACT REAL at_blarge, at_clarge; + INEXACT REAL bt_clarge, bt_alarge; + INEXACT REAL ct_alarge, ct_blarge; + REAL at_b[4], at_c[4], bt_c[4], bt_a[4], ct_a[4], ct_b[4]; + int at_blen, at_clen, bt_clen, bt_alen, ct_alen, ct_blen; + INEXACT REAL bdxt_cdy1, cdxt_bdy1, cdxt_ady1; + INEXACT REAL adxt_cdy1, adxt_bdy1, bdxt_ady1; + REAL bdxt_cdy0, cdxt_bdy0, cdxt_ady0; + REAL adxt_cdy0, adxt_bdy0, bdxt_ady0; + INEXACT REAL bdyt_cdx1, cdyt_bdx1, cdyt_adx1; + INEXACT REAL adyt_cdx1, adyt_bdx1, bdyt_adx1; + REAL bdyt_cdx0, cdyt_bdx0, cdyt_adx0; + REAL adyt_cdx0, adyt_bdx0, bdyt_adx0; + REAL bct[8], cat[8], abt[8]; + int bctlen, catlen, abtlen; + INEXACT REAL bdxt_cdyt1, cdxt_bdyt1, cdxt_adyt1; + INEXACT REAL adxt_cdyt1, adxt_bdyt1, bdxt_adyt1; + REAL bdxt_cdyt0, cdxt_bdyt0, cdxt_adyt0; + REAL adxt_cdyt0, adxt_bdyt0, bdxt_adyt0; + REAL u[4], v[12], w[16]; + INEXACT REAL u3; + int vlength, wlength; + REAL negate; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j, _k; + REAL _0; + + adx = (REAL) (pa[0] - pd[0]); + bdx = (REAL) (pb[0] - pd[0]); + cdx = (REAL) (pc[0] - pd[0]); + ady = (REAL) (pa[1] - pd[1]); + bdy = (REAL) (pb[1] - pd[1]); + cdy = (REAL) (pc[1] - pd[1]); + adz = (REAL) (pa[2] - pd[2]); + bdz = (REAL) (pb[2] - pd[2]); + cdz = (REAL) (pc[2] - pd[2]); + + Two_Product(bdx, cdy, bdxcdy1, bdxcdy0); + Two_Product(cdx, bdy, cdxbdy1, cdxbdy0); + Two_Two_Diff(bdxcdy1, bdxcdy0, cdxbdy1, cdxbdy0, bc3, bc[2], bc[1], bc[0]); + bc[3] = bc3; + alen = scale_expansion_zeroelim(4, bc, adz, adet); + + Two_Product(cdx, ady, cdxady1, cdxady0); + Two_Product(adx, cdy, adxcdy1, adxcdy0); + Two_Two_Diff(cdxady1, cdxady0, adxcdy1, adxcdy0, ca3, ca[2], ca[1], ca[0]); + ca[3] = ca3; + blen = scale_expansion_zeroelim(4, ca, bdz, bdet); + + Two_Product(adx, bdy, adxbdy1, adxbdy0); + Two_Product(bdx, ady, bdxady1, bdxady0); + Two_Two_Diff(adxbdy1, adxbdy0, bdxady1, bdxady0, ab3, ab[2], ab[1], ab[0]); + ab[3] = ab3; + clen = scale_expansion_zeroelim(4, ab, cdz, cdet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + finlength = fast_expansion_sum_zeroelim(ablen, abdet, clen, cdet, fin1); + + det = estimate(finlength, fin1); + errbound = o3derrboundB * permanent; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pd[0], adx, adxtail); + Two_Diff_Tail(pb[0], pd[0], bdx, bdxtail); + Two_Diff_Tail(pc[0], pd[0], cdx, cdxtail); + Two_Diff_Tail(pa[1], pd[1], ady, adytail); + Two_Diff_Tail(pb[1], pd[1], bdy, bdytail); + Two_Diff_Tail(pc[1], pd[1], cdy, cdytail); + Two_Diff_Tail(pa[2], pd[2], adz, adztail); + Two_Diff_Tail(pb[2], pd[2], bdz, bdztail); + Two_Diff_Tail(pc[2], pd[2], cdz, cdztail); + + if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0) + && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0) + && (adztail == 0.0) && (bdztail == 0.0) && (cdztail == 0.0)) { + return det; + } + + errbound = o3derrboundC * permanent + resulterrbound * Absolute(det); + det += (adz * ((bdx * cdytail + cdy * bdxtail) + - (bdy * cdxtail + cdx * bdytail)) + + adztail * (bdx * cdy - bdy * cdx)) + + (bdz * ((cdx * adytail + ady * cdxtail) + - (cdy * adxtail + adx * cdytail)) + + bdztail * (cdx * ady - cdy * adx)) + + (cdz * ((adx * bdytail + bdy * adxtail) + - (ady * bdxtail + bdx * adytail)) + + cdztail * (adx * bdy - ady * bdx)); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + finnow = fin1; + finother = fin2; + + if (adxtail == 0.0) { + if (adytail == 0.0) { + at_b[0] = 0.0; + at_blen = 1; + at_c[0] = 0.0; + at_clen = 1; + } else { + negate = -adytail; + Two_Product(negate, bdx, at_blarge, at_b[0]); + at_b[1] = at_blarge; + at_blen = 2; + Two_Product(adytail, cdx, at_clarge, at_c[0]); + at_c[1] = at_clarge; + at_clen = 2; + } + } else { + if (adytail == 0.0) { + Two_Product(adxtail, bdy, at_blarge, at_b[0]); + at_b[1] = at_blarge; + at_blen = 2; + negate = -adxtail; + Two_Product(negate, cdy, at_clarge, at_c[0]); + at_c[1] = at_clarge; + at_clen = 2; + } else { + Two_Product(adxtail, bdy, adxt_bdy1, adxt_bdy0); + Two_Product(adytail, bdx, adyt_bdx1, adyt_bdx0); + Two_Two_Diff(adxt_bdy1, adxt_bdy0, adyt_bdx1, adyt_bdx0, + at_blarge, at_b[2], at_b[1], at_b[0]); + at_b[3] = at_blarge; + at_blen = 4; + Two_Product(adytail, cdx, adyt_cdx1, adyt_cdx0); + Two_Product(adxtail, cdy, adxt_cdy1, adxt_cdy0); + Two_Two_Diff(adyt_cdx1, adyt_cdx0, adxt_cdy1, adxt_cdy0, + at_clarge, at_c[2], at_c[1], at_c[0]); + at_c[3] = at_clarge; + at_clen = 4; + } + } + if (bdxtail == 0.0) { + if (bdytail == 0.0) { + bt_c[0] = 0.0; + bt_clen = 1; + bt_a[0] = 0.0; + bt_alen = 1; + } else { + negate = -bdytail; + Two_Product(negate, cdx, bt_clarge, bt_c[0]); + bt_c[1] = bt_clarge; + bt_clen = 2; + Two_Product(bdytail, adx, bt_alarge, bt_a[0]); + bt_a[1] = bt_alarge; + bt_alen = 2; + } + } else { + if (bdytail == 0.0) { + Two_Product(bdxtail, cdy, bt_clarge, bt_c[0]); + bt_c[1] = bt_clarge; + bt_clen = 2; + negate = -bdxtail; + Two_Product(negate, ady, bt_alarge, bt_a[0]); + bt_a[1] = bt_alarge; + bt_alen = 2; + } else { + Two_Product(bdxtail, cdy, bdxt_cdy1, bdxt_cdy0); + Two_Product(bdytail, cdx, bdyt_cdx1, bdyt_cdx0); + Two_Two_Diff(bdxt_cdy1, bdxt_cdy0, bdyt_cdx1, bdyt_cdx0, + bt_clarge, bt_c[2], bt_c[1], bt_c[0]); + bt_c[3] = bt_clarge; + bt_clen = 4; + Two_Product(bdytail, adx, bdyt_adx1, bdyt_adx0); + Two_Product(bdxtail, ady, bdxt_ady1, bdxt_ady0); + Two_Two_Diff(bdyt_adx1, bdyt_adx0, bdxt_ady1, bdxt_ady0, + bt_alarge, bt_a[2], bt_a[1], bt_a[0]); + bt_a[3] = bt_alarge; + bt_alen = 4; + } + } + if (cdxtail == 0.0) { + if (cdytail == 0.0) { + ct_a[0] = 0.0; + ct_alen = 1; + ct_b[0] = 0.0; + ct_blen = 1; + } else { + negate = -cdytail; + Two_Product(negate, adx, ct_alarge, ct_a[0]); + ct_a[1] = ct_alarge; + ct_alen = 2; + Two_Product(cdytail, bdx, ct_blarge, ct_b[0]); + ct_b[1] = ct_blarge; + ct_blen = 2; + } + } else { + if (cdytail == 0.0) { + Two_Product(cdxtail, ady, ct_alarge, ct_a[0]); + ct_a[1] = ct_alarge; + ct_alen = 2; + negate = -cdxtail; + Two_Product(negate, bdy, ct_blarge, ct_b[0]); + ct_b[1] = ct_blarge; + ct_blen = 2; + } else { + Two_Product(cdxtail, ady, cdxt_ady1, cdxt_ady0); + Two_Product(cdytail, adx, cdyt_adx1, cdyt_adx0); + Two_Two_Diff(cdxt_ady1, cdxt_ady0, cdyt_adx1, cdyt_adx0, + ct_alarge, ct_a[2], ct_a[1], ct_a[0]); + ct_a[3] = ct_alarge; + ct_alen = 4; + Two_Product(cdytail, bdx, cdyt_bdx1, cdyt_bdx0); + Two_Product(cdxtail, bdy, cdxt_bdy1, cdxt_bdy0); + Two_Two_Diff(cdyt_bdx1, cdyt_bdx0, cdxt_bdy1, cdxt_bdy0, + ct_blarge, ct_b[2], ct_b[1], ct_b[0]); + ct_b[3] = ct_blarge; + ct_blen = 4; + } + } + + bctlen = fast_expansion_sum_zeroelim(bt_clen, bt_c, ct_blen, ct_b, bct); + wlength = scale_expansion_zeroelim(bctlen, bct, adz, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + + catlen = fast_expansion_sum_zeroelim(ct_alen, ct_a, at_clen, at_c, cat); + wlength = scale_expansion_zeroelim(catlen, cat, bdz, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + + abtlen = fast_expansion_sum_zeroelim(at_blen, at_b, bt_alen, bt_a, abt); + wlength = scale_expansion_zeroelim(abtlen, abt, cdz, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + + if (adztail != 0.0) { + vlength = scale_expansion_zeroelim(4, bc, adztail, v); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, vlength, v, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdztail != 0.0) { + vlength = scale_expansion_zeroelim(4, ca, bdztail, v); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, vlength, v, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdztail != 0.0) { + vlength = scale_expansion_zeroelim(4, ab, cdztail, v); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, vlength, v, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + if (adxtail != 0.0) { + if (bdytail != 0.0) { + Two_Product(adxtail, bdytail, adxt_bdyt1, adxt_bdyt0); + Two_One_Product(adxt_bdyt1, adxt_bdyt0, cdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (cdztail != 0.0) { + Two_One_Product(adxt_bdyt1, adxt_bdyt0, cdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if (cdytail != 0.0) { + negate = -adxtail; + Two_Product(negate, cdytail, adxt_cdyt1, adxt_cdyt0); + Two_One_Product(adxt_cdyt1, adxt_cdyt0, bdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (bdztail != 0.0) { + Two_One_Product(adxt_cdyt1, adxt_cdyt0, bdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + } + if (bdxtail != 0.0) { + if (cdytail != 0.0) { + Two_Product(bdxtail, cdytail, bdxt_cdyt1, bdxt_cdyt0); + Two_One_Product(bdxt_cdyt1, bdxt_cdyt0, adz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (adztail != 0.0) { + Two_One_Product(bdxt_cdyt1, bdxt_cdyt0, adztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if (adytail != 0.0) { + negate = -bdxtail; + Two_Product(negate, adytail, bdxt_adyt1, bdxt_adyt0); + Two_One_Product(bdxt_adyt1, bdxt_adyt0, cdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (cdztail != 0.0) { + Two_One_Product(bdxt_adyt1, bdxt_adyt0, cdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + } + if (cdxtail != 0.0) { + if (adytail != 0.0) { + Two_Product(cdxtail, adytail, cdxt_adyt1, cdxt_adyt0); + Two_One_Product(cdxt_adyt1, cdxt_adyt0, bdz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (bdztail != 0.0) { + Two_One_Product(cdxt_adyt1, cdxt_adyt0, bdztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if (bdytail != 0.0) { + negate = -cdxtail; + Two_Product(negate, bdytail, cdxt_bdyt1, cdxt_bdyt0); + Two_One_Product(cdxt_bdyt1, cdxt_bdyt0, adz, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + if (adztail != 0.0) { + Two_One_Product(cdxt_bdyt1, cdxt_bdyt0, adztail, u3, u[2], u[1], u[0]); + u[3] = u3; + finlength = fast_expansion_sum_zeroelim(finlength, finnow, 4, u, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + } + + if (adztail != 0.0) { + wlength = scale_expansion_zeroelim(bctlen, bct, adztail, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdztail != 0.0) { + wlength = scale_expansion_zeroelim(catlen, cat, bdztail, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdztail != 0.0) { + wlength = scale_expansion_zeroelim(abtlen, abt, cdztail, w); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, wlength, w, + finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + return finnow[finlength - 1]; +} + +REAL orient3d(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + REAL adx, bdx, cdx, ady, bdy, cdy, adz, bdz, cdz; + REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady; + REAL det; + REAL permanent, errbound; + + adx = pa[0] - pd[0]; + bdx = pb[0] - pd[0]; + cdx = pc[0] - pd[0]; + ady = pa[1] - pd[1]; + bdy = pb[1] - pd[1]; + cdy = pc[1] - pd[1]; + adz = pa[2] - pd[2]; + bdz = pb[2] - pd[2]; + cdz = pc[2] - pd[2]; + + bdxcdy = bdx * cdy; + cdxbdy = cdx * bdy; + + cdxady = cdx * ady; + adxcdy = adx * cdy; + + adxbdy = adx * bdy; + bdxady = bdx * ady; + + det = adz * (bdxcdy - cdxbdy) + + bdz * (cdxady - adxcdy) + + cdz * (adxbdy - bdxady); + + permanent = (Absolute(bdxcdy) + Absolute(cdxbdy)) * Absolute(adz) + + (Absolute(cdxady) + Absolute(adxcdy)) * Absolute(bdz) + + (Absolute(adxbdy) + Absolute(bdxady)) * Absolute(cdz); + errbound = o3derrboundA * permanent; + if ((det > errbound) || (-det > errbound)) { + return det; + } + + return orient3dadapt(pa, pb, pc, pd, permanent); +} + +/*****************************************************************************/ +/* */ +/* incirclefast() Approximate 2D incircle test. Nonrobust. */ +/* incircleexact() Exact 2D incircle test. Robust. */ +/* incircleslow() Another exact 2D incircle test. Robust. */ +/* incircle() Adaptive exact 2D incircle test. Robust. */ +/* */ +/* Return a positive value if the point pd lies inside the */ +/* circle passing through pa, pb, and pc; a negative value if */ +/* it lies outside; and zero if the four points are cocircular.*/ +/* The points pa, pb, and pc must be in counterclockwise */ +/* order, or the sign of the result will be reversed. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In incircle() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, incircle() is usually quite */ +/* fast, but will run more slowly when the input points are cocircular or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +REAL incirclefast(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + REAL adx, ady, bdx, bdy, cdx, cdy; + REAL abdet, bcdet, cadet; + REAL alift, blift, clift; + + adx = pa[0] - pd[0]; + ady = pa[1] - pd[1]; + bdx = pb[0] - pd[0]; + bdy = pb[1] - pd[1]; + cdx = pc[0] - pd[0]; + cdy = pc[1] - pd[1]; + + abdet = adx * bdy - bdx * ady; + bcdet = bdx * cdy - cdx * bdy; + cadet = cdx * ady - adx * cdy; + alift = adx * adx + ady * ady; + blift = bdx * bdx + bdy * bdy; + clift = cdx * cdx + cdy * cdy; + + return alift * bcdet + blift * cadet + clift * abdet; +} + +REAL incircleexact(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + INEXACT REAL axby1, bxcy1, cxdy1, dxay1, axcy1, bxdy1; + INEXACT REAL bxay1, cxby1, dxcy1, axdy1, cxay1, dxby1; + REAL axby0, bxcy0, cxdy0, dxay0, axcy0, bxdy0; + REAL bxay0, cxby0, dxcy0, axdy0, cxay0, dxby0; + REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4]; + REAL temp8[8]; + int templen; + REAL abc[12], bcd[12], cda[12], dab[12]; + int abclen, bcdlen, cdalen, dablen; + REAL det24x[24], det24y[24], det48x[48], det48y[48]; + int xlen, ylen; + REAL adet[96], bdet[96], cdet[96], ddet[96]; + int alen, blen, clen, dlen; + REAL abdet[192], cddet[192]; + int ablen, cdlen; + REAL deter[384]; + int deterlen; + int i; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + Two_Product(pa[0], pb[1], axby1, axby0); + Two_Product(pb[0], pa[1], bxay1, bxay0); + Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]); + + Two_Product(pb[0], pc[1], bxcy1, bxcy0); + Two_Product(pc[0], pb[1], cxby1, cxby0); + Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]); + + Two_Product(pc[0], pd[1], cxdy1, cxdy0); + Two_Product(pd[0], pc[1], dxcy1, dxcy0); + Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]); + + Two_Product(pd[0], pa[1], dxay1, dxay0); + Two_Product(pa[0], pd[1], axdy1, axdy0); + Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]); + + Two_Product(pa[0], pc[1], axcy1, axcy0); + Two_Product(pc[0], pa[1], cxay1, cxay0); + Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]); + + Two_Product(pb[0], pd[1], bxdy1, bxdy0); + Two_Product(pd[0], pb[1], dxby1, dxby0); + Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]); + + templen = fast_expansion_sum_zeroelim(4, cd, 4, da, temp8); + cdalen = fast_expansion_sum_zeroelim(templen, temp8, 4, ac, cda); + templen = fast_expansion_sum_zeroelim(4, da, 4, ab, temp8); + dablen = fast_expansion_sum_zeroelim(templen, temp8, 4, bd, dab); + for (i = 0; i < 4; i++) { + bd[i] = -bd[i]; + ac[i] = -ac[i]; + } + templen = fast_expansion_sum_zeroelim(4, ab, 4, bc, temp8); + abclen = fast_expansion_sum_zeroelim(templen, temp8, 4, ac, abc); + templen = fast_expansion_sum_zeroelim(4, bc, 4, cd, temp8); + bcdlen = fast_expansion_sum_zeroelim(templen, temp8, 4, bd, bcd); + + xlen = scale_expansion_zeroelim(bcdlen, bcd, pa[0], det24x); + xlen = scale_expansion_zeroelim(xlen, det24x, pa[0], det48x); + ylen = scale_expansion_zeroelim(bcdlen, bcd, pa[1], det24y); + ylen = scale_expansion_zeroelim(ylen, det24y, pa[1], det48y); + alen = fast_expansion_sum_zeroelim(xlen, det48x, ylen, det48y, adet); + + xlen = scale_expansion_zeroelim(cdalen, cda, pb[0], det24x); + xlen = scale_expansion_zeroelim(xlen, det24x, -pb[0], det48x); + ylen = scale_expansion_zeroelim(cdalen, cda, pb[1], det24y); + ylen = scale_expansion_zeroelim(ylen, det24y, -pb[1], det48y); + blen = fast_expansion_sum_zeroelim(xlen, det48x, ylen, det48y, bdet); + + xlen = scale_expansion_zeroelim(dablen, dab, pc[0], det24x); + xlen = scale_expansion_zeroelim(xlen, det24x, pc[0], det48x); + ylen = scale_expansion_zeroelim(dablen, dab, pc[1], det24y); + ylen = scale_expansion_zeroelim(ylen, det24y, pc[1], det48y); + clen = fast_expansion_sum_zeroelim(xlen, det48x, ylen, det48y, cdet); + + xlen = scale_expansion_zeroelim(abclen, abc, pd[0], det24x); + xlen = scale_expansion_zeroelim(xlen, det24x, -pd[0], det48x); + ylen = scale_expansion_zeroelim(abclen, abc, pd[1], det24y); + ylen = scale_expansion_zeroelim(ylen, det24y, -pd[1], det48y); + dlen = fast_expansion_sum_zeroelim(xlen, det48x, ylen, det48y, ddet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, cdlen, cddet, deter); + + return deter[deterlen - 1]; +} + +REAL incircleslow(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + INEXACT REAL adx, bdx, cdx, ady, bdy, cdy; + REAL adxtail, bdxtail, cdxtail; + REAL adytail, bdytail, cdytail; + REAL negate, negatetail; + INEXACT REAL axby7, bxcy7, axcy7, bxay7, cxby7, cxay7; + REAL axby[8], bxcy[8], axcy[8], bxay[8], cxby[8], cxay[8]; + REAL temp16[16]; + int temp16len; + REAL detx[32], detxx[64], detxt[32], detxxt[64], detxtxt[64]; + int xlen, xxlen, xtlen, xxtlen, xtxtlen; + REAL x1[128], x2[192]; + int x1len, x2len; + REAL dety[32], detyy[64], detyt[32], detyyt[64], detytyt[64]; + int ylen, yylen, ytlen, yytlen, ytytlen; + REAL y1[128], y2[192]; + int y1len, y2len; + REAL adet[384], bdet[384], cdet[384], abdet[768], deter[1152]; + int alen, blen, clen, ablen, deterlen; + int i; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL a0hi, a0lo, a1hi, a1lo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j, _k, _l, _m, _n; + REAL _0, _1, _2; + + Two_Diff(pa[0], pd[0], adx, adxtail); + Two_Diff(pa[1], pd[1], ady, adytail); + Two_Diff(pb[0], pd[0], bdx, bdxtail); + Two_Diff(pb[1], pd[1], bdy, bdytail); + Two_Diff(pc[0], pd[0], cdx, cdxtail); + Two_Diff(pc[1], pd[1], cdy, cdytail); + + Two_Two_Product(adx, adxtail, bdy, bdytail, + axby7, axby[6], axby[5], axby[4], + axby[3], axby[2], axby[1], axby[0]); + axby[7] = axby7; + negate = -ady; + negatetail = -adytail; + Two_Two_Product(bdx, bdxtail, negate, negatetail, + bxay7, bxay[6], bxay[5], bxay[4], + bxay[3], bxay[2], bxay[1], bxay[0]); + bxay[7] = bxay7; + Two_Two_Product(bdx, bdxtail, cdy, cdytail, + bxcy7, bxcy[6], bxcy[5], bxcy[4], + bxcy[3], bxcy[2], bxcy[1], bxcy[0]); + bxcy[7] = bxcy7; + negate = -bdy; + negatetail = -bdytail; + Two_Two_Product(cdx, cdxtail, negate, negatetail, + cxby7, cxby[6], cxby[5], cxby[4], + cxby[3], cxby[2], cxby[1], cxby[0]); + cxby[7] = cxby7; + Two_Two_Product(cdx, cdxtail, ady, adytail, + cxay7, cxay[6], cxay[5], cxay[4], + cxay[3], cxay[2], cxay[1], cxay[0]); + cxay[7] = cxay7; + negate = -cdy; + negatetail = -cdytail; + Two_Two_Product(adx, adxtail, negate, negatetail, + axcy7, axcy[6], axcy[5], axcy[4], + axcy[3], axcy[2], axcy[1], axcy[0]); + axcy[7] = axcy7; + + + temp16len = fast_expansion_sum_zeroelim(8, bxcy, 8, cxby, temp16); + + xlen = scale_expansion_zeroelim(temp16len, temp16, adx, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, adx, detxx); + xtlen = scale_expansion_zeroelim(temp16len, temp16, adxtail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, adx, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, adxtail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + + ylen = scale_expansion_zeroelim(temp16len, temp16, ady, dety); + yylen = scale_expansion_zeroelim(ylen, dety, ady, detyy); + ytlen = scale_expansion_zeroelim(temp16len, temp16, adytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, ady, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, adytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + + alen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, adet); + + + temp16len = fast_expansion_sum_zeroelim(8, cxay, 8, axcy, temp16); + + xlen = scale_expansion_zeroelim(temp16len, temp16, bdx, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, bdx, detxx); + xtlen = scale_expansion_zeroelim(temp16len, temp16, bdxtail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, bdx, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, bdxtail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + + ylen = scale_expansion_zeroelim(temp16len, temp16, bdy, dety); + yylen = scale_expansion_zeroelim(ylen, dety, bdy, detyy); + ytlen = scale_expansion_zeroelim(temp16len, temp16, bdytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, bdy, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, bdytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + + blen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, bdet); + + + temp16len = fast_expansion_sum_zeroelim(8, axby, 8, bxay, temp16); + + xlen = scale_expansion_zeroelim(temp16len, temp16, cdx, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, cdx, detxx); + xtlen = scale_expansion_zeroelim(temp16len, temp16, cdxtail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, cdx, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, cdxtail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + + ylen = scale_expansion_zeroelim(temp16len, temp16, cdy, dety); + yylen = scale_expansion_zeroelim(ylen, dety, cdy, detyy); + ytlen = scale_expansion_zeroelim(temp16len, temp16, cdytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, cdy, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, cdytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + + clen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, cdet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, clen, cdet, deter); + + return deter[deterlen - 1]; +} + +REAL incircleadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL permanent) +{ + INEXACT REAL adx, bdx, cdx, ady, bdy, cdy; + REAL det, errbound; + + INEXACT REAL bdxcdy1, cdxbdy1, cdxady1, adxcdy1, adxbdy1, bdxady1; + REAL bdxcdy0, cdxbdy0, cdxady0, adxcdy0, adxbdy0, bdxady0; + REAL bc[4], ca[4], ab[4]; + INEXACT REAL bc3, ca3, ab3; + REAL axbc[8], axxbc[16], aybc[8], ayybc[16], adet[32]; + int axbclen, axxbclen, aybclen, ayybclen, alen; + REAL bxca[8], bxxca[16], byca[8], byyca[16], bdet[32]; + int bxcalen, bxxcalen, bycalen, byycalen, blen; + REAL cxab[8], cxxab[16], cyab[8], cyyab[16], cdet[32]; + int cxablen, cxxablen, cyablen, cyyablen, clen; + REAL abdet[64]; + int ablen; + REAL fin1[1152], fin2[1152]; + REAL *finnow, *finother, *finswap; + int finlength; + + REAL adxtail, bdxtail, cdxtail, adytail, bdytail, cdytail; + INEXACT REAL adxadx1, adyady1, bdxbdx1, bdybdy1, cdxcdx1, cdycdy1; + REAL adxadx0, adyady0, bdxbdx0, bdybdy0, cdxcdx0, cdycdy0; + REAL aa[4], bb[4], cc[4]; + INEXACT REAL aa3, bb3, cc3; + INEXACT REAL ti1, tj1; + REAL ti0, tj0; + REAL u[4], v[4]; + INEXACT REAL u3, v3; + REAL temp8[8], temp16a[16], temp16b[16], temp16c[16]; + REAL temp32a[32], temp32b[32], temp48[48], temp64[64]; + int temp8len, temp16alen, temp16blen, temp16clen; + int temp32alen, temp32blen, temp48len, temp64len; + REAL axtbb[8], axtcc[8], aytbb[8], aytcc[8]; + int axtbblen, axtcclen, aytbblen, aytcclen; + REAL bxtaa[8], bxtcc[8], bytaa[8], bytcc[8]; + int bxtaalen, bxtcclen, bytaalen, bytcclen; + REAL cxtaa[8], cxtbb[8], cytaa[8], cytbb[8]; + int cxtaalen, cxtbblen, cytaalen, cytbblen; + REAL axtbc[8], aytbc[8], bxtca[8], bytca[8], cxtab[8], cytab[8]; + int axtbclen, aytbclen, bxtcalen, bytcalen, cxtablen, cytablen; + REAL axtbct[16], aytbct[16], bxtcat[16], bytcat[16], cxtabt[16], cytabt[16]; + int axtbctlen, aytbctlen, bxtcatlen, bytcatlen, cxtabtlen, cytabtlen; + REAL axtbctt[8], aytbctt[8], bxtcatt[8]; + REAL bytcatt[8], cxtabtt[8], cytabtt[8]; + int axtbcttlen, aytbcttlen, bxtcattlen, bytcattlen, cxtabttlen, cytabttlen; + REAL abt[8], bct[8], cat[8]; + int abtlen, bctlen, catlen; + REAL abtt[4], bctt[4], catt[4]; + int abttlen, bcttlen, cattlen; + INEXACT REAL abtt3, bctt3, catt3; + REAL negate; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + adx = (REAL) (pa[0] - pd[0]); + bdx = (REAL) (pb[0] - pd[0]); + cdx = (REAL) (pc[0] - pd[0]); + ady = (REAL) (pa[1] - pd[1]); + bdy = (REAL) (pb[1] - pd[1]); + cdy = (REAL) (pc[1] - pd[1]); + + Two_Product(bdx, cdy, bdxcdy1, bdxcdy0); + Two_Product(cdx, bdy, cdxbdy1, cdxbdy0); + Two_Two_Diff(bdxcdy1, bdxcdy0, cdxbdy1, cdxbdy0, bc3, bc[2], bc[1], bc[0]); + bc[3] = bc3; + axbclen = scale_expansion_zeroelim(4, bc, adx, axbc); + axxbclen = scale_expansion_zeroelim(axbclen, axbc, adx, axxbc); + aybclen = scale_expansion_zeroelim(4, bc, ady, aybc); + ayybclen = scale_expansion_zeroelim(aybclen, aybc, ady, ayybc); + alen = fast_expansion_sum_zeroelim(axxbclen, axxbc, ayybclen, ayybc, adet); + + Two_Product(cdx, ady, cdxady1, cdxady0); + Two_Product(adx, cdy, adxcdy1, adxcdy0); + Two_Two_Diff(cdxady1, cdxady0, adxcdy1, adxcdy0, ca3, ca[2], ca[1], ca[0]); + ca[3] = ca3; + bxcalen = scale_expansion_zeroelim(4, ca, bdx, bxca); + bxxcalen = scale_expansion_zeroelim(bxcalen, bxca, bdx, bxxca); + bycalen = scale_expansion_zeroelim(4, ca, bdy, byca); + byycalen = scale_expansion_zeroelim(bycalen, byca, bdy, byyca); + blen = fast_expansion_sum_zeroelim(bxxcalen, bxxca, byycalen, byyca, bdet); + + Two_Product(adx, bdy, adxbdy1, adxbdy0); + Two_Product(bdx, ady, bdxady1, bdxady0); + Two_Two_Diff(adxbdy1, adxbdy0, bdxady1, bdxady0, ab3, ab[2], ab[1], ab[0]); + ab[3] = ab3; + cxablen = scale_expansion_zeroelim(4, ab, cdx, cxab); + cxxablen = scale_expansion_zeroelim(cxablen, cxab, cdx, cxxab); + cyablen = scale_expansion_zeroelim(4, ab, cdy, cyab); + cyyablen = scale_expansion_zeroelim(cyablen, cyab, cdy, cyyab); + clen = fast_expansion_sum_zeroelim(cxxablen, cxxab, cyyablen, cyyab, cdet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + finlength = fast_expansion_sum_zeroelim(ablen, abdet, clen, cdet, fin1); + + det = estimate(finlength, fin1); + errbound = iccerrboundB * permanent; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pd[0], adx, adxtail); + Two_Diff_Tail(pa[1], pd[1], ady, adytail); + Two_Diff_Tail(pb[0], pd[0], bdx, bdxtail); + Two_Diff_Tail(pb[1], pd[1], bdy, bdytail); + Two_Diff_Tail(pc[0], pd[0], cdx, cdxtail); + Two_Diff_Tail(pc[1], pd[1], cdy, cdytail); + if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0) + && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0)) { + return det; + } + + errbound = iccerrboundC * permanent + resulterrbound * Absolute(det); + det += ((adx * adx + ady * ady) * ((bdx * cdytail + cdy * bdxtail) + - (bdy * cdxtail + cdx * bdytail)) + + 2.0 * (adx * adxtail + ady * adytail) * (bdx * cdy - bdy * cdx)) + + ((bdx * bdx + bdy * bdy) * ((cdx * adytail + ady * cdxtail) + - (cdy * adxtail + adx * cdytail)) + + 2.0 * (bdx * bdxtail + bdy * bdytail) * (cdx * ady - cdy * adx)) + + ((cdx * cdx + cdy * cdy) * ((adx * bdytail + bdy * adxtail) + - (ady * bdxtail + bdx * adytail)) + + 2.0 * (cdx * cdxtail + cdy * cdytail) * (adx * bdy - ady * bdx)); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + finnow = fin1; + finother = fin2; + + if ((bdxtail != 0.0) || (bdytail != 0.0) + || (cdxtail != 0.0) || (cdytail != 0.0)) { + Square(adx, adxadx1, adxadx0); + Square(ady, adyady1, adyady0); + Two_Two_Sum(adxadx1, adxadx0, adyady1, adyady0, aa3, aa[2], aa[1], aa[0]); + aa[3] = aa3; + } + if ((cdxtail != 0.0) || (cdytail != 0.0) + || (adxtail != 0.0) || (adytail != 0.0)) { + Square(bdx, bdxbdx1, bdxbdx0); + Square(bdy, bdybdy1, bdybdy0); + Two_Two_Sum(bdxbdx1, bdxbdx0, bdybdy1, bdybdy0, bb3, bb[2], bb[1], bb[0]); + bb[3] = bb3; + } + if ((adxtail != 0.0) || (adytail != 0.0) + || (bdxtail != 0.0) || (bdytail != 0.0)) { + Square(cdx, cdxcdx1, cdxcdx0); + Square(cdy, cdycdy1, cdycdy0); + Two_Two_Sum(cdxcdx1, cdxcdx0, cdycdy1, cdycdy0, cc3, cc[2], cc[1], cc[0]); + cc[3] = cc3; + } + + if (adxtail != 0.0) { + axtbclen = scale_expansion_zeroelim(4, bc, adxtail, axtbc); + temp16alen = scale_expansion_zeroelim(axtbclen, axtbc, 2.0 * adx, + temp16a); + + axtcclen = scale_expansion_zeroelim(4, cc, adxtail, axtcc); + temp16blen = scale_expansion_zeroelim(axtcclen, axtcc, bdy, temp16b); + + axtbblen = scale_expansion_zeroelim(4, bb, adxtail, axtbb); + temp16clen = scale_expansion_zeroelim(axtbblen, axtbb, -cdy, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (adytail != 0.0) { + aytbclen = scale_expansion_zeroelim(4, bc, adytail, aytbc); + temp16alen = scale_expansion_zeroelim(aytbclen, aytbc, 2.0 * ady, + temp16a); + + aytbblen = scale_expansion_zeroelim(4, bb, adytail, aytbb); + temp16blen = scale_expansion_zeroelim(aytbblen, aytbb, cdx, temp16b); + + aytcclen = scale_expansion_zeroelim(4, cc, adytail, aytcc); + temp16clen = scale_expansion_zeroelim(aytcclen, aytcc, -bdx, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdxtail != 0.0) { + bxtcalen = scale_expansion_zeroelim(4, ca, bdxtail, bxtca); + temp16alen = scale_expansion_zeroelim(bxtcalen, bxtca, 2.0 * bdx, + temp16a); + + bxtaalen = scale_expansion_zeroelim(4, aa, bdxtail, bxtaa); + temp16blen = scale_expansion_zeroelim(bxtaalen, bxtaa, cdy, temp16b); + + bxtcclen = scale_expansion_zeroelim(4, cc, bdxtail, bxtcc); + temp16clen = scale_expansion_zeroelim(bxtcclen, bxtcc, -ady, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdytail != 0.0) { + bytcalen = scale_expansion_zeroelim(4, ca, bdytail, bytca); + temp16alen = scale_expansion_zeroelim(bytcalen, bytca, 2.0 * bdy, + temp16a); + + bytcclen = scale_expansion_zeroelim(4, cc, bdytail, bytcc); + temp16blen = scale_expansion_zeroelim(bytcclen, bytcc, adx, temp16b); + + bytaalen = scale_expansion_zeroelim(4, aa, bdytail, bytaa); + temp16clen = scale_expansion_zeroelim(bytaalen, bytaa, -cdx, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdxtail != 0.0) { + cxtablen = scale_expansion_zeroelim(4, ab, cdxtail, cxtab); + temp16alen = scale_expansion_zeroelim(cxtablen, cxtab, 2.0 * cdx, + temp16a); + + cxtbblen = scale_expansion_zeroelim(4, bb, cdxtail, cxtbb); + temp16blen = scale_expansion_zeroelim(cxtbblen, cxtbb, ady, temp16b); + + cxtaalen = scale_expansion_zeroelim(4, aa, cdxtail, cxtaa); + temp16clen = scale_expansion_zeroelim(cxtaalen, cxtaa, -bdy, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdytail != 0.0) { + cytablen = scale_expansion_zeroelim(4, ab, cdytail, cytab); + temp16alen = scale_expansion_zeroelim(cytablen, cytab, 2.0 * cdy, + temp16a); + + cytaalen = scale_expansion_zeroelim(4, aa, cdytail, cytaa); + temp16blen = scale_expansion_zeroelim(cytaalen, cytaa, bdx, temp16b); + + cytbblen = scale_expansion_zeroelim(4, bb, cdytail, cytbb); + temp16clen = scale_expansion_zeroelim(cytbblen, cytbb, -adx, temp16c); + + temp32alen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16clen, temp16c, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + if ((adxtail != 0.0) || (adytail != 0.0)) { + if ((bdxtail != 0.0) || (bdytail != 0.0) + || (cdxtail != 0.0) || (cdytail != 0.0)) { + Two_Product(bdxtail, cdy, ti1, ti0); + Two_Product(bdx, cdytail, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]); + u[3] = u3; + negate = -bdy; + Two_Product(cdxtail, negate, ti1, ti0); + negate = -bdytail; + Two_Product(cdx, negate, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]); + v[3] = v3; + bctlen = fast_expansion_sum_zeroelim(4, u, 4, v, bct); + + Two_Product(bdxtail, cdytail, ti1, ti0); + Two_Product(cdxtail, bdytail, tj1, tj0); + Two_Two_Diff(ti1, ti0, tj1, tj0, bctt3, bctt[2], bctt[1], bctt[0]); + bctt[3] = bctt3; + bcttlen = 4; + } else { + bct[0] = 0.0; + bctlen = 1; + bctt[0] = 0.0; + bcttlen = 1; + } + + if (adxtail != 0.0) { + temp16alen = scale_expansion_zeroelim(axtbclen, axtbc, adxtail, temp16a); + axtbctlen = scale_expansion_zeroelim(bctlen, bct, adxtail, axtbct); + temp32alen = scale_expansion_zeroelim(axtbctlen, axtbct, 2.0 * adx, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + if (bdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, cc, adxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, bdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, bb, -adxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, cdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + temp32alen = scale_expansion_zeroelim(axtbctlen, axtbct, adxtail, + temp32a); + axtbcttlen = scale_expansion_zeroelim(bcttlen, bctt, adxtail, axtbctt); + temp16alen = scale_expansion_zeroelim(axtbcttlen, axtbctt, 2.0 * adx, + temp16a); + temp16blen = scale_expansion_zeroelim(axtbcttlen, axtbctt, adxtail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (adytail != 0.0) { + temp16alen = scale_expansion_zeroelim(aytbclen, aytbc, adytail, temp16a); + aytbctlen = scale_expansion_zeroelim(bctlen, bct, adytail, aytbct); + temp32alen = scale_expansion_zeroelim(aytbctlen, aytbct, 2.0 * ady, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + + + temp32alen = scale_expansion_zeroelim(aytbctlen, aytbct, adytail, + temp32a); + aytbcttlen = scale_expansion_zeroelim(bcttlen, bctt, adytail, aytbctt); + temp16alen = scale_expansion_zeroelim(aytbcttlen, aytbctt, 2.0 * ady, + temp16a); + temp16blen = scale_expansion_zeroelim(aytbcttlen, aytbctt, adytail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if ((bdxtail != 0.0) || (bdytail != 0.0)) { + if ((cdxtail != 0.0) || (cdytail != 0.0) + || (adxtail != 0.0) || (adytail != 0.0)) { + Two_Product(cdxtail, ady, ti1, ti0); + Two_Product(cdx, adytail, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]); + u[3] = u3; + negate = -cdy; + Two_Product(adxtail, negate, ti1, ti0); + negate = -cdytail; + Two_Product(adx, negate, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]); + v[3] = v3; + catlen = fast_expansion_sum_zeroelim(4, u, 4, v, cat); + + Two_Product(cdxtail, adytail, ti1, ti0); + Two_Product(adxtail, cdytail, tj1, tj0); + Two_Two_Diff(ti1, ti0, tj1, tj0, catt3, catt[2], catt[1], catt[0]); + catt[3] = catt3; + cattlen = 4; + } else { + cat[0] = 0.0; + catlen = 1; + catt[0] = 0.0; + cattlen = 1; + } + + if (bdxtail != 0.0) { + temp16alen = scale_expansion_zeroelim(bxtcalen, bxtca, bdxtail, temp16a); + bxtcatlen = scale_expansion_zeroelim(catlen, cat, bdxtail, bxtcat); + temp32alen = scale_expansion_zeroelim(bxtcatlen, bxtcat, 2.0 * bdx, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + if (cdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, aa, bdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, cdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (adytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, cc, -bdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, adytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + temp32alen = scale_expansion_zeroelim(bxtcatlen, bxtcat, bdxtail, + temp32a); + bxtcattlen = scale_expansion_zeroelim(cattlen, catt, bdxtail, bxtcatt); + temp16alen = scale_expansion_zeroelim(bxtcattlen, bxtcatt, 2.0 * bdx, + temp16a); + temp16blen = scale_expansion_zeroelim(bxtcattlen, bxtcatt, bdxtail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdytail != 0.0) { + temp16alen = scale_expansion_zeroelim(bytcalen, bytca, bdytail, temp16a); + bytcatlen = scale_expansion_zeroelim(catlen, cat, bdytail, bytcat); + temp32alen = scale_expansion_zeroelim(bytcatlen, bytcat, 2.0 * bdy, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + + + temp32alen = scale_expansion_zeroelim(bytcatlen, bytcat, bdytail, + temp32a); + bytcattlen = scale_expansion_zeroelim(cattlen, catt, bdytail, bytcatt); + temp16alen = scale_expansion_zeroelim(bytcattlen, bytcatt, 2.0 * bdy, + temp16a); + temp16blen = scale_expansion_zeroelim(bytcattlen, bytcatt, bdytail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + if ((cdxtail != 0.0) || (cdytail != 0.0)) { + if ((adxtail != 0.0) || (adytail != 0.0) + || (bdxtail != 0.0) || (bdytail != 0.0)) { + Two_Product(adxtail, bdy, ti1, ti0); + Two_Product(adx, bdytail, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, u3, u[2], u[1], u[0]); + u[3] = u3; + negate = -ady; + Two_Product(bdxtail, negate, ti1, ti0); + negate = -adytail; + Two_Product(bdx, negate, tj1, tj0); + Two_Two_Sum(ti1, ti0, tj1, tj0, v3, v[2], v[1], v[0]); + v[3] = v3; + abtlen = fast_expansion_sum_zeroelim(4, u, 4, v, abt); + + Two_Product(adxtail, bdytail, ti1, ti0); + Two_Product(bdxtail, adytail, tj1, tj0); + Two_Two_Diff(ti1, ti0, tj1, tj0, abtt3, abtt[2], abtt[1], abtt[0]); + abtt[3] = abtt3; + abttlen = 4; + } else { + abt[0] = 0.0; + abtlen = 1; + abtt[0] = 0.0; + abttlen = 1; + } + + if (cdxtail != 0.0) { + temp16alen = scale_expansion_zeroelim(cxtablen, cxtab, cdxtail, temp16a); + cxtabtlen = scale_expansion_zeroelim(abtlen, abt, cdxtail, cxtabt); + temp32alen = scale_expansion_zeroelim(cxtabtlen, cxtabt, 2.0 * cdx, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + if (adytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, bb, cdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, adytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (bdytail != 0.0) { + temp8len = scale_expansion_zeroelim(4, aa, -cdxtail, temp8); + temp16alen = scale_expansion_zeroelim(temp8len, temp8, bdytail, + temp16a); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp16alen, + temp16a, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + + temp32alen = scale_expansion_zeroelim(cxtabtlen, cxtabt, cdxtail, + temp32a); + cxtabttlen = scale_expansion_zeroelim(abttlen, abtt, cdxtail, cxtabtt); + temp16alen = scale_expansion_zeroelim(cxtabttlen, cxtabtt, 2.0 * cdx, + temp16a); + temp16blen = scale_expansion_zeroelim(cxtabttlen, cxtabtt, cdxtail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + if (cdytail != 0.0) { + temp16alen = scale_expansion_zeroelim(cytablen, cytab, cdytail, temp16a); + cytabtlen = scale_expansion_zeroelim(abtlen, abt, cdytail, cytabt); + temp32alen = scale_expansion_zeroelim(cytabtlen, cytabt, 2.0 * cdy, + temp32a); + temp48len = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp32alen, temp32a, temp48); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp48len, + temp48, finother); + finswap = finnow; finnow = finother; finother = finswap; + + + temp32alen = scale_expansion_zeroelim(cytabtlen, cytabt, cdytail, + temp32a); + cytabttlen = scale_expansion_zeroelim(abttlen, abtt, cdytail, cytabtt); + temp16alen = scale_expansion_zeroelim(cytabttlen, cytabtt, 2.0 * cdy, + temp16a); + temp16blen = scale_expansion_zeroelim(cytabttlen, cytabtt, cdytail, + temp16b); + temp32blen = fast_expansion_sum_zeroelim(temp16alen, temp16a, + temp16blen, temp16b, temp32b); + temp64len = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64); + finlength = fast_expansion_sum_zeroelim(finlength, finnow, temp64len, + temp64, finother); + finswap = finnow; finnow = finother; finother = finswap; + } + } + + return finnow[finlength - 1]; +} + +REAL incircle(REAL *pa, REAL *pb, REAL *pc, REAL *pd) +{ + REAL adx, bdx, cdx, ady, bdy, cdy; + REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady; + REAL alift, blift, clift; + REAL det; + REAL permanent, errbound; + + adx = pa[0] - pd[0]; + bdx = pb[0] - pd[0]; + cdx = pc[0] - pd[0]; + ady = pa[1] - pd[1]; + bdy = pb[1] - pd[1]; + cdy = pc[1] - pd[1]; + + bdxcdy = bdx * cdy; + cdxbdy = cdx * bdy; + alift = adx * adx + ady * ady; + + cdxady = cdx * ady; + adxcdy = adx * cdy; + blift = bdx * bdx + bdy * bdy; + + adxbdy = adx * bdy; + bdxady = bdx * ady; + clift = cdx * cdx + cdy * cdy; + + det = alift * (bdxcdy - cdxbdy) + + blift * (cdxady - adxcdy) + + clift * (adxbdy - bdxady); + + permanent = (Absolute(bdxcdy) + Absolute(cdxbdy)) * alift + + (Absolute(cdxady) + Absolute(adxcdy)) * blift + + (Absolute(adxbdy) + Absolute(bdxady)) * clift; + errbound = iccerrboundA * permanent; + if ((det > errbound) || (-det > errbound)) { + return det; + } + + return incircleadapt(pa, pb, pc, pd, permanent); +} + +/*****************************************************************************/ +/* */ +/* inspherefast() Approximate 3D insphere test. Nonrobust. */ +/* insphereexact() Exact 3D insphere test. Robust. */ +/* insphereslow() Another exact 3D insphere test. Robust. */ +/* insphere() Adaptive exact 3D insphere test. Robust. */ +/* */ +/* Return a positive value if the point pe lies inside the */ +/* sphere passing through pa, pb, pc, and pd; a negative value */ +/* if it lies outside; and zero if the five points are */ +/* cospherical. The points pa, pb, pc, and pd must be ordered */ +/* so that they have a positive orientation (as defined by */ +/* orient3d()), or the sign of the result will be reversed. */ +/* */ +/* Only the first and last routine should be used; the middle two are for */ +/* timings. */ +/* */ +/* The last three use exact arithmetic to ensure a correct answer. The */ +/* result returned is the determinant of a matrix. In insphere() only, */ +/* this determinant is computed adaptively, in the sense that exact */ +/* arithmetic is used only to the degree it is needed to ensure that the */ +/* returned value has the correct sign. Hence, insphere() is usually quite */ +/* fast, but will run more slowly when the input points are cospherical or */ +/* nearly so. */ +/* */ +/*****************************************************************************/ + +REAL inspherefast(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) +{ + REAL aex, bex, cex, dex; + REAL aey, bey, cey, dey; + REAL aez, bez, cez, dez; + REAL alift, blift, clift, dlift; + REAL ab, bc, cd, da, ac, bd; + REAL abc, bcd, cda, dab; + + aex = pa[0] - pe[0]; + bex = pb[0] - pe[0]; + cex = pc[0] - pe[0]; + dex = pd[0] - pe[0]; + aey = pa[1] - pe[1]; + bey = pb[1] - pe[1]; + cey = pc[1] - pe[1]; + dey = pd[1] - pe[1]; + aez = pa[2] - pe[2]; + bez = pb[2] - pe[2]; + cez = pc[2] - pe[2]; + dez = pd[2] - pe[2]; + + ab = aex * bey - bex * aey; + bc = bex * cey - cex * bey; + cd = cex * dey - dex * cey; + da = dex * aey - aex * dey; + + ac = aex * cey - cex * aey; + bd = bex * dey - dex * bey; + + abc = aez * bc - bez * ac + cez * ab; + bcd = bez * cd - cez * bd + dez * bc; + cda = cez * da + dez * ac + aez * cd; + dab = dez * ab + aez * bd + bez * da; + + alift = aex * aex + aey * aey + aez * aez; + blift = bex * bex + bey * bey + bez * bez; + clift = cex * cex + cey * cey + cez * cez; + dlift = dex * dex + dey * dey + dez * dez; + + return (dlift * abc - clift * dab) + (blift * cda - alift * bcd); +} + +REAL insphereexact(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) +{ + INEXACT REAL axby1, bxcy1, cxdy1, dxey1, exay1; + INEXACT REAL bxay1, cxby1, dxcy1, exdy1, axey1; + INEXACT REAL axcy1, bxdy1, cxey1, dxay1, exby1; + INEXACT REAL cxay1, dxby1, excy1, axdy1, bxey1; + REAL axby0, bxcy0, cxdy0, dxey0, exay0; + REAL bxay0, cxby0, dxcy0, exdy0, axey0; + REAL axcy0, bxdy0, cxey0, dxay0, exby0; + REAL cxay0, dxby0, excy0, axdy0, bxey0; + REAL ab[4], bc[4], cd[4], de[4], ea[4]; + REAL ac[4], bd[4], ce[4], da[4], eb[4]; + REAL temp8a[8], temp8b[8], temp16[16]; + int temp8alen, temp8blen, temp16len; + REAL abc[24], bcd[24], cde[24], dea[24], eab[24]; + REAL abd[24], bce[24], cda[24], deb[24], eac[24]; + int abclen, bcdlen, cdelen, dealen, eablen; + int abdlen, bcelen, cdalen, deblen, eaclen; + REAL temp48a[48], temp48b[48]; + int temp48alen, temp48blen; + REAL abcd[96], bcde[96], cdea[96], deab[96], eabc[96]; + int abcdlen, bcdelen, cdealen, deablen, eabclen; + REAL temp192[192]; + REAL det384x[384], det384y[384], det384z[384]; + int xlen, ylen, zlen; + REAL detxy[768]; + int xylen; + REAL adet[1152], bdet[1152], cdet[1152], ddet[1152], edet[1152]; + int alen, blen, clen, dlen, elen; + REAL abdet[2304], cddet[2304], cdedet[3456]; + int ablen, cdlen; + REAL deter[5760]; + int deterlen; + int i; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + Two_Product(pa[0], pb[1], axby1, axby0); + Two_Product(pb[0], pa[1], bxay1, bxay0); + Two_Two_Diff(axby1, axby0, bxay1, bxay0, ab[3], ab[2], ab[1], ab[0]); + + Two_Product(pb[0], pc[1], bxcy1, bxcy0); + Two_Product(pc[0], pb[1], cxby1, cxby0); + Two_Two_Diff(bxcy1, bxcy0, cxby1, cxby0, bc[3], bc[2], bc[1], bc[0]); + + Two_Product(pc[0], pd[1], cxdy1, cxdy0); + Two_Product(pd[0], pc[1], dxcy1, dxcy0); + Two_Two_Diff(cxdy1, cxdy0, dxcy1, dxcy0, cd[3], cd[2], cd[1], cd[0]); + + Two_Product(pd[0], pe[1], dxey1, dxey0); + Two_Product(pe[0], pd[1], exdy1, exdy0); + Two_Two_Diff(dxey1, dxey0, exdy1, exdy0, de[3], de[2], de[1], de[0]); + + Two_Product(pe[0], pa[1], exay1, exay0); + Two_Product(pa[0], pe[1], axey1, axey0); + Two_Two_Diff(exay1, exay0, axey1, axey0, ea[3], ea[2], ea[1], ea[0]); + + Two_Product(pa[0], pc[1], axcy1, axcy0); + Two_Product(pc[0], pa[1], cxay1, cxay0); + Two_Two_Diff(axcy1, axcy0, cxay1, cxay0, ac[3], ac[2], ac[1], ac[0]); + + Two_Product(pb[0], pd[1], bxdy1, bxdy0); + Two_Product(pd[0], pb[1], dxby1, dxby0); + Two_Two_Diff(bxdy1, bxdy0, dxby1, dxby0, bd[3], bd[2], bd[1], bd[0]); + + Two_Product(pc[0], pe[1], cxey1, cxey0); + Two_Product(pe[0], pc[1], excy1, excy0); + Two_Two_Diff(cxey1, cxey0, excy1, excy0, ce[3], ce[2], ce[1], ce[0]); + + Two_Product(pd[0], pa[1], dxay1, dxay0); + Two_Product(pa[0], pd[1], axdy1, axdy0); + Two_Two_Diff(dxay1, dxay0, axdy1, axdy0, da[3], da[2], da[1], da[0]); + + Two_Product(pe[0], pb[1], exby1, exby0); + Two_Product(pb[0], pe[1], bxey1, bxey0); + Two_Two_Diff(exby1, exby0, bxey1, bxey0, eb[3], eb[2], eb[1], eb[0]); + + temp8alen = scale_expansion_zeroelim(4, bc, pa[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, -pb[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ab, pc[2], temp8a); + abclen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + abc); + + temp8alen = scale_expansion_zeroelim(4, cd, pb[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, -pc[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, bc, pd[2], temp8a); + bcdlen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + bcd); + + temp8alen = scale_expansion_zeroelim(4, de, pc[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ce, -pd[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, cd, pe[2], temp8a); + cdelen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + cde); + + temp8alen = scale_expansion_zeroelim(4, ea, pd[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, da, -pe[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, de, pa[2], temp8a); + dealen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + dea); + + temp8alen = scale_expansion_zeroelim(4, ab, pe[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, eb, -pa[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ea, pb[2], temp8a); + eablen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + eab); + + temp8alen = scale_expansion_zeroelim(4, bd, pa[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, da, pb[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ab, pd[2], temp8a); + abdlen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + abd); + + temp8alen = scale_expansion_zeroelim(4, ce, pb[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, eb, pc[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, bc, pe[2], temp8a); + bcelen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + bce); + + temp8alen = scale_expansion_zeroelim(4, da, pc[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, pd[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, cd, pa[2], temp8a); + cdalen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + cda); + + temp8alen = scale_expansion_zeroelim(4, eb, pd[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, pe[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, de, pb[2], temp8a); + deblen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + deb); + + temp8alen = scale_expansion_zeroelim(4, ac, pe[2], temp8a); + temp8blen = scale_expansion_zeroelim(4, ce, pa[2], temp8b); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp8blen, temp8b, + temp16); + temp8alen = scale_expansion_zeroelim(4, ea, pc[2], temp8a); + eaclen = fast_expansion_sum_zeroelim(temp8alen, temp8a, temp16len, temp16, + eac); + + temp48alen = fast_expansion_sum_zeroelim(cdelen, cde, bcelen, bce, temp48a); + temp48blen = fast_expansion_sum_zeroelim(deblen, deb, bcdlen, bcd, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + bcdelen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, bcde); + xlen = scale_expansion_zeroelim(bcdelen, bcde, pa[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pa[0], det384x); + ylen = scale_expansion_zeroelim(bcdelen, bcde, pa[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pa[1], det384y); + zlen = scale_expansion_zeroelim(bcdelen, bcde, pa[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pa[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + alen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, adet); + + temp48alen = fast_expansion_sum_zeroelim(dealen, dea, cdalen, cda, temp48a); + temp48blen = fast_expansion_sum_zeroelim(eaclen, eac, cdelen, cde, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + cdealen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, cdea); + xlen = scale_expansion_zeroelim(cdealen, cdea, pb[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pb[0], det384x); + ylen = scale_expansion_zeroelim(cdealen, cdea, pb[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pb[1], det384y); + zlen = scale_expansion_zeroelim(cdealen, cdea, pb[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pb[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + blen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, bdet); + + temp48alen = fast_expansion_sum_zeroelim(eablen, eab, deblen, deb, temp48a); + temp48blen = fast_expansion_sum_zeroelim(abdlen, abd, dealen, dea, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + deablen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, deab); + xlen = scale_expansion_zeroelim(deablen, deab, pc[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pc[0], det384x); + ylen = scale_expansion_zeroelim(deablen, deab, pc[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pc[1], det384y); + zlen = scale_expansion_zeroelim(deablen, deab, pc[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pc[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + clen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, cdet); + + temp48alen = fast_expansion_sum_zeroelim(abclen, abc, eaclen, eac, temp48a); + temp48blen = fast_expansion_sum_zeroelim(bcelen, bce, eablen, eab, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + eabclen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, eabc); + xlen = scale_expansion_zeroelim(eabclen, eabc, pd[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pd[0], det384x); + ylen = scale_expansion_zeroelim(eabclen, eabc, pd[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pd[1], det384y); + zlen = scale_expansion_zeroelim(eabclen, eabc, pd[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pd[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + dlen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, ddet); + + temp48alen = fast_expansion_sum_zeroelim(bcdlen, bcd, abdlen, abd, temp48a); + temp48blen = fast_expansion_sum_zeroelim(cdalen, cda, abclen, abc, temp48b); + for (i = 0; i < temp48blen; i++) { + temp48b[i] = -temp48b[i]; + } + abcdlen = fast_expansion_sum_zeroelim(temp48alen, temp48a, + temp48blen, temp48b, abcd); + xlen = scale_expansion_zeroelim(abcdlen, abcd, pe[0], temp192); + xlen = scale_expansion_zeroelim(xlen, temp192, pe[0], det384x); + ylen = scale_expansion_zeroelim(abcdlen, abcd, pe[1], temp192); + ylen = scale_expansion_zeroelim(ylen, temp192, pe[1], det384y); + zlen = scale_expansion_zeroelim(abcdlen, abcd, pe[2], temp192); + zlen = scale_expansion_zeroelim(zlen, temp192, pe[2], det384z); + xylen = fast_expansion_sum_zeroelim(xlen, det384x, ylen, det384y, detxy); + elen = fast_expansion_sum_zeroelim(xylen, detxy, zlen, det384z, edet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + cdelen = fast_expansion_sum_zeroelim(cdlen, cddet, elen, edet, cdedet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, cdelen, cdedet, deter); + + return deter[deterlen - 1]; +} + +REAL insphereslow(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) +{ + INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez; + REAL aextail, bextail, cextail, dextail; + REAL aeytail, beytail, ceytail, deytail; + REAL aeztail, beztail, ceztail, deztail; + REAL negate, negatetail; + INEXACT REAL axby7, bxcy7, cxdy7, dxay7, axcy7, bxdy7; + INEXACT REAL bxay7, cxby7, dxcy7, axdy7, cxay7, dxby7; + REAL axby[8], bxcy[8], cxdy[8], dxay[8], axcy[8], bxdy[8]; + REAL bxay[8], cxby[8], dxcy[8], axdy[8], cxay[8], dxby[8]; + REAL ab[16], bc[16], cd[16], da[16], ac[16], bd[16]; + int ablen, bclen, cdlen, dalen, aclen, bdlen; + REAL temp32a[32], temp32b[32], temp64a[64], temp64b[64], temp64c[64]; + int temp32alen, temp32blen, temp64alen, temp64blen, temp64clen; + REAL temp128[128], temp192[192]; + int temp128len, temp192len; + REAL detx[384], detxx[768], detxt[384], detxxt[768], detxtxt[768]; + int xlen, xxlen, xtlen, xxtlen, xtxtlen; + REAL x1[1536], x2[2304]; + int x1len, x2len; + REAL dety[384], detyy[768], detyt[384], detyyt[768], detytyt[768]; + int ylen, yylen, ytlen, yytlen, ytytlen; + REAL y1[1536], y2[2304]; + int y1len, y2len; + REAL detz[384], detzz[768], detzt[384], detzzt[768], detztzt[768]; + int zlen, zzlen, ztlen, zztlen, ztztlen; + REAL z1[1536], z2[2304]; + int z1len, z2len; + REAL detxy[4608]; + int xylen; + REAL adet[6912], bdet[6912], cdet[6912], ddet[6912]; + int alen, blen, clen, dlen; + REAL abdet[13824], cddet[13824], deter[27648]; + int deterlen; + int i; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL a0hi, a0lo, a1hi, a1lo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j, _k, _l, _m, _n; + REAL _0, _1, _2; + + Two_Diff(pa[0], pe[0], aex, aextail); + Two_Diff(pa[1], pe[1], aey, aeytail); + Two_Diff(pa[2], pe[2], aez, aeztail); + Two_Diff(pb[0], pe[0], bex, bextail); + Two_Diff(pb[1], pe[1], bey, beytail); + Two_Diff(pb[2], pe[2], bez, beztail); + Two_Diff(pc[0], pe[0], cex, cextail); + Two_Diff(pc[1], pe[1], cey, ceytail); + Two_Diff(pc[2], pe[2], cez, ceztail); + Two_Diff(pd[0], pe[0], dex, dextail); + Two_Diff(pd[1], pe[1], dey, deytail); + Two_Diff(pd[2], pe[2], dez, deztail); + + Two_Two_Product(aex, aextail, bey, beytail, + axby7, axby[6], axby[5], axby[4], + axby[3], axby[2], axby[1], axby[0]); + axby[7] = axby7; + negate = -aey; + negatetail = -aeytail; + Two_Two_Product(bex, bextail, negate, negatetail, + bxay7, bxay[6], bxay[5], bxay[4], + bxay[3], bxay[2], bxay[1], bxay[0]); + bxay[7] = bxay7; + ablen = fast_expansion_sum_zeroelim(8, axby, 8, bxay, ab); + Two_Two_Product(bex, bextail, cey, ceytail, + bxcy7, bxcy[6], bxcy[5], bxcy[4], + bxcy[3], bxcy[2], bxcy[1], bxcy[0]); + bxcy[7] = bxcy7; + negate = -bey; + negatetail = -beytail; + Two_Two_Product(cex, cextail, negate, negatetail, + cxby7, cxby[6], cxby[5], cxby[4], + cxby[3], cxby[2], cxby[1], cxby[0]); + cxby[7] = cxby7; + bclen = fast_expansion_sum_zeroelim(8, bxcy, 8, cxby, bc); + Two_Two_Product(cex, cextail, dey, deytail, + cxdy7, cxdy[6], cxdy[5], cxdy[4], + cxdy[3], cxdy[2], cxdy[1], cxdy[0]); + cxdy[7] = cxdy7; + negate = -cey; + negatetail = -ceytail; + Two_Two_Product(dex, dextail, negate, negatetail, + dxcy7, dxcy[6], dxcy[5], dxcy[4], + dxcy[3], dxcy[2], dxcy[1], dxcy[0]); + dxcy[7] = dxcy7; + cdlen = fast_expansion_sum_zeroelim(8, cxdy, 8, dxcy, cd); + Two_Two_Product(dex, dextail, aey, aeytail, + dxay7, dxay[6], dxay[5], dxay[4], + dxay[3], dxay[2], dxay[1], dxay[0]); + dxay[7] = dxay7; + negate = -dey; + negatetail = -deytail; + Two_Two_Product(aex, aextail, negate, negatetail, + axdy7, axdy[6], axdy[5], axdy[4], + axdy[3], axdy[2], axdy[1], axdy[0]); + axdy[7] = axdy7; + dalen = fast_expansion_sum_zeroelim(8, dxay, 8, axdy, da); + Two_Two_Product(aex, aextail, cey, ceytail, + axcy7, axcy[6], axcy[5], axcy[4], + axcy[3], axcy[2], axcy[1], axcy[0]); + axcy[7] = axcy7; + negate = -aey; + negatetail = -aeytail; + Two_Two_Product(cex, cextail, negate, negatetail, + cxay7, cxay[6], cxay[5], cxay[4], + cxay[3], cxay[2], cxay[1], cxay[0]); + cxay[7] = cxay7; + aclen = fast_expansion_sum_zeroelim(8, axcy, 8, cxay, ac); + Two_Two_Product(bex, bextail, dey, deytail, + bxdy7, bxdy[6], bxdy[5], bxdy[4], + bxdy[3], bxdy[2], bxdy[1], bxdy[0]); + bxdy[7] = bxdy7; + negate = -bey; + negatetail = -beytail; + Two_Two_Product(dex, dextail, negate, negatetail, + dxby7, dxby[6], dxby[5], dxby[4], + dxby[3], dxby[2], dxby[1], dxby[0]); + dxby[7] = dxby7; + bdlen = fast_expansion_sum_zeroelim(8, bxdy, 8, dxby, bd); + + temp32alen = scale_expansion_zeroelim(cdlen, cd, -bez, temp32a); + temp32blen = scale_expansion_zeroelim(cdlen, cd, -beztail, temp32b); + temp64alen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64a); + temp32alen = scale_expansion_zeroelim(bdlen, bd, cez, temp32a); + temp32blen = scale_expansion_zeroelim(bdlen, bd, ceztail, temp32b); + temp64blen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64b); + temp32alen = scale_expansion_zeroelim(bclen, bc, -dez, temp32a); + temp32blen = scale_expansion_zeroelim(bclen, bc, -deztail, temp32b); + temp64clen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64c); + temp128len = fast_expansion_sum_zeroelim(temp64alen, temp64a, + temp64blen, temp64b, temp128); + temp192len = fast_expansion_sum_zeroelim(temp64clen, temp64c, + temp128len, temp128, temp192); + xlen = scale_expansion_zeroelim(temp192len, temp192, aex, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, aex, detxx); + xtlen = scale_expansion_zeroelim(temp192len, temp192, aextail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, aex, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, aextail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + ylen = scale_expansion_zeroelim(temp192len, temp192, aey, dety); + yylen = scale_expansion_zeroelim(ylen, dety, aey, detyy); + ytlen = scale_expansion_zeroelim(temp192len, temp192, aeytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, aey, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, aeytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + zlen = scale_expansion_zeroelim(temp192len, temp192, aez, detz); + zzlen = scale_expansion_zeroelim(zlen, detz, aez, detzz); + ztlen = scale_expansion_zeroelim(temp192len, temp192, aeztail, detzt); + zztlen = scale_expansion_zeroelim(ztlen, detzt, aez, detzzt); + for (i = 0; i < zztlen; i++) { + detzzt[i] *= 2.0; + } + ztztlen = scale_expansion_zeroelim(ztlen, detzt, aeztail, detztzt); + z1len = fast_expansion_sum_zeroelim(zzlen, detzz, zztlen, detzzt, z1); + z2len = fast_expansion_sum_zeroelim(z1len, z1, ztztlen, detztzt, z2); + xylen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, detxy); + alen = fast_expansion_sum_zeroelim(z2len, z2, xylen, detxy, adet); + + temp32alen = scale_expansion_zeroelim(dalen, da, cez, temp32a); + temp32blen = scale_expansion_zeroelim(dalen, da, ceztail, temp32b); + temp64alen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64a); + temp32alen = scale_expansion_zeroelim(aclen, ac, dez, temp32a); + temp32blen = scale_expansion_zeroelim(aclen, ac, deztail, temp32b); + temp64blen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64b); + temp32alen = scale_expansion_zeroelim(cdlen, cd, aez, temp32a); + temp32blen = scale_expansion_zeroelim(cdlen, cd, aeztail, temp32b); + temp64clen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64c); + temp128len = fast_expansion_sum_zeroelim(temp64alen, temp64a, + temp64blen, temp64b, temp128); + temp192len = fast_expansion_sum_zeroelim(temp64clen, temp64c, + temp128len, temp128, temp192); + xlen = scale_expansion_zeroelim(temp192len, temp192, bex, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, bex, detxx); + xtlen = scale_expansion_zeroelim(temp192len, temp192, bextail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, bex, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, bextail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + ylen = scale_expansion_zeroelim(temp192len, temp192, bey, dety); + yylen = scale_expansion_zeroelim(ylen, dety, bey, detyy); + ytlen = scale_expansion_zeroelim(temp192len, temp192, beytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, bey, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, beytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + zlen = scale_expansion_zeroelim(temp192len, temp192, bez, detz); + zzlen = scale_expansion_zeroelim(zlen, detz, bez, detzz); + ztlen = scale_expansion_zeroelim(temp192len, temp192, beztail, detzt); + zztlen = scale_expansion_zeroelim(ztlen, detzt, bez, detzzt); + for (i = 0; i < zztlen; i++) { + detzzt[i] *= 2.0; + } + ztztlen = scale_expansion_zeroelim(ztlen, detzt, beztail, detztzt); + z1len = fast_expansion_sum_zeroelim(zzlen, detzz, zztlen, detzzt, z1); + z2len = fast_expansion_sum_zeroelim(z1len, z1, ztztlen, detztzt, z2); + xylen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, detxy); + blen = fast_expansion_sum_zeroelim(z2len, z2, xylen, detxy, bdet); + + temp32alen = scale_expansion_zeroelim(ablen, ab, -dez, temp32a); + temp32blen = scale_expansion_zeroelim(ablen, ab, -deztail, temp32b); + temp64alen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64a); + temp32alen = scale_expansion_zeroelim(bdlen, bd, -aez, temp32a); + temp32blen = scale_expansion_zeroelim(bdlen, bd, -aeztail, temp32b); + temp64blen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64b); + temp32alen = scale_expansion_zeroelim(dalen, da, -bez, temp32a); + temp32blen = scale_expansion_zeroelim(dalen, da, -beztail, temp32b); + temp64clen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64c); + temp128len = fast_expansion_sum_zeroelim(temp64alen, temp64a, + temp64blen, temp64b, temp128); + temp192len = fast_expansion_sum_zeroelim(temp64clen, temp64c, + temp128len, temp128, temp192); + xlen = scale_expansion_zeroelim(temp192len, temp192, cex, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, cex, detxx); + xtlen = scale_expansion_zeroelim(temp192len, temp192, cextail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, cex, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, cextail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + ylen = scale_expansion_zeroelim(temp192len, temp192, cey, dety); + yylen = scale_expansion_zeroelim(ylen, dety, cey, detyy); + ytlen = scale_expansion_zeroelim(temp192len, temp192, ceytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, cey, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, ceytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + zlen = scale_expansion_zeroelim(temp192len, temp192, cez, detz); + zzlen = scale_expansion_zeroelim(zlen, detz, cez, detzz); + ztlen = scale_expansion_zeroelim(temp192len, temp192, ceztail, detzt); + zztlen = scale_expansion_zeroelim(ztlen, detzt, cez, detzzt); + for (i = 0; i < zztlen; i++) { + detzzt[i] *= 2.0; + } + ztztlen = scale_expansion_zeroelim(ztlen, detzt, ceztail, detztzt); + z1len = fast_expansion_sum_zeroelim(zzlen, detzz, zztlen, detzzt, z1); + z2len = fast_expansion_sum_zeroelim(z1len, z1, ztztlen, detztzt, z2); + xylen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, detxy); + clen = fast_expansion_sum_zeroelim(z2len, z2, xylen, detxy, cdet); + + temp32alen = scale_expansion_zeroelim(bclen, bc, aez, temp32a); + temp32blen = scale_expansion_zeroelim(bclen, bc, aeztail, temp32b); + temp64alen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64a); + temp32alen = scale_expansion_zeroelim(aclen, ac, -bez, temp32a); + temp32blen = scale_expansion_zeroelim(aclen, ac, -beztail, temp32b); + temp64blen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64b); + temp32alen = scale_expansion_zeroelim(ablen, ab, cez, temp32a); + temp32blen = scale_expansion_zeroelim(ablen, ab, ceztail, temp32b); + temp64clen = fast_expansion_sum_zeroelim(temp32alen, temp32a, + temp32blen, temp32b, temp64c); + temp128len = fast_expansion_sum_zeroelim(temp64alen, temp64a, + temp64blen, temp64b, temp128); + temp192len = fast_expansion_sum_zeroelim(temp64clen, temp64c, + temp128len, temp128, temp192); + xlen = scale_expansion_zeroelim(temp192len, temp192, dex, detx); + xxlen = scale_expansion_zeroelim(xlen, detx, dex, detxx); + xtlen = scale_expansion_zeroelim(temp192len, temp192, dextail, detxt); + xxtlen = scale_expansion_zeroelim(xtlen, detxt, dex, detxxt); + for (i = 0; i < xxtlen; i++) { + detxxt[i] *= 2.0; + } + xtxtlen = scale_expansion_zeroelim(xtlen, detxt, dextail, detxtxt); + x1len = fast_expansion_sum_zeroelim(xxlen, detxx, xxtlen, detxxt, x1); + x2len = fast_expansion_sum_zeroelim(x1len, x1, xtxtlen, detxtxt, x2); + ylen = scale_expansion_zeroelim(temp192len, temp192, dey, dety); + yylen = scale_expansion_zeroelim(ylen, dety, dey, detyy); + ytlen = scale_expansion_zeroelim(temp192len, temp192, deytail, detyt); + yytlen = scale_expansion_zeroelim(ytlen, detyt, dey, detyyt); + for (i = 0; i < yytlen; i++) { + detyyt[i] *= 2.0; + } + ytytlen = scale_expansion_zeroelim(ytlen, detyt, deytail, detytyt); + y1len = fast_expansion_sum_zeroelim(yylen, detyy, yytlen, detyyt, y1); + y2len = fast_expansion_sum_zeroelim(y1len, y1, ytytlen, detytyt, y2); + zlen = scale_expansion_zeroelim(temp192len, temp192, dez, detz); + zzlen = scale_expansion_zeroelim(zlen, detz, dez, detzz); + ztlen = scale_expansion_zeroelim(temp192len, temp192, deztail, detzt); + zztlen = scale_expansion_zeroelim(ztlen, detzt, dez, detzzt); + for (i = 0; i < zztlen; i++) { + detzzt[i] *= 2.0; + } + ztztlen = scale_expansion_zeroelim(ztlen, detzt, deztail, detztzt); + z1len = fast_expansion_sum_zeroelim(zzlen, detzz, zztlen, detzzt, z1); + z2len = fast_expansion_sum_zeroelim(z1len, z1, ztztlen, detztzt, z2); + xylen = fast_expansion_sum_zeroelim(x2len, x2, y2len, y2, detxy); + dlen = fast_expansion_sum_zeroelim(z2len, z2, xylen, detxy, ddet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + deterlen = fast_expansion_sum_zeroelim(ablen, abdet, cdlen, cddet, deter); + + return deter[deterlen - 1]; +} + +REAL insphereadapt(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe, + REAL permanent) +{ + INEXACT REAL aex, bex, cex, dex, aey, bey, cey, dey, aez, bez, cez, dez; + REAL det, errbound; + + INEXACT REAL aexbey1, bexaey1, bexcey1, cexbey1; + INEXACT REAL cexdey1, dexcey1, dexaey1, aexdey1; + INEXACT REAL aexcey1, cexaey1, bexdey1, dexbey1; + REAL aexbey0, bexaey0, bexcey0, cexbey0; + REAL cexdey0, dexcey0, dexaey0, aexdey0; + REAL aexcey0, cexaey0, bexdey0, dexbey0; + REAL ab[4], bc[4], cd[4], da[4], ac[4], bd[4]; + INEXACT REAL ab3, bc3, cd3, da3, ac3, bd3; + REAL abeps, bceps, cdeps, daeps, aceps, bdeps; + REAL temp8a[8], temp8b[8], temp8c[8], temp16[16], temp24[24], temp48[48]; + int temp8alen, temp8blen, temp8clen, temp16len, temp24len, temp48len; + REAL xdet[96], ydet[96], zdet[96], xydet[192]; + int xlen, ylen, zlen, xylen; + REAL adet[288], bdet[288], cdet[288], ddet[288]; + int alen, blen, clen, dlen; + REAL abdet[576], cddet[576]; + int ablen, cdlen; + REAL fin1[1152]; + int finlength; + + REAL aextail, bextail, cextail, dextail; + REAL aeytail, beytail, ceytail, deytail; + REAL aeztail, beztail, ceztail, deztail; + + INEXACT REAL bvirt; + REAL avirt, bround, around; + INEXACT REAL c; + INEXACT REAL abig; + REAL ahi, alo, bhi, blo; + REAL err1, err2, err3; + INEXACT REAL _i, _j; + REAL _0; + + aex = (REAL) (pa[0] - pe[0]); + bex = (REAL) (pb[0] - pe[0]); + cex = (REAL) (pc[0] - pe[0]); + dex = (REAL) (pd[0] - pe[0]); + aey = (REAL) (pa[1] - pe[1]); + bey = (REAL) (pb[1] - pe[1]); + cey = (REAL) (pc[1] - pe[1]); + dey = (REAL) (pd[1] - pe[1]); + aez = (REAL) (pa[2] - pe[2]); + bez = (REAL) (pb[2] - pe[2]); + cez = (REAL) (pc[2] - pe[2]); + dez = (REAL) (pd[2] - pe[2]); + + Two_Product(aex, bey, aexbey1, aexbey0); + Two_Product(bex, aey, bexaey1, bexaey0); + Two_Two_Diff(aexbey1, aexbey0, bexaey1, bexaey0, ab3, ab[2], ab[1], ab[0]); + ab[3] = ab3; + + Two_Product(bex, cey, bexcey1, bexcey0); + Two_Product(cex, bey, cexbey1, cexbey0); + Two_Two_Diff(bexcey1, bexcey0, cexbey1, cexbey0, bc3, bc[2], bc[1], bc[0]); + bc[3] = bc3; + + Two_Product(cex, dey, cexdey1, cexdey0); + Two_Product(dex, cey, dexcey1, dexcey0); + Two_Two_Diff(cexdey1, cexdey0, dexcey1, dexcey0, cd3, cd[2], cd[1], cd[0]); + cd[3] = cd3; + + Two_Product(dex, aey, dexaey1, dexaey0); + Two_Product(aex, dey, aexdey1, aexdey0); + Two_Two_Diff(dexaey1, dexaey0, aexdey1, aexdey0, da3, da[2], da[1], da[0]); + da[3] = da3; + + Two_Product(aex, cey, aexcey1, aexcey0); + Two_Product(cex, aey, cexaey1, cexaey0); + Two_Two_Diff(aexcey1, aexcey0, cexaey1, cexaey0, ac3, ac[2], ac[1], ac[0]); + ac[3] = ac3; + + Two_Product(bex, dey, bexdey1, bexdey0); + Two_Product(dex, bey, dexbey1, dexbey0); + Two_Two_Diff(bexdey1, bexdey0, dexbey1, dexbey0, bd3, bd[2], bd[1], bd[0]); + bd[3] = bd3; + + temp8alen = scale_expansion_zeroelim(4, cd, bez, temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, -cez, temp8b); + temp8clen = scale_expansion_zeroelim(4, bc, dez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, aex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, -aex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, aey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, -aey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, aez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, -aez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + alen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, adet); + + temp8alen = scale_expansion_zeroelim(4, da, cez, temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, dez, temp8b); + temp8clen = scale_expansion_zeroelim(4, cd, aez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, bex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, bex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, bey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, bey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, bez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, bez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + blen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, bdet); + + temp8alen = scale_expansion_zeroelim(4, ab, dez, temp8a); + temp8blen = scale_expansion_zeroelim(4, bd, aez, temp8b); + temp8clen = scale_expansion_zeroelim(4, da, bez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, cex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, -cex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, cey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, -cey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, cez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, -cez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + clen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, cdet); + + temp8alen = scale_expansion_zeroelim(4, bc, aez, temp8a); + temp8blen = scale_expansion_zeroelim(4, ac, -bez, temp8b); + temp8clen = scale_expansion_zeroelim(4, ab, cez, temp8c); + temp16len = fast_expansion_sum_zeroelim(temp8alen, temp8a, + temp8blen, temp8b, temp16); + temp24len = fast_expansion_sum_zeroelim(temp8clen, temp8c, + temp16len, temp16, temp24); + temp48len = scale_expansion_zeroelim(temp24len, temp24, dex, temp48); + xlen = scale_expansion_zeroelim(temp48len, temp48, dex, xdet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, dey, temp48); + ylen = scale_expansion_zeroelim(temp48len, temp48, dey, ydet); + temp48len = scale_expansion_zeroelim(temp24len, temp24, dez, temp48); + zlen = scale_expansion_zeroelim(temp48len, temp48, dez, zdet); + xylen = fast_expansion_sum_zeroelim(xlen, xdet, ylen, ydet, xydet); + dlen = fast_expansion_sum_zeroelim(xylen, xydet, zlen, zdet, ddet); + + ablen = fast_expansion_sum_zeroelim(alen, adet, blen, bdet, abdet); + cdlen = fast_expansion_sum_zeroelim(clen, cdet, dlen, ddet, cddet); + finlength = fast_expansion_sum_zeroelim(ablen, abdet, cdlen, cddet, fin1); + + det = estimate(finlength, fin1); + errbound = isperrboundB * permanent; + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + Two_Diff_Tail(pa[0], pe[0], aex, aextail); + Two_Diff_Tail(pa[1], pe[1], aey, aeytail); + Two_Diff_Tail(pa[2], pe[2], aez, aeztail); + Two_Diff_Tail(pb[0], pe[0], bex, bextail); + Two_Diff_Tail(pb[1], pe[1], bey, beytail); + Two_Diff_Tail(pb[2], pe[2], bez, beztail); + Two_Diff_Tail(pc[0], pe[0], cex, cextail); + Two_Diff_Tail(pc[1], pe[1], cey, ceytail); + Two_Diff_Tail(pc[2], pe[2], cez, ceztail); + Two_Diff_Tail(pd[0], pe[0], dex, dextail); + Two_Diff_Tail(pd[1], pe[1], dey, deytail); + Two_Diff_Tail(pd[2], pe[2], dez, deztail); + if ((aextail == 0.0) && (aeytail == 0.0) && (aeztail == 0.0) + && (bextail == 0.0) && (beytail == 0.0) && (beztail == 0.0) + && (cextail == 0.0) && (ceytail == 0.0) && (ceztail == 0.0) + && (dextail == 0.0) && (deytail == 0.0) && (deztail == 0.0)) { + return det; + } + + errbound = isperrboundC * permanent + resulterrbound * Absolute(det); + abeps = (aex * beytail + bey * aextail) + - (aey * bextail + bex * aeytail); + bceps = (bex * ceytail + cey * bextail) + - (bey * cextail + cex * beytail); + cdeps = (cex * deytail + dey * cextail) + - (cey * dextail + dex * ceytail); + daeps = (dex * aeytail + aey * dextail) + - (dey * aextail + aex * deytail); + aceps = (aex * ceytail + cey * aextail) + - (aey * cextail + cex * aeytail); + bdeps = (bex * deytail + dey * bextail) + - (bey * dextail + dex * beytail); + det += (((bex * bex + bey * bey + bez * bez) + * ((cez * daeps + dez * aceps + aez * cdeps) + + (ceztail * da3 + deztail * ac3 + aeztail * cd3)) + + (dex * dex + dey * dey + dez * dez) + * ((aez * bceps - bez * aceps + cez * abeps) + + (aeztail * bc3 - beztail * ac3 + ceztail * ab3))) + - ((aex * aex + aey * aey + aez * aez) + * ((bez * cdeps - cez * bdeps + dez * bceps) + + (beztail * cd3 - ceztail * bd3 + deztail * bc3)) + + (cex * cex + cey * cey + cez * cez) + * ((dez * abeps + aez * bdeps + bez * daeps) + + (deztail * ab3 + aeztail * bd3 + beztail * da3)))) + + 2.0 * (((bex * bextail + bey * beytail + bez * beztail) + * (cez * da3 + dez * ac3 + aez * cd3) + + (dex * dextail + dey * deytail + dez * deztail) + * (aez * bc3 - bez * ac3 + cez * ab3)) + - ((aex * aextail + aey * aeytail + aez * aeztail) + * (bez * cd3 - cez * bd3 + dez * bc3) + + (cex * cextail + cey * ceytail + cez * ceztail) + * (dez * ab3 + aez * bd3 + bez * da3))); + if ((det >= errbound) || (-det >= errbound)) { + return det; + } + + return insphereexact(pa, pb, pc, pd, pe); +} + +REAL insphere(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe) +{ + REAL aex, bex, cex, dex; + REAL aey, bey, cey, dey; + REAL aez, bez, cez, dez; + REAL aexbey, bexaey, bexcey, cexbey, cexdey, dexcey, dexaey, aexdey; + REAL aexcey, cexaey, bexdey, dexbey; + REAL alift, blift, clift, dlift; + REAL ab, bc, cd, da, ac, bd; + REAL abc, bcd, cda, dab; + REAL aezplus, bezplus, cezplus, dezplus; + REAL aexbeyplus, bexaeyplus, bexceyplus, cexbeyplus; + REAL cexdeyplus, dexceyplus, dexaeyplus, aexdeyplus; + REAL aexceyplus, cexaeyplus, bexdeyplus, dexbeyplus; + REAL det; + REAL permanent, errbound; + + aex = pa[0] - pe[0]; + bex = pb[0] - pe[0]; + cex = pc[0] - pe[0]; + dex = pd[0] - pe[0]; + aey = pa[1] - pe[1]; + bey = pb[1] - pe[1]; + cey = pc[1] - pe[1]; + dey = pd[1] - pe[1]; + aez = pa[2] - pe[2]; + bez = pb[2] - pe[2]; + cez = pc[2] - pe[2]; + dez = pd[2] - pe[2]; + + aexbey = aex * bey; + bexaey = bex * aey; + ab = aexbey - bexaey; + bexcey = bex * cey; + cexbey = cex * bey; + bc = bexcey - cexbey; + cexdey = cex * dey; + dexcey = dex * cey; + cd = cexdey - dexcey; + dexaey = dex * aey; + aexdey = aex * dey; + da = dexaey - aexdey; + + aexcey = aex * cey; + cexaey = cex * aey; + ac = aexcey - cexaey; + bexdey = bex * dey; + dexbey = dex * bey; + bd = bexdey - dexbey; + + abc = aez * bc - bez * ac + cez * ab; + bcd = bez * cd - cez * bd + dez * bc; + cda = cez * da + dez * ac + aez * cd; + dab = dez * ab + aez * bd + bez * da; + + alift = aex * aex + aey * aey + aez * aez; + blift = bex * bex + bey * bey + bez * bez; + clift = cex * cex + cey * cey + cez * cez; + dlift = dex * dex + dey * dey + dez * dez; + + det = (dlift * abc - clift * dab) + (blift * cda - alift * bcd); + + aezplus = Absolute(aez); + bezplus = Absolute(bez); + cezplus = Absolute(cez); + dezplus = Absolute(dez); + aexbeyplus = Absolute(aexbey); + bexaeyplus = Absolute(bexaey); + bexceyplus = Absolute(bexcey); + cexbeyplus = Absolute(cexbey); + cexdeyplus = Absolute(cexdey); + dexceyplus = Absolute(dexcey); + dexaeyplus = Absolute(dexaey); + aexdeyplus = Absolute(aexdey); + aexceyplus = Absolute(aexcey); + cexaeyplus = Absolute(cexaey); + bexdeyplus = Absolute(bexdey); + dexbeyplus = Absolute(dexbey); + permanent = ((cexdeyplus + dexceyplus) * bezplus + + (dexbeyplus + bexdeyplus) * cezplus + + (bexceyplus + cexbeyplus) * dezplus) + * alift + + ((dexaeyplus + aexdeyplus) * cezplus + + (aexceyplus + cexaeyplus) * dezplus + + (cexdeyplus + dexceyplus) * aezplus) + * blift + + ((aexbeyplus + bexaeyplus) * dezplus + + (bexdeyplus + dexbeyplus) * aezplus + + (dexaeyplus + aexdeyplus) * bezplus) + * clift + + ((bexceyplus + cexbeyplus) * aezplus + + (cexaeyplus + aexceyplus) * bezplus + + (aexbeyplus + bexaeyplus) * cezplus) + * dlift; + errbound = isperrboundA * permanent; + if ((det > errbound) || (-det > errbound)) { + return det; + } + + return insphereadapt(pa, pb, pc, pd, pe, permanent); +} diff --git a/src/TETGEN/tetgen.cxx b/src/TETGEN/tetgen.cxx new file mode 100644 index 0000000..255a13f --- /dev/null +++ b/src/TETGEN/tetgen.cxx @@ -0,0 +1,34926 @@ +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen // +// // +// A Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator // +// // +// Version 1.4 // +// September 6, December 13, 2010 // +// January 19, April 15, 2011 +// // +// Copyright (C) 2002--2011 // +// Hang Si // +// Research Group: Numerical Mathematics and Scientific Computing // +// Weierstrass Institute for Applied Analysis and Stochastics (WIAS) // +// Mohrenstr. 39, 10117 Berlin, Germany // +// si@wias-berlin.de // +// // +// TetGen is freely available through the website: http://tetgen.berlios.de. // +// It may be copied, modified, and redistributed for non-commercial use. // +// Please consult the file LICENSE for the detailed copyright notices. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetgen.cxx // +// // +// The TetGen library and program. // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include "tetgen.h" + +//// io_cxx /////////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_node_call() Read a list of points from a file. // +// // +// It is a support routine for routines: 'load_nodes()', 'load_poly()', and // +// 'load_tetmesh()'. 'infile' is the file handle contains the node list. It // +// may point to a .node, or .poly or .smesh file. 'markers' indicates each // +// node contains an additional marker (integer) or not. 'infilename' is the // +// name of the file being read, it is only used in error messages. // +// // +// The 'firstnumber' (0 or 1) is automatically determined by the number of // +// the first index of the first point. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_node_call(FILE* infile, int markers, char* infilename) +{ + char inputline[INPUTLINESIZE]; + char *stringptr; + REAL x, y, z, attrib; + int firstnode, currentmarker; + int index, attribindex; + int i, j; + + // Initialize 'pointlist', 'pointattributelist', and 'pointmarkerlist'. + pointlist = new REAL[numberofpoints * 3]; + if (pointlist == (REAL *) NULL) { + terminatetetgen(1); + } + if (numberofpointattributes > 0) { + pointattributelist = new REAL[numberofpoints * numberofpointattributes]; + if (pointattributelist == (REAL *) NULL) { + terminatetetgen(1); + } + } + if (markers) { + pointmarkerlist = new int[numberofpoints]; + if (pointmarkerlist == (int *) NULL) { + terminatetetgen(1); + } + } + + // Read the point section. + index = 0; + attribindex = 0; + for (i = 0; i < numberofpoints; i++) { + stringptr = readnumberline(inputline, infile, infilename); + if (useindex) { + if (i == 0) { + firstnode = (int) strtol (stringptr, &stringptr, 0); + if ((firstnode == 0) || (firstnode == 1)) { + firstnumber = firstnode; + } + } + stringptr = findnextnumber(stringptr); + } // if (useindex) + if (*stringptr == '\0') { + printf("Error: Point %d has no x coordinate.\n", firstnumber + i); + break; + } + x = (REAL) strtod(stringptr, &stringptr); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Point %d has no y coordinate.\n", firstnumber + i); + break; + } + y = (REAL) strtod(stringptr, &stringptr); + if (mesh_dim == 3) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Point %d has no z coordinate.\n", firstnumber + i); + break; + } + z = (REAL) strtod(stringptr, &stringptr); + } else { + z = 0.0; // mesh_dim == 2; + } + pointlist[index++] = x; + pointlist[index++] = y; + pointlist[index++] = z; + // Read the point attributes. + for (j = 0; j < numberofpointattributes; j++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + attrib = 0.0; + } else { + attrib = (REAL) strtod(stringptr, &stringptr); + } + pointattributelist[attribindex++] = attrib; + } + if (markers) { + // Read a point marker. + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + currentmarker = 0; + } else { + currentmarker = (int) strtol (stringptr, &stringptr, 0); + } + pointmarkerlist[i] = currentmarker; + } + } + if (i < numberofpoints) { + // Failed to read points due to some error. + delete [] pointlist; + pointlist = (REAL *) NULL; + if (markers) { + delete [] pointmarkerlist; + pointmarkerlist = (int *) NULL; + } + if (numberofpointattributes > 0) { + delete [] pointattributelist; + pointattributelist = (REAL *) NULL; + } + numberofpoints = 0; + return false; + } + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_node() Load a list of points from a .node file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_node(char* filebasename) +{ + FILE *infile; + char innodefilename[FILENAMESIZE]; + char inputline[INPUTLINESIZE]; + char *stringptr; + bool okflag; + int markers; + + // Assembling the actual file names we want to open. + strcpy(innodefilename, filebasename); + strcat(innodefilename, ".node"); + + // Try to open a .node file. + infile = fopen(innodefilename, "r"); + if (infile == (FILE *) NULL) { + printf("File I/O Error: Cannot access file %s.\n", innodefilename); + return false; + } + printf("Opening %s.\n", innodefilename); + // Read the first line of the file. + stringptr = readnumberline(inputline, infile, innodefilename); + // Does this file contain an index colume? + stringptr = strstr(inputline, "rbox"); + if (stringptr == NULL) { + // Read number of points, number of dimensions, number of point + // attributes, and number of boundary markers. + stringptr = inputline; + numberofpoints = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + mesh_dim = 3; + } else { + mesh_dim = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + numberofpointattributes = 0; + } else { + numberofpointattributes = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + markers = 0; + } else { + markers = (int) strtol (stringptr, &stringptr, 0); + } + } else { + // It is a rbox (qhull) input file. + stringptr = inputline; + // Get the dimension. + mesh_dim = (int) strtol (stringptr, &stringptr, 0); + // Get the number of points. + stringptr = readnumberline(inputline, infile, innodefilename); + numberofpoints = (int) strtol (stringptr, &stringptr, 0); + // There is no index column. + useindex = 0; + } + + // Load the list of nodes. + okflag = load_node_call(infile, markers, innodefilename); + + fclose(infile); + return okflag; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_var() Load constraints applied on facets, segments, and nodes // +// from a .var file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_var(char* filebasename) +{ + FILE *infile; + char varfilename[FILENAMESIZE]; + char inputline[INPUTLINESIZE]; + char *stringptr; + int index; + int i; + + // Variant constraints are saved in file "filename.var". + strcpy(varfilename, filebasename); + strcat(varfilename, ".var"); + infile = fopen(varfilename, "r"); + if (infile != (FILE *) NULL) { + printf("Opening %s.\n", varfilename); + } else { + // No such file. Ignore it without a message. + return false; + } + + // Read the facet constraint section. + stringptr = readnumberline(inputline, infile, varfilename); + if (*stringptr != '\0') { + numberoffacetconstraints = (int) strtol (stringptr, &stringptr, 0); + } else { + numberoffacetconstraints = 0; + } + if (numberoffacetconstraints > 0) { + // Initialize 'facetconstraintlist'. + facetconstraintlist = new REAL[numberoffacetconstraints * 2]; + index = 0; + for (i = 0; i < numberoffacetconstraints; i++) { + stringptr = readnumberline(inputline, infile, varfilename); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: facet constraint %d has no facet marker.\n", + firstnumber + i); + break; + } else { + facetconstraintlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: facet constraint %d has no maximum area bound.\n", + firstnumber + i); + break; + } else { + facetconstraintlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + } + if (i < numberoffacetconstraints) { + // This must be caused by an error. + fclose(infile); + return false; + } + } + + // Read the segment constraint section. + stringptr = readnumberline(inputline, infile, varfilename); + if (*stringptr != '\0') { + numberofsegmentconstraints = (int) strtol (stringptr, &stringptr, 0); + } else { + numberofsegmentconstraints = 0; + } + if (numberofsegmentconstraints > 0) { + // Initialize 'segmentconstraintlist'. + segmentconstraintlist = new REAL[numberofsegmentconstraints * 3]; + index = 0; + for (i = 0; i < numberofsegmentconstraints; i++) { + stringptr = readnumberline(inputline, infile, varfilename); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: segment constraint %d has no frist endpoint.\n", + firstnumber + i); + break; + } else { + segmentconstraintlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: segment constraint %d has no second endpoint.\n", + firstnumber + i); + break; + } else { + segmentconstraintlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: segment constraint %d has no maximum length bound.\n", + firstnumber + i); + break; + } else { + segmentconstraintlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + } + if (i < numberofsegmentconstraints) { + // This must be caused by an error. + fclose(infile); + return false; + } + } + + fclose(infile); + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_mtr() Load a size specification map from a .mtr file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_mtr(char* filebasename) +{ + FILE *infile; + char mtrfilename[FILENAMESIZE]; + char inputline[INPUTLINESIZE]; + char *stringptr; + REAL mtr; + int mtrindex; + int i, j; + + strcpy(mtrfilename, filebasename); + strcat(mtrfilename, ".mtr"); + infile = fopen(mtrfilename, "r"); + if (infile != (FILE *) NULL) { + printf("Opening %s.\n", mtrfilename); + } else { + // No such file. Return. + return false; + } + + // Read number of points, number of columns (1, 3, or 6). + stringptr = readnumberline(inputline, infile, mtrfilename); + stringptr = findnextnumber(stringptr); // Skip number of points. + if (*stringptr != '\0') { + numberofpointmtrs = (int) strtol (stringptr, &stringptr, 0); + } + if (numberofpointmtrs == 0) { + // Column number doesn't match. Set a default number (1). + numberofpointmtrs = 1; + } + + // Allocate space for pointmtrlist. + pointmtrlist = new REAL[numberofpoints * numberofpointmtrs]; + if (pointmtrlist == (REAL *) NULL) { + terminatetetgen(1); + } + mtrindex = 0; + for (i = 0; i < numberofpoints; i++) { + // Read metrics. + stringptr = readnumberline(inputline, infile, mtrfilename); + for (j = 0; j < numberofpointmtrs; j++) { + if (*stringptr == '\0') { + printf("Error: Metric %d is missing value #%d in %s.\n", + i + firstnumber, j + 1, mtrfilename); + terminatetetgen(1); + } + mtr = (REAL) strtod(stringptr, &stringptr); + pointmtrlist[mtrindex++] = mtr; + stringptr = findnextnumber(stringptr); + } + } + + fclose(infile); + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_poly() Load a PL complex from a .poly or a .smesh file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_poly(char* filebasename) +{ + FILE *infile, *polyfile; + char innodefilename[FILENAMESIZE]; + char inpolyfilename[FILENAMESIZE]; + char insmeshfilename[FILENAMESIZE]; + char inputline[INPUTLINESIZE]; + char *stringptr, *infilename; + int smesh, markers, currentmarker; + int readnodefile, index; + int i, j, k; + + // Assembling the actual file names we want to open. + strcpy(innodefilename, filebasename); + strcpy(inpolyfilename, filebasename); + strcpy(insmeshfilename, filebasename); + strcat(innodefilename, ".node"); + strcat(inpolyfilename, ".poly"); + strcat(insmeshfilename, ".smesh"); + + // First assume it is a .poly file. + smesh = 0; + // Try to open a .poly file. + polyfile = fopen(inpolyfilename, "r"); + if (polyfile == (FILE *) NULL) { + // .poly doesn't exist! Try to open a .smesh file. + polyfile = fopen(insmeshfilename, "r"); + if (polyfile == (FILE *) NULL) { + printf("File I/O Error: Cannot access file %s and %s.\n", + inpolyfilename, insmeshfilename); + return false; + } else { + printf("Opening %s.\n", insmeshfilename); + } + smesh = 1; + } else { + printf("Opening %s.\n", inpolyfilename); + } + // Initialize the default values. + mesh_dim = 3; // Three-dimemsional accoordinates. + numberofpointattributes = 0; // no point attribute. + markers = 0; // no boundary marker. + // Read number of points, number of dimensions, number of point + // attributes, and number of boundary markers. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + numberofpoints = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + mesh_dim = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + numberofpointattributes = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + markers = (int) strtol (stringptr, &stringptr, 0); + } + if (numberofpoints > 0) { + readnodefile = 0; + if (smesh) { + infilename = insmeshfilename; + } else { + infilename = inpolyfilename; + } + infile = polyfile; + } else { + // If the .poly or .smesh file claims there are zero points, that + // means the points should be read from a separate .node file. + readnodefile = 1; + infilename = innodefilename; + } + + if (readnodefile) { + // Read the points from the .node file. + printf("Opening %s.\n", innodefilename); + infile = fopen(innodefilename, "r"); + if (infile == (FILE *) NULL) { + printf("File I/O Error: Cannot access file %s.\n", innodefilename); + return false; + } + // Initialize the default values. + mesh_dim = 3; // Three-dimemsional accoordinates. + numberofpointattributes = 0; // no point attribute. + markers = 0; // no boundary marker. + // Read number of points, number of dimensions, number of point + // attributes, and number of boundary markers. + stringptr = readnumberline(inputline, infile, innodefilename); + numberofpoints = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + mesh_dim = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + numberofpointattributes = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + markers = (int) strtol (stringptr, &stringptr, 0); + } + } + + if ((mesh_dim != 3) && (mesh_dim != 2)) { + printf("Input error: TetGen only works for 2D & 3D point sets.\n"); + fclose(infile); + return false; + } + if (numberofpoints < (mesh_dim + 1)) { + printf("Input error: TetGen needs at least %d points.\n", mesh_dim + 1); + fclose(infile); + return false; + } + + // Load the list of nodes. + if (!load_node_call(infile, markers, infilename)) { + fclose(infile); + return false; + } + + if (readnodefile) { + fclose(infile); + } + + facet *f; + polygon *p; + + if (mesh_dim == 3) { + + // Read number of facets and number of boundary markers. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + numberoffacets = (int) strtol (stringptr, &stringptr, 0); + if (numberoffacets <= 0) { + // No facet list, return. + fclose(polyfile); + return true; + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + markers = 0; // no boundary marker. + } else { + markers = (int) strtol (stringptr, &stringptr, 0); + } + + // Initialize the 'facetlist', 'facetmarkerlist'. + facetlist = new facet[numberoffacets]; + if (markers == 1) { + facetmarkerlist = new int[numberoffacets]; + } + + // Read data into 'facetlist', 'facetmarkerlist'. + if (smesh == 0) { + // Facets are in .poly file format. + for (i = 1; i <= numberoffacets; i++) { + f = &(facetlist[i - 1]); + init(f); + f->numberofholes = 0; + currentmarker = 0; + // Read number of polygons, number of holes, and a boundary marker. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + f->numberofpolygons = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + f->numberofholes = (int) strtol (stringptr, &stringptr, 0); + if (markers == 1) { + stringptr = findnextnumber(stringptr); + if (*stringptr != '\0') { + currentmarker = (int) strtol(stringptr, &stringptr, 0); + } + } + } + // Initialize facetmarker if it needs. + if (markers == 1) { + facetmarkerlist[i - 1] = currentmarker; + } + // Each facet should has at least one polygon. + if (f->numberofpolygons <= 0) { + printf("Error: Wrong number of polygon in %d facet.\n", i); + break; + } + // Initialize the 'f->polygonlist'. + f->polygonlist = new polygon[f->numberofpolygons]; + // Go through all polygons, read in their vertices. + for (j = 1; j <= f->numberofpolygons; j++) { + p = &(f->polygonlist[j - 1]); + init(p); + // Read number of vertices of this polygon. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + p->numberofvertices = (int) strtol(stringptr, &stringptr, 0); + if (p->numberofvertices < 1) { + printf("Error: Wrong polygon %d in facet %d\n", j, i); + break; + } + // Initialize 'p->vertexlist'. + p->vertexlist = new int[p->numberofvertices]; + // Read all vertices of this polygon. + for (k = 1; k <= p->numberofvertices; k++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + // Try to load another non-empty line and continue to read the + // rest of vertices. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + if (*stringptr == '\0') { + printf("Error: Missing %d endpoints of polygon %d in facet %d", + p->numberofvertices - k, j, i); + break; + } + } + p->vertexlist[k - 1] = (int) strtol (stringptr, &stringptr, 0); + } + } + if (j <= f->numberofpolygons) { + // This must be caused by an error. However, there're j - 1 + // polygons have been read. Reset the 'f->numberofpolygon'. + if (j == 1) { + // This is the first polygon. + delete [] f->polygonlist; + } + f->numberofpolygons = j - 1; + // No hole will be read even it exists. + f->numberofholes = 0; + break; + } + // If this facet has hole pints defined, read them. + if (f->numberofholes > 0) { + // Initialize 'f->holelist'. + f->holelist = new REAL[f->numberofholes * 3]; + // Read the holes' coordinates. + index = 0; + for (j = 1; j <= f->numberofholes; j++) { + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + for (k = 1; k <= 3; k++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Hole %d in facet %d has no coordinates", j, i); + break; + } + f->holelist[index++] = (REAL) strtod (stringptr, &stringptr); + } + if (k <= 3) { + // This must be caused by an error. + break; + } + } + if (j <= f->numberofholes) { + // This must be caused by an error. + break; + } + } + } + if (i <= numberoffacets) { + // This must be caused by an error. + numberoffacets = i - 1; + fclose(polyfile); + return false; + } + } else { // poly == 0 + // Read the facets from a .smesh file. + for (i = 1; i <= numberoffacets; i++) { + f = &(facetlist[i - 1]); + init(f); + // Initialize 'f->facetlist'. In a .smesh file, each facetlist only + // contains exactly one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new polygon[f->numberofpolygons]; + p = &(f->polygonlist[0]); + init(p); + // Read number of vertices of this polygon. + stringptr = readnumberline(inputline, polyfile, insmeshfilename); + p->numberofvertices = (int) strtol (stringptr, &stringptr, 0); + if (p->numberofvertices < 1) { + printf("Error: Wrong number of vertex in facet %d\n", i); + break; + } + // Initialize 'p->vertexlist'. + p->vertexlist = new int[p->numberofvertices]; + for (k = 1; k <= p->numberofvertices; k++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + // Try to load another non-empty line and continue to read the + // rest of vertices. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + if (*stringptr == '\0') { + printf("Error: Missing %d endpoints in facet %d", + p->numberofvertices - k, i); + break; + } + } + p->vertexlist[k - 1] = (int) strtol (stringptr, &stringptr, 0); + } + if (k <= p->numberofvertices) { + // This must be caused by an error. + break; + } + // Read facet's boundary marker at last. + if (markers == 1) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + currentmarker = 0; + } else { + currentmarker = (int) strtol(stringptr, &stringptr, 0); + } + facetmarkerlist[i - 1] = currentmarker; + } + } + if (i <= numberoffacets) { + // This must be caused by an error. + numberoffacets = i - 1; + fclose(polyfile); + return false; + } + } + + // Read the hole section. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + if (*stringptr != '\0') { + numberofholes = (int) strtol (stringptr, &stringptr, 0); + } else { + numberofholes = 0; + } + if (numberofholes > 0) { + // Initialize 'holelist'. + holelist = new REAL[numberofholes * 3]; + for (i = 0; i < 3 * numberofholes; i += 3) { + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Hole %d has no x coord.\n", firstnumber + (i / 3)); + break; + } else { + holelist[i] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Hole %d has no y coord.\n", firstnumber + (i / 3)); + break; + } else { + holelist[i + 1] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Hole %d has no z coord.\n", firstnumber + (i / 3)); + break; + } else { + holelist[i + 2] = (REAL) strtod(stringptr, &stringptr); + } + } + if (i < 3 * numberofholes) { + // This must be caused by an error. + fclose(polyfile); + return false; + } + } + + // Read the region section. The 'region' section is optional, if we + // don't reach the end-of-file, try read it in. + stringptr = readnumberline(inputline, polyfile, NULL); + if (stringptr != (char *) NULL && *stringptr != '\0') { + numberofregions = (int) strtol (stringptr, &stringptr, 0); + } else { + numberofregions = 0; + } + if (numberofregions > 0) { + // Initialize 'regionlist'. + regionlist = new REAL[numberofregions * 5]; + index = 0; + for (i = 0; i < numberofregions; i++) { + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Region %d has no x coordinate.\n", firstnumber + i); + break; + } else { + regionlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Region %d has no y coordinate.\n", firstnumber + i); + break; + } else { + regionlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Region %d has no z coordinate.\n", firstnumber + i); + break; + } else { + regionlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Region %d has no region attrib.\n", firstnumber + i); + break; + } else { + regionlist[index++] = (REAL) strtod(stringptr, &stringptr); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + regionlist[index] = regionlist[index - 1]; + } else { + regionlist[index] = (REAL) strtod(stringptr, &stringptr); + } + index++; + } + if (i < numberofregions) { + // This must be caused by an error. + fclose(polyfile); + return false; + } + } + + } else { + + // Read a PSLG from Triangle's poly file. + assert(mesh_dim == 2); + // A PSLG is a facet of a PLC. + numberoffacets = 1; + // Initialize the 'facetlist'. + facetlist = new facet[numberoffacets]; + facetmarkerlist = (int *) NULL; // No facet markers. + f = &(facetlist[0]); + init(f); + // Read number of segments. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + // Segments are degenerate polygons. + f->numberofpolygons = (int) strtol (stringptr, &stringptr, 0); + if (f->numberofpolygons > 0) { + f->polygonlist = new polygon[f->numberofpolygons]; + } + // Go through all segments, read in their vertices. + for (j = 0; j < f->numberofpolygons; j++) { + p = &(f->polygonlist[j]); + init(p); + // Read in a segment. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + stringptr = findnextnumber(stringptr); // Skip its index. + p->numberofvertices = 2; // A segment always has two vertices. + p->vertexlist = new int[p->numberofvertices]; + p->vertexlist[0] = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + p->vertexlist[1] = (int) strtol (stringptr, &stringptr, 0); + } + // Read number of holes. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + f->numberofholes = (int) strtol (stringptr, &stringptr, 0); + if (f->numberofholes > 0) { + // Initialize 'f->holelist'. + f->holelist = new REAL[f->numberofholes * 3]; + // Read the holes' coordinates. + for (j = 0; j < f->numberofholes; j++) { + // Read a 2D hole point. + stringptr = readnumberline(inputline, polyfile, inpolyfilename); + stringptr = findnextnumber(stringptr); // Skip its index. + f->holelist[j * 3] = (REAL) strtod (stringptr, &stringptr); + stringptr = findnextnumber(stringptr); + f->holelist[j * 3 + 1] = (REAL) strtod (stringptr, &stringptr); + f->holelist[j * 3 + 2] = 0.0; // The z-coord. + } + } + // The regions are skipped. + + } + + // End of reading poly/smesh file. + fclose(polyfile); + + // Try to load a .var file if it exists. + load_var(filebasename); + + // Try to load a .mtr file if it exists. + load_mtr(filebasename); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_off() Load a polyhedron from a .off file. // +// // +// The .off format is one of file formats of the Geomview, an interactive // +// program for viewing and manipulating geometric objects. More information // +// is available form: http://www.geomview.org. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_off(char* filebasename) +{ + FILE *fp; + tetgenio::facet *f; + tetgenio::polygon *p; + char infilename[FILENAMESIZE]; + char buffer[INPUTLINESIZE]; + char *bufferp; + double *coord; + int nverts = 0, iverts = 0; + int nfaces = 0, ifaces = 0; + int nedges = 0; + int line_count = 0, i; + + strncpy(infilename, filebasename, 1024 - 1); + infilename[FILENAMESIZE - 1] = '\0'; + if (infilename[0] == '\0') { + printf("Error: No filename.\n"); + return false; + } + if (strcmp(&infilename[strlen(infilename) - 4], ".off") != 0) { + strcat(infilename, ".off"); + } + + if (!(fp = fopen(infilename, "r"))) { + printf("File I/O Error: Unable to open file %s\n", infilename); + return false; + } + printf("Opening %s.\n", infilename); + + // OFF requires the index starts from '0'. + firstnumber = 0; + + while ((bufferp = readline(buffer, fp, &line_count)) != NULL) { + // Check section + if (nverts == 0) { + // Read header + bufferp = strstr(bufferp, "OFF"); + if (bufferp != NULL) { + // Read mesh counts + bufferp = findnextnumber(bufferp); // Skip field "OFF". + if (*bufferp == '\0') { + // Read a non-empty line. + bufferp = readline(buffer, fp, &line_count); + } + if ((sscanf(bufferp, "%d%d%d", &nverts, &nfaces, &nedges) != 3) + || (nverts == 0)) { + printf("Syntax error reading header on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + // Allocate memory for 'tetgenio' + if (nverts > 0) { + numberofpoints = nverts; + pointlist = new REAL[nverts * 3]; + } + if (nfaces > 0) { + numberoffacets = nfaces; + facetlist = new tetgenio::facet[nfaces]; + } + } + } else if (iverts < nverts) { + // Read vertex coordinates + coord = &pointlist[iverts * 3]; + for (i = 0; i < 3; i++) { + if (*bufferp == '\0') { + printf("Syntax error reading vertex coords on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + coord[i] = (REAL) strtod(bufferp, &bufferp); + bufferp = findnextnumber(bufferp); + } + iverts++; + } else if (ifaces < nfaces) { + // Get next face + f = &facetlist[ifaces]; + init(f); + // In .off format, each facet has one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + init(p); + // Read the number of vertices, it should be greater than 0. + p->numberofvertices = (int) strtol(bufferp, &bufferp, 0); + if (p->numberofvertices == 0) { + printf("Syntax error reading polygon on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + // Allocate memory for face vertices + p->vertexlist = new int[p->numberofvertices]; + for (i = 0; i < p->numberofvertices; i++) { + bufferp = findnextnumber(bufferp); + if (*bufferp == '\0') { + printf("Syntax error reading polygon on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + p->vertexlist[i] = (int) strtol(bufferp, &bufferp, 0); + } + ifaces++; + } else { + // Should never get here + printf("Found extra text starting at line %d in file %s\n", line_count, + infilename); + break; + } + } + + // Close file + fclose(fp); + + // Check whether read all points + if (iverts != nverts) { + printf("Expected %d vertices, but read only %d vertices in file %s\n", + nverts, iverts, infilename); + return false; + } + + // Check whether read all faces + if (ifaces != nfaces) { + printf("Expected %d faces, but read only %d faces in file %s\n", + nfaces, ifaces, infilename); + return false; + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_ply() Load a polyhedron from a .ply file. // +// // +// This is a simplified version of reading .ply files, which only reads the // +// set of vertices and the set of faces. Other informations (such as color, // +// material, texture, etc) in .ply file are ignored. Complete routines for // +// reading and writing ,ply files are available from: http://www.cc.gatech. // +// edu/projects/large_models/ply.html. Except the header section, ply file // +// format has exactly the same format for listing vertices and polygons as // +// off file format. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_ply(char* filebasename) +{ + FILE *fp; + tetgenio::facet *f; + tetgenio::polygon *p; + char infilename[FILENAMESIZE]; + char buffer[INPUTLINESIZE]; + char *bufferp, *str; + double *coord; + int endheader = 0, format = 0; + int nverts = 0, iverts = 0; + int nfaces = 0, ifaces = 0; + int line_count = 0, i; + + strncpy(infilename, filebasename, FILENAMESIZE - 1); + infilename[FILENAMESIZE - 1] = '\0'; + if (infilename[0] == '\0') { + printf("Error: No filename.\n"); + return false; + } + if (strcmp(&infilename[strlen(infilename) - 4], ".ply") != 0) { + strcat(infilename, ".ply"); + } + + if (!(fp = fopen(infilename, "r"))) { + printf("Error: Unable to open file %s\n", infilename); + return false; + } + printf("Opening %s.\n", infilename); + + // PLY requires the index starts from '0'. + firstnumber = 0; + + while ((bufferp = readline(buffer, fp, &line_count)) != NULL) { + if (!endheader) { + // Find if it is the keyword "end_header". + str = strstr(bufferp, "end_header"); + // strstr() is case sensitive. + if (!str) str = strstr(bufferp, "End_header"); + if (!str) str = strstr(bufferp, "End_Header"); + if (str) { + // This is the end of the header section. + endheader = 1; + continue; + } + // Parse the number of vertices and the number of faces. + if (nverts == 0 || nfaces == 0) { + // Find if it si the keyword "element". + str = strstr(bufferp, "element"); + if (!str) str = strstr(bufferp, "Element"); + if (str) { + bufferp = findnextfield(str); + if (*bufferp == '\0') { + printf("Syntax error reading element type on line%d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + if (nverts == 0) { + // Find if it is the keyword "vertex". + str = strstr(bufferp, "vertex"); + if (!str) str = strstr(bufferp, "Vertex"); + if (str) { + bufferp = findnextnumber(str); + if (*bufferp == '\0') { + printf("Syntax error reading vertex number on line"); + printf(" %d in file %s\n", line_count, infilename); + fclose(fp); + return false; + } + nverts = (int) strtol(bufferp, &bufferp, 0); + // Allocate memory for 'tetgenio' + if (nverts > 0) { + numberofpoints = nverts; + pointlist = new REAL[nverts * 3]; + } + } + } + if (nfaces == 0) { + // Find if it is the keyword "face". + str = strstr(bufferp, "face"); + if (!str) str = strstr(bufferp, "Face"); + if (str) { + bufferp = findnextnumber(str); + if (*bufferp == '\0') { + printf("Syntax error reading face number on line"); + printf(" %d in file %s\n", line_count, infilename); + fclose(fp); + return false; + } + nfaces = (int) strtol(bufferp, &bufferp, 0); + // Allocate memory for 'tetgenio' + if (nfaces > 0) { + numberoffacets = nfaces; + facetlist = new tetgenio::facet[nfaces]; + } + } + } + } // It is not the string "element". + } + if (format == 0) { + // Find the keyword "format". + str = strstr(bufferp, "format"); + if (!str) str = strstr(bufferp, "Format"); + if (str) { + format = 1; + bufferp = findnextfield(str); + // Find if it is the string "ascii". + str = strstr(bufferp, "ascii"); + if (!str) str = strstr(bufferp, "ASCII"); + if (!str) { + printf("This routine only reads ascii format of ply files.\n"); + printf("Hint: You can convert the binary to ascii format by\n"); + printf(" using the provided ply tools:\n"); + printf(" ply2ascii < %s > ascii_%s\n", infilename, infilename); + fclose(fp); + return false; + } + } + } + } else if (iverts < nverts) { + // Read vertex coordinates + coord = &pointlist[iverts * 3]; + for (i = 0; i < 3; i++) { + if (*bufferp == '\0') { + printf("Syntax error reading vertex coords on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + coord[i] = (REAL) strtod(bufferp, &bufferp); + bufferp = findnextnumber(bufferp); + } + iverts++; + } else if (ifaces < nfaces) { + // Get next face + f = &facetlist[ifaces]; + init(f); + // In .off format, each facet has one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + init(p); + // Read the number of vertices, it should be greater than 0. + p->numberofvertices = (int) strtol(bufferp, &bufferp, 0); + if (p->numberofvertices == 0) { + printf("Syntax error reading polygon on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + // Allocate memory for face vertices + p->vertexlist = new int[p->numberofvertices]; + for (i = 0; i < p->numberofvertices; i++) { + bufferp = findnextnumber(bufferp); + if (*bufferp == '\0') { + printf("Syntax error reading polygon on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + p->vertexlist[i] = (int) strtol(bufferp, &bufferp, 0); + } + ifaces++; + } else { + // Should never get here + printf("Found extra text starting at line %d in file %s\n", line_count, + infilename); + break; + } + } + + // Close file + fclose(fp); + + // Check whether read all points + if (iverts != nverts) { + printf("Expected %d vertices, but read only %d vertices in file %s\n", + nverts, iverts, infilename); + return false; + } + + // Check whether read all faces + if (ifaces != nfaces) { + printf("Expected %d faces, but read only %d faces in file %s\n", + nfaces, ifaces, infilename); + return false; + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_stl() Load a surface mesh from a .stl file. // +// // +// The .stl or stereolithography format is an ASCII or binary file used in // +// manufacturing. It is a list of the triangular surfaces that describe a // +// computer generated solid model. This is the standard input for most rapid // +// prototyping machines. // +// // +// Comment: A .stl file many contain many duplicated points. They will be // +// unified during the Delaunay tetrahedralization process. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_stl(char* filebasename) +{ + FILE *fp; + tetgenmesh::list *plist; + tetgenio::facet *f; + tetgenio::polygon *p; + char infilename[FILENAMESIZE]; + char buffer[INPUTLINESIZE]; + char *bufferp, *str; + double *coord; + int solid = 0; + int nverts = 0, iverts = 0; + int nfaces = 0; + int line_count = 0, i; + + strncpy(infilename, filebasename, FILENAMESIZE - 1); + infilename[FILENAMESIZE - 1] = '\0'; + if (infilename[0] == '\0') { + printf("Error: No filename.\n"); + return false; + } + if (strcmp(&infilename[strlen(infilename) - 4], ".stl") != 0) { + strcat(infilename, ".stl"); + } + + if (!(fp = fopen(infilename, "r"))) { + printf("Error: Unable to open file %s\n", infilename); + return false; + } + printf("Opening %s.\n", infilename); + + // STL file has no number of points available. Use a list to read points. + plist = new tetgenmesh::list(sizeof(double) * 3, NULL, 1024); + + while ((bufferp = readline(buffer, fp, &line_count)) != NULL) { + // The ASCII .stl file must start with the lower case keyword solid and + // end with endsolid. + if (solid == 0) { + // Read header + bufferp = strstr(bufferp, "solid"); + if (bufferp != NULL) { + solid = 1; + } + } else { + // We're inside the block of the solid. + str = bufferp; + // Is this the end of the solid. + bufferp = strstr(bufferp, "endsolid"); + if (bufferp != NULL) { + solid = 0; + } else { + // Read the XYZ coordinates if it is a vertex. + bufferp = str; + bufferp = strstr(bufferp, "vertex"); + if (bufferp != NULL) { + coord = (double *) plist->append(NULL); + for (i = 0; i < 3; i++) { + bufferp = findnextnumber(bufferp); + if (*bufferp == '\0') { + printf("Syntax error reading vertex coords on line %d\n", + line_count); + delete plist; + fclose(fp); + return false; + } + coord[i] = (REAL) strtod(bufferp, &bufferp); + } + } + } + } + } + fclose(fp); + + nverts = plist->len(); + // nverts should be an integer times 3 (every 3 vertices denote a face). + if (nverts == 0 || (nverts % 3 != 0)) { + printf("Error: Wrong number of vertices in file %s.\n", infilename); + delete plist; + return false; + } + numberofpoints = nverts; + pointlist = new REAL[nverts * 3]; + for (i = 0; i < nverts; i++) { + coord = (double *) (* plist)[i]; + iverts = i * 3; + pointlist[iverts] = (REAL) coord[0]; + pointlist[iverts + 1] = (REAL) coord[1]; + pointlist[iverts + 2] = (REAL) coord[2]; + } + + nfaces = (int) (nverts / 3); + numberoffacets = nfaces; + facetlist = new tetgenio::facet[nfaces]; + + // Default use '1' as the array starting index. + firstnumber = 1; + iverts = firstnumber; + for (i = 0; i < nfaces; i++) { + f = &facetlist[i]; + init(f); + // In .stl format, each facet has one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + init(p); + // Each polygon has three vertices. + p->numberofvertices = 3; + p->vertexlist = new int[p->numberofvertices]; + p->vertexlist[0] = iverts; + p->vertexlist[1] = iverts + 1; + p->vertexlist[2] = iverts + 2; + iverts += 3; + } + + delete plist; + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_medit() Load a surface mesh from a .mesh file. // +// // +// The .mesh format is the file format of Medit, a user-friendly interactive // +// mesh viewer program. // +// // +// This routine ONLY reads the sections containing vertices, triangles, and // +// quadrilaters. Other sections (such as tetrahedra, edges, ...) are ignored.// +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_medit(char* filebasename) +{ + FILE *fp; + tetgenio::facet *tmpflist, *f; + tetgenio::polygon *p; + char infilename[FILENAMESIZE]; + char buffer[INPUTLINESIZE]; + char *bufferp, *str; + double *coord; + int *tmpfmlist; + int dimension = 0; + int nverts = 0; + int nfaces = 0; + int line_count = 0; + int corners = 0; // 3 (triangle) or 4 (quad). + int i, j; + + strncpy(infilename, filebasename, FILENAMESIZE - 1); + infilename[FILENAMESIZE - 1] = '\0'; + if (infilename[0] == '\0') { + printf("Error: No filename.\n"); + return false; + } + if (strcmp(&infilename[strlen(infilename) - 5], ".mesh") != 0) { + strcat(infilename, ".mesh"); + } + + if (!(fp = fopen(infilename, "r"))) { + printf("Error: Unable to open file %s\n", infilename); + return false; + } + printf("Opening %s.\n", infilename); + + // Default uses the index starts from '1'. + firstnumber = 1; + + while ((bufferp = readline(buffer, fp, &line_count)) != NULL) { + if (*bufferp == '#') continue; // A comment line is skipped. + if (dimension == 0) { + // Find if it is the keyword "Dimension". + str = strstr(bufferp, "Dimension"); + if (!str) str = strstr(bufferp, "dimension"); + if (!str) str = strstr(bufferp, "DIMENSION"); + if (str) { + // Read the dimensions + bufferp = findnextnumber(str); // Skip field "Dimension". + if (*bufferp == '\0') { + // Read a non-empty line. + bufferp = readline(buffer, fp, &line_count); + } + dimension = (int) strtol(bufferp, &bufferp, 0); + if (dimension != 2 && dimension != 3) { + printf("Unknown dimension in file on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + mesh_dim = dimension; + } + } + if (nverts == 0) { + // Find if it is the keyword "Vertices". + str = strstr(bufferp, "Vertices"); + if (!str) str = strstr(bufferp, "vertices"); + if (!str) str = strstr(bufferp, "VERTICES"); + if (str) { + // Read the number of vertices. + bufferp = findnextnumber(str); // Skip field "Vertices". + if (*bufferp == '\0') { + // Read a non-empty line. + bufferp = readline(buffer, fp, &line_count); + } + nverts = (int) strtol(bufferp, &bufferp, 0); + // Allocate memory for 'tetgenio' + if (nverts > 0) { + numberofpoints = nverts; + pointlist = new REAL[nverts * 3]; + } + // Read the follwoing node list. + for (i = 0; i < nverts; i++) { + bufferp = readline(buffer, fp, &line_count); + if (bufferp == NULL) { + printf("Unexpected end of file on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + // Read vertex coordinates + coord = &pointlist[i * 3]; + for (j = 0; j < 3; j++) { + if (*bufferp == '\0') { + printf("Syntax error reading vertex coords on line"); + printf(" %d in file %s\n", line_count, infilename); + fclose(fp); + return false; + } + if ((j < 2) || (dimension == 3)) { + coord[j] = (REAL) strtod(bufferp, &bufferp); + } else { + assert((j == 2) && (dimension == 2)); + coord[j] = 0.0; + } + bufferp = findnextnumber(bufferp); + } + } + continue; + } + } + if (nfaces == 0) { + // Find if it is the keyword "Triangles" or "Quadrilaterals". + corners = 0; + str = strstr(bufferp, "Triangles"); + if (!str) str = strstr(bufferp, "triangles"); + if (!str) str = strstr(bufferp, "TRIANGLES"); + if (str) { + corners = 3; + } else { + str = strstr(bufferp, "Quadrilaterals"); + if (!str) str = strstr(bufferp, "quadrilaterals"); + if (!str) str = strstr(bufferp, "QUADRILATERALS"); + if (str) { + corners = 4; + } + } + if (corners == 3 || corners == 4) { + // Read the number of triangles (or quadrilaterals). + bufferp = findnextnumber(str); // Skip field "Triangles". + if (*bufferp == '\0') { + // Read a non-empty line. + bufferp = readline(buffer, fp, &line_count); + } + nfaces = strtol(bufferp, &bufferp, 0); + // Allocate memory for 'tetgenio' + if (nfaces > 0) { + if (numberoffacets > 0) { + // facetlist has already been allocated. Enlarge arrays. + tmpflist = new tetgenio::facet[numberoffacets + nfaces]; + tmpfmlist = new int[numberoffacets + nfaces]; + // Copy the data of old arrays into new arrays. + for (i = 0; i < numberoffacets; i++) { + f = &(tmpflist[i]); + tetgenio::init(f); + *f = facetlist[i]; + tmpfmlist[i] = facetmarkerlist[i]; + } + // Release old arrays. + delete [] facetlist; + delete [] facetmarkerlist; + // Remember the new arrays. + facetlist = tmpflist; + facetmarkerlist = tmpfmlist; + } else { + // This is the first time to allocate facetlist. + facetlist = new tetgenio::facet[nfaces]; + facetmarkerlist = new int[nfaces]; + } + } + // Read the following list of faces. + for (i = numberoffacets; i < numberoffacets + nfaces; i++) { + bufferp = readline(buffer, fp, &line_count); + if (bufferp == NULL) { + printf("Unexpected end of file on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + f = &facetlist[i]; + tetgenio::init(f); + // In .mesh format, each facet has one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + tetgenio::init(p); + p->numberofvertices = corners; + // Allocate memory for face vertices + p->vertexlist = new int[p->numberofvertices]; + // Read the vertices of the face. + for (j = 0; j < corners; j++) { + if (*bufferp == '\0') { + printf("Syntax error reading face on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + p->vertexlist[j] = (int) strtol(bufferp, &bufferp, 0); + if (firstnumber == 1) { + // Check if a '0' index appears. + if (p->vertexlist[j] == 0) { + // The first index is set to be 0. + firstnumber = 0; + } + } + bufferp = findnextnumber(bufferp); + } + // Read the marker of the face if it exists. + facetmarkerlist[i] = 0; + if (*bufferp != '\0') { + facetmarkerlist[i] = (int) strtol(bufferp, &bufferp, 0); + } + } + // Have read in a list of triangles/quads. + numberoffacets += nfaces; + nfaces = 0; + } + } + // if (nverts > 0 && nfaces > 0) break; // Ignore other data. + } + + // Close file + fclose(fp); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_vtk() Load VTK surface mesh from file (.vtk ascii or binary). // +// // +// This function is contributed by: Bryn Lloyd, Computer Vision Laborator, // +// ETH, Zuerich. May 7, 2007. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_vtk(char* filebasename) +{ + FILE *fp; + tetgenio::facet *f; + tetgenio::polygon *p; + char infilename[FILENAMESIZE]; + char line[INPUTLINESIZE]; + char mode[128], id[256], fmt[64]; + char *bufferp; + double *coord; + float _x, _y, _z; + int nverts = 0; + int nfaces = 0; + int line_count = 0; + int dummy; + int id1, id2, id3; + int nn = -1; + int nn_old = -1; + int i, j; + bool ImALittleEndian = !testIsBigEndian(); + + strncpy(infilename, filebasename, FILENAMESIZE - 1); + infilename[FILENAMESIZE - 1] = '\0'; + if (infilename[0] == '\0') { + printf("Error: No filename.\n"); + return false; + } + if (strcmp(&infilename[strlen(infilename) - 4], ".vtk") != 0) { + strcat(infilename, ".vtk"); + } + if (!(fp = fopen(infilename, "r"))) { + printf("Error: Unable to open file %s\n", infilename); + return false; + } + printf("Opening %s.\n", infilename); + + // Default uses the index starts from '0'. + firstnumber = 0; + strcpy(mode, "BINARY"); + + while((bufferp = readline(line, fp, &line_count)) != NULL) { + if(strlen(line) == 0) continue; + //swallow lines beginning with a comment sign or white space + if(line[0] == '#' || line[0]=='\n' || line[0] == 10 || line[0] == 13 || + line[0] == 32) continue; + + sscanf(line, "%s", id); + if(!strcmp(id, "ASCII")) { + strcpy(mode, "ASCII"); + } + + if(!strcmp(id, "POINTS")) { + sscanf(line, "%s %d %s", id, &nverts, fmt); + if (nverts > 0) { + numberofpoints = nverts; + pointlist = new REAL[nverts * 3]; + } + + if(!strcmp(mode, "BINARY")) { + for(i = 0; i < nverts; i++) { + coord = &pointlist[i * 3]; + if(!strcmp(fmt, "double")) { + fread((char*)(&(coord[0])), sizeof(double), 1, fp); + fread((char*)(&(coord[1])), sizeof(double), 1, fp); + fread((char*)(&(coord[2])), sizeof(double), 1, fp); + if(ImALittleEndian){ + swapBytes((unsigned char *) &(coord[0]), sizeof(coord[0])); + swapBytes((unsigned char *) &(coord[1]), sizeof(coord[1])); + swapBytes((unsigned char *) &(coord[2]), sizeof(coord[2])); + } + } else if(!strcmp(fmt, "float")) { + fread((char*)(&_x), sizeof(float), 1, fp); + fread((char*)(&_y), sizeof(float), 1, fp); + fread((char*)(&_z), sizeof(float), 1, fp); + if(ImALittleEndian){ + swapBytes((unsigned char *) &_x, sizeof(_x)); + swapBytes((unsigned char *) &_y, sizeof(_y)); + swapBytes((unsigned char *) &_z, sizeof(_z)); + } + coord[0] = double(_x); + coord[1] = double(_y); + coord[2] = double(_z); + } else { + printf("Error: Only float or double formats are supported!\n"); + return false; + } + } + } else if(!strcmp(mode, "ASCII")) { + for(i = 0; i < nverts; i++){ + bufferp = readline(line, fp, &line_count); + if (bufferp == NULL) { + printf("Unexpected end of file on line %d in file %s\n", + line_count, infilename); + fclose(fp); + return false; + } + // Read vertex coordinates + coord = &pointlist[i * 3]; + for (j = 0; j < 3; j++) { + if (*bufferp == '\0') { + printf("Syntax error reading vertex coords on line"); + printf(" %d in file %s\n", line_count, infilename); + fclose(fp); + return false; + } + coord[j] = (REAL) strtod(bufferp, &bufferp); + bufferp = findnextnumber(bufferp); + } + } + } + continue; + } + + if(!strcmp(id, "POLYGONS")) { + sscanf(line, "%s %d %d", id, &nfaces, &dummy); + if (nfaces > 0) { + numberoffacets = nfaces; + facetlist = new tetgenio::facet[nfaces]; + } + + if(!strcmp(mode, "BINARY")) { + for(i = 0; i < nfaces; i++){ + fread((char*)(&nn), sizeof(int), 1, fp); + if(ImALittleEndian){ + swapBytes((unsigned char *) &nn, sizeof(nn)); + } + if (i == 0) + nn_old = nn; + if (nn != nn_old) { + printf("Error: No mixed cells are allowed.\n"); + return false; + } + + if(nn == 3){ + fread((char*)(&id1), sizeof(int), 1, fp); + fread((char*)(&id2), sizeof(int), 1, fp); + fread((char*)(&id3), sizeof(int), 1, fp); + if(ImALittleEndian){ + swapBytes((unsigned char *) &id1, sizeof(id1)); + swapBytes((unsigned char *) &id2, sizeof(id2)); + swapBytes((unsigned char *) &id3, sizeof(id3)); + } + f = &facetlist[i]; + init(f); + // In .off format, each facet has one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + init(p); + // Set number of vertices + p->numberofvertices = 3; + // Allocate memory for face vertices + p->vertexlist = new int[p->numberofvertices]; + p->vertexlist[0] = id1; + p->vertexlist[1] = id2; + p->vertexlist[2] = id3; + } else { + printf("Error: Only triangles are supported\n"); + return false; + } + } + } else if(!strcmp(mode, "ASCII")) { + for(i = 0; i < nfaces; i++) { + bufferp = readline(line, fp, &line_count); + nn = (int) strtol(bufferp, &bufferp, 0); + if (i == 0) + nn_old = nn; + if (nn != nn_old) { + printf("Error: No mixed cells are allowed.\n"); + return false; + } + + if (nn == 3) { + bufferp = findnextnumber(bufferp); // Skip the first field. + id1 = (int) strtol(bufferp, &bufferp, 0); + bufferp = findnextnumber(bufferp); + id2 = (int) strtol(bufferp, &bufferp, 0); + bufferp = findnextnumber(bufferp); + id3 = (int) strtol(bufferp, &bufferp, 0); + f = &facetlist[i]; + init(f); + // In .off format, each facet has one polygon, no hole. + f->numberofpolygons = 1; + f->polygonlist = new tetgenio::polygon[1]; + p = &f->polygonlist[0]; + init(p); + // Set number of vertices + p->numberofvertices = 3; + // Allocate memory for face vertices + p->vertexlist = new int[p->numberofvertices]; + p->vertexlist[0] = id1; + p->vertexlist[1] = id2; + p->vertexlist[2] = id3; + } else { + printf("Error: Only triangles are supported.\n"); + return false; + } + } + } + + fclose(fp); + return true; + } + + if(!strcmp(id,"LINES") || !strcmp(id,"CELLS")){ + printf("Warning: load_vtk(): cannot read formats LINES, CELLS.\n"); + } + } // while () + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_plc() Load a piecewise linear complex from file(s). // +// // +// 'object' indicates which file format is used to describ the plc. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_plc(char* filebasename, int object) +{ + enum tetgenbehavior::objecttype type; + + type = (enum tetgenbehavior::objecttype) object; + switch (type) { + case tetgenbehavior::NODES: + return load_node(filebasename); + case tetgenbehavior::POLY: + return load_poly(filebasename); + case tetgenbehavior::OFF: + return load_off(filebasename); + case tetgenbehavior::PLY: + return load_ply(filebasename); + case tetgenbehavior::STL: + return load_stl(filebasename); + case tetgenbehavior::MEDIT: + return load_medit(filebasename); + case tetgenbehavior::VTK: + return load_vtk(filebasename); + default: + return load_poly(filebasename); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// load_tetmesh() Load a tetrahedral mesh from files. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenio::load_tetmesh(char* filebasename) +{ + FILE *infile; + char innodefilename[FILENAMESIZE]; + char inelefilename[FILENAMESIZE]; + char infacefilename[FILENAMESIZE]; + char inedgefilename[FILENAMESIZE]; + char involfilename[FILENAMESIZE]; + char inputline[INPUTLINESIZE]; + char *stringptr, *infilename; + REAL attrib, volume; + int volelements; + int markers, corner; + int index, attribindex; + int i, j; + + // Assembling the actual file names we want to open. + strcpy(innodefilename, filebasename); + strcpy(inelefilename, filebasename); + strcpy(infacefilename, filebasename); + strcpy(inedgefilename, filebasename); + strcpy(involfilename, filebasename); + strcat(innodefilename, ".node"); + strcat(inelefilename, ".ele"); + strcat(infacefilename, ".face"); + strcat(inedgefilename, ".edge"); + strcat(involfilename, ".vol"); + + // Read the points from a .node file. + infilename = innodefilename; + printf("Opening %s.\n", infilename); + infile = fopen(infilename, "r"); + if (infile == (FILE *) NULL) { + printf("File I/O Error: Cannot access file %s.\n", infilename); + return false; + } + // Read the first line of the file. + stringptr = readnumberline(inputline, infile, infilename); + // Is this list of points generated from rbox? + stringptr = strstr(inputline, "rbox"); + if (stringptr == NULL) { + // Read number of points, number of dimensions, number of point + // attributes, and number of boundary markers. + stringptr = inputline; + numberofpoints = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + mesh_dim = 3; + } else { + mesh_dim = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + numberofpointattributes = 0; + } else { + numberofpointattributes = (int) strtol (stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + markers = 0; // Default value. + } else { + markers = (int) strtol (stringptr, &stringptr, 0); + } + } else { + // It is a rbox (qhull) input file. + stringptr = inputline; + // Get the dimension. + mesh_dim = (int) strtol (stringptr, &stringptr, 0); + // Get the number of points. + stringptr = readnumberline(inputline, infile, infilename); + numberofpoints = (int) strtol (stringptr, &stringptr, 0); + // There is no index column. + useindex = 0; + } + + // Load the list of nodes. + if (!load_node_call(infile, markers, infilename)) { + fclose(infile); + return false; + } + fclose(infile); + + // Read the elements from an .ele file. + if (mesh_dim == 3) { + infilename = inelefilename; + infile = fopen(infilename, "r"); + if (infile != (FILE *) NULL) { + printf("Opening %s.\n", infilename); + // Read number of elements, number of corners (4 or 10), number of + // element attributes. + stringptr = readnumberline(inputline, infile, infilename); + numberoftetrahedra = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + numberofcorners = 4; // Default read 4 nodes per element. + } else { + numberofcorners = (int) strtol(stringptr, &stringptr, 0); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + numberoftetrahedronattributes = 0; // Default no attribute. + } else { + numberoftetrahedronattributes = (int) strtol(stringptr, &stringptr, 0); + } + if (numberofcorners != 4 && numberofcorners != 10) { + printf("Error: Wrong number of corners %d (should be 4 or 10).\n", + numberofcorners); + fclose(infile); + return false; + } + // Allocate memory for tetrahedra. + if (numberoftetrahedra > 0) { + tetrahedronlist = new int[numberoftetrahedra * numberofcorners]; + if (tetrahedronlist == (int *) NULL) { + terminatetetgen(1); + } + // Allocate memory for output tetrahedron attributes if necessary. + if (numberoftetrahedronattributes > 0) { + tetrahedronattributelist = new REAL[numberoftetrahedra * + numberoftetrahedronattributes]; + if (tetrahedronattributelist == (REAL *) NULL) { + terminatetetgen(1); + } + } + } + // Read the list of tetrahedra. + index = 0; + attribindex = 0; + for (i = 0; i < numberoftetrahedra; i++) { + // Read tetrahedron index and the tetrahedron's corners. + stringptr = readnumberline(inputline, infile, infilename); + for (j = 0; j < numberofcorners; j++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Tetrahedron %d is missing vertex %d in %s.\n", + i + firstnumber, j + 1, infilename); + terminatetetgen(1); + } + corner = (int) strtol(stringptr, &stringptr, 0); + if (corner < firstnumber || corner >= numberofpoints + firstnumber) { + printf("Error: Tetrahedron %d has an invalid vertex index.\n", + i + firstnumber); + terminatetetgen(1); + } + tetrahedronlist[index++] = corner; + } + // Read the tetrahedron's attributes. + for (j = 0; j < numberoftetrahedronattributes; j++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + attrib = 0.0; + } else { + attrib = (REAL) strtod(stringptr, &stringptr); + } + tetrahedronattributelist[attribindex++] = attrib; + } + } + fclose(infile); + } + } // if (meshdim == 3) + + // Read the hullfaces or subfaces from a .face file if it exists. + if (mesh_dim == 3) { + infilename = infacefilename; + } else { + infilename = inelefilename; + } + infile = fopen(infilename, "r"); + if (infile != (FILE *) NULL) { + printf("Opening %s.\n", infilename); + // Read number of faces, boundary markers. + stringptr = readnumberline(inputline, infile, infilename); + numberoftrifaces = (int) strtol (stringptr, &stringptr, 0); + stringptr = findnextnumber(stringptr); + if (mesh_dim == 2) { + // Skip a number. + stringptr = findnextnumber(stringptr); + } + if (*stringptr == '\0') { + markers = 0; // Default there is no marker per face. + } else { + markers = (int) strtol (stringptr, &stringptr, 0); + } + if (numberoftrifaces > 0) { + trifacelist = new int[numberoftrifaces * 3]; + if (trifacelist == (int *) NULL) { + terminatetetgen(1); + } + if (markers) { + trifacemarkerlist = new int[numberoftrifaces]; + if (trifacemarkerlist == (int *) NULL) { + terminatetetgen(1); + } + } + } + // Read the list of faces. + index = 0; + for (i = 0; i < numberoftrifaces; i++) { + // Read face index and the face's three corners. + stringptr = readnumberline(inputline, infile, infilename); + for (j = 0; j < 3; j++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Face %d is missing vertex %d in %s.\n", + i + firstnumber, j + 1, infilename); + terminatetetgen(1); + } + corner = (int) strtol(stringptr, &stringptr, 0); + if (corner < firstnumber || corner >= numberofpoints + firstnumber) { + printf("Error: Face %d has an invalid vertex index.\n", + i + firstnumber); + terminatetetgen(1); + } + trifacelist[index++] = corner; + } + // Read the boundary marker if it exists. + if (markers) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + attrib = 0.0; + } else { + attrib = (REAL) strtod(stringptr, &stringptr); + } + trifacemarkerlist[i] = (int) attrib; + } + } + fclose(infile); + } + + // Read the boundary edges from a .edge file if it exists. + infilename = inedgefilename; + infile = fopen(infilename, "r"); + if (infile != (FILE *) NULL) { + printf("Opening %s.\n", infilename); + // Read number of boundary edges. + stringptr = readnumberline(inputline, infile, infilename); + numberofedges = (int) strtol (stringptr, &stringptr, 0); + if (numberofedges > 0) { + edgelist = new int[numberofedges * 2]; + if (edgelist == (int *) NULL) { + terminatetetgen(1); + } + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + markers = 0; // Default value. + } else { + markers = (int) strtol (stringptr, &stringptr, 0); + } + if (markers > 0) { + edgemarkerlist = new int[numberofedges]; + } + } + // Read the list of faces. + index = 0; + for (i = 0; i < numberofedges; i++) { + // Read face index and the edge's two endpoints. + stringptr = readnumberline(inputline, infile, infilename); + for (j = 0; j < 2; j++) { + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + printf("Error: Edge %d is missing vertex %d in %s.\n", + i + firstnumber, j + 1, infilename); + terminatetetgen(1); + } + corner = (int) strtol(stringptr, &stringptr, 0); + if (corner < firstnumber || corner >= numberofpoints + firstnumber) { + printf("Error: Edge %d has an invalid vertex index.\n", + i + firstnumber); + terminatetetgen(1); + } + edgelist[index++] = corner; + } + // Read the edge marker if it has. + if (markers) { + stringptr = findnextnumber(stringptr); + edgemarkerlist[i] = (int) strtol(stringptr, &stringptr, 0); + } + } + fclose(infile); + } + + // Read the volume constraints from a .vol file if it exists. + infilename = involfilename; + infile = fopen(infilename, "r"); + if (infile != (FILE *) NULL) { + printf("Opening %s.\n", infilename); + // Read number of tetrahedra. + stringptr = readnumberline(inputline, infile, infilename); + volelements = (int) strtol (stringptr, &stringptr, 0); + if (volelements != numberoftetrahedra) { + printf("Warning: %s and %s disagree on number of tetrahedra.\n", + inelefilename, involfilename); + volelements = 0; + } + if (volelements > 0) { + tetrahedronvolumelist = new REAL[volelements]; + if (tetrahedronvolumelist == (REAL *) NULL) { + terminatetetgen(1); + } + } + // Read the list of volume constraints. + for (i = 0; i < volelements; i++) { + stringptr = readnumberline(inputline, infile, infilename); + stringptr = findnextnumber(stringptr); + if (*stringptr == '\0') { + volume = -1.0; // No constraint on this tetrahedron. + } else { + volume = (REAL) strtod(stringptr, &stringptr); + } + tetrahedronvolumelist[i] = volume; + } + fclose(infile); + } + + // Try to load a .mtr file if it exists. + load_mtr(filebasename); + + // Try to read a .pbc file if it exists. + // load_pbc(filebasename); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// save_nodes() Save points to a .node file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenio::save_nodes(char* filebasename) +{ + FILE *fout; + char outnodefilename[FILENAMESIZE]; + char outmtrfilename[FILENAMESIZE]; + int i, j; + + sprintf(outnodefilename, "%s.node", filebasename); + printf("Saving nodes to %s\n", outnodefilename); + fout = fopen(outnodefilename, "w"); + fprintf(fout, "%d %d %d %d\n", numberofpoints, mesh_dim, + numberofpointattributes, pointmarkerlist != NULL ? 1 : 0); + for (i = 0; i < numberofpoints; i++) { + if (mesh_dim == 2) { + fprintf(fout, "%d %.16g %.16g", i + firstnumber, pointlist[i * 3], + pointlist[i * 3 + 1]); + } else { + fprintf(fout, "%d %.16g %.16g %.16g", i + firstnumber, + pointlist[i * 3], pointlist[i * 3 + 1], pointlist[i * 3 + 2]); + } + for (j = 0; j < numberofpointattributes; j++) { + fprintf(fout, " %.16g", + pointattributelist[i * numberofpointattributes + j]); + } + if (pointmarkerlist != NULL) { + fprintf(fout, " %d", pointmarkerlist[i]); + } + fprintf(fout, "\n"); + } + fclose(fout); + + // If the point metrics exist, output them to a .mtr file. + if ((numberofpointmtrs > 0) && (pointmtrlist != (REAL *) NULL)) { + sprintf(outmtrfilename, "%s.mtr", filebasename); + printf("Saving metrics to %s\n", outmtrfilename); + fout = fopen(outmtrfilename, "w"); + fprintf(fout, "%d %d\n", numberofpoints, numberofpointmtrs); + for (i = 0; i < numberofpoints; i++) { + for (j = 0; j < numberofpointmtrs; j++) { + fprintf(fout, "%.16g ", pointmtrlist[i * numberofpointmtrs + j]); + } + fprintf(fout, "\n"); + } + fclose(fout); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// save_elements() Save elements to a .ele file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenio::save_elements(char* filebasename) +{ + FILE *fout; + char outelefilename[FILENAMESIZE]; + int i, j; + + sprintf(outelefilename, "%s.ele", filebasename); + printf("Saving elements to %s\n", outelefilename); + fout = fopen(outelefilename, "w"); + if (mesh_dim == 3) { + fprintf(fout, "%d %d %d\n", numberoftetrahedra, numberofcorners, + numberoftetrahedronattributes); + for (i = 0; i < numberoftetrahedra; i++) { + fprintf(fout, "%d", i + firstnumber); + for (j = 0; j < numberofcorners; j++) { + fprintf(fout, " %5d", tetrahedronlist[i * numberofcorners + j]); + } + for (j = 0; j < numberoftetrahedronattributes; j++) { + fprintf(fout, " %g", + tetrahedronattributelist[i * numberoftetrahedronattributes + j]); + } + fprintf(fout, "\n"); + } + } else { + // Save a two-dimensional mesh. + fprintf(fout, "%d %d %d\n",numberoftrifaces,3,trifacemarkerlist ? 1 : 0); + for (i = 0; i < numberoftrifaces; i++) { + fprintf(fout, "%d", i + firstnumber); + for (j = 0; j < 3; j++) { + fprintf(fout, " %5d", trifacelist[i * 3 + j]); + } + if (trifacemarkerlist != NULL) { + fprintf(fout, " %d", trifacemarkerlist[i]); + } + fprintf(fout, "\n"); + } + } + + fclose(fout); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// save_faces() Save faces to a .face file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenio::save_faces(char* filebasename) +{ + FILE *fout; + char outfacefilename[FILENAMESIZE]; + int i; + + sprintf(outfacefilename, "%s.face", filebasename); + printf("Saving faces to %s\n", outfacefilename); + fout = fopen(outfacefilename, "w"); + fprintf(fout, "%d %d\n", numberoftrifaces, + trifacemarkerlist != NULL ? 1 : 0); + for (i = 0; i < numberoftrifaces; i++) { + fprintf(fout, "%d %5d %5d %5d", i + firstnumber, trifacelist[i * 3], + trifacelist[i * 3 + 1], trifacelist[i * 3 + 2]); + if (trifacemarkerlist != NULL) { + fprintf(fout, " %d", trifacemarkerlist[i]); + } + fprintf(fout, "\n"); + } + + fclose(fout); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// save_edges() Save egdes to a .edge file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenio::save_edges(char* filebasename) +{ + FILE *fout; + char outedgefilename[FILENAMESIZE]; + int i; + + sprintf(outedgefilename, "%s.edge", filebasename); + printf("Saving edges to %s\n", outedgefilename); + fout = fopen(outedgefilename, "w"); + fprintf(fout, "%d %d\n", numberofedges, edgemarkerlist != NULL ? 1 : 0); + for (i = 0; i < numberofedges; i++) { + fprintf(fout, "%d %4d %4d", i + firstnumber, edgelist[i * 2], + edgelist[i * 2 + 1]); + if (edgemarkerlist != NULL) { + fprintf(fout, " %d", edgemarkerlist[i]); + } + fprintf(fout, "\n"); + } + + fclose(fout); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// save_neighbors() Save egdes to a .neigh file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenio::save_neighbors(char* filebasename) +{ + FILE *fout; + char outneighborfilename[FILENAMESIZE]; + int i; + + sprintf(outneighborfilename, "%s.neigh", filebasename); + printf("Saving neighbors to %s\n", outneighborfilename); + fout = fopen(outneighborfilename, "w"); + fprintf(fout, "%d %d\n", numberoftetrahedra, mesh_dim + 1); + for (i = 0; i < numberoftetrahedra; i++) { + if (mesh_dim == 2) { + fprintf(fout, "%d %5d %5d %5d", i + firstnumber, neighborlist[i * 3], + neighborlist[i * 3 + 1], neighborlist[i * 3 + 2]); + } else { + fprintf(fout, "%d %5d %5d %5d %5d", i + firstnumber, + neighborlist[i * 4], neighborlist[i * 4 + 1], + neighborlist[i * 4 + 2], neighborlist[i * 4 + 3]); + } + fprintf(fout, "\n"); + } + + fclose(fout); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// save_poly() Save segments or facets to a .poly file. // +// // +// It only save the facets, holes and regions. No .node file is saved. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenio::save_poly(char* filebasename) +{ + FILE *fout; + facet *f; + polygon *p; + char outpolyfilename[FILENAMESIZE]; + int i, j, k; + + sprintf(outpolyfilename, "%s.poly", filebasename); + printf("Saving poly to %s\n", outpolyfilename); + fout = fopen(outpolyfilename, "w"); + + // The zero indicates that the vertices are in a separate .node file. + // Followed by number of dimensions, number of vertex attributes, + // and number of boundary markers (zero or one). + fprintf(fout, "%d %d %d %d\n", 0, mesh_dim, numberofpointattributes, + pointmarkerlist != NULL ? 1 : 0); + + // Save segments or facets. + if (mesh_dim == 2) { + // Number of segments, number of boundary markers (zero or one). + fprintf(fout, "%d %d\n", numberofedges, edgemarkerlist != NULL ? 1 : 0); + for (i = 0; i < numberofedges; i++) { + fprintf(fout, "%d %4d %4d", i + firstnumber, edgelist[i * 2], + edgelist[i * 2 + 1]); + if (edgemarkerlist != NULL) { + fprintf(fout, " %d", edgemarkerlist[i]); + } + fprintf(fout, "\n"); + } + } else { + // Number of facets, number of boundary markers (zero or one). + fprintf(fout, "%d %d\n", numberoffacets, facetmarkerlist != NULL ? 1 : 0); + for (i = 0; i < numberoffacets; i++) { + f = &(facetlist[i]); + fprintf(fout, "%d %d %d # %d\n", f->numberofpolygons,f->numberofholes, + facetmarkerlist != NULL ? facetmarkerlist[i] : 0, i + firstnumber); + // Output polygons of this facet. + for (j = 0; j < f->numberofpolygons; j++) { + p = &(f->polygonlist[j]); + fprintf(fout, "%d ", p->numberofvertices); + for (k = 0; k < p->numberofvertices; k++) { + if (((k + 1) % 10) == 0) { + fprintf(fout, "\n "); + } + fprintf(fout, " %d", p->vertexlist[k]); + } + fprintf(fout, "\n"); + } + // Output holes of this facet. + for (j = 0; j < f->numberofholes; j++) { + fprintf(fout, "%d %.12g %.12g %.12g\n", j + firstnumber, + f->holelist[j * 3], f->holelist[j * 3 + 1], f->holelist[j * 3 + 2]); + } + } + } + + // Save holes. + fprintf(fout, "%d\n", numberofholes); + for (i = 0; i < numberofholes; i++) { + // Output x, y coordinates. + fprintf(fout, "%d %.12g %.12g", i + firstnumber, holelist[i * mesh_dim], + holelist[i * mesh_dim + 1]); + if (mesh_dim == 3) { + // Output z coordinate. + fprintf(fout, " %.12g", holelist[i * mesh_dim + 2]); + } + fprintf(fout, "\n"); + } + + // Save regions. + fprintf(fout, "%d\n", numberofregions); + for (i = 0; i < numberofregions; i++) { + if (mesh_dim == 2) { + // Output the index, x, y coordinates, attribute (region number) + // and maximum area constraint (maybe -1). + fprintf(fout, "%d %.12g %.12g %.12g %.12g\n", i + firstnumber, + regionlist[i * 4], regionlist[i * 4 + 1], + regionlist[i * 4 + 2], regionlist[i * 4 + 3]); + } else { + // Output the index, x, y, z coordinates, attribute (region number) + // and maximum volume constraint (maybe -1). + fprintf(fout, "%d %.12g %.12g %.12g %.12g %.12g\n", i + firstnumber, + regionlist[i * 5], regionlist[i * 5 + 1], + regionlist[i * 5 + 2], regionlist[i * 5 + 3], + regionlist[i * 5 + 4]); + } + } + + fclose(fout); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// readline() Read a nonempty line from a file. // +// // +// A line is considered "nonempty" if it contains something more than white // +// spaces. If a line is considered empty, it will be dropped and the next // +// line will be read, this process ends until reaching the end-of-file or a // +// non-empty line. Return NULL if it is the end-of-file, otherwise, return // +// a pointer to the first non-whitespace character of the line. // +// // +/////////////////////////////////////////////////////////////////////////////// + +char* tetgenio::readline(char *string, FILE *infile, int *linenumber) +{ + char *result; + + // Search for a non-empty line. + do { + result = fgets(string, INPUTLINESIZE - 1, infile); + if (linenumber) (*linenumber)++; + if (result == (char *) NULL) { + return (char *) NULL; + } + // Skip white spaces. + while ((*result == ' ') || (*result == '\t')) result++; + // If it's end of line, read another line and try again. + } while (*result == '\0'); + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// findnextfield() Find the next field of a string. // +// // +// Jumps past the current field by searching for whitespace or a comma, then // +// jumps past the whitespace or the comma to find the next field. // +// // +/////////////////////////////////////////////////////////////////////////////// + +char* tetgenio::findnextfield(char *string) +{ + char *result; + + result = string; + // Skip the current field. Stop upon reaching whitespace or a comma. + while ((*result != '\0') && (*result != ' ') && (*result != '\t') && + (*result != ',') && (*result != ';')) { + result++; + } + // Now skip the whitespace or the comma, stop at anything else that looks + // like a character, or the end of a line. + while ((*result == ' ') || (*result == '\t') || (*result == ',') || + (*result == ';')) { + result++; + } + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// readnumberline() Read a nonempty number line from a file. // +// // +// A line is considered "nonempty" if it contains something that looks like // +// a number. Comments (prefaced by `#') are ignored. // +// // +/////////////////////////////////////////////////////////////////////////////// + +char* tetgenio::readnumberline(char *string, FILE *infile, char *infilename) +{ + char *result; + + // Search for something that looks like a number. + do { + result = fgets(string, INPUTLINESIZE, infile); + if (result == (char *) NULL) { + if (infilename != (char *) NULL) { + printf(" Error: Unexpected end of file in %s.\n", infilename); + terminatetetgen(1); + } + return result; + } + // Skip anything that doesn't look like a number, a comment, + // or the end of a line. + while ((*result != '\0') && (*result != '#') + && (*result != '.') && (*result != '+') && (*result != '-') + && ((*result < '0') || (*result > '9'))) { + result++; + } + // If it's a comment or end of line, read another line and try again. + } while ((*result == '#') || (*result == '\0')); + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// findnextnumber() Find the next field of a number string. // +// // +// Jumps past the current field by searching for whitespace or a comma, then // +// jumps past the whitespace or the comma to find the next field that looks // +// like a number. // +// // +/////////////////////////////////////////////////////////////////////////////// + +char* tetgenio::findnextnumber(char *string) +{ + char *result; + + result = string; + // Skip the current field. Stop upon reaching whitespace or a comma. + while ((*result != '\0') && (*result != '#') && (*result != ' ') && + (*result != '\t') && (*result != ',')) { + result++; + } + // Now skip the whitespace and anything else that doesn't look like a + // number, a comment, or the end of a line. + while ((*result != '\0') && (*result != '#') + && (*result != '.') && (*result != '+') && (*result != '-') + && ((*result < '0') || (*result > '9'))) { + result++; + } + // Check for a comment (prefixed with `#'). + if (*result == '#') { + *result = '\0'; + } + return result; +} + +//// //// +//// //// +//// io_cxx /////////////////////////////////////////////////////////////////// + +//// behavior_cxx ///////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// syntax() Print list of command line switches. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenbehavior::syntax() +{ + printf(" tetgen [-prq_a_AiMYS_T_dzo_fenvgGOJBNEFICQVh] input_file\n"); + printf(" -p Tetrahedralizes a piecewise linear complex (PLC).\n"); + printf(" -r Reconstructs a previously generated mesh.\n"); + printf(" -q Refines mesh (to improve mesh quality).\n"); + printf(" -a Applies a maximum tetrahedron volume constraint.\n"); + printf(" -A Assigns attributes to tetrahedra in different regions.\n"); + printf(" -i Inserts a list of additional points into mesh.\n"); + printf(" -M No merge of coplanar facets.\n"); + printf(" -Y No splitting of input boundaries (facets and segments).\n"); + printf(" -S Specifies maximum number of added points.\n"); + printf(" -T Sets a tolerance for coplanar test (default 1e-8).\n"); + printf(" -d Detects self-intersections of facets of the PLC.\n"); + printf(" -z Numbers all output items starting from zero.\n"); + printf(" -o2 Generates second-order subparametric elements.\n"); + printf(" -f Outputs all faces to .face file.\n"); + printf(" -e Outputs all edges to .edge file.\n"); + printf(" -n Outputs tetrahedra neighbors to .neigh file.\n"); + printf(" -v Outputs Voronoi diagram to files.\n"); + printf(" -g Outputs mesh to .mesh file for viewing by Medit.\n"); + printf(" -G Outputs mesh to .msh file for viewing by Gid.\n"); + printf(" -O Outputs mesh to .off file for viewing by Geomview.\n"); + printf(" -K Outputs mesh to .vtk file for viewing by Paraview.\n"); + printf(" -J No jettison of unused vertices from output .node file.\n"); + printf(" -B Suppresses output of boundary information.\n"); + printf(" -N Suppresses output of .node file.\n"); + printf(" -E Suppresses output of .ele file.\n"); + printf(" -F Suppresses output of .face file.\n"); + printf(" -I Suppresses mesh iteration numbers.\n"); + printf(" -C Checks the consistency of the final mesh.\n"); + printf(" -Q Quiet: No terminal output except errors.\n"); + printf(" -V Verbose: Detailed information, more terminal output.\n"); + printf(" -h Help: A brief instruction for using TetGen.\n"); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// usage() Print a brief instruction for using TetGen. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenbehavior::usage() +{ + printf("TetGen\n"); + printf("A Quality Tetrahedral Mesh Generator and 3D Delaunay "); + printf("Triangulator\n"); + //versioninfo(); + printf("Version 1.4.3 (January 19, 2011).\n"); + printf("\n"); + printf("Copyright (C) 2002 - 2011\n"); + printf("Hang Si\n"); + printf("Mohrenstr. 39, 10117 Berlin, Germany\n"); + printf("si@wias-berlin.de\n"); + printf("\n"); + printf("What Can TetGen Do?\n"); + printf("\n"); + printf(" TetGen generates exact Delaunay tetrahedralizations, exact\n"); + printf(" constrained Delaunay tetrahedralizations, and quality "); + printf("tetrahedral\n meshes. The latter are nicely graded and whose "); + printf("tetrahedra have\n radius-edge ratio bounded, thus are suitable "); + printf("for finite element and\n finite volume analysis.\n"); + printf("\n"); + printf("Command Line Syntax:\n"); + printf("\n"); + printf(" Below is the command line syntax of TetGen with a list of "); + printf("short\n"); + printf(" descriptions. Underscores indicate that numbers may optionally\n"); + printf(" follow certain switches. Do not leave any space between a "); + printf("switch\n"); + printf(" and its numeric parameter. \'input_file\' contains input data\n"); + printf(" depending on the switches you supplied which may be a "); + printf(" piecewise\n"); + printf(" linear complex or a list of nodes. File formats and detailed\n"); + printf(" description of command line switches are found in user's "); + printf("manual.\n"); + printf("\n"); + syntax(); + printf("\n"); + printf("Examples of How to Use TetGen:\n"); + printf("\n"); + printf(" \'tetgen object\' reads vertices from object.node, and writes "); + printf("their\n Delaunay tetrahedralization to object.1.node and "); + printf("object.1.ele.\n"); + printf("\n"); + printf(" \'tetgen -p object\' reads a PLC from object.poly or object."); + printf("smesh (and\n possibly object.node) and writes its constrained "); + printf("Delaunay\n tetrahedralization to object.1.node, object.1.ele and "); + printf("object.1.face.\n"); + printf("\n"); + printf(" \'tetgen -pq1.414a.1 object\' reads a PLC from object.poly or\n"); + printf(" object.smesh (and possibly object.node), generates a mesh "); + printf("whose\n tetrahedra have radius-edge ratio smaller than 1.414 and "); + printf("have volume\n of 0.1 or less, and writes the mesh to "); + printf("object.1.node, object.1.ele\n and object.1.face.\n"); + printf("\n"); + printf("Please send bugs/comments to Hang Si \n"); + terminatetetgen(0); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// parse_commandline() Read the command line, identify switches, and set // +// up options and file names. // +// // +// 'argc' and 'argv' are the same parameters passed to the function main() // +// of a C/C++ program. They together represent the command line user invoked // +// from an environment in which TetGen is running. // +// // +// When TetGen is invoked from an environment. 'argc' is nonzero, switches // +// and input filename should be supplied as zero-terminated strings in // +// argv[0] through argv[argc - 1] and argv[0] shall be the name used to // +// invoke TetGen, i.e. "tetgen". Switches are previously started with a // +// dash '-' to identify them from the input filename. // +// // +// When TetGen is called from within another program. 'argc' is set to zero. // +// switches are given in one zero-terminated string (no previous dash is // +// required.), and 'argv' is a pointer points to this string. No input // +// filename is required (usually the input data has been directly created by // +// user in the 'tetgenio' structure). A default filename 'tetgen-tmpfile' // +// will be created for debugging output purpose. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenbehavior::parse_commandline(int argc, char **argv) +{ + int startindex; + int increment; + int meshnumber; + int scount; + int i, j, k; + char workstring[1024]; + + // First determine the input style of the switches. + if (argc == 0) { + startindex = 0; // Switches are given without a dash. + argc = 1; // For running the following for-loop once. + commandline[0] = '\0'; + } else { + startindex = 1; + strcpy(commandline, argv[0]); + strcat(commandline, " "); + } + + // Rcount used to count the number of '-R' be used. + scount = 0; + + for (i = startindex; i < argc; i++) { + // Remember the command line switches. + strcat(commandline, argv[i]); + strcat(commandline, " "); + if (startindex == 1) { + // Is this string a filename? + if (argv[i][0] != '-') { + strncpy(infilename, argv[i], 1024 - 1); + infilename[1024 - 1] = '\0'; + // Go to the next string directly. + continue; + } + } + // Parse the individual switch from the string. + for (j = startindex; argv[i][j] != '\0'; j++) { + if (argv[i][j] == 'p') { + plc = 1; + } else if (argv[i][j] == 'r') { + refine++; + } else if (argv[i][j] == 'R') { + coarse = 1; + } else if (argv[i][j] == 'q') { + quality++; + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + if (quality == 1) { + minratio = (REAL) strtod(workstring, (char **) NULL); + } else if (quality == 2) { + mindihedral = (REAL) strtod(workstring, (char **) NULL); + } else if (quality == 3) { + maxdihedral = (REAL) strtod(workstring, (char **) NULL); + } + } + } else if (argv[i][j] == 'm') { + metric++; + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + if (metric == 1) { + alpha1 = (REAL) strtod(workstring, (char **) NULL); + } else if (metric == 2) { + alpha2 = (REAL) strtod(workstring, (char **) NULL); + } + } + } else if (argv[i][j] == 'a') { + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + fixedvolume = 1; + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.') || (argv[i][j + 1] == 'e') || + (argv[i][j + 1] == '-') || (argv[i][j + 1] == '+')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + maxvolume = (REAL) strtod(workstring, (char **) NULL); + } else { + varvolume = 1; + } + } else if (argv[i][j] == 'A') { + regionattrib++; + } else if (argv[i][j] == 'u') { + // Set the maximum btree node size, -u0 means do not use btree. + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + max_btreenode_size = (int) strtol(workstring, (char **) NULL, 0); + } + if (max_btreenode_size == 0) { + btree = 0; + } + } else if (argv[i][j] == 'i') { + insertaddpoints = 1; + } else if (argv[i][j] == 'd') { + diagnose = 1; + } else if (argv[i][j] == 'z') { + zeroindex = 1; + } else if (argv[i][j] == 'f') { + facesout = 1; + } else if (argv[i][j] == 'e') { + edgesout++; + } else if (argv[i][j] == 'n') { + neighout++; + } else if (argv[i][j] == 'v') { + voroout = 1; + } else if (argv[i][j] == 'g') { + meditview = 1; + } else if (argv[i][j] == 'G') { + gidview = 1; + } else if (argv[i][j] == 'O') { + geomview = 1; + } else if (argv[i][j] == 'K') { + vtkview = 1; + } else if (argv[i][j] == 'M') { + nomerge = 1; + } else if (argv[i][j] == 'Y') { + nobisect++; + } else if (argv[i][j] == 'J') { + nojettison = 1; + } else if (argv[i][j] == 'B') { + nobound = 1; + } else if (argv[i][j] == 'N') { + nonodewritten = 1; + } else if (argv[i][j] == 'E') { + noelewritten = 1; + if (argv[i][j + 1] == '2') { + j++; + noelewritten = 2; + } + } else if (argv[i][j] == 'F') { + nofacewritten = 1; + } else if (argv[i][j] == 'I') { + noiterationnum = 1; + } else if (argv[i][j] == 'o') { + if (argv[i][j + 1] == '2') { + j++; + order = 2; + } + } else if (argv[i][j] == 'S') { + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.') || (argv[i][j + 1] == 'e') || + (argv[i][j + 1] == '-') || (argv[i][j + 1] == '+')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + steiner = (int) strtol(workstring, (char **) NULL, 0); + } + } else if (argv[i][j] == 's') { + scount++; + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.') || (argv[i][j + 1] == 'e') || + (argv[i][j + 1] == '-') || (argv[i][j + 1] == '+')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + if (scount == 1) { + optlevel = (int) strtol(workstring, (char **) NULL, 0); + } else if (scount == 2) { + optpasses = (int) strtol(workstring, (char **) NULL, 0); + } + } + } else if (argv[i][j] == 'D') { + conformdel++; + } else if (argv[i][j] == 'T') { + if (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.')) { + k = 0; + while (((argv[i][j + 1] >= '0') && (argv[i][j + 1] <= '9')) || + (argv[i][j + 1] == '.') || (argv[i][j + 1] == 'e') || + (argv[i][j + 1] == '-') || (argv[i][j + 1] == '+')) { + j++; + workstring[k] = argv[i][j]; + k++; + } + workstring[k] = '\0'; + epsilon = (REAL) strtod(workstring, (char **) NULL); + } + } else if (argv[i][j] == 'C') { + docheck++; + } else if (argv[i][j] == 'X') { + fliprepair = 0; + } else if (argv[i][j] == 'Q') { + quiet = 1; + } else if (argv[i][j] == 'V') { + verbose++; + } else if ((argv[i][j] == 'h') || (argv[i][j] == 'H') || + (argv[i][j] == '?')) { + usage(); + } else { + printf("Warning: Unknown switch -%c.\n", argv[i][j]); + } + } + } + + if (startindex == 0) { + // Set a temporary filename for debugging output. + strcpy(infilename, "tetgen-tmpfile"); + } else { + if (infilename[0] == '\0') { + // No input file name. Print the syntax and exit. + syntax(); + terminatetetgen(0); + } + // Recognize the object from file extension if it is available. + if (!strcmp(&infilename[strlen(infilename) - 5], ".node")) { + infilename[strlen(infilename) - 5] = '\0'; + object = NODES; + } else if (!strcmp(&infilename[strlen(infilename) - 5], ".poly")) { + infilename[strlen(infilename) - 5] = '\0'; + object = POLY; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 6], ".smesh")) { + infilename[strlen(infilename) - 6] = '\0'; + object = POLY; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 4], ".off")) { + infilename[strlen(infilename) - 4] = '\0'; + object = OFF; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 4], ".ply")) { + infilename[strlen(infilename) - 4] = '\0'; + object = PLY; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 4], ".stl")) { + infilename[strlen(infilename) - 4] = '\0'; + object = STL; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 5], ".mesh")) { + infilename[strlen(infilename) - 5] = '\0'; + object = MEDIT; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 4], ".vtk")) { + infilename[strlen(infilename) - 4] = '\0'; + object = VTK; + plc = 1; + } else if (!strcmp(&infilename[strlen(infilename) - 4], ".ele")) { + infilename[strlen(infilename) - 4] = '\0'; + object = MESH; + refine = 1; + } + } + plc = plc || diagnose; + useshelles = plc || refine || coarse || quality; + goodratio = minratio; + goodratio *= goodratio; + + // Detect improper combinations of switches. + if (plc && refine) { + printf("Error: Switch -r cannot use together with -p.\n"); + return false; + } + if (refine && (plc || noiterationnum)) { + printf("Error: Switches %s cannot use together with -r.\n", + "-p, -d, and -I"); + return false; + } + if (diagnose && (quality || insertaddpoints || (order == 2) || neighout + || docheck)) { + printf("Error: Switches %s cannot use together with -d.\n", + "-q, -i, -o2, -n, and -C"); + return false; + } + + // Be careful not to allocate space for element area constraints that + // will never be assigned any value (other than the default -1.0). + if (!refine && !plc) { + varvolume = 0; + } + // Be careful not to add an extra attribute to each element unless the + // input supports it (PLC in, but not refining a preexisting mesh). + if (refine || !plc) { + regionattrib = 0; + } + // If '-a' or '-aa' is in use, enable '-q' option too. + if (fixedvolume || varvolume) { + if (quality == 0) { + quality = 1; + } + } + // Calculate the goodangle for testing bad subfaces. + goodangle = cos(minangle * tetgenmesh::PI / 180.0); + goodangle *= goodangle; + + increment = 0; + strcpy(workstring, infilename); + j = 1; + while (workstring[j] != '\0') { + if ((workstring[j] == '.') && (workstring[j + 1] != '\0')) { + increment = j + 1; + } + j++; + } + meshnumber = 0; + if (increment > 0) { + j = increment; + do { + if ((workstring[j] >= '0') && (workstring[j] <= '9')) { + meshnumber = meshnumber * 10 + (int) (workstring[j] - '0'); + } else { + increment = 0; + } + j++; + } while (workstring[j] != '\0'); + } + if (noiterationnum) { + strcpy(outfilename, infilename); + } else if (increment == 0) { + strcpy(outfilename, infilename); + strcat(outfilename, ".1"); + } else { + workstring[increment] = '%'; + workstring[increment + 1] = 'd'; + workstring[increment + 2] = '\0'; + sprintf(outfilename, workstring, meshnumber + 1); + } + // Additional input file name has the end ".a". + strcpy(addinfilename, infilename); + strcat(addinfilename, ".a"); + // Background filename has the form "*.b.ele", "*.b.node", ... + strcpy(bgmeshfilename, infilename); + strcat(bgmeshfilename, ".b"); + + return true; +} + +//// //// +//// //// +//// behavior_cxx ///////////////////////////////////////////////////////////// + +//// prim_cxx ///////////////////////////////////////////////////////////////// +//// //// +//// //// + +// For enumerating three edges of a triangle. + +int tetgenmesh::plus1mod3[3] = {1, 2, 0}; +int tetgenmesh::minus1mod3[3] = {2, 0, 1}; + +// Table 've' takes an edge version as input, returns the next edge version +// in the same edge ring. + +int tetgenmesh::ve[6] = { 2, 5, 4, 1, 0, 3 }; + +// Tables 'vo', 'vd' and 'va' take an edge version, return the positions of +// the origin, destination and apex in the triangle. + +int tetgenmesh::vo[6] = { 0, 1, 1, 2, 2, 0 }; +int tetgenmesh::vd[6] = { 1, 0, 2, 1, 0, 2 }; +int tetgenmesh::va[6] = { 2, 2, 0, 0, 1, 1 }; + +// The following tables are for tetrahedron primitives (operate on trifaces). + +// For 'org()', 'dest()' and 'apex()'. Use 'loc' as the first index and +// 'ver' as the second index. + +int tetgenmesh::locver2org[4][6] = { + {0, 1, 1, 2, 2, 0}, + {0, 3, 3, 1, 1, 0}, + {1, 3, 3, 2, 2, 1}, + {2, 3, 3, 0, 0, 2} +}; +int tetgenmesh::locver2dest[4][6] = { + {1, 0, 2, 1, 0, 2}, + {3, 0, 1, 3, 0, 1}, + {3, 1, 2, 3, 1, 2}, + {3, 2, 0, 3, 2, 0} +}; +int tetgenmesh::locver2apex[4][6] = { + {2, 2, 0, 0, 1, 1}, + {1, 1, 0, 0, 3, 3}, + {2, 2, 1, 1, 3, 3}, + {0, 0, 2, 2, 3, 3} +}; + +// For oppo() primitives, use 'loc' as the index. + +int tetgenmesh::loc2oppo[4] = { 3, 2, 0, 1 }; + +// For fnext() primitive. Use 'loc' as the first index and 'ver' as the +// second index. Returns a new 'loc' and new 'ver' in an array. (It is +// only valid for edge version equals one of {0, 2, 4}.) + +int tetgenmesh::locver2nextf[4][6][2] = { + { {1, 5}, {-1, -1}, {2, 5}, {-1, -1}, {3, 5}, {-1, -1} }, + { {3, 3}, {-1, -1}, {2, 1}, {-1, -1}, {0, 1}, {-1, -1} }, + { {1, 3}, {-1, -1}, {3, 1}, {-1, -1}, {0, 3}, {-1, -1} }, + { {2, 3}, {-1, -1}, {1, 1}, {-1, -1}, {0, 5}, {-1, -1} } +}; + +// The edge number (from 0 to 5) of a tet is defined as follows: +// 0 - (v0, v1), 1 - (v1, v2), 2 - (v2, v0) +// 3 - (v3, v0), 4 - (v3, v1), 5 - (v3, v2). + +int tetgenmesh::locver2edge[4][6] = { + {0, 0, 1, 1, 2, 2}, + {3, 3, 4, 4, 0, 0}, + {4, 4, 5, 5, 1, 1}, + {5, 5, 3, 3, 2, 2} +}; + +int tetgenmesh::edge2locver[6][2] = { + {0, 0}, // 0 v0 -> v1 (a -> b) + {0, 2}, // 1 v1 -> v2 (b -> c) + {0, 4}, // 2 v2 -> v0 (c -> a) + {1, 0}, // 3 v0 -> v3 (a -> d) + {1, 2}, // 4 v1 -> v3 (b -> d + {2, 2} // 5 v2 -> v3 (c -> d) +}; + +int tetgenmesh::locpivot[4][3] = { + {1, 2, 3}, + {0, 2, 3}, + {0, 1, 3}, + {0, 1, 2} +}; + +int tetgenmesh::locverpivot[4][6][2] = { + {{2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 2}, {1, 2}}, + {{0, 2}, {0, 2}, {0, 3}, {0, 3}, {2, 3}, {2, 3}}, + {{0, 3}, {0, 3}, {0, 1}, {0, 1}, {1, 3}, {1, 3}}, + {{0, 1}, {0, 1}, {0, 2}, {0, 2}, {1, 2}, {1, 2}} +}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// getnextsface() Finds the next subface in the face ring. // +// // +// For saving space in the data structure of subface, there only exists one // +// face ring around a segment (see programming manual). This routine imple- // +// ments the double face ring as desired in Muecke's data structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::getnextsface(face* s1, face* s2) +{ + face neighsh, spinsh; + face testseg; + + sspivot(*s1, testseg); + if (testseg.sh != dummysh) { + testseg.shver = 0; + if (sorg(testseg) == sorg(*s1)) { + spivot(*s1, neighsh); + } else { + spinsh = *s1; + do { + neighsh = spinsh; + spivotself(spinsh); + } while (spinsh.sh != s1->sh); + } + } else { + spivot(*s1, neighsh); + } + if (sorg(neighsh) != sorg(*s1)) { + sesymself(neighsh); + } + if (s2 != (face *) NULL) { + *s2 = neighsh; + } else { + *s1 = neighsh; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tsspivot() Finds a subsegment abutting on a tetrahderon's edge. // +// // +// The edge is represented in the primary edge of 'checkedge'. If there is a // +// subsegment bonded at this edge, it is returned in handle 'checkseg', the // +// edge direction of 'checkseg' is conformed to 'checkedge'. If there isn't, // +// set 'checkseg.sh = dummysh' to indicate it is not a subsegment. // +// // +// To find whether an edge of a tetrahedron is a subsegment or not. First we // +// need find a subface around this edge to see if it contains a subsegment. // +// The reason is there is no direct connection between a tetrahedron and its // +// adjoining subsegments. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::tsspivot(triface* checkedge, face* checkseg) +{ + triface spintet; + face parentsh; + point tapex; + int hitbdry; + + spintet = *checkedge; + tapex = apex(*checkedge); + hitbdry = 0; + do { + tspivot(spintet, parentsh); + // Does spintet have a (non-fake) subface attached? + if ((parentsh.sh != dummysh) && (sapex(parentsh) != NULL)) { + // Find a subface! Find the edge in it. + findedge(&parentsh, org(*checkedge), dest(*checkedge)); + sspivot(parentsh, *checkseg); + if (checkseg->sh != dummysh) { + // Find a subsegment! Correct its edge direction before return. + if (sorg(*checkseg) != org(*checkedge)) { + sesymself(*checkseg); + } + } + return; + } + if (!fnextself(spintet)) { + hitbdry++; + if (hitbdry < 2) { + esym(*checkedge, spintet); + if (!fnextself(spintet)) { + hitbdry++; + } + } + } + } while ((apex(spintet) != tapex) && (hitbdry < 2)); + // Not find. + checkseg->sh = dummysh; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// sstpivot() Finds a tetrahedron abutting a subsegment. // +// // +// This is the inverse operation of 'tsspivot()'. One subsegment shared by // +// arbitrary number of tetrahedron, the returned tetrahedron is not unique. // +// The edge direction of the returned tetrahedron is conformed to the given // +// subsegment. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::sstpivot(face* checkseg, triface* retedge) +{ + face parentsh; + + // Get the subface which holds the subsegment. + sdecode(checkseg->sh[0], parentsh); +#ifdef SELF_CHECK + assert(parentsh.sh != dummysh); +#endif + // Get a tetraheron to which the subface attches. + stpivot(parentsh, *retedge); + if (retedge->tet == dummytet) { + sesymself(parentsh); + stpivot(parentsh, *retedge); +#ifdef SELF_CHECK + assert(retedge->tet != dummytet); +#endif + } + // Correct the edge direction before return. + findedge(retedge, sorg(*checkseg), sdest(*checkseg)); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// point2tetorg(), point2shorg(), point2segorg() // +// // +// Return a tet, a subface, or a subsegment whose origin is the given point. // +// These routines assume the maps between points to tets (subfaces, segments // +// ) have been built and maintained. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::point2tetorg(point pa, triface& searchtet) +{ + int i; + + // Search a tet whose origin is pa. + decode(point2tet(pa), searchtet); + if (searchtet.tet == NULL) { + printf("Internal error: %d contains bad tet pointer.\n", pointmark(pa)); + terminatetetgen(2); + } + for (i = 4; i < 8; i++) { + if ((point) searchtet.tet[i] == pa) { + // Found. Set pa as its origin. + switch (i) { + case 4: searchtet.loc = 0; searchtet.ver = 0; break; + case 5: searchtet.loc = 0; searchtet.ver = 2; break; + case 6: searchtet.loc = 0; searchtet.ver = 4; break; + case 7: searchtet.loc = 1; searchtet.ver = 2; break; + } + break; + } + } + if (i == 8) { + printf("Internal error: %d contains bad tet pointer.\n", pointmark(pa)); + terminatetetgen(2); + } +} + +void tetgenmesh::point2shorg(point pa, face& searchsh) +{ + sdecode(point2sh(pa), searchsh); + if (searchsh.sh == NULL) { + printf("Internal error: %d contains bad sub pointer.\n", pointmark(pa)); + terminatetetgen(2); + } + if (((point) searchsh.sh[3]) == pa) { + searchsh.shver = 0; + } else if (((point) searchsh.sh[4]) == pa) { + searchsh.shver = 2; + } else if (((point) searchsh.sh[5]) == pa) { + searchsh.shver = 4; + } else { + printf("Internal error: %d contains bad sub pointer.\n", pointmark(pa)); + terminatetetgen(2); + } +} + +void tetgenmesh::point2segorg(point pa, face& searchsh) +{ + sdecode(point2seg(pa), searchsh); + if (searchsh.sh == NULL) { + printf("Internal error: %d contains bad seg pointer.\n", pointmark(pa)); + terminatetetgen(2); + } + if (((point) searchsh.sh[3]) == pa) { + searchsh.shver = 0; + } else if (((point) searchsh.sh[4]) == pa) { + searchsh.shver = 1; + } else { + printf("Internal error: %d contains bad sub pointer.\n", pointmark(pa)); + terminatetetgen(2); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// findorg() Find a point in the given tet or subface. // +// // +// If 'dorg' is a one of vertices of the given handle, set the origin of // +// this handle be that point and return TRUE. Otherwise, return FALSE and // +// 'tface' remains unchanged. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::findorg(triface* tface, point dorg) +{ + if (org(*tface) == dorg) { + return true; + } else { + if (dest(*tface) == dorg) { + enextself(*tface); + return true; + } else { + if (apex(*tface) == dorg) { + enext2self(*tface); + return true; + } else { + if (oppo(*tface) == dorg) { + // Keep 'tface' referring to the same tet after fnext(). + adjustedgering(*tface, CCW); + fnextself(*tface); + enext2self(*tface); + return true; + } + } + } + } + return false; +} + +bool tetgenmesh::findorg(face* sface, point dorg) +{ + if (sorg(*sface) == dorg) { + return true; + } else { + if (sdest(*sface) == dorg) { + senextself(*sface); + return true; + } else { + if (sapex(*sface) == dorg) { + senext2self(*sface); + return true; + } + } + } + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// findedge() Find an edge in the given tet or subface. // +// // +// The edge is given in two points 'eorg' and 'edest'. It is assumed that // +// the edge must exist in the given handle (tetrahedron or subface). This // +// routine sets the right edge version for the input handle. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::findedge(triface* tface, point eorg, point edest) +{ + int i; + + for (i = 0; i < 3; i++) { + if (org(*tface) == eorg) { + if (dest(*tface) == edest) { + // Edge is found, return. + return; + } + } else { + if (org(*tface) == edest) { + if (dest(*tface) == eorg) { + // Edge is found, inverse the direction and return. + esymself(*tface); + return; + } + } + } + enextself(*tface); + } + // It should never be here. + printf("Internalerror in findedge(): Unable to find an edge in tet.\n"); + terminatetetgen(2); +} + +void tetgenmesh::findedge(face* sface, point eorg, point edest) +{ + int i; + + for (i = 0; i < 3; i++) { + if (sorg(*sface) == eorg) { + if (sdest(*sface) == edest) { + // Edge is found, return. + return; + } + } else { + if (sorg(*sface) == edest) { + if (sdest(*sface) == eorg) { + // Edge is found, inverse the direction and return. + sesymself(*sface); + return; + } + } + } + senextself(*sface); + } + printf("Internalerror in findedge(): Unable to find an edge in subface.\n"); + terminatetetgen(2); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getonextseg() Get the next segment counterclockwise with the same org. // +// // +// 's' is a subface. This routine reteuns the segment which is counterclock- // +// wise with the origin of s. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::getonextseg(face* s, face* lseg) +{ + face checksh, checkseg; + point forg; + + forg = sorg(*s); + checksh = *s; + do { + // Go to the edge at forg's left side. + senext2self(checksh); + // Check if there is a segment attaching this edge. + sspivot(checksh, checkseg); + if (checkseg.sh != dummysh) break; + // No segment! Go to the neighbor of this subface. + spivotself(checksh); +#ifdef SELF_CHECK + // It should always meet a segment before come back. + assert(checksh.sh != s->sh); +#endif + if (sorg(checksh) != forg) { + sesymself(checksh); +#ifdef SELF_CHECK + assert(sorg(checksh) == forg); +#endif + } + } while (true); + if (sorg(checkseg) != forg) sesymself(checkseg); + *lseg = checkseg; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getseghasorg() Get the segment containing the given point. // +// // +// 'dorg' is an endpoint of a segment S. 'sseg' is a subsegment of S. This // +// routine search a subsegment (along sseg) of S containing dorg. On return, // +// 'sseg' contains 'dorg' as its origin. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::getseghasorg(face* sseg, point dorg) +{ + face nextseg; + point checkpt; + + nextseg = *sseg; + checkpt = sorg(nextseg); + while ((checkpt != dorg) && (pointtype(checkpt) == FREESEGVERTEX)) { + // Search dorg along the original direction of sseg. + senext2self(nextseg); + spivotself(nextseg); + nextseg.shver = 0; + if (sdest(nextseg) != checkpt) sesymself(nextseg); + checkpt = sorg(nextseg); + } + if (checkpt == dorg) { + *sseg = nextseg; + return; + } + nextseg = *sseg; + checkpt = sdest(nextseg); + while ((checkpt != dorg) && (pointtype(checkpt) == FREESEGVERTEX)) { + // Search dorg along the destinational direction of sseg. + senextself(nextseg); + spivotself(nextseg); + nextseg.shver = 0; + if (sorg(nextseg) != checkpt) sesymself(nextseg); + checkpt = sdest(nextseg); + } + if (checkpt == dorg) { + sesym(nextseg, *sseg); + return; + } + // Should never be here. + printf("Internalerror in getseghasorg(): Unable to find the subseg.\n"); + terminatetetgen(2); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getsubsegfarorg() Get the origin of the parent segment of a subseg. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::point tetgenmesh::getsubsegfarorg(face* sseg) +{ + face prevseg; + point checkpt; + + checkpt = sorg(*sseg); + senext2(*sseg, prevseg); + spivotself(prevseg); + // Search dorg along the original direction of sseg. + while (prevseg.sh != dummysh) { + prevseg.shver = 0; + if (sdest(prevseg) != checkpt) sesymself(prevseg); + checkpt = sorg(prevseg); + senext2self(prevseg); + spivotself(prevseg); + } + return checkpt; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getsubsegfardest() Get the dest. of the parent segment of a subseg. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::point tetgenmesh::getsubsegfardest(face* sseg) +{ + face nextseg; + point checkpt; + + checkpt = sdest(*sseg); + senext(*sseg, nextseg); + spivotself(nextseg); + // Search dorg along the destinational direction of sseg. + while (nextseg.sh != dummysh) { + nextseg.shver = 0; + if (sorg(nextseg) != checkpt) sesymself(nextseg); + checkpt = sdest(nextseg); + senextself(nextseg); + spivotself(nextseg); + } + return checkpt; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// printtet() Print out the details of a tetrahedron on screen. // +// // +// It's also used when the highest level of verbosity (`-VVV') is specified. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::printtet(triface* tface) +{ + triface tmpface, prtface; + shellface *shells; + point tmppt; + face checksh; + int facecount; + + printf("Tetra x%lx with loc(%i) and ver(%i):", + (uintptr_t)(tface->tet), tface->loc, tface->ver); + if (infected(*tface)) { + printf(" (infected)"); + } + if (marktested(*tface)) { + printf(" (marked)"); + } + printf("\n"); + + tmpface = *tface; + facecount = 0; + while(facecount < 4) { + tmpface.loc = facecount; + sym(tmpface, prtface); + if(prtface.tet == dummytet) { + printf(" [%i] Outer space.\n", facecount); + } else { + if (!isdead(&prtface)) { + printf(" [%i] x%lx loc(%i).", facecount, + (uintptr_t)(prtface.tet), prtface.loc); + if (infected(prtface)) { + printf(" (infected)"); + } + printf("\n"); + } else { + printf(" [%i] NULL\n", facecount); + } + } + facecount ++; + } + + tmppt = org(*tface); + if(tmppt == (point) NULL) { + printf(" Org [%i] NULL\n", locver2org[tface->loc][tface->ver]); + } else { + printf(" Org [%i] x%lx (%.12g,%.12g,%.12g) %d\n", + locver2org[tface->loc][tface->ver], (uintptr_t)(tmppt), + tmppt[0], tmppt[1], tmppt[2], pointmark(tmppt)); + } + tmppt = dest(*tface); + if(tmppt == (point) NULL) { + printf(" Dest[%i] NULL\n", locver2dest[tface->loc][tface->ver]); + } else { + printf(" Dest[%i] x%lx (%.12g,%.12g,%.12g) %d\n", + locver2dest[tface->loc][tface->ver], (uintptr_t)(tmppt), + tmppt[0], tmppt[1], tmppt[2], pointmark(tmppt)); + } + tmppt = apex(*tface); + if(tmppt == (point) NULL) { + printf(" Apex[%i] NULL\n", locver2apex[tface->loc][tface->ver]); + } else { + printf(" Apex[%i] x%lx (%.12g,%.12g,%.12g) %d\n", + locver2apex[tface->loc][tface->ver], (uintptr_t)(tmppt), + tmppt[0], tmppt[1], tmppt[2], pointmark(tmppt)); + } + tmppt = oppo(*tface); + if(tmppt == (point) NULL) { + printf(" Oppo[%i] NULL\n", loc2oppo[tface->loc]); + } else { + printf(" Oppo[%i] x%lx (%.12g,%.12g,%.12g) %d\n", + loc2oppo[tface->loc], (uintptr_t)(tmppt), + tmppt[0], tmppt[1], tmppt[2], pointmark(tmppt)); + } + + if (b->useshelles) { + if (tface->tet[8] != NULL) { + shells = (shellface *) tface->tet[8]; + for (facecount = 0; facecount < 6; facecount++) { + sdecode(shells[facecount], checksh); + if (checksh.sh != dummysh) { + printf(" [%d] x%lx %d.", facecount, (uintptr_t) checksh.sh, + checksh.shver); + } else { + printf(" [%d] NULL.", facecount); + } + if (locver2edge[tface->loc][tface->ver] == facecount) { + printf(" (*)"); // It is the current edge. + } + printf("\n"); + } + } + if (tface->tet[9] != NULL) { + shells = (shellface *) tface->tet[9]; + for (facecount = 0; facecount < 4; facecount++) { + sdecode(shells[facecount], checksh); + if (checksh.sh != dummysh) { + printf(" [%d] x%lx %d.", facecount, (uintptr_t) checksh.sh, + checksh.shver); + } else { + printf(" [%d] NULL.", facecount); + } + if (tface->loc == facecount) { + printf(" (*)"); // It is the current face. + } + printf("\n"); + } + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// printsh() Print out the details of a subface or subsegment on screen. // +// // +// It's also used when the highest level of verbosity (`-VVV') is specified. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::printsh(face* sface) +{ + face prtsh; + triface prttet; + point printpoint; + + if (sapex(*sface) != NULL) { + printf("subface x%lx, ver %d, mark %d:", + (uintptr_t)(sface->sh), sface->shver, shellmark(*sface)); + } else { + printf("Subsegment x%lx, ver %d, mark %d:", + (uintptr_t)(sface->sh), sface->shver, shellmark(*sface)); + } + if (sinfected(*sface)) { + printf(" (infected)"); + } + if (smarktested(*sface)) { + printf(" (marked)"); + } + if (shell2badface(*sface)) { + printf(" (queued)"); + } + if (sapex(*sface) != NULL) { + if (shelltype(*sface) == SHARP) { + printf(" (sharp)"); + } + } else { + if (shelltype(*sface) == SHARP) { + printf(" (sharp)"); + } + } + if (checkpbcs) { + if (shellpbcgroup(*sface) >= 0) { + printf(" (pbc %d)", shellpbcgroup(*sface)); + } + } + printf("\n"); + + sdecode(sface->sh[0], prtsh); + if (prtsh.sh == dummysh) { + printf(" [0] = No shell\n"); + } else { + printf(" [0] = x%lx %d\n", (uintptr_t)(prtsh.sh), prtsh.shver); + } + sdecode(sface->sh[1], prtsh); + if (prtsh.sh == dummysh) { + printf(" [1] = No shell\n"); + } else { + printf(" [1] = x%lx %d\n", (uintptr_t)(prtsh.sh), prtsh.shver); + } + sdecode(sface->sh[2], prtsh); + if (prtsh.sh == dummysh) { + printf(" [2] = No shell\n"); + } else { + printf(" [2] = x%lx %d\n", (uintptr_t)(prtsh.sh), prtsh.shver); + } + + printpoint = sorg(*sface); + if (printpoint == (point) NULL) + printf(" Org [%d] = NULL\n", vo[sface->shver]); + else + printf(" Org [%d] = x%lx (%.12g,%.12g,%.12g) %d\n", + vo[sface->shver], (uintptr_t)(printpoint), printpoint[0], + printpoint[1], printpoint[2], pointmark(printpoint)); + printpoint = sdest(*sface); + if (printpoint == (point) NULL) + printf(" Dest[%d] = NULL\n", vd[sface->shver]); + else + printf(" Dest[%d] = x%lx (%.12g,%.12g,%.12g) %d\n", + vd[sface->shver], (uintptr_t)(printpoint), printpoint[0], + printpoint[1], printpoint[2], pointmark(printpoint)); + + if (sapex(*sface) != NULL) { + printpoint = sapex(*sface); + if (printpoint == (point) NULL) + printf(" Apex[%d] = NULL\n", va[sface->shver]); + else + printf(" Apex[%d] = x%lx (%.12g,%.12g,%.12g) %d\n", + va[sface->shver], (uintptr_t)(printpoint), printpoint[0], + printpoint[1], printpoint[2], pointmark(printpoint)); + + decode(sface->sh[6], prttet); + if (prttet.tet == dummytet) { + printf(" [6] = Outer space\n"); + } else { + printf(" [6] = x%lx %d\n", + (uintptr_t)(prttet.tet), prttet.loc); + } + decode(sface->sh[7], prttet); + if (prttet.tet == dummytet) { + printf(" [7] = Outer space\n"); + } else { + printf(" [7] = x%lx %d\n", + (uintptr_t)(prttet.tet), prttet.loc); + } + + sdecode(sface->sh[8], prtsh); + if (prtsh.sh == dummysh) { + printf(" [8] = No subsegment\n"); + } else { + printf(" [8] = x%lx %d\n", + (uintptr_t)(prtsh.sh), prtsh.shver); + } + sdecode(sface->sh[9], prtsh); + if (prtsh.sh == dummysh) { + printf(" [9] = No subsegment\n"); + } else { + printf(" [9] = x%lx %d\n", + (uintptr_t)(prtsh.sh), prtsh.shver); + } + sdecode(sface->sh[10], prtsh); + if (prtsh.sh == dummysh) { + printf(" [10]= No subsegment\n"); + } else { + printf(" [10]= x%lx %d\n", + (uintptr_t)(prtsh.sh), prtsh.shver); + } + } +} + +//// //// +//// //// +//// prim_cxx ///////////////////////////////////////////////////////////////// + +//// mempool_cxx ////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// restart() Deallocate all objects in this pool. // +// // +// The pool returns to a fresh state, like after it was initialized, except // +// that no memory is freed to the operating system. Rather, the previously // +// allocated blocks are ready to be used. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::arraypool::restart() +{ + objects = 0l; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// poolinit() Initialize an arraypool for allocation of objects. // +// // +// Before the pool may be used, it must be initialized by this procedure. // +// After initialization, memory can be allocated and freed in this pool. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::arraypool::poolinit(int sizeofobject, int log2objperblk) +{ + // Each object must be at least one byte long. + objectbytes = sizeofobject > 1 ? sizeofobject : 1; + + log2objectsperblock = log2objperblk; + // Compute the number of objects in each block. + objectsperblock = ((int) 1) << log2objectsperblock; + + // No memory has been allocated. + totalmemory = 0l; + // The top array has not been allocated yet. + toparray = (char **) NULL; + toparraylen = 0; + + // Ready all indices to be allocated. + restart(); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// arraypool() The constructor and destructor. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::arraypool::arraypool(int sizeofobject, int log2objperblk) +{ + poolinit(sizeofobject, log2objperblk); +} + +tetgenmesh::arraypool::~arraypool() +{ + int i; + + // Has anything been allocated at all? + if (toparray != (char **) NULL) { + // Walk through the top array. + for (i = 0; i < toparraylen; i++) { + // Check every pointer; NULLs may be scattered randomly. + if (toparray[i] != (char *) NULL) { + // Free an allocated block. + free((void *) toparray[i]); + } + } + // Free the top array. + free((void *) toparray); + } + + // The top array is no longer allocated. + toparray = (char **) NULL; + toparraylen = 0; + objects = 0; + totalmemory = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getblock() Return (and perhaps create) the block containing the object // +// with a given index. // +// // +// This function takes care of allocating or resizing the top array if nece- // +// ssary, and of allocating the block if it hasn't yet been allocated. // +// // +// Return a pointer to the beginning of the block (NOT the object). // +// // +/////////////////////////////////////////////////////////////////////////////// + +char* tetgenmesh::arraypool::getblock(int objectindex) +{ + char **newarray; + char *block; + int newsize; + int topindex; + int i; + + // Compute the index in the top array (upper bits). + topindex = objectindex >> log2objectsperblock; + // Does the top array need to be allocated or resized? + if (toparray == (char **) NULL) { + // Allocate the top array big enough to hold 'topindex', and NULL out + // its contents. + newsize = topindex + 128; + toparray = (char **) malloc((size_t) (newsize * sizeof(char *))); + toparraylen = newsize; + for (i = 0; i < newsize; i++) { + toparray[i] = (char *) NULL; + } + // Account for the memory. + totalmemory = newsize * (unsigned long) sizeof(char *); + } else if (topindex >= toparraylen) { + // Resize the top array, making sure it holds 'topindex'. + newsize = 3 * toparraylen; + if (topindex >= newsize) { + newsize = topindex + 128; + } + // Allocate the new array, copy the contents, NULL out the rest, and + // free the old array. + newarray = (char **) malloc((size_t) (newsize * sizeof(char *))); + for (i = 0; i < toparraylen; i++) { + newarray[i] = toparray[i]; + } + for (i = toparraylen; i < newsize; i++) { + newarray[i] = (char *) NULL; + } + free(toparray); + // Account for the memory. + totalmemory += (newsize - toparraylen) * sizeof(char *); + toparray = newarray; + toparraylen = newsize; + } + + // Find the block, or learn that it hasn't been allocated yet. + block = toparray[topindex]; + if (block == (char *) NULL) { + // Allocate a block at this index. + block = (char *) malloc((size_t) (objectsperblock * objectbytes)); + toparray[topindex] = block; + // Account for the memory. + totalmemory += objectsperblock * objectbytes; + } + + // Return a pointer to the block. + return block; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// lookup() Return the pointer to the object with a given index, or NULL // +// if the object's block doesn't exist yet. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void* tetgenmesh::arraypool::lookup(int objectindex) +{ + char *block; + int topindex; + + // Has the top array been allocated yet? + if (toparray == (char **) NULL) { + return (void *) NULL; + } + + // Compute the index in the top array (upper bits). + topindex = objectindex >> log2objectsperblock; + // Does the top index fit in the top array? + if (topindex >= toparraylen) { + return (void *) NULL; + } + + // Find the block, or learn that it hasn't been allocated yet. + block = toparray[topindex]; + if (block == (char *) NULL) { + return (void *) NULL; + } + + // Compute a pointer to the object with the given index. Note that + // 'objectsperblock' is a power of two, so the & operation is a bit mask + // that preserves the lower bits. + return (void *)(block + (objectindex & (objectsperblock - 1)) * objectbytes); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// newindex() Allocate space for a fresh object from the pool. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::arraypool::newindex(void **newptr) +{ + void *newobject; + int newindex; + + // Allocate an object at index 'firstvirgin'. + newindex = objects; + newobject = (void *) (getblock(objects) + + (objects & (objectsperblock - 1)) * objectbytes); + objects++; + + // If 'newptr' is not NULL, use it to return a pointer to the object. + if (newptr != (void **) NULL) { + *newptr = newobject; + } + return newindex; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// listinit() Initialize a list for storing a data type. // +// // +// Determine the size of each item, set the maximum size allocated at onece, // +// set the expand size in case the list is full, and set the linear order // +// function if it is provided (default is NULL). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::list::listinit(int itbytes, compfunc pcomp, int mitems, + int exsize) +{ + itembytes = itbytes; + comp = pcomp; + maxitems = mitems; + expandsize = exsize; + base = (char *) malloc(maxitems * itembytes); + if (base == (char *) NULL) { + terminatetetgen(1); + } + items = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// append() Add a new item at the end of the list. // +// // +// A new space at the end of this list will be allocated for storing the new // +// item. If the memory is not sufficient, reallocation will be performed. If // +// 'appitem' is not NULL, the contents of this pointer will be copied to the // +// new allocated space. Returns the pointer to the new allocated space. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void* tetgenmesh::list::append(void *appitem) +{ + // Do we have enough space? + if (items == maxitems) { + char* newbase = (char *) realloc(base, (maxitems + expandsize) * + itembytes); + if (newbase == (char *) NULL) { + terminatetetgen(1); + } + base = newbase; + maxitems += expandsize; + } + if (appitem != (void *) NULL) { + memcpy(base + items * itembytes, appitem, itembytes); + } + items++; + return (void *) (base + (items - 1) * itembytes); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// insert() Insert an item before 'pos' (range from 0 to items - 1). // +// // +// A new space will be inserted at the position 'pos', that is, items lie // +// after pos (including the item at pos) will be moved one space downwords. // +// If 'insitem' is not NULL, its contents will be copied into the new // +// inserted space. Return a pointer to the new inserted space. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void* tetgenmesh::list::insert(int pos, void* insitem) +{ + if (pos >= items) { + return append(insitem); + } + // Do we have enough space. + if (items == maxitems) { + char* newbase = (char *) realloc(base, (maxitems + expandsize) * + itembytes); + if (newbase == (char *) NULL) { + terminatetetgen(1); + } + base = newbase; + maxitems += expandsize; + } + // Do block move. + memmove(base + (pos + 1) * itembytes, // dest + base + pos * itembytes, // src + (items - pos) * itembytes); // size in bytes + // Insert the item. + if (insitem != (void *) NULL) { + memcpy(base + pos * itembytes, insitem, itembytes); + } + items++; + return (void *) (base + pos * itembytes); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// del() Delete an item at 'pos' (range from 0 to items - 1). // +// // +// The space at 'pos' will be overlapped by other item. If 'order' is 1, the // +// remaining items of the list have the same order as usual, i.e., items lie // +// after pos will be moved one space upwords. If 'order' is 0, the last item // +// of the list will be moved up to pos. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::list::del(int pos, int order) +{ + // If 'pos' is the last item of the list, nothing need to do. + if (pos >= 0 && pos < items - 1) { + if (order == 1) { + // Do block move. + memmove(base + pos * itembytes, // dest + base + (pos + 1) * itembytes, // src + (items - pos - 1) * itembytes); + } else { + // Use the last item to overlap the del item. + memcpy(base + pos * itembytes, // item at pos + base + (items - 1) * itembytes, // item at last + itembytes); + } + } + if (items > 0) { + items--; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// hasitem() Search in this list to find if 'checkitem' exists. // +// // +// This routine assumes that a linear order function has been set. It loops // +// through the entire list, compares each item to 'checkitem'. If it exists, // +// return its position (between 0 to items - 1), otherwise, return -1. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::list::hasitem(void* checkitem) +{ + int i; + + for (i = 0; i < items; i++) { + if (comp != (compfunc) NULL) { + if ((* comp)((void *)(base + i * itembytes), checkitem) == 0) { + return i; + } + } + } + return -1; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// memorypool() The constructors of memorypool. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::memorypool::memorypool() +{ + firstblock = nowblock = (void **) NULL; + nextitem = (void *) NULL; + deaditemstack = (void *) NULL; + pathblock = (void **) NULL; + pathitem = (void *) NULL; + itemwordtype = POINTER; + alignbytes = 0; + itembytes = itemwords = 0; + itemsperblock = 0; + items = maxitems = 0l; + unallocateditems = 0; + pathitemsleft = 0; +} + +tetgenmesh::memorypool:: +memorypool(int bytecount, int itemcount, enum wordtype wtype, int alignment) +{ + poolinit(bytecount, itemcount, wtype, alignment); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// ~memorypool() Free to the operating system all memory taken by a pool. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::memorypool::~memorypool() +{ + while (firstblock != (void **) NULL) { + nowblock = (void **) *(firstblock); + free(firstblock); + firstblock = nowblock; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// poolinit() Initialize a pool of memory for allocation of items. // +// // +// A `pool' is created whose records have size at least `bytecount'. Items // +// will be allocated in `itemcount'-item blocks. Each item is assumed to be // +// a collection of words, and either pointers or floating-point values are // +// assumed to be the "primary" word type. (The "primary" word type is used // +// to determine alignment of items.) If `alignment' isn't zero, all items // +// will be `alignment'-byte aligned in memory. `alignment' must be either a // +// multiple or a factor of the primary word size; powers of two are safe. // +// `alignment' is normally used to create a few unused bits at the bottom of // +// each item's pointer, in which information may be stored. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::memorypool:: +poolinit(int bytecount, int itemcount, enum wordtype wtype, int alignment) +{ + int wordsize; + + // Initialize values in the pool. + itemwordtype = wtype; + wordsize = (itemwordtype == POINTER) ? sizeof(void *) : sizeof(REAL); + // Find the proper alignment, which must be at least as large as: + // - The parameter `alignment'. + // - The primary word type, to avoid unaligned accesses. + // - sizeof(void *), so the stack of dead items can be maintained + // without unaligned accesses. + if (alignment > wordsize) { + alignbytes = alignment; + } else { + alignbytes = wordsize; + } + if ((int) sizeof(void *) > alignbytes) { + alignbytes = (int) sizeof(void *); + } + itemwords = ((bytecount + alignbytes - 1) / alignbytes) + * (alignbytes / wordsize); + itembytes = itemwords * wordsize; + itemsperblock = itemcount; + + // Allocate a block of items. Space for `itemsperblock' items and one + // pointer (to point to the next block) are allocated, as well as space + // to ensure alignment of the items. + firstblock = (void **) malloc(itemsperblock * itembytes + sizeof(void *) + + alignbytes); + if (firstblock == (void **) NULL) { + terminatetetgen(1); + } + // Set the next block pointer to NULL. + *(firstblock) = (void *) NULL; + restart(); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// restart() Deallocate all items in this pool. // +// // +// The pool is returned to its starting state, except that no memory is // +// freed to the operating system. Rather, the previously allocated blocks // +// are ready to be reused. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::memorypool::restart() +{ + // unsigned long alignptr; + uintptr_t alignptr; + + items = 0; + maxitems = 0; + + // Set the currently active block. + nowblock = firstblock; + // Find the first item in the pool. Increment by the size of (void *). + // alignptr = (unsigned long) (nowblock + 1); + alignptr = (uintptr_t) (nowblock + 1); + // Align the item on an `alignbytes'-byte boundary. + // nextitem = (void *) + // (alignptr + (unsigned long) alignbytes - + // (alignptr % (unsigned long) alignbytes)); + nextitem = (void *) + (alignptr + (uintptr_t) alignbytes - + (alignptr % (uintptr_t) alignbytes)); + // There are lots of unallocated items left in this block. + unallocateditems = itemsperblock; + // The stack of deallocated items is empty. + deaditemstack = (void *) NULL; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// alloc() Allocate space for an item. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void* tetgenmesh::memorypool::alloc() +{ + void *newitem; + void **newblock; + // unsigned long alignptr; + uintptr_t alignptr; + + // First check the linked list of dead items. If the list is not + // empty, allocate an item from the list rather than a fresh one. + if (deaditemstack != (void *) NULL) { + newitem = deaditemstack; // Take first item in list. + deaditemstack = * (void **) deaditemstack; + } else { + // Check if there are any free items left in the current block. + if (unallocateditems == 0) { + // Check if another block must be allocated. + if (*nowblock == (void *) NULL) { + // Allocate a new block of items, pointed to by the previous block. + newblock = (void **) malloc(itemsperblock * itembytes + sizeof(void *) + + alignbytes); + if (newblock == (void **) NULL) { + terminatetetgen(1); + } + *nowblock = (void *) newblock; + // The next block pointer is NULL. + *newblock = (void *) NULL; + } + // Move to the new block. + nowblock = (void **) *nowblock; + // Find the first item in the block. + // Increment by the size of (void *). + // alignptr = (unsigned long) (nowblock + 1); + alignptr = (uintptr_t) (nowblock + 1); + // Align the item on an `alignbytes'-byte boundary. + // nextitem = (void *) + // (alignptr + (unsigned long) alignbytes - + // (alignptr % (unsigned long) alignbytes)); + nextitem = (void *) + (alignptr + (uintptr_t) alignbytes - + (alignptr % (uintptr_t) alignbytes)); + // There are lots of unallocated items left in this block. + unallocateditems = itemsperblock; + } + // Allocate a new item. + newitem = nextitem; + // Advance `nextitem' pointer to next free item in block. + if (itemwordtype == POINTER) { + nextitem = (void *) ((void **) nextitem + itemwords); + } else { + nextitem = (void *) ((REAL *) nextitem + itemwords); + } + unallocateditems--; + maxitems++; + } + items++; + return newitem; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// dealloc() Deallocate space for an item. // +// // +// The deallocated space is stored in a queue for later reuse. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::memorypool::dealloc(void *dyingitem) +{ + // Push freshly killed item onto stack. + *((void **) dyingitem) = deaditemstack; + deaditemstack = dyingitem; + items--; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// traversalinit() Prepare to traverse the entire list of items. // +// // +// This routine is used in conjunction with traverse(). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::memorypool::traversalinit() +{ + // unsigned long alignptr; + uintptr_t alignptr; + + // Begin the traversal in the first block. + pathblock = firstblock; + // Find the first item in the block. Increment by the size of (void *). + // alignptr = (unsigned long) (pathblock + 1); + alignptr = (uintptr_t) (pathblock + 1); + // Align with item on an `alignbytes'-byte boundary. + // pathitem = (void *) + // (alignptr + (unsigned long) alignbytes - + // (alignptr % (unsigned long) alignbytes)); + pathitem = (void *) + (alignptr + (uintptr_t) alignbytes - + (alignptr % (uintptr_t) alignbytes)); + // Set the number of items left in the current block. + pathitemsleft = itemsperblock; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// traverse() Find the next item in the list. // +// // +// This routine is used in conjunction with traversalinit(). Be forewarned // +// that this routine successively returns all items in the list, including // +// deallocated ones on the deaditemqueue. It's up to you to figure out which // +// ones are actually dead. It can usually be done more space-efficiently by // +// a routine that knows something about the structure of the item. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void* tetgenmesh::memorypool::traverse() +{ + void *newitem; + // unsigned long alignptr; + uintptr_t alignptr; + + // Stop upon exhausting the list of items. + if (pathitem == nextitem) { + return (void *) NULL; + } + // Check whether any untraversed items remain in the current block. + if (pathitemsleft == 0) { + // Find the next block. + pathblock = (void **) *pathblock; + // Find the first item in the block. Increment by the size of (void *). + // alignptr = (unsigned long) (pathblock + 1); + alignptr = (uintptr_t) (pathblock + 1); + // Align with item on an `alignbytes'-byte boundary. + // pathitem = (void *) + // (alignptr + (unsigned long) alignbytes - + // (alignptr % (unsigned long) alignbytes)); + pathitem = (void *) + (alignptr + (uintptr_t) alignbytes - + (alignptr % (uintptr_t) alignbytes)); + // Set the number of items left in the current block. + pathitemsleft = itemsperblock; + } + newitem = pathitem; + // Find the next item in the block. + if (itemwordtype == POINTER) { + pathitem = (void *) ((void **) pathitem + itemwords); + } else { + pathitem = (void *) ((REAL *) pathitem + itemwords); + } + pathitemsleft--; + return newitem; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// makepoint2tetmap() Construct a mapping from points to tetrahedra. // +// // +// Traverses all the tetrahedra, provides each corner of each tetrahedron // +// with a pointer to that tetrahedera. Some pointers will be overwritten by // +// other pointers because each point may be a corner of several tetrahedra, // +// but in the end every point will point to a tetrahedron that contains it. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::makepoint2tetmap() +{ + triface tetloop; + point pointptr; + + if (b->verbose > 2) { + printf(" Constructing mapping from points to tetrahedra.\n"); + } + + // Initialize the point2tet field of each point. + points->traversalinit(); + pointptr = pointtraverse(); + while (pointptr != (point) NULL) { + setpoint2tet(pointptr, (tetrahedron) NULL); + pointptr = pointtraverse(); + } + + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Check all four points of the tetrahedron. + tetloop.loc = 0; + pointptr = org(tetloop); + setpoint2tet(pointptr, encode(tetloop)); + pointptr = dest(tetloop); + setpoint2tet(pointptr, encode(tetloop)); + pointptr = apex(tetloop); + setpoint2tet(pointptr, encode(tetloop)); + pointptr = oppo(tetloop); + setpoint2tet(pointptr, encode(tetloop)); + // Get the next tetrahedron in the list. + tetloop.tet = tetrahedrontraverse(); + } +} + +void tetgenmesh::makepoint2segmap() +{ + face segloop; + point *ppt; + + if (b->verbose > 2) { + printf(" Constructing mapping from points to segments.\n"); + } + + segloop.shver = 0; + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != NULL) { + ppt = (point *) &(segloop.sh[3]); + setpoint2seg(ppt[0], sencode(segloop)); + setpoint2seg(ppt[1], sencode(segloop)); + segloop.sh = shellfacetraverse(subsegs); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// makeindex2pointmap() Create a map from index to vertices. // +// // +// 'idx2verlist' returns the created map. Traverse all vertices, a pointer // +// to each vertex is set into the array. The pointer to the first vertex is // +// saved in 'idx2verlist[0]'. Don't forget to minus 'in->firstnumber' when // +// to get the vertex form its index. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::makeindex2pointmap(point*& idx2verlist) +{ + point pointloop; + int idx; + + if (b->verbose > 1) { + printf(" Constructing mapping from indices to points.\n"); + } + + idx2verlist = new point[points->items]; + + points->traversalinit(); + pointloop = pointtraverse(); + idx = 0; + while (pointloop != (point) NULL) { + idx2verlist[idx] = pointloop; + idx++; + pointloop = pointtraverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// makesegmentmap(), makesubfacemap(), maketetrahedronmap() // +// // +// Create a map from vertex indices to segments, subfaces, and tetrahedra // +// sharing at the same vertices. // +// // +// The map is stored in two arrays: 'idx2___list' and '___sperverlist', they // +// form a sparse matrix whose size is (n+1)x(n+1), where n is the number of // +// segments, subfaces, or tetrahedra. 'idx2___list' contains row information // +// and '___sperverlist' contains all non-zero elements. The i-th entry of // +// 'idx2___list' is the starting position of i-th row's non-zero elements in // +// '___sperverlist'. The number of elements of i-th row is (i+1)-th entry // +// minus i-th entry of 'idx2___list'. // +// // +// NOTE: These two arrays will be created inside this routine, don't forget // +// to free them after using. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::makesegmentmap(int*& idx2seglist, shellface**& segsperverlist) +{ + shellface *shloop; + int i, j, k; + + if (b->verbose > 1) { + printf(" Constructing mapping from points to segments.\n"); + } + + // Create and initialize 'idx2seglist'. + idx2seglist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) idx2seglist[i] = 0; + + // Loop the set of segments once, counter the number of segments sharing + // each vertex. + subsegs->traversalinit(); + shloop = shellfacetraverse(subsegs); + while (shloop != (shellface *) NULL) { + // Increment the number of sharing segments for each endpoint. + for (i = 0; i < 2; i++) { + j = pointmark((point) shloop[3 + i]) - in->firstnumber; + idx2seglist[j]++; + } + shloop = shellfacetraverse(subsegs); + } + + // Calculate the total length of array 'facesperverlist'. + j = idx2seglist[0]; + idx2seglist[0] = 0; // Array starts from 0 element. + for (i = 0; i < points->items; i++) { + k = idx2seglist[i + 1]; + idx2seglist[i + 1] = idx2seglist[i] + j; + j = k; + } + // The total length is in the last unit of idx2seglist. + segsperverlist = new shellface*[idx2seglist[i]]; + // Loop the set of segments again, set the info. of segments per vertex. + subsegs->traversalinit(); + shloop = shellfacetraverse(subsegs); + while (shloop != (shellface *) NULL) { + for (i = 0; i < 2; i++) { + j = pointmark((point) shloop[3 + i]) - in->firstnumber; + segsperverlist[idx2seglist[j]] = shloop; + idx2seglist[j]++; + } + shloop = shellfacetraverse(subsegs); + } + // Contents in 'idx2seglist' are shifted, now shift them back. + for (i = points->items - 1; i >= 0; i--) { + idx2seglist[i + 1] = idx2seglist[i]; + } + idx2seglist[0] = 0; +} + +void tetgenmesh::makesubfacemap(int*& idx2facelist, + shellface**& facesperverlist) +{ + shellface *shloop; + int i, j, k; + + if (b->verbose > 1) { + printf(" Constructing mapping from points to subfaces.\n"); + } + + // Create and initialize 'idx2facelist'. + idx2facelist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) idx2facelist[i] = 0; + + // Loop the set of subfaces once, counter the number of subfaces sharing + // each vertex. + subfaces->traversalinit(); + shloop = shellfacetraverse(subfaces); + while (shloop != (shellface *) NULL) { + // Increment the number of sharing segments for each endpoint. + for (i = 0; i < 3; i++) { + j = pointmark((point) shloop[3 + i]) - in->firstnumber; + idx2facelist[j]++; + } + shloop = shellfacetraverse(subfaces); + } + + // Calculate the total length of array 'facesperverlist'. + j = idx2facelist[0]; + idx2facelist[0] = 0; // Array starts from 0 element. + for (i = 0; i < points->items; i++) { + k = idx2facelist[i + 1]; + idx2facelist[i + 1] = idx2facelist[i] + j; + j = k; + } + // The total length is in the last unit of idx2facelist. + facesperverlist = new shellface*[idx2facelist[i]]; + // Loop the set of segments again, set the info. of segments per vertex. + subfaces->traversalinit(); + shloop = shellfacetraverse(subfaces); + while (shloop != (shellface *) NULL) { + for (i = 0; i < 3; i++) { + j = pointmark((point) shloop[3 + i]) - in->firstnumber; + facesperverlist[idx2facelist[j]] = shloop; + idx2facelist[j]++; + } + shloop = shellfacetraverse(subfaces); + } + // Contents in 'idx2facelist' are shifted, now shift them back. + for (i = points->items - 1; i >= 0; i--) { + idx2facelist[i + 1] = idx2facelist[i]; + } + idx2facelist[0] = 0; +} + +void tetgenmesh::maketetrahedronmap(int*& idx2tetlist, + tetrahedron**& tetsperverlist) +{ + tetrahedron *tetloop; + int i, j, k; + + if (b->verbose > 1) { + printf(" Constructing mapping from points to tetrahedra.\n"); + } + + // Create and initialize 'idx2tetlist'. + idx2tetlist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) idx2tetlist[i] = 0; + + // Loop the set of tetrahedra once, counter the number of tetrahedra + // sharing each vertex. + tetrahedrons->traversalinit(); + tetloop = tetrahedrontraverse(); + while (tetloop != (tetrahedron *) NULL) { + // Increment the number of sharing tetrahedra for each endpoint. + for (i = 0; i < 4; i++) { + j = pointmark((point) tetloop[4 + i]) - in->firstnumber; + idx2tetlist[j]++; + } + tetloop = tetrahedrontraverse(); + } + + // Calculate the total length of array 'tetsperverlist'. + j = idx2tetlist[0]; + idx2tetlist[0] = 0; // Array starts from 0 element. + for (i = 0; i < points->items; i++) { + k = idx2tetlist[i + 1]; + idx2tetlist[i + 1] = idx2tetlist[i] + j; + j = k; + } + // The total length is in the last unit of idx2tetlist. + tetsperverlist = new tetrahedron*[idx2tetlist[i]]; + // Loop the set of tetrahedra again, set the info. of tet. per vertex. + tetrahedrons->traversalinit(); + tetloop = tetrahedrontraverse(); + while (tetloop != (tetrahedron *) NULL) { + for (i = 0; i < 4; i++) { + j = pointmark((point) tetloop[4 + i]) - in->firstnumber; + tetsperverlist[idx2tetlist[j]] = tetloop; + idx2tetlist[j]++; + } + tetloop = tetrahedrontraverse(); + } + // Contents in 'idx2tetlist' are shifted, now shift them back. + for (i = points->items - 1; i >= 0; i--) { + idx2tetlist[i + 1] = idx2tetlist[i]; + } + idx2tetlist[0] = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// dummyinit() Initialize the tetrahedron that fills "outer space" and // +// the omnipresent subface. // +// // +// The tetrahedron that fills "outer space" called 'dummytet', is pointed to // +// by every tetrahedron and subface on a boundary (be it outer or inner) of // +// the tetrahedralization. Also, 'dummytet' points to one of the tetrahedron // +// on the convex hull(until the holes and concavities are carved), making it // +// possible to find a starting tetrahedron for point location. // +// // +// The omnipresent subface,'dummysh', is pointed to by every tetrahedron or // +// subface that doesn't have a full complement of real subface to point to. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::dummyinit(int tetwords, int shwords) +{ + unsigned long alignptr; + + // Set up 'dummytet', the 'tetrahedron' that occupies "outer space". + dummytetbase = (tetrahedron *) new char[tetwords * sizeof(tetrahedron) + + tetrahedrons->alignbytes]; + // Align 'dummytet' on a 'tetrahedrons->alignbytes'-byte boundary. + alignptr = (unsigned long) dummytetbase; + dummytet = (tetrahedron *) + (alignptr + (unsigned long) tetrahedrons->alignbytes + - (alignptr % (unsigned long) tetrahedrons->alignbytes)); + // Initialize the four adjoining tetrahedra to be "outer space". These + // will eventually be changed by various bonding operations, but their + // values don't really matter, as long as they can legally be + // dereferenced. + dummytet[0] = (tetrahedron) dummytet; + dummytet[1] = (tetrahedron) dummytet; + dummytet[2] = (tetrahedron) dummytet; + dummytet[3] = (tetrahedron) dummytet; + // Four null vertex points. + dummytet[4] = (tetrahedron) NULL; + dummytet[5] = (tetrahedron) NULL; + dummytet[6] = (tetrahedron) NULL; + dummytet[7] = (tetrahedron) NULL; + + if (b->useshelles) { + // Set up 'dummysh', the omnipresent "subface" pointed to by any + // tetrahedron side or subface end that isn't attached to a real + // subface. + dummyshbase = (shellface *) new char[shwords * sizeof(shellface) + + subfaces->alignbytes]; + // Align 'dummysh' on a 'subfaces->alignbytes'-byte boundary. + alignptr = (unsigned long) dummyshbase; + dummysh = (shellface *) + (alignptr + (unsigned long) subfaces->alignbytes + - (alignptr % (unsigned long) subfaces->alignbytes)); + // Initialize the three adjoining subfaces to be the omnipresent + // subface. These will eventually be changed by various bonding + // operations, but their values don't really matter, as long as they + // can legally be dereferenced. + dummysh[0] = (shellface) dummysh; + dummysh[1] = (shellface) dummysh; + dummysh[2] = (shellface) dummysh; + // Three null vertex points. + dummysh[3] = (shellface) NULL; + dummysh[4] = (shellface) NULL; + dummysh[5] = (shellface) NULL; + // Initialize the two adjoining tetrahedra to be "outer space". + dummysh[6] = (shellface) dummytet; + dummysh[7] = (shellface) dummytet; + // Initialize the three adjoining subsegments to be "out boundary". + dummysh[8] = (shellface) dummysh; + dummysh[9] = (shellface) dummysh; + dummysh[10] = (shellface) dummysh; + // Initialize the pointer to badface structure. + dummysh[11] = (shellface) NULL; + // Initialize the four adjoining subfaces of 'dummytet' to be the + // omnipresent subface. + dummytet[8 ] = NULL; + dummytet[9 ] = NULL; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// initializepools() Calculate the sizes of the point, tetrahedron, and // +// subface. Initialize their memory pools. // +// // +// This routine also computes the indices 'pointmarkindex', 'point2simindex',// +// and 'point2pbcptindex' used to find values within each point; computes // +// indices 'highorderindex', 'elemattribindex', and 'volumeboundindex' used // +// to find values within each tetrahedron. // +// // +// There are two types of boundary elements, which are subfaces and subsegs, // +// they are stored in seperate pools. However, the data structures of them // +// are the same. A subsegment can be regarded as a degenerate subface, i.e.,// +// one of its three corners is not used. We set the apex of it be 'NULL' to // +// distinguish it's a subsegment. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::initializepools() +{ + enum wordtype wtype; + int pointsize, elesize, shsize; + + // Default checkpbc = 0; + if ((b->plc || b->refine) && (in->pbcgrouplist != NULL)) { + checkpbcs = 1; + } + // Default varconstraint = 0; + if (in->segmentconstraintlist || in->facetconstraintlist) { + varconstraint = 1; + } + + // The index within each point at which its metric tensor is found. It is + // saved directly after the list of point attributes. + pointmtrindex = 3 + in->numberofpointattributes; + // Decide the size (1, 3, or 6) of the metric tensor. + if (b->metric) { + // For '-m' option. A tensor field is provided (*.mtr or *.b.mtr file). + if (bgm != (tetgenmesh *) NULL) { + // A background mesh is allocated. It may not exist though. + sizeoftensor = (bgm->in != (tetgenio *) NULL) ? + bgm->in->numberofpointmtrs : in->numberofpointmtrs; + } else { + // No given background mesh - Itself is a background mesh. + sizeoftensor = in->numberofpointmtrs; + } + // Make sure sizeoftensor is at least 1. + sizeoftensor = (sizeoftensor > 0) ? sizeoftensor : 1; + } else { + // For '-q' option. Make sure to have space for saving a scalar value. + sizeoftensor = b->quality ? 1 : 0; + } + // The index within each point at which an element pointer is found, where + // the index is measured in pointers. Ensure the index is aligned to a + // sizeof(tetrahedron)-byte address. + point2simindex = ((pointmtrindex + sizeoftensor) * sizeof(REAL) + + sizeof(tetrahedron) - 1) / sizeof(tetrahedron); + if (b->plc || b->refine || b->voroout) { + // Increase the point size by four pointers, which are: + // - a pointer to a tet, read by point2tet(); + // - a pointer to a subface, read by point2sh(); + // - a pointer to a subsegment, read by point2seg(); + // - a pointer to a parent point, read by point2ppt()). + if (b->metric) { + // Increase one pointer to a tet of the background mesh. + pointsize = (point2simindex + 5) * sizeof(tetrahedron); + } else { + pointsize = (point2simindex + 4) * sizeof(tetrahedron); + } + // The index within each point at which a pbc point is found. + point2pbcptindex = (pointsize + sizeof(tetrahedron) - 1) + / sizeof(tetrahedron); + if (checkpbcs) { + // Increase the size by one pointer to a corresponding pbc point, + // read by point2pbcpt(). + pointsize = (point2pbcptindex + 1) * sizeof(tetrahedron); + } + } else { + // Increase the point size by FOUR pointer, which are: + // - a pointer to a tet, read by point2tet(); + // - a pointer to a subface, read by point2sh(); -- !! Unused !! + // - a pointer to a subsegment, read by point2seg(); -- !! Unused !! + // - a pointer to a parent point, read by point2ppt()). -- Used by btree. + pointsize = (point2simindex + 4) * sizeof(tetrahedron); + } + // The index within each point at which the boundary marker is found, + // Ensure the point marker is aligned to a sizeof(int)-byte address. + pointmarkindex = (pointsize + sizeof(int) - 1) / sizeof(int); + // Now point size is the ints (inidcated by pointmarkindex) plus: + // - an integer for boundary marker; + // - an integer for vertex type; + //pointsize = (pointmarkindex + 2) * sizeof(int); // Wrong for 64 bit. + pointsize = (pointmarkindex + 2) * sizeof(tetrahedron); + // Decide the wordtype used in vertex pool. + wtype = (sizeof(REAL) >= sizeof(tetrahedron)) ? FLOATINGPOINT : POINTER; + // Initialize the pool of vertices. + points = new memorypool(pointsize, VERPERBLOCK, wtype, 0); + + if (b->useshelles) { + dummypoint = (point) new char[pointsize]; // For abovepoint. + } + + // The number of bytes occupied by a tetrahedron. There are four pointers + // to other tetrahedra, four pointers to corners, and possibly four + // pointers to subfaces (or six pointers to subsegments (used in + // segment recovery only)). + elesize = (8 + b->useshelles * 2) * sizeof(tetrahedron); + // If Voronoi diagram is wanted, make sure we have additional space. + if (b->voroout) { + elesize = (8 + 4) * sizeof(tetrahedron); + } + // The index within each element at which its attributes are found, where + // the index is measured in REALs. + elemattribindex = (elesize + sizeof(REAL) - 1) / sizeof(REAL); + // The index within each element at which the maximum voulme bound is + // found, where the index is measured in REALs. Note that if the + // `b->regionattrib' flag is set, an additional attribute will be added. + volumeboundindex = elemattribindex + in->numberoftetrahedronattributes + + (b->regionattrib > 0); + // If element attributes or an constraint are needed, increase the number + // of bytes occupied by an element. + if (b->varvolume) { + elesize = (volumeboundindex + 1) * sizeof(REAL); + } else if (in->numberoftetrahedronattributes + b->regionattrib > 0) { + elesize = volumeboundindex * sizeof(REAL); + } + // If element neighbor graph is requested (-n switch), an additional + // integer is allocated for each element. + // elemmarkerindex = (elesize + sizeof(int) - 1) / sizeof(int); + elemmarkerindex = (elesize + sizeof(int) - 1) / sizeof(int); + // if (b->neighout || b->voroout) { + // elesize = (elemmarkerindex + 1) * sizeof(int); + // Allocate one slot for the element marker. The actual need isa size + // of an integer. We allocate enough space (a pointer) for alignment + // for 64 bit system. Thanks Liu Yang (LORIA/INRIA) for reporting + // this problem. + elesize = elesize + sizeof(tetrahedron); + // } + // If -o2 switch is used, an additional pointer pointed to the list of + // higher order nodes is allocated for each element. + highorderindex = (elesize + sizeof(tetrahedron) - 1) / sizeof(tetrahedron); + if (b->order == 2) { + elesize = (highorderindex + 1) * sizeof(tetrahedron); + } + // Having determined the memory size of an element, initialize the pool. + tetrahedrons = new memorypool(elesize, ELEPERBLOCK, POINTER, 8); + + if (b->useshelles) { + // The number of bytes occupied by a subface. The list of pointers + // stored in a subface are: three to other subfaces, three to corners, + // three to subsegments, two to tetrahedra, and one to a badface. + shsize = 12 * sizeof(shellface); + // The index within each subface at which the maximum area bound is + // found, where the index is measured in REALs. + areaboundindex = (shsize + sizeof(REAL) - 1) / sizeof(REAL); + // If -q switch is in use, increase the number of bytes occupied by + // a subface for saving maximum area bound. + if (b->quality && varconstraint) { + shsize = (areaboundindex + 1) * sizeof(REAL); + } else { + shsize = areaboundindex * sizeof(REAL); + } + // The index within subface at which the facet marker is found. Ensure + // the marker is aligned to a sizeof(int)-byte address. + shmarkindex = (shsize + sizeof(int) - 1) / sizeof(int); + // Increase the number of bytes by two or three integers, one for facet + // marker, one for shellface type, and optionally one for pbc group. + shsize = (shmarkindex + 2 + checkpbcs) * sizeof(int); + // Initialize the pool of subfaces. Each subface record is eight-byte + // aligned so it has room to store an edge version (from 0 to 5) in + // the least three bits. + subfaces = new memorypool(shsize, SUBPERBLOCK, POINTER, 8); + // Initialize the pool of subsegments. The subsegment's record is same + // with subface. + subsegs = new memorypool(shsize, SUBPERBLOCK, POINTER, 8); + // Initialize the pool for tet-subseg connections. + tet2segpool = new memorypool(6*sizeof(shellface), SUBPERBLOCK, POINTER, 0); + // Initialize the pool for tet-subface connections. + tet2subpool = new memorypool(4*sizeof(shellface), SUBPERBLOCK, POINTER, 0); + // Initialize arraypools for segment & facet recovery. + subsegstack = new arraypool(sizeof(face), 10); + subfacstack = new arraypool(sizeof(face), 10); + // Initialize the "outer space" tetrahedron and omnipresent subface. + dummyinit(tetrahedrons->itemwords, subfaces->itemwords); + } else { + // Initialize the "outer space" tetrahedron. + dummyinit(tetrahedrons->itemwords, 0); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetrahedrondealloc() Deallocate space for a tet., marking it dead. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::tetrahedrondealloc(tetrahedron *dyingtetrahedron) +{ + // Set tetrahedron's vertices to NULL. This makes it possible to detect + // dead tetrahedra when traversing the list of all tetrahedra. + dyingtetrahedron[4] = (tetrahedron) NULL; + // dyingtetrahedron[5] = (tetrahedron) NULL; + // dyingtetrahedron[6] = (tetrahedron) NULL; + dyingtetrahedron[7] = (tetrahedron) NULL; + + if (b->useshelles) { + // Dealloc the space to subfaces/subsegments. + if (dyingtetrahedron[8] != NULL) { + tet2segpool->dealloc((shellface *) dyingtetrahedron[8]); + } + if (dyingtetrahedron[9] != NULL) { + tet2subpool->dealloc((shellface *) dyingtetrahedron[9]); + } + } + + tetrahedrons->dealloc((void *) dyingtetrahedron); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetrahedrontraverse() Traverse the tetrahedra, skipping dead ones. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::tetrahedron* tetgenmesh::tetrahedrontraverse() +{ + tetrahedron *newtetrahedron; + + do { + newtetrahedron = (tetrahedron *) tetrahedrons->traverse(); + if (newtetrahedron == (tetrahedron *) NULL) { + return (tetrahedron *) NULL; + } + } while (newtetrahedron[7] == (tetrahedron) NULL); // Skip dead ones. + return newtetrahedron; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// shellfacedealloc() Deallocate space for a shellface, marking it dead. // +// Used both for dealloc a subface and subsegment. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::shellfacedealloc(memorypool *pool, shellface *dyingsh) +{ + // Set shellface's vertices to NULL. This makes it possible to detect dead + // shellfaces when traversing the list of all shellfaces. + dyingsh[3] = (shellface) NULL; + dyingsh[4] = (shellface) NULL; + dyingsh[5] = (shellface) NULL; + pool->dealloc((void *) dyingsh); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// shellfacetraverse() Traverse the subfaces, skipping dead ones. Used // +// for both subfaces and subsegments pool traverse. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::shellface* tetgenmesh::shellfacetraverse(memorypool *pool) +{ + shellface *newshellface; + + do { + newshellface = (shellface *) pool->traverse(); + if (newshellface == (shellface *) NULL) { + return (shellface *) NULL; + } + } while (newshellface[3] == (shellface) NULL); // Skip dead ones. + return newshellface; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// badfacedealloc() Deallocate space for a badface, marking it dead. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::badfacedealloc(memorypool *pool, badface *dying) +{ + // Set badface's forg to NULL. This makes it possible to detect dead + // ones when traversing the list of all items. + dying->forg = (point) NULL; + pool->dealloc((void *) dying); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// badfacetraverse() Traverse the pools, skipping dead ones. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::badface* tetgenmesh::badfacetraverse(memorypool *pool) +{ + badface *newsh; + + do { + newsh = (badface *) pool->traverse(); + if (newsh == (badface *) NULL) { + return (badface *) NULL; + } + } while (newsh->forg == (point) NULL); // Skip dead ones. + return newsh; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// pointdealloc() Deallocate space for a point, marking it dead. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::pointdealloc(point dyingpoint) +{ + // Mark the point as dead. This makes it possible to detect dead points + // when traversing the list of all points. + setpointtype(dyingpoint, DEADVERTEX); + points->dealloc((void *) dyingpoint); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// pointtraverse() Traverse the points, skipping dead ones. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::point tetgenmesh::pointtraverse() +{ + point newpoint; + + do { + newpoint = (point) points->traverse(); + if (newpoint == (point) NULL) { + return (point) NULL; + } + } while (pointtype(newpoint) == DEADVERTEX); // Skip dead ones. + return newpoint; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// maketetrahedron() Create a new tetrahedron. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::maketetrahedron(triface *newtet) +{ + newtet->tet = (tetrahedron *) tetrahedrons->alloc(); + // Initialize the four adjoining tetrahedra to be "outer space". + newtet->tet[0] = (tetrahedron) dummytet; + newtet->tet[1] = (tetrahedron) dummytet; + newtet->tet[2] = (tetrahedron) dummytet; + newtet->tet[3] = (tetrahedron) dummytet; + // Four NULL vertices. + newtet->tet[4] = (tetrahedron) NULL; + newtet->tet[5] = (tetrahedron) NULL; + newtet->tet[6] = (tetrahedron) NULL; + newtet->tet[7] = (tetrahedron) NULL; + // Initialize the four adjoining subfaces to be the omnipresent subface. + if (b->useshelles) { + newtet->tet[8 ] = NULL; + newtet->tet[9 ] = NULL; + } + for (int i = 0; i < in->numberoftetrahedronattributes; i++) { + setelemattribute(newtet->tet, i, 0.0); + } + if (b->varvolume) { + setvolumebound(newtet->tet, -1.0); + } + // Initialize the marker (for flags). + setelemmarker(newtet->tet, 0); + // Initialize the location and version to be Zero. + newtet->loc = 0; + newtet->ver = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// makeshellface() Create a new shellface with version zero. Used for // +// both subfaces and seusegments. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::makeshellface(memorypool *pool, face *newface) +{ + newface->sh = (shellface *) pool->alloc(); + //Initialize the three adjoining subfaces to be the omnipresent subface. + newface->sh[0] = (shellface) dummysh; + newface->sh[1] = (shellface) dummysh; + newface->sh[2] = (shellface) dummysh; + // Three NULL vertices. + newface->sh[3] = (shellface) NULL; + newface->sh[4] = (shellface) NULL; + newface->sh[5] = (shellface) NULL; + // Initialize the two adjoining tetrahedra to be "outer space". + newface->sh[6] = (shellface) dummytet; + newface->sh[7] = (shellface) dummytet; + // Initialize the three adjoining subsegments to be the omnipresent + // subsegments. + newface->sh [8] = (shellface) dummysh; + newface->sh [9] = (shellface) dummysh; + newface->sh[10] = (shellface) dummysh; + // Initialize the pointer to badface structure. + newface->sh[11] = (shellface) NULL; + if (b->quality && varconstraint) { + // Initialize the maximum area bound. + setareabound(*newface, 0.0); + } + // Clear the infection and marktest bits. + suninfect(*newface); + sunmarktest(*newface); + // Set the boundary marker to zero. + setshellmark(*newface, 0); + // Set the type. + setshelltype(*newface, NSHARP); + if (checkpbcs) { + // Set the pbcgroup be ivalid. + setshellpbcgroup(*newface, -1); + } + // Initialize the version to be Zero. + newface->shver = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// makepoint() Create a new point. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::makepoint(point* pnewpoint) +{ + int ptmark, i; + + *pnewpoint = (point) points->alloc(); + // Initialize three coordinates. + (*pnewpoint)[0] = 0.0; + (*pnewpoint)[1] = 0.0; + (*pnewpoint)[2] = 0.0; + // Initialize the list of user-defined attributes. + for (i = 0; i < in->numberofpointattributes; i++) { + (*pnewpoint)[3 + i] = 0.0; + } + // Initialize the metric tensor. + for (i = 0; i < sizeoftensor; i++) { + (*pnewpoint)[pointmtrindex + i] = 0.0; + } + if (b->plc || b->refine) { + // Initialize the point-to-simplex filed. + setpoint2tet(*pnewpoint, NULL); + setpoint2sh(*pnewpoint, NULL); + setpoint2seg(*pnewpoint, NULL); + setpoint2ppt(*pnewpoint, NULL); + if (b->metric) { + setpoint2bgmtet(*pnewpoint, NULL); + } + if (checkpbcs) { + // Initialize the other pointer to its pbc point. + setpoint2pbcpt(*pnewpoint, NULL); + } + } + // Initialize the point marker (starting from in->firstnumber). + ptmark = (int) points->items - (in->firstnumber == 1 ? 0 : 1); + setpointmark(*pnewpoint, ptmark); + // Initialize the point type. + setpointtype(*pnewpoint, UNUSEDVERTEX); + // Clear the point flags. + puninfect(*pnewpoint); + //punmarktest(*pnewpoint); +} + +//// //// +//// //// +//// mempool_cxx ////////////////////////////////////////////////////////////// + +//// geom_cxx ///////////////////////////////////////////////////////////////// +//// //// +//// //// + +// PI is the ratio of a circle's circumference to its diameter. + +REAL tetgenmesh::PI = 3.14159265358979323846264338327950288419716939937510582; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Triangle-triangle intersection test // +// // +// The triangle-triangle intersection test is implemented with exact arithm- // +// etic. It exactly tells whether or not two triangles in three dimensions // +// intersect. Before implementing this test myself, I tried two C codes // +// (implemented by Thomas Moeller and Philippe Guigue, respectively), which // +// are all public available. However both of them failed frequently. Another // +// unconvenience is both codes only tell whether or not the two triangles // +// intersect without distinguishing the cases whether they exactly intersect // +// in interior or they just share a vertex or share an edge. The two latter // +// cases are acceptable and should return not intersection in TetGen. // +// // +/////////////////////////////////////////////////////////////////////////////// + +// All the following routines require the input objects are not degenerate. +// i.e., a triangle must has three non-collinear corners; an edge must +// has two identical endpoints. Degenerate cases should have to detect +// first and then handled as special cases. + +/////////////////////////////////////////////////////////////////////////////// +// // +// edge_vert_col_inter() Test whether an edge (ab) and a collinear vertex // +// (p) are intersecting or not. // +// // +// Possible cases are p is coincident to a (p = a), or to b (p = b), or p is // +// inside ab (a < p < b), or outside ab (p < a or p > b). These cases can be // +// quickly determined by comparing the corresponding coords of a, b, and p // +// (which are not all equal). // +// // +// The return value indicates one of the three cases: DISJOINT, SHAREVERTEX // +// (p = a or p = b), and INTERSECT (a < p < b). // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::edge_vert_col_inter(REAL* A, REAL* B, + REAL* P) +{ + int i = 0; + do { + if (A[i] < B[i]) { + if (P[i] < A[i]) { + return DISJOINT; + } else if (P[i] > A[i]) { + if (P[i] < B[i]) { + return INTERSECT; + } else if (P[i] > B[i]) { + return DISJOINT; + } else { + // assert(P[i] == B[i]); + return SHAREVERTEX; + } + } else { + // assert(P[i] == A[i]); + return SHAREVERTEX; + } + } else if (A[i] > B[i]) { + if (P[i] < B[i]) { + return DISJOINT; + } else if (P[i] > B[i]) { + if (P[i] < A[i]) { + return INTERSECT; + } else if (P[i] > A[i]) { + return DISJOINT; + } else { + // assert(P[i] == A[i]); + return SHAREVERTEX; + } + } else { + // assert(P[i] == B[i]); + return SHAREVERTEX; + } + } + // i-th coordinates are equal, try i+1-th; + i++; + } while (i < 3); + // Should never be here. + return DISJOINT; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// edge_edge_cop_inter() Test whether two coplanar edges (ab, and pq) are // +// intersecting or not. // +// // +// Possible cases are ab and pq are disjointed, or proper intersecting (int- // +// ersect at a point other than their endpoints), or both collinear and int- // +// ersecting, or sharing at a common endpoint, or are coincident. // +// // +// A reference point R is required, which is exactly not coplanar with these // +// two edges. Since the caller knows these two edges are coplanar, it must // +// be able to provide (or calculate) such a point. // +// // +// The return value indicates one of the four cases: DISJOINT, SHAREVERTEX, // +// SHAREEDGE, and INTERSECT. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh:: edge_edge_cop_inter(REAL* A, REAL* B, + REAL* P, REAL* Q, REAL* R) +{ + REAL s1, s2, s3, s4; + +#ifdef SELF_CHECK + assert(R != NULL); +#endif + s1 = orient3d(A, B, R, P); + s2 = orient3d(A, B, R, Q); + if (s1 * s2 > 0.0) { + // Both p and q are at the same side of ab. + return DISJOINT; + } + s3 = orient3d(P, Q, R, A); + s4 = orient3d(P, Q, R, B); + if (s3 * s4 > 0.0) { + // Both a and b are at the same side of pq. + return DISJOINT; + } + + // Possible degenerate cases are: + // (1) Only one of p and q is collinear with ab; + // (2) Both p and q are collinear with ab; + // (3) Only one of a and b is collinear with pq. + enum interresult abp, abq; + enum interresult pqa, pqb; + + if (s1 == 0.0) { + // p is collinear with ab. + abp = edge_vert_col_inter(A, B, P); + if (abp == INTERSECT) { + // p is inside ab. + return INTERSECT; + } + if (s2 == 0.0) { + // q is collinear with ab. Case (2). + abq = edge_vert_col_inter(A, B, Q); + if (abq == INTERSECT) { + // q is inside ab. + return INTERSECT; + } + if (abp == SHAREVERTEX && abq == SHAREVERTEX) { + // ab and pq are identical. + return SHAREEDGE; + } + pqa = edge_vert_col_inter(P, Q, A); + if (pqa == INTERSECT) { + // a is inside pq. + return INTERSECT; + } + pqb = edge_vert_col_inter(P, Q, B); + if (pqb == INTERSECT) { + // b is inside pq. + return INTERSECT; + } + if (abp == SHAREVERTEX || abq == SHAREVERTEX) { + // either p or q is coincident with a or b. +#ifdef SELF_CHECK + // ONLY one case is possible, otherwise, shoule be SHAREEDGE. + assert(abp ^ abq); +#endif + return SHAREVERTEX; + } + // The last case. They are disjointed. +#ifdef SELF_CHECK + assert((abp == DISJOINT) && (abp == abq && abq == pqa && pqa == pqb)); +#endif + return DISJOINT; + } else { + // p is collinear with ab. Case (1). +#ifdef SELF_CHECK + assert(abp == SHAREVERTEX || abp == DISJOINT); +#endif + return abp; + } + } + // p is NOT collinear with ab. + if (s2 == 0.0) { + // q is collinear with ab. Case (1). + abq = edge_vert_col_inter(A, B, Q); +#ifdef SELF_CHECK + assert(abq == SHAREVERTEX || abq == DISJOINT || abq == INTERSECT); +#endif + return abq; + } + + // We have found p and q are not collinear with ab. However, it is still + // possible that a or b is collinear with pq (ONLY one of a and b). + if (s3 == 0.0) { + // a is collinear with pq. Case (3). +#ifdef SELF_CHECK + assert(s4 != 0.0); +#endif + pqa = edge_vert_col_inter(P, Q, A); +#ifdef SELF_CHECK + // This case should have been detected in above. + assert(pqa != SHAREVERTEX); + assert(pqa == INTERSECT || pqa == DISJOINT); +#endif + return pqa; + } + if (s4 == 0.0) { + // b is collinear with pq. Case (3). +#ifdef SELF_CHECK + assert(s3 != 0.0); +#endif + pqb = edge_vert_col_inter(P, Q, B); +#ifdef SELF_CHECK + // This case should have been detected in above. + assert(pqb != SHAREVERTEX); + assert(pqb == INTERSECT || pqb == DISJOINT); +#endif + return pqb; + } + + // ab and pq are intersecting properly. + return INTERSECT; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// Notations // +// // +// Let ABC be the plane passes through a, b, and c; ABC+ be the halfspace // +// including the set of all points x, such that orient3d(a, b, c, x) > 0; // +// ABC- be the other halfspace, such that for each point x in ABC-, // +// orient3d(a, b, c, x) < 0. For the set of x which are on ABC, orient3d(a, // +// b, c, x) = 0. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_vert_copl_inter() Test whether a triangle (abc) and a coplanar // +// point (p) are intersecting or not. // +// // +// Possible cases are p is inside abc, or on an edge of, or coincident with // +// a vertex of, or outside abc. // +// // +// A reference point R is required. R is exactly not coplanar with abc and p.// +// Since the caller knows they are coplanar, it must be able to provide (or // +// calculate) such a point. // +// // +// The return value indicates one of the four cases: DISJOINT, SHAREVERTEX, // +// and INTERSECT. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::tri_vert_cop_inter(REAL* A, REAL* B, + REAL* C, REAL* P, REAL* R) +{ + REAL s1, s2, s3; + int sign; + +#ifdef SELF_CHECK + assert(R != (REAL *) NULL); +#endif + // Adjust the orientation of a, b, c and r, so that we can assume that + // r is strictly in ABC- (i.e., r is above ABC wrt. right-hand rule). + s1 = orient3d(A, B, C, R); +#ifdef SELF_CHECK + assert(s1 != 0.0); +#endif + sign = s1 < 0.0 ? 1 : -1; + + // Test starts from here. + s1 = orient3d(A, B, R, P) * sign; + if (s1 < 0.0) { + // p is in ABR-. + return DISJOINT; + } + s2 = orient3d(B, C, R, P) * sign; + if (s2 < 0.0) { + // p is in BCR-. + return DISJOINT; + } + s3 = orient3d(C, A, R, P) * sign; + if (s3 < 0.0) { + // p is in CAR-. + return DISJOINT; + } + if (s1 == 0.0) { + // p is on ABR. + if (s2 == 0.0) { + // p is on BCR. +#ifdef SELF_CHECK + assert(s3 > 0.0); +#endif + // p is coincident with b. + return SHAREVERTEX; + } + if (s3 == 0.0) { + // p is on CAR. + // p is coincident with a. + return SHAREVERTEX; + } + // p is on edge ab. + return INTERSECT; + } + // p is in ABR+. + if (s2 == 0.0) { + // p is on BCR. + if (s3 == 0.0) { + // p is on CAR. + // p is coincident with c. + return SHAREVERTEX; + } + // p is on edge bc. + return INTERSECT; + } + if (s3 == 0.0) { + // p is on CAR. + // p is on edge ca. + return INTERSECT; + } + + // p is strictly inside abc. + return INTERSECT; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_edge_cop_inter() Test whether a triangle (abc) and a coplanar edge // +// (pq) are intersecting or not. // +// // +// A reference point R is required. R is exactly not coplanar with abc and // +// pq. Since the caller knows they are coplanar, it must be able to provide // +// (or calculate) such a point. // +// // +// The return value indicates one of the four cases: DISJOINT, SHAREVERTEX, // +// SHAREEDGE, and INTERSECT. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::tri_edge_cop_inter(REAL* A, REAL* B, + REAL* C, REAL* P, REAL* Q, REAL* R) +{ + enum interresult abpq, bcpq, capq; + enum interresult abcp, abcq; + + // Test if pq is intersecting one of edges of abc. + abpq = edge_edge_cop_inter(A, B, P, Q, R); + if (abpq == INTERSECT || abpq == SHAREEDGE) { + return abpq; + } + bcpq = edge_edge_cop_inter(B, C, P, Q, R); + if (bcpq == INTERSECT || bcpq == SHAREEDGE) { + return bcpq; + } + capq = edge_edge_cop_inter(C, A, P, Q, R); + if (capq == INTERSECT || capq == SHAREEDGE) { + return capq; + } + + // Test if p and q is inside abc. + abcp = tri_vert_cop_inter(A, B, C, P, R); + if (abcp == INTERSECT) { + return INTERSECT; + } + abcq = tri_vert_cop_inter(A, B, C, Q, R); + if (abcq == INTERSECT) { + return INTERSECT; + } + + // Combine the test results of edge intersectings and triangle insides + // to detect whether abc and pq are sharing vertex or disjointed. + if (abpq == SHAREVERTEX) { + // p or q is coincident with a or b. +#ifdef SELF_CHECK + assert(abcp ^ abcq); +#endif + return SHAREVERTEX; + } + if (bcpq == SHAREVERTEX) { + // p or q is coincident with b or c. +#ifdef SELF_CHECK + assert(abcp ^ abcq); +#endif + return SHAREVERTEX; + } + if (capq == SHAREVERTEX) { + // p or q is coincident with c or a. +#ifdef SELF_CHECK + assert(abcp ^ abcq); +#endif + return SHAREVERTEX; + } + + // They are disjointed. + return DISJOINT; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_edge_inter_tail() Test whether a triangle (abc) and an edge (pq) // +// are intersecting or not. // +// // +// s1 and s2 are results of pre-performed orientation tests. s1 = orient3d( // +// a, b, c, p); s2 = orient3d(a, b, c, q). To separate this routine from // +// tri_edge_inter() can save two orientation tests in tri_tri_inter(). // +// // +// The return value indicates one of the four cases: DISJOINT, SHAREVERTEX, // +// SHAREEDGE, and INTERSECT. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::tri_edge_inter_tail(REAL* A, REAL* B, + REAL* C, REAL* P, REAL* Q, REAL s1, REAL s2) +{ + REAL s3, s4, s5; + int sign; + + if (s1 * s2 > 0.0) { + // p, q are at the same halfspace of ABC, no intersection. + return DISJOINT; + } + + if (s1 * s2 < 0.0) { + // p, q are both not on ABC (and not sharing vertices, edges of abc). + // Adjust the orientation of a, b, c and p, so that we can assume that + // p is strictly in ABC-, and q is strictly in ABC+. + sign = s1 < 0.0 ? 1 : -1; + s3 = orient3d(A, B, P, Q) * sign; + if (s3 < 0.0) { + // q is at ABP-. + return DISJOINT; + } + s4 = orient3d(B, C, P, Q) * sign; + if (s4 < 0.0) { + // q is at BCP-. + return DISJOINT; + } + s5 = orient3d(C, A, P, Q) * sign; + if (s5 < 0.0) { + // q is at CAP-. + return DISJOINT; + } + if (s3 == 0.0) { + // q is on ABP. + if (s4 == 0.0) { + // q is on BCP (and q must in CAP+). +#ifdef SELF_CHECK + assert(s5 > 0.0); +#endif + // pq intersects abc at vertex b. + return SHAREVERTEX; + } + if (s5 == 0.0) { + // q is on CAP (and q must in BCP+). + // pq intersects abc at vertex a. + return SHAREVERTEX; + } + // q in both BCP+ and CAP+. + // pq crosses ab properly. + return INTERSECT; + } + // q is in ABP+; + if (s4 == 0.0) { + // q is on BCP. + if (s5 == 0.0) { + // q is on CAP. + // pq intersects abc at vertex c. + return SHAREVERTEX; + } + // pq crosses bc properly. + return INTERSECT; + } + // q is in BCP+; + if (s5 == 0.0) { + // q is on CAP. + // pq crosses ca properly. + return INTERSECT; + } + // q is in CAP+; + // pq crosses abc properly. + return INTERSECT; + } + + if (s1 != 0.0 || s2 != 0.0) { + // Either p or q is coplanar with abc. ONLY one of them is possible. + if (s1 == 0.0) { + // p is coplanar with abc, q can be used as reference point. +#ifdef SELF_CHECK + assert(s2 != 0.0); +#endif + return tri_vert_cop_inter(A, B, C, P, Q); + } else { + // q is coplanar with abc, p can be used as reference point. +#ifdef SELF_CHECK + assert(s2 == 0.0); +#endif + return tri_vert_cop_inter(A, B, C, Q, P); + } + } + + // pq is coplanar with abc. Calculate a point which is exactly not + // coplanar with a, b, and c. + REAL R[3], N[3]; + REAL ax, ay, az, bx, by, bz; + + ax = A[0] - B[0]; + ay = A[1] - B[1]; + az = A[2] - B[2]; + bx = A[0] - C[0]; + by = A[1] - C[1]; + bz = A[2] - C[2]; + N[0] = ay * bz - by * az; + N[1] = az * bx - bz * ax; + N[2] = ax * by - bx * ay; + // The normal should not be a zero vector (otherwise, abc are collinear). +#ifdef SELF_CHECK + assert((fabs(N[0]) + fabs(N[1]) + fabs(N[2])) > 0.0); +#endif + // The reference point R is lifted from A to the normal direction with + // a distance d = average edge length of the triangle abc. + R[0] = N[0] + A[0]; + R[1] = N[1] + A[1]; + R[2] = N[2] + A[2]; + // Becareful the case: if the non-zero component(s) in N is smaller than + // the machine epsilon (i.e., 2^(-16) for double), R will exactly equal + // to A due to the round-off error. Do check if it is. + if (R[0] == A[0] && R[1] == A[1] && R[2] == A[2]) { + int i, j; + for (i = 0; i < 3; i++) { +#ifdef SELF_CHECK + assert (R[i] == A[i]); +#endif + j = 2; + do { + if (N[i] > 0.0) { + N[i] += (j * macheps); + } else { + N[i] -= (j * macheps); + } + R[i] = N[i] + A[i]; + j *= 2; + } while (R[i] == A[i]); + } + } + + return tri_edge_cop_inter(A, B, C, P, Q, R); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_edge_inter() Test whether a triangle (abc) and an edge (pq) are // +// intersecting or not. // +// // +// The return value indicates one of the four cases: DISJOINT, SHAREVERTEX, // +// SHAREEDGE, and INTERSECT. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::tri_edge_inter(REAL* A, REAL* B, + REAL* C, REAL* P, REAL* Q) +{ + REAL s1, s2; + + // Test the locations of p and q with respect to ABC. + s1 = orient3d(A, B, C, P); + s2 = orient3d(A, B, C, Q); + + return tri_edge_inter_tail(A, B, C, P, Q, s1, s2); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_tri_inter() Test whether two triangle (abc) and (opq) are // +// intersecting or not. // +// // +// The return value indicates one of the five cases: DISJOINT, SHAREVERTEX, // +// SHAREEDGE, SHAREFACE, and INTERSECT. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::tri_tri_inter(REAL* A, REAL* B, + REAL* C, REAL* O, REAL* P, REAL* Q) +{ + REAL s_o, s_p, s_q; + REAL s_a, s_b, s_c; + + s_o = orient3d(A, B, C, O); + s_p = orient3d(A, B, C, P); + s_q = orient3d(A, B, C, Q); + if ((s_o * s_p > 0.0) && (s_o * s_q > 0.0)) { + // o, p, q are all in the same halfspace of ABC. + return DISJOINT; + } + + s_a = orient3d(O, P, Q, A); + s_b = orient3d(O, P, Q, B); + s_c = orient3d(O, P, Q, C); + if ((s_a * s_b > 0.0) && (s_a * s_c > 0.0)) { + // a, b, c are all in the same halfspace of OPQ. + return DISJOINT; + } + + enum interresult abcop, abcpq, abcqo; + int shareedge = 0; + + abcop = tri_edge_inter_tail(A, B, C, O, P, s_o, s_p); + if (abcop == INTERSECT) { + return INTERSECT; + } else if (abcop == SHAREEDGE) { + shareedge++; + } + abcpq = tri_edge_inter_tail(A, B, C, P, Q, s_p, s_q); + if (abcpq == INTERSECT) { + return INTERSECT; + } else if (abcpq == SHAREEDGE) { + shareedge++; + } + abcqo = tri_edge_inter_tail(A, B, C, Q, O, s_q, s_o); + if (abcqo == INTERSECT) { + return INTERSECT; + } else if (abcqo == SHAREEDGE) { + shareedge++; + } + if (shareedge == 3) { + // opq are coincident with abc. + return SHAREFACE; + } +#ifdef SELF_CHECK + // It is only possible either no share edge or one. + assert(shareedge == 0 || shareedge == 1); +#endif + + // Continue to detect whether opq and abc are intersecting or not. + enum interresult opqab, opqbc, opqca; + + opqab = tri_edge_inter_tail(O, P, Q, A, B, s_a, s_b); + if (opqab == INTERSECT) { + return INTERSECT; + } + opqbc = tri_edge_inter_tail(O, P, Q, B, C, s_b, s_c); + if (opqbc == INTERSECT) { + return INTERSECT; + } + opqca = tri_edge_inter_tail(O, P, Q, C, A, s_c, s_a); + if (opqca == INTERSECT) { + return INTERSECT; + } + + // At this point, two triangles are not intersecting and not coincident. + // They may be share an edge, or share a vertex, or disjoint. + if (abcop == SHAREEDGE) { +#ifdef SELF_CHECK + assert(abcpq == SHAREVERTEX && abcqo == SHAREVERTEX); +#endif + // op is coincident with an edge of abc. + return SHAREEDGE; + } + if (abcpq == SHAREEDGE) { +#ifdef SELF_CHECK + assert(abcop == SHAREVERTEX && abcqo == SHAREVERTEX); +#endif + // pq is coincident with an edge of abc. + return SHAREEDGE; + } + if (abcqo == SHAREEDGE) { +#ifdef SELF_CHECK + assert(abcop == SHAREVERTEX && abcpq == SHAREVERTEX); +#endif + // qo is coincident with an edge of abc. + return SHAREEDGE; + } + + // They may share a vertex or disjoint. + if (abcop == SHAREVERTEX) { + // o or p is coincident with a vertex of abc. + if (abcpq == SHAREVERTEX) { + // p is the coincident vertex. +#ifdef SELF_CHECK + assert(abcqo != SHAREVERTEX); +#endif + } else { + // o is the coincident vertex. +#ifdef SELF_CHECK + assert(abcqo == SHAREVERTEX); +#endif + } + return SHAREVERTEX; + } + if (abcpq == SHAREVERTEX) { + // q is the coincident vertex. +#ifdef SELF_CHECK + assert(abcqo == SHAREVERTEX); +#endif + return SHAREVERTEX; + } + + // They are disjoint. + return DISJOINT; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_edge_2d() Triangle-edge coplanar intersection test. // +// // +// This routine takes a triangle T (with vertices A, B, C) and an edge E (P, // +// Q) in a plane in 3D, and tests if they intersect each other. Return 1 if // +// they are intersected, i.e., T \cap E is not empty, otherwise, return 0. // +// // +// If the point 'R' is not NULL, it lies strictly above T [A, B, C]. // +// // +// If T1 and T2 intersect each other (return 1), they may intersect in diff- // +// erent ways. If 'level' > 0, their intersection type will be reported in // +// combinations of 'types' and 'pos'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::tri_edge_2d(point A, point B, point C, point P, point Q, + point R, int level, int *types, int *pos) +{ + point U[3], V[3]; // The permuted vectors of points. + int pu[3], pv[3]; // The original positions of points. + REAL sA, sB, sC; + REAL s1, s2, s3, s4; + int z1; + + if (R == NULL) { + REAL n[3], len; + // Calculate a lift point, saved in dummypoint. + facenormal2(A, B, C, n, 1); + len = sqrt(DOT(n, n)); + n[0] /= len; + n[1] /= len; + n[2] /= len; + len = DIST(A, B); + len += DIST(B, C); + len += DIST(C, A); + len /= 3.0; + R = dummypoint; + R[0] = A[0] + len * n[0]; + R[1] = A[1] + len * n[1]; + R[2] = A[2] + len * n[2]; + } + + // Test A's, B's, and C's orientations wrt plane PQR. + sA = orient3d(P, Q, R, A); + sB = orient3d(P, Q, R, B); + sC = orient3d(P, Q, R, C); + orient3dcount+=3; + + if (b->verbose > 2) { + printf(" Tri-edge-2d (%d %d %d)-(%d %d)-(%d) (%c%c%c)", pointmark(A), + pointmark(B), pointmark(C), pointmark(P), pointmark(Q), pointmark(R), + sA > 0 ? '+' : (sA < 0 ? '-' : '0'), sB>0 ? '+' : (sB<0 ? '-' : '0'), + sC>0 ? '+' : (sC<0 ? '-' : '0')); + } + // triedgcopcount++; + + if (sA < 0) { + if (sB < 0) { + if (sC < 0) { // (---). + return 0; + } else { + if (sC > 0) { // (--+). + // All points are in the right positions. + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 0; + } else { // (--0). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 1; + } + } + } else { + if (sB > 0) { + if (sC < 0) { // (-+-). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 0, 1, 2); + z1 = 0; + } else { + if (sC > 0) { // (-++). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 1, 0, 2); + z1 = 0; + } else { // (-+0). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 0, 1, 2); + z1 = 2; + } + } + } else { + if (sC < 0) { // (-0-). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 0, 1, 2); + z1 = 1; + } else { + if (sC > 0) { // (-0+). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 1, 0, 2); + z1 = 2; + } else { // (-00). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 1, 0, 2); + z1 = 3; + } + } + } + } + } else { + if (sA > 0) { + if (sB < 0) { + if (sC < 0) { // (+--). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 0, 1, 2); + z1 = 0; + } else { + if (sC > 0) { // (+-+). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 1, 0, 2); + z1 = 0; + } else { // (+-0). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 1, 0, 2); + z1 = 2; + } + } + } else { + if (sB > 0) { + if (sC < 0) { // (++-). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 0; + } else { + if (sC > 0) { // (+++). + return 0; + } else { // (++0). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 1; + } + } + } else { // (+0#) + if (sC < 0) { // (+0-). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 0, 1, 2); + z1 = 2; + } else { + if (sC > 0) { // (+0+). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 1, 0, 2); + z1 = 1; + } else { // (+00). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 0, 1, 2); + z1 = 3; + } + } + } + } + } else { + if (sB < 0) { + if (sC < 0) { // (0--). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 0, 1, 2); + z1 = 1; + } else { + if (sC > 0) { // (0-+). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 2; + } else { // (0-0). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 1, 0, 2); + z1 = 3; + } + } + } else { + if (sB > 0) { + if (sC < 0) { // (0+-). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 2; + } else { + if (sC > 0) { // (0++). + SETVECTOR3(U, B, C, A); // PT = ST x ST + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 1, 2, 0); + SETVECTOR3(pv, 1, 0, 2); + z1 = 1; + } else { // (0+0). + SETVECTOR3(U, C, A, B); // PT = ST + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 2, 0, 1); + SETVECTOR3(pv, 0, 1, 2); + z1 = 3; + } + } + } else { // (00#) + if (sC < 0) { // (00-). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, Q, P, R); // PL = SL + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 3; + } else { + if (sC > 0) { // (00+). + SETVECTOR3(U, A, B, C); // I3 + SETVECTOR3(V, P, Q, R); // I2 + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 3; + } else { // (000) + // Not possible unless ABC is degenerate. + z1 = 4; + } + } + } + } + } + } + + s1 = orient3d(U[0], U[2], R, V[1]); // A, C, R, Q + s2 = orient3d(U[1], U[2], R, V[0]); // B, C, R, P + orient3dcount+=2; + + if (b->verbose > 2) { + printf(" Tri-edge-2d (%d %d %d)-(%d %d %d) (%d) (%c%c)\n", + pointmark(U[0]), pointmark(U[1]), pointmark(U[2]), pointmark(V[0]), + pointmark(V[1]), pointmark(V[2]), z1, s1>0 ? '+' : (s1<0 ? '-' : '0'), + s2>0 ? '+' : (s2<0 ? '-' : '0')); + } + assert(z1 != 4); // SELF_CHECK + + if (s1 > 0) { + return 0; + } + if (s2 < 0) { + return 0; + } + + if (level == 0) { + return 1; // They are intersected. + } + + if (z1 == 1) { + if (s1 == 0) { // (0###) + // C = Q. + types[0] = (int) SHAREVERTEX; + pos[0] = pu[2]; // C + pos[1] = pv[1]; // Q + types[1] = (int) DISJOINT; + } else { + if (s2 == 0) { // (#0##) + // C = P. + types[0] = (int) SHAREVERTEX; + pos[0] = pu[2]; // C + pos[1] = pv[0]; // P + types[1] = (int) DISJOINT; + } else { // (-+##) + // C in [P, Q]. + types[0] = (int) INTERVERT; + pos[0] = pu[2]; // C + pos[1] = pv[0]; // [P, Q] + types[1] = (int) DISJOINT; + } + } + return 1; + } + + s3 = orient3d(U[0], U[2], R, V[0]); // A, C, R, P + s4 = orient3d(U[1], U[2], R, V[1]); // B, C, R, Q + orient3dcount+=2; + + if (z1 == 0) { // (tritri-03) + if (s1 < 0) { + if (s3 > 0) { + assert(s2 > 0); // SELF_CHECK + if (s4 > 0) { + // [P, Q] overlaps [k, l] (-+++). + types[0] = (int) INTEREDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[0]; // [P, Q] + types[1] = (int) TOUCHFACE; + pos[2] = 3; // [A, B, C] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // Q = l, [P, Q] contains [k, l] (-++0). + types[0] = (int) INTEREDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[0]; // [P, Q] + types[1] = (int) TOUCHEDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[1]; // Q + } else { // s4 < 0 + // [P, Q] contains [k, l] (-++-). + types[0] = (int) INTEREDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[0]; // [P, Q] + types[1] = (int) INTEREDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[0]; // [P, Q] + } + } + } else { + if (s3 == 0) { + assert(s2 > 0); // SELF_CHECK + if (s4 > 0) { + // P = k, [P, Q] in [k, l] (-+0+). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[0]; // P + types[1] = (int) TOUCHFACE; + pos[2] = 3; // [A, B, C] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // [P, Q] = [k, l] (-+00). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[0]; // P + types[1] = (int) TOUCHEDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[1]; // Q + } else { + // P = k, [P, Q] contains [k, l] (-+0-). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[0]; // P + types[1] = (int) INTEREDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[0]; // [P, Q] + } + } + } else { // s3 < 0 + if (s2 > 0) { + if (s4 > 0) { + // [P, Q] in [k, l] (-+-+). + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[0]; // P + types[1] = (int) TOUCHFACE; + pos[2] = 3; // [A, B, C] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // Q = l, [P, Q] in [k, l] (-+-0). + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[0]; // P + types[1] = (int) TOUCHEDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[1]; // Q + } else { // s4 < 0 + // [P, Q] overlaps [k, l] (-+--). + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[0]; // P + types[1] = (int) INTEREDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[0]; // [P, Q] + } + } + } else { // s2 == 0 + // P = l (#0##). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[1]; // [B, C] + pos[1] = pv[0]; // P + types[1] = (int) DISJOINT; + } + } + } + } else { // s1 == 0 + // Q = k (0####) + types[0] = (int) TOUCHEDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[1]; // Q + types[1] = (int) DISJOINT; + } + } else if (z1 == 2) { // (tritri-23) + if (s1 < 0) { + if (s3 > 0) { + assert(s2 > 0); // SELF_CHECK + if (s4 > 0) { + // [P, Q] overlaps [A, l] (-+++). + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // [P, Q] + types[1] = (int) TOUCHFACE; + pos[2] = 3; // [A, B, C] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // Q = l, [P, Q] contains [A, l] (-++0). + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // [P, Q] + types[1] = (int) TOUCHEDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[1]; // Q + } else { // s4 < 0 + // [P, Q] contains [A, l] (-++-). + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // [P, Q] + types[1] = (int) INTEREDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[0]; // [P, Q] + } + } + } else { + if (s3 == 0) { + assert(s2 > 0); // SELF_CHECK + if (s4 > 0) { + // P = A, [P, Q] in [A, l] (-+0+). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // P + types[1] = (int) TOUCHFACE; + pos[2] = 3; // [A, B, C] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // [P, Q] = [A, l] (-+00). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // P + types[1] = (int) TOUCHEDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[1]; // Q + } else { // s4 < 0 + // Q = l, [P, Q] in [A, l] (-+0-). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // P + types[1] = (int) INTEREDGE; + pos[2] = pu[1]; // [B, C] + pos[3] = pv[0]; // [P, Q] + } + } + } else { // s3 < 0 + if (s2 > 0) { + if (s4 > 0) { + // [P, Q] in [A, l] (-+-+). + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[0]; // P + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[1]; // Q + } else { + if (s4 == 0) { + // Q = l, [P, Q] in [A, l] (-+-0). + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[0]; // P + types[0] = (int) TOUCHEDGE; + pos[0] = pu[1]; // [B, C] + pos[1] = pv[1]; // Q + } else { // s4 < 0 + // [P, Q] overlaps [A, l] (-+--). + types[0] = (int) TOUCHFACE; + pos[0] = 3; // [A, B, C] + pos[1] = pv[0]; // P + types[0] = (int) INTEREDGE; + pos[0] = pu[1]; // [B, C] + pos[1] = pv[0]; // [P, Q] + } + } + } else { // s2 == 0 + // P = l (#0##). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[1]; // [B, C] + pos[1] = pv[0]; // P + types[1] = (int) DISJOINT; + } + } + } + } else { // s1 == 0 + // Q = A (0###). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[1]; // Q + types[1] = (int) DISJOINT; + } + } else if (z1 == 3) { // (tritri-33) + if (s1 < 0) { + if (s3 > 0) { + assert(s2 > 0); // SELF_CHECK + if (s4 > 0) { + // [P, Q] overlaps [A, B] (-+++). + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // [P, Q] + types[1] = (int) TOUCHEDGE; + pos[2] = pu[0]; // [A, B] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // Q = B, [P, Q] contains [A, B] (-++0). + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // [P, Q] + types[1] = (int) SHAREVERTEX; + pos[2] = pu[1]; // B + pos[3] = pv[1]; // Q + } else { // s4 < 0 + // [P, Q] contains [A, B] (-++-). + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // [P, Q] + types[1] = (int) INTERVERT; + pos[2] = pu[1]; // B + pos[3] = pv[0]; // [P, Q] + } + } + } else { + if (s3 == 0) { + assert(s2 > 0); // SELF_CHECK + if (s4 > 0) { + // P = A, [P, Q] in [A, B] (-+0+). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // P + types[1] = (int) TOUCHEDGE; + pos[2] = pu[0]; // [A, B] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // [P, Q] = [A, B] (-+00). + types[0] = (int) SHAREEDGE; + pos[0] = pu[0]; // [A, B] + pos[1] = pv[0]; // [P, Q] + types[1] = (int) DISJOINT; + } else { // s4 < 0 + // P= A, [P, Q] in [A, B] (-+0-). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[0]; // P + types[1] = (int) INTERVERT; + pos[2] = pu[1]; // B + pos[3] = pv[0]; // [P, Q] + } + } + } else { // s3 < 0 + if (s2 > 0) { + if (s4 > 0) { + // [P, Q] in [A, B] (-+-+). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[0]; // [A, B] + pos[1] = pv[0]; // P + types[1] = (int) TOUCHEDGE; + pos[2] = pu[0]; // [A, B] + pos[3] = pv[1]; // Q + } else { + if (s4 == 0) { + // Q = B, [P, Q] in [A, B] (-+-0). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[0]; // [A, B] + pos[1] = pv[0]; // P + types[1] = (int) SHAREVERTEX; + pos[2] = pu[1]; // B + pos[3] = pv[1]; // Q + } else { // s4 < 0 + // [P, Q] overlaps [A, B] (-+--). + types[0] = (int) TOUCHEDGE; + pos[0] = pu[0]; // [A, B] + pos[1] = pv[0]; // P + types[1] = (int) INTERVERT; + pos[2] = pu[1]; // B + pos[3] = pv[0]; // [P, Q] + } + } + } else { // s2 == 0 + // P = B (#0##). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[1]; // B + pos[1] = pv[0]; // P + types[1] = (int) DISJOINT; + } + } + } + } else { // s1 == 0 + // Q = A (0###). + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[1]; // Q + types[1] = (int) DISJOINT; + } + } + + return 1; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tri_edge_test() Triangle-edge intersection test. // +// // +// This routine takes a triangle T (with vertices A, B, C) and an edge E (P, // +// Q) in 3D, and tests if they intersect each other. Return 1 if they are // +// intersected, i.e., T \cap E is not empty, otherwise, return 0. // +// // +// If the point 'R' is not NULL, it lies strictly above the plane defined by // +// A, B, C. It is used in test when T and E are coplanar. // +// // +// If T1 and T2 intersect each other (return 1), they may intersect in diff- // +// erent ways. If 'level' > 0, their intersection type will be reported in // +// combinations of 'types' and 'pos'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::tri_edge_test(point A, point B, point C, point P, point Q, + point R, int level, int *types, int *pos) +{ + point U[3], V[3]; //, Ptmp; + int pu[3], pv[3]; //, itmp; + REAL sP, sQ, s1, s2, s3; + int z1; + + // Test the locations of P and Q with respect to ABC. + sP = orient3d(A, B, C, P); + sQ = orient3d(A, B, C, Q); + orient3dcount+=2; + + if (b->verbose > 2) { + printf(" Tri-edge (%d %d %d)-(%d %d) (%c%c).\n", pointmark(A), + pointmark(B), pointmark(C), pointmark(P), pointmark(Q), + sP>0 ? '+' : (sP<0 ? '-' : '0'), sQ>0 ? '+' : (sQ<0 ? '-' : '0')); + } + // triedgcount++; + + if (sP < 0) { + if (sQ < 0) { // (--) disjoint + return 0; + } else { + if (sQ > 0) { // (-+) + SETVECTOR3(U, A, B, C); + SETVECTOR3(V, P, Q, R); + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 0; + } else { // (-0) + SETVECTOR3(U, A, B, C); + SETVECTOR3(V, P, Q, R); + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 1; + } + } + } else { + if (sP > 0) { // (+-) + if (sQ < 0) { + SETVECTOR3(U, A, B, C); + SETVECTOR3(V, Q, P, R); // P and Q are flipped. + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 0; + } else { + if (sQ > 0) { // (++) disjoint + return 0; + } else { // (+0) + SETVECTOR3(U, B, A, C); // A and B are flipped. + SETVECTOR3(V, P, Q, R); + SETVECTOR3(pu, 1, 0, 2); + SETVECTOR3(pv, 0, 1, 2); + z1 = 1; + } + } + } else { // sP == 0 + if (sQ < 0) { // (0-) + SETVECTOR3(U, A, B, C); + SETVECTOR3(V, Q, P, R); // P and Q are flipped. + SETVECTOR3(pu, 0, 1, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 1; + } else { + if (sQ > 0) { // (0+) + SETVECTOR3(U, B, A, C); // A and B are flipped. + SETVECTOR3(V, Q, P, R); // P and Q are flipped. + SETVECTOR3(pu, 1, 0, 2); + SETVECTOR3(pv, 1, 0, 2); + z1 = 1; + } else { // (00) + // A, B, C, P, and Q are coplanar. + z1 = 2; + } + } + } + } + + if (z1 == 2) { + // The triangle and the edge are coplanar. + return tri_edge_2d(A, B, C, P, Q, R, level, types, pos); + } + + s1 = orient3d(U[0], U[1], V[0], V[1]); orient3dcount++; + if (s1 < 0) { + return 0; + } + + s2 = orient3d(U[1], U[2], V[0], V[1]); orient3dcount++; + if (s2 < 0) { + return 0; + } + + s3 = orient3d(U[2], U[0], V[0], V[1]); orient3dcount++; + if (s3 < 0) { + return 0; + } + + if (b->verbose > 2) { + printf(" Tri-edge (%d %d %d)-(%d %d) (%c%c%c).\n", pointmark(U[0]), + pointmark(U[1]), pointmark(U[2]), pointmark(V[0]), pointmark(V[1]), + s1>0 ? '+' : (s1<0 ? '-' : '0'), s2>0 ? '+' : (s2<0 ? '-' : '0'), + s3>0 ? '+' : (s3<0 ? '-' : '0')); + } + + if (level == 0) { + return 1; // The are intersected. + } + + types[1] = (int) DISJOINT; // No second intersection point. + + if (z1 == 0) { + if (s1 > 0) { + if (s2 > 0) { + if (s3 > 0) { // (+++) + // [P, Q] passes interior of [A, B, C]. + types[0] = (int) INTERFACE; + pos[0] = 3; // interior of [A, B, C] + pos[1] = 0; // [P, Q] + } else { // s3 == 0 (++0) + // [P, Q] intersects [C, A]. + types[0] = (int) INTEREDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = 0; // [P, Q] + } + } else { // s2 == 0 + if (s3 > 0) { // (+0+) + // [P, Q] intersects [B, C]. + types[0] = (int) INTEREDGE; + pos[0] = pu[1]; // [B, C] + pos[1] = 0; // [P, Q] + } else { // s3 == 0 (+00) + // [P, Q] passes C. + types[0] = (int) INTERVERT; + pos[0] = pu[2]; // C + pos[1] = 0; // [P, Q] + } + } + } else { // s1 == 0 + if (s2 > 0) { + if (s3 > 0) { // (0++) + // [P, Q] intersects [A, B]. + types[0] = (int) INTEREDGE; + pos[0] = pu[0]; // [A, B] + pos[1] = 0; // [P, Q] + } else { // s3 == 0 (0+0) + // [P, Q] passes A. + types[0] = (int) INTERVERT; + pos[0] = pu[0]; // A + pos[1] = 0; // [P, Q] + } + } else { // s2 == 0 + if (s3 > 0) { // (00+) + // [P, Q] passes B. + types[0] = (int) INTERVERT; + pos[0] = pu[1]; // B + pos[1] = 0; // [P, Q] + } else { // s3 == 0 (000) + // Impossible. + assert(0); + } + } + } + } else { // z1 == 1 + if (s1 > 0) { + if (s2 > 0) { + if (s3 > 0) { // (+++) + // Q lies in [A, B, C]. + types[0] = (int) TOUCHFACE; + pos[0] = 0; // [A, B, C] + pos[1] = pv[1]; // Q + } else { // s3 == 0 (++0) + // Q lies on [C, A]. + types[0] = (int) TOUCHEDGE; + pos[0] = pu[2]; // [C, A] + pos[1] = pv[1]; // Q + } + } else { // s2 == 0 + if (s3 > 0) { // (+0+) + // Q lies on [B, C]. + types[0] = (int) TOUCHEDGE; + pos[0] = pu[1]; // [B, C] + pos[1] = pv[1]; // Q + } else { // s3 == 0 (+00) + // Q = C. + types[0] = (int) SHAREVERTEX; + pos[0] = pu[2]; // C + pos[1] = pv[1]; // Q + } + } + } else { // s1 == 0 + if (s2 > 0) { + if (s3 > 0) { // (0++) + // Q lies on [A, B]. + types[0] = (int) TOUCHEDGE; + pos[0] = pu[0]; // [A, B] + pos[1] = pv[1]; // Q + } else { // s3 == 0 (0+0) + // Q = A. + types[0] = (int) SHAREVERTEX; + pos[0] = pu[0]; // A + pos[1] = pv[1]; // Q + } + } else { // s2 == 0 + if (s3 > 0) { // (00+) + // Q = B. + types[0] = (int) SHAREVERTEX; + pos[0] = pu[1]; // B + pos[1] = pv[1]; // Q + } else { // s3 == 0 (000) + // Impossible. + assert(0); + } + } + } + } + + return 1; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// incircle3d() 3D in-circle test. // +// // +// Return a negative value if pd is inside the circumcircle of the triangle // +// pa, pb, and pc. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::incircle3d(point pa, point pb, point pc, point pd) +{ + REAL area2[2], n1[3], n2[3], c[3]; + REAL sign, r, d; + + // Calculate the areas of the two triangles [a, b, c] and [b, a, d]. + facenormal2(pa, pb, pc, n1, 1); + area2[0] = DOT(n1, n1); + facenormal2(pb, pa, pd, n2, 1); + area2[1] = DOT(n2, n2); + + if (area2[0] > area2[1]) { + // Choose [a, b, c] as the base triangle. + circumsphere(pa, pb, pc, NULL, c, &r); + d = DIST(c, pd); + } else { + // Choose [b, a, d] as the base triangle. + if (area2[1] > 0) { + circumsphere(pb, pa, pd, NULL, c, &r); + d = DIST(c, pc); + } else { + // The four points are collinear. This case only happens on the boundary. + return 0; // Return "not inside". + } + } + + sign = d - r; + if (fabs(sign) / r < b->epsilon) { + sign = 0; + } + + return sign; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// insphere_s() Insphere test with symbolic perturbation. // +// // +// Given four points pa, pb, pc, and pd, test if the point pe lies inside or // +// outside the circumscirbed sphere of the four points. Here we assume that // +// the orientation of the sequence {pa, pb, pc, pd} is negative (NOT zero), // +// i.e., pd lies at the negative side of the plane defined by pa, pb, and pc.// +// // +// Return a positive value (> 0) if pe lies outside, a negative value (< 0) // +// if pe lies inside the sphere, the returned value will not be zero. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::insphere_s(REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* pe) +{ + REAL sign; + + inspherecount++; + + sign = insphere(pa, pb, pc, pd, pe); + if (sign != 0.0) { + return sign; + } + + insphere_sos_count++; + + // Symbolic perturbation. + point pt[5], swappt; + REAL oriA, oriB; + int swaps, count; + int n, i; + + pt[0] = pa; + pt[1] = pb; + pt[2] = pc; + pt[3] = pd; + pt[4] = pe; + + // Sort the five points such that their indices are in the increasing + // order. An optimized bubble sort algorithm is used, i.e., it has + // the worst case O(n^2) runtime, but it is usually much faster. + swaps = 0; // Record the total number of swaps. + n = 5; + do { + count = 0; + n = n - 1; + for (i = 0; i < n; i++) { + if (pointmark(pt[i]) > pointmark(pt[i+1])) { + swappt = pt[i]; pt[i] = pt[i+1]; pt[i+1] = swappt; + count++; + } + } + swaps += count; + } while (count > 0); // Continue if some points are swapped. + + oriA = orient3d(pt[1], pt[2], pt[3], pt[4]); + if (oriA != 0.0) { + // Flip the sign if there are odd number of swaps. + if ((swaps % 2) != 0) oriA = -oriA; + return oriA; + } + + oriB = -orient3d(pt[0], pt[2], pt[3], pt[4]); + assert(oriB != 0.0); // SELF_CHECK + // Flip the sign if there are odd number of swaps. + if ((swaps % 2) != 0) oriB = -oriB; + return oriB; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// iscollinear() Check if three points are approximately collinear. // +// // +// 'eps' is a relative error tolerance. The collinearity is determined by // +// the value q = cos(theta), where theta is the angle between two vectors // +// A->B and A->C. They're collinear if 1.0 - q <= epspp. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::iscollinear(REAL* A, REAL* B, REAL* C, REAL eps) +{ + REAL abx, aby, abz; + REAL acx, acy, acz; + REAL Lv, Lw, dd; + REAL d, q; + + // Limit of two closed points. + q = longest * eps; + q *= q; + + abx = A[0] - B[0]; + aby = A[1] - B[1]; + abz = A[2] - B[2]; + acx = A[0] - C[0]; + acy = A[1] - C[1]; + acz = A[2] - C[2]; + Lv = abx * abx + aby * aby + abz * abz; + // Is AB (nearly) indentical? + if (Lv < q) return true; + Lw = acx * acx + acy * acy + acz * acz; + // Is AC (nearly) indentical? + if (Lw < q) return true; + dd = abx * acx + aby * acy + abz * acz; + + d = (dd * dd) / (Lv * Lw); + if (d > 1.0) d = 1.0; // Rounding. + q = 1.0 - sqrt(d); // Notice 0 < q < 1.0. + + return q <= eps; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// iscoplanar() Check if four points are approximately coplanar. // +// // +// 'vol6' is six times of the signed volume of the tetrahedron formed by the // +// four points. 'eps' is the relative error tolerance. The coplanarity is // +// determined by the value: q = fabs(vol6) / L^3, where L is the average // +// edge length of the tet. They're coplanar if q <= eps. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh:: +iscoplanar(REAL* k, REAL* l, REAL* m, REAL* n, REAL vol6, REAL eps) +{ + REAL L, q; + REAL x, y, z; + + if (vol6 == 0.0) return true; + + x = k[0] - l[0]; + y = k[1] - l[1]; + z = k[2] - l[2]; + L = sqrt(x * x + y * y + z * z); + x = l[0] - m[0]; + y = l[1] - m[1]; + z = l[2] - m[2]; + L += sqrt(x * x + y * y + z * z); + x = m[0] - k[0]; + y = m[1] - k[1]; + z = m[2] - k[2]; + L += sqrt(x * x + y * y + z * z); + x = k[0] - n[0]; + y = k[1] - n[1]; + z = k[2] - n[2]; + L += sqrt(x * x + y * y + z * z); + x = l[0] - n[0]; + y = l[1] - n[1]; + z = l[2] - n[2]; + L += sqrt(x * x + y * y + z * z); + x = m[0] - n[0]; + y = m[1] - n[1]; + z = m[2] - n[2]; + L += sqrt(x * x + y * y + z * z); +#ifdef SELF_CHECK + assert(L > 0.0); +#endif + L /= 6.0; + q = fabs(vol6) / (L * L * L); + + return q <= eps; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// iscospheric() Check if five points are approximately coplanar. // +// // +// 'vol24' is the 24 times of the signed volume of the 4-dimensional simplex // +// formed by the five points. 'eps' is the relative tolerance. The cosphere // +// case is determined by the value: q = fabs(vol24) / L^4, where L is the // +// average edge length of the simplex. They're cosphere if q <= eps. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh:: +iscospheric(REAL* k, REAL* l, REAL* m, REAL* n, REAL* o, REAL vol24, REAL eps) +{ + REAL L, q; + + // A 4D simplex has 10 edges. + L = distance(k, l); + L += distance(l, m); + L += distance(m, k); + L += distance(k, n); + L += distance(l, n); + L += distance(m, n); + L += distance(k, o); + L += distance(l, o); + L += distance(m, o); + L += distance(n, o); +#ifdef SELF_CHECK + assert(L > 0.0); +#endif + L /= 10.0; + q = fabs(vol24) / (L * L * L * L); + + return q < eps; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// lu_decmp() Compute the LU decomposition of a matrix. // +// // +// Compute the LU decomposition of a (non-singular) square matrix A using // +// partial pivoting and implicit row exchanges. The result is: // +// A = P * L * U, // +// where P is a permutation matrix, L is unit lower triangular, and U is // +// upper triangular. The factored form of A is used in combination with // +// 'lu_solve()' to solve linear equations: Ax = b, or invert a matrix. // +// // +// The inputs are a square matrix 'lu[N..n+N-1][N..n+N-1]', it's size is 'n'.// +// On output, 'lu' is replaced by the LU decomposition of a rowwise permuta- // +// tion of itself, 'ps[N..n+N-1]' is an output vector that records the row // +// permutation effected by the partial pivoting, effectively, 'ps' array // +// tells the user what the permutation matrix P is; 'd' is output as +1/-1 // +// depending on whether the number of row interchanges was even or odd, // +// respectively. // +// // +// Return true if the LU decomposition is successfully computed, otherwise, // +// return false in case that A is a singular matrix. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::lu_decmp(REAL lu[4][4], int n, int* ps, REAL* d, int N) +{ + REAL scales[4]; + REAL pivot, biggest, mult, tempf; + int pivotindex = 0; + int i, j, k; + + *d = 1.0; // No row interchanges yet. + + for (i = N; i < n + N; i++) { // For each row. + // Find the largest element in each row for row equilibration + biggest = 0.0; + for (j = N; j < n + N; j++) + if (biggest < (tempf = fabs(lu[i][j]))) + biggest = tempf; + if (biggest != 0.0) + scales[i] = 1.0 / biggest; + else { + scales[i] = 0.0; + return false; // Zero row: singular matrix. + } + ps[i] = i; // Initialize pivot sequence. + } + + for (k = N; k < n + N - 1; k++) { // For each column. + // Find the largest element in each column to pivot around. + biggest = 0.0; + for (i = k; i < n + N; i++) { + if (biggest < (tempf = fabs(lu[ps[i]][k]) * scales[ps[i]])) { + biggest = tempf; + pivotindex = i; + } + } + if (biggest == 0.0) { + return false; // Zero column: singular matrix. + } + if (pivotindex != k) { // Update pivot sequence. + j = ps[k]; + ps[k] = ps[pivotindex]; + ps[pivotindex] = j; + *d = -(*d); // ...and change the parity of d. + } + + // Pivot, eliminating an extra variable each time + pivot = lu[ps[k]][k]; + for (i = k + 1; i < n + N; i++) { + lu[ps[i]][k] = mult = lu[ps[i]][k] / pivot; + if (mult != 0.0) { + for (j = k + 1; j < n + N; j++) + lu[ps[i]][j] -= mult * lu[ps[k]][j]; + } + } + } + + // (lu[ps[n + N - 1]][n + N - 1] == 0.0) ==> A is singular. + return lu[ps[n + N - 1]][n + N - 1] != 0.0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// lu_solve() Solves the linear equation: Ax = b, after the matrix A // +// has been decomposed into the lower and upper triangular // +// matrices L and U, where A = LU. // +// // +// 'lu[N..n+N-1][N..n+N-1]' is input, not as the matrix 'A' but rather as // +// its LU decomposition, computed by the routine 'lu_decmp'; 'ps[N..n+N-1]' // +// is input as the permutation vector returned by 'lu_decmp'; 'b[N..n+N-1]' // +// is input as the right-hand side vector, and returns with the solution // +// vector. 'lu', 'n', and 'ps' are not modified by this routine and can be // +// left in place for successive calls with different right-hand sides 'b'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::lu_solve(REAL lu[4][4], int n, int* ps, REAL* b, int N) +{ + int i, j; + REAL X[4], dot; + + for (i = N; i < n + N; i++) X[i] = 0.0; + + // Vector reduction using U triangular matrix. + for (i = N; i < n + N; i++) { + dot = 0.0; + for (j = N; j < i + N; j++) + dot += lu[ps[i]][j] * X[j]; + X[i] = b[ps[i]] - dot; + } + + // Back substitution, in L triangular matrix. + for (i = n + N - 1; i >= N; i--) { + dot = 0.0; + for (j = i + 1; j < n + N; j++) + dot += lu[ps[i]][j] * X[j]; + X[i] = (X[i] - dot) / lu[ps[i]][i]; + } + + for (i = N; i < n + N; i++) b[i] = X[i]; +} + +// initm44() initializes a 4x4 matrix. +static void initm44(REAL a00, REAL a01, REAL a02, REAL a03, + REAL a10, REAL a11, REAL a12, REAL a13, + REAL a20, REAL a21, REAL a22, REAL a23, + REAL a30, REAL a31, REAL a32, REAL a33, + REAL M[4][4]) +{ + M[0][0] = a00; M[0][1] = a01; M[0][2] = a02; M[0][3] = a03; + M[1][0] = a10; M[1][1] = a11; M[1][2] = a12; M[1][3] = a13; + M[2][0] = a20; M[2][1] = a21; M[2][2] = a22; M[2][3] = a23; + M[3][0] = a30; M[3][1] = a31; M[3][2] = a32; M[3][3] = a33; +} + +// m4xv4() multiplies a 4x4 matrix and 4x1 vector: v2 = m * v1 +static void m4xv4(REAL v2[4], REAL m[4][4], REAL v1[4]) +{ + v2[0] = m[0][0]*v1[0] + m[0][1]*v1[1] + m[0][2]*v1[2] + m[0][3]*v1[3]; + v2[1] = m[1][0]*v1[0] + m[1][1]*v1[1] + m[1][2]*v1[2] + m[1][3]*v1[3]; + v2[2] = m[2][0]*v1[0] + m[2][1]*v1[1] + m[2][2]*v1[2] + m[2][3]*v1[3]; + v2[3] = m[3][0]*v1[0] + m[3][1]*v1[1] + m[3][2]*v1[2] + m[3][3]*v1[3]; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// shortdistance() Returns the shortest distance from point p to a line // +// defined by two points e1 and e2. // +// // +// First compute the projection length l_p of the vector v1 = p - e1 along // +// the vector v2 = e2 - e1. Then Pythagoras' Theorem is used to compute the // +// shortest distance. // +// // +// This routine allows that p is collinear with the line. In this case, the // +// return value is zero. The two points e1 and e2 should not be identical. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::shortdistance(REAL* p, REAL* e1, REAL* e2) +{ + REAL v1[3], v2[3]; + REAL len, l_p; + + v1[0] = e2[0] - e1[0]; + v1[1] = e2[1] - e1[1]; + v1[2] = e2[2] - e1[2]; + v2[0] = p[0] - e1[0]; + v2[1] = p[1] - e1[1]; + v2[2] = p[2] - e1[2]; + + len = sqrt(dot(v1, v1)); +#ifdef SELF_CHECK + assert(len != 0.0); +#endif + v1[0] /= len; + v1[1] /= len; + v1[2] /= len; + l_p = dot(v1, v2); + + return sqrt(dot(v2, v2) - l_p * l_p); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// shortdistance() Returns the shortest distance from point p to a face. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::shortdistance(REAL* p, REAL* e1, REAL* e2, REAL* e3) +{ + REAL prj[3]; + + projpt2face(p, e1, e2, e3, prj); + return distance(p, prj); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// interiorangle() Return the interior angle (0 - 2 * PI) between vectors // +// o->p1 and o->p2. // +// // +// 'n' is the normal of the plane containing face (o, p1, p2). The interior // +// angle is the total angle rotating from o->p1 around n to o->p2. Exchange // +// the position of p1 and p2 will get the complement angle of the other one. // +// i.e., interiorangle(o, p1, p2) = 2 * PI - interiorangle(o, p2, p1). Set // +// 'n' be NULL if you only want the interior angle between 0 - PI. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::interiorangle(REAL* o, REAL* p1, REAL* p2, REAL* n) +{ + REAL v1[3], v2[3], np[3]; + REAL theta, costheta, lenlen; + REAL ori, len1, len2; + + // Get the interior angle (0 - PI) between o->p1, and o->p2. + v1[0] = p1[0] - o[0]; + v1[1] = p1[1] - o[1]; + v1[2] = p1[2] - o[2]; + v2[0] = p2[0] - o[0]; + v2[1] = p2[1] - o[1]; + v2[2] = p2[2] - o[2]; + len1 = sqrt(dot(v1, v1)); + len2 = sqrt(dot(v2, v2)); + lenlen = len1 * len2; +#ifdef SELF_CHECK + assert(lenlen != 0.0); +#endif + costheta = dot(v1, v2) / lenlen; + if (costheta > 1.0) { + costheta = 1.0; // Roundoff. + } else if (costheta < -1.0) { + costheta = -1.0; // Roundoff. + } + theta = acos(costheta); + if (n != NULL) { + // Get a point above the face (o, p1, p2); + np[0] = o[0] + n[0]; + np[1] = o[1] + n[1]; + np[2] = o[2] + n[2]; + // Adjust theta (0 - 2 * PI). + ori = orient3d(p1, o, np, p2); + if (ori > 0.0) { + theta = 2 * PI - theta; + } + } + + return theta; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// projpt2edge() Return the projection point from a point to an edge. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::projpt2edge(REAL* p, REAL* e1, REAL* e2, REAL* prj) +{ + REAL v1[3], v2[3]; + REAL len, l_p; + + v1[0] = e2[0] - e1[0]; + v1[1] = e2[1] - e1[1]; + v1[2] = e2[2] - e1[2]; + v2[0] = p[0] - e1[0]; + v2[1] = p[1] - e1[1]; + v2[2] = p[2] - e1[2]; + + len = sqrt(dot(v1, v1)); +#ifdef SELF_CHECK + assert(len != 0.0); +#endif + v1[0] /= len; + v1[1] /= len; + v1[2] /= len; + l_p = dot(v1, v2); + + prj[0] = e1[0] + l_p * v1[0]; + prj[1] = e1[1] + l_p * v1[1]; + prj[2] = e1[2] + l_p * v1[2]; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// projpt2face() Return the projection point from a point to a face. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::projpt2face(REAL* p, REAL* f1, REAL* f2, REAL* f3, REAL* prj) +{ + REAL fnormal[3], v1[3]; + REAL len, dist; + + // Get the unit face normal. + // facenormal(f1, f2, f3, fnormal, &len); + facenormal2(f1, f2, f3, fnormal, 1); + len = sqrt(fnormal[0]*fnormal[0] + fnormal[1]*fnormal[1] + + fnormal[2]*fnormal[2]); + fnormal[0] /= len; + fnormal[1] /= len; + fnormal[2] /= len; + // Get the vector v1 = |p - f1|. + v1[0] = p[0] - f1[0]; + v1[1] = p[1] - f1[1]; + v1[2] = p[2] - f1[2]; + // Get the project distance. + dist = dot(fnormal, v1); + + // Get the project point. + prj[0] = p[0] - dist * fnormal[0]; + prj[1] = p[1] - dist * fnormal[1]; + prj[2] = p[2] - dist * fnormal[2]; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// facenormal() Calculate the normal of a face given by three points. // +// // +// In general, the face normal can be calculate by the cross product of any // +// pair of the three edge vectors. However, if the three points are nearly // +// collinear, the rounding error may harm the result. To choose a good pair // +// of vectors is helpful to reduce the error. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::facenormal(REAL* pa, REAL* pb, REAL* pc, REAL* n, REAL* nlen) +{ + REAL v1[3], v2[3]; + + v1[0] = pb[0] - pa[0]; + v1[1] = pb[1] - pa[1]; + v1[2] = pb[2] - pa[2]; + v2[0] = pc[0] - pa[0]; + v2[1] = pc[1] - pa[1]; + v2[2] = pc[2] - pa[2]; + + cross(v1, v2, n); + if (nlen != (REAL *) NULL) { + *nlen = sqrt(dot(n, n)); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// facenormal() Calculate the normal of the face. // +// // +// The normal of the face abc can be calculated by the cross product of 2 of // +// its 3 edge vectors. A better choice of two edge vectors will reduce the // +// numerical error during the calculation. Burdakov proved that the optimal // +// basis problem is equivalent to the minimum spanning tree problem with the // +// edge length be the functional, see Burdakov, "A greedy algorithm for the // +// optimal basis problem", BIT 37:3 (1997), 591-599. If 'pivot' > 0, the two // +// short edges in abc are chosen for the calculation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::facenormal2(point pa, point pb, point pc, REAL *n, int pivot) +{ + REAL v1[3], v2[3], v3[3], *pv1, *pv2; + REAL L1, L2, L3; + + v1[0] = pb[0] - pa[0]; // edge vector v1: a->b + v1[1] = pb[1] - pa[1]; + v1[2] = pb[2] - pa[2]; + v2[0] = pa[0] - pc[0]; // edge vector v2: c->a + v2[1] = pa[1] - pc[1]; + v2[2] = pa[2] - pc[2]; + + // Default, normal is calculated by: v1 x (-v2) (see Fig. fnormal). + if (pivot > 0) { + // Choose edge vectors by Burdakov's algorithm. + v3[0] = pc[0] - pb[0]; // edge vector v3: b->c + v3[1] = pc[1] - pb[1]; + v3[2] = pc[2] - pb[2]; + L1 = DOT(v1, v1); + L2 = DOT(v2, v2); + L3 = DOT(v3, v3); + // Sort the three edge lengths. + if (L1 < L2) { + if (L2 < L3) { + pv1 = v1; pv2 = v2; // n = v1 x (-v2). + } else { + pv1 = v3; pv2 = v1; // n = v3 x (-v1). + } + } else { + if (L1 < L3) { + pv1 = v1; pv2 = v2; // n = v1 x (-v2). + } else { + pv1 = v2; pv2 = v3; // n = v2 x (-v3). + } + } + } else { + pv1 = v1; pv2 = v2; // n = v1 x (-v2). + } + + // Calculate the face normal. + CROSS(pv1, pv2, n); + // Inverse the direction; + n[0] = -n[0]; + n[1] = -n[1]; + n[2] = -n[2]; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// edgeorthonormal() Return the unit normal of an edge in a given plane. // +// // +// The edge is from e1 to e2, the plane is defined by given an additional // +// point op, which is non-collinear with the edge. In addition, the side of // +// the edge in which op lies defines the positive position of the normal. // +// // +// Let v1 be the unit vector from e1 to e2, v2 be the unit edge vector from // +// e1 to op, fn be the unit face normal calculated by fn = v1 x v2. Then the // +// unit edge normal of e1e2 pointing to op is n = fn x v1. Note, we should // +// not change the position of fn and v1, otherwise, we get the edge normal // +// pointing to the other side of op. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::edgeorthonormal(REAL* e1, REAL* e2, REAL* op, REAL* n) +{ + REAL v1[3], v2[3], fn[3]; + REAL len; + + // Get the edge vector v1. + v1[0] = e2[0] - e1[0]; + v1[1] = e2[1] - e1[1]; + v1[2] = e2[2] - e1[2]; + // Get the edge vector v2. + v2[0] = op[0] - e1[0]; + v2[1] = op[1] - e1[1]; + v2[2] = op[2] - e1[2]; + // Get the face normal fn = v1 x v2. + cross(v1, v2, fn); + // Get the edge normal n pointing to op. n = fn x v1. + cross(fn, v1, n); + // Normalize the vector. + len = sqrt(dot(n, n)); + n[0] /= len; + n[1] /= len; + n[2] /= len; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// facedihedral() Return the dihedral angle (in radian) between two // +// adjoining faces. // +// // +// 'pa', 'pb' are the shared edge of these two faces, 'pc1', and 'pc2' are // +// apexes of these two faces. Return the angle (between 0 to 2*pi) between // +// the normal of face (pa, pb, pc1) and normal of face (pa, pb, pc2). // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::facedihedral(REAL* pa, REAL* pb, REAL* pc1, REAL* pc2) +{ + REAL n1[3], n2[3]; + REAL n1len, n2len; + REAL costheta, ori; + REAL theta; + + facenormal(pa, pb, pc1, n1, &n1len); + facenormal(pa, pb, pc2, n2, &n2len); + costheta = dot(n1, n2) / (n1len * n2len); + // Be careful rounding error! + if (costheta > 1.0) { + costheta = 1.0; + } else if (costheta < -1.0) { + costheta = -1.0; + } + theta = acos(costheta); + ori = orient3d(pa, pb, pc1, pc2); + if (ori > 0.0) { + theta = 2 * PI - theta; + } + + return theta; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetalldihedral() Get all (six) dihedral angles of a tet. // +// // +// The tet is given by its four corners a, b, c, and d. If 'cosdd' is not // +// NULL, it returns the cosines of the 6 dihedral angles, the corresponding // +// edges are: ab, bc, ca, ad, bd, and cd. If 'cosmaxd' (or 'cosmind') is not // +// NULL, it returns the cosine of the maximal (or minimal) dihedral angle. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::tetalldihedral(point pa, point pb, point pc, point pd, + REAL* cosdd, REAL* cosmaxd, REAL* cosmind) +{ + REAL N[4][3], vol, cosd, len; + int f1, f2, i, j; + + vol = 0; // Check if the tet is valid or not. + + // Get four normals of faces of the tet. + tetallnormal(pa, pb, pc, pd, N, &vol); + + if (vol == 0.0) { + // This tet is not valid. + if (cosdd != NULL) { + for (i = 0; i < 6; i++) { + cosdd[i] = -1.0; // 180 degree. + } + } + // This tet has zero volume. + if (cosmaxd != NULL) { + *cosmaxd = -1.0; // 180 degree. + } + if (cosmind != NULL) { + *cosmind = 1.0; // 0 degree. + } + return; + } + + // Normalize the normals. + for (i = 0; i < 4; i++) { + len = sqrt(dot(N[i], N[i])); + if (len != 0.0) { + for (j = 0; j < 3; j++) N[i][j] /= len; + } + } + + for (i = 0; i < 6; i++) { + switch (i) { + case 0: f1 = 2; f2 = 3; break; // edge ab. + case 1: f1 = 0; f2 = 3; break; // edge bc. + case 2: f1 = 1; f2 = 3; break; // edge ca. + case 3: f1 = 1; f2 = 2; break; // edge ad. + case 4: f1 = 2; f2 = 0; break; // edge bd. + case 5: f1 = 0; f2 = 1; break; // edge cd. + } + cosd = -dot(N[f1], N[f2]); + if (cosdd) cosdd[i] = cosd; + if (i == 0) { + if (cosmaxd) *cosmaxd = cosd; + if (cosmind) *cosmind = cosd; + } else { + if (cosmaxd) *cosmaxd = cosd < *cosmaxd ? cosd : *cosmaxd; + if (cosmind) *cosmind = cosd > *cosmind ? cosd : *cosmind; + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetallnormal() Get the in-noramls of the four faces of a given tet. // +// // +// Let tet be abcd. N[4][3] returns the four normals, which are: N[0] cbd, // +// N[1] acd, N[2] bad, N[3] abc. These normals are unnormalized. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::tetallnormal(point pa, point pb, point pc, point pd, + REAL N[4][3], REAL* volume) +{ + REAL A[4][4], rhs[4], D; + int indx[4]; + int i, j; + + // get the entries of A[3][3]. + for (i = 0; i < 3; i++) A[0][i] = pa[i] - pd[i]; // d->a vec + for (i = 0; i < 3; i++) A[1][i] = pb[i] - pd[i]; // d->b vec + for (i = 0; i < 3; i++) A[2][i] = pc[i] - pd[i]; // d->c vec + // Compute the inverse of matrix A, to get 3 normals of the 4 faces. + lu_decmp(A, 3, indx, &D, 0); // Decompose the matrix just once. + if (volume != NULL) { + // Get the volume of the tet. + *volume = fabs((A[indx[0]][0] * A[indx[1]][1] * A[indx[2]][2])) / 6.0; + } + for (j = 0; j < 3; j++) { + for (i = 0; i < 3; i++) rhs[i] = 0.0; + rhs[j] = 1.0; // Positive means the inside direction + lu_solve(A, 3, indx, rhs, 0); + for (i = 0; i < 3; i++) N[j][i] = rhs[i]; + } + // Get the fourth normal by summing up the first three. + for (i = 0; i < 3; i++) N[3][i] = - N[0][i] - N[1][i] - N[2][i]; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetaspectratio() Calculate the aspect ratio of the tetrahedron. // +// // +// The aspect ratio of a tet is R/h, where R is the circumradius and h is // +// the shortest height of the tet. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::tetaspectratio(point pa, point pb, point pc, point pd) +{ + REAL vda[3], vdb[3], vdc[3]; + REAL N[4][3], A[4][4], rhs[4], D; + REAL H[4], volume, radius2, minheightinv; + int indx[4]; + int i, j; + + // Set the matrix A = [vda, vdb, vdc]^T. + for (i = 0; i < 3; i++) A[0][i] = vda[i] = pa[i] - pd[i]; + for (i = 0; i < 3; i++) A[1][i] = vdb[i] = pb[i] - pd[i]; + for (i = 0; i < 3; i++) A[2][i] = vdc[i] = pc[i] - pd[i]; + // Lu-decompose the matrix A. + lu_decmp(A, 3, indx, &D, 0); + // Get the volume of abcd. + volume = (A[indx[0]][0] * A[indx[1]][1] * A[indx[2]][2]) / 6.0; + // Check if it is zero. + if (volume == 0.0) return 1.0e+200; // A degenerate tet. + // if (volume < 0.0) volume = -volume; + // Check the radiu-edge ratio of the tet. + rhs[0] = 0.5 * dot(vda, vda); + rhs[1] = 0.5 * dot(vdb, vdb); + rhs[2] = 0.5 * dot(vdc, vdc); + lu_solve(A, 3, indx, rhs, 0); + // Get the circumcenter. + // for (i = 0; i < 3; i++) circumcent[i] = pd[i] + rhs[i]; + // Get the square of the circumradius. + radius2 = dot(rhs, rhs); + + // Compute the 4 face normals (N[0], ..., N[3]). + for (j = 0; j < 3; j++) { + for (i = 0; i < 3; i++) rhs[i] = 0.0; + rhs[j] = 1.0; // Positive means the inside direction + lu_solve(A, 3, indx, rhs, 0); + for (i = 0; i < 3; i++) N[j][i] = rhs[i]; + } + // Get the fourth normal by summing up the first three. + for (i = 0; i < 3; i++) N[3][i] = - N[0][i] - N[1][i] - N[2][i]; + // Normalized the normals. + for (i = 0; i < 4; i++) { + // H[i] is the inverse of the height of its corresponding face. + H[i] = sqrt(dot(N[i], N[i])); + // if (H[i] > 0.0) { + // for (j = 0; j < 3; j++) N[i][j] /= H[i]; + // } + } + // Get the radius of the inscribed sphere. + // insradius = 1.0 / (H[0] + H[1] + H[2] + H[3]); + // Get the biggest H[i] (corresponding to the smallest height). + minheightinv = H[0]; + for (i = 1; i < 3; i++) { + if (H[i] > minheightinv) minheightinv = H[i]; + } + + return sqrt(radius2) * minheightinv; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// circumsphere() Calculate the smallest circumsphere (center and radius) // +// of the given three or four points. // +// // +// The circumsphere of four points (a tetrahedron) is unique if they are not // +// degenerate. If 'pd = NULL', the smallest circumsphere of three points is // +// the diametral sphere of the triangle if they are not degenerate. // +// // +// Return TRUE if the input points are not degenerate and the circumcenter // +// and circumradius are returned in 'cent' and 'radius' respectively if they // +// are not NULLs. Otherwise, return FALSE indicated the points are degenrate.// +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh:: +circumsphere(REAL* pa, REAL* pb, REAL* pc, REAL* pd, REAL* cent, REAL* radius) +{ + REAL A[4][4], rhs[4], D; + int indx[4]; + + // Compute the coefficient matrix A (3x3). + A[0][0] = pb[0] - pa[0]; + A[0][1] = pb[1] - pa[1]; + A[0][2] = pb[2] - pa[2]; + A[1][0] = pc[0] - pa[0]; + A[1][1] = pc[1] - pa[1]; + A[1][2] = pc[2] - pa[2]; + if (pd != NULL) { + A[2][0] = pd[0] - pa[0]; + A[2][1] = pd[1] - pa[1]; + A[2][2] = pd[2] - pa[2]; + } else { + cross(A[0], A[1], A[2]); + } + + // Compute the right hand side vector b (3x1). + rhs[0] = 0.5 * dot(A[0], A[0]); + rhs[1] = 0.5 * dot(A[1], A[1]); + if (pd != NULL) { + rhs[2] = 0.5 * dot(A[2], A[2]); + } else { + rhs[2] = 0.0; + } + + // Solve the 3 by 3 equations use LU decomposition with partial pivoting + // and backward and forward substitute.. + if (!lu_decmp(A, 3, indx, &D, 0)) { + if (radius != (REAL *) NULL) *radius = 0.0; + return false; + } + lu_solve(A, 3, indx, rhs, 0); + if (cent != (REAL *) NULL) { + cent[0] = pa[0] + rhs[0]; + cent[1] = pa[1] + rhs[1]; + cent[2] = pa[2] + rhs[2]; + } + if (radius != (REAL *) NULL) { + *radius = sqrt(rhs[0] * rhs[0] + rhs[1] * rhs[1] + rhs[2] * rhs[2]); + } + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// inscribedsphere() Compute the radius and center of the biggest // +// inscribed sphere of a given tetrahedron. // +// // +// The tetrahedron is given by its four points, it must not be degenerate. // +// The center and radius are returned in 'cent' and 'radius' respectively if // +// they are not NULLs. // +// // +// Geometrical fact. For any simplex in d dimension, // +// r/h1 + r/h2 + ... r/hn = 1 (n <= d + 1); // +// where r is the radius of inscribed ball, and h is the height of each side // +// of the simplex. The value of 'r/h' is just the barycenter coordinates of // +// each vertex of the simplex. Therefore, we can compute the radius and // +// center of the smallest inscribed ball as following equations: // +// r = 1.0 / (1/h1 + 1/h2 + ... + 1/hn); (1) // +// C = r/h1 * P1 + r/h2 * P2 + ... + r/hn * Pn; (2) // +// where C is the vector of center, P1, P2, .. Pn are vectors of vertices. // +// Here (2) contains n linear equations with n variables. (h, P) must be a // +// pair, h is the height from P to its opposite face. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::inscribedsphere(REAL* pa, REAL* pb, REAL* pc, REAL* pd, + REAL* cent, REAL* radius) +{ + REAL N[4][3], H[4]; // Normals (colume vectors) and heights of each face. + REAL rd; + int i; + + // Get the all normals of the tet. + tetallnormal(pa, pb, pc, pd, N, NULL); + for (i = 0; i < 4; i++) { + // H[i] is the inverse of height of its corresponding face. + H[i] = sqrt(dot(N[i], N[i])); + } + // Compute the radius use eq. (1). + rd = 1.0 / (H[0] + H[1] + H[2] + H[3]); + if (radius != (REAL*) NULL) *radius = rd; + if (cent != (REAL*) NULL) { + // Compute the center use eq. (2). + cent[0] = rd * (H[0] * pa[0] + H[1] * pb[0] + H[2] * pc[0] + H[3] * pd[0]); + cent[1] = rd * (H[0] * pa[1] + H[1] * pb[1] + H[2] * pc[1] + H[3] * pd[1]); + cent[2] = rd * (H[0] * pa[2] + H[1] * pb[2] + H[2] * pc[2] + H[3] * pd[2]); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// rotatepoint() Create a point by rotating an existing point. // +// // +// Create a 3D point by rotating point 'p' with an angle 'rotangle' (in arc // +// degree) around a rotating axis given by a vector from point 'p1' to 'p2'. // +// The rotation is according with right-hand rule, i.e., use your right-hand // +// to grab the axis with your thumber pointing to its positive direction, // +// your fingers indicate the rotating direction. // +// // +// The rotating steps are the following: // +// 1. Translate vector 'p1->p2' to origin, M1; // +// 2. Rotate vector around the Y-axis until it lies in the YZ plane, M2; // +// 3. Rotate vector around the X-axis until it lies on the Z axis, M3; // +// 4. Perform the rotation of 'p' around the z-axis, M4; // +// 5. Undo Step 3, M5; // +// 6. Undo Step 2, M6; // +// 7. Undo Step 1, M7; // +// Use matrix multiplication to combine the above sequences, we get: // +// p0' = T * p0, where T = M7 * M6 * M5 * M4 * M3 * M2 * M1 // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::rotatepoint(REAL* p, REAL rotangle, REAL* p1, REAL* p2) +{ + REAL T[4][4], pp0[4], p0t[4], p2t[4]; + REAL roty, rotx, alphaR, projlen; + REAL dx, dy, dz; + + initm44(1, 0, 0, -p1[0], + 0, 1, 0, -p1[1], + 0, 0, 1, -p1[2], + 0, 0, 0, 1, T); + pp0[0] = p[0]; pp0[1] = p[1]; pp0[2] = p[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 1 + pp0[0] = p2[0]; pp0[1] = p2[1]; pp0[2] = p2[2]; pp0[3] = 1.0; + m4xv4(p2t, T, pp0); // Step 1 + + // Get the rotation angle around y-axis; + dx = p2t[0]; + dz = p2t[2]; + projlen = sqrt(dx * dx + dz * dz); + if (projlen <= (b->epsilon * 1e-2) * longest) { + roty = 0; + } else { + roty = acos(dz / projlen); + if (dx < 0) { + roty = -roty; + } + } + + initm44(cos(-roty), 0, sin(-roty), 0, + 0, 1, 0, 0, + -sin(-roty), 0, cos(-roty), 0, + 0, 0, 0, 1, T); + pp0[0] = p0t[0]; pp0[1] = p0t[1]; pp0[2] = p0t[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 2 + pp0[0] = p2t[0]; pp0[1] = p2t[1]; pp0[2] = p2t[2]; pp0[3] = 1.0; + m4xv4(p2t, T, pp0); // Step 2 + + // Get the rotation angle around x-axis + dy = p2t[1]; + dz = p2t[2]; + projlen = sqrt(dy * dy + dz * dz); + if (projlen <= (b->epsilon * 1e-2) * longest) { + rotx = 0; + } else { + rotx = acos(dz / projlen); + if (dy < 0) { + rotx = -rotx; + } + } + + initm44(1, 0, 0, 0, + 0, cos(rotx), -sin(rotx), 0, + 0, sin(rotx), cos(rotx), 0, + 0, 0, 0, 1, T); + pp0[0] = p0t[0]; pp0[1] = p0t[1]; pp0[2] = p0t[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 3 + // pp0[0] = p2t[0]; pp0[1] = p2t[1]; pp0[2] = p2t[2]; pp0[3] = 1.0; + // m4xv4(p2t, T, pp0); // Step 3 + + alphaR = rotangle; + initm44(cos(alphaR), -sin(alphaR), 0, 0, + sin(alphaR), cos(alphaR), 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, T); + pp0[0] = p0t[0]; pp0[1] = p0t[1]; pp0[2] = p0t[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 4 + + initm44(1, 0, 0, 0, + 0, cos(-rotx), -sin(-rotx), 0, + 0, sin(-rotx), cos(-rotx), 0, + 0, 0, 0, 1, T); + pp0[0] = p0t[0]; pp0[1] = p0t[1]; pp0[2] = p0t[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 5 + + initm44(cos(roty), 0, sin(roty), 0, + 0, 1, 0, 0, + -sin(roty), 0, cos(roty), 0, + 0, 0, 0, 1, T); + pp0[0] = p0t[0]; pp0[1] = p0t[1]; pp0[2] = p0t[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 6 + + initm44(1, 0, 0, p1[0], + 0, 1, 0, p1[1], + 0, 0, 1, p1[2], + 0, 0, 0, 1, T); + pp0[0] = p0t[0]; pp0[1] = p0t[1]; pp0[2] = p0t[2]; pp0[3] = 1.0; + m4xv4(p0t, T, pp0); // Step 7 + + p[0] = p0t[0]; + p[1] = p0t[1]; + p[2] = p0t[2]; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// planelineint() Calculate the intersection of a line and a plane. // +// // +// The equation of a plane (points P are on the plane with normal N and P3 // +// on the plane) can be written as: N dot (P - P3) = 0. The equation of the // +// line (points P on the line passing through P1 and P2) can be written as: // +// P = P1 + u (P2 - P1). The intersection of these two occurs when: // +// N dot (P1 + u (P2 - P1)) = N dot P3. // +// Solving for u gives: // +// N dot (P3 - P1) // +// u = ------------------. // +// N dot (P2 - P1) // +// If the denominator is 0 then N (the normal to the plane) is perpendicular // +// to the line. Thus the line is either parallel to the plane and there are // +// no solutions or the line is on the plane in which case there are an infi- // +// nite number of solutions. // +// // +// The plane is given by three points pa, pb, and pc, e1 and e2 defines the // +// line. If u is non-zero, The intersection point (if exists) returns in ip. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::planelineint(REAL* pa, REAL* pb, REAL* pc, REAL* e1, REAL* e2, + REAL* ip, REAL* u) +{ + REAL n[3], det, det1; + + // Calculate N. + facenormal2(pa, pb, pc, n, 1); + // Calculate N dot (e2 - e1). + det = n[0] * (e2[0] - e1[0]) + n[1] * (e2[1] - e1[1]) + + n[2] * (e2[2] - e1[2]); + if (det != 0.0) { + // Calculate N dot (pa - e1) + det1 = n[0] * (pa[0] - e1[0]) + n[1] * (pa[1] - e1[1]) + + n[2] * (pa[2] - e1[2]); + *u = det1 / det; + ip[0] = e1[0] + *u * (e2[0] - e1[0]); + ip[1] = e1[1] + *u * (e2[1] - e1[1]); + ip[2] = e1[2] + *u * (e2[2] - e1[2]); + } else { + *u = 0.0; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// randomnation() Generate a random number between 0 and 'choices' - 1. // +// // +/////////////////////////////////////////////////////////////////////////////// + +unsigned long tetgenmesh::randomnation(unsigned int choices) +{ + unsigned long newrandom; + + if (choices >= 714025l) { + newrandom = (randomseed * 1366l + 150889l) % 714025l; + randomseed = (newrandom * 1366l + 150889l) % 714025l; + newrandom = newrandom * (choices / 714025l) + randomseed; + if (newrandom >= choices) { + return newrandom - choices; + } else { + return newrandom; + } + } else { + randomseed = (randomseed * 1366l + 150889l) % 714025l; + return randomseed % choices; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// distance2() Returns the square "distance" of a tetrahedron to point p. // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL tetgenmesh::distance2(tetrahedron* tetptr, point p) +{ + point p1, p2, p3, p4; + REAL dx, dy, dz; + + p1 = (point) tetptr[4]; + p2 = (point) tetptr[5]; + p3 = (point) tetptr[6]; + p4 = (point) tetptr[7]; + + dx = p[0] - 0.25 * (p1[0] + p2[0] + p3[0] + p4[0]); + dy = p[1] - 0.25 * (p1[1] + p2[1] + p3[1] + p4[1]); + dz = p[2] - 0.25 * (p1[2] + p2[2] + p3[2] + p4[2]); + + return dx * dx + dy * dy + dz * dz; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// preciselocate() Find a simplex containing a given point. // +// // +// This routine implements the simple Walk-through point location algorithm. // +// Begins its search from 'searchtet', assume there is a line segment L from // +// a vertex of 'searchtet' to the query point 'searchpt', and simply walk // +// towards 'searchpt' by traversing all faces intersected by L. // +// // +// On completion, 'searchtet' is a tetrahedron that contains 'searchpt'. The // +// returned value indicates one of the following cases: // +// - ONVERTEX, the search point lies on the origin of 'searchtet'. // +// - ONEDGE, the search point lies on an edge of 'searchtet'. // +// - ONFACE, the search point lies on a face of 'searchtet'. // +// - INTET, the search point lies in the interior of 'searchtet'. // +// - OUTSIDE, the search point lies outside the mesh. 'searchtet' is a // +// hull tetrahedron whose base face is visible by the search point. // +// // +// WARNING: This routine is designed for convex triangulations, and will not // +// generally work after the holes and concavities have been carved. // +// // +// If 'maxtetnumber' > 0, stop the searching process if the number of passed // +// tets is larger than it and return OUTSIDE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::preciselocate(point searchpt, + triface* searchtet, long maxtetnumber) +{ + triface backtracetet; + triface walkthroface; + point forg, fdest, fapex, toppo; + REAL ori1, ori2, ori3, ori4; + long tetnumber; + int side; + + if (isdead(searchtet)) searchtet->tet = dummytet; + if (searchtet->tet == dummytet) { + searchtet->loc = 0; + symself(*searchtet); + } + // 'searchtet' should be a valid tetrahedron now. +#ifdef SELF_CHECK + assert(searchtet->tet != dummytet); +#endif + + searchtet->ver = 0; // Keep in CCW edge ring. + // Find a face of 'searchtet' such that the 'searchpt' lies strictly + // above it. Such face should always exist. + for (searchtet->loc = 0; searchtet->loc < 4; searchtet->loc++) { + forg = org(*searchtet); + fdest = dest(*searchtet); + fapex = apex(*searchtet); + ori1 = orient3d(forg, fdest, fapex, searchpt); + if (ori1 < 0.0) break; + } +#ifdef SELF_CHECK + assert(searchtet->loc < 4); +#endif + + backtracetet = *searchtet; // Initialize backtracetet. + + // Define 'tetnumber' for exit the loop when it's running endless. + tetnumber = 0l; + while ((maxtetnumber > 0l) && (tetnumber <= maxtetnumber)) { + ptloc_count++; // Algorithimic count. + // Check if we are reaching the boundary of the triangulation. + if (searchtet->tet == dummytet) { + *searchtet = backtracetet; + return OUTSIDE; + } + // Initialize the face for returning the walk-through face. + walkthroface.tet = (tetrahedron *) NULL; + // Adjust the edge ring, so that 'ori1 < 0.0' holds. + searchtet->ver = 0; + // 'toppo' remains unchange for the following orientation tests. + toppo = oppo(*searchtet); + // Check the three sides of 'searchtet' to find the face through which + // we can walk next. + for (side = 0; side < 3; side++) { + forg = org(*searchtet); + fdest = dest(*searchtet); + ori2 = orient3d(forg, fdest, toppo, searchpt); + if (ori2 == 0.0) { + // They are coplanar, check if 'searchpt' lies inside, or on an edge, + // or coindice with a vertex of face (forg, fdest, toppo). + fapex = apex(*searchtet); + ori3 = orient3d(fdest, fapex, toppo, searchpt); + if (ori3 < 0.0) { + // Outside the face (fdest, fapex, toppo), walk through it. + enextself(*searchtet); + fnext(*searchtet, walkthroface); + break; + } + ori4 = orient3d(fapex, forg, toppo, searchpt); + if (ori4 < 0.0) { + // Outside the face (fapex, forg, toppo), walk through it. + enext2self(*searchtet); + fnext(*searchtet, walkthroface); + break; + } + // Remember, ori1 < 0.0, which means that 'searchpt' will not on edge + // (forg, fdest) or on vertex forg or fdest. + // The rest possible cases are: + // (1) 'searchpt' lies on edge (fdest, toppo); + // (2) 'searchpt' lies on edge (toppo, forg); + // (3) 'searchpt' coincident with toppo; + // (4) 'searchpt' lies inside face (forg, fdest, toppo). + fnextself(*searchtet); + if (ori3 == 0.0) { + if (ori4 == 0.0) { + // Case (4). + enext2self(*searchtet); + return ONVERTEX; + } else { + // Case (1). + enextself(*searchtet); + return ONEDGE; + } + } + if (ori4 == 0.0) { + // Case (2). + enext2self(*searchtet); + return ONEDGE; + } + // Case (4). + return ONFACE; + } else if (ori2 < 0.0) { + // Outside the face (forg, fdest, toppo), walk through it. + fnext(*searchtet, walkthroface); + break; + } + // Go to check next side. + enextself(*searchtet); + } + if (side == 3) { + // Found! Inside tetrahedron. + return INTETRAHEDRON; + } + // We walk through the face 'walkthroface' and continue the searching. + // Store the face handle in 'backtracetet' before we take the real walk. + // So we are able to restore the handle to 'searchtet' if we are + // reaching the outer boundary. + backtracetet = walkthroface; + sym(walkthroface, *searchtet); + tetnumber++; + } + + if (!b->quiet && b->verbose) { + printf("Warning: Point location stopped after searching %ld tets.\n", + maxtetnumber); + } + // terminatetetgen(2); + return OUTSIDE; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// randomsample() Randomly sample the tetrahedra for point loation. // +// // +// This routine implements Muecke's Jump-and-walk point location algorithm. // +// It improves the simple walk-through by "jumping" to a good starting point // +// via random sampling. Searching begins from one of handles: the input // +// 'searchtet', a recently encountered tetrahedron 'recenttet', or from one // +// chosen from a random sample. The choice is made by determining which one // +// 's origin is closest to the point we are searcing for. Having chosen the // +// starting tetrahedron, the simple Walk-through algorithm is executed. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::randomsample(point searchpt, triface *searchtet) +{ + tetrahedron *firsttet, *tetptr; + void **sampleblock; + long sampleblocks, samplesperblock, samplenum; + long tetblocks, i, j; + uintptr_t alignptr; + REAL searchdist, dist; + + // 'searchtet' should be a valid tetrahedron. + if (isdead(searchtet)) { + searchtet->tet = dummytet; + } + if (searchtet->tet == dummytet) { + // This is an 'Outer Space' handle, get a hull tetrahedron. + searchtet->loc = 0; + symself(*searchtet); + } + + // Note 'searchtet' may be dead (chnaged in constrainedcavity2()). + if (!isdead(searchtet)) { + // Get the distance from the suggested starting tet to the point we seek. + searchdist = distance2(searchtet->tet, searchpt); + } else { + searchdist = longest * longest; + } + + // If a recently encountered tetrahedron has been recorded and has not + // been deallocated, test it as a good starting point. + if (!isdead(&recenttet) && (recenttet.tet != searchtet->tet)) { + dist = distance2(recenttet.tet, searchpt); + if (dist < searchdist) { + *searchtet = recenttet; + searchdist = dist; + } + } + + // Select "good" candidate using k random samples, taking the closest one. + // The number of random samples taken is proportional to the fourth root + // of the number of tetrahedra in the mesh. The next bit of code assumes + // that the number of tetrahedra increases monotonically. + while (SAMPLEFACTOR * samples * samples * samples * samples < + tetrahedrons->items) { + samples++; + } + // Find how much blocks in current tet pool. + tetblocks = (tetrahedrons->maxitems + ELEPERBLOCK - 1) / ELEPERBLOCK; + // Find the average samles per block. Each block at least have 1 sample. + samplesperblock = 1 + (samples / tetblocks); + sampleblocks = samples / samplesperblock; + sampleblock = tetrahedrons->firstblock; + for (i = 0; i < sampleblocks; i++) { + alignptr = (uintptr_t) (sampleblock + 1); + firsttet = (tetrahedron *) + (alignptr + (uintptr_t) tetrahedrons->alignbytes + - (alignptr % (uintptr_t) tetrahedrons->alignbytes)); + for (j = 0; j < samplesperblock; j++) { + if (i == tetblocks - 1) { + // This is the last block. + samplenum = randomnation((int) + (tetrahedrons->maxitems - (i * ELEPERBLOCK))); + } else { + samplenum = randomnation(ELEPERBLOCK); + } + tetptr = (tetrahedron *) + (firsttet + (samplenum * tetrahedrons->itemwords)); + if (tetptr[4] != (tetrahedron) NULL) { + dist = distance2(tetptr, searchpt); + if (dist < searchdist) { + searchtet->tet = tetptr; + searchdist = dist; + } + } + } + sampleblock = (void **) *sampleblock; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// locate() Find a simplex containing a given point. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::locate(point searchpt, + triface *searchtet) +{ + // Randomly sample for a good starting tet. + randomsample(searchpt, searchtet); + // Call simple walk-through to locate the point. + return preciselocate(searchpt, searchtet, tetrahedrons->items); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// locate2() Find a simplex containing a given point. // +// // +// Another implementation of the Walk-through point location algorithm. // +// See the comments of preciselocate(). // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::locate2(point searchpt, + triface* searchtet, arraypool *histtetarray) +{ + triface neightet, backtracetet, *parytet; + point torg, tdest, tapex, toppo, ntoppo; + enum {ORGMOVE, DESTMOVE, APEXMOVE} nextmove; + REAL ori, oriorg, oridest, oriapex; + REAL searchdist, dist; + enum locateresult loc; + int i; + + if (searchtet->tet == dummytet) { + // A hull tet. Choose the neighbor of its base face. + searchtet->loc = 0; + symself(*searchtet); + } + + // Stay in the 0th edge ring. + searchtet->ver = 0; + + // Let searchtet be the face such that 'searchpt' lies above to it. + for (searchtet->loc = 0; searchtet->loc < 4; searchtet->loc++) { + torg = org(*searchtet); + tdest = dest(*searchtet); + tapex = apex(*searchtet); + ori = orient3d(torg, tdest, tapex, searchpt); orient3dcount++; + if (ori < 0.0) break; + } + if (!(searchtet->loc < 4)) { + // Either 'searchtet' is a very flat tet, or the 'searchpt' lies in + // infinity, or both of them. Return OUTSIDE. + return OUTSIDE; + } + + if (histtetarray != NULL) { + // Remember all the tets we've visited. + assert(histtetarray->objects == 0l); + infect(*searchtet); + histtetarray->newindex((void **) &parytet); + *parytet = *searchtet; + } + + loc = OUTSIDE; // Set a default return value. + + // Walk through tetrahedra to locate the point. + while (true) { + + ptloc_count++; // Algorithimic count. + + toppo = oppo(*searchtet); + + // Check if the vertex is we seek. + if (toppo == searchpt) { + // Adjust the origin of searchtet to be searchpt. + fnextself(*searchtet); + esymself(*searchtet); + enext2self(*searchtet); + loc = ONVERTEX; // return ONVERTEX; + break; + } + + // We enter from serarchtet's base face. There are three other faces in + // searchtet (all connecting to toppo), which one is the exit? + oriorg = orient3d(tdest, tapex, toppo, searchpt); + oridest = orient3d(tapex, torg, toppo, searchpt); + oriapex = orient3d(torg, tdest, toppo, searchpt); + orient3dcount+=3; + + // Now decide which face to move. It is possible there are more than one + // faces are viable moves. Use the opposite points of thier neighbors + // to discriminate, i.e., we choose the face whose opposite point has + // the shortest distance to searchpt. + if (oriorg < 0) { + if (oridest < 0) { + if (oriapex < 0) { + // Any of the three faces is a viable move. + nextmove = ORGMOVE; + enextfnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + searchdist = NORM2(searchpt[0] - ntoppo[0], + searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + searchdist = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + dist = NORM2(searchpt[0] - ntoppo[0], searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + dist = searchdist; + } + if (dist < searchdist) { + nextmove = DESTMOVE; + searchdist = dist; + } + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + dist = NORM2(searchpt[0] - ntoppo[0], searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + dist = searchdist; + } + if (dist < searchdist) { + nextmove = APEXMOVE; + searchdist = dist; + } + } else { + // Two faces, opposite to origin and destination, are viable. + nextmove = ORGMOVE; + enextfnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + searchdist = NORM2(searchpt[0] - ntoppo[0], + searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + searchdist = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + dist = NORM2(searchpt[0] - ntoppo[0], searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + dist = searchdist; + } + if (dist < searchdist) { + nextmove = DESTMOVE; + searchdist = dist; + } + } + } else { + if (oriapex < 0) { + // Two faces, opposite to origin and apex, are viable. + nextmove = ORGMOVE; + enextfnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + searchdist = NORM2(searchpt[0] - ntoppo[0], + searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + searchdist = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + dist = NORM2(searchpt[0] - ntoppo[0], searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + dist = searchdist; + } + if (dist < searchdist) { + nextmove = APEXMOVE; + searchdist = dist; + } + } else { + // Only the face opposite to origin is viable. + nextmove = ORGMOVE; + } + } + } else { + if (oridest < 0) { + if (oriapex < 0) { + // Two faces, opposite to destination and apex, are viable. + nextmove = DESTMOVE; + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + searchdist = NORM2(searchpt[0] - ntoppo[0], + searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + searchdist = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + ntoppo = oppo(neightet); + dist = NORM2(searchpt[0] - ntoppo[0], searchpt[1] - ntoppo[1], + searchpt[2] - ntoppo[2]); + } else { + dist = searchdist; + } + if (dist < searchdist) { + nextmove = APEXMOVE; + searchdist = dist; + } + } else { + // Only the face opposite to destination is viable. + nextmove = DESTMOVE; + } + } else { + if (oriapex < 0) { + // Only the face opposite to apex is viable. + nextmove = APEXMOVE; + } else { + // The point we seek must be on the boundary of or inside this + // tetrahedron. Check for boundary cases. + if (oriorg == 0) { + // Go to the face opposite to origin. + enextfnextself(*searchtet); + if (oridest == 0) { + enextself(*searchtet); // edge apex->oppo + if (oriapex == 0) { + enextself(*searchtet); // oppo is duplicated with p. + loc = ONVERTEX; // return ONVERTEX; + break; + } + loc = ONEDGE; // return ONEDGE; + break; + } + if (oriapex == 0) { + enext2self(*searchtet); + loc = ONEDGE; // return ONEDGE; + break; + } + loc = ONFACE; // return ONFACE; + break; + } + if (oridest == 0) { + // Go to the face opposite to destination. + enext2fnextself(*searchtet); + if (oriapex == 0) { + enextself(*searchtet); + loc = ONEDGE; // return ONEDGE; + break; + } + loc = ONFACE; // return ONFACE; + break; + } + if (oriapex == 0) { + // Go to the face opposite to apex + fnextself(*searchtet); + loc = ONFACE; // return ONFACE; + break; + } + loc = INTETRAHEDRON; // return INTETRAHEDRON; + break; + } + } + } + + // Move to the selected face. + if (nextmove == ORGMOVE) { + enextfnextself(*searchtet); + } else if (nextmove == DESTMOVE) { + enext2fnextself(*searchtet); + } else { + fnextself(*searchtet); + } + // Move to the adjacent tetrahedron (maybe a hull tetrahedron). + backtracetet = *searchtet; + symself(*searchtet); + if (searchtet->tet == dummytet) { + *searchtet = backtracetet; + loc = OUTSIDE; // return OUTSIDE; + break; + } + + if (histtetarray != NULL) { + // Check if we have run into a loop. + if (infected(*searchtet)) { + // We have visited this tet. A potential loop is found. + loc = OUTSIDE; + break; + } else { + // Remember this tet. + infect(*searchtet); + histtetarray->newindex((void **) &parytet); + *parytet = *searchtet; + } + } + + // Retreat the three vertices of the base face. + searchtet->ver = 0; + torg = org(*searchtet); + tdest = dest(*searchtet); + tapex = apex(*searchtet); + + } // while (true) + + if (histtetarray != NULL) { + // Unmark the visited tets. + for (i = 0; i < (int) histtetarray->objects; i++) { + parytet = (triface *) fastlookup(histtetarray, i); + uninfect(*parytet); + } + histtetarray->restart(); + } + + return loc; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// adjustlocate() Adjust the precise location of a vertex. // +// // +// 'precise' is the value returned from preciselocate(). It indicates the // +// exact location of the point 'searchpt' with respect to the tetrahedron // +// 'searchtet'. 'epspp' is a given relative tolerance. // +// // +// This routine re-evaluates the orientations of searchpt with respect to // +// the four sides of searchtet. Detects the coplanarities by additinal tests // +// which are based on the given tolerance. If 'precise' is ONFACE or ONEDGE, // +// we can save one or two orientation tests. // +// // +// The return value indicates the location of the 'searchpt' (INTETRAHEDRON, // +// or ONFACE, ...). 'searchtet' is adjusted to a tetrahedron corresponding // +// to that value. See the introduction part of preciselocate(). // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::adjustlocate(point searchpt, + triface* searchtet, enum locateresult precise, REAL epspp) +{ + point torg, tdest, tapex, toppo; + REAL s1, s2, s3, s4; + + // For the given 'searchtet', the orientations tests are: + // s1: (tdest, torg, tapex, searchpt); + // s2: (torg, tdest, toppo, searchpt); + // s3: (tdest, tapex, toppo, searchpt); + // s4: (tapex, torg, toppo, searchpt); + adjustedgering(*searchtet, CCW); + torg = org(*searchtet); + tdest = dest(*searchtet); + tapex = apex(*searchtet); + toppo = oppo(*searchtet); + + switch (precise) { + case ONVERTEX: + // This case we don't need do any further test. + return ONVERTEX; + case ONEDGE: + // (torg, tdest); + s1 = 0.0; + s2 = 0.0; + break; + case ONFACE: + // (tdest, torg, tapex); + s1 = 0.0; + s2 = orient3d(torg, tdest, toppo, searchpt); + break; + default: // INTETRAHEDRON or OUTSIDE + s1 = orient3d(tdest, torg, tapex, searchpt); + s2 = orient3d(torg, tdest, toppo, searchpt); + } + + if (s1 != 0.0) { + if (iscoplanar(tdest, torg, tapex, searchpt, s1, epspp)) { + s1 = 0.0; + } + } + if (s1 < 0.0) { + return OUTSIDE; + } + + if (s2 != 0.0) { + if (iscoplanar(torg, tdest, toppo, searchpt, s2, epspp)) { + s2 = 0.0; + } + } + if (s2 < 0.0) { + fnextself(*searchtet); + return OUTSIDE; + } + + s3 = orient3d(tdest, tapex, toppo, searchpt); + if (s3 != 0.0) { + if (iscoplanar(tdest, tapex, toppo, searchpt, s3, epspp)) { + s3 = 0.0; + } + } + if (s3 < 0.0) { + enextfnextself(*searchtet); + return OUTSIDE; + } + + s4 = orient3d(tapex, torg, toppo, searchpt); + if (s4 != 0.0) { + if (iscoplanar(tapex, torg, toppo, searchpt, s4, epspp)) { + s4 = 0.0; + } + } + if (s4 < 0.0) { + enext2fnextself(*searchtet); + return OUTSIDE; + } + + // Determine degenerate cases. + if (s1 == 0.0) { + if (s2 == 0.0) { + if (s3 == 0.0) { + // On tdest. + enextself(*searchtet); + return ONVERTEX; + } + if (s4 == 0.0) { + // On torg. + return ONVERTEX; + } + // On edge (torg, tdest). + return ONEDGE; + } + if (s3 == 0.0) { + if (s4 == 0.0) { + // On tapex. + enext2self(*searchtet); + return ONVERTEX; + } + // On edge (tdest, tapex). + enextself(*searchtet); + return ONEDGE; + } + if (s4 == 0.0) { + // On edge (tapex, torg). + enext2self(*searchtet); + return ONEDGE; + } + // On face (torg, tdest, tapex). + return ONFACE; + } + if (s2 == 0.0) { + fnextself(*searchtet); + if (s3 == 0.0) { + if (s4 == 0.0) { + // On toppo. + enext2self(*searchtet); + return ONVERTEX; + } + // On edge (tdest, toppo). + enextself(*searchtet); + return ONEDGE; + } + if (s4 == 0.0) { + // On edge (toppo, torg). + enext2self(*searchtet); + return ONEDGE; + } + // On face (torg, tdest, toppo). + return ONFACE; + } + if (s3 == 0.0) { + enextfnextself(*searchtet); + if (s4 == 0.0) { + // On edge (tapex, toppo). + enextself(*searchtet); + return ONEDGE; + } + // On face (tdest, tapex, toppo). + return ONFACE; + } + if (s4 == 0.0) { + enext2fnextself(*searchtet); + // On face (tapex, torg, toppo). + return ONFACE; + } + + // Inside tetrahedron. + return INTETRAHEDRON; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// hullwalk() Find a tetrahedron on the hull to continue search. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::hullwalk(point searchpt, + triface *hulltet) +{ + list* travtetlist; + triface travtet, neightet; + point pa, pb, pc, pp[3]; + enum locateresult loc; + REAL prjpt[3]; + REAL ori; + int i, j; + + travtetlist = new list(sizeof(triface), NULL, 256); + travtet = *hulltet; + infect(travtet); + travtetlist->append(&travtet); + + loc = OUTSIDE; + for (i = 0; i < travtetlist->len(); i++) { + travtet = * (triface *)(* travtetlist)[i]; + // Choose the CCW-edgering in face. + travtet.ver = 0; + // Look for a side where pt lies below it. + for (travtet.loc = 0; travtet.loc < 4; travtet.loc++) { + pa = org(travtet); + pb = dest(travtet); + pc = apex(travtet); + ori = orient3d(pa, pb, pc, searchpt); + if (ori > 0.0) break; + } + // Is pt above all (or coplanar with some of) the four sides? + if (travtet.loc == 4) { + hulltet->tet = travtet.tet; + loc = adjustlocate(searchpt, hulltet, INTETRAHEDRON, b->epsilon); + assert(loc != OUTSIDE); + } else { // ori > 0.0 + // pt is below (behind) this side. We want to walk through it. + sym(travtet, neightet); + if (neightet.tet == dummytet) { + // This is a hull side. Is p approximately on this side. + loc = adjustlocate(searchpt, &travtet, OUTSIDE, b->epsilon); + } + if (loc == OUTSIDE) { + // searchpt is outside the hull face. Project it on the face. + travtet.ver = 1; + pp[0] = org(travtet); + pp[1] = dest(travtet); + pp[2] = apex(travtet); + projpt2face(searchpt, pp[0], pp[1], pp[2], prjpt); + // check if project point inside the hull face. + for (j = 0; j < 3; j++) { + ori = orient3d(pp[j], pp[(j+1)%3], searchpt, prjpt); + if (ori < 0.0) break; // Stop if it lies ouside. + } + if (ori >= 0.0) { + // Yes, return this tet. + *hulltet = travtet; + } + // Let's collect all the neighbors for next searching. + for (travtet.loc = 0; travtet.loc < 4; travtet.loc++) { + sym(travtet, neightet); + if ((neightet.tet != dummytet) && !infected(neightet)) { + // Neighbor exists and not visited. + infect(neightet); + travtetlist->append(&neightet); + } + } // for (travtet.loc = 0; + } // if (loc == OUTSIDE) + } // if (travtet.loc == 4) + if (loc != OUTSIDE) break; + } // for (i = 0; i < travtetlist->len(); i++) + + // Uninfect traversed tets. + for (i = 0; i < travtetlist->len(); i++) { + travtet = * (triface *)(* travtetlist)[i]; + uninfect(travtet); + } + + delete travtetlist; + return loc; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// locatesub() Find a point in the surface mesh of a facet. // +// // +// Searching begins from the input 'searchsh', it should be a handle on the // +// convex hull of the facet triangulation. // +// // +// If 'stopatseg' is nonzero, the search will stop if it tries to walk // +// through a subsegment, and will return OUTSIDE. // +// // +// On completion, 'searchsh' is a subface that contains 'searchpt'. // +// - Returns ONVERTEX if the point lies on an existing vertex. 'searchsh' // +// is a handle whose origin is the existing vertex. // +// - Returns ONEDGE if the point lies on a mesh edge. 'searchsh' is a // +// handle whose primary edge is the edge on which the point lies. // +// - Returns ONFACE if the point lies strictly within a subface. // +// 'searchsh' is a handle on which the point lies. // +// - Returns OUTSIDE if the point lies outside the triangulation. // +// // +// WARNING: This routine is designed for convex triangulations, and will not // +// not generally work after the holes and concavities have been carved. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::locatesub(point searchpt, + face* searchsh, int stopatseg, REAL epspp) +{ + face backtracksh, spinsh, checkedge; + point forg, fdest, fapex; + REAL orgori, destori; + REAL ori, sign; + int moveleft, i; + + if (searchsh->sh == dummysh) { + searchsh->shver = 0; + spivotself(*searchsh); +#ifdef SELF_CHECK + assert(searchsh->sh != dummysh); +#endif + } + // Find the sign to simulate that abovepoint is 'above' the facet. + adjustedgering(*searchsh, CCW); + forg = sorg(*searchsh); + fdest = sdest(*searchsh); + fapex = sapex(*searchsh); + ori = orient3d(forg, fdest, fapex, abovepoint); + sign = ori > 0.0 ? -1 : 1; + + // Orient 'searchsh' so that 'searchpt' is below it (i.e., searchpt has + // CCW orientation with respect to searchsh in plane). Such edge + // should always exist. Save it as (forg, fdest). + for (i = 0; i < 3; i++) { + forg = sorg(*searchsh); + fdest = sdest(*searchsh); + ori = orient3d(forg, fdest, abovepoint, searchpt) * sign; + if (ori > 0.0) break; + senextself(*searchsh); + } +#ifdef SELF_CHECK + assert(i < 3); +#endif + + while (1) { + fapex = sapex(*searchsh); + // Check whether the apex is the point we seek. + if (fapex[0] == searchpt[0] && fapex[1] == searchpt[1] && + fapex[2] == searchpt[2]) { + senext2self(*searchsh); + return ONVERTEX; + } + // Does the point lie on the other side of the line defined by the + // triangle edge opposite the triangle's destination? + destori = orient3d(forg, fapex, abovepoint, searchpt) * sign; + if (epspp > 0.0) { + if (iscoplanar(forg, fapex, abovepoint, searchpt, destori, epspp)) { + destori = 0.0; + } + } + // Does the point lie on the other side of the line defined by the + // triangle edge opposite the triangle's origin? + orgori = orient3d(fapex, fdest, abovepoint, searchpt) * sign; + if (epspp > 0.0) { + if (iscoplanar(fapex, fdest, abovepoint, searchpt, orgori, epspp)) { + orgori = 0.0; + } + } + if (destori > 0.0) { + moveleft = 1; + } else { + if (orgori > 0.0) { + moveleft = 0; + } else { + // The point must be on the boundary of or inside this triangle. + if (destori == 0.0) { + senext2self(*searchsh); + return ONEDGE; + } + if (orgori == 0.0) { + senextself(*searchsh); + return ONEDGE; + } + return ONFACE; + } + } + // Move to another triangle. Leave a trace `backtracksh' in case + // walking off a boundary of the triangulation. + if (moveleft) { + senext2(*searchsh, backtracksh); + fdest = fapex; + } else { + senext(*searchsh, backtracksh); + forg = fapex; + } + // Check if we meet a segment. + sspivot(backtracksh, checkedge); + if (checkedge.sh != dummysh) { + if (stopatseg) { + // The flag indicates we should not cross a segment. Stop. + *searchsh = backtracksh; + return OUTSIDE; + } + // Try to walk through a segment. We need to find a coplanar subface + // sharing this segment to get into. + spinsh = backtracksh; + do { + spivotself(spinsh); + if (spinsh.sh == backtracksh.sh) { + // Turn back, no coplanar subface is found. + break; + } + // Are they belong to the same facet. + if (shellmark(spinsh) == shellmark(backtracksh)) { + // Find a coplanar subface. Walk into it. + *searchsh = spinsh; + break; + } + // Are they (nearly) coplanar? + ori = orient3d(forg, fdest, sapex(backtracksh), sapex(spinsh)); + if (iscoplanar(forg, fdest, sapex(backtracksh), sapex(spinsh), ori, + b->epsilon)) { + // Find a coplanar subface. Walk into it. + *searchsh = spinsh; + break; + } + } while (spinsh.sh != backtracksh.sh); + } else { + spivot(backtracksh, *searchsh); + } + // Check for walking right out of the triangulation. + if ((searchsh->sh == dummysh) || (searchsh->sh == backtracksh.sh)) { + // Go back to the last triangle. + *searchsh = backtracksh; + return OUTSIDE; + } + // To keep the same orientation wrt abovepoint. + if (sorg(*searchsh) != forg) sesymself(*searchsh); +#ifdef SELF_CHECK + assert((sorg(*searchsh) == forg) && (sdest(*searchsh) == fdest)); +#endif + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// adjustlocatesub() Adjust the precise location of a vertex. // +// // +// 'precise' is the precise location (returned from locatesub()) of 'searcht'// +// with respect to 'searchsh'. 'epspp' is the given relative tolerance. // +// // +// This routine re-evaluates the orientations of 'searchpt' with respect to // +// the three edges of 'searchsh'. Detects the collinearities by additinal // +// tests based on the given tolerance. If 'precise' is ONEDGE, one can save // +// one orientation test for the current edge of 'searchsh'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh:: +adjustlocatesub(point searchpt, face* searchsh, enum locateresult precise, + REAL epspp) +{ + point pa, pb, pc; + bool s1, s2, s3; + + pa = sorg(*searchsh); + pb = sdest(*searchsh); + pc = sapex(*searchsh); + + if (precise == ONEDGE) { + s1 = true; + } else { + s1 = iscollinear(pa, pb, searchpt, epspp); + } + s2 = iscollinear(pb, pc, searchpt, epspp); + s3 = iscollinear(pc, pa, searchpt, epspp); + if (s1) { + if (s2) { + // on vertex pb. +#ifdef SELF_CHECK + assert(!s3); +#endif + senextself(*searchsh); + return ONVERTEX; + } else if (s3) { + // on vertex pa. + return ONVERTEX; + } else { + // on edge pa->pb. + return ONEDGE; + } + } else if (s2) { + if (s3) { + // on vertex pc. + senext2self(*searchsh); + return ONVERTEX; + } else { + // on edge pb->pc. + senextself(*searchsh); + return ONEDGE; + } + } else if (s3) { + // on edge pc->pa. + senext2self(*searchsh); + return ONEDGE; + } else { + return precise; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// locateseg() Find a point in subsegments. // +// // +// Searching begins from the input 'searchseg', it should be a subsegment of // +// the whole segment. // +// // +// On completion, 'searchseg' is a subsegment that contains 'searchpt'. // +// - Returns ONVERTEX if the point lies on an existing vertex. 'searchseg' // +// is a handle whose origin is the existing vertex. // +// - Returns ONEDGE if the point lies inside 'searchseg'. // +// - Returns OUTSIDE if the point lies outside the segment. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh:: +locateseg(point searchpt, face* searchseg) +{ + face backtraceseg; + point pa, pb; + REAL dx, dy, dz; + int moveleft; + int i; + + moveleft = 0; + while (1) { + searchseg->shver = 0; + pa = sorg(*searchseg); + pb = sdest(*searchseg); + // Find the biggest difference in x, y, and z coordinates of a and b. + dx = fabs(pb[0] - pa[0]); + dy = fabs(pb[1] - pa[1]); + dz = fabs(pb[2] - pa[2]); + if (dx > dy) { + if (dx > dz) { + i = 0; + } else { + i = 2; + } + } else { + if (dy > dz) { + i = 1; + } else { + i = 2; + } + } + if (pa[i] < pb[i]) { + if (searchpt[i] < pa[i]) { + moveleft = 1; + } else if (searchpt[i] > pa[i]) { + if (searchpt[i] < pb[i]) { + return ONEDGE; + } else if (searchpt[i] > pb[i]) { + moveleft = 0; + } else { +#ifdef SELF_CHECK + assert(searchpt[i] == pb[i]); +#endif + sesymself(*searchseg); + return ONVERTEX; + } + } else { +#ifdef SELF_CHECK + assert(searchpt[i] == pa[i]); +#endif + return ONVERTEX; + } + } else if (pa[i] > pb[i]) { + if (searchpt[i] < pb[i]) { + moveleft = 0; + } else if (searchpt[i] > pb[i]) { + if (searchpt[i] < pa[i]) { + return ONEDGE; + } else if (searchpt[i] > pa[i]) { + moveleft = 1; + } else { +#ifdef SELF_CHECK + assert(searchpt[i] == pa[i]); +#endif + return ONVERTEX; + } + } else { +#ifdef SELF_CHECK + assert(searchpt[i] == pb[i]); +#endif + sesymself(*searchseg); + return ONVERTEX; + } + } + backtraceseg = *searchseg; + if (moveleft) { + senext2self(*searchseg); + } else { + senextself(*searchseg); + } + spivotself(*searchseg); + if (searchseg->sh == dummysh) { + *searchseg = backtraceseg; + break; + } + } + + return OUTSIDE; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// adjustlocateseg() Adjust the precise location of a vertex on segment. // +// // +// 'searchpt' is either inside or ouside the segment 'searchseg'. It will be // +// adjusted to on vertex if it is very close to an endpoint of 'searchseg'. // +// 'epspp' is the given relative tolerance. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh:: +adjustlocateseg(point searchpt, face* searchseg, enum locateresult precise, + REAL epspp) +{ + point pa, pb; + REAL L, d, r; + + pa = sorg(*searchseg); + pb = sdest(*searchseg); + L = distance(pa, pb); + + // Is searchpt approximate to pa? + d = distance(pa, searchpt); + r = d / L; + if (r <= epspp) { + return ONVERTEX; + } + // Is searchpt approximate to pb? + d = distance(pb, searchpt); + r = d / L; + if (r <= epspp) { + sesymself(*searchseg); + return ONVERTEX; + } + + return precise; +} + +//// //// +//// //// +//// geom_cxx ///////////////////////////////////////////////////////////////// + +//// flip_cxx ///////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// enqueueflipface(), enqueueflipedge() Queue a face (or an edge). // +// // +// The face (or edge) may be non-locally Delaunay. It is queued for process- // +// ing in flip() (or flipsub()). The vertices of the face (edge) are stored // +// seperatly to ensure the face (or edge) is still the same one when we save // +// it since other flips will cause this face (or edge) be changed or dead. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::enqueueflipface(triface& checkface, queue* flipqueue) +{ + badface *queface; + triface symface; + + sym(checkface, symface); + if (symface.tet != dummytet) { + queface = (badface *) flipqueue->push((void *) NULL); + queface->tt = checkface; + queface->foppo = oppo(symface); + } +} + +void tetgenmesh::enqueueflipedge(face& checkedge, queue* flipqueue) +{ + badface *queface; + + queface = (badface *) flipqueue->push((void *) NULL); + queface->ss = checkedge; + queface->forg = sorg(checkedge); + queface->fdest = sdest(checkedge); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// flip23() Perform a 2-to-3 flip. // +// // +// On input, 'flipface' represents the face will be flipped. Let it is abc, // +// the two tetrahedra sharing abc are abcd, bace. abc is not a subface. // +// // +// A 2-to-3 flip is to change two tetrahedra abcd, bace to three tetrahedra // +// edab, edbc, and edca. As a result, face abc has been removed and three // +// new faces eda, edb and edc have been created. // +// // +// On completion, 'flipface' returns edab. If 'flipqueue' is not NULL, all // +// possibly non-Delaunay faces are added into it. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::flip23(triface* flipface, queue* flipqueue) +{ + triface abcd, bace; // Old configuration. + triface oldabd, oldbcd, oldcad; + triface abdcasing, bcdcasing, cadcasing; + triface oldbae, oldcbe, oldace; + triface baecasing, cbecasing, acecasing; + triface worktet; + face abdsh, bcdsh, cadsh; // The six subfaces on the CH. + face baesh, cbesh, acesh; + face abseg, bcseg, caseg; // The nine segs on the CH. + face adseg, bdseg, cdseg; + face aeseg, beseg, ceseg; + triface edab, edbc, edca; // New configuration. + point pa, pb, pc, pd, pe; + REAL attrib, volume; + int i; + + abcd = *flipface; + adjustedgering(abcd, CCW); // abcd represents edge ab. + pa = org(abcd); + pb = dest(abcd); + pc = apex(abcd); + pd = oppo(abcd); + // sym(abcd, bace); + // findedge(&bace, dest(abcd), org(abcd)); // bace represents edge ba. + sym(abcd, bace); + bace.ver = 0; // CCW. + for (i = 0; (i < 3) && (org(bace) != pb); i++) { + enextself(bace); + } + pe = oppo(bace); + + if (b->verbose > 1) { + printf(" Do T23 on face (%d, %d, %d) %d, %d.\n", pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(pd), pointmark(pe)); + } + flip23s++; + + // Storing the old configuration outside the convex hull. + fnext(abcd, oldabd); + enextfnext(abcd, oldbcd); + enext2fnext(abcd, oldcad); + fnext(bace, oldbae); + enext2fnext(bace, oldcbe); + enextfnext(bace, oldace); + sym(oldabd, abdcasing); + sym(oldbcd, bcdcasing); + sym(oldcad, cadcasing); + sym(oldbae, baecasing); + sym(oldcbe, cbecasing); + sym(oldace, acecasing); + if (checksubfaces) { + tspivot(oldabd, abdsh); + tspivot(oldbcd, bcdsh); + tspivot(oldcad, cadsh); + tspivot(oldbae, baesh); + tspivot(oldcbe, cbesh); + tspivot(oldace, acesh); + } + if (checksubsegs) { + tsspivot1(abcd, abseg); + enext(abcd, worktet); + tsspivot1(worktet, bcseg); + enext2(abcd, worktet); + tsspivot1(worktet, caseg); + enext2(oldabd, worktet); + tsspivot1(worktet, adseg); + enext2(oldbcd, worktet); + tsspivot1(worktet, bdseg); + enext2(oldcad, worktet); + tsspivot1(worktet, cdseg); + enext(oldbae, worktet); + tsspivot1(worktet, aeseg); + enext(oldcbe, worktet); + tsspivot1(worktet, beseg); + enext(oldace, worktet); + tsspivot1(worktet, ceseg); + } + + // Creating the new configuration inside the convex hull. + edab.tet = abcd.tet; // Update abcd to be edab. + setorg (edab, pe); + setdest(edab, pd); + setapex(edab, pa); + setoppo(edab, pb); + edbc.tet = bace.tet; // Update bace to be edbc. + setorg (edbc, pe); + setdest(edbc, pd); + setapex(edbc, pb); + setoppo(edbc, pc); + maketetrahedron(&edca); // Create edca. + setorg (edca, pe); + setdest(edca, pd); + setapex(edca, pc); + setoppo(edca, pa); + // Set the element attributes of the new tetrahedron 'edca'. + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(abcd.tet, i); + setelemattribute(edca.tet, i, attrib); + } + // Set the volume constraint of the new tetrahedron 'edca' if the -ra + // switches are not used together. In -ra case, the various volume + // constraints can be spreaded very far. + if (b->varvolume && !b->refine) { + volume = volumebound(abcd.tet); + setvolumebound(edca.tet, volume); + } + + // Clear old bonds in edab(was abcd) and edbc(was bace). + for (i = 0; i < 4; i ++) { + edab.tet[i] = (tetrahedron) dummytet; + } + for (i = 0; i < 4; i ++) { + edbc.tet[i] = (tetrahedron) dummytet; + } + // Bond the faces inside the convex hull. + edab.loc = 0; + edca.loc = 1; + bond(edab, edca); + edab.loc = 1; + edbc.loc = 0; + bond(edab, edbc); + edbc.loc = 1; + edca.loc = 0; + bond(edbc, edca); + // Bond the faces on the convex hull. + edab.loc = 2; + bond(edab, abdcasing); + edab.loc = 3; + bond(edab, baecasing); + edbc.loc = 2; + bond(edbc, bcdcasing); + edbc.loc = 3; + bond(edbc, cbecasing); + edca.loc = 2; + bond(edca, cadcasing); + edca.loc = 3; + bond(edca, acecasing); + // There may exist subfaces that need to be bonded to new configuarton. + if (checksubfaces) { + // Clear old flags in edab(was abcd) and edbc(was bace). + for (i = 0; i < 4; i ++) { + edab.loc = i; + tsdissolve(edab); + edbc.loc = i; + tsdissolve(edbc); + } + if (abdsh.sh != dummysh) { + edab.loc = 2; + tsbond(edab, abdsh); + } + if (baesh.sh != dummysh) { + edab.loc = 3; + tsbond(edab, baesh); + } + if (bcdsh.sh != dummysh) { + edbc.loc = 2; + tsbond(edbc, bcdsh); + } + if (cbesh.sh != dummysh) { + edbc.loc = 3; + tsbond(edbc, cbesh); + } + if (cadsh.sh != dummysh) { + edca.loc = 2; + tsbond(edca, cadsh); + } + if (acesh.sh != dummysh) { + edca.loc = 3; + tsbond(edca, acesh); + } + } + if (checksubsegs) { + for (i = 0; i < 6; i++) { + edab.loc = edge2locver[i][0]; + edab.ver = edge2locver[i][1]; + tssdissolve1(edab); + } + for (i = 0; i < 6; i++) { + edbc.loc = edge2locver[i][0]; + edbc.ver = edge2locver[i][1]; + tssdissolve1(edbc); + } + edab.loc = edab.ver = 0; + edbc.loc = edab.ver = 0; + edca.loc = edab.ver = 0; + // Operate in tet edab (5 edges). + enext(edab, worktet); + tssbond1(worktet, adseg); + enext2(edab, worktet); + tssbond1(worktet, aeseg); + fnext(edab, worktet); + enextself(worktet); + tssbond1(worktet, bdseg); + enextself(worktet); + tssbond1(worktet, beseg); + enextfnext(edab, worktet); + enextself(worktet); + tssbond1(worktet, abseg); + // Operate in tet edbc (5 edges) + enext(edbc, worktet); + tssbond1(worktet, bdseg); + enext2(edbc, worktet); + tssbond1(worktet, beseg); + fnext(edbc, worktet); + enextself(worktet); + tssbond1(worktet, cdseg); + enextself(worktet); + tssbond1(worktet, ceseg); + enextfnext(edbc, worktet); + enextself(worktet); + tssbond1(worktet, bcseg); + // Operate in tet edca (5 edges) + enext(edca, worktet); + tssbond1(worktet, cdseg); + enext2(edca, worktet); + tssbond1(worktet, ceseg); + fnext(edca, worktet); + enextself(worktet); + tssbond1(worktet, adseg); + enextself(worktet); + tssbond1(worktet, aeseg); + enextfnext(edca, worktet); + enextself(worktet); + tssbond1(worktet, caseg); + } + + edab.loc = 0; + edbc.loc = 0; + edca.loc = 0; + if (b->verbose > 3) { + printf(" Updating edab "); + printtet(&edab); + printf(" Updating edbc "); + printtet(&edbc); + printf(" Creating edca "); + printtet(&edca); + } + + // Update point-to-tet map. + setpoint2tet(pa, encode(edab)); + setpoint2tet(pb, encode(edab)); + setpoint2tet(pc, encode(edbc)); + setpoint2tet(pd, encode(edab)); + setpoint2tet(pe, encode(edab)); + + if (flipqueue != (queue *) NULL) { + enextfnext(edab, abdcasing); + enqueueflipface(abdcasing, flipqueue); + enext2fnext(edab, baecasing); + enqueueflipface(baecasing, flipqueue); + enextfnext(edbc, bcdcasing); + enqueueflipface(bcdcasing, flipqueue); + enext2fnext(edbc, cbecasing); + enqueueflipface(cbecasing, flipqueue); + enextfnext(edca, cadcasing); + enqueueflipface(cadcasing, flipqueue); + enext2fnext(edca, acecasing); + enqueueflipface(acecasing, flipqueue); + } + + // Save a live handle in 'recenttet'. + recenttet = edbc; + // Set the return handle be edab. + *flipface = edab; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// flip32() Perform a 3-to-2 flip. // +// // +// On input, 'flipface' represents the face will be flipped. Let it is eda, // +// where edge ed is locally non-convex. Three tetrahedra sharing ed are edab,// +// edbc, and edca. ed is not a subsegment. // +// // +// A 3-to-2 flip is to change the three tetrahedra edab, edbc, and edca into // +// another two tetrahedra abcd and bace. As a result, the edge ed has been // +// removed and the face abc has been created. // +// // +// On completion, 'flipface' returns abcd. If 'flipqueue' is not NULL, all // +// possibly non-Delaunay faces are added into it. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::flip32(triface* flipface, queue* flipqueue) +{ + triface edab, edbc, edca; // Old configuration. + triface oldabd, oldbcd, oldcad; + triface abdcasing, bcdcasing, cadcasing; + triface oldbae, oldcbe, oldace; + triface baecasing, cbecasing, acecasing; + triface worktet; + face abdsh, bcdsh, cadsh; + face baesh, cbesh, acesh; + face abseg, bcseg, caseg; // The nine segs on the CH. + face adseg, bdseg, cdseg; + face aeseg, beseg, ceseg; + triface abcd, bace; // New configuration. + point pa, pb, pc, pd, pe; + int i; + + edab = *flipface; + adjustedgering(edab, CCW); + pa = apex(edab); + pb = oppo(edab); + pd = dest(edab); + pe = org(edab); + fnext(edab, edbc); + symself(edbc); + edbc.ver = 0; + for (i = 0; (i < 3) && (org(edbc) != pe); i++) { + enextself(edbc); + } + pc = oppo(edbc); + fnext(edbc, edca); + symself(edca); + edca.ver = 0; + for (i = 0; (i < 3) && (org(edca) != pe); i++) { + enextself(edca); + } + + if (b->verbose > 1) { + printf(" Do T32 on edge (%d, %d) %d, %d, %d.\n", pointmark(pe), + pointmark(pd), pointmark(pa), pointmark(pb), pointmark(pc)); + } + flip32s++; + + // Storing the old configuration outside the convex hull. + enextfnext(edab, oldabd); + enext2fnext(edab, oldbae); + enextfnext(edbc, oldbcd); + enext2fnext(edbc, oldcbe); + enextfnext(edca, oldcad); + enext2fnext(edca, oldace); + sym(oldabd, abdcasing); + sym(oldbcd, bcdcasing); + sym(oldcad, cadcasing); + sym(oldbae, baecasing); + sym(oldcbe, cbecasing); + sym(oldace, acecasing); + if (checksubfaces) { + tspivot(oldabd, abdsh); + tspivot(oldbcd, bcdsh); + tspivot(oldcad, cadsh); + tspivot(oldbae, baesh); + tspivot(oldcbe, cbesh); + tspivot(oldace, acesh); + } + if (checksubsegs) { + enext(edab, worktet); + tsspivot1(worktet, adseg); + enext2(edab, worktet); + tsspivot1(worktet, aeseg); + enext(edbc, worktet); + tsspivot1(worktet, bdseg); + enext2(edbc, worktet); + tsspivot1(worktet, beseg); + enext(edca, worktet); + tsspivot1(worktet, cdseg); + enext2(edca, worktet); + tsspivot1(worktet, ceseg); + enextfnext(edab, worktet); + enextself(worktet); + tsspivot1(worktet, abseg); + enextfnext(edbc, worktet); + enextself(worktet); + tsspivot1(worktet, bcseg); + enextfnext(edca, worktet); + enextself(worktet); + tsspivot1(worktet, caseg); + } + + // Creating the new configuration inside the convex hull. + abcd.tet = edab.tet; // Update edab to be abcd. + setorg (abcd, pa); + setdest(abcd, pb); + setapex(abcd, pc); + setoppo(abcd, pd); + bace.tet = edbc.tet; // Update edbc to be bace. + setorg (bace, pb); + setdest(bace, pa); + setapex(bace, pc); + setoppo(bace, pe); + // Dealloc a redundant tetrahedron (edca). + tetrahedrondealloc(edca.tet); + + // Clear the old bonds in abcd (was edab) and bace (was edbc). + for (i = 0; i < 4; i ++) { + abcd.tet[i] = (tetrahedron) dummytet; + } + for (i = 0; i < 4; i ++) { + bace.tet[i] = (tetrahedron) dummytet; + } + // Bond the inside face of the convex hull. + abcd.loc = 0; + bace.loc = 0; + bond(abcd, bace); + // Bond the outside faces of the convex hull. + abcd.loc = 1; + bond(abcd, abdcasing); + abcd.loc = 2; + bond(abcd, bcdcasing); + abcd.loc = 3; + bond(abcd, cadcasing); + bace.loc = 1; + bond(bace, baecasing); + bace.loc = 3; + bond(bace, cbecasing); + bace.loc = 2; + bond(bace, acecasing); + if (checksubfaces) { + // Clear old bonds in abcd(was edab) and bace(was edbc). + for (i = 0; i < 4; i ++) { + abcd.loc = i; + tsdissolve(abcd); + } + for (i = 0; i < 4; i ++) { + bace.loc = i; + tsdissolve(bace); + } + if (abdsh.sh != dummysh) { + abcd.loc = 1; + tsbond(abcd, abdsh); + } + if (bcdsh.sh != dummysh) { + abcd.loc = 2; + tsbond(abcd, bcdsh); + } + if (cadsh.sh != dummysh) { + abcd.loc = 3; + tsbond(abcd, cadsh); + } + if (baesh.sh != dummysh) { + bace.loc = 1; + tsbond(bace, baesh); + } + if (cbesh.sh != dummysh) { + bace.loc = 3; + tsbond(bace, cbesh); + } + if (acesh.sh != dummysh) { + bace.loc = 2; + tsbond(bace, acesh); + } + } + if (checksubsegs) { + for (i = 0; i < 6; i++) { + abcd.loc = edge2locver[i][0]; + abcd.ver = edge2locver[i][1]; + tssdissolve1(abcd); + } + for (i = 0; i < 6; i++) { + bace.loc = edge2locver[i][0]; + bace.ver = edge2locver[i][1]; + tssdissolve1(bace); + } + abcd.loc = abcd.ver = 0; + bace.loc = bace.ver = 0; + tssbond1(abcd, abseg); // 1 + enext(abcd, worktet); + tssbond1(worktet, bcseg); // 2 + enext2(abcd, worktet); + tssbond1(worktet, caseg); // 3 + fnext(abcd, worktet); + enext2self(worktet); + tssbond1(worktet, adseg); // 4 + enextfnext(abcd, worktet); + enext2self(worktet); + tssbond1(worktet, bdseg); // 5 + enext2fnext(abcd, worktet); + enext2self(worktet); + tssbond1(worktet, cdseg); // 6 + tssbond1(bace, abseg); + enext2(bace, worktet); + tssbond1(worktet, bcseg); + enext(bace, worktet); + tssbond1(worktet, caseg); + fnext(bace, worktet); + enextself(worktet); + tssbond1(worktet, aeseg); // 7 + enext2fnext(bace, worktet); + enextself(worktet); + tssbond1(worktet, beseg); // 8 + enextfnext(bace, worktet); + enextself(worktet); + tssbond1(worktet, ceseg); // 9 + } + + abcd.loc = 0; + bace.loc = 0; + if (b->verbose > 3) { + printf(" Updating abcd "); + printtet(&abcd); + printf(" Updating bace "); + printtet(&bace); + printf(" Deleting edca "); + // printtet(&edca); + } + + // Update point-to-tet map. + setpoint2tet(pa, encode(abcd)); + setpoint2tet(pb, encode(abcd)); + setpoint2tet(pc, encode(abcd)); + setpoint2tet(pd, encode(abcd)); + setpoint2tet(pe, encode(bace)); + + if (flipqueue != (queue *) NULL) { + fnext(abcd, abdcasing); + enqueueflipface(abdcasing, flipqueue); + fnext(bace, baecasing); + enqueueflipface(baecasing, flipqueue); + enextfnext(abcd, bcdcasing); + enqueueflipface(bcdcasing, flipqueue); + enextfnext(bace, cbecasing); + enqueueflipface(cbecasing, flipqueue); + enext2fnext(abcd, cadcasing); + enqueueflipface(cadcasing, flipqueue); + enext2fnext(bace, acecasing); + enqueueflipface(acecasing, flipqueue); + } + + // Save a live handle in 'recenttet'. + recenttet = abcd; + // Set the return handle be abcd. + *flipface = abcd; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// flip22() Perform a 2-to-2 (or 4-to-4) flip. // +// // +// On input, 'flipface' represents the face will be flipped. Let it is abe, // +// ab is the flipable edge, the two tetrahedra sharing abe are abce and bade,// +// hence a, b, c and d are coplanar. If abc, bad are interior faces, the two // +// tetrahedra opposite to e are bacf and abdf. ab is not a subsegment. // +// // +// A 2-to-2 flip is to change two tetrahedra abce and bade into another two // +// tetrahedra dcae and cdbe. If bacf and abdf exist, they're changed to cdaf // +// and dcbf, thus a 4-to-4 flip. As a result, two or four tetrahedra have // +// rotated counterclockwise (using right-hand rule with thumb points to e): // +// abce->dcae, bade->cdbe, and bacf->cdaf, abdf->dcbf. // +// // +// If abc and bad are subfaces, a 2-to-2 flip is performed simultaneously by // +// calling routine flip22sub(), hence abc->dca, bad->cdb. The edge rings of // +// the flipped subfaces dca and cdb have the same orientation as abc and bad.// +// Hence, they have the same orientation as other subfaces of the facet with // +// respect to the lift point of this facet. // +// // +// On completion, 'flipface' holds edge dc of tetrahedron dcae. 'flipqueue' // +// contains all possibly non-Delaunay faces if it is not NULL. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::flip22(triface* flipface, queue* flipqueue) +{ + triface abce, bade; + triface oldbce, oldcae, oldade, olddbe; + triface bcecasing, caecasing, adecasing, dbecasing; + face bcesh, caesh, adesh, dbesh; + triface bacf, abdf; + triface oldacf, oldcbf, oldbdf, olddaf; + triface acfcasing, cbfcasing, bdfcasing, dafcasing; + triface worktet; + face acfsh, cbfsh, bdfsh, dafsh; + face abc, bad; + face adseg, dbseg, bcseg, caseg; // Coplanar segs. + face aeseg, deseg, beseg, ceseg; // Above segs. + face afseg, dfseg, bfseg, cfseg; // Below segs. + point pa, pb, pc, pd, pe, pf; + int mirrorflag, i; + + adjustedgering(*flipface, CCW); // 'flipface' is bae. + fnext(*flipface, abce); + esymself(abce); + adjustedgering(*flipface, CW); // 'flipface' is abe. + fnext(*flipface, bade); +#ifdef SELF_CHECK + assert(bade.tet != dummytet); +#endif + esymself(bade); + pa = org(abce); + pb = dest(abce); + pc = apex(abce); + pd = apex(bade); + pe = oppo(bade); +#ifdef SELF_CHECK + assert(oppo(abce) == pe); +#endif + sym(abce, bacf); + mirrorflag = bacf.tet != dummytet; + if (mirrorflag) { + // findedge(&bacf, pb, pa); + bacf.ver = 0; + for (i = 0; (i < 3) && (org(bacf) != pb); i++) { + enextself(bacf); + } + sym(bade, abdf); +#ifdef SELF_CHECK + assert(abdf.tet != dummytet); +#endif + // findedge(&abdf, pa, pb); + abdf.ver = 0; + for (i = 0; (i < 3) && (org(abdf) != pa); i++) { + enextself(abdf); + } + pf = oppo(bacf); +#ifdef SELF_CHECK + assert(oppo(abdf) == pf); +#endif + } + + if (b->verbose > 1) { + printf(" Flip edge (%d, %d) to (%d, %d) %s.\n", pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(pd), mirrorflag ? "T44" : "T22"); + } + mirrorflag ? flip44s++ : flip22s++; + + // Save the old configuration at the convex hull. + enextfnext(abce, oldbce); + enext2fnext(abce, oldcae); + enextfnext(bade, oldade); + enext2fnext(bade, olddbe); + sym(oldbce, bcecasing); + sym(oldcae, caecasing); + sym(oldade, adecasing); + sym(olddbe, dbecasing); + if (checksubfaces) { + tspivot(oldbce, bcesh); + tspivot(oldcae, caesh); + tspivot(oldade, adesh); + tspivot(olddbe, dbesh); + tspivot(abce, abc); + tspivot(bade, bad); + } + if (checksubsegs) { + // Coplanar segs: a->d->b->c. + enext(bade, worktet); + tsspivot1(worktet, adseg); + enext2(bade, worktet); + tsspivot1(worktet, dbseg); + enext(abce, worktet); + tsspivot1(worktet, bcseg); + enext2(abce, worktet); + tsspivot1(worktet, caseg); + // Above segs: a->e, d->e, b->e, c->e. + fnext(bade, worktet); + enextself(worktet); + tsspivot1(worktet, aeseg); + enextfnext(bade, worktet); + enextself(worktet); + tsspivot1(worktet, deseg); + enext2fnext(bade, worktet); + enextself(worktet); + tsspivot1(worktet, beseg); + enextfnext(abce, worktet); + enextself(worktet); + tsspivot1(worktet, ceseg); + } + if (mirrorflag) { + enextfnext(bacf, oldacf); + enext2fnext(bacf, oldcbf); + enextfnext(abdf, oldbdf); + enext2fnext(abdf, olddaf); + sym(oldacf, acfcasing); + sym(oldcbf, cbfcasing); + sym(oldbdf, bdfcasing); + sym(olddaf, dafcasing); + if (checksubfaces) { + tspivot(oldacf, acfsh); + tspivot(oldcbf, cbfsh); + tspivot(oldbdf, bdfsh); + tspivot(olddaf, dafsh); + } + if (checksubsegs) { + // Below segs: a->f, d->f, b->f, c->f. + fnext(abdf, worktet); + enext2self(worktet); + tsspivot1(worktet, afseg); + enext2fnext(abdf, worktet); + enext2self(worktet); + tsspivot1(worktet, dfseg); + enextfnext(abdf, worktet); + enext2self(worktet); + tsspivot1(worktet, bfseg); + enextfnext(bacf, worktet); + enextself(worktet); + tsspivot1(worktet, cfseg); + } + } + + // Rotate abce, bade one-quarter turn counterclockwise. + bond(oldbce, caecasing); + bond(oldcae, adecasing); + bond(oldade, dbecasing); + bond(olddbe, bcecasing); + if (checksubfaces) { + // Check for subfaces and rebond them to the rotated tets. + if (caesh.sh == dummysh) { + tsdissolve(oldbce); + } else { + tsbond(oldbce, caesh); + } + if (adesh.sh == dummysh) { + tsdissolve(oldcae); + } else { + tsbond(oldcae, adesh); + } + if (dbesh.sh == dummysh) { + tsdissolve(oldade); + } else { + tsbond(oldade, dbesh); + } + if (bcesh.sh == dummysh) { + tsdissolve(olddbe); + } else { + tsbond(olddbe, bcesh); + } + } + if (checksubsegs) { + // 5 edges in abce are changed. + enext(abce, worktet); // fit b->c into c->a. + if (caseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, caseg); + } + enext2(abce, worktet); // fit c->a into a->d. + if (adseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, adseg); + } + fnext(abce, worktet); // fit b->e into c->e. + enextself(worktet); + if (ceseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, ceseg); + } + enextfnext(abce, worktet); // fit c->e into a->e. + enextself(worktet); + if (aeseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, aeseg); + } + enext2fnext(abce, worktet); // fit a->e into d->e. + enextself(worktet); + if (deseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, deseg); + } + // 5 edges in bade are changed. + enext(bade, worktet); // fit a->d into d->b. + if (dbseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, dbseg); + } + enext2(bade, worktet); // fit d->b into b->c. + if (bcseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, bcseg); + } + fnext(bade, worktet); // fit a->e into d->e. + enextself(worktet); + if (deseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, deseg); + } + enextfnext(bade, worktet); // fit d->e into b->e. + enextself(worktet); + if (beseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, beseg); + } + enext2fnext(bade, worktet); // fit b->e into c->e. + enextself(worktet); + if (ceseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, ceseg); + } + } + if (mirrorflag) { + // Rotate bacf, abdf one-quarter turn counterclockwise. + bond(oldcbf, acfcasing); + bond(oldacf, dafcasing); + bond(olddaf, bdfcasing); + bond(oldbdf, cbfcasing); + if (checksubfaces) { + // Check for subfaces and rebond them to the rotated tets. + if (acfsh.sh == dummysh) { + tsdissolve(oldcbf); + } else { + tsbond(oldcbf, acfsh); + } + if (dafsh.sh == dummysh) { + tsdissolve(oldacf); + } else { + tsbond(oldacf, dafsh); + } + if (bdfsh.sh == dummysh) { + tsdissolve(olddaf); + } else { + tsbond(olddaf, bdfsh); + } + if (cbfsh.sh == dummysh) { + tsdissolve(oldbdf); + } else { + tsbond(oldbdf, cbfsh); + } + } + if (checksubsegs) { + // 5 edges in bacf are changed. + enext2(bacf, worktet); // fit b->c into c->a. + if (caseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, caseg); + } + enext(bacf, worktet); // fit c->a into a->d. + if (adseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, adseg); + } + fnext(bacf, worktet); // fit b->f into c->f. + enext2self(worktet); + if (cfseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, cfseg); + } + enext2fnext(bacf, worktet); // fit c->f into a->f. + enext2self(worktet); + if (afseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, afseg); + } + enextfnext(bacf, worktet); // fit a->f into d->f. + enext2self(worktet); + if (dfseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, dfseg); + } + // 5 edges in abdf are changed. + enext2(abdf, worktet); // fit a->d into d->b. + if (dbseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, dbseg); + } + enext(abdf, worktet); // fit d->b into b->c. + if (bcseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, bcseg); + } + fnext(abdf, worktet); // fit a->f into d->f. + enext2self(worktet); + if (dfseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, dfseg); + } + enext2fnext(abdf, worktet); // fit d->f into b->f. + enext2self(worktet); + if (bfseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, bfseg); + } + enextfnext(abdf, worktet); // fit b->f into c->f. + enext2self(worktet); + if (cfseg.sh == dummysh) { + tssdissolve1(worktet); + } else { + tssbond1(worktet, cfseg); + } + } + } + + // New vertex assignments for the rotated tetrahedra. + setorg(abce, pd); // Update abce to dcae + setdest(abce, pc); + setapex(abce, pa); + setorg(bade, pc); // Update bade to cdbe + setdest(bade, pd); + setapex(bade, pb); + if (mirrorflag) { + setorg(bacf, pc); // Update bacf to cdaf + setdest(bacf, pd); + setapex(bacf, pa); + setorg(abdf, pd); // Update abdf to dcbf + setdest(abdf, pc); + setapex(abdf, pb); + } + + // Update point-to-tet map. + setpoint2tet(pa, encode(abce)); + setpoint2tet(pb, encode(bade)); + setpoint2tet(pc, encode(abce)); + setpoint2tet(pd, encode(bade)); + setpoint2tet(pe, encode(abce)); + if (mirrorflag) { + setpoint2tet(pf, encode(bacf)); + } + + // Are there subfaces need to be flipped? + if (checksubfaces && abc.sh != dummysh) { +#ifdef SELF_CHECK + assert(bad.sh != dummysh); +#endif + // Adjust the edge be ab, so the rotation of subfaces is according with + // the rotation of tetrahedra. + findedge(&abc, pa, pb); + // Flip an edge of two subfaces, ignore non-Delaunay edges. + flip22sub(&abc, NULL); + } + + if (b->verbose > 3) { + printf(" Updating abce "); + printtet(&abce); + printf(" Updating bade "); + printtet(&bade); + if (mirrorflag) { + printf(" Updating bacf "); + printtet(&bacf); + printf(" Updating abdf "); + printtet(&abdf); + } + } + + if (flipqueue != (queue *) NULL) { + enextfnext(abce, bcecasing); + enqueueflipface(bcecasing, flipqueue); + enext2fnext(abce, caecasing); + enqueueflipface(caecasing, flipqueue); + enextfnext(bade, adecasing); + enqueueflipface(adecasing, flipqueue); + enext2fnext(bade, dbecasing); + enqueueflipface(dbecasing, flipqueue); + if (mirrorflag) { + enextfnext(bacf, acfcasing); + enqueueflipface(acfcasing, flipqueue); + enext2fnext(bacf, cbfcasing); + enqueueflipface(cbfcasing, flipqueue); + enextfnext(abdf, bdfcasing); + enqueueflipface(bdfcasing, flipqueue); + enext2fnext(abdf, dafcasing); + enqueueflipface(dafcasing, flipqueue); + } + // The two new faces dcae (abce), cdbe (bade) may still not be locally + // Delaunay, and may need be flipped (flip23). On the other hand, in + // conforming Delaunay algorithm, two new subfaces dca (abc), and cdb + // (bad) may be non-conforming Delaunay, they need be queued if they + // are locally Delaunay but non-conforming Delaunay. + enqueueflipface(abce, flipqueue); + enqueueflipface(bade, flipqueue); + } + + // Save a live handle in 'recenttet'. + recenttet = abce; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// flip22sub() Perform a 2-to-2 flip on a subface edge. // +// // +// The flip edge is given by subface 'flipedge'. Let it is abc, where ab is // +// the flipping edge. The other subface is bad, where a, b, c, d form a // +// convex quadrilateral. ab is not a subsegment. // +// // +// A 2-to-2 subface flip is to change two subfaces abc and bad to another // +// two subfaces dca and cdb. Hence, edge ab has been removed and dc becomes // +// an edge. If a point e is above abc, this flip is equal to rotate abc and // +// bad counterclockwise using right-hand rule with thumb points to e. It is // +// important to know that the edge rings of the flipped subfaces dca and cdb // +// are keeping the same orientation as their original subfaces. So they have // +// the same orientation with respect to the lift point of this facet. // +// // +// During rotating, the face rings of the four edges bc, ca, ad, and de need // +// be re-connected. If the edge is not a subsegment, then its face ring has // +// only two faces, a sbond() will bond them together. If it is a subsegment, // +// one should use sbond1() twice to bond two different handles to the rotat- // +// ing subface, one is predecssor (-casin), another is successor (-casout). // +// // +// If 'flipqueue' is not NULL, it returns four edges bc, ca, ad, de, which // +// may be non-Delaunay. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::flip22sub(face* flipedge, queue* flipqueue) +{ + face abc, bad; + face oldbc, oldca, oldad, olddb; + face bccasin, bccasout, cacasin, cacasout; + face adcasin, adcasout, dbcasin, dbcasout; + face bc, ca, ad, db; + face spinsh; + point pa, pb, pc, pd; + + abc = *flipedge; + spivot(abc, bad); + if (sorg(bad) != sdest(abc)) { + sesymself(bad); + } + pa = sorg(abc); + pb = sdest(abc); + pc = sapex(abc); + pd = sapex(bad); + + if (b->verbose > 1) { + printf(" Flip subedge (%d, %d) to (%d, %d).\n", pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(pd)); + } + + // Unmark the flipped subfaces (used in mesh refinement). 2009-08-17. + sunmarktest(abc); + sunmarktest(bad); + + // Save the old configuration outside the quadrilateral. + senext(abc, oldbc); + senext2(abc, oldca); + senext(bad, oldad); + senext2(bad, olddb); + // Get the outside connection. Becareful if there is a subsegment on the + // quadrilateral, two casings (casin and casout) are needed to save for + // keeping the face link. + spivot(oldbc, bccasout); + sspivot(oldbc, bc); + if (bc.sh != dummysh) { + // 'bc' is a subsegment. + if (bccasout.sh != dummysh) { + if (oldbc.sh != bccasout.sh) { + // 'oldbc' is not self-bonded. + spinsh = bccasout; + do { + bccasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != oldbc.sh); + } else { + bccasout.sh = dummysh; + } + } + ssdissolve(oldbc); + } + spivot(oldca, cacasout); + sspivot(oldca, ca); + if (ca.sh != dummysh) { + // 'ca' is a subsegment. + if (cacasout.sh != dummysh) { + if (oldca.sh != cacasout.sh) { + // 'oldca' is not self-bonded. + spinsh = cacasout; + do { + cacasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != oldca.sh); + } else { + cacasout.sh = dummysh; + } + } + ssdissolve(oldca); + } + spivot(oldad, adcasout); + sspivot(oldad, ad); + if (ad.sh != dummysh) { + // 'ad' is a subsegment. + if (adcasout.sh != dummysh) { + if (oldad.sh != adcasout.sh) { + // 'adcasout' is not self-bonded. + spinsh = adcasout; + do { + adcasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != oldad.sh); + } else { + adcasout.sh = dummysh; + } + } + ssdissolve(oldad); + } + spivot(olddb, dbcasout); + sspivot(olddb, db); + if (db.sh != dummysh) { + // 'db' is a subsegment. + if (dbcasout.sh != dummysh) { + if (olddb.sh != dbcasout.sh) { + // 'dbcasout' is not self-bonded. + spinsh = dbcasout; + do { + dbcasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != olddb.sh); + } else { + dbcasout.sh = dummysh; + } + } + ssdissolve(olddb); + } + + // Rotate abc and bad one-quarter turn counterclockwise. + if (ca.sh != dummysh) { + if (cacasout.sh != dummysh) { + sbond1(cacasin, oldbc); + sbond1(oldbc, cacasout); + } else { + // Bond 'oldbc' to itself. + sdissolve(oldbc); // sbond(oldbc, oldbc); + // Make sure that dummysh always correctly bonded. + dummysh[0] = sencode(oldbc); + } + ssbond(oldbc, ca); + } else { + sbond(oldbc, cacasout); + } + if (ad.sh != dummysh) { + if (adcasout.sh != dummysh) { + sbond1(adcasin, oldca); + sbond1(oldca, adcasout); + } else { + // Bond 'oldca' to itself. + sdissolve(oldca); // sbond(oldca, oldca); + // Make sure that dummysh always correctly bonded. + dummysh[0] = sencode(oldca); + } + ssbond(oldca, ad); + } else { + sbond(oldca, adcasout); + } + if (db.sh != dummysh) { + if (dbcasout.sh != dummysh) { + sbond1(dbcasin, oldad); + sbond1(oldad, dbcasout); + } else { + // Bond 'oldad' to itself. + sdissolve(oldad); // sbond(oldad, oldad); + // Make sure that dummysh always correctly bonded. + dummysh[0] = sencode(oldad); + } + ssbond(oldad, db); + } else { + sbond(oldad, dbcasout); + } + if (bc.sh != dummysh) { + if (bccasout.sh != dummysh) { + sbond1(bccasin, olddb); + sbond1(olddb, bccasout); + } else { + // Bond 'olddb' to itself. + sdissolve(olddb); // sbond(olddb, olddb); + // Make sure that dummysh always correctly bonded. + dummysh[0] = sencode(olddb); + } + ssbond(olddb, bc); + } else { + sbond(olddb, bccasout); + } + + // New vertex assignments for the rotated subfaces. + setsorg(abc, pd); // Update abc to dca. + setsdest(abc, pc); + setsapex(abc, pa); + setsorg(bad, pc); // Update bad to cdb. + setsdest(bad, pd); + setsapex(bad, pb); + + // Update the point-to-subface map. + // Comemnt: After the flip, abc becomes dca, bad becodes cdb. + setpoint2sh(pa, sencode(abc)); // dca + setpoint2sh(pb, sencode(bad)); // cdb + setpoint2sh(pc, sencode(bad)); + setpoint2sh(pd, sencode(bad)); + + if (flipqueue != (queue *) NULL) { + enqueueflipedge(bccasout, flipqueue); + enqueueflipedge(cacasout, flipqueue); + enqueueflipedge(adcasout, flipqueue); + enqueueflipedge(dbcasout, flipqueue); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// lawson3d() Perform 3D Lawson flips on non-Delaunay faces/edges. // +// // +/////////////////////////////////////////////////////////////////////////////// + +long tetgenmesh::lawson3d(queue* flipqueue) +{ + badface *qface; + triface flipface, symface, flipedge; + triface neighface, symneighface; + face checksh, checkseg; + face neighsh, symneighsh; + point pa, pb, pc, pd, pe; + point end1, end2; + REAL sign, ori1, ori2, ori3; + REAL ori4, len, vol; + long flipcount; + int copflag; + int i; + + if (b->verbose > 1) { + printf(" Lawson flip: %ld faces.\n", flipqueue->len()); + } + flipcount = flip23s + flip32s + flip22s + flip44s; + + // Loop until the queue is empty. + while (!flipqueue->empty()) { + qface = (badface *) flipqueue->pop(); + flipface = qface->tt; + if (isdead(&flipface)) continue; + if (flipface.tet == dummytet) continue; + // Do not flip it if it is a subface. + tspivot(flipface, checksh); + if (checksh.sh != dummysh) continue; + + sym(flipface, symface); + // Only do check when the adjacent tet exists and it's not a "fake" tet. + if ((symface.tet != dummytet) && (oppo(symface) == qface->foppo)) { + flipface.ver = 0; // CCW. + pa = org(flipface); + pb = dest(flipface); + pc = apex(flipface); + pd = oppo(flipface); + pe = oppo(symface); + sign = insphere_s(pb, pa, pc, pd, pe); + assert(sign != 0.0); + + if (sign > 0.0) { + // flipface is not locally Delaunay. Try to flip it. + ori1 = orient3d(pa, pb, pd, pe); + ori2 = orient3d(pb, pc, pd, pe); + ori3 = orient3d(pc, pa, pd, pe); + + flipedge = flipface; // Initialize flipedge. + copflag = 0; + + // Find a suitable flip. + if (ori1 > 0) { + if (ori2 > 0) { + if (ori3 > 0) { // (+++) + // A 2-to-3 flip is found. + // Do not flip it if it is a subface. + // tspivot(flipface, checksh); + // if (checksh.sh == dummysh) { + // Do not flip it if it will create a tet spanning two + // "coplanar" subfaces. We treat this case as either + // a 2-to-2 or a 4-to-4 flip. + for (i = 0; i < 3; i++) { + tsspivot(&flipface, &checkseg); + if (checkseg.sh == dummysh) { + fnext(flipface, neighface); + tspivot(neighface, neighsh); + if (neighsh.sh != dummysh) { + // Check if there exist another subface. + symedge(flipface, symface); + fnext(symface, symneighface); + tspivot(symneighface, symneighsh); + if (symneighsh.sh != dummysh) { + // Do not flip this face. Try to do a 2-to-2 or a + // 4-to-4 flip instead. + flipedge = flipface; + copflag = 1; + break; + } + } + } + enextself(flipface); + } + if (i == 3) { + // Do not flip if it will create a nearly degenerate tet + // at a segment. Once we created such a tet, it may + // prevent you to split the segment later. An example + // is in dump-.lua + for (i = 0; i < 3; i++) { + tsspivot(&flipface, &checkseg); + if (checkseg.sh != dummysh) { + end1 = (point) checkseg.sh[3]; + end2 = (point) checkseg.sh[4]; + ori4 = orient3d(end1, end2, pd, pe); + len = distance(end1, end2); + vol = len * len * len; + // Is it nearly degnerate? + if ((fabs(ori4) / vol) < b->epsilon) { + flipedge = flipface; + copflag = 0; + break; + } + } + enextself(flipface); + } + if (i == 3) { + flip23(&flipface, flipqueue); + continue; + } + } + // } + } else { + if (ori3 < 0) { // (++-) + // Try to flip edge [c, a]. + flipedge.ver = 4; + copflag = 0; + } else { // (++0) + // A 2-to-2 or 4-to-4 flip at edge [c, a]. + flipedge.ver = 4; + copflag = 1; + } + } + } else { + if (ori2 < 0) { + if (ori3 > 0) { // (+-+) + // Try to flip edge [b, c]. + flipedge.ver = 2; + copflag = 0; + } else { + if (ori3 < 0) { // (+--) + // Not possible when pe is inside the circumsphere of + // the tet [pa.pb, pc, pd]. + assert(0); + } else { // (+-0) + assert(0); // The same reason as above. + } + } + } else { // ori2 == 0 + if (ori3 > 0) { // (+0+) + // A 2-to-2 or 4-to-4 flip at edge [b, c]. + flipedge.ver = 2; + copflag = 1; + } else { + if (ori3 < 0) { // (+0-) + // Not possible when pe is inside the circumsphere of + // the tet [pa.pb, pc, pd]. + assert(0); + } else { // (+00) + assert(0); // The same reason as above. + } + } + } + } + } else { + if (ori1 < 0) { + if (ori2 > 0) { + if (ori3 > 0) { // (-++) + // Try to flip edge [a, b]. + flipedge.ver = 0; + copflag = 0; + } else { + if (ori3 < 0) { // (-+-) + // Not possible when pe is inside the circumsphere of + // the tet [pa.pb, pc, pd]. + assert(0); + } else { // (-+0) + assert(0); // The same reason as above. + } + } + } else { + if (ori2 < 0) { + if (ori3 > 0) { // (--+) + // Not possible when pe is inside the circumsphere of + // the tet [pa.pb, pc, pd]. + assert(0); + } else { + if (ori3 < 0) { // (---) + assert(0); + } else { // (--0) + assert(0); + } + } + } else { // ori2 == 0 + if (ori3 > 0) { // (-0+) + assert(0); + } else { + if (ori3 < 0) { // (-0-) + assert(0); + } else { // (-00) + assert(0); + } + } + } + } + } else { // ori1 == 0 + if (ori2 > 0) { + if (ori3 > 0) { // (0++) + // A 2-to-2 or 4-to-4 flip at edge [a, b]. + flipedge.ver = 0; + copflag = 1; + } else { + if (ori3 < 0) { // (0+-) + assert(0); + } else { // (0+0) + assert(0); + } + } + } else { + if (ori2 < 0) { + if (ori3 > 0) { // (0-+) + assert(0); + } else { + if (ori3 < 0) { // (0--) + assert(0); + } else { // (0-0) + assert(0); + } + } + } else { + if (ori3 > 0) { // (00+) + assert(0); + } else { + if (ori3 < 0) { // (00-) + assert(0); + } else { // (000) + assert(0); + } + } + } + } + } + } + + // An edge (flipedge) is going to be flipped. + // Do not flip it it is a subsegment. + tsspivot(&flipedge, &checkseg); + if (checkseg.sh == dummysh) { + symedge(flipedge, symface); + if (copflag == 0) { + // Check if a 3-to-2 flip is possible. + tfnext(flipedge, neighface); + if (neighface.tet != dummytet) { + // Check if neighface is a subface. + tspivot(neighface, neighsh); + if (neighsh.sh == dummysh) { + tfnext(symface, symneighface); + if (neighface.tet == symneighface.tet) { + // symneighface should not be a subface. Check it. + tspivot(symneighface, symneighsh); + assert(symneighsh.sh == dummysh); + // Found a 3-to-2 flip. + flip32(&flipedge, flipqueue); + } + } else { + // neighsh is a subface. Check a potential 4-to-4 flip. + tfnext(symface, symneighface); + tspivot(symneighface, symneighsh); + if (symneighsh.sh != dummysh) { + if (oppo(neighface) == oppo(symneighface)) { + // Found a 4-to-4 flip. + flip22(&flipedge, flipqueue); + } + } + } + } else { + // neightface is a hull face. Since flipedge is not a segment + // and this edge is locally non-convex. + tfnext(symface, symneighface); + // symneighface should also be a hull face. + if (symneighface.tet == dummytet) { + // Force a 2-to-2 flip (recovery of Delaunay). + flip22(&flipedge, flipqueue); + } + } + } else { + // Check if a 2-to-2 or 4-to-4 flip is possible. + tfnext(flipedge, neighface); + tfnext(symface, symneighface); + if (neighface.tet != dummytet) { + if (symneighface.tet != dummytet) { + if (oppo(neighface) == oppo(symneighface)) { + // Found a 4-to-4 flip. + flip22(&flipedge, flipqueue); + } + } + } else { + if (symneighface.tet == dummytet) { + // Found a 2-to-2 flip. + flip22(&flipedge, flipqueue); + } + } + } + } + + } // if (sign > 0) + } + } // while (!flipqueue->empty()) + + flipcount = flip23s + flip32s + flip22s + flip44s - flipcount; + if (b->verbose > 1) { + printf(" %ld flips.\n", flipcount); + } + + return flipcount; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// lawson() Perform lawson flips on non-Delaunay edges. // +// // +// Assumpation: Current triangulation T contains non-Delaunay edges (after // +// inserting a point or performing a flip). Non-Delaunay edges are queued in // +// 'facequeue'. Returns the total number of flips done during this call. // +// // +/////////////////////////////////////////////////////////////////////////////// + +long tetgenmesh::lawson(queue* flipqueue) +{ + badface *qedge; + face flipedge, symedge; + face checkseg; + point pa, pb, pc, pd; + REAL vab[3], vac[3], vad[3]; + REAL dot1, dot2, lac, lad; + REAL sign, ori; + int edgeflips, maxflips; + int i; + + if (b->verbose > 1) { + printf(" Lawson flip: %ld edges.\n", flipqueue->len()); + } + + if (b->diagnose) { + maxflips = (int) ((flipqueue->len() + 1l) * 3l); + maxflips *= maxflips; + } else { + maxflips = -1; + } + edgeflips = 0; + + while (!flipqueue->empty() && maxflips != 0) { + qedge = (badface *) flipqueue->pop(); + flipedge = qedge->ss; + if (flipedge.sh == dummysh) continue; + if ((sorg(flipedge) != qedge->forg) || + (sdest(flipedge) != qedge->fdest)) continue; + sspivot(flipedge, checkseg); + if (checkseg.sh != dummysh) continue; // Can't flip a subsegment. + spivot(flipedge, symedge); + if (symedge.sh == dummysh) continue; // Can't flip a hull edge. + pa = sorg(flipedge); + pb = sdest(flipedge); + pc = sapex(flipedge); + pd = sapex(symedge); + // Choose the triangle abc or abd as the base depending on the angle1 + // (Vac, Vab) and angle2 (Vad, Vab). + for (i = 0; i < 3; i++) vab[i] = pb[i] - pa[i]; + for (i = 0; i < 3; i++) vac[i] = pc[i] - pa[i]; + for (i = 0; i < 3; i++) vad[i] = pd[i] - pa[i]; + dot1 = dot(vac, vab); + dot2 = dot(vad, vab); + dot1 *= dot1; + dot2 *= dot2; + lac = dot(vac, vac); + lad = dot(vad, vad); + if (lad * dot1 <= lac * dot2) { + // angle1 is closer to 90 than angle2, choose abc (flipedge). + abovepoint = facetabovepointarray[shellmark(flipedge)]; + if (abovepoint == (point) NULL) { + getfacetabovepoint(&flipedge); + } + sign = insphere(pa, pb, pc, abovepoint, pd); + ori = orient3d(pa, pb, pc, abovepoint); + } else { + // angle2 is closer to 90 than angle1, choose abd (symedge). + abovepoint = facetabovepointarray[shellmark(symedge)]; + if (abovepoint == (point) NULL) { + getfacetabovepoint(&symedge); + } + sign = insphere(pa, pb, pd, abovepoint, pc); + ori = orient3d(pa, pb, pd, abovepoint); + } + // Correct the sign. + sign = ori > 0.0 ? sign : -sign; + if (sign > 0.0) { + // Flip the non-Delaunay edge. + flip22sub(&flipedge, flipqueue); + edgeflips++; + if (maxflips > 0) maxflips--; + } + } + + if (!maxflips && !b->quiet) { + printf("Warning: Maximal number of flips reached !\n"); + } + + if (b->verbose > 1) { + printf(" Total %d flips.\n", edgeflips); + } + + return edgeflips; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removetetbypeeloff() Remove a boundary tet by peeling it off. // +// // +// 'striptet' (abcd) is on boundary and can be removed by stripping it off. // +// Let abc and bad are the external boundary faces. // +// // +// To strip 'abcd' from the mesh is to detach its two interal faces (dca and // +// cdb) from their adjoining tets together with a 2-to-2 flip to transform // +// two subfaces (abc and bad) into another two (dca and cdb). // +// // +// 'adjtetlist[2]' returns the two new boundary faces (in tet) dca and cdb. // +// // +// In mesh optimization. It is possible that ab is a segment and abcd is a // +// sliver on the hull. Strip abcd will also delete the segment ab. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removetetbypeeloff(triface *striptet, triface *adjtetlist) +{ + triface abcd, badc; + triface dcacasing, cdbcasing; + face abc, bad; + face abseg; + REAL ang; + + abcd = *striptet; + adjustedgering(abcd, CCW); + // Get the casing tets at the internal sides. + enextfnext(abcd, cdbcasing); + enext2fnext(abcd, dcacasing); + symself(cdbcasing); + symself(dcacasing); + // Do the neighboring tets exist? During optimization. It is possible + // that the neighboring tets are already dead. + if ((cdbcasing.tet == dummytet) || (dcacasing.tet == dummytet)) { + // Do not strip this tet. + return false; + } + + // Are there subfaces? + if (checksubfaces) { + // Get the external subfaces abc, bad. + fnext(abcd, badc); + esymself(badc); + tspivot(abcd, abc); + tspivot(badc, bad); + if (abc.sh != dummysh) { + assert(bad.sh != dummysh); + findedge(&abc, org(abcd), dest(abcd)); + findedge(&bad, org(badc), dest(badc)); + // Is ab a segment? + sspivot(abc, abseg); + if (abseg.sh != dummysh) { + // Does a segment allow to be removed? + if ((b->optlevel > 3) && (b->nobisect == 0)) { + // Only remove this segment if the dihedal angle at ab is between + // [b->maxdihedral-9, 180] (deg). This avoids mistakely fliping + // ab when it has actually no big dihedral angle while cd has. + ang = facedihedral(org(abcd), dest(abcd), apex(abcd), oppo(abcd)); + ang = ang * 180.0 / PI; + if ((ang + 9.0) > b->maxdihedral) { + if (b->verbose > 1) { + printf(" Remove a segment during peeling.\n"); + } + face prevseg, nextseg; + // It is only shared by abc and bad (abcd is a tet). + ssdissolve(abc); + ssdissolve(bad); + abseg.shver = 0; + senext(abseg, nextseg); + spivotself(nextseg); + if (nextseg.sh != dummysh) { + ssdissolve(nextseg); + } + senext2(abseg, prevseg); + spivotself(prevseg); + if (prevseg.sh != dummysh) { + ssdissolve(prevseg); + } + shellfacedealloc(subsegs, abseg.sh); + optcount[1]++; + } else { + return false; + } + } else { + return false; + } + } + // Do a 2-to-2 flip on abc and bad, transform abc->dca, bad->cdb. + flip22sub(&abc, NULL); + // The two internal faces become boundary faces. + tsbond(cdbcasing, bad); + tsbond(dcacasing, abc); + } + } + + // Detach abcd from the two internal faces. + dissolve(cdbcasing); + dissolve(dcacasing); + // Delete abcd. + tetrahedrondealloc(abcd.tet); + + adjtetlist[0] = cdbcasing; + adjtetlist[1] = dcacasing; + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeedgebyflip22() Remove an edge by a 2-to-2 (or 4-to-4) flip. // +// // +// 'abtetlist' contains n tets (n is 2 or 4) sharing edge ab, abtetlist[0] // +// and abtetlist[1] are tets abec and abde, respectively (NOTE, both are in // +// CW edge ring), where a, b, c, and d are coplanar. If n = 4, abtetlist[2] // +// and abtetlist[3] are tets abfd and abcf, respectively. This routine uses // +// flip22() to replace edge ab with cd, the surrounding tets are rotated. // +// // +// If 'key' != NULL. The old tets are replaced by the new tets only if the // +// local mesh quality is improved. Current 'key' = cos(\theta), where \theta // +// is the maximum dihedral angle in the old tets. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removeedgebyflip22(REAL *key, int n, triface *abtetlist, + queue *flipque) +{ + point pa, pb, pc, pd, pe, pf; + REAL cosmaxd, d1, d2, d3; + bool doflip; + + doflip = true; + adjustedgering(abtetlist[0], CW); + pa = org(abtetlist[0]); + pb = dest(abtetlist[0]); + pe = apex(abtetlist[0]); + pc = oppo(abtetlist[0]); + pd = apex(abtetlist[1]); + if (n == 4) { + pf = apex(abtetlist[2]); + } + if (key && (*key > -1.0)) { + tetalldihedral(pc, pd, pe, pa, NULL, &d1, NULL); + tetalldihedral(pd, pc, pe, pb, NULL, &d2, NULL); + cosmaxd = d1 < d2 ? d1 : d2; // Choose the bigger angle. + if (n == 4) { + tetalldihedral(pd, pc, pf, pa, NULL, &d1, NULL); + tetalldihedral(pc, pd, pf, pb, NULL, &d2, NULL); + d3 = d1 < d2 ? d1 : d2; // Choose the bigger angle. + cosmaxd = cosmaxd < d3 ? cosmaxd : d3; // Choose the bigger angle. + } + doflip = (*key < cosmaxd); // Can local quality be improved? + } + + if (doflip) { + flip22(&abtetlist[0], NULL); + // Return the improved quality value. + if (key) *key = cosmaxd; + } + + return doflip; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removefacebyflip23() Remove a face by a 2-to-3 flip. // +// // +// 'abctetlist' contains 2 tets sharing abc, which are [0]abcd and [1]bace. // +// This routine forms three new tets that abc is not a face anymore. Save // +// them in 'newtetlist': [0]edab, [1]edbc, and [2]edca. Note that the new // +// tets may not valid if one of them get inverted. return false if so. // +// // +// If 'key' != NULL. The old tets are replaced by the new tets only if the // +// local mesh quality is improved. Current 'key' = cos(\theta), where \theta // +// is the maximum dihedral angle in the old tets. // +// // +// If the face is flipped, 'newtetlist' returns the three new tets. The two // +// tets in 'abctetlist' are NOT deleted. The caller has the right to either // +// delete them or reverse the operation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removefacebyflip23(REAL *key, triface *abctetlist, + triface *newtetlist, queue *flipque) +{ + triface edab, edbc, edca; // new configuration. + triface newfront, oldfront, adjfront; + face checksh; + point pa, pb, pc, pd, pe; + REAL ori, cosmaxd, d1, d2, d3; + REAL attrib, volume; + bool doflip; + int i; + + adjustedgering(abctetlist[0], CCW); + pa = org(abctetlist[0]); + pb = dest(abctetlist[0]); + pc = apex(abctetlist[0]); + pd = oppo(abctetlist[0]); + pe = oppo(abctetlist[1]); + + // Check if the flip creates valid new tets. + ori = orient3d(pe, pd, pa, pb); + if (ori < 0.0) { + ori = orient3d(pe, pd, pb, pc); + if (ori < 0.0) { + ori = orient3d(pe, pd, pc, pa); + } + } + doflip = (ori < 0.0); // Can abc be flipped away? + if (doflip && (key != (REAL *) NULL)) { + if (*key > -1.0) { + // Test if the new tets reduce the maximal dihedral angle. + tetalldihedral(pe, pd, pa, pb, NULL, &d1, NULL); + tetalldihedral(pe, pd, pb, pc, NULL, &d2, NULL); + tetalldihedral(pe, pd, pc, pa, NULL, &d3, NULL); + cosmaxd = d1 < d2 ? d1 : d2; // Choose the bigger angle. + cosmaxd = cosmaxd < d3 ? cosmaxd : d3; // Choose the bigger angle. + doflip = (*key < cosmaxd); // Can local quality be improved? + } + } + + if (doflip) { + // A valid (2-to-3) flip is found. + flip23s++; + // Create the new tets. + maketetrahedron(&edab); + setorg(edab, pe); + setdest(edab, pd); + setapex(edab, pa); + setoppo(edab, pb); + maketetrahedron(&edbc); + setorg(edbc, pe); + setdest(edbc, pd); + setapex(edbc, pb); + setoppo(edbc, pc); + maketetrahedron(&edca); + setorg(edca, pe); + setdest(edca, pd); + setapex(edca, pc); + setoppo(edca, pa); + // Transfer the element attributes. + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(abctetlist[0].tet, i); + setelemattribute(edab.tet, i, attrib); + setelemattribute(edbc.tet, i, attrib); + setelemattribute(edca.tet, i, attrib); + } + // Transfer the volume constraints. + if (b->varvolume && !b->refine) { + volume = volumebound(abctetlist[0].tet); + setvolumebound(edab.tet, volume); + setvolumebound(edbc.tet, volume); + setvolumebound(edca.tet, volume); + } + // Return two new tets. + newtetlist[0] = edab; + newtetlist[1] = edbc; + newtetlist[2] = edca; + // Glue the three new tets. + for (i = 0; i < 3; i++) { + fnext(newtetlist[i], newfront); + bond(newfront, newtetlist[(i + 1) % 3]); + } + // Substitute the three new tets into the old cavity. + for (i = 0; i < 3; i++) { + fnext(abctetlist[0], oldfront); + sym(oldfront, adjfront); // may be outside. + enextfnext(newtetlist[i], newfront); + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + if (flipque != (queue *) NULL) { + enqueueflipface(newfront, flipque); + } + enextself(abctetlist[0]); + } + findedge(&(abctetlist[1]), pb, pa); + for (i = 0; i < 3; i++) { + fnext(abctetlist[1], oldfront); + sym(oldfront, adjfront); // may be outside. + enext2fnext(newtetlist[i], newfront); + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + if (flipque != (queue *) NULL) { + enqueueflipface(newfront, flipque); + } + enext2self(abctetlist[1]); + } + // Do not delete the old tets. + // for (i = 0; i < 2; i++) { + // tetrahedrondealloc(abctetlist[i].tet); + // } + // Return the improved quality value. + if (key != (REAL *) NULL) *key = cosmaxd; + return true; + } + + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeedgebyflip32() Remove an edge by a 3-to-2 flip. // +// // +// 'abtetlist' contains 3 tets sharing ab. Imaging that ab is perpendicular // +// to the screen, where a lies in front of and b lies behind it. The 3 tets // +// of the list are: [0]abce, [1]abdc, and [2]abed, respectively. // +// Comment: the edge ab is in CW edge ring of the three faces: abc, abd, and // +// abe. (2009-06-29) // +// // +// This routine forms two new tets that ab is not an edge of them. Save them // +// in 'newtetlist', [0]dcea, [1]cdeb. Note that the new tets may not valid // +// if one of them get inverted. return false if so. // +// // +// If 'key' != NULL. The old tets are replaced by the new tets only if the // +// local mesh quality is improved. Current 'key' = cos(\theta), where \theta // +// is the maximum dihedral angle in the old tets. // +// // +// If the edge is flipped, 'newtetlist' returns the two new tets. The three // +// tets in 'abtetlist' are NOT deleted. The caller has the right to either // +// delete them or reverse the operation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removeedgebyflip32(REAL *key, triface *abtetlist, + triface *newtetlist, queue *flipque) +{ + triface dcea, cdeb; // new configuration. + triface newfront, oldfront, adjfront; + face checksh, checkseg; + point pa, pb, pc, pd, pe; + REAL ori, cosmaxd, d1, d2; + REAL attrib, volume; + bool doflip; + int i; + + pa = org(abtetlist[0]); + pb = dest(abtetlist[0]); + pc = apex(abtetlist[0]); + pd = apex(abtetlist[1]); + pe = apex(abtetlist[2]); + + ori = orient3d(pd, pc, pe, pa); + if (ori < 0.0) { + ori = orient3d(pc, pd, pe, pb); + } + doflip = (ori < 0.0); // Can ab be flipped away? + + // Does the caller ensure a valid configuration? + if (doflip && (key != (REAL *) NULL)) { + if (*key > -1.0) { + // Test if the new tets reduce the maximal dihedral angle. + tetalldihedral(pd, pc, pe, pa, NULL, &d1, NULL); + tetalldihedral(pc, pd, pe, pb, NULL, &d2, NULL); + cosmaxd = d1 < d2 ? d1 : d2; // Choose the bigger angle. + doflip = (*key < cosmaxd); // Can local quality be improved? + // Return the key + *key = cosmaxd; + } + } + + // Comment: This edge must not be fixed. It has been checked before. + if (doflip && (elemfliplist != NULL)) { + // Regist this flip. + if (!registerelemflip(T32, pa, pb, dummypoint, pc, pd, pe)) { + // Detected a potential flip loop. Don't do it. + return false; + } + } + + if (doflip) { + // Create the new tets. + maketetrahedron(&dcea); + setorg(dcea, pd); + setdest(dcea, pc); + setapex(dcea, pe); + setoppo(dcea, pa); + maketetrahedron(&cdeb); + setorg(cdeb, pc); + setdest(cdeb, pd); + setapex(cdeb, pe); + setoppo(cdeb, pb); + // Transfer the element attributes. + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(abtetlist[0].tet, i); + setelemattribute(dcea.tet, i, attrib); + setelemattribute(cdeb.tet, i, attrib); + } + // Transfer the volume constraints. + if (b->varvolume && !b->refine) { + volume = volumebound(abtetlist[0].tet); + setvolumebound(dcea.tet, volume); + setvolumebound(cdeb.tet, volume); + } + // Return two new tets. + newtetlist[0] = dcea; + newtetlist[1] = cdeb; + // Glue the two new tets. + bond(dcea, cdeb); + // Substitute the two new tets into the old three-tets cavity. + for (i = 0; i < 3; i++) { + fnext(dcea, newfront); // face dca, cea, eda. + esym(abtetlist[(i + 1) % 3], oldfront); + enextfnextself(oldfront); + // Get the adjacent tet at the face (may be a dummytet). + sym(oldfront, adjfront); + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + if (flipque != (queue *) NULL) { + enqueueflipface(newfront, flipque); + } + enext2self(dcea); + } + for (i = 0; i < 3; i++) { + fnext(cdeb, newfront); // face cdb, deb, ecb. + esym(abtetlist[(i + 1) % 3], oldfront); + enext2fnextself(oldfront); + // Get the adjacent tet at the face (may be a dummytet). + sym(oldfront, adjfront); + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + if (flipque != (queue *) NULL) { + enqueueflipface(newfront, flipque); + } + enextself(cdeb); + } + // Do not delete the old tets. + // for (i = 0; i < 3; i++) { + // tetrahedrondealloc(abtetlist[i].tet); + // } + return true; + } // if (doflip) + + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeedgebytranNM() Remove an edge by transforming n-to-m tets. // +// // +// This routine attempts to remove a given edge (ab) by transforming the set // +// T of tets surrounding ab into another set T' of tets. T and T' have the // +// same outer faces and ab is not an edge of T' anymore. Let |T|=n, and |T'| // +// =m, it is actually a n-to-m flip for n > 3. The relation between n and m // +// depends on the method, ours is found below. // +// // +// 'abtetlist' contains n tets sharing ab. Imaging that ab is perpendicular // +// to the screen, where a lies in front of and b lies behind it. Let the // +// projections of the n apexes onto screen in clockwise order are: p_0, ... // +// p_n-1, respectively. The tets in the list are: [0]abp_0p_n-1,[1]abp_1p_0, // +// ..., [n-1]abp_n-1p_n-2, respectively. // +// // +// The principle of the approach is: Recursively reduce the link of ab by // +// using flip23 until only three faces remain, hence a flip32 can be applied // +// to remove ab. For a given face a.b.p_0, check a flip23 can be applied on // +// it, i.e, edge p_1.p_n-1 crosses it. NOTE*** We do the flip even p_1.p_n-1 // +// intersects with a.b (they are coplanar). If so, a degenerate tet (a.b.p_1.// +// p_n-1) is temporarily created, but it will be eventually removed by the // +// final flip32. This relaxation splits a flip44 into flip23 + flip32. *NOTE // +// Now suppose a.b.p_0 gets flipped, p_0 is not on the link of ab anymore. // +// The link is then reduced (by 1). 2 of the 3 new tets, p_n-1.p_1.p_0.a and // +// p_1.p_n-1.p_0.b, will be part of the new configuration. The left new tet,// +// a.b.p_1.p_n-1, goes into the new link of ab. A recurrence can be applied. // +// // +// If 'e1' and 'e2' are not NULLs, they specify an wanted edge to appear in // +// the new tet configuration. In such case, only do flip23 if edge e1<->e2 // +// can be recovered. It is used in removeedgebycombNM(). // +// // +// If ab gets removed. 'newtetlist' contains m new tets. By using the above // +// approach, the pairs (n, m) can be easily enumerated. For example, (3, 2),// +// (4, 4), (5, 6), (6, 8), (7, 10), (8, 12), (9, 14), (10, 16), and so on. // +// It is easy to deduce, that m = (n - 2) * 2, when n >= 3. The n tets in // +// 'abtetlist' are NOT deleted in this routine. The caller has the right to // +// either delete them or reverse this operation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removeedgebytranNM(REAL *key, int n, triface *abtetlist, + triface *newtetlist, point e1, point e2, queue *flipque) +{ + triface tmpabtetlist[21]; // Temporary max 20 tets configuration. + triface newfront, oldfront, adjfront; + face checksh; + point pa, pb, p[21]; + REAL ori, cosmaxd, d1, d2; + REAL tmpkey; + REAL attrib, volume; + bool doflip, copflag, success; + int i, j, k; + + // Maximum 20 tets. + assert(n < 20); // n <= b->maxflipedgelinksize + // Two points a and b are fixed. + pa = org(abtetlist[0]); + pb = dest(abtetlist[0]); + // The points p_0, p_1, ..., p_n-1 are permuted in each new configuration. + // These permutations can be easily done in the following loop. + // Loop through all the possible new tets configurations. Stop on finding + // a valid new tet configuration which also immproves the quality value. + for (i = 0; i < n; i++) { + // Get other n points for the current configuration. + for (j = 0; j < n; j++) { + p[j] = apex(abtetlist[(i + j) % n]); + } + // Is there a wanted edge? + if ((e1 != (point) NULL) && (e2 != (point) NULL)) { + // Yes. Skip this face if p[1]<->p[n-1] is not the edge. + if (!(((p[1] == e1) && (p[n - 1] == e2)) || + ((p[1] == e2) && (p[n - 1] == e1)))) continue; + } + // Test if face a.b.p_0 can be flipped (by flip23), ie, to check if the + // edge p_n-1.p_1 crosses face a.b.p_0 properly. + // Note. It is possible that face a.b.p_0 has type flip44, ie, a,b,p_1, + // and p_n-1 are coplanar. A trick is to split the flip44 into two + // steps: frist a flip23, then a flip32. The first step creates a + // degenerate tet (vol=0) which will be removed by the second flip. + ori = orient3d(pa, pb, p[1], p[n - 1]); + copflag = (ori == 0.0); // Are they coplanar? + if (ori >= 0.0) { + // Accept the coplanar case which supports flip44. + ori = orient3d(pb, p[0], p[1], p[n - 1]); + if (ori > 0.0) { + ori = orient3d(p[0], pa, p[1], p[n - 1]); + } + } + // Is face abc flipable? + if (ori > 0.0) { + // A valid (2-to-3) flip (or 4-to-4 flip) is found. + copflag ? flip44s++ : flip23s++; + doflip = true; + if (key != (REAL *) NULL) { + if (*key > -1.0) { + // Test if the new tets reduce the maximal dihedral angle. Only 2 + // tets, p_n-1.p_1.p_0.a and p_1.p_n-1.p_0.b, need to be tested + // The left one a.b.p_n-1.p_1 goes into the new link of ab. + tetalldihedral(p[n - 1], p[1], p[0], pa, NULL, &d1, NULL); + tetalldihedral(p[1], p[n - 1], p[0], pb, NULL, &d2, NULL); + cosmaxd = d1 < d2 ? d1 : d2; // Choose the bigger angle. + doflip = *key < cosmaxd; // Can the local quality be improved? + } + } + if (doflip && (elemfliplist != NULL)) { + // Comment: The flipping face must be not fixed. This case has been + // tested during collecting the face ring of this edge. + // Do not flip this face if it has been registered before. + if (!registerelemflip(T23, pa, pb, p[0], p[1], p[n-1], dummypoint)) { + doflip = false; // Do not flip this face. + } + } + if (doflip) { + tmpkey = key != NULL ? *key : -1.0; + // Create the two new tets. + maketetrahedron(&(newtetlist[0])); + setorg(newtetlist[0], p[n - 1]); + setdest(newtetlist[0], p[1]); + setapex(newtetlist[0], p[0]); + setoppo(newtetlist[0], pa); + maketetrahedron(&(newtetlist[1])); + setorg(newtetlist[1], p[1]); + setdest(newtetlist[1], p[n - 1]); + setapex(newtetlist[1], p[0]); + setoppo(newtetlist[1], pb); + // Create the n - 1 temporary new tets (the new Star(ab)). + maketetrahedron(&(tmpabtetlist[0])); + setorg(tmpabtetlist[0], pa); + setdest(tmpabtetlist[0], pb); + setapex(tmpabtetlist[0], p[n - 1]); + setoppo(tmpabtetlist[0], p[1]); + for (j = 1; j < n - 1; j++) { + maketetrahedron(&(tmpabtetlist[j])); + setorg(tmpabtetlist[j], pa); + setdest(tmpabtetlist[j], pb); + setapex(tmpabtetlist[j], p[j]); + setoppo(tmpabtetlist[j], p[j + 1]); + } + // Transfer the element attributes. + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(abtetlist[0].tet, j); + setelemattribute(newtetlist[0].tet, j, attrib); + setelemattribute(newtetlist[1].tet, j, attrib); + for (k = 0; k < n - 1; k++) { + setelemattribute(tmpabtetlist[k].tet, j, attrib); + } + } + // Transfer the volume constraints. + if (b->varvolume && !b->refine) { + volume = volumebound(abtetlist[0].tet); + setvolumebound(newtetlist[0].tet, volume); + setvolumebound(newtetlist[1].tet, volume); + for (k = 0; k < n - 1; k++) { + setvolumebound(tmpabtetlist[k].tet, volume); + } + } + // Glue the new tets at their internal faces: 2 + (n - 1). + bond(newtetlist[0], newtetlist[1]); // p_n-1.p_1.p_0. + fnext(newtetlist[0], newfront); + enext2fnext(tmpabtetlist[0], adjfront); + bond(newfront, adjfront); // p_n-1.p_1.a. + fnext(newtetlist[1], newfront); + enextfnext(tmpabtetlist[0], adjfront); + bond(newfront, adjfront); // p_n-1.p_1.b. + // Glue n - 1 internal faces around ab. + for (j = 0; j < n - 1; j++) { + fnext(tmpabtetlist[j], newfront); + bond(newfront, tmpabtetlist[(j + 1) % (n - 1)]); // a.b.p_j+1 + } + // Substitute the old tets with the new tets by connecting the new + // tets to the adjacent tets in the mesh. There are n * 2 (outer) + // faces of the new tets need to be operated. + // Note, after the substitution, the old tets still have pointers to + // their adjacent tets in the mesh. These pointers can be re-used + // to inverse the substitution. + for (j = 0; j < n; j++) { + // Get an old tet: [0]a.b.p_0.p_n-1 or [j]a.b.p_j.p_j-1, (j > 0). + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enextfnextself(oldfront); + // Get an adjacent tet at face: [0]a.p_0.p_n-1 or [j]a.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy. + // Get the corresponding face from the new tets. + if (j == 0) { + enext2fnext(newtetlist[0], newfront); // a.p_0.n_n-1 + } else if (j == 1) { + enextfnext(newtetlist[0], newfront); // a.p_1.p_0 + } else { // j >= 2. + enext2fnext(tmpabtetlist[j - 1], newfront); // a.p_j.p_j-1 + } + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + if (flipque != (queue *) NULL) { + // Only queue the faces of the two new tets. + if (j < 2) enqueueflipface(newfront, flipque); + } + } + for (j = 0; j < n; j++) { + // Get an old tet: [0]a.b.p_0.p_n-1 or [j]a.b.p_j.p_j-1, (j > 0). + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enext2fnextself(oldfront); + // Get an adjacent tet at face: [0]b.p_0.p_n-1 or [j]b.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy. + // Get the corresponding face from the new tets. + if (j == 0) { + enextfnext(newtetlist[1], newfront); // b.p_0.n_n-1 + } else if (j == 1) { + enext2fnext(newtetlist[1], newfront); // b.p_1.p_0 + } else { // j >= 2. + enextfnext(tmpabtetlist[j - 1], newfront); // b.p_j.p_j-1 + } + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + if (flipque != (queue *) NULL) { + // Only queue the faces of the two new tets. + if (j < 2) enqueueflipface(newfront, flipque); + } + } + // Adjust the faces in the temporary new tets at ab for recursively + // processing on the n-1 tets.(See the description at beginning) + for (j = 0; j < n - 1; j++) { + fnextself(tmpabtetlist[j]); + } + if (n > 4) { + success = removeedgebytranNM(&tmpkey, n-1, tmpabtetlist, + &(newtetlist[2]), NULL, NULL, flipque); + } else { // assert(n == 4); + success = removeedgebyflip32(&tmpkey, tmpabtetlist, + &(newtetlist[2]), flipque); + } + // No matter it was success or not, delete the temporary tets. + for (j = 0; j < n - 1; j++) { + tetrahedrondealloc(tmpabtetlist[j].tet); + } + if (success) { + // The new configuration is good. + // Do not delete the old tets. + // for (j = 0; j < n; j++) { + // tetrahedrondealloc(abtetlist[j].tet); + // } + // Save the minimal improved quality value. + if (key != (REAL *) NULL) { + *key = (tmpkey < cosmaxd ? tmpkey : cosmaxd); + } + return true; + } else { + // The new configuration is bad, substitue back the old tets. + if (elemfliplist != NULL) { + // Remove the last registered 2-to-3 flip. + elemfliplist->objects--; + } + for (j = 0; j < n; j++) { + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enextfnextself(oldfront); // [0]a.p_0.p_n-1, [j]a.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy. + bond(oldfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(oldfront, checksh); + } + } + } + for (j = 0; j < n; j++) { + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enext2fnextself(oldfront); // [0]b.p_0.p_n-1, [j]b.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy + bond(oldfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(oldfront, checksh); + } + } + } + // Delete the new tets. + tetrahedrondealloc(newtetlist[0].tet); + tetrahedrondealloc(newtetlist[1].tet); + // If tmpkey has been modified, then the failure was not due to + // unflipable configuration, but the non-improvement. + if (key && (tmpkey < *key)) { + *key = tmpkey; + return false; + } + } // if (success) + } // if (doflip) + } // if (ori > 0.0) + } // for (i = 0; i < n; i++) + + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeedgebycombNM() Remove an edge by combining two flipNMs. // +// // +// Given a set T of tets surrounding edge ab. The premise is that ab can not // +// be removed by a flipNM. This routine attempts to remove ab by two flipNMs,// +// i.e., first find and flip an edge af (or bf) by flipNM, then flip ab by // +// flipNM. If it succeeds, two sets T(ab) and T(af) of tets are replaced by // +// a new set T' and both ab and af are not edges in T' anymore. // +// // +// 'abtetlist' contains n tets sharing ab. Imaging that ab is perpendicular // +// to the screen, such that a lies in front of and b lies behind it. Let the // +// projections of the n apexes on the screen in clockwise order are: p_0,...,// +// p_n-1, respectively. So the list of tets are: [0]abp_0p_n-1, [1]abp_1p_0, // +// ..., [n-1]abp_n-1p_n-2, respectively. // +// // +// The principle of the approach is: for a face a.b.p_0, check if edge b.p_0 // +// is of type N32 (or N44). If it is, then try to do a flipNM on it. If the // +// flip is successful, then try to do another flipNM on a.b. If one of the // +// two flipNMs fails, restore the old tets as they have never been flipped. // +// Then try the next face a.b.p_1. The process can be looped for all faces // +// having ab. Stop if ab is removed or all faces have been visited. Note in // +// the above description only b.p_0 is considered, a.p_0 is done by swapping // +// the position of a and b. // +// // +// Similar operations have been described in [Joe,1995]. My approach checks // +// more cases for finding flips than Joe's. For instance, the cases (1)-(7) // +// of Joe only consider abf for finding a flip (T23/T32). My approach looks // +// all faces at ab for finding flips. Moreover, the flipNM can flip an edge // +// whose star may have more than 3 tets while Joe's only works on 3-tet case.// +// // +// If ab is removed, 'newtetlist' contains the new tets. Two sets 'abtetlist'// +// (n tets) and 'bftetlist' (n1 tets) have been replaced. The number of new // +// tets can be calculated by follows: the 1st flip transforms n1 tets into // +// (n1 - 2) * 2 new tets, however,one of the new tets goes into the new link // +// of ab, i.e., the reduced tet number in Star(ab) is n - 1; the 2nd flip // +// transforms n - 1 tets into (n - 3) * 2 new tets. Hence the number of new // +// tets are: m = ((n1 - 2) * 2 - 1) + (n - 3) * 2. The old tets are NOT del-// +// eted. The caller has the right to delete them or reverse the operation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removeedgebycombNM(REAL *key, int n, triface *abtetlist, + int *n1, triface *bftetlist, triface *newtetlist, queue *flipque) +{ + triface tmpabtetlist[21]; + triface newfront, oldfront, adjfront; + face checksh; + point pa, pb, p[21]; + REAL ori, tmpkey, tmpkey2; + REAL attrib, volume; + bool doflip, success; + int twice, count; + int i, j, k, m; + + // point *ppt; // Used together with fixededgelist. + long bakflipcount; // Used for elemfliplist. + + // Maximal 20 tets in Star(ab). + assert(n < 20); // n <= b->maxflipedgelinksize + + // Do the following procedure twice, one for flipping edge b.p_0 and the + // other for p_0.a which is symmetric to the first. + twice = 0; + do { + // Two points a and b are fixed. + pa = org(abtetlist[0]); + pb = dest(abtetlist[0]); + // The points p_0, ..., p_n-1 are permuted in the following loop. + for (i = 0; i < n; i++) { + // Get the n points for the current configuration. + for (j = 0; j < n; j++) { + p[j] = apex(abtetlist[(i + j) % n]); + } + // Check if b.p_0 is of type N32 or N44. + ori = orient3d(pb, p[0], p[1], p[n - 1]); + if ((ori > 0) && (key != (REAL *) NULL)) { + // b.p_0 is not N32. However, it is possible that the tet b.p_0.p_1. + // p_n-1 has worse quality value than the key. In such case, also + // try to flip b.p_0. + tetalldihedral(pb, p[0], p[n - 1], p[1], NULL, &tmpkey, NULL); + if (tmpkey < *key) ori = 0.0; + } + if ((fixededgelist != NULL) && (ori <= 0.0)) { + // b.p_0 is either N32 or N44. Do not flip a fixed edge. + if (check4fixededge(pb, p[0])) { + ori = 1.0; // Do not flip this edge. Skip it. + } + } + if (ori <= 0.0) { + // b.p_0 is either N32 or N44. Try the 1st flipNM. + bftetlist[0] = abtetlist[i]; + enextself(bftetlist[0]);// go to edge b.p_0. + adjustedgering(bftetlist[0], CW); // edge p_0.b. + assert(apex(bftetlist[0]) == pa); + // Form Star(b.p_0). + doflip = true; + *n1 = 0; + do { + // Is the list full? + if (*n1 == 20) break; + if (checksubfaces) { + // Stop if a subface appears. + tspivot(bftetlist[*n1], checksh); + if (checksh.sh != dummysh) { + doflip = false; break; + } + } + // Get the next tet at p_0.b. + if (!fnext(bftetlist[*n1], bftetlist[(*n1) + 1])) { + // Meet a boundary face. Do not flip. + doflip = false; break; + } + (*n1)++; + } while (apex(bftetlist[*n1]) != pa); + // 2 < n1 <= b->maxflipedgelinksize. + if (doflip) { + success = false; + tmpkey = -1.0; // = acos(pi). + if (key != (REAL *) NULL) tmpkey = *key; + m = 0; + if (*n1 == 3) { + // Three tets case. Try flip32. + success = removeedgebyflip32(&tmpkey,bftetlist,newtetlist,flipque); + m = 2; + } else if ((*n1 > 3) && (*n1 <= b->maxflipedgelinksize)) { + // Four or more tets case. Try flipNM. + success = removeedgebytranNM(&tmpkey, *n1, bftetlist, newtetlist, + p[1], p[n - 1], flipque); + // If success, the number of new tets. + m = ((*n1) - 2) * 2; + } else { + if (b->verbose > 1) { + printf(" !! Unhandled case: n1 = %d.\n", *n1); + } + } + if (success) { + // b.p_0 is flipped. The link of ab is reduced (by 1), i.e., p_0 + // is not on the link of ab. Two old tets a.b.p_0.p_n-1 and + // a.b.p_1.p_0 have been removed from the Star(ab) and one new + // tet t = a.b.p_1.p_n-1 belongs to Star(ab). + // Find t in the 'newtetlist' and remove it from the list. + setpointmark(pa, -pointmark(pa) - 1); + setpointmark(pb, -pointmark(pb) - 1); + assert(m > 0); + for (j = 0; j < m; j++) { + tmpabtetlist[0] = newtetlist[j]; + // Does it has ab? + count = 0; + for (k = 0; k < 4; k++) { + if (pointmark((point)(tmpabtetlist[0].tet[4+k])) < 0) count++; + } + if (count == 2) { + // It is. Adjust t to be the edge ab. + for (tmpabtetlist[0].loc = 0; tmpabtetlist[0].loc < 4; + tmpabtetlist[0].loc++) { + if ((oppo(tmpabtetlist[0]) != pa) && + (oppo(tmpabtetlist[0]) != pb)) break; + } + // The face of t must contain ab. + assert(tmpabtetlist[0].loc < 4); + findedge(&(tmpabtetlist[0]), pa, pb); + break; + } + } + assert(j < m); // The tet must exist. + // Remove t from list. Fill t's position by the last tet. + newtetlist[j] = newtetlist[m - 1]; + setpointmark(pa, -(pointmark(pa) + 1)); + setpointmark(pb, -(pointmark(pb) + 1)); + // Create the temporary Star(ab) for the next flipNM. + adjustedgering(tmpabtetlist[0], CCW); + if (org(tmpabtetlist[0]) != pa) { + fnextself(tmpabtetlist[0]); + esymself(tmpabtetlist[0]); + } +#ifdef SELF_CHECK + // Make sure current edge is a->b. + assert(org(tmpabtetlist[0]) == pa); + assert(dest(tmpabtetlist[0]) == pb); + assert(apex(tmpabtetlist[0]) == p[n - 1]); + assert(oppo(tmpabtetlist[0]) == p[1]); +#endif // SELF_CHECK + // There are n - 2 left temporary tets. + for (j = 1; j < n - 1; j++) { + maketetrahedron(&(tmpabtetlist[j])); + setorg(tmpabtetlist[j], pa); + setdest(tmpabtetlist[j], pb); + setapex(tmpabtetlist[j], p[j]); + setoppo(tmpabtetlist[j], p[j + 1]); + } + // Transfer the element attributes. + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(abtetlist[0].tet, j); + for (k = 0; k < n - 1; k++) { + setelemattribute(tmpabtetlist[k].tet, j, attrib); + } + } + // Transfer the volume constraints. + if (b->varvolume && !b->refine) { + volume = volumebound(abtetlist[0].tet); + for (k = 0; k < n - 1; k++) { + setvolumebound(tmpabtetlist[k].tet, volume); + } + } + // Glue n - 1 internal faces of Star(ab). + for (j = 0; j < n - 1; j++) { + fnext(tmpabtetlist[j], newfront); + bond(newfront, tmpabtetlist[(j + 1) % (n - 1)]); // a.b.p_j+1 + } + // Substitute the old tets with the new tets by connecting the + // new tets to the adjacent tets in the mesh. There are (n-2) + // * 2 (outer) faces of the new tets need to be operated. + // Note that the old tets still have the pointers to their + // adjacent tets in the mesh. These pointers can be re-used + // to inverse the substitution. + for (j = 2; j < n; j++) { + // Get an old tet: [j]a.b.p_j.p_j-1, (j > 1). + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enextfnextself(oldfront); + // Get an adjacent tet at face: [j]a.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy. + // Get the corresponding face from the new tets. + // j >= 2. + enext2fnext(tmpabtetlist[j - 1], newfront); // a.p_j.p_j-1 + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + } + for (j = 2; j < n; j++) { + // Get an old tet: [j]a.b.p_j.p_j-1, (j > 2). + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enext2fnextself(oldfront); + // Get an adjacent tet at face: [j]b.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy. + // Get the corresponding face from the new tets. + // j >= 2. + enextfnext(tmpabtetlist[j - 1], newfront); // b.p_j.p_j-1 + bond(newfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(newfront, checksh); + } + } + } + // Adjust the faces in the temporary new tets at ab for + // recursively processing on the n-1 tets. + for (j = 0; j < n - 1; j++) { + fnextself(tmpabtetlist[j]); + } + tmpkey2 = -1; + if (key) tmpkey2 = *key; + if (elemfliplist != NULL) { + // Remember the current registered flips. + bakflipcount = elemfliplist->objects; + } + if ((n - 1) == 3) { + success = removeedgebyflip32(&tmpkey2, tmpabtetlist, + &(newtetlist[m - 1]), flipque); + } else { // assert((n - 1) >= 4); + success = removeedgebytranNM(&tmpkey2, n - 1, tmpabtetlist, + &(newtetlist[m - 1]), NULL, NULL, flipque); + } + // No matter it was success or not, delete the temporary tets. + for (j = 0; j < n - 1; j++) { + tetrahedrondealloc(tmpabtetlist[j].tet); + } + if (success) { + // The new configuration is good. + // Do not delete the old tets. + // for (j = 0; j < n; j++) { + // tetrahedrondealloc(abtetlist[j].tet); + // } + // Return the bigger dihedral in the two sets of new tets. + if (key != (REAL *) NULL) { + *key = tmpkey2 < tmpkey ? tmpkey2 : tmpkey; + } + return true; + } else { + // The new configuration is bad, substitue back the old tets. + if (elemfliplist != NULL) { + // Restore the registered flips. + elemfliplist->objects = bakflipcount; + } + for (j = 0; j < n; j++) { + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enextfnextself(oldfront); // [0]a.p_0.p_n-1, [j]a.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy. + bond(oldfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(oldfront, checksh); + } + } + } + for (j = 0; j < n; j++) { + oldfront = abtetlist[(i + j) % n]; + esymself(oldfront); + enext2fnextself(oldfront); // [0]b.p_0.p_n-1, [j]b.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy + bond(oldfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(oldfront, checksh); + } + } + } + // Substitute back the old tets of the first flip. + for (j = 0; j < *n1; j++) { + oldfront = bftetlist[j]; + esymself(oldfront); + enextfnextself(oldfront); + sym(oldfront, adjfront); // adjfront may be dummy. + bond(oldfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(oldfront, checksh); + } + } + } + for (j = 0; j < *n1; j++) { + oldfront = bftetlist[j]; + esymself(oldfront); + enext2fnextself(oldfront); // [0]b.p_0.p_n-1, [j]b.p_j.p_j-1. + sym(oldfront, adjfront); // adjfront may be dummy + bond(oldfront, adjfront); + if (checksubfaces) { + tspivot(oldfront, checksh); + if (checksh.sh != dummysh) { + tsbond(oldfront, checksh); + } + } + } + // Delete the new tets of the first flip. Note that one new + // tet has already been removed from the list. + for (j = 0; j < m - 1; j++) { + tetrahedrondealloc(newtetlist[j].tet); + } + } // if (success) + } // if (success) + } // if (doflip) + } // if (ori <= 0.0) + } // for (i = 0; i < n; i++) + // Inverse a and b and the tets configuration. + for (i = 0; i < n; i++) newtetlist[i] = abtetlist[i]; + for (i = 0; i < n; i++) { + oldfront = newtetlist[n - i - 1]; + esymself(oldfront); + fnextself(oldfront); + abtetlist[i] = oldfront; + } + twice++; + } while (twice < 2); + + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splittetrahedron() Insert a point into a tetrahedron, split it into // +// four tetrahedra. // +// // +// The tetrahedron is given by 'splittet'. Let it is abcd. The inserting // +// point 'newpoint' v should lie strictly inside abcd. // +// // +// Splitting a tetrahedron is to shrink abcd to abcv, and create three new // +// tetrahedra badv, cbdv, and acdv. // +// // +// On completion, 'splittet' returns abcv. If 'flipqueue' is not NULL, it // +// contains all possibly non-locally Delaunay faces. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::splittetrahedron(point newpoint, triface* splittet, + queue* flipqueue) +{ + triface oldabd, oldbcd, oldcad; // Old configuration. + triface abdcasing, bcdcasing, cadcasing; + face abdsh, bcdsh, cadsh; + triface abcv, badv, cbdv, acdv; // New configuration. + triface worktet; + face abseg, bcseg, caseg; + face adseg, bdseg, cdseg; + point pa, pb, pc, pd; + REAL attrib, volume; + int i; + + abcv = *splittet; + abcv.ver = 0; + // Set the changed vertices and new tetrahedron. + pa = org(abcv); + pb = dest(abcv); + pc = apex(abcv); + pd = oppo(abcv); + + if (b->verbose > 1) { + printf(" Inserting point %d in tetrahedron (%d, %d, %d, %d).\n", + pointmark(newpoint), pointmark(pa), pointmark(pb), pointmark(pc), + pointmark(pd)); + } + + fnext(abcv, oldabd); + enextfnext(abcv, oldbcd); + enext2fnext(abcv, oldcad); + sym(oldabd, abdcasing); + sym(oldbcd, bcdcasing); + sym(oldcad, cadcasing); + maketetrahedron(&badv); + maketetrahedron(&cbdv); + maketetrahedron(&acdv); + + // Set 'badv' vertices. + setorg (badv, pb); + setdest(badv, pa); + setapex(badv, pd); + setoppo(badv, newpoint); + // Set 'cbdv' vertices. + setorg (cbdv, pc); + setdest(cbdv, pb); + setapex(cbdv, pd); + setoppo(cbdv, newpoint); + // Set 'acdv' vertices. + setorg (acdv, pa); + setdest(acdv, pc); + setapex(acdv, pd); + setoppo(acdv, newpoint); + // Set 'abcv' vertices + setoppo(abcv, newpoint); + + // Set the element attributes of the new tetrahedra. + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(abcv.tet, i); + setelemattribute(badv.tet, i, attrib); + setelemattribute(cbdv.tet, i, attrib); + setelemattribute(acdv.tet, i, attrib); + } + // Set the volume constraint of the new tetrahedra. + if (b->varvolume) { + volume = volumebound(abcv.tet); + setvolumebound(badv.tet, volume); + setvolumebound(cbdv.tet, volume); + setvolumebound(acdv.tet, volume); + } + + // Bond the new triangles to the surrounding tetrahedron. + bond(badv, abdcasing); + bond(cbdv, bcdcasing); + bond(acdv, cadcasing); + // There may exist subfaces need to be bonded to the new tetrahedra. + if (checksubfaces) { + tspivot(oldabd, abdsh); + if (abdsh.sh != dummysh) { + tsdissolve(oldabd); + tsbond(badv, abdsh); + } + tspivot(oldbcd, bcdsh); + if (bcdsh.sh != dummysh) { + tsdissolve(oldbcd); + tsbond(cbdv, bcdsh); + } + tspivot(oldcad, cadsh); + if (cadsh.sh != dummysh) { + tsdissolve(oldcad); + tsbond(acdv, cadsh); + } + } else if (checksubsegs) { + tsspivot1(abcv, abseg); + if (abseg.sh != dummysh) { + tssbond1(badv, abseg); + } + enext(abcv, worktet); + tsspivot1(worktet, bcseg); + if (bcseg.sh != dummysh) { + tssbond1(cbdv, bcseg); + } + enext2(abcv, worktet); + tsspivot1(worktet, caseg); + if (caseg.sh != dummysh) { + tssbond1(acdv, caseg); + } + fnext(abcv, worktet); + enext2self(worktet); + tsspivot1(worktet, adseg); + if (adseg.sh != dummysh) { + tssdissolve1(worktet); + enext(badv, worktet); + tssbond1(worktet, adseg); + enext2(acdv, worktet); + tssbond1(worktet, adseg); + } + enextfnext(abcv, worktet); + enext2self(worktet); + tsspivot1(worktet, bdseg); + if (bdseg.sh != dummysh) { + tssdissolve1(worktet); + enext(cbdv, worktet); + tssbond1(worktet, bdseg); + enext2(badv, worktet); + tssbond1(worktet, bdseg); + } + enext2fnext(abcv, worktet); + enext2self(worktet); + tsspivot1(worktet, cdseg); + if (cdseg.sh != dummysh) { + tssdissolve1(worktet); + enext(acdv, worktet); + tssbond1(worktet, cdseg); + enext2(cbdv, worktet); + tssbond1(worktet, cdseg); + } + } + badv.loc = 3; + cbdv.loc = 2; + bond(badv, cbdv); + cbdv.loc = 3; + acdv.loc = 2; + bond(cbdv, acdv); + acdv.loc = 3; + badv.loc = 2; + bond(acdv, badv); + badv.loc = 1; + bond(badv, oldabd); + cbdv.loc = 1; + bond(cbdv, oldbcd); + acdv.loc = 1; + bond(acdv, oldcad); + + badv.loc = 0; + cbdv.loc = 0; + acdv.loc = 0; + if (b->verbose > 3) { + printf(" Updating abcv "); + printtet(&abcv); + printf(" Creating badv "); + printtet(&badv); + printf(" Creating cbdv "); + printtet(&cbdv); + printf(" Creating acdv "); + printtet(&acdv); + } + + if (flipqueue != (queue *) NULL) { + enqueueflipface(abcv, flipqueue); + enqueueflipface(badv, flipqueue); + enqueueflipface(cbdv, flipqueue); + enqueueflipface(acdv, flipqueue); + } + + // Save a handle for quick point location. + recenttet = abcv; + // Set the return handle be abcv. + *splittet = abcv; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splittetface() Insert a point on a face of a mesh. // +// // +// 'splittet' is the splitting face. Let it is abcd, where abc is the face // +// will be split. If abc is not a hull face, abce is the tetrahedron at the // +// opposite of d. // +// // +// To split face abc by a point v is to shrink the tetrahedra abcd to abvd, // +// create two new tetrahedra bcvd, cavd. If abc is not a hull face, shrink // +// the tetrahedra bace to bave, create two new tetrahedra cbve, acve. // +// // +// If abc is a subface, it is split into three subfaces simultaneously by // +// calling routine splitsubface(), hence, abv, bcv, cav. The edge rings of // +// the split subfaces have the same orientation as abc's. // +// // +// On completion, 'splittet' returns abvd. If 'flipqueue' is not NULL, it // +// contains all possibly non-locally Delaunay faces. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::splittetface(point newpoint, triface* splittet, + queue* flipqueue) +{ + triface abcd, bace; // Old configuration. + triface oldbcd, oldcad, oldace, oldcbe; + triface bcdcasing, cadcasing, acecasing, cbecasing; + face abcsh, bcdsh, cadsh, acesh, cbesh; + triface abvd, bcvd, cavd, bave, cbve, acve; // New configuration. + triface worktet; + face bcseg, caseg; + face adseg, bdseg, cdseg; + face aeseg, beseg, ceseg; + point pa, pb, pc, pd, pe; + REAL attrib, volume; + bool mirrorflag; + int i; + + abcd = *splittet; + // abcd.ver = 0; // Adjust to be CCW edge ring. + adjustedgering(abcd, CCW); + pa = org(abcd); + pb = dest(abcd); + pc = apex(abcd); + pd = oppo(abcd); + pe = (point) NULL; // avoid a compile warning. + // Is there a second tetrahderon? + mirrorflag = issymexist(&abcd); + if (mirrorflag) { + // This is an interior face. + sym(abcd, bace); + findedge(&bace, dest(abcd), org(abcd)); + pe = oppo(bace); + } + if (checksubfaces) { + // Is there a subface need to be split together? + tspivot(abcd, abcsh); + if (abcsh.sh != dummysh) { + // Exists! Keep the edge ab of both handles be the same. + findedge(&abcsh, org(abcd), dest(abcd)); + } + } + + if (b->verbose > 1) { + printf(" Inserting point %d on face (%d, %d, %d).\n", pointmark(newpoint), + pointmark(pa), pointmark(pb), pointmark(pc)); + } + + // Save the old configuration at faces bcd and cad. + enextfnext(abcd, oldbcd); + enext2fnext(abcd, oldcad); + sym(oldbcd, bcdcasing); + sym(oldcad, cadcasing); + // Create two new tetrahedra. + maketetrahedron(&bcvd); + maketetrahedron(&cavd); + if (mirrorflag) { + // Save the old configuration at faces bce and cae. + enextfnext(bace, oldace); + enext2fnext(bace, oldcbe); + sym(oldace, acecasing); + sym(oldcbe, cbecasing); + // Create two new tetrahedra. + maketetrahedron(&acve); + maketetrahedron(&cbve); + } else { + // Splitting a boundary face increases the number of boundary faces. + hullsize += 2; + } + + // Set vertices to the changed tetrahedron and new tetrahedra. + abvd = abcd; // Update 'abcd' to 'abvd'. + setapex(abvd, newpoint); + setorg (bcvd, pb); // Set 'bcvd'. + setdest(bcvd, pc); + setapex(bcvd, newpoint); + setoppo(bcvd, pd); + setorg (cavd, pc); // Set 'cavd'. + setdest(cavd, pa); + setapex(cavd, newpoint); + setoppo(cavd, pd); + // Set the element attributes of the new tetrahedra. + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(abvd.tet, i); + setelemattribute(bcvd.tet, i, attrib); + setelemattribute(cavd.tet, i, attrib); + } + if (b->varvolume) { + // Set the area constraint of the new tetrahedra. + volume = volumebound(abvd.tet); + setvolumebound(bcvd.tet, volume); + setvolumebound(cavd.tet, volume); + } + if (mirrorflag) { + bave = bace; // Update 'bace' to 'bave'. + setapex(bave, newpoint); + setorg (acve, pa); // Set 'acve'. + setdest(acve, pc); + setapex(acve, newpoint); + setoppo(acve, pe); + setorg (cbve, pc); // Set 'cbve'. + setdest(cbve, pb); + setapex(cbve, newpoint); + setoppo(cbve, pe); + // Set the element attributes of the new tetrahedra. + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(bave.tet, i); + setelemattribute(acve.tet, i, attrib); + setelemattribute(cbve.tet, i, attrib); + } + if (b->varvolume) { + // Set the area constraint of the new tetrahedra. + volume = volumebound(bave.tet); + setvolumebound(acve.tet, volume); + setvolumebound(cbve.tet, volume); + } + } + + // Bond the new tetrahedra to the surrounding tetrahedra. + bcvd.loc = 1; + bond(bcvd, bcdcasing); + cavd.loc = 1; + bond(cavd, cadcasing); + bcvd.loc = 3; + bond(bcvd, oldbcd); + cavd.loc = 2; + bond(cavd, oldcad); + bcvd.loc = 2; + cavd.loc = 3; + bond(bcvd, cavd); + if (mirrorflag) { + acve.loc = 1; + bond(acve, acecasing); + cbve.loc = 1; + bond(cbve, cbecasing); + acve.loc = 3; + bond(acve, oldace); + cbve.loc = 2; + bond(cbve, oldcbe); + acve.loc = 2; + cbve.loc = 3; + bond(acve, cbve); + // Bond two new coplanar facets. + bcvd.loc = 0; + cbve.loc = 0; + bond(bcvd, cbve); + cavd.loc = 0; + acve.loc = 0; + bond(cavd, acve); + } + + // There may exist subface needed to be bonded to the new tetrahedra. + if (checksubfaces) { + tspivot(oldbcd, bcdsh); + if (bcdsh.sh != dummysh) { + tsdissolve(oldbcd); + bcvd.loc = 1; + tsbond(bcvd, bcdsh); + } + tspivot(oldcad, cadsh); + if (cadsh.sh != dummysh) { + tsdissolve(oldcad); + cavd.loc = 1; + tsbond(cavd, cadsh); + } + if (mirrorflag) { + tspivot(oldace, acesh); + if (acesh.sh != dummysh) { + tsdissolve(oldace); + acve.loc = 1; + tsbond(acve, acesh); + } + tspivot(oldcbe, cbesh); + if (cbesh.sh != dummysh) { + tsdissolve(oldcbe); + cbve.loc = 1; + tsbond(cbve, cbesh); + } + } + // Is there a subface needs to be split together? + if (abcsh.sh != dummysh) { + // Split this subface 'abc' into three i.e, abv, bcv, cav. + splitsubface(newpoint, &abcsh, (queue *) NULL); + } + } else if (checksubsegs) { + // abvd.loc = abvd.ver = 0; + bcvd.loc = bcvd.ver = 0; + cavd.loc = cavd.ver = 0; + if (mirrorflag) { + // bave.loc = bave.ver = 0; + cbve.loc = cbve.ver = 0; + acve.loc = acve.ver = 0; + } + enext(abvd, worktet); + tsspivot1(worktet, bcseg); + if (bcseg.sh != dummysh) { + tssdissolve1(worktet); + tssbond1(bcvd, bcseg); + if (mirrorflag) { + enext2(bave, worktet); + tssdissolve1(worktet); + tssbond1(cbve, bcseg); + } + } + enext2(abvd, worktet); + tsspivot1(worktet, caseg); + if (caseg.sh != dummysh) { + tssdissolve1(worktet); + tssbond1(cavd, caseg); + if (mirrorflag) { + enext(bave, worktet); + tssdissolve1(worktet); + tssbond1(acve, caseg); + } + } + fnext(abvd, worktet); + enext2self(worktet); + tsspivot1(worktet, adseg); + if (adseg.sh != dummysh) { + fnext(cavd, worktet); + enextself(worktet); + tssbond1(worktet, adseg); + } + fnext(abvd, worktet); + enextself(worktet); + tsspivot1(worktet, bdseg); + if (bdseg.sh != dummysh) { + fnext(bcvd, worktet); + enext2self(worktet); + tssbond1(worktet, bdseg); + } + enextfnext(abvd, worktet); + enextself(worktet); + tsspivot1(worktet, cdseg); + if (cdseg.sh != dummysh) { + tssdissolve1(worktet); + fnext(bcvd, worktet); + enextself(worktet); + tssbond1(worktet, cdseg); + fnext(cavd, worktet); + enext2self(worktet); + tssbond1(worktet, cdseg); + } + if (mirrorflag) { + fnext(bave, worktet); + enextself(worktet); + tsspivot1(worktet, aeseg); + if (aeseg.sh != dummysh) { + fnext(acve, worktet); + enext2self(worktet); + tssbond1(worktet, aeseg); + } + fnext(bave, worktet); + enext2self(worktet); + tsspivot1(worktet, beseg); + if (beseg.sh != dummysh) { + fnext(cbve, worktet); + enextself(worktet); + tssbond1(worktet, beseg); + } + enextfnext(bave, worktet); + enextself(worktet); + tsspivot1(worktet, ceseg); + if (ceseg.sh != dummysh) { + tssdissolve1(worktet); + fnext(cbve, worktet); + enext2self(worktet); + tssbond1(worktet, ceseg); + fnext(acve, worktet); + enextself(worktet); + tssbond1(worktet, ceseg); + } + } + } + + // Save a handle for quick point location. + recenttet = abvd; + // Set the return handle be abvd. + *splittet = abvd; + + bcvd.loc = 0; + cavd.loc = 0; + if (mirrorflag) { + cbve.loc = 0; + acve.loc = 0; + } + if (b->verbose > 3) { + printf(" Updating abvd "); + printtet(&abvd); + printf(" Creating bcvd "); + printtet(&bcvd); + printf(" Creating cavd "); + printtet(&cavd); + if (mirrorflag) { + printf(" Updating bave "); + printtet(&bave); + printf(" Creating cbve "); + printtet(&cbve); + printf(" Creating acve "); + printtet(&acve); + } + } + + if (flipqueue != (queue *) NULL) { + fnextself(abvd); + enqueueflipface(abvd, flipqueue); + fnextself(bcvd); + enqueueflipface(bcvd, flipqueue); + fnextself(cavd); + enqueueflipface(cavd, flipqueue); + if (mirrorflag) { + fnextself(bave); + enqueueflipface(bave, flipqueue); + fnextself(cbve); + enqueueflipface(cbve, flipqueue); + fnextself(acve); + enqueueflipface(acve, flipqueue); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splitsubface() Insert a point on a subface, split it into three. // +// // +// The subface is 'splitface'. Let it is abc. The inserting point 'newpoint'// +// v should lie inside abc. If the neighbor tetrahedra of abc exist, i.e., // +// abcd and bace, they should have been split by routine splittetface() // +// before calling this routine, so the connection between the new tetrahedra // +// and new subfaces can be correctly set. // +// // +// To split subface abc by point v is to shrink abc to abv, create two new // +// subfaces bcv and cav. Set the connection between updated and new created // +// subfaces. If there is a subsegment at edge bc or ca, connection of new // +// subface (bcv or cav) to its casing subfaces is a face link, 'casingin' is // +// the predecessor and 'casingout' is the successor. It is important to keep // +// the orientations of the edge rings of the updated and created subfaces be // +// the same as abc's. So they have the same orientation as other subfaces of // +// this facet with respect to the lift point of this facet. // +// // +// On completion, 'splitface' returns abv. If 'flipqueue' is not NULL, it // +// returns all possibly non-Delaunay edges. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::splitsubface(point newpoint, face* splitface, + queue* flipqueue) +{ + triface abvd, bcvd, cavd, bave, cbve, acve; + face abc, oldbc, oldca, bc, ca, spinsh; + face bccasin, bccasout, cacasin, cacasout; + face abv, bcv, cav; + point pa, pb, pc; + + abc = *splitface; + // The newly created subfaces will have the same edge ring as abc. + adjustedgering(abc, CCW); + pa = sorg(abc); + pb = sdest(abc); + pc = sapex(abc); + + if (b->verbose > 1) { + printf(" Inserting point %d on subface (%d, %d, %d).\n", + pointmark(newpoint), pointmark(pa), pointmark(pb), pointmark(pc)); + } + + // Save the old configuration at edge bc and ca. Subsegments may appear + // at both sides, save the face links and dissolve them. + senext(abc, oldbc); + senext2(abc, oldca); + spivot(oldbc, bccasout); + sspivot(oldbc, bc); + if (bc.sh != dummysh) { + if (bccasout.sh != dummysh) { + // 'oldbc' is not self-bonded. + spinsh = bccasout; + do { + bccasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != oldbc.sh); + } + ssdissolve(oldbc); + } + spivot(oldca, cacasout); + sspivot(oldca, ca); + if (ca.sh != dummysh) { + if (cacasout.sh != dummysh) { + // 'oldca' is not self-bonded. + spinsh = cacasout; + do { + cacasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != oldca.sh); + } + ssdissolve(oldca); + } + // Create two new subfaces. + makeshellface(subfaces, &bcv); + makeshellface(subfaces, &cav); + + // Set the vertices of changed and new subfaces. + abv = abc; // Update 'abc' to 'abv'. + setsapex(abv, newpoint); + setsorg(bcv, pb); // Set 'bcv'. + setsdest(bcv, pc); + setsapex(bcv, newpoint); + setsorg(cav, pc); // Set 'cav'. + setsdest(cav, pa); + setsapex(cav, newpoint); + if (b->quality && varconstraint) { + // Copy yhr area bound into the new subfaces. + setareabound(bcv, areabound(abv)); + setareabound(cav, areabound(abv)); + } + // Copy the boundary mark into the new subfaces. + setshellmark(bcv, shellmark(abv)); + setshellmark(cav, shellmark(abv)); + // Copy the subface type into the new subfaces. + setshelltype(bcv, shelltype(abv)); + setshelltype(cav, shelltype(abv)); + if (checkpbcs) { + // Copy the pbcgroup into the new subfaces. + setshellpbcgroup(bcv, shellpbcgroup(abv)); + setshellpbcgroup(cav, shellpbcgroup(abv)); + } + // Bond the new subfaces to the surrounding subfaces. + if (bc.sh != dummysh) { + if (bccasout.sh != dummysh) { + sbond1(bccasin, bcv); + sbond1(bcv, bccasout); + } else { + // Bond 'bcv' to itsself. + sdissolve(bcv); // sbond(bcv, bcv); + } + ssbond(bcv, bc); + } else { + sbond(bcv, bccasout); + } + if (ca.sh != dummysh) { + if (cacasout.sh != dummysh) { + sbond1(cacasin, cav); + sbond1(cav, cacasout); + } else { + // Bond 'cav' to itself. + sdissolve(cav); // sbond(cav, cav); + } + ssbond(cav, ca); + } else { + sbond(cav, cacasout); + } + senext2self(bcv); + sbond(bcv, oldbc); + senextself(cav); + sbond(cav, oldca); + senext2self(bcv); + senextself(cav); + sbond(bcv, cav); + + // Bond the new subfaces to the new tetrahedra if they exist. + stpivot(abv, abvd); + if (abvd.tet != dummytet) { + // Get two new tetrahedra and their syms. + findedge(&abvd, sorg(abv), sdest(abv)); + enextfnext(abvd, bcvd); +#ifdef SELF_CHECK + assert(bcvd.tet != dummytet); +#endif + fnextself(bcvd); + enext2fnext(abvd, cavd); +#ifdef SELF_CHECK + assert(cavd.tet != dummytet); +#endif + fnextself(cavd); + // Bond two new subfaces to the two new tetrahedra. + tsbond(bcvd, bcv); + tsbond(cavd, cav); + } + // Set the connection at the other sides if the tetrahedra exist. + sesymself(abv); // bav + stpivot(abv, bave); + if (bave.tet != dummytet) { + sesymself(bcv); // cbv + sesymself(cav); // acv + // Get two new tetrahedra and their syms. + findedge(&bave, sorg(abv), sdest(abv)); + enextfnext(bave, acve); +#ifdef SELF_CHECK + assert(acve.tet != dummytet); +#endif + fnextself(acve); + enext2fnext(bave, cbve); +#ifdef SELF_CHECK + assert(cbve.tet != dummytet); +#endif + fnextself(cbve); + // Bond two new subfaces to the two new tetrahedra. + tsbond(acve, cav); + tsbond(cbve, bcv); + } + + bcv.shver = 0; + cav.shver = 0; + if (b->verbose > 3) { + printf(" Updating abv "); + printsh(&abv); + printf(" Creating bcv "); + printsh(&bcv); + printf(" Creating cav "); + printsh(&cav); + } + + if (flipqueue != (queue *) NULL) { + enqueueflipedge(abv, flipqueue); + enqueueflipedge(bcv, flipqueue); + enqueueflipedge(cav, flipqueue); + } + + // Set the return handle be abv. + *splitface = abv; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splittetedge() Insert a point on an edge of the mesh. // +// // +// The edge is given by 'splittet'. Assume its four corners are a, b, n1 and // +// n2, where ab is the edge will be split. Around ab may exist any number of // +// tetrahedra. For convenience, they're ordered in a sequence following the // +// right-hand rule with your thumb points from a to b. Let the vertex set of // +// these tetrahedra be {a, b, n1, n2, ..., n(i)}. NOTE the tetrahedra around // +// ab may not connect to each other (can only happen when ab is a subsegment,// +// hence some faces abn(i) are subfaces). If ab is a subsegment, abn1 must // +// be a subface. // +// // +// To split edge ab by a point v is to split all tetrahedra containing ab by // +// v. More specifically, for each such tetrahedron, an1n2b, it is shrunk to // +// an1n2v, and a new tetrahedra bn2n1v is created. If ab is a subsegment, or // +// some faces of the splitting tetrahedra are subfaces, they must be split // +// either by calling routine 'splitsubedge()'. // +// // +// On completion, 'splittet' returns avn1n2. If 'flipqueue' is not NULL, it // +// returns all faces which may become non-Delaunay after this operation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::splittetedge(point newpoint, triface* splittet, + queue* flipqueue) +{ + triface *bots, *newtops; + triface oldtop, topcasing; + triface spintet, tmpbond0, tmpbond1; + face abseg, splitsh, topsh, spinsh; + triface worktet; + face n1n2seg, n2vseg, n1vseg; + point pa, pb, n1, n2; + REAL attrib, volume; + int wrapcount, hitbdry; + int i, j; + + if (checksubfaces) { + // Is there a subsegment need to be split together? + tsspivot(splittet, &abseg); + if (abseg.sh != dummysh) { + abseg.shver = 0; + // Orient the edge direction of 'splittet' be abseg. + if (org(*splittet) != sorg(abseg)) { + esymself(*splittet); + } + } + } + spintet = *splittet; + pa = org(spintet); + pb = dest(spintet); + + if (b->verbose > 1) { + printf(" Inserting point %d on edge (%d, %d).\n", + pointmark(newpoint), pointmark(pa), pointmark(pb)); + } + + // Collect the tetrahedra containing the splitting edge (ab). + n1 = apex(spintet); + hitbdry = 0; + wrapcount = 1; + if (checksubfaces && abseg.sh != dummysh) { + // It may happen that some tetrahedra containing ab (a subsegment) are + // completely disconnected with others. If it happens, use the face + // link of ab to cross the boundary. + while (true) { + if (!fnextself(spintet)) { + // Meet a boundary, walk through it. + hitbdry ++; + tspivot(spintet, spinsh); +#ifdef SELF_CHECK + assert(spinsh.sh != dummysh); +#endif + findedge(&spinsh, pa, pb); + sfnextself(spinsh); + stpivot(spinsh, spintet); +#ifdef SELF_CHECK + assert(spintet.tet != dummytet); +#endif + findedge(&spintet, pa, pb); + // Remember this position (hull face) in 'splittet'. + *splittet = spintet; + // Split two hull faces increase the hull size; + hullsize += 2; + } + if (apex(spintet) == n1) break; + wrapcount ++; + } + if (hitbdry > 0) { + wrapcount -= hitbdry; + } + } else { + // All the tetrahedra containing ab are connected together. If there + // are subfaces, 'splitsh' keeps one of them. + splitsh.sh = dummysh; + while (hitbdry < 2) { + if (checksubfaces && splitsh.sh == dummysh) { + tspivot(spintet, splitsh); + } + if (fnextself(spintet)) { + if (apex(spintet) == n1) break; + wrapcount++; + } else { + hitbdry ++; + if (hitbdry < 2) { + esym(*splittet, spintet); + } + } + } + if (hitbdry > 0) { + // ab is on the hull. + wrapcount -= 1; + // 'spintet' now is a hull face, inverse its edge direction. + esym(spintet, *splittet); + // Split two hull faces increases the number of hull faces. + hullsize += 2; + } + } + + // Make arrays of updating (bot, oldtop) and new (newtop) tetrahedra. + bots = new triface[wrapcount]; + newtops = new triface[wrapcount]; + // Spin around ab, gather tetrahedra and set up new tetrahedra. + spintet = *splittet; + for (i = 0; i < wrapcount; i++) { + // Get 'bots[i] = an1n2b'. + enext2fnext(spintet, bots[i]); + esymself(bots[i]); + // Create 'newtops[i]'. + maketetrahedron(&(newtops[i])); + // Go to the next. + fnextself(spintet); + if (checksubfaces && abseg.sh != dummysh) { + if (!issymexist(&spintet)) { + // We meet a hull face, walk through it. + tspivot(spintet, spinsh); +#ifdef SELF_CHECK + assert(spinsh.sh != dummysh); +#endif + findedge(&spinsh, pa, pb); + sfnextself(spinsh); + stpivot(spinsh, spintet); +#ifdef SELF_CHECK + assert(spintet.tet != dummytet); +#endif + findedge(&spintet, pa, pb); + } + } + } + + // Set the vertices of updated and new tetrahedra. + for (i = 0; i < wrapcount; i++) { + // Update 'bots[i] = an1n2v'. + setoppo(bots[i], newpoint); + // Set 'newtops[i] = bn2n1v'. + n1 = dest(bots[i]); + n2 = apex(bots[i]); + // Set 'newtops[i]'. + setorg(newtops[i], pb); + setdest(newtops[i], n2); + setapex(newtops[i], n1); + setoppo(newtops[i], newpoint); + // Set the element attributes of a new tetrahedron. + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(bots[i].tet, j); + setelemattribute(newtops[i].tet, j, attrib); + } + if (b->varvolume) { + // Set the area constraint of a new tetrahedron. + volume = volumebound(bots[i].tet); + setvolumebound(newtops[i].tet, volume); + } +//#ifdef SELF_CHECK + // Make sure no inversed tetrahedron has been created. + volume = orient3d(pa, n1, n2, newpoint); + if (volume >= 0.0) { + //printf("Internal error in splittetedge(): volume = %.12g.\n", volume); + break; + } + volume = orient3d(pb, n2, n1, newpoint); + if (volume >= 0.0) { + //printf("Internal error in splittetedge(): volume = %.12g.\n", volume); + break; + } +//#endif + } + + if (i < wrapcount) { + // Do not insert this point. It will result inverted or degenerated tet. + // Restore have updated tets in "bots". + for (; i >= 0; i--) { + setoppo(bots[i], pb); + } + // Deallocate tets in "newtops". + for (i = 0; i < wrapcount; i++) { + tetrahedrondealloc(newtops[i].tet); + } + delete [] newtops; + delete [] bots; + return false; + } + + // Bond newtops to topcasings and bots. + for (i = 0; i < wrapcount; i++) { + // Get 'oldtop = n1n2va' from 'bots[i]'. + enextfnext(bots[i], oldtop); + sym(oldtop, topcasing); + bond(newtops[i], topcasing); + if (checksubfaces) { + tspivot(oldtop, topsh); + if (topsh.sh != dummysh) { + tsdissolve(oldtop); + tsbond(newtops[i], topsh); + } + } + enextfnext(newtops[i], tmpbond0); + bond(oldtop, tmpbond0); + } + // Bond between newtops. + fnext(newtops[0], tmpbond0); + enext2fnext(bots[0], spintet); + for (i = 1; i < wrapcount; i ++) { + if (issymexist(&spintet)) { + enext2fnext(newtops[i], tmpbond1); + bond(tmpbond0, tmpbond1); + } + fnext(newtops[i], tmpbond0); + enext2fnext(bots[i], spintet); + } + // Bond the last to the first if no boundary. + if (issymexist(&spintet)) { + enext2fnext(newtops[0], tmpbond1); + bond(tmpbond0, tmpbond1); + } + if (checksubsegs) { + for (i = 0; i < wrapcount; i++) { + enextfnext(bots[i], worktet); // edge n1->n2. + tsspivot1(worktet, n1n2seg); + if (n1n2seg.sh != dummysh) { + enext(newtops[i], tmpbond0); + tssbond1(tmpbond0, n1n2seg); + } + enextself(worktet); // edge n2->v ==> n2->b + tsspivot1(worktet, n2vseg); + if (n2vseg.sh != dummysh) { + tssdissolve1(worktet); + tssbond1(newtops[i], n2vseg); + } + enextself(worktet); // edge v->n1 ==> b->n1 + tsspivot1(worktet, n1vseg); + if (n1vseg.sh != dummysh) { + tssdissolve1(worktet); + enext2(newtops[i], tmpbond0); + tssbond1(tmpbond0, n1vseg); + } + } + } + + // Is there exist subfaces and subsegment need to be split? + if (checksubfaces) { + if (abseg.sh != dummysh) { + // A subsegment needs be split. + spivot(abseg, splitsh); +#ifdef SELF_CHECK + assert(splitsh.sh != dummysh); +#endif + } + if (splitsh.sh != dummysh) { + // Split subfaces (and subsegment). + findedge(&splitsh, pa, pb); + splitsubedge(newpoint, &splitsh, (queue *) NULL); + } + } + + if (b->verbose > 3) { + for (i = 0; i < wrapcount; i++) { + printf(" Updating bots[%i] ", i); + printtet(&(bots[i])); + printf(" Creating newtops[%i] ", i); + printtet(&(newtops[i])); + } + } + + if (flipqueue != (queue *) NULL) { + for (i = 0; i < wrapcount; i++) { + enqueueflipface(bots[i], flipqueue); + enqueueflipface(newtops[i], flipqueue); + } + } + + // Set the return handle be avn1n2. It is got by transforming from + // 'bots[0]' (which is an1n2v). + fnext(bots[0], spintet); // spintet is an1vn2. + esymself(spintet); // spintet is n1avn2. + enextself(spintet); // spintet is avn1n2. + *splittet = spintet; + + delete [] bots; + delete [] newtops; + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splitsubedge() Insert a point on an edge of the surface mesh. // +// // +// The splitting edge is given by 'splitsh'. Assume its three corners are a, // +// b, c, where ab is the edge will be split. ab may be a subsegment. // +// // +// To split edge ab is to split all subfaces conatining ab. If ab is not a // +// subsegment, there are only two subfaces need be split, otherwise, there // +// may have any number of subfaces need be split. Each splitting subface abc // +// is shrunk to avc, a new subface vbc is created. It is important to keep // +// the orientations of edge rings of avc and vbc be the same as abc's. If ab // +// is a subsegment, it is shrunk to av and a new subsegment vb is created. // +// // +// If there are tetrahedra adjoining to the splitting subfaces, they should // +// be split before calling this routine, so the connection between the new // +// tetrahedra and the new subfaces can be correctly set. // +// // +// On completion, 'splitsh' returns avc. If 'flipqueue' is not NULL, it // +// returns all edges which may be non-Delaunay. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::splitsubedge(point newpoint, face* splitsh, queue* flipqueue) +{ + triface abcd, bace, vbcd, bvce; + face startabc, spinabc, spinsh; + face oldbc, bccasin, bccasout; + face ab, bc; + face avc, vbc, vbc1; + face av, vb; + point pa, pb; + + startabc = *splitsh; + // Is there a subsegment? + sspivot(startabc, ab); + if (ab.sh != dummysh) { + ab.shver = 0; + if (sorg(startabc) != sorg(ab)) { + sesymself(startabc); + } + } + pa = sorg(startabc); + pb = sdest(startabc); + + if (b->verbose > 1) { + printf(" Inserting point %d on subedge (%d, %d) %s.\n", + pointmark(newpoint), pointmark(pa), pointmark(pb), + (ab.sh != dummysh ? "(seg)" : " ")); + } + + // Spin arround ab, split every subface containing ab. + spinabc = startabc; + do { + // Adjust spinabc be edge ab. + if (sorg(spinabc) != pa) { + sesymself(spinabc); + } + // Unmark the face for splitting (used for refinement) 2009-08-17. + sunmarktest(spinabc); + // Save old configuration at edge bc, if bc has a subsegment, save the + // face link of it and dissolve it from bc. + senext(spinabc, oldbc); + spivot(oldbc, bccasout); + sspivot(oldbc, bc); + if (bc.sh != dummysh) { + if (bccasout.sh != dummysh) { + // 'spinabc' is not self-bonded. + spinsh = bccasout; + do { + bccasin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != oldbc.sh); + } else { + bccasout.sh = dummysh; + } + ssdissolve(oldbc); + } + // Create a new subface. + makeshellface(subfaces, &vbc); + // Split abc. + avc = spinabc; // Update 'abc' to 'avc'. + setsdest(avc, newpoint); + // Make 'vbc' be in the same edge ring as 'avc'. + vbc.shver = avc.shver; + setsorg(vbc, newpoint); // Set 'vbc'. + setsdest(vbc, pb); + setsapex(vbc, sapex(avc)); + if (b->quality && varconstraint) { + // Copy the area bound into the new subface. + setareabound(vbc, areabound(avc)); + } + // Copy the shell marker and shell type into the new subface. + setshellmark(vbc, shellmark(avc)); + setshelltype(vbc, shelltype(avc)); + if (checkpbcs) { + // Copy the pbcgroup into the new subface. + setshellpbcgroup(vbc, shellpbcgroup(avc)); + } + // Set the connection between updated and new subfaces. + senext2self(vbc); + sbond(vbc, oldbc); + // Set the connection between new subface and casings. + senext2self(vbc); + if (bc.sh != dummysh) { + if (bccasout.sh != dummysh) { + // Insert 'vbc' into face link. + sbond1(bccasin, vbc); + sbond1(vbc, bccasout); + } else { + // Bond 'vbc' to itself. + sdissolve(vbc); // sbond(vbc, vbc); + } + ssbond(vbc, bc); + } else { + sbond(vbc, bccasout); + } + // Go to next subface at edge ab. + spivotself(spinabc); + if (spinabc.sh == dummysh) { + break; // 'ab' is a hull edge. + } + } while (spinabc.sh != startabc.sh); + + // Get the new subface vbc above the updated subface avc (= startabc). + senext(startabc, oldbc); + spivot(oldbc, vbc); + if (sorg(vbc) == newpoint) { + sesymself(vbc); + } +#ifdef SELF_CHECK + assert(sorg(vbc) == sdest(oldbc) && sdest(vbc) == sorg(oldbc)); +#endif + senextself(vbc); + // Set the face link for the new created subfaces around edge vb. + spinabc = startabc; + do { + // Go to the next subface at edge av. + spivotself(spinabc); + if (spinabc.sh == dummysh) { + break; // 'ab' is a hull edge. + } + if (sorg(spinabc) != pa) { + sesymself(spinabc); + } + // Get the new subface vbc1 above the updated subface avc (= spinabc). + senext(spinabc, oldbc); + spivot(oldbc, vbc1); + if (sorg(vbc1) == newpoint) { + sesymself(vbc1); + } +#ifdef SELF_CHECK + assert(sorg(vbc1) == sdest(oldbc) && sdest(vbc1) == sorg(oldbc)); +#endif + senextself(vbc1); + // Set the connection: vbc->vbc1. + sbond1(vbc, vbc1); + // For the next connection. + vbc = vbc1; + } while (spinabc.sh != startabc.sh); + + // Split ab if it is a subsegment. + if (ab.sh != dummysh) { + // Unmark the segment for mesh optimization. 2009-08-17. + sunmarktest(ab); + // Update subsegment ab to av. + av = ab; + setsdest(av, newpoint); + // Create a new subsegment vb. + makeshellface(subsegs, &vb); + setsorg(vb, newpoint); + setsdest(vb, pb); + // vb gets the same mark and segment type as av. + setshellmark(vb, shellmark(av)); + setshelltype(vb, shelltype(av)); + if (b->quality && varconstraint) { + // Copy the area bound into the new subsegment. + setareabound(vb, areabound(av)); + } + // Save the old connection at ab (re-use the handles oldbc, bccasout). + senext(av, oldbc); + spivot(oldbc, bccasout); + // Bond av and vb (bonded at their "fake" edges). + senext2(vb, bccasin); + sbond(bccasin, oldbc); + if (bccasout.sh != dummysh) { + // There is a subsegment connecting with ab at b. It will connect + // to vb at b after splitting. + bccasout.shver = 0; + if (sorg(bccasout) != pb) sesymself(bccasout); +#ifdef SELF_CHECK + assert(sorg(bccasout) == pb); +#endif + senext2self(bccasout); + senext(vb, bccasin); + sbond(bccasin, bccasout); + } + // Bond all new subfaces (vbc) to vb. + spinabc = startabc; + do { + // Adjust spinabc be edge av. + if (sorg(spinabc) != pa) { + sesymself(spinabc); + } + // Get new subface vbc above the updated subface avc (= spinabc). + senext(spinabc, oldbc); + spivot(oldbc, vbc); + if (sorg(vbc) == newpoint) { + sesymself(vbc); + } + senextself(vbc); + // Bond the new subface and the new subsegment. + ssbond(vbc, vb); + // Go to the next. + spivotself(spinabc); + if (spinabc.sh == dummysh) { + break; // There's only one facet at the segment.rr + } + } while (spinabc.sh != startabc.sh); + } + + // Bond the new subfaces to new tetrahedra if they exist. New tetrahedra + // should have been created before calling this routine. + spinabc = startabc; + do { + // Adjust spinabc be edge av. + if (sorg(spinabc) != pa) { + sesymself(spinabc); + } + // Get new subface vbc above the updated subface avc (= spinabc). + senext(spinabc, oldbc); + spivot(oldbc, vbc); + if (sorg(vbc) == newpoint) { + sesymself(vbc); + } + senextself(vbc); + // Get the adjacent tetrahedra at 'spinabc'. + stpivot(spinabc, abcd); + if (abcd.tet != dummytet) { + findedge(&abcd, sorg(spinabc), sdest(spinabc)); + enextfnext(abcd, vbcd); + fnextself(vbcd); +#ifdef SELF_CHECK + assert(vbcd.tet != dummytet); +#endif + tsbond(vbcd, vbc); + sym(vbcd, bvce); + sesymself(vbc); + tsbond(bvce, vbc); + } else { + // One side is empty, check the other side. + sesymself(spinabc); + stpivot(spinabc, bace); + if (bace.tet != dummytet) { + findedge(&bace, sorg(spinabc), sdest(spinabc)); + enext2fnext(bace, bvce); + fnextself(bvce); +#ifdef SELF_CHECK + assert(bvce.tet != dummytet); +#endif + sesymself(vbc); + tsbond(bvce, vbc); + } + } + // Go to the next. + spivotself(spinabc); + if (spinabc.sh == dummysh) { + break; // 'ab' is a hull edge. + } + } while (spinabc.sh != startabc.sh); + + if (b->verbose > 3) { + spinabc = startabc; + do { + // Adjust spinabc be edge av. + if (sorg(spinabc) != pa) { + sesymself(spinabc); + } + printf(" Updating abc:\n"); + printsh(&spinabc); + // Get new subface vbc above the updated subface avc (= spinabc). + senext(spinabc, oldbc); + spivot(oldbc, vbc); + if (sorg(vbc) == newpoint) { + sesymself(vbc); + } + senextself(vbc); + printf(" Creating vbc:\n"); + printsh(&vbc); + // Go to the next. + spivotself(spinabc); + if (spinabc.sh == dummysh) { + break; // 'ab' is a hull edge. + } + } while (spinabc.sh != startabc.sh); + } + + if (flipqueue != (queue *) NULL) { + spinabc = startabc; + do { + // Adjust spinabc be edge av. + if (sorg(spinabc) != pa) { + sesymself(spinabc); + } + senext2(spinabc, oldbc); // Re-use oldbc. + enqueueflipedge(oldbc, flipqueue); + // Get new subface vbc above the updated subface avc (= spinabc). + senext(spinabc, oldbc); + spivot(oldbc, vbc); + if (sorg(vbc) == newpoint) { + sesymself(vbc); + } + senextself(vbc); + senext(vbc, oldbc); // Re-use oldbc. + enqueueflipedge(oldbc, flipqueue); + // Go to the next. + spivotself(spinabc); + if (spinabc.sh == dummysh) { + break; // 'ab' is a hull edge. + } + } while (spinabc.sh != startabc.sh); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formstarpolyhedron() Get the star ployhedron of a point 'pt'. // +// // +// The polyhedron P is formed by faces of tets having 'pt' as a vertex. If // +// 'complete' is TRUE, P is the complete star of 'pt'. Otherwise, P is boun- // +// ded by subfaces, i.e. P is only part of the star of 'pt'. // +// // +// 'tetlist' T returns the tets, it has one of such tets on input. Moreover, // +// if t is in T, then oppo(t) = p. Topologically, T is the star of p; and // +// the faces of T is the link of p. 'verlist' V returns the vertices of T. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formstarpolyhedron(point pt, list* tetlist, list* verlist, + bool complete) +{ + triface starttet, neightet; + face checksh; + point ver[3]; + int idx, i, j; + + // Get a tet t containing p. + starttet = * (triface *)(* tetlist)[0]; + // Let oppo(t) = p. + for (starttet.loc = 0; starttet.loc < 4; starttet.loc++) { + if (oppo(starttet) == pt) break; + } + assert(starttet.loc < 4); + // Add t into T. + * (triface *)(* tetlist)[0] = starttet; + infect(starttet); + if (verlist != (list *) NULL) { + // Add three verts of t into V. + ver[0] = org(starttet); + ver[1] = dest(starttet); + ver[2] = apex(starttet); + for (i = 0; i < 3; i++) { + // Mark the vert by inversing the index of the vert. + idx = pointmark(ver[i]); + setpointmark(ver[i], -idx - 1); // -1 to distinguish the zero. + verlist->append(&(ver[i])); + } + } + + // Find other tets by a broadth-first search. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + starttet.ver = 0; + for (j = 0; j < 3; j++) { + fnext(starttet, neightet); + tspivot(neightet, checksh); + // Should we cross a subface. + if ((checksh.sh == dummysh) || complete) { + // Get the neighbor n. + symself(neightet); + if ((neightet.tet != dummytet) && !infected(neightet)) { + // Let oppo(n) = p. + for (neightet.loc = 0; neightet.loc < 4; neightet.loc++) { + if (oppo(neightet) == pt) break; + } + assert(neightet.loc < 4); + // Add n into T. + infect(neightet); + tetlist->append(&neightet); + if (verlist != (list *) NULL) { + // Add the apex vertex in n into V. + ver[0] = org(starttet); + ver[1] = dest(starttet); + findedge(&neightet, ver[0], ver[1]); + ver[2] = apex(neightet); + idx = pointmark(ver[2]); + if (idx >= 0) { + setpointmark(ver[2], -idx - 1); + verlist->append(&(ver[2])); + } + } + } + } + enextself(starttet); + } + } + + // Uninfect tets. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + uninfect(starttet); + } + if (verlist != (list *) NULL) { + // Uninfect vertices. + for (i = 0; i < verlist->len(); i++) { + ver[0] = * (point *)(* verlist)[i]; + idx = pointmark(ver[0]); + setpointmark(ver[0], -(idx + 1)); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// Terminology: BC(p) and CBC(p), B(p) and C(p). // +// // +// Given an arbitrary point p, the Bowyer-Watson cavity BC(p) is formed by // +// tets whose circumspheres containing p. The outer faces of BC(p) form a // +// polyhedron B(p). // +// // +// If p is on a facet F, the constrained Bowyer-Watson cavity CBC(p) on F is // +// formed by subfaces of F whose circumspheres containing p. The outer edges // +// of CBC(p) form a polygon C(p). B(p) is separated into two parts by C(p), // +// denoted as B_1(p) and B_2(p), one of them may be empty (F is on the hull).// +// // +// If p is on a segment S which is shared by n facets. There exist n C(p)s, // +// each one is a non-closed polygon (without S). B(p) is split into n parts, // +// each of them is denoted as B_i(p), some B_i(p) may be empty. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// formbowatcavitysub() Form CBC(p) and C(p) on a facet F. // +// // +// Parameters: bp = p, bpseg = S, sublist = CBC(p), subceillist = C(p). // +// // +// CBC(p) contains at least one subface on input; S may be NULL which means // +// that p is inside a facet. On output, all subfaces of CBC(p) are infected, // +// and the edge rings are oriented to the same halfspace. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formbowatcavitysub(point bp, face* bpseg, list* sublist, + list* subceillist) +{ + triface adjtet; + face startsh, neighsh; + face checkseg; + point pa, pb, pc, pd; + REAL sign; + int i, j; + + // Form CBC(p) and C(p) by a broadth-first searching. + for (i = 0; i < sublist->len(); i++) { + startsh = * (face *)(* sublist)[i]; // startsh = f. + // Look for three neighbors of f. + for (j = 0; j < 3; j++) { + sspivot(startsh, checkseg); + if (checkseg.sh == dummysh) { + // Get its neighbor n. + spivot(startsh, neighsh); + // Is n already in CBC(p)? + if (!sinfected(neighsh)) { + stpivot(neighsh, adjtet); + if (adjtet.tet == dummytet) { + sesymself(neighsh); + stpivot(neighsh, adjtet); + } + // For positive orientation that insphere() test requires. + adjustedgering(adjtet, CW); + pa = org(adjtet); + pb = dest(adjtet); + pc = apex(adjtet); + pd = oppo(adjtet); + sign = insphere(pa, pb, pc, pd, bp); + if (sign >= 0.0) { + // Orient edge ring of n according to that of f. + if (sorg(neighsh) != sdest(startsh)) sesymself(neighsh); + // Collect it into CBC(p). + sinfect(neighsh); + sublist->append(&neighsh); + } else { + subceillist->append(&startsh); // Found an edge of C(p). + } + } + } else { + // Do not cross a segment. + if (bpseg != (face *) NULL) { + if (checkseg.sh != bpseg->sh) { + subceillist->append(&startsh); // Found an edge of C(p). + } + } else { + subceillist->append(&startsh); // Found an edge of C(p). + } + } + senextself(startsh); + } + } + + if (b->verbose > 2) { + printf(" Collect CBC(%d): %d subfaces, %d edges.\n", pointmark(bp), + sublist->len(), subceillist->len()); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formbowatcavityquad() Form BC_i(p) and B_i(p) in a quadrant. // +// // +// Parameters: bp = p, tetlist = BC_i(p), ceillist = B_i(p). // +// // +// BC_i(p) contains at least one tet on input. On finish, all tets collected // +// in BC_i(p) are infected. B_i(p) may not closed when p is on segment or in // +// facet. C(p) must be formed before this routine. Check the infect flag of // +// a subface to identify the unclosed side of B_i(p). These sides will be // +// closed by new subfaces of C(p)s. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formbowatcavityquad(point bp, list* tetlist, list* ceillist) +{ + triface starttet, neightet; + face checksh; + point pa, pb, pc, pd; + REAL sign; + int i; + + // Form BC_i(p) and B_i(p) by a broadth-first searching. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + for (starttet.loc = 0; starttet.loc < 4; starttet.loc++) { + // Try to collect the neighbor of the face (f). + tspivot(starttet, checksh); + if (checksh.sh == dummysh) { + // Get its neighbor n. + sym(starttet, neightet); + // Is n already in BC_i(p)? + if (!infected(neightet)) { + // For positive orientation that insphere() test requires. + adjustedgering(neightet, CW); + pa = org(neightet); + pb = dest(neightet); + pc = apex(neightet); + pd = oppo(neightet); + sign = insphere(pa, pb, pc, pd, bp); + if (sign >= 0.0) { + // Collect it into BC_i(p). + infect(neightet); + tetlist->append(&neightet); + } else { + ceillist->append(&starttet); // Found a face of B_i(p). + } + } + } else { + // Do not cross a boundary face. + if (!sinfected(checksh)) { + ceillist->append(&starttet); // Found a face of B_i(p). + } + } + } + } + + if (b->verbose > 2) { + printf(" Collect BC_i(%d): %d tets, %d faces.\n", pointmark(bp), + tetlist->len(), ceillist->len()); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formbowatcavitysegquad() Form BC_i(p) and B_i(p) in a segment quadrant.// +// // +// Parameters: bp = p, tetlist = BC_i(p), ceillist = B_i(p). // +// // +// BC_i(p) contains at least one tet on input. On finish, all tets collected // +// in BC_i(p) are infected. B_i(p) is not closed. C(p) must be formed before // +// this routine. Check the infect flag of a subface to identify the unclosed // +// sides of B_i(p). These sides will be closed by new subfaces of C(p)s. // +// // +// During the repair of encroaching subsegments, there may exist locally non-// +// Delaunay faces. These faces are collected in BC_i(p) either. B_i(p) has // +// to be formed later than BC_i(p). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formbowatcavitysegquad(point bp, list* tetlist,list* ceillist) +{ + triface starttet, neightet, cavtet; + face checksh; + point pa, pb, pc, pd, pe; + REAL sign; + int i; + + // Form BC_i(p) by a broadth-first searching. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + for (starttet.loc = 0; starttet.loc < 4; starttet.loc++) { + // Try to collect the neighbor of the face f. + tspivot(starttet, checksh); + if (checksh.sh == dummysh) { + // Get its neighbor n. + sym(starttet, neightet); + // Is n already in BC_i(p)? + if (!infected(neightet)) { + // For positive orientation that insphere() test requires. + adjustedgering(neightet, CW); + pa = org(neightet); + pb = dest(neightet); + pc = apex(neightet); + pd = oppo(neightet); + sign = insphere(pa, pb, pc, pd, bp); + if (sign >= 0.0) { + // Collect it into BC_i(p). + infect(neightet); + tetlist->append(&neightet); + } else { + // Check if the face is locally non-Delaunay. + pe = oppo(starttet); + sign = insphere(pa, pb, pc, pd, pe); + if (sign >= 0.0) { + // Collect it into BC_i(p). + infect(neightet); + tetlist->append(&neightet); + } + } + } + } + } + } + + // Generate B_i(p). + for (i = 0; i < tetlist->len(); i++) { + cavtet = * (triface *)(* tetlist)[i]; + for (cavtet.loc = 0; cavtet.loc < 4; cavtet.loc++) { + tspivot(cavtet, checksh); + if (checksh.sh == dummysh) { + sym(cavtet, neightet); + if (!infected(neightet)) { + ceillist->append(&cavtet); // Found a face of B(p). + } + } else { + // Do not cross a boundary face. + if (!sinfected(checksh)) { + ceillist->append(&cavtet); // Found a face of B(p). + } + } + } + } + + if (b->verbose > 2) { + printf(" Collect BC_i(%d): %d tets, %d faces.\n", pointmark(bp), + tetlist->len(), ceillist->len()); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formbowatcavity() Form BC(p), B(p), CBC(p)s, and C(p)s. // +// // +// If 'bpseg'(S) != NULL, p is on segment S, else, p is on facet containing // +// 'bpsh' (F). 'n' returns the number of quadrants in BC(p). 'nmax' is the // +// maximum pre-allocated array length for the lists. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formbowatcavity(point bp, face* bpseg, face* bpsh, int* n, + int* nmax, list** sublists, list** subceillists, list** tetlists, + list** ceillists) +{ + list *sublist; + triface adjtet; + face startsh, spinsh; + point pa, pb; + int i, j; + + *n = 0; + if (bpseg != (face *) NULL) { + // p is on segment S. + bpseg->shver = 0; + pa = sorg(*bpseg); + pb = sdest(*bpseg); + // Count the number of facets sharing at S. + spivot(*bpseg, startsh); + spinsh = startsh; + do { + (*n)++; // spinshlist->append(&spinsh); + spivotself(spinsh); + } while (spinsh.sh != startsh.sh); + // *n is the number of quadrants around S. + if (*n > *nmax) { + // Reallocate arrays. Should not happen very often. + delete [] tetlists; + delete [] ceillists; + delete [] sublists; + delete [] subceillists; + tetlists = new list*[*n]; + ceillists = new list*[*n]; + sublists = new list*[*n]; + subceillists = new list*[*n]; + *nmax = *n; + } + // Form CBC(p)s and C(p)s. + spinsh = startsh; + for (i = 0; i < *n; i++) { + sublists[i] = new list(sizeof(face), NULL, 256); + subceillists[i] = new list(sizeof(face), NULL, 256); + // Set a subface f to start search. + startsh = spinsh; + // Let f face to the quadrant of interest (used in forming BC(p)). + findedge(&startsh, pa, pb); + sinfect(startsh); + sublists[i]->append(&startsh); + formbowatcavitysub(bp, bpseg, sublists[i], subceillists[i]); + // Go to the next facet. + spivotself(spinsh); + } + } else if (sublists != (list **) NULL) { + // p is on a facet. + *n = 2; + // Form CBC(p) and C(p). + sublists[0] = new list(sizeof(face), NULL, 256); + subceillists[0] = new list(sizeof(face), NULL, 256); + sinfect(*bpsh); + sublists[0]->append(bpsh); + formbowatcavitysub(bp, NULL, sublists[0], subceillists[0]); + } else { + // p is inside a tet. + *n = 1; + } + + // Form BC_i(p) and B_i(p). + for (i = 0; i < *n; i++) { + tetlists[i] = new list(sizeof(triface), NULL, 256); + ceillists[i] = new list(sizeof(triface), NULL, 256); + if (sublists != (list **) NULL) { + // There are C(p)s. + sublist = ((bpseg == (face *) NULL) ? sublists[0] : sublists[i]); + // Add all adjacent tets of C_i(p) into BC_i(p). + for (j = 0; j < sublist->len(); j++) { + startsh = * (face *)(* sublist)[j]; + // Adjust the side facing to the right quadrant for C(p). + if ((bpseg == (face *) NULL) && (i == 1)) sesymself(startsh); + stpivot(startsh, adjtet); + if (adjtet.tet != dummytet) { + if (!infected(adjtet)) { + infect(adjtet); + tetlists[i]->append(&adjtet); + } + } + } + if (bpseg != (face *) NULL) { + // The quadrant is bounded by another facet. + sublist = ((i < *n - 1) ? sublists[i + 1] : sublists[0]); + for (j = 0; j < sublist->len(); j++) { + startsh = * (face *)(* sublist)[j]; + // Adjust the side facing to the right quadrant for C(p). + sesymself(startsh); + stpivot(startsh, adjtet); + if (adjtet.tet != dummytet) { + if (!infected(adjtet)) { + infect(adjtet); + tetlists[i]->append(&adjtet); + } + } + } + } + } + // It is possible that BC_i(p) is empty. + if (tetlists[i]->len() == 0) continue; + // Collect the rest of tets of BC_i(p) and form B_i(p). + // if (b->conformdel) { + // formbowatcavitysegquad(bp, tetlists[i], ceillists[i]); + // } else { + formbowatcavityquad(bp, tetlists[i], ceillists[i]); + // } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// releasebowatcavity() Undo and free the memory allocated in routine // +// formbowatcavity(). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::releasebowatcavity(face* bpseg, int n, list** sublists, + list** subceillist, list** tetlists, list** ceillists) +{ + triface oldtet; + face oldsh; + int i, j; + + if (sublists != (list **) NULL) { + // Release CBC(p)s. + for (i = 0; i < n; i++) { + // Uninfect subfaces of CBC(p). + for (j = 0; j < sublists[i]->len(); j++) { + oldsh = * (face *)(* (sublists[i]))[j]; +#ifdef SELF_CHECK + assert(sinfected(oldsh)); +#endif + suninfect(oldsh); + } + delete sublists[i]; + delete subceillist[i]; + sublists[i] = (list *) NULL; + subceillist[i] = (list *) NULL; + if (bpseg == (face *) NULL) break; + } + } + // Release BC(p). + for (i = 0; i < n; i++) { + // Uninfect tets of BC_i(p). + for (j = 0; j < tetlists[i]->len(); j++) { + oldtet = * (triface *)(* (tetlists[i]))[j]; +#ifdef SELF_CHECK + assert(infected(oldtet)); +#endif + uninfect(oldtet); + } + delete tetlists[i]; + delete ceillists[i]; + tetlists[i] = (list *) NULL; + ceillists[i] = (list *) NULL; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// validatebowatcavityquad() Valid B_i(p). // +// // +// B_i(p) is valid if all faces of B_i(p) are visible by p, else B_i(p) is // +// invalid. Each tet of BC_i(p) which has such a face is marked (uninfect). // +// They will be removed in updatebowatcavityquad(). // +// // +// Return TRUE if B(p) is valid, else, return FALSE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::validatebowatcavityquad(point bp,list* ceillist,REAL maxcosd) +{ + triface ceiltet; + point pa, pb, pc; + REAL ori, cosd; + int remcount, i; + + // Check the validate of B(p), cut tets having invisible faces. + remcount = 0; + for (i = 0; i < ceillist->len(); i++) { + ceiltet = * (triface *)(* ceillist)[i]; + if (infected(ceiltet)) { + adjustedgering(ceiltet, CCW); + pa = org(ceiltet); + pb = dest(ceiltet); + pc = apex(ceiltet); + ori = orient3d(pa, pb, pc, bp); + if (ori >= 0.0) { + // Found an invisible face. + uninfect(ceiltet); + remcount++; + continue; + } + // If a non-trival 'maxcosd' is given. + if (maxcosd > -1.0) { + // Get the maximal dihedral angle of tet abcp. + tetalldihedral(pa, pb, pc, bp, NULL, &cosd, NULL); + // Do not form the tet if the maximal dihedral angle is not reduced. + if (cosd < maxcosd) { + uninfect(ceiltet); + remcount++; + } + } + } + } + return remcount == 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// updatebowatcavityquad() Update BC_i(p) and reform B_i(p). // +// // +// B_i(p) is invalid and some tets in BC_i(p) have been marked to be removed // +// in validatebowatcavityquad(). This routine actually remove the cut tets // +// of BC_i(p) and re-form the B_i(p). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::updatebowatcavityquad(list* tetlist, list* ceillist) +{ + triface cavtet, neightet; + face checksh; + int remcount, i; + + remcount = 0; + for (i = 0; i < tetlist->len(); i++) { + cavtet = * (triface *)(* tetlist)[i]; + if (!infected(cavtet)) { + tetlist->del(i, 1); + remcount++; + i--; + } + } + + // Are there tets have been cut in BC_i(p)? + if (remcount > 0) { + // Re-form B_i(p). + ceillist->clear(); + for (i = 0; i < tetlist->len(); i++) { + cavtet = * (triface *)(* tetlist)[i]; + for (cavtet.loc = 0; cavtet.loc < 4; cavtet.loc++) { + tspivot(cavtet, checksh); + if (checksh.sh == dummysh) { + sym(cavtet, neightet); + if (!infected(neightet)) { + ceillist->append(&cavtet); // Found a face of B_i(p). + } + } else { + // Do not cross a boundary face. + if (!sinfected(checksh)) { + ceillist->append(&cavtet); // Found a face of B_i(p). + } + } + } + } + if (b->verbose > 2) { + printf(" Update BC_i(p): %d tets, %d faces.\n", tetlist->len(), + ceillist->len()); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// updatebowatcavitysub() Check and update CBC(p) and C(p). // +// // +// A CBC(p) is valid if all its subfaces are inside or on the hull of BC(p). // +// A subface s of CBC(p) is invalid if it is in one of the two cases: // +// (1) s is completely outside BC(p); // +// (2) s has two adjacent tets but only one of them is in BC(p); // +// s is removed from CBC(p) if it is invalid. If there is an adjacent tet of // +// s which is in BC(p), it gets removed from BC(p) too. If CBC(p) is updated,// +// C(p) is re-formed. // +// // +// A C(p) is valid if all its edges are on the hull of BC(p). An edge e of // +// C(p) may be inside BC(p) if e is a segment and belongs to only one facet. // +// To correct C(p), a tet of BC(p) which shields e gets removed. // +// // +// If BC(p) is formed with locally non-Delaunay check (b->conformdel > 0). // +// A boundary-consistent check is needed for non-segment edges of C(p). Let // +// e be such an edge, the subface f contains e and outside C(p) may belong // +// to B(p) due to the non-coplanarity of the facet definition. The tet of // +// BC(p) containing f gets removed to avoid creating a degenerate new tet. // +// // +// 'cutcount' accumulates the total number of cuttets(not only by this call).// +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::updatebowatcavitysub(list* sublist, list* subceillist, + int* cutcount) +{ + triface adjtet, rotface; + face checksh, neighsh; + face checkseg; + point pa, pb, pc; + REAL ori1, ori2; + int remcount; + int i, j; + + remcount = 0; + // Check the validity of CBC(p). + for (i = 0; i < sublist->len(); i++) { + checksh = * (face *)(* sublist)[i]; + // Check two adjacent tets of s. + for (j = 0; j < 2; j++) { + stpivot(checksh, adjtet); + if (adjtet.tet != dummytet) { + if (!infected(adjtet)) { + // Could be either case (1) or (2). + suninfect(checksh); // s survives. + // If the sym. adjtet exists, it should remove from BC(p) too. + sesymself(checksh); + stpivot(checksh, adjtet); + if (adjtet.tet != dummytet) { + if (infected(adjtet)) { + // Found an adj. tet in BC(p), remove it. + uninfect(adjtet); + (*cutcount)++; + } + } + // Remove s from C(p). + sublist->del(i, 1); + i--; + remcount++; + break; + } + } + sesymself(checksh); + } + } + if (remcount > 0) { + // Some subfaces have been removed from the cavity. + if (checkpbcs) { + // Check if the facet has a PBC defined. + checksh = * (face *)(* sublist)[0]; + if (shellpbcgroup(checksh) >= 0) { + // Yes, A PBC facet. Remove all subfaces -- Do not insert the point. + for (i = 0; i < sublist->len(); i++) { + checksh = * (face *)(* sublist)[i]; + suninfect(checksh); + // Remove both side tets from the cavity. + for (j = 0; j < 2; j++) { + stpivot(checksh, adjtet); + if (adjtet.tet != dummytet) { + if (infected(adjtet)) { + uninfect(adjtet); + (*cutcount)++; + } + } + sesymself(checksh); + } + } + remcount += sublist->len(); + sublist->clear(); + } + } + if (b->verbose > 2) { + printf(" Removed %d subfaces from CBC(p).\n", remcount); + } + // Re-generate C(p). + subceillist->clear(); + for (i = 0; i < sublist->len(); i++) { + checksh = * (face *)(* sublist)[i]; + for (j = 0; j < 3; j++) { + spivot(checksh, neighsh); + if (!sinfected(neighsh)) { + subceillist->append(&checksh); + } + senextself(checksh); + } + } + if (b->verbose > 2) { + printf(" Update CBC(p): %d subs, %d edges.\n", sublist->len(), + subceillist->len()); + } + } + + // Check the validity of C(p). + for (i = 0; i < subceillist->len(); i++) { + checksh = * (face *)(* subceillist)[i]; + sspivot(checksh, checkseg); + if (checkseg.sh != dummysh) { + // A segment. Check if it is inside BC(p). + stpivot(checksh, adjtet); + if (adjtet.tet == dummytet) { + sesym(checksh, neighsh); + stpivot(neighsh, adjtet); + } + findedge(&adjtet, sorg(checkseg), sdest(checkseg)); + adjustedgering(adjtet, CCW); + fnext(adjtet, rotface); // It's the same tet. + // Rotate rotface (f), stop on either of the following cases: + // (a) meet a subface, or + // (b) enter an uninfected tet, or + // (c) rewind back to adjtet. + do { + if (!infected(rotface)) break; // case (b) + tspivot(rotface, neighsh); + if (neighsh.sh != dummysh) break; // case (a) + // Go to the next tet of the facing ring. + fnextself(rotface); + } while (apex(rotface) != apex(adjtet)); + // Is it case (c)? + if (apex(rotface) == apex(adjtet)) { + // The segment is enclosed by BC(p), invalid cavity. + pa = org(adjtet); + pb = dest(adjtet); + pc = apex(adjtet); + // Find the shield tet and cut it. Notice that the shield tet may + // not be unique when there are four coplanar points, ie., + // ori1 * ori2 == 0.0. In such case, choose either of them. + fnext(adjtet, rotface); + do { + fnextself(rotface); + assert(infected(rotface)); + ori1 = orient3d(pa, pb, pc, apex(rotface)); + ori2 = orient3d(pa, pb, pc, oppo(rotface)); + } while (ori1 * ori2 > 0.0); + // Cut this tet from BC(p). + uninfect(rotface); + (*cutcount)++; + } + } else { + /*// An edge. Check if boundary-consistency should be enforced. + if (b->conformdel > 0) { + // Get the adj-sub n at e, it must be outside C(p). + spivot(checksh, neighsh); + assert(!sinfected(neighsh)); + // Check if n is on B(p). + for (j = 0; j < 2; j++) { + stpivot(neighsh, adjtet); + if (adjtet.tet != dummytet) { + if (infected(adjtet)) { + uninfect(adjtet); + (*cutcount)++; + } + } + sesymself(neighsh); + } + } */ + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// trimbowatcavity() Validate B(p), CBC(p)s and C(p)s, update BC(p). // +// // +// A B(p) is valid if all its faces are visible by p. If a face f of B(p) is // +// found invisible by p, the tet of BC(p) containing f gets removed and B(p) // +// is refromed. The new B(p) may still contain invisible faces by p. Iterat- // +// ively do the above procedure until B(p) is satisfied. // +// // +// A CBC(p) is valid if each subface of CBC(p) is either on the hull of BC(p)// +// or completely inside BC(p). If a subface s of CBC(p) is not valid, it is // +// removed from CBC(p) and C(p) is reformed. If there exists a tet t of BC(p)// +// containg s, t is removed from BC(p). The process for validating BC(p) and // +// B(p) is re-excuted. // +// // +// A C(p) is valid if each edge of C(p) is on the hull of BC(p). If an edge // +// e of C(p) is invalid (e should be a subsegment which only belong to one // +// facet), a tet of BC(p) which contains e and has two other faces shielding // +// e is removed. The process for validating BC(p) and B(p) is re-excuted. // +// // +// If either BC(p) or CBC(p) becomes empty. No valid BC(p) is found, return // +// FALSE. else, return TRUE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::trimbowatcavity(point bp, face* bpseg, int n, list** sublists, + list** subceillists, list** tetlists, list** ceillists, REAL maxcosd) +{ + bool valflag; + int oldnum, cutnum, cutcount; + int i; + + cutnum = 0; // Count the total number of cut-off tets of BC(p). + valflag = true; + + do { + // Validate BC(p), B(p). + for (i = 0; i < n && valflag; i++) { + oldnum = tetlists[i]->len(); + // Iteratively validate BC_i(p) and B_i(p). + while (!validatebowatcavityquad(bp, ceillists[i], maxcosd)) { + // Update BC_i(p) and B_i(p). + updatebowatcavityquad(tetlists[i], ceillists[i]); + valflag = tetlists[i]->len() > 0; + } + cutnum += (oldnum - tetlists[i]->len()); + } + if (valflag && (sublists != (list **) NULL)) { + // Validate CBC(p), C(p). + cutcount = 0; + for (i = 0; i < n; i++) { + updatebowatcavitysub(sublists[i], subceillists[i], &cutcount); + // Only do once if p is on a facet. + if (bpseg == (face *) NULL) break; + } + // Are there cut tets? + if (cutcount > 0) { + // Squeeze all cut tets in BC(p), keep valflag once it gets FLASE. + for (i = 0; i < n; i++) { + if (tetlists[i]->len() > 0) { + updatebowatcavityquad(tetlists[i], ceillists[i]); + if (valflag) { + valflag = tetlists[i]->len() > 0; + } + } + } + cutnum += cutcount; + // Go back to valid the updated BC(p). + continue; + } + } + break; // Leave the while-loop. + } while (true); + + // Check if any CBC(p) becomes non-empty. + if (valflag && (sublists != (list **) NULL)) { + for (i = 0; i < n && valflag; i++) { + valflag = (sublists[i]->len() > 0); + if (bpseg == (face *) NULL) break; + } + } + + if (valflag && (cutnum > 0)) { + // Accumulate counters. + if (bpseg != (face *) NULL) { + updsegcount++; + } else if (sublists != (list **) NULL) { + updsubcount++; + } else { + updvolcount++; + } + } + + if (!valflag) { + // Accumulate counters. + if (bpseg != (face *) NULL) { + failsegcount++; + } else if (sublists != (list **) NULL) { + failsubcount++; + } else { + failvolcount++; + } + } + + return valflag; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// bowatinsertsite() Insert a point using the Bowyer-Watson method. // +// // +// Parameters: 'bp' = p, 'splitseg' = S, 'n' = the number of quadrants, // +// 'sublists', an array of CBC_i(p)s, 'subceillists', an array of C_i(p)s, // +// 'tetlists', an array of BC_i(p)s, 'ceillists', an array of B_i(p)s. // +// // +// If p is inside the mesh domain, then S = NULL, n = 1, CBC(p) and C(p) are // +// NULLs. 'tetlists[0]' = BC(p), 'ceillists[0]' = B(p). // +// If p is on a facet F, then S = NULL, n = 2, and 'subceillists[0]' = C(p), // +// 'subceillists[1]' is not needed (set it to NULL). B_1(p) and B_2(p) are // +// in 'ceillists[0]' and 'ceillists[1]'. // +// If p is on a segment S, then F(S) is a list of subfaces around S, and n = // +// len(F(S)), there are n C_i(p)s and B_i(p)s supplied in 'subceillists[i]'// +// and 'ceillists[i]'. // +// // +// If 'verlist' != NULL, it returns a list of vertices which connect to p. // +// This vertices are used for interpolating size of p. // +// // +// If 'flipque' != NULL, it returns a list of internal faces of new tets in // +// BC(p), faces on C(p)s are excluded. These faces may be locally non- // +// Delaunay and will be flipped if they are flippable. Such non-Delaunay // +// faces may exist when p is inserted to split an encroaching segment. // +// // +// 'chkencseg', 'chkencsub', and 'chkbadtet' are flags that indicate whether // +// or not there should be checks for the creation of encroached subsegments, // +// subfaces, or bad quality tets. If 'chkencseg' = TRUE, the encroached sub- // +// segments are added to the list of subsegments to be split. // +// // +// On return, 'ceillists' returns Star(p). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::bowatinsertsite(point bp,face* splitseg,int n,list** sublists, + list** subceillists, list** tetlists, list** ceillists, list* verlist, + queue* flipque, bool chkencseg, bool chkencsub, bool chkbadtet) +{ + list *ceillist, *subceillist; + triface oldtet, newtet, newface, rotface, neightet; + face oldsh, newsh, newedge, checksh; + face spinsh, casingin, casingout; + face *apsegshs, *pbsegshs; + face apseg, pbseg, checkseg; + point pa, pb, pc; + REAL attrib, volume; + int idx, i, j, k; + + if (b->verbose > 1) { + printf(" Insert point %d (%.12g, %.12g, %.12g)", pointmark(bp), bp[0], + bp[1], bp[2]); + } + if (splitseg != (face *) NULL) { + if (b->verbose > 1) { + printf(" on segment.\n"); + } + bowatsegcount++; + } else { + if (subceillists != (list **) NULL) { + if (b->verbose > 1) { + printf(" on facet.\n"); + } + bowatsubcount++; + } else { + if (b->verbose > 1) { + printf(" in volume.\n"); + } + bowatvolcount++; + } + } + + // Create new tets to fill B(p). + for (k = 0; k < n; k++) { + // Create new tets from each B_i(p). + ceillist = ceillists[k]; + for (i = 0; i < ceillist->len(); i++) { + oldtet = * (triface *)(* ceillist)[i]; + adjustedgering(oldtet, CCW); + pa = org(oldtet); + pb = dest(oldtet); + pc = apex(oldtet); + maketetrahedron(&newtet); + setorg(newtet, pa); + setdest(newtet, pb); + setapex(newtet, pc); + setoppo(newtet, bp); + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(oldtet.tet, j); + setelemattribute(newtet.tet, j, attrib); + } + if (b->varvolume) { + volume = volumebound(oldtet.tet); + if (volume > 0.0) { + if (!b->fixedvolume && b->refine) { + // '-r -a' switches and a .vol file case. Enlarge the maximum + // volume constraint for the new tets. Hence the new points + // only spread near the original constrained tet. + volume *= 1.2; + } + } + setvolumebound(newtet.tet, volume); + } + sym(oldtet, neightet); + tspivot(oldtet, checksh); + if (neightet.tet != dummytet) { + bond(newtet, neightet); + } + if (checksh.sh != dummysh) { + tsbond(newtet, checksh); + } + if (verlist != (list *) NULL) { + // Collect vertices connecting to p. + idx = pointmark(pa); + if (idx >= 0) { + setpointmark(pa, -idx - 1); + verlist->append(&pa); + } + idx = pointmark(pb); + if (idx >= 0) { + setpointmark(pb, -idx - 1); + verlist->append(&pb); + } + idx = pointmark(pc); + if (idx >= 0) { + setpointmark(pc, -idx - 1); + verlist->append(&pc); + } + } + // Replace the tet by the newtet for checking the quality. + * (triface *)(* ceillist)[i] = newtet; + } + } + if (verlist != (list *) NULL) { + // Uninfect collected vertices. + for (i = 0; i < verlist->len(); i++) { + pa = * (point *)(* verlist)[i]; + idx = pointmark(pa); + setpointmark(pa, -(idx + 1)); + } + } + + // Connect new tets of B(p). Not all faces of new tets can be connected, + // e.g., if there are empty B_i(p)s. + for (k = 0; k < n; k++) { + ceillist = ceillists[k]; + for (i = 0; i < ceillist->len(); i++) { + newtet = * (triface *)(* ceillist)[i]; + newtet.ver = 0; + for (j = 0; j < 3; j++) { + fnext(newtet, newface); + sym(newface, neightet); + if (neightet.tet == dummytet) { + // Find the neighbor face by rotating the faces at edge ab. + esym(newtet, rotface); + pa = org(rotface); + pb = dest(rotface); + while (fnextself(rotface)); + // Do we meet a boundary face? + tspivot(rotface, checksh); + if (checksh.sh != dummysh) { + // Walk through the boundary and continue to rotate faces. + do { + findedge(&checksh, pa, pb); + sfnextself(checksh); + assert((sorg(checksh) == pa) && (sdest(checksh) == pb)); + stpivot(checksh, rotface); + if (infected(rotface)) { + // Meet an old tet of B_i(p). This side is on the hull and + // will be connected to a new subface created in C(p). + break; + } + findedge(&rotface, pa, pb); + while (fnextself(rotface)); + tspivot(rotface, checksh); + } while (checksh.sh != dummysh); + } + // The rotface has edge ab, but it may not have newpt. + if (apex(rotface) == apex(newface)) { + // Bond the two tets together. + bond(newface, rotface); + // Queue (uniquely) this face if 'flipque' is given. + if (flipque != (queue *) NULL) { + enqueueflipface(newface, flipque); + } + } + } + enextself(newtet); + } + } + } + + if (subceillists != (list **) NULL) { + // There are C(p)s. + if (splitseg != (face *) NULL) { + // S (ab) is split by p. + splitseg->shver = 0; + pa = sorg(*splitseg); + pb = sdest(*splitseg); + // Allcate two arrays for saving the subface rings of the two new + // segments a->p and p->b. + apsegshs = new face[n]; + pbsegshs = new face[n]; + } + + // For each C_k(p), do the following: + // (1) Create new subfaces to fill C_k(p), insert them into B(p); + // (2) Connect new subfaces to each other; + for (k = 0; k < n; k++) { + subceillist = subceillists[k]; + + // Check if 'hullsize' should be updated. + oldsh = * (face *)(* subceillist)[0]; + stpivot(oldsh, neightet); + if (neightet.tet != dummytet) { + sesymself(oldsh); + stpivot(oldsh, neightet); + } + if (neightet.tet == dummytet) { + // The hull size changes. + hullsize += (subceillist->len() - sublists[k]->len()); + } + + // (1) Create new subfaces to fill C_k(p), insert them into B(p). + for (i = 0; i < subceillist->len(); i++) { + oldsh = * (face *)(* subceillist)[i]; + makeshellface(subfaces, &newsh); + setsorg(newsh, sorg(oldsh)); + setsdest(newsh, sdest(oldsh)); + setsapex(newsh, bp); + if (b->quality && varconstraint) { + setareabound(newsh, areabound(oldsh)); + } + setshellmark(newsh, shellmark(oldsh)); + setshelltype(newsh, shelltype(oldsh)); + if (checkpbcs) { + setshellpbcgroup(newsh, shellpbcgroup(oldsh)); + } + // Replace oldsh by newsh at the edge. + spivot(oldsh, casingout); + sspivot(oldsh, checkseg); + if (checkseg.sh != dummysh) { + // A segment. Insert s into the face ring, ie, s_in -> s -> s_out. + if (casingout.sh != dummysh) { // if (oldsh.sh != casingout.sh) { + // s is not bonded to itself. + spinsh = casingout; + do { + casingin = spinsh; + spivotself(spinsh); + } while (sapex(spinsh) != sapex(oldsh)); + assert(casingin.sh != oldsh.sh); + // Bond s_in -> s -> s_out (and dissolve s_in -> s_old -> s_out). + sbond1(casingin, newsh); + sbond1(newsh, casingout); + } else { + // Bond newsh -> newsh. + sdissolve(newsh); // sbond(newsh, newsh); + } + // Bond the segment. + ssbond(newsh, checkseg); + } else { + // Bond s <-> s_out (and dissolve s_out -> s_old). + sbond(newsh, casingout); + } + + // Insert newsh into B(p). Use the coonections of oldsh. + stpivot(oldsh, neightet); + if (neightet.tet == dummytet) { + sesymself(oldsh); + sesymself(newsh); // Keep the same orientation as oldsh. + stpivot(oldsh, neightet); + } + assert(infected(neightet)); + // Set on the rotating edge. + findedge(&neightet, sorg(oldsh), sdest(oldsh)); + // Choose the rotating direction (to the inside of B(p)). + adjustedgering(neightet, CCW); + rotface = neightet; + // Rotate face. Stop at a non-infected tet t (not in B(p)) or a + // hull face f (on B(p)). Get the neighbor n of t or f. n is + // a new tet that has just been created to fill B(p). + do { + fnextself(rotface); + sym(rotface, neightet); + if (neightet.tet == dummytet) { + tspivot(rotface, checksh); + assert(checksh.sh != dummysh); + stpivot(checksh, newtet); + break; + } else if (!infected(neightet)) { + sym(neightet, newtet); + break; + } + } while (true); + assert(newtet.tet != rotface.tet); + // Set the rotating edge of n. + findedge(&newtet, sorg(oldsh), sdest(oldsh)); + // Choose the rotating direction (to the inside of B(p)). + adjustedgering(newtet, CCW); + fnext(newtet, newface); + assert(apex(newface) == bp); + // newsh has already been oriented toward n. + tsbond(newface, newsh); + sym(newface, neightet); // 'neightet' maybe outside. + sesymself(newsh); + tsbond(neightet, newsh); // Bond them anyway. + + // Replace oldsh by newsh in list. + * (face *)(* subceillist)[i] = newsh; + } + + // (2) Connect new subfaces to each other. + for (i = 0; i < subceillist->len(); i++) { + // Get a face cdp. + newsh = * (face *)(* subceillist)[i]; + // Get a new tet containing cdp. + stpivot(newsh, newtet); + if (newtet.tet == dummytet) { + sesymself(newsh); + stpivot(newsh, newtet); + } + for (j = 0; j < 2; j++) { + if (j == 0) { + senext(newsh, newedge); // edge dp. + } else { + senext2(newsh, newedge); // edge pc. + sesymself(newedge); // edge cp. + } + if (splitseg != (face *) NULL) { + // Don not operate on newedge if it is ap or pb. + if (sorg(newedge) == pa) { + apsegshs[k] = newedge; + continue; + } else if (sorg(newedge) == pb) { + pbsegshs[k] = newedge; + continue; + } + } + // There should no segment inside the cavity. Check it. + sspivot(newedge, checkseg); + assert(checkseg.sh == dummysh); + spivot(newedge, casingout); + if (casingout.sh == dummysh) { + rotface = newtet; + findedge(&rotface, sorg(newedge), sdest(newedge)); + // Rotate newtet until meeting a new subface which contains + // newedge. It must exist since newedge is not a seg. + adjustedgering(rotface, CCW); + do { + fnextself(rotface); + tspivot(rotface, checksh); + if (checksh.sh != dummysh) break; + } while (true); + findedge(&checksh, sorg(newedge), sdest(newedge)); + sbond(newedge, checksh); + } + } + } + // Only do once if p is on a facet. + if (splitseg == (face *) NULL) break; + } // for (k = 0; k < n; k++) + + if (splitseg != (face *) NULL) { + // Update a->b to be a->p. + apseg = *splitseg; + setsdest(apseg, bp); + // Create a new subsegment p->b. + makeshellface(subsegs, &pbseg); + setsorg(pbseg, bp); + setsdest(pbseg, pb); + // p->b gets the same mark and segment type as a->p. + setshellmark(pbseg, shellmark(apseg)); + setshelltype(pbseg, shelltype(apseg)); + if (b->quality && varconstraint) { + // Copy the area bound into the new subsegment. + setareabound(pbseg, areabound(apseg)); + } + senext(apseg, checkseg); + // Get the old connection at b of a->b. + spivot(checkseg, casingout); + // Bond a->p and p->b together. + senext2(pbseg, casingin); + sbond(casingin, checkseg); + if (casingout.sh != dummysh) { + // There is a subsegment connect at b of p->b. + casingout.shver = 0; +#ifdef SELF_CHECK + assert(sorg(casingout) == pb); +#endif + senext2self(casingout); + senext(pbseg, casingin); + sbond(casingin, casingout); + } + + // Bond all new subfaces to a->p and p->b. + for (i = 0; i < n; i++) { + spinsh = apsegshs[i]; + findedge(&spinsh, pa, bp); + ssbond(spinsh, apseg); + spinsh = pbsegshs[i]; + findedge(&spinsh, bp, pb); + ssbond(spinsh, pbseg); + } + // Bond all subfaces share at a->p together. + for (i = 0; i < n; i++) { + spinsh = apsegshs[i]; + if (i < (n - 1)) { + casingout = apsegshs[i + 1]; + } else { + casingout = apsegshs[0]; + } + sbond1(spinsh, casingout); + } + // Bond all subfaces share at p->b together. + for (i = 0; i < n; i++) { + spinsh = pbsegshs[i]; + if (i < (n - 1)) { + casingout = pbsegshs[i + 1]; + } else { + casingout = pbsegshs[0]; + } + sbond1(spinsh, casingout); + } + delete [] apsegshs; + delete [] pbsegshs; + + // Check for newly encroached subsegments if the flag is set. + if (chkencseg) { + // Check if a->p and p->b are encroached by other vertices. + checkseg4encroach(&apseg, NULL, NULL, true); + checkseg4encroach(&pbseg, NULL, NULL, true); + // Check if the adjacent segments are encroached by p. + tallencsegs(bp, n, ceillists); + } + } // if (splitseg != (face *) NULL) + + // Delete subfaces of old CBC_i(p)s. + for (k = 0; k < n; k++) { + for (i = 0; i < sublists[k]->len(); i++) { + oldsh = * (face *)(* (sublists[k]))[i]; + shellfacedealloc(subfaces, oldsh.sh); + } + // Clear the list so that the subs will not get unmarked later in + // routine releasebowatcavity() which only frees the memory. + sublists[k]->clear(); + // Only do once if p is on a facet. + if (splitseg == (face *) NULL) break; + } + + // Check for newly encroached subfaces if the flag is set. + if (chkencsub) { + // Check if new subfaces of C_i(p) are encroached by other vertices. + for (k = 0; k < n; k++) { + subceillist = subceillists[k]; + for (i = 0; i < subceillist->len(); i++) { + newsh = * (face *)(* subceillist)[i]; + checksub4encroach(&newsh, NULL, true); + } + // Only do once if p is on a facet. + if (splitseg == (face *) NULL) break; + } + // Check if the adjacent subfaces are encroached by p. + tallencsubs(bp, n, ceillists); + } + } // if (subceillists != (list **) NULL) + + // Delete tets of old BC_i(p)s. + for (k = 0; k < n; k++) { + for (i = 0; i < tetlists[k]->len(); i++) { + oldtet = * (triface *)(* (tetlists[k]))[i]; + tetrahedrondealloc(oldtet.tet); + } + // Clear the list so that the tets will not get unmarked later in + // routine releasebowatcavity() which only frees the memory. + tetlists[k]->clear(); + } + + // check for bad quality tets if the flags is set. + if (chkbadtet) { + for (k = 0; k < n; k++) { + ceillist = ceillists[k]; + for (i = 0; i < ceillist->len(); i++) { + newtet = * (triface *)(* ceillist)[i]; + checktet4badqual(&newtet, true); + } + } + } + + if (flipque != (queue *) NULL) { + // Newly created internal faces of BC(p) (excluding faces on C(p)s) are + // in 'flipque'. Some of these faces may be locally non-Delaunay due + // to the existence of non-constrained tets. check and fix them. + lawson3d(flipque); + } +} + +//// //// +//// //// +//// flip_cxx ///////////////////////////////////////////////////////////////// + +//// delaunay_cxx ///////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// btree_sort() Sort vertices using a binary space partition (bsp) tree. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::btree_sort(point* vertexarray, int arraysize, int axis, + REAL bxmin, REAL bxmax, REAL bymin, REAL bymax, REAL bzmin, REAL bzmax, + int depth) +{ + point *leftarray, *rightarray; + point **pptary, swapvert; + REAL split; + bool lflag, rflag; + int i, j, k; + + if (b->verbose > 2) { + printf(" Depth %d, %d verts. Bbox (%g, %g, %g),(%g, %g, %g). %s-axis\n", + depth, arraysize, bxmin, bymin, bzmin, bxmax, bymax, bzmax, + axis == 0 ? "x" : (axis == 1 ? "y" : "z")); + } + + if (depth > max_btree_depth) { + max_btree_depth = depth; + } + + if (axis == 0) { + // Split along x-axis. + split = 0.5 * (bxmin + bxmax); + } else if (axis == 1) { + // Split along y-axis. + split = 0.5 * (bymin + bymax); + } else { + // Split along z-axis. + split = 0.5 * (bzmin + bzmax); + } + + i = 0; + j = arraysize - 1; + + // Partition the vertices into left- and right-arraies. + do { + for (; i < arraysize; i++) { + if (vertexarray[i][axis] >= split) { + break; + } + } + for (; j >= 0; j--) { + if (vertexarray[j][axis] < split) { + break; + } + } + // Is the partition finished? + if (i == (j + 1)) { + break; + } + // Swap i-th and j-th vertices. + swapvert = vertexarray[i]; + vertexarray[i] = vertexarray[j]; + vertexarray[j] = swapvert; + // Continue patitioning the array; + } while (true); + + if (b->verbose > 2) { + printf(" leftsize = %d, rightsize = %d\n", i, arraysize - i); + } + lflag = rflag = false; + + // if (depth < max_tree_depth) { + if (i > b->max_btreenode_size) { + // Recursively partition the left array (length = i). + if (axis == 0) { // x + btree_sort(vertexarray, i, (axis + 1) % 3, bxmin, split, bymin, + bymax, bzmin, bzmax, depth + 1); + } else if (axis == 1) { // y + btree_sort(vertexarray, i, (axis + 1) % 3, bxmin, bxmax, bymin, + split, bzmin, bzmax, depth + 1); + } else { // z + btree_sort(vertexarray, i, (axis + 1) % 3, bxmin, bxmax, bymin, + bymax, bzmin, split, depth + 1); + } + } else { + lflag = true; + } + if ((arraysize - i) > b->max_btreenode_size) { + // Recursively partition the right array (length = arraysize - i). + if (axis == 0) { // x + btree_sort(&(vertexarray[i]), arraysize - i, (axis + 1) % 3, split, + bxmax, bymin, bymax, bzmin, bzmax, depth + 1); + } else if (axis == 1) { // y + btree_sort(&(vertexarray[i]), arraysize - i, (axis + 1) % 3, bxmin, + bxmax, split, bymax, bzmin, bzmax, depth + 1); + } else { // z + btree_sort(&(vertexarray[i]), arraysize - i, (axis + 1) % 3, bxmin, + bxmax, bymin, bymax, split, bzmax, depth + 1); + } + } else { + rflag = true; + } + // } else { + // // Both left and right are done. + // lflag = rflag = true; + // } + + if (lflag && (i > 0)) { + // Remember the maximal length of the partitions. + if (i > max_btreenode_size) { + max_btreenode_size = i; + } + // Allocate space for the left array (use the first entry to save + // the length of this array). + leftarray = new point[i + 1]; + leftarray[0] = (point) i; // The array lenth. + // Put all points in this array. + for (k = 0; k < i; k++) { + leftarray[k + 1] = vertexarray[k]; + setpoint2ppt(leftarray[k + 1], (point) leftarray); + } + // Save this array in list. + btreenode_list->newindex((void **) &pptary); + *pptary = leftarray; + } + + // Get the length of the right array. + j = arraysize - i; + if (rflag && (j > 0)) { + if (j > max_btreenode_size) { + max_btreenode_size = j; + } + // Allocate space for the right array (use the first entry to save + // the length of this array). + rightarray = new point[j + 1]; + rightarray[0] = (point) j; // The array lenth. + // Put all points in this array. + for (k = 0; k < j; k++) { + rightarray[k + 1] = vertexarray[i + k]; + setpoint2ppt(rightarray[k + 1], (point) rightarray); + } + // Save this array in list. + btreenode_list->newindex((void **) &pptary); + *pptary = rightarray; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// btree_insert() Add a vertex into a tree node. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::btree_insert(point insertpt) +{ + point *ptary; + long arylen; // The array lenhgth is saved in ptary[0]. + + // Get the tree node (save in this point). + ptary = (point *) point2ppt(insertpt); + // Get the current array length. + arylen = (long) ptary[0]; + // Insert the point into the node. + ptary[arylen + 1] = insertpt; + // Increase the array length by 1. + ptary[0] = (point) (arylen + 1); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// btree_search() Search a near point for an inserting point. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::btree_search(point insertpt, triface* searchtet) +{ + point *ptary; + point nearpt, candpt; + REAL dist2, mindist2; + int ptsamples, ptidx; + long arylen; + int i; + + // Get the tree node (save in this point). + ptary = (point *) point2ppt(insertpt); + // Get the current array length. + arylen = (long) ptary[0]; + + if (arylen == 0) { + searchtet->tet = NULL; + return; + } + + if (arylen < 10) { + ptsamples = arylen; + } else { + ptsamples = 10; // Take at least 10 samples. + // The number of random samples taken is proportional to the third root + // of the number of points in the cell. + while (ptsamples * ptsamples * ptsamples < arylen) { + ptsamples++; + } + } + + // Select "good" candidate using k random samples, taking the closest one. + mindist2 = 1.79769E+308; // The largest double value (8 byte). + nearpt = NULL; + + for (i = 0; i < ptsamples; i++) { + ptidx = randomnation((unsigned long) arylen); + candpt = ptary[ptidx + 1]; + dist2 = (candpt[0] - insertpt[0]) * (candpt[0] - insertpt[0]) + + (candpt[1] - insertpt[1]) * (candpt[1] - insertpt[1]) + + (candpt[2] - insertpt[2]) * (candpt[2] - insertpt[2]); + if (dist2 < mindist2) { + mindist2 = dist2; + nearpt = candpt; + } + } + + if (b->verbose > 1) { + printf(" Get point %d (cell size %ld).\n", pointmark(nearpt), arylen); + } + + decode(point2tet(nearpt), *searchtet); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// ordervertices() Order the vertices for incremental inserting. // +// // +// We assume the vertices have been sorted by a binary tree. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::ordervertices(point* vertexarray, int arraysize) +{ + point **ipptary, **jpptary, *swappptary; + point *ptary; + long arylen; + int index, i, j; + + // First pick one vertex from each tree node. + for (i = 0; i < (int) btreenode_list->objects; i++) { + ipptary = (point **) fastlookup(btreenode_list, i); + ptary = *ipptary; + vertexarray[i] = ptary[1]; // Skip the first entry. + } + + index = i; + // Then put all other points in the array node by node. + for (i = (int) btreenode_list->objects - 1; i >= 0; i--) { + // Randomly pick a tree node. + j = randomnation(i + 1); + // Save the i-th node. + ipptary = (point **) fastlookup(btreenode_list, i); + // Get the j-th node. + jpptary = (point **) fastlookup(btreenode_list, j); + // Order the points in the node. + ptary = *jpptary; + arylen = (long) ptary[0]; + for (j = 2; j <= arylen; j++) { // Skip the first point. + vertexarray[index] = ptary[j]; + index++; + } + // Clear this tree node. + ptary[0] = (point) 0; + // Swap i-th node to j-th node. + swappptary = *ipptary; + *ipptary = *jpptary; // [i] <= [j] + *jpptary = swappptary; // [j] <= [i] + } + + // Make sure we've done correctly. + assert(index == arraysize); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// insertvertexbw() Insert a vertex using the Boywer-Watson algorithm. // +// // +// The point p will be first located in T. 'searchtet' is a suggested start- // +// tetrahedron, it can be NULL. Note that p may lies outside T. In such case,// +// the convex hull of T will be updated to include p as a vertex. // +// // +// If 'bwflag' is TRUE, the Bowyer-Watson algorithm is used to recover the // +// Delaunayness of T. Otherwise, do nothing with regard to the Delaunayness // +// T (T may be non-Delaunay after this function). // +// // +// If 'visflag' is TRUE, force to check the visibility of the boundary faces // +// of cavity. This is needed when T is not Delaunay. // +// // +// If 'noencflag' is TRUE, only insert the new point p if it does not cause // +// any existing (sub)segment be non-Delaunay. This option only is checked // +// when the global variable 'checksubsegs' is set. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::insertvertexbw(point insertpt, + triface *searchtet, bool bwflag, bool visflag, bool noencsegflag, + bool noencsubflag) +{ + triface neightet, spintet, newtet, neineitet; + triface *cavetet, *parytet, *parytet1; + face checksh, *pssub; + face checkseg, *paryseg; + point pa, pb, pc, *ppt; + enum locateresult loc; + REAL attrib, volume; + REAL sign, ori; + long tetcount; + bool enqflag; + int hitbdry; + int i, j; + + arraypool *swaplist; // for updating cavity. + long updatecount; + + if (b->verbose > 1) { + printf(" Insert point %d\n", pointmark(insertpt)); + } + + tetcount = ptloc_count; + updatecount = 0; + + // Locate the point. + if (searchtet->tet == NULL) { + if (btreenode_list) { // default option + // Use bsp-tree to select a starting tetrahedron. + btree_search(insertpt, searchtet); + } else { // -u0 option + // Randomly select a starting tetrahedron. + randomsample(insertpt, searchtet); + } + loc = preciselocate(insertpt, searchtet, tetrahedrons->items); + } else { + // Start from 'searchtet'. + loc = locate2(insertpt, searchtet, NULL); + } + + if (b->verbose > 1) { + printf(" Walk distance (# tets): %ld\n", ptloc_count - tetcount); + } + + if (ptloc_max_count < (ptloc_count - tetcount)) { + ptloc_max_count = (ptloc_count - tetcount); + } + + if (b->verbose > 1) { + printf(" Located (%d) tet (%d, %d, %d, %d).\n", (int) loc, + pointmark(org(*searchtet)), pointmark(dest(*searchtet)), + pointmark(apex(*searchtet)), pointmark(oppo(*searchtet))); + } + + if (loc == ONVERTEX) { + // The point already exists. Mark it and do nothing on it. + if (b->object != tetgenbehavior::STL) { + if (!b->quiet) { + printf("Warning: Point #%d is duplicated with Point #%d. Ignored!\n", + pointmark(insertpt), pointmark(org(*searchtet))); + } + } + setpoint2ppt(insertpt, org(*searchtet)); + setpointtype(insertpt, DUPLICATEDVERTEX); + dupverts++; + return loc; + } + + tetcount = 0l; // The number of deallocated tets. + + // Create the initial boundary of the cavity. + if (loc == INTETRAHEDRON) { + // Add four boundary faces of this tet into list. + neightet.tet = searchtet->tet; + for (neightet.loc = 0; neightet.loc < 4; neightet.loc++) { + cavetetlist->newindex((void **) &parytet); + *parytet = neightet; + } + infect(*searchtet); + caveoldtetlist->newindex((void **) &parytet); + *parytet = *searchtet; + tetcount++; + flip14count++; + } else if (loc == ONFACE) { + // Add at most six boundary faces into list. + neightet.tet = searchtet->tet; + for (i = 0; i < 3; i++) { + neightet.loc = locpivot[searchtet->loc][i]; + cavetetlist->newindex((void **) &parytet); + *parytet = neightet; + } + infect(*searchtet); + caveoldtetlist->newindex((void **) &parytet); + *parytet = *searchtet; + tetcount++; + decode(searchtet->tet[searchtet->loc], spintet); + if (spintet.tet != dummytet) { + neightet.tet = spintet.tet; + for (i = 0; i < 3; i++) { + neightet.loc = locpivot[spintet.loc][i]; + cavetetlist->newindex((void **) &parytet); + *parytet = neightet; + } + infect(spintet); + caveoldtetlist->newindex((void **) &parytet); + *parytet = spintet; + tetcount++; + } else { + // Split a hull face into three hull faces. + hullsize += 2; + } + flip26count++; + } else if (loc == ONEDGE) { + // Add all adjacent boundary tets into list. + spintet = *searchtet; + pc = apex(spintet); + hitbdry = 0; + do { + tetcount++; + neightet.tet = spintet.tet; + neightet.loc = locverpivot[spintet.loc][spintet.ver][0]; + cavetetlist->newindex((void **) &parytet); + *parytet = neightet; + neightet.loc = locverpivot[spintet.loc][spintet.ver][1]; + cavetetlist->newindex((void **) &parytet); + *parytet = neightet; + infect(spintet); + caveoldtetlist->newindex((void **) &parytet); + *parytet = spintet; + // Go to the next tet (may be dummytet). + tfnext(spintet, neightet); + if (neightet.tet == dummytet) { + hitbdry++; + if (hitbdry == 2) break; + esym(*searchtet, spintet); // Go to another direction. + tfnext(spintet, neightet); + if (neightet.tet == dummytet) break; + } + spintet = neightet; + } while (apex(spintet) != pc); + // Update hull size if it is a hull edge. + if (hitbdry > 0) { + // Split a hull edge deletes two hull faces, adds four new hull faces. + hullsize += 2; + } + flipn2ncount++; + } else if (loc == OUTSIDE) { + // p lies outside the convex hull. Enlarge the convex hull by including p. + if (b->verbose > 1) { + printf(" Insert a hull vertex.\n"); + } + // 'searchtet' refers to a hull face which is visible by p. + adjustedgering(*searchtet, CW); + // Create the first tet t (from f and p). + maketetrahedron(&newtet); + setorg (newtet, org(*searchtet)); + setdest(newtet, dest(*searchtet)); + setapex(newtet, apex(*searchtet)); + setoppo(newtet, insertpt); + for (i = 0; i < in->numberoftetrahedronattributes; i++) { + attrib = elemattribute(searchtet->tet, i); + setelemattribute(newtet.tet, i, attrib); + } + if (b->varvolume) { + volume = volumebound(searchtet->tet); + setvolumebound(newtet.tet, volume); + } + // Connect t to T. + bond(newtet, *searchtet); + // Removed a hull face, added three "new hull faces". + hullsize += 2; + + // Add a cavity boundary face. + cavetetlist->newindex((void **) &parytet); + *parytet = newtet; + // Add a cavity tet. + infect(newtet); + caveoldtetlist->newindex((void **) &parytet); + *parytet = newtet; + tetcount++; + + // Add three "new hull faces" into list (re-use cavebdrylist). + newtet.ver = 0; + for (i = 0; i < 3; i++) { + fnext(newtet, neightet); + cavebdrylist->newindex((void **) &parytet); + *parytet = neightet; + enextself(newtet); + } + + // Find all actual new hull faces. + for (i = 0; i < (int) cavebdrylist->objects; i++) { + // Get a queued "new hull face". + parytet = (triface *) fastlookup(cavebdrylist, i); + // Every "new hull face" must have p as its apex. + assert(apex(*parytet) == insertpt); + assert((parytet->ver & 1) == 1); // It's CW edge ring. + // Check if it is still a hull face. + sym(*parytet, neightet); + if (neightet.tet == dummytet) { + // Yes, get its adjacent hull face (at its edge). + esym(*parytet, neightet); + while (1) { + fnextself(neightet); + // Does its adjacent tet exist? + sym(neightet, neineitet); + if (neineitet.tet == dummytet) break; + symedgeself(neightet); + } + // neightet is an adjacent hull face. + pc = apex(neightet); + if (pc != insertpt) { + // Check if p is visible by the hull face ('neightet'). + pa = org(neightet); + pb = dest(neightet); + ori = orient3d(pa, pb, pc, insertpt); orient3dcount++; + if (ori < 0) { + // Create a new tet adjacent to neightet. + maketetrahedron(&newtet); + setorg (newtet, pa); + setdest(newtet, pb); + setapex(newtet, pc); + setoppo(newtet, insertpt); + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(neightet.tet, j); + setelemattribute(newtet.tet, j, attrib); + } + if (b->varvolume) { + volume = volumebound(neightet.tet); + setvolumebound(newtet.tet, volume); + } + bond(newtet, neightet); + fnext(newtet, neineitet); + bond(neineitet, *parytet); + // Comment: We removed two hull faces, and added two "new hull + // faces", hence hullsize remains unchanged. + // Add a cavity boundary face. + cavetetlist->newindex((void **) &parytet1); + *parytet1 = newtet; + // Add a cavity tet. + infect(newtet); + caveoldtetlist->newindex((void **) &parytet1); + *parytet1 = newtet; + tetcount++; + // Add two "new hull faces" into list. + enextself(newtet); + for (j = 0; j < 2; j++) { + fnext(newtet, neineitet); + cavebdrylist->newindex((void **) &parytet1); + *parytet1 = neineitet; + enextself(newtet); + } + } + } else { + // Two hull faces matched. Bond the two adjacent tets. + bond(*parytet, neightet); + hullsize -= 2; + } + } // if (neightet.tet == dummytet) + } // i + cavebdrylist->restart(); + inserthullcount++; + } + + if (!bwflag) return loc; + + // Form the Boywer-Watson cavity. + for (i = 0; i < (int) cavetetlist->objects; i++) { + // Get a cavity boundary face. + parytet = (triface *) fastlookup(cavetetlist, i); + assert(parytet->tet != dummytet); + assert(infected(*parytet)); // The tet is inside the cavity. + enqflag = false; + // Get the adjacent tet. + sym(*parytet, neightet); + if (neightet.tet != dummytet) { + if (!infected(neightet)) { + if (!marktested(neightet)) { + ppt = (point *) &(neightet.tet[4]); + sign = insphere_s(ppt[0], ppt[1], ppt[2], ppt[3], insertpt); + enqflag = (sign < 0.0); + // Avoid redundant insphere tests. + marktest(neightet); + } + } else { + enqflag = true; + } + } + if (enqflag) { // Found a tet in the cavity. + if (!infected(neightet)) { // Avoid to add it multiple times. + // Put other three faces in check list. + neineitet.tet = neightet.tet; + for (j = 0; j < 3; j++) { + neineitet.loc = locpivot[neightet.loc][j]; + cavetetlist->newindex((void **) &parytet1); + *parytet1 = neineitet; + } + infect(neightet); + caveoldtetlist->newindex((void **) &parytet1); + *parytet1 = neightet; + tetcount++; + } + } else { + // Found a boundary face of the cavity. + if (neightet.tet == dummytet) { + // Check for a possible flat tet (see m27.node, use -J option). + pa = org(*parytet); + pb = dest(*parytet); + pc = apex(*parytet); + ori = orient3d(pa, pb, pc, insertpt); + if (ori != 0) { + cavebdrylist->newindex((void **) &parytet1); + *parytet1 = *parytet; + // futureflip = flippush(futureflip, parytet, insertpt); + } + } else { + cavebdrylist->newindex((void **) &parytet1); + *parytet1 = *parytet; + } + } + } // i + + if (b->verbose > 1) { + printf(" Cavity formed: %ld tets, %ld faces.\n", tetcount, + cavebdrylist->objects); + } + + totaldeadtets += tetcount; + totalbowatcavsize += cavebdrylist->objects; + if (maxbowatcavsize < (long) cavebdrylist->objects) { + maxbowatcavsize = cavebdrylist->objects; + } + + if (checksubsegs || noencsegflag) { + // Check if some (sub)segments are inside the cavity. + for (i = 0; i < (int) caveoldtetlist->objects; i++) { + parytet = (triface *) fastlookup(caveoldtetlist, i); + for (j = 0; j < 6; j++) { + parytet->loc = edge2locver[j][0]; + parytet->ver = edge2locver[j][1]; + tsspivot1(*parytet, checkseg); + if ((checkseg.sh != dummysh) && !sinfected(checkseg)) { + // Check if this segment is inside the cavity. + spintet = *parytet; + pa = apex(spintet); + enqflag = true; + hitbdry = 0; + while (1) { + tfnextself(spintet); + if (spintet.tet == dummytet) { + hitbdry++; + if (hitbdry == 2) break; + esym(*parytet, spintet); + tfnextself(spintet); + if (spintet.tet == dummytet) break; + } + if (!infected(spintet)) { + enqflag = false; break; // It is not inside. + } + if (apex(spintet) == pa) break; + } + if (enqflag) { + if (b->verbose > 1) { + printf(" Queue a missing segment (%d, %d).\n", + pointmark(sorg(checkseg)), pointmark(sdest(checkseg))); + } + sinfect(checkseg); // Only save it once. + subsegstack->newindex((void **) &paryseg); + *paryseg = checkseg; + } + } + } + } + } + + if (noencsegflag && (subsegstack->objects > 0)) { + // Found encroached subsegments! Do not insert this point. + for (i = 0; i < (int) caveoldtetlist->objects; i++) { + parytet = (triface *) fastlookup(caveoldtetlist, i); + uninfect(*parytet); + unmarktest(*parytet); + } + // Unmark cavity neighbor tets (outside the cavity). + for (i = 0; i < (int) cavebdrylist->objects; i++) { + parytet = (triface *) fastlookup(cavebdrylist, i); + sym(*parytet, neightet); + if (neightet.tet != dummytet) { + unmarktest(neightet); + } + } + cavetetlist->restart(); + cavebdrylist->restart(); + caveoldtetlist->restart(); + return ENCSEGMENT; + } + + if (checksubfaces || noencsubflag) { + // Check if some subfaces are inside the cavity. + for (i = 0; i < (int) caveoldtetlist->objects; i++) { + parytet = (triface *) fastlookup(caveoldtetlist, i); + neightet.tet = parytet->tet; + for (neightet.loc = 0; neightet.loc < 4; neightet.loc++) { + tspivot(neightet, checksh); + if (checksh.sh != dummysh) { + sym(neightet, neineitet); + // Do not check it if it is a hull tet. + if (neineitet.tet != dummytet) { + if (infected(neineitet)) { + if (b->verbose > 1) { + printf(" Queue a missing subface (%d, %d, %d).\n", + pointmark(sorg(checksh)), pointmark(sdest(checksh)), + pointmark(sapex(checksh))); + } + tsdissolve(neineitet); // Disconnect a tet-sub bond. + stdissolve(checksh); // Disconnect the sub-tet bond. + sesymself(checksh); + stdissolve(checksh); + // Add the missing subface into list. + subfacstack->newindex((void **) &pssub); + *pssub = checksh; + } + } + } + } + } + } + + if (noencsubflag && (subfacstack->objects > 0)) { + // Found encroached subfaces! Do not insert this point. + /*for (i = 0; i < caveoldtetlist->objects; i++) { + cavetet = (triface *) fastlookup(caveoldtetlist, i); + uninfect(*cavetet); + unmarktest(*cavetet); + } + for (i = 0; i < cavebdrylist->objects; i++) { + cavetet = (triface *) fastlookup(cavebdrylist, i); + unmarktest(*cavetet); // Unmark it. + } + if (bwflag && (futureflip != NULL)) { + flippool->restart(); + futureflip = NULL; + } + cavetetlist->restart(); + cavebdrylist->restart(); + caveoldtetlist->restart(); + return ENCFACE; + */ + } + + if (visflag) { + // If T is not a Delaunay triangulation, the formed cavity may not be + // star-shaped (fig/dump-cavity-case8). Validation is needed. + cavetetlist->restart(); // Re-use it. + for (i = 0; i < (int) cavebdrylist->objects; i++) { + cavetet = (triface *) fastlookup(cavebdrylist, i); + if (infected(*cavetet)) { + sym(*cavetet, neightet); + if (neightet.tet == dummytet || !infected(neightet)) { + if (neightet.tet != dummytet) { + cavetet->ver = 4; // CCW edge ring. + pa = dest(*cavetet); + pb = org(*cavetet); + pc = apex(*cavetet); + ori = orient3d(pa, pb, pc, insertpt); orient3dcount++; + assert(ori != 0.0); // SELF_CHECK + enqflag = (ori > 0.0); + } else { + enqflag = true; // A hull face. + } + if (enqflag) { + // This face is valid, save it. + cavetetlist->newindex((void **) &parytet); + *parytet = *cavetet; + } else { + if (b->verbose > 1) { + printf(" Cut tet (%d, %d, %d, %d)\n", pointmark(pb), + pointmark(pa), pointmark(pc), pointmark(oppo(*cavetet))); + } + uninfect(*cavetet); + unmarktest(*cavetet); + if (neightet.tet != dummytet) { + unmarktest(neightet); + } + updatecount++; + // Add three new faces to find new boundaries. + for (j = 0; j < 3; j++) { + fnext(*cavetet, neineitet); + sym(neineitet, neightet); + if (neightet.tet != dummytet) { + if (infected(neightet)) { + neightet.ver = 4; + cavebdrylist->newindex((void **) &parytet); + *parytet = neightet; + } else { + unmarktest(neightet); + } + } + enextself(*cavetet); + } + } + } else { + // This face is not on the cavity boundary anymore. + unmarktest(*cavetet); + } + } else { + assert(!marktested(*cavetet)); + } + } + if (updatecount > 0) { + // Update the cavity boundary faces (fig/dump-cavity-case9). + cavebdrylist->restart(); + for (i = 0; i < (int) cavetetlist->objects; i++) { + cavetet = (triface *) fastlookup(cavetetlist, i); + // 'cavetet' was boundary face of the cavity. + if (infected(*cavetet)) { + sym(*cavetet, neightet); + if ((neightet.tet != dummytet) || !infected(neightet)) { + // It is a cavity boundary face. + cavebdrylist->newindex((void **) &parytet); + *parytet = *cavetet; + } else { + // Not a cavity boundary face. + unmarktest(*cavetet); + } + } else { + assert(!marktested(*cavetet)); + } + } + // Update the list of old tets. + cavetetlist->restart(); + for (i = 0; i < (int) caveoldtetlist->objects; i++) { + cavetet = (triface *) fastlookup(caveoldtetlist, i); + if (infected(*cavetet)) { + cavetetlist->newindex((void **) &parytet); + *parytet = *cavetet; + } + } + assert((int) cavetetlist->objects < i); + // Swap 'cavetetlist' and 'caveoldtetlist'. + swaplist = caveoldtetlist; + caveoldtetlist = cavetetlist; + cavetetlist = swaplist; + if (b->verbose > 1) { + printf(" Size of the updated cavity: %d faces %d tets.\n", + (int) cavebdrylist->objects, (int) caveoldtetlist->objects); + } + } + } + + // Re-use this list for new cavity faces. + cavetetlist->restart(); + + // Create new tetrahedra in the Bowyer-Watson cavity and Connect them. + for (i = 0; i < (int) cavebdrylist->objects; i++) { + parytet = (triface *) fastlookup(cavebdrylist, i); + assert(infected(*parytet)); // The tet is inside the cavity. + parytet->ver = 0; // In CCW edge ring. + maketetrahedron(&newtet); + setorg (newtet, org(*parytet)); + setdest(newtet, dest(*parytet)); + setapex(newtet, apex(*parytet)); + setoppo(newtet, insertpt); + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(parytet->tet, j); + setelemattribute(newtet.tet, j, attrib); + } + if (b->varvolume) { + volume = volumebound(parytet->tet); + setvolumebound(newtet.tet, volume); + } + // Bond the new tet to the adjacent tet outside the cavity. + sym(*parytet, neightet); + if (neightet.tet != dummytet) { + // The tet was marked (to avoid redundant insphere tests). + unmarktest(neightet); + bond(newtet, neightet); + } else { + // Bond newtet to dummytet. + dummytet[0] = encode(newtet); + } + // mark the other three faces of this tet as "open". + neightet.tet = newtet.tet; + for (j = 0; j < 3; j++) { + neightet.tet[locpivot[0][j]] = NULL; + } + // Let the oldtet knows newtet (for connecting adjacent new tets). + parytet->tet[parytet->loc] = encode(newtet); + if (checksubsegs) { + // newtet and parytet share at the same edge. + for (j = 0; j < 3; j++) { + tsspivot1(*parytet, checkseg); + if (checkseg.sh != dummysh) { + if (sinfected(checkseg)) { + // This subsegment is not missing. Unmark it. + if (b->verbose > 1) { + printf(" Dequeue a segment (%d, %d).\n", + pointmark(sorg(checkseg)), pointmark(sdest(checkseg))); + } + suninfect(checkseg); // Dequeue a non-missing segment. + } + tssbond1(newtet, checkseg); + } + enextself(*parytet); + enextself(newtet); + } + } + if (checksubfaces) { + // Bond subface to the new tet. + tspivot(*parytet, checksh); + if (checksh.sh != dummysh) { + tsbond(newtet, checksh); + // The other-side-connection of checksh should be no change. + } + } + } // i + + // Set a handle for speeding point location. + recenttet = newtet; + setpoint2tet(insertpt, encode(newtet)); + + // Connect adjacent new tetrahedra together. Here we utilize the connections + // of the old cavity tets to find the new adjacent tets. + for (i = 0; i < (int) cavebdrylist->objects; i++) { + parytet = (triface *) fastlookup(cavebdrylist, i); + decode(parytet->tet[parytet->loc], newtet); + // assert(org(newtet) == org(*parytet)); // SELF_CHECK + // assert((newtet.ver & 1) == 0); // in CCW edge ring. + for (j = 0; j < 3; j++) { + fnext(newtet, neightet); // Go to the "open" face. + if (neightet.tet[neightet.loc] == NULL) { + spintet = *parytet; + while (1) { + fnextself(spintet); + symedgeself(spintet); + if (spintet.tet == dummytet) break; + if (!infected(spintet)) break; + } + if (spintet.tet != dummytet) { + // 'spintet' is the adjacent tet of the cavity. + fnext(spintet, neineitet); + assert(neineitet.tet[neineitet.loc] == NULL); // SELF_CHECK + bond(neightet, neineitet); + } else { + // This side is a hull face. + neightet.tet[neightet.loc] = (tetrahedron) dummytet; + dummytet[0] = encode(neightet); + } + } + setpoint2tet(org(newtet), encode(newtet)); + enextself(newtet); + enextself(*parytet); + } + } + + // Delete the old cavity tets. + for (i = 0; i < (int) caveoldtetlist->objects; i++) { + parytet = (triface *) fastlookup(caveoldtetlist, i); + tetrahedrondealloc(parytet->tet); + } + + // Set the point type. + if (pointtype(insertpt) == UNUSEDVERTEX) { + setpointtype(insertpt, FREEVOLVERTEX); + } + + if (btreenode_list) { + btree_insert(insertpt); + } + + cavetetlist->restart(); + cavebdrylist->restart(); + caveoldtetlist->restart(); + + return loc; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// unifypoint() Unify two distinct points if they're very close. // +// // +// This function is used for dealing with inputs from CAD tools. Two points // +// p and q are unified if: dist(p, q) / longest < eps. Where dist() is the // +// Euclidean distance between p and q, longest is the maximum edge size of // +// the input point set, eps is the tolerrence specified by user, default is // +// 1e-6, it can be adjusted by '-T' switch. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::unifypoint(point testpt, triface *starttet, enum locateresult + loc, REAL eps) +{ + triface symtet, spintet; + point checkpt, tapex; + REAL tol; + bool merged; + int hitbdry; + int i; + + merged = false; + tol = longest * eps; + if ((loc == OUTSIDE) || (loc == INTETRAHEDRON) || (loc == ONFACE)) { + // Check p is close to the four corners of the tet. + for (i = 0; i < 4; i++) { + checkpt = (point) starttet->tet[4 + i]; + if (distance(testpt, checkpt) < tol) { + merged = true; // Found a merge point p'. + break; + } + } + if (!merged && (loc == ONFACE)) { + // Check the opposite point of the neighbor tet if it exists. + sym(*starttet, symtet); + if (symtet.tet != dummytet) { + checkpt = oppo(symtet); + if (distance(testpt, checkpt) < tol) { + merged = true; // Found a merge point p'. + } + } + } + } else if (loc == ONEDGE) { + // Check two endpoints of the edge. + checkpt = org(*starttet); + if (distance(testpt, checkpt) < tol) { + merged = true; // Found a merge point p'. + } + if (!merged) { + checkpt = dest(*starttet); + if (distance(testpt, checkpt) < tol) { + merged = true; // Found a merge point p'. + } + } + if (!merged) { + // Check apexes of the faces having the edge. + spintet = *starttet; + tapex = apex(*starttet); + hitbdry = 0; + do { + checkpt = apex(spintet); + if (distance(testpt, checkpt) < tol) { + merged = true; // Found a merge point p'. + break; + } + if (!fnextself(spintet)) { + hitbdry++; + if (hitbdry < 2) { + esym(*starttet, spintet); + if (!fnextself(spintet)) { + hitbdry++; + } + } + } + } while ((apex(spintet) != tapex) && (hitbdry < 2)); + } + } + if (merged) { + if (b->object != tetgenbehavior::STL) { + if (!b->quiet) { + printf("Warning: Point %d is unified to point %d.\n", + pointmark(testpt), pointmark(checkpt)); + } + // Count the number of duplicated points. + dupverts++; + } + // Remember it is a duplicated point. + setpointtype(testpt, DUPLICATEDVERTEX); + // Set a pointer to the point it duplicates. + setpoint2ppt(testpt, checkpt); + } + return merged; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// incrflipdelaunay() Construct a delaunay tetrahedrization from a set of // +// 3D points by the incremental flip algorithm. // +// // +// The incremental flip algorithm (by Edelsbrunner and Shah) can be describ- // +// ed as follows: // +// // +// S be a set of points in 3D, Let 4 <= i <= n and assume that the // +// Delaunay tetrahedralization of the first i-1 points in S is already // +// constructed; call it D(i-1). Add the i-th point p_i (belong to S) to // +// D(i-1), and restore Delaunayhood by flipping; this result in D(i). // +// Repeat this procedure until i = n. // +// // +// This strategy always leads to the Delaunay triangulation of a point set. // +// The return value is the number of convex hull faces of D. // +// // +// If the input point set is degenerate, i.e., all points are collinear or // +// are coplanar, then no 3D DT is created and return FALSE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::incrflipdelaunay(triface* oldtet, point* insertarray, + long arraysize, bool jump, bool merge, REAL eps, queue* flipque) +{ + triface newtet, searchtet; + point swappt, lastpt; + enum locateresult loc; + REAL det; + REAL attrib, volume; + int i, j; + + // The initial tetrahedralization T only has one tet formed by 4 affinely + // linear independent vertices of the point set V = 'insertarray'. The + // first point a = insertarray[0]. + + // Get the second point b, that is not identical or very close to a. + for (i = 1; i < arraysize; i++) { + det = distance(insertarray[0], insertarray[i]); + if (det > (longest * eps)) break; + } + if (i == arraysize) { + // printf("\nAll points seem to be identical.\n"); + return false; + } else { + // Swap to move b from index i to index 1. + swappt = insertarray[i]; + insertarray[i] = insertarray[1]; + insertarray[1] = swappt; + } + // Get the third point c, that is not collinear with a and b. + for (i++; i < arraysize; i++) { + if (!iscollinear(insertarray[0], insertarray[1], insertarray[i], eps)) + break; + } + if (i == arraysize) { + // printf("\nAll points seem to be collinear.\n"); + return false; + } else { + // Swap to move c from index i to index 2. + swappt = insertarray[i]; + insertarray[i] = insertarray[2]; + insertarray[2] = swappt; + } + // Get the fourth point d, that is not coplanar with a, b, and c. + for (i++; i < arraysize; i++) { + det = orient3d(insertarray[0], insertarray[1], insertarray[2], + insertarray[i]); + if (det == 0.0) continue; + if (!iscoplanar(insertarray[0], insertarray[1], insertarray[2], + insertarray[i], det, eps)) break; + } + if (i == arraysize) { + return false; + } else { + // Swap to move d from index i to index 3. + swappt = insertarray[i]; + insertarray[i] = insertarray[3]; + insertarray[3] = swappt; + lastpt = insertarray[3]; + // The index of the next inserting point is 4. + i = 4; + } + + if (det > 0.0) { + // For keeping the positive orientation. + swappt = insertarray[0]; + insertarray[0] = insertarray[1]; + insertarray[1] = swappt; + } + + // Create the initial tet. + if (b->verbose > 1) { + printf(" Create the first tet (%d, %d, %d, %d).\n", + pointmark(insertarray[0]), pointmark(insertarray[1]), + pointmark(insertarray[2]), pointmark(lastpt)); + } + + maketetrahedron(&newtet); + setorg(newtet, insertarray[0]); + setdest(newtet, insertarray[1]); + setapex(newtet, insertarray[2]); + setoppo(newtet, lastpt); + if (oldtet != (triface *) NULL) { + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(oldtet->tet, j); + setelemattribute(newtet.tet, j, attrib); + } + if (b->varvolume) { + volume = volumebound(oldtet->tet); + setvolumebound(newtet.tet, volume); + } + } + // Set vertex type be FREEVOLVERTEX if it has no type yet. + if (pointtype(insertarray[0]) == UNUSEDVERTEX) { + setpointtype(insertarray[0], FREEVOLVERTEX); + } + if (pointtype(insertarray[1]) == UNUSEDVERTEX) { + setpointtype(insertarray[1], FREEVOLVERTEX); + } + if (pointtype(insertarray[2]) == UNUSEDVERTEX) { + setpointtype(insertarray[2], FREEVOLVERTEX); + } + if (pointtype(lastpt) == UNUSEDVERTEX) { + setpointtype(lastpt, FREEVOLVERTEX); + } + // Bond to 'dummytet' for point location. + dummytet[0] = encode(newtet); + recenttet = newtet; + // Update the point-to-tet map. + setpoint2tet(insertarray[0], encode(newtet)); + setpoint2tet(insertarray[1], encode(newtet)); + setpoint2tet(insertarray[2], encode(newtet)); + setpoint2tet(lastpt, encode(newtet)); + if (b->verbose > 3) { + printf(" Creating tetra "); + printtet(&newtet); + } + // At init, all faces of this tet are hull faces. + hullsize = 4; + + if (b->verbose > 1) { + printf(" Incrementally inserting points.\n"); + } + + // Insert the rest of points, one by one. + for (; i < arraysize; i++) { + if (jump) { + searchtet.tet = NULL; + } else { + searchtet = recenttet; + } + loc = insertvertexbw(insertarray[i],&searchtet,true,false,false,false); + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// delaunizevertices() Form a Delaunay tetrahedralization. // +// // +// Given a point set V (saved in 'points'). The Delaunay tetrahedralization // +// D of V is created by incrementally inserting vertices. Returns the number // +// of triangular faces bounding the convex hull of D. // +// // +/////////////////////////////////////////////////////////////////////////////// + +long tetgenmesh::delaunizevertices() +{ + point *insertarray; + long arraysize; + bool success; + int i, j; + + if (!b->quiet) { + printf("Constructing Delaunay tetrahedralization.\n"); + } + + if (b->btree) { + btreenode_list = new arraypool(sizeof(point*), 10); + max_btreenode_size = 0; + max_btree_depth = 0; + } + + if (cavetetlist == NULL) { + cavetetlist = new arraypool(sizeof(triface), 10); + cavebdrylist = new arraypool(sizeof(triface), 10); + caveoldtetlist = new arraypool(sizeof(triface), 10); + } + + // Prepare the array of points for inserting. + arraysize = points->items; + insertarray = new point[arraysize]; + + points->traversalinit(); + if (b->btree) { // -u option. + // Use the input order. + for (i = 0; i < arraysize; i++) { + insertarray[i] = pointtraverse(); + } + if (b->verbose) { + printf(" Sorting vertices by a bsp-tree.\n"); + } + // Sort the points using a binary tree recursively. + btree_sort(insertarray, in->numberofpoints, 0, xmin, xmax, ymin, ymax, + zmin, zmax, 0); + if (b->verbose) { + printf(" Number of tree nodes: %ld.\n", btreenode_list->objects); + printf(" Maximum tree node size: %d.\n", max_btreenode_size); + printf(" Maximum tree depth: %d.\n", max_btree_depth); + } + // Order the sorted points. + ordervertices(insertarray, in->numberofpoints); + } else { + if (b->verbose) { + printf(" Permuting vertices.\n"); + } + // Randomize the point order. + for (i = 0; i < arraysize; i++) { + j = (int) randomnation(i + 1); // 0 <= j <= i; + insertarray[i] = insertarray[j]; + insertarray[j] = pointtraverse(); + } + } + + if (b->verbose) { + printf(" Incrementally inserting vertices.\n"); + } + + // Form the DT by incremental flip Delaunay algorithm. + success = incrflipdelaunay(NULL, insertarray, arraysize, true, b->plc, + 0.0, NULL); + + if (b->btree) { + point **pptary; + for (i = 0; i < (int) btreenode_list->objects; i++) { + pptary = (point **) fastlookup(btreenode_list, i); + delete [] *pptary; + } + delete btreenode_list; + btreenode_list = NULL; + } + + delete [] insertarray; + + if (!success) { + return 0l; + } else { + return hullsize; + } +} + +//// //// +//// //// +//// delaunay_cxx ///////////////////////////////////////////////////////////// + +//// surface_cxx ////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// sinsertvertex() Insert a vertex into a triangulation of a facet. // +// // +// The new point (p) will be located. Searching from 'splitsh'. If 'splitseg'// +// is not NULL, p is on a segment, no search is needed. // +// // +// If 'cflag' is not TRUE, the triangulation may be not convex. Don't insert // +// p if it is found in outside. // +// // +// Comment: This routine assumes the 'abovepoint' of this facet has been set,// +// i.e., the routine getabovepoint() has been executed before it is called. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::locateresult tetgenmesh::sinsertvertex(point insertpt, + face *splitsh, face *splitseg, bool bwflag, bool cflag) +{ + face *abfaces, *parysh, *pssub; + face neighsh, newsh, casout, casin; + face aseg, bseg, aoutseg, boutseg; + face checkseg; + triface neightet; + point pa, pb, pc, *ppt; + enum locateresult loc; + REAL sign, ori, area; + int n, s, i, j; + + if (splitseg != NULL) { + spivot(*splitseg, *splitsh); + loc = ONEDGE; + } else { + // Locate the point, '1' means the flag stop-at-segment is on. + loc = locatesub(insertpt, splitsh, 1, 0); + } + + // Return if p lies on a vertex. + if (loc == ONVERTEX) return loc; + + if (loc == OUTSIDE) { + // Return if 'cflag' is not set. + if (!cflag) return loc; + } + + if (loc == ONEDGE) { + if (splitseg == NULL) { + // Do not split a segment. + sspivot(*splitsh, checkseg); + if (checkseg.sh != dummysh) return loc; // return ONSUBSEG; + // Check if this edge is on the hull. + spivot(*splitsh, neighsh); + if (neighsh.sh == dummysh) { + // A convex hull edge. The new point is on the hull. + loc = OUTSIDE; + } + } + } + + if (b->verbose > 1) { + pa = sorg(*splitsh); + pb = sdest(*splitsh); + pc = sapex(*splitsh); + printf(" Insert point %d (%d, %d, %d) loc %d\n", pointmark(insertpt), + pointmark(pa), pointmark(pb), pointmark(pc), (int) loc); + } + + // Does 'insertpt' lie on a segment? + if (splitseg != NULL) { + splitseg->shver = 0; + pa = sorg(*splitseg); + // Count the number of faces at segment [a, b]. + n = 0; + neighsh = *splitsh; + do { + spivotself(neighsh); + n++; + } while ((neighsh.sh != dummysh) && (neighsh.sh != splitsh->sh)); + // n is at least 1. + abfaces = new face[n]; + // Collect faces at seg [a, b]. + abfaces[0] = *splitsh; + if (sorg(abfaces[0]) != pa) sesymself(abfaces[0]); + for (i = 1; i < n; i++) { + spivot(abfaces[i - 1], abfaces[i]); + if (sorg(abfaces[i]) != pa) sesymself(abfaces[i]); + } + } + + // Initialize the cavity. + if (loc == ONEDGE) { + smarktest(*splitsh); + caveshlist->newindex((void **) &parysh); + *parysh = *splitsh; + if (splitseg != NULL) { + for (i = 1; i < n; i++) { + smarktest(abfaces[i]); + caveshlist->newindex((void **) &parysh); + *parysh = abfaces[i]; + } + } else { + spivot(*splitsh, neighsh); + if (neighsh.sh != dummysh) { + smarktest(neighsh); + caveshlist->newindex((void **) &parysh); + *parysh = neighsh; + } + } + } else if (loc == ONFACE) { + smarktest(*splitsh); + caveshlist->newindex((void **) &parysh); + *parysh = *splitsh; + } else { // loc == OUTSIDE; + // This is only possible when T is convex. + assert(cflag); // SELF_CHECK + // Adjust 'abovepoint' to be above the 'splitsh'. 2009-07-21. + ori = orient3d(sorg(*splitsh), sdest(*splitsh), sapex(*splitsh), + abovepoint); + assert(ori != 0); + if (ori > 0) { + sesymself(*splitsh); + } + // Assume p is on top of the edge ('splitsh'). Find a right-most edge + // which is visible by p. + neighsh = *splitsh; + while (1) { + senext2self(neighsh); + spivot(neighsh, casout); + if (casout.sh == dummysh) { + // A convex hull edge. Is it visible by p. + pa = sorg(neighsh); + pb = sdest(neighsh); + ori = orient3d(pa, pb, abovepoint, insertpt); + if (ori < 0) { + *splitsh = neighsh; // Update 'splitsh'. + } else { + break; // 'splitsh' is the right-most visible edge. + } + } else { + if (sorg(casout) != sdest(neighsh)) sesymself(casout); + neighsh = casout; + } + } + // Create new triangles for all visible edges of p (from right to left). + casin.sh = dummysh; // No adjacent face at right. + pa = sorg(*splitsh); + pb = sdest(*splitsh); + while (1) { + // Create a new subface on top of the (visible) edge. + makeshellface(subfaces, &newsh); + // setshvertices(newsh, pb, pa, insertpt); + setsorg(newsh, pb); + setsdest(newsh, pa); + setsapex(newsh, insertpt); + setshellmark(newsh, shellmark(*splitsh)); + if (b->quality && varconstraint) { + area = areabound(*splitsh); + setareabound(newsh, area); + } + // Connect the new subface to the bottom subfaces. + sbond1(newsh, *splitsh); + sbond1(*splitsh, newsh); + // Connect the new subface to its right-adjacent subface. + if (casin.sh != dummysh) { + senext(newsh, casout); + sbond1(casout, casin); + sbond1(casin, casout); + } + // The left-adjacent subface has not been created yet. + senext2(newsh, casin); + // Add the new face into list. + smarktest(newsh); + caveshlist->newindex((void **) &parysh); + *parysh = newsh; + // Move to the convex hull edge at the left of 'splitsh'. + neighsh = *splitsh; + while (1) { + senextself(neighsh); + spivot(neighsh, casout); + if (casout.sh == dummysh) { + *splitsh = neighsh; + break; + } + if (sorg(casout) != sdest(neighsh)) sesymself(casout); + neighsh = casout; + } + // A convex hull edge. Is it visible by p. + pa = sorg(*splitsh); + pb = sdest(*splitsh); + ori = orient3d(pa, pb, abovepoint, insertpt); + if (ori >= 0) break; + } + } + + // Form the Bowyer-Watson cavity. + for (i = 0; i < (int) caveshlist->objects; i++) { + parysh = (face *) fastlookup(caveshlist, i); + for (j = 0; j < 3; j++) { + sspivot(*parysh, checkseg); + if (checkseg.sh == dummysh) { + spivot(*parysh, neighsh); + if (neighsh.sh != dummysh) { + if (!smarktested(neighsh)) { + if (bwflag) { + pa = sorg(neighsh); + pb = sdest(neighsh); + pc = sapex(neighsh); + sign = incircle3d(pa, pb, pc, insertpt); + if (sign < 0) { + smarktest(neighsh); + caveshlist->newindex((void **) &pssub); + *pssub = neighsh; + } + } else { + sign = 1; // A boundary edge. + } + } else { + sign = -1; // Not a boundary edge. + } + } else { + if (loc == OUTSIDE) { + // It is a boundary edge if it does not contain insertp. + if ((sorg(*parysh)==insertpt) || (sdest(*parysh)==insertpt)) { + sign = -1; // Not a boundary edge. + } else { + sign = 1; // A boundary edge. + } + } else { + sign = 1; // A boundary edge. + } + } + } else { + sign = 1; // A segment! + } + if (sign >= 0) { + // Add a boundary edge. + caveshbdlist->newindex((void **) &pssub); + *pssub = *parysh; + } + senextself(*parysh); + } + } + + // Creating new subfaces. + for (i = 0; i < (int) caveshbdlist->objects; i++) { + parysh = (face *) fastlookup(caveshbdlist, i); + sspivot(*parysh, checkseg); + if ((parysh->shver & 01) != 0) sesymself(*parysh); + pa = sorg(*parysh); + pb = sdest(*parysh); + // Create a new subface. + makeshellface(subfaces, &newsh); + // setshvertices(newsh, pa, pb, insertpt); + setsorg(newsh, pa); + setsdest(newsh, pb); + setsapex(newsh, insertpt); + setshellmark(newsh, shellmark(*parysh)); + if (b->quality && varconstraint) { + area = areabound(*parysh); + setareabound(newsh, area); + } + // Connect newsh to outer subfaces. + spivot(*parysh, casout); + if (casout.sh != dummysh) { + if (casout.sh != parysh->sh) { // It is not self-bonded. + casin = casout; + if (checkseg.sh != dummysh) { + spivot(casin, neighsh); + while (neighsh.sh != parysh->sh) { + casin = neighsh; + spivot(casin, neighsh); + } + } + sbond1(newsh, casout); + sbond1(casin, newsh); + } else { + // This side is empty. + } + } else { + // This is a hull side. Save it in dummysh[0] (it will be used by + // the routine locatesub()). 2009-07-20. + dummysh[0] = sencode(newsh); + } + if (checkseg.sh != dummysh) { + ssbond(newsh, checkseg); + } + // Connect oldsh <== newsh (for connecting adjacent new subfaces). + sbond1(*parysh, newsh); + } + + // Set a handle for searching. + // recentsh = newsh; + + // Connect adjacent new subfaces together. + for (i = 0; i < (int) caveshbdlist->objects; i++) { + // Get an old subface at edge [a, b]. + parysh = (face *) fastlookup(caveshbdlist, i); + sspivot(*parysh, checkseg); + spivot(*parysh, newsh); // The new subface [a, b, p]. + senextself(newsh); // At edge [b, p]. + spivot(newsh, neighsh); + if (neighsh.sh == dummysh) { + // Find the adjacent new subface at edge [b, p]. + pb = sdest(*parysh); + neighsh = *parysh; + while (1) { + senextself(neighsh); + spivotself(neighsh); + if (neighsh.sh == dummysh) break; + if (!smarktested(neighsh)) break; + if (sdest(neighsh) != pb) sesymself(neighsh); + } + if (neighsh.sh != dummysh) { + // Now 'neighsh' is a new subface at edge [b, #]. + if (sorg(neighsh) != pb) sesymself(neighsh); + assert(sorg(neighsh) == pb); // SELF_CHECK + assert(sapex(neighsh) == insertpt); // SELF_CHECK + senext2self(neighsh); // Go to the open edge [p, b]. + spivot(neighsh, casout); // SELF_CHECK + assert(casout.sh == dummysh); // SELF_CHECK + sbond(newsh, neighsh); + } else { + assert(loc == OUTSIDE); // SELF_CHECK + // It is a hull edge. 2009-07-21 + dummysh[0] = sencode(newsh); + } + } + spivot(*parysh, newsh); // The new subface [a, b, p]. + senext2self(newsh); // At edge [p, a]. + spivot(newsh, neighsh); + if (neighsh.sh == dummysh) { + // Find the adjacent new subface at edge [p, a]. + pa = sorg(*parysh); + neighsh = *parysh; + while (1) { + senext2self(neighsh); + spivotself(neighsh); + if (neighsh.sh == dummysh) break; + if (!smarktested(neighsh)) break; + if (sorg(neighsh) != pa) sesymself(neighsh); + } + if (neighsh.sh != dummysh) { + // Now 'neighsh' is a new subface at edge [#, a]. + if (sdest(neighsh) != pa) sesymself(neighsh); + assert(sdest(neighsh) == pa); // SELF_CHECK + assert(sapex(neighsh) == insertpt); // SELF_CHECK + senextself(neighsh); // Go to the open edge [a, p]. + spivot(neighsh, casout); // SELF_CHECK + assert(casout.sh == dummysh); // SELF_CHECK + sbond(newsh, neighsh); + } else { + assert(loc == OUTSIDE); // SELF_CHECK + // It is a hull edge. 2009-07-21 + dummysh[0] = sencode(newsh); + } + } + } + + if (splitseg != NULL) { + // Split the segment [a, b]. + aseg = *splitseg; + pa = sorg(aseg); + pb = sdest(aseg); + if (b->verbose > 1) { + printf(" Split seg (%d, %d) by %d.\n", pointmark(pa), pointmark(pb), + pointmark(insertpt)); + } + // Insert the new point p. + makeshellface(subsegs, &bseg); + // setshvertices(bseg, insertpt, pb, NULL); + setsorg(bseg, insertpt); + setsdest(bseg, pb); + setsapex(bseg, NULL); + setsdest(aseg, insertpt); + setshellmark(bseg, shellmark(aseg)); + // This is done outside this routine (at where newpt was created). + // setpoint2sh(insertpt, sencode(aseg)); + if (b->quality && varconstraint) { + setareabound(bseg, areabound(aseg)); + } + // Update the point-to-seg map. + setpoint2seg(pb, sencode(bseg)); + setpoint2seg(insertpt, sencode(bseg)); + // Connect [p, b]<->[b, #]. + senext(aseg, aoutseg); + spivotself(aoutseg); + if (aoutseg.sh != dummysh) { + senext(bseg, boutseg); + sbond(boutseg, aoutseg); + } + // Connect [a, p] <-> [p, b]. + senext(aseg, aoutseg); + senext2(bseg, boutseg); + sbond(aoutseg, boutseg); + // Connect subsegs [a, p] and [p, b] to the true new subfaces. + for (i = 0; i < n; i++) { + spivot(abfaces[i], newsh); // The faked new subface. + if (sorg(newsh) != pa) sesymself(newsh); + senext2(newsh, neighsh); // The edge [p, a] in newsh + spivot(neighsh, casout); + ssbond(casout, aseg); + senext(newsh, neighsh); // The edge [b, p] in newsh + spivot(neighsh, casout); + ssbond(casout, bseg); + } + if (n > 1) { + // Create the two face rings at [a, p] and [p, b]. + for (i = 0; i < n; i++) { + spivot(abfaces[i], newsh); // The faked new subface. + if (sorg(newsh) != pa) sesymself(newsh); + spivot(abfaces[(i + 1) % n], neighsh); // The next faked new subface. + if (sorg(neighsh) != pa) sesymself(neighsh); + senext2(newsh, casout); // The edge [p, a] in newsh. + senext2(neighsh, casin); // The edge [p, a] in neighsh. + spivotself(casout); + spivotself(casin); + sbond1(casout, casin); // Let the i's face point to (i+1)'s face. + senext(newsh, casout); // The edge [b, p] in newsh. + senext(neighsh, casin); // The edge [b, p] in neighsh. + spivotself(casout); + spivotself(casin); + sbond1(casout, casin); + } + } else { + // Only one subface contains this segment. + // assert(n == 1); + spivot(abfaces[0], newsh); // The faked new subface. + if (sorg(newsh) != pa) sesymself(newsh); + senext2(newsh, casout); // The edge [p, a] in newsh. + spivotself(casout); + sdissolve(casout); // Disconnect to faked subface. + senext(newsh, casout); // The edge [b, p] in newsh. + spivotself(casout); + sdissolve(casout); // Disconnect to faked subface. + } + // Delete the faked new subfaces. + for (i = 0; i < n; i++) { + spivot(abfaces[i], newsh); // The faked new subface. + shellfacedealloc(subfaces, newsh.sh); + } + if (checksubsegs) { + // Add two subsegs into stack (for recovery). + if (!sinfected(aseg)) { + s = randomnation(subsegstack->objects + 1); + subsegstack->newindex((void **) &parysh); + *parysh = * (face *) fastlookup(subsegstack, s); + sinfect(aseg); + parysh = (face *) fastlookup(subsegstack, s); + *parysh = aseg; + } + assert(!sinfected(bseg)); // SELF_CHECK + s = randomnation(subsegstack->objects + 1); + subsegstack->newindex((void **) &parysh); + *parysh = * (face *) fastlookup(subsegstack, s); + sinfect(bseg); + parysh = (face *) fastlookup(subsegstack, s); + *parysh = bseg; + } + delete [] abfaces; + } + + if (checksubfaces) { + // Add all new subfaces into list. + for (i = 0; i < (int) caveshbdlist->objects; i++) { + // Get an old subface at edge [a, b]. + parysh = (face *) fastlookup(caveshbdlist, i); + spivot(*parysh, newsh); // The new subface [a, b, p]. + // Some new subfaces may get deleted (when 'splitseg' is a segment). + if (!isdead(&newsh)) { + if (b->verbose > 1) { + printf(" Queue a new subface (%d, %d, %d).\n", + pointmark(sorg(newsh)), pointmark(sdest(newsh)), + pointmark(sapex(newsh))); + } + subfacstack->newindex((void **) &pssub); + *pssub = newsh; + } + } + } + + // Update the point-to-subface map. + for (i = 0; i < (int) caveshbdlist->objects; i++) { + // Get an old subface at edge [a, b]. + parysh = (face *) fastlookup(caveshbdlist, i); + spivot(*parysh, newsh); // The new subface [a, b, p]. + // Some new subfaces may get deleted (when 'splitseg' is a segment). + if (!isdead(&newsh)) { + ppt = (point *) &(newsh.sh[3]); + for (j = 0; j < 3; j++) { + setpoint2sh(ppt[j], sencode(newsh)); + } + } + } + + // Delete the old subfaces. + for (i = 0; i < (int) caveshlist->objects; i++) { + parysh = (face *) fastlookup(caveshlist, i); + if (checksubfaces) { + // Disconnect in the neighbor tets. + for (j = 0; j < 2; j++) { + stpivot(*parysh, neightet); + if (neightet.tet != dummytet) { + tsdissolve(neightet); + // symself(neightet); + // tsdissolve(neightet); + } + sesymself(*parysh); + } + } + shellfacedealloc(subfaces, parysh->sh); + } + + // Clean the working lists. + caveshlist->restart(); + caveshbdlist->restart(); + + return loc; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formstarpolygon() Form the star polygon of a point in facet. // +// // +// The polygon P is formed by all coplanar subfaces having 'pt' as a vertex. // +// P is bounded by segments, e.g, if no segments, P is the full star of pt. // +// // +// 'trilist' T returns the subfaces, it has one of such subfaces on input. // +// In addition, if f is in T, then sapex(f) = p. 'vertlist' V are verts of P.// +// Topologically, T is the star of p; V and the edges of T are the link of p.// +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formstarpolygon(point pt, list* trilist, list* vertlist) +{ + face steinsh, lnextsh, rnextsh; + face checkseg; + point pa, pb, pc, pd; + int i; + + // Get a subface f containing p. + steinsh = * (face *)(* trilist)[0]; + steinsh.shver = 0; // CCW + // Let sapex(f) be p. + for (i = 0; i < 3; i++) { + if (sapex(steinsh) == pt) break; + senextself(steinsh); + } + assert(i < 3); + // Add the edge f into list. + * (face *)(* trilist)[0] = steinsh; + pa = sorg(steinsh); + pb = sdest(steinsh); + if (vertlist != (list *) NULL) { + // Add two verts a, b into V, + vertlist->append(&pa); + vertlist->append(&pb); + } + + // Rotate edge pa to the left (CW) until meet pb or a segment. + lnextsh = steinsh; + pc = pa; + do { + senext2self(lnextsh); + assert(sorg(lnextsh) == pt); + sspivot(lnextsh, checkseg); + if (checkseg.sh != dummysh) break; // Do not cross a segment. + // Get neighbor subface n (must exist). + spivotself(lnextsh); + if (lnextsh.sh == dummysh) break; // It's a hull edge. + // Go to the edge ca opposite to p. + if (sdest(lnextsh) != pt) sesymself(lnextsh); + assert(sdest(lnextsh) == pt); + senext2self(lnextsh); + // Add n (at edge ca) to T. + trilist->append(&lnextsh); + // Add edge ca to E. + pc = sorg(lnextsh); + if (pc == pb) break; // Rotate back. + if (vertlist != (list *) NULL) { + // Add vert c into V. + vertlist->append(&pc); + } + } while (true); + + if (pc != pb) { + // Rotate edge bp to the right (CCW) until meet a segment. + rnextsh = steinsh; + do { + senextself(rnextsh); + assert(sdest(rnextsh) == pt); + sspivot(rnextsh, checkseg); + if (checkseg.sh != dummysh) break; // Do not cross a segment. + // Get neighbor subface n (must exist). + spivotself(rnextsh); + if (rnextsh.sh == dummysh) break; // It's a hull edge. + // Go to the edge bd opposite to p. + if (sorg(rnextsh) != pt) sesymself(rnextsh); + assert(sorg(rnextsh) == pt); + senextself(rnextsh); + // Add n (at edge bd) to T. + trilist->append(&rnextsh); + // Add edge bd to E. + pd = sdest(rnextsh); + if (pd == pa) break; // Rotate back. + if (vertlist != (list *) NULL) { + // Add vert d into V. + vertlist->append(&pd); + } + } while (true); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// About the 'abovepoint' // +// // +// The 'abovepoint' of a facet is a point which is exactly non-coplanar with // +// the plane containing that facet. With such an point, the 3D predicates: // +// orient3d(), and insphere() can be used to substitute the corresponding 2D // +// siblings, e.g. orient2d(), and incircle(). Its location is not critical, // +// but floating-point accuracy is improved if it is nicely placed over the // +// facet, not too close or too far away. // +// // +// We take the convention that the abovepoint of a facet always lies above // +// the facet. By this convention, given three points a, b, and c in a facet, // +// we say c has the counterclockwise order with ab is corresponding to say // +// that c is below the plane abp, where p is the lift point. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// getfacetabovepoint() Get a point above a plane pass through a facet. // +// // +// The calculcated point is saved in 'facetabovepointarray'. The 'abovepoint'// +// is set on return. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::getfacetabovepoint(face* facetsh) +{ + list *verlist, *trilist, *tetlist; + triface adjtet; + face symsh; + point p1, p2, p3, pa; + // enum locateresult loc; + REAL smallcos, cosa; + REAL largevol, volume; + REAL v1[3], v2[3], len; + int smallidx, largeidx; + int shmark; + int i, j; + + abovecount++; + // Initialize working lists. + verlist = new list(sizeof(point *), NULL); + trilist = new list(sizeof(face), NULL); + tetlist = new list(sizeof(triface), NULL); + + // Get three pivotal points p1, p2, and p3 in the facet as a base triangle + // which is non-trivil and has good base angle (close to 90 degree). + + // p1 is chosen as the one which has the smallest index in pa, pb, pc. + p1 = sorg(*facetsh); + pa = sdest(*facetsh); + if (pointmark(pa) < pointmark(p1)) p1 = pa; + pa = sapex(*facetsh); + if (pointmark(pa) < pointmark(p1)) p1 = pa; + // Form the star polygon of p1. + trilist->append(facetsh); + formstarpolygon(p1, trilist, verlist); + + // Get the second pivotal point p2. + p2 = * (point *)(* verlist)[0]; + // Get vector v1 = p1->p2. + for (i = 0; i < 3; i++) v1[i] = p2[i] - p1[i]; + len = sqrt(dot(v1, v1)); + assert(len > 0.0); // p2 != p1. + for (i = 0; i < 3; i++) v1[i] /= len; + + // Get the third pivotal point p3. p3 is chosen as the one in 'verlist' + // which forms an angle with v1 closer to 90 degree than others do. + smallcos = 1.0; // The cosine value of 0 degree. + smallidx = 1; // Default value. + for (i = 1; i < verlist->len(); i++) { + p3 = * (point *)(* verlist)[i]; + for (j = 0; j < 3; j++) v2[j] = p3[j] - p1[j]; + len = sqrt(dot(v2, v2)); + if (len > 0.0) { // v2 is not too small. + cosa = fabs(dot(v1, v2)) / len; + if (cosa < smallcos) { + smallidx = i; + smallcos = cosa; + } + } + } + assert(smallcos < 1.0); // p1->p3 != p1->p2. + p3 = * (point *)(* verlist)[smallidx]; + verlist->clear(); + + if (tetrahedrons->items > 0l) { + // Get a tet having p1 as a vertex. + point2tetorg(p1, adjtet); + assert(org(adjtet) == p1); + if (adjtet.tet != dummytet) { + // Get the star polyhedron of p1. + tetlist->append(&adjtet); + formstarpolyhedron(p1, tetlist, verlist, false); + } + } + + // Get the abovepoint in 'verlist'. It is the one form the largest valid + // volumw with the base triangle over other points in 'verlist. + largevol = 0.0; + largeidx = 0; + for (i = 0; i < verlist->len(); i++) { + pa = * (point *)(* verlist)[i]; + volume = orient3d(p1, p2, p3, pa); + if (!iscoplanar(p1, p2, p3, pa, volume, b->epsilon * 1e+2)) { + if (fabs(volume) > largevol) { + largevol = fabs(volume); + largeidx = i; + } + } + } + + // Do we have the abovepoint? + if (largevol > 0.0) { + abovepoint = * (point *)(* verlist)[largeidx]; + if (b->verbose > 1) { + printf(" Chosen abovepoint %d for facet %d.\n", pointmark(abovepoint), + shellmark(*facetsh)); + } + } else { + // Calculate an abovepoint for this facet. + facenormal(p1, p2, p3, v1, &len); + if (len != 0.0) for (i = 0; i < 3; i++) v1[i] /= len; + // Take the average edge length of the bounding box. + len = (0.5*(xmax - xmin) + 0.5*(ymax - ymin) + 0.5*(zmax - zmin)) / 3.0; + // Temporarily create a point. It will be removed by jettison(); + makepoint(&abovepoint); + setpointtype(abovepoint, UNUSEDVERTEX); + unuverts++; + for (i = 0; i < 3; i++) abovepoint[i] = p1[i] + len * v1[i]; + if (b->verbose > 1) { + printf(" Calculated abovepoint %d for facet %d.\n", + pointmark(abovepoint), shellmark(*facetsh)); + } + } + // Save the abovepoint in 'facetabovepointarray'. + shmark = shellmark(*facetsh); + facetabovepointarray[shmark] = abovepoint; + + delete trilist; + delete tetlist; + delete verlist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// incrflipdelaunaysub() Create a DT from a 3D coplanar point set using // +// the incremental flip algorithm. // +// // +// Let T be the current Delaunay triangulation (of vertices of a facet F). // +// 'shmark', the index of F in 'in->facetlist' (starts from 1). // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::incrflipdelaunaysub(int shmark, REAL eps, list* ptlist, + int holes, REAL* holelist, queue* flipque) +{ + face newsh, startsh; + point *insertarray; + point swappt; + pbcdata *pd; + enum locateresult loc; + REAL det, area; + bool aboveflag; + int arraysize; + int epscount; + int fmarker; + int idx, i, j, k; + + // Get the point array (saved in 'ptlist'). + insertarray = (point *) ptlist->base; + arraysize = ptlist->len(); + if (arraysize < 3) return false; + + // Do calculation of 'abovepoint' if number of points > 3. + aboveflag = (arraysize > 3); + + // The initial triangulation T only has one triangle formed by 3 not + // cillinear points of the set V = 'insertarray'. The first point: + // a = insertarray[0]. + + epscount = 0; + while (true) { + for (i = 1; i < arraysize; i++) { + det = distance(insertarray[0], insertarray[i]); + if (det > (longest * eps)) break; + } + if (i < arraysize) { + // Swap to move b from index i to index 1. + swappt = insertarray[i]; + insertarray[i] = insertarray[1]; + insertarray[1] = swappt; + } + // Get the third point c, that is not collinear with a and b. + for (i++; i < arraysize; i++) { + if (!iscollinear(insertarray[0], insertarray[1], insertarray[i], eps)) + break; + } + if (i < arraysize) { + // Swap to move c from index i to index 2. + swappt = insertarray[i]; + insertarray[i] = insertarray[2]; + insertarray[2] = swappt; + i = 3; // The next inserting point. + } else { + // The set of vertices is not good (or nearly degenerate). + if ((eps == 0.0) || (epscount > 3)) { + printf("Warning: Discard an invalid facet.\n"); + printf(" #%d (%d, %d, %d", shmark, pointmark(insertarray[0]), + pointmark(insertarray[1]), pointmark(insertarray[2])); + if (ptlist->len() > 3) { + printf(", ..."); + } + printf(") looks like a line.\n"); + // terminatetetgen(1); + return false; + } + // Decrease the eps, and continue to try. + eps *= 1e-2; + epscount++; + continue; + } + break; + } // while (true); + + // Create the initial triangle. + makeshellface(subfaces, &newsh); + setsorg(newsh, insertarray[0]); + setsdest(newsh, insertarray[1]); + setsapex(newsh, insertarray[2]); + // Remeber the facet it belongs to. + setshellmark(newsh, shmark); + // Set vertex type be FREESUBVERTEX if it has no type yet. + if (pointtype(insertarray[0]) == FREEVOLVERTEX) { + setpointtype(insertarray[0], FREESUBVERTEX); + } + if (pointtype(insertarray[1]) == FREEVOLVERTEX) { + setpointtype(insertarray[1], FREESUBVERTEX); + } + if (pointtype(insertarray[2]) == FREEVOLVERTEX) { + setpointtype(insertarray[2], FREESUBVERTEX); + } + // Let 'dummysh' point to it (for point location). + dummysh[0] = sencode(newsh); + + // Update the point-to-subface map. + for (i = 0; i < 3; i++) { + setpoint2sh(insertarray[i], sencode(newsh)); + } + + // Are there area constraints? + if (b->quality && (in->facetconstraintlist != (REAL *) NULL)) { + idx = in->facetmarkerlist[shmark - 1]; // The actual facet marker. + for (k = 0; k < in->numberoffacetconstraints; k++) { + fmarker = (int) in->facetconstraintlist[k * 2]; + if (fmarker == idx) { + area = in->facetconstraintlist[k * 2 + 1]; + setareabound(newsh, area); + break; + } + } + } + + // Are there pbc conditions? + if (checkpbcs) { + idx = in->facetmarkerlist[shmark - 1]; // The actual facet marker. + for (k = 0; k < in->numberofpbcgroups; k++) { + pd = &subpbcgrouptable[k]; + for (j = 0; j < 2; j++) { + if (pd->fmark[j] == idx) { + setshellpbcgroup(newsh, k); + pd->ss[j] = newsh; + } + } + } + } + + if (aboveflag) { + // Compute the 'abovepoint' for orient3d(). + abovepoint = facetabovepointarray[shmark]; + if (abovepoint == (point) NULL) { + getfacetabovepoint(&newsh); + } + } + + if (holes > 0) { + // Project hole points onto the plane containing the facet. + REAL prj[3]; + for (k = 0; k < holes; k++) { + projpt2face(&(holelist[k * 3]), insertarray[0], insertarray[1], + insertarray[2], prj); + for (j = 0; j < 3; j++) holelist[k * 3 + j] = prj[j]; + } + } + + // Incrementally insert the rest of points into T. + for (; i < arraysize; i++) { + // Insert p_i. + startsh.sh = dummysh; + loc = sinsertvertex(insertarray[i], &startsh, NULL, true, true); + // The point-to-subface map has been updated. + // Set p_i's type FREESUBVERTEX if it has no type yet. + if (pointtype(insertarray[i]) == FREEVOLVERTEX) { + setpointtype(insertarray[i], FREESUBVERTEX); + } + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// finddirectionsub() Find the first subface in a facet on the path from // +// one point to another. // +// // +// Finds the subface in the facet that intersects a line segment drawn from // +// the origin of `searchsh' to the point `tend', and returns the result in // +// `searchsh'. The origin of `searchsh' does not change, even though the // +// subface returned may differ from the one passed in. // +// // +// The return value notes whether the destination or apex of the found face // +// is collinear with the two points in question. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::finddirectionresult tetgenmesh::finddirectionsub( + face* searchsh, point tend) +{ + face checksh; + point startpoint, leftpoint, rightpoint; + REAL leftccw, rightccw; + REAL ori, sign; + int leftflag, rightflag; + + startpoint = sorg(*searchsh); + // Find the sign to simulate that abovepoint is 'above' the facet. + adjustedgering(*searchsh, CCW); + // Make sure 'startpoint' is the origin. + if (sorg(*searchsh) != startpoint) senextself(*searchsh); + rightpoint = sdest(*searchsh); + leftpoint = sapex(*searchsh); + ori = orient3d(startpoint, rightpoint, leftpoint, abovepoint); + sign = ori > 0.0 ? -1 : 1; + + // Is `tend' to the left? + ori = orient3d(tend, startpoint, abovepoint, leftpoint); + leftccw = ori * sign; + leftflag = leftccw > 0.0; + // Is `tend' to the right? + ori = orient3d(startpoint, tend, abovepoint, rightpoint); + rightccw = ori * sign; + rightflag = rightccw > 0.0; + if (leftflag && rightflag) { + // `searchsh' faces directly away from `tend'. We could go left or + // right. Ask whether it's a triangle or a boundary on the left. + senext2(*searchsh, checksh); + spivotself(checksh); + if (checksh.sh == dummysh) { + leftflag = 0; + } else { + rightflag = 0; + } + } + while (leftflag) { + // Turn left until satisfied. + senext2self(*searchsh); + spivotself(*searchsh); + if (searchsh->sh == dummysh) { + printf("Internal error in finddirectionsub(): Unable to find a\n"); + printf(" subface leading from %d to %d.\n", pointmark(startpoint), + pointmark(tend)); + terminatetetgen(2); + } + if (sorg(*searchsh) != startpoint) sesymself(*searchsh); + assert(sorg(*searchsh) == startpoint); + leftpoint = sapex(*searchsh); + rightccw = leftccw; + ori = orient3d(tend, startpoint, abovepoint, leftpoint); + leftccw = ori * sign; + leftflag = leftccw > 0.0; + } + while (rightflag) { + // Turn right until satisfied. + spivotself(*searchsh); + if (searchsh->sh == dummysh) { + printf("Internal error in finddirectionsub(): Unable to find a\n"); + printf(" subface leading from %d to %d.\n", pointmark(startpoint), + pointmark(tend)); + terminatetetgen(2); + } + if (sdest(*searchsh) != startpoint) sesymself(*searchsh); + assert(sdest(*searchsh) == startpoint); + senextself(*searchsh); + rightpoint = sdest(*searchsh); + leftccw = rightccw; + ori = orient3d(startpoint, tend, abovepoint, rightpoint); + rightccw = ori * sign; + rightflag = rightccw > 0.0; + } + if (leftccw == 0.0) { + return LEFTCOLLINEAR; + } else if (rightccw == 0.0) { + return RIGHTCOLLINEAR; + } else { + return ACROSSEDGE; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// insertsubseg() Create a subsegment and insert it between two subfaces. // +// // +// The new subsegment ab is inserted at the edge of subface 'tri'. If ab is // +// not a hull edge, it is inserted between two subfaces. If 'tri' is a hull // +// face, the initial face ring of ab will be set only one face which is self-// +// bonded. The final face ring will be constructed in 'unifysegments()'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::insertsubseg(face* tri) +{ + face oppotri; + face newsubseg; + point pa, pb; + REAL len; + int e1, e2; + int i; + + // Check if there's already a subsegment here. + sspivot(*tri, newsubseg); + if (newsubseg.sh == dummysh) { + // Make new subsegment and initialize its vertices. + makeshellface(subsegs, &newsubseg); + pa = sorg(*tri); + pb = sdest(*tri); + setsorg(newsubseg, pa); + setsdest(newsubseg, pb); + // Are there length constraints? + if (b->quality && (in->segmentconstraintlist != (REAL *) NULL)) { + for (i = 0; i < in->numberofsegmentconstraints; i++) { + e1 = (int) in->segmentconstraintlist[i * 3]; + e2 = (int) in->segmentconstraintlist[i * 3 + 1]; + if (((pointmark(pa) == e1) && (pointmark(pb) == e2)) || + ((pointmark(pa) == e2) && (pointmark(pb) == e1))) { + len = in->segmentconstraintlist[i * 3 + 2]; + setareabound(newsubseg, len); + break; + } + } + } + // Bond new subsegment to the two subfaces it is sandwiched between. + ssbond(*tri, newsubseg); + spivot(*tri, oppotri); + // 'oppotri' might be "out space". + if (oppotri.sh != dummysh) { + ssbond(oppotri, newsubseg); + } /* else { + // Outside! Bond '*tri' to itself. + sbond(*tri, *tri); + } */ + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// scoutsegmentsub() Scout the first triangle on the path from one point // +// to another, and check for completion (reaching the // +// second point), a collinear point,or the intersection // +// of two segments. // +// // +// Returns true if the entire segment is successfully inserted, and false if // +// the job must be finished by constrainededge(). // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::scoutsegmentsub(face* searchsh, point tend) +{ + face newsubseg; + face crosssub, crosssubseg; + point leftpoint, rightpoint; + enum finddirectionresult collinear; + + collinear = finddirectionsub(searchsh, tend); + rightpoint = sdest(*searchsh); + leftpoint = sapex(*searchsh); + if (rightpoint == tend || leftpoint == tend) { + // The segment is already an edge. + if (leftpoint == tend) { + senext2self(*searchsh); + } + // Insert a subsegment. + insertsubseg(searchsh); + return true; + } else if (collinear == LEFTCOLLINEAR) { + // We've collided with a vertex between the segment's endpoints. + // Make the collinear vertex be the triangle's origin. + senextself(*searchsh); // lprevself(*searchtri); + // Insert a subsegment. + insertsubseg(searchsh); + // Insert the remainder of the segment. + return scoutsegmentsub(searchsh, tend); + } else if (collinear == RIGHTCOLLINEAR) { + // We've collided with a vertex between the segment's endpoints. + // Insert a subsegment. + insertsubseg(searchsh); + // Make the collinear vertex be the triangle's origin. + senextself(*searchsh); // lnextself(*searchtri); + // Insert the remainder of the segment. + return scoutsegmentsub(searchsh, tend); + } else { + senext(*searchsh, crosssub); // lnext(*searchtri, crosstri); + // Check for a crossing segment. + sspivot(crosssub, crosssubseg); +#ifdef SELF_CHECK + assert(crosssubseg.sh == dummysh); +#endif + return false; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// flipedgerecursive() Flip an edge. // +// // +// This is a support routine for inserting segments into a CDT. // +// // +// Let 'flipedge' be ab, and two triangles abc, abd share at it. ab may not // +// flipable if the four vertices a, b, c, and d are non-convex. If it is the // +// case, recursively flip ad or bd. Return when ab is flipped. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::flipedgerecursive(face* flipedge, queue* flipqueue) +{ + face fixupsh; + point pa, pb, pc, pd; + REAL oria, orib; + bool doflip; + + pa = sorg(*flipedge); + pb = sdest(*flipedge); + pc = sapex(*flipedge); + do { + spivot(*flipedge, fixupsh); + pd = sapex(fixupsh); + oria = orient3d(pc, pd, abovepoint, pa); + orib = orient3d(pc, pd, abovepoint, pb); + doflip = (oria * orib < 0.0); + if (doflip) { + // Flip the edge (a, b) away. + flip22sub(flipedge, flipqueue); + // Fix flipedge on edge e (c, d). + findedge(flipedge, pc, pd); + } else { + // ab is unflipable. Get the next edge (bd, or da) to flip. + if (sorg(fixupsh) != pb) sesymself(fixupsh); + assert(sdest(fixupsh) == pa); + if (fabs(oria) > fabs(orib)) { + // acd has larger area. Choose da. + senextself(fixupsh); + } else { + // bcd has larger area. Choose bd. + senext2self(fixupsh); + } + // Flip the edge. + flipedgerecursive(&fixupsh, flipqueue); + } + } while (!doflip); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// constrainededge() Force a segment into a CDT. // +// // +// The segment s is recovered by flipping away the edges it intersects, and // +// triangulating the polygons that form on each side of it. // +// // +// Generates a single subsegment connecting `tstart' to `tend'. The triangle // +// `startsh' has `tstart' as its origin. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::constrainededge(face* startsh, point tend, queue* flipqueue) +{ + point tstart, tright, tleft; + REAL rori, lori; + bool collision; + + tstart = sorg(*startsh); + do { + // Loop edges oppo to tstart until find one crosses the segment. + do { + tright = sdest(*startsh); + tleft = sapex(*startsh); + // Is edge (tright, tleft) corss the segment. + rori = orient3d(tstart, tright, abovepoint, tend); + collision = (rori == 0.0); + if (collision) break; // tright is on the segment. + lori = orient3d(tstart, tleft, abovepoint, tend); + collision = (lori == 0.0); + if (collision) { // tleft is on the segment. + senext2self(*startsh); + break; + } + if (rori * lori < 0.0) break; // Find the crossing edge. + // Both points are at one side of the segment. + finddirectionsub(startsh, tend); + } while (true); + if (collision) break; + // Get the neighbor face at edge e (tright, tleft). + senextself(*startsh); + // Flip the crossing edge. + flipedgerecursive(startsh, flipqueue); + // After flip, sorg(*startsh) == tstart. + assert(sorg(*startsh) == tstart); + } while (sdest(*startsh) != tend); + + // Insert a subsegment to make the segment permanent. + insertsubseg(startsh); + // If there was a collision with an interceding vertex, install another + // segment connecting that vertex with endpoint2. + if (collision) { + // Insert the remainder of the segment. + if (!scoutsegmentsub(startsh, tend)) { + constrainededge(startsh, tend, flipqueue); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// recoversegment() Recover a segment in the surface triangulation. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::recoversegment(point tstart, point tend, queue* flipqueue) +{ + face searchsh; + + if (b->verbose > 2) { + printf(" Insert seg (%d, %d).\n", pointmark(tstart), pointmark(tend)); + } + + // Find a triangle whose origin is the segment's first endpoint. + point2shorg(tstart, searchsh); + // Scout the segment and insert it if it is found. + if (scoutsegmentsub(&searchsh, tend)) { + // The segment was easily inserted. + return; + } + // Insert the segment into the triangulation by flips. + constrainededge(&searchsh, tend, flipqueue); + // Some edges may need flipping. + lawson(flipqueue); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// infecthullsub() Virally infect all of the triangles of the convex hull // +// that are not protected by subsegments. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::infecthullsub(memorypool* viri) +{ + face hulltri, nexttri, starttri; + face hullsubseg; + shellface **deadshellface; + + // Find a triangle handle on the hull. + hulltri.sh = dummysh; + hulltri.shver = 0; + spivotself(hulltri); + adjustedgering(hulltri, CCW); + // Remember where we started so we know when to stop. + starttri = hulltri; + // Go once counterclockwise around the convex hull. + do { + // Ignore triangles that are already infected. + if (!sinfected(hulltri)) { + // Is the triangle protected by a subsegment? + sspivot(hulltri, hullsubseg); + if (hullsubseg.sh == dummysh) { + // The triangle is not protected; infect it. + if (!sinfected(hulltri)) { + sinfect(hulltri); + deadshellface = (shellface **) viri->alloc(); + *deadshellface = hulltri.sh; + } + } + } + // To find the next hull edge, go clockwise around the next vertex. + senextself(hulltri); + spivot(hulltri, nexttri); + while (nexttri.sh != dummysh) { + if (sorg(nexttri) != sdest(hulltri)) { + sesymself(nexttri); + } + senext(nexttri, hulltri); + spivot(hulltri, nexttri); + } + } while (hulltri != starttri); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// plaguesub() Spread the virus from all infected triangles to any // +// neighbors not protected by subsegments. Delete all // +// infected triangles. // +// // +// This is the procedure that actually creates holes and concavities. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::plaguesub(memorypool* viri) +{ + face testtri, neighbor, ghostsh; + face neighborsubseg; + shellface **virusloop; + shellface **deadshellface; + point *ppt; + int i, j; + + // Loop through all the infected triangles, spreading the virus to + // their neighbors, then to their neighbors' neighbors. + viri->traversalinit(); + virusloop = (shellface **) viri->traverse(); + while (virusloop != (shellface **) NULL) { + testtri.sh = *virusloop; + // Check each of the triangle's three neighbors. + for (i = 0; i < 3; i++) { + // Find the neighbor. + spivot(testtri, neighbor); + // Check for a subsegment between the triangle and its neighbor. + sspivot(testtri, neighborsubseg); + // Check if the neighbor is nonexistent or already infected. + if ((neighbor.sh == dummysh) || sinfected(neighbor)) { + if (neighborsubseg.sh != dummysh) { + // There is a subsegment separating the triangle from its + // neighbor, but both triangles are dying, so the subsegment + // dies too. + shellfacedealloc(subsegs, neighborsubseg.sh); + if (neighbor.sh != dummysh) { + // Make sure the subsegment doesn't get deallocated again + // later when the infected neighbor is visited. + ssdissolve(neighbor); + } + } + } else { // The neighbor exists and is not infected. + if (neighborsubseg.sh == dummysh) { + // There is no subsegment protecting the neighbor, so the + // neighbor becomes infected. + sinfect(neighbor); + // Ensure that the neighbor's neighbors will be infected. + deadshellface = (shellface **) viri->alloc(); + *deadshellface = neighbor.sh; + } else { // The neighbor is protected by a subsegment. + // Remove this triangle from the subsegment. + ssbond(neighbor, neighborsubseg); + // Update the point-to-subface map. 2009-07-21. + ppt = (point *) &(neighbor.sh[3]); + for (j = 0; j < 3; j++) { + setpoint2sh(ppt[j], sencode(neighbor)); + } + } + } + senextself(testtri); + } + virusloop = (shellface **) viri->traverse(); + } + + ghostsh.sh = dummysh; // A handle of outer space. + viri->traversalinit(); + virusloop = (shellface **) viri->traverse(); + while (virusloop != (shellface **) NULL) { + testtri.sh = *virusloop; + // Record changes in the number of boundary edges, and disconnect + // dead triangles from their neighbors. + for (i = 0; i < 3; i++) { + spivot(testtri, neighbor); + if (neighbor.sh != dummysh) { + // Disconnect the triangle from its neighbor. + // sdissolve(neighbor); + sbond(neighbor, ghostsh); + } + senextself(testtri); + } + // Return the dead triangle to the pool of triangles. + shellfacedealloc(subfaces, testtri.sh); + virusloop = (shellface **) viri->traverse(); + } + // Empty the virus pool. + viri->restart(); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// carveholessub() Find the holes and infect them. Find the area // +// constraints and infect them. Infect the convex hull. // +// Spread the infection and kill triangles. Spread the // +// area constraints. // +// // +// This routine mainly calls other routines to carry out all these functions.// +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::carveholessub(int holes, REAL* holelist, memorypool *viri) +{ + face searchtri, triangleloop; + shellface **holetri; + enum locateresult intersect; + int i; + + // Mark as infected any unprotected triangles on the boundary. + // This is one way by which concavities are created. + infecthullsub(viri); + + if (holes > 0) { + // Infect each triangle in which a hole lies. + for (i = 0; i < 3 * holes; i += 3) { + // Ignore holes that aren't within the bounds of the mesh. + if ((holelist[i] >= xmin) && (holelist[i] <= xmax) + && (holelist[i + 1] >= ymin) && (holelist[i + 1] <= ymax) + && (holelist[i + 2] >= zmin) && (holelist[i + 2] <= zmax)) { + // Start searching from some triangle on the outer boundary. + searchtri.sh = dummysh; + // Find a triangle that contains the hole. + intersect = locatesub(&holelist[i], &searchtri, 0, 0.0); + if ((intersect != OUTSIDE) && (!sinfected(searchtri))) { + // Infect the triangle. This is done by marking the triangle + // as infected and including the triangle in the virus pool. + sinfect(searchtri); + holetri = (shellface **) viri->alloc(); + *holetri = searchtri.sh; + } + } + } + } + + if (viri->items > 0) { + // Carve the holes and concavities. + plaguesub(viri); + } + // The virus pool should be empty now. +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// triangulate() Triangulate a PSLG into a CDT. // +// // +// A Planar Straight Line Graph (PSLG) P is actually a 2D polygonal region, // +// possibly contains holes, segments and vertices in its interior. P is tri- // +// angulated into a set of _subfaces_ forming a CDT of P. // +// // +// The vertices and segments of P are found in 'ptlist' and 'conlist', resp- // +// ectively. 'holelist' contains a list of hole points. 'shmark' will be set // +// to all subfaces of P. // +// // +// The CDT is created directly in the pools 'subfaces' and 'subsegs'. It can // +// be retrived by a broadth-first searching starting from 'dummysh[0]'(debug // +// function 'outsurfmesh()' does it). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::triangulate(int shmark, REAL eps, list* ptlist, list* conlist, + int holes, REAL* holelist, memorypool* viri, queue* flipqueue) +{ + face newsh; + point *cons; + int i; + + if (b->verbose > 1) { + printf(" %d vertices, %d segments", ptlist->len(), conlist->len()); + if (holes > 0) { + printf(", %d holes", holes); + } + printf(", shmark: %d.\n", shmark); + } + + // Create the DT of V by the 2D incremental flip algorithm. + if (incrflipdelaunaysub(shmark, eps, ptlist, holes, holelist, flipqueue)) { + // Recover boundary edges. + if (ptlist->len() > 3) { + // Insert segments into the DT. + for (i = 0; i < conlist->len(); i++) { + cons = (point *)(* conlist)[i]; + recoversegment(cons[0], cons[1], flipqueue); + } + // Carve holes and concavities. + carveholessub(holes, holelist, viri); + } else if (ptlist->len() == 3) { + // Insert 3 segments directly. + newsh.sh = dummysh; + newsh.shver = 0; + spivotself(newsh); + for (i = 0; i < 3; i++) { + insertsubseg(&newsh); + senextself(newsh); + } + } else if (ptlist->len() == 2) { + // This facet is actually a segment. It is not support by the mesh data + // strcuture. Hence the segment will not be maintained in the mesh. + // However, during segment recovery, the segment can be processed. + cons = (point *)(* conlist)[0]; + makeshellface(subsegs, &newsh); + setsorg(newsh, cons[0]); + setsdest(newsh, cons[1]); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// retrievenewsubs() Retrieve newly created subfaces. // +// // +// The new subfaces created by triangulate() can be found by a broadth-first // +// searching starting from 'dummysh[0]'. // +// // +// 'newshlist' (empty on input) returns the retrieved subfaces. Each edge on // +// the hull is bound to 'dummysh' and protected by a segment. If 'removeseg' // +// is TRUE, the segment is removed. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::retrievenewsubs(list* newshlist, bool removeseg) +{ + face startsh, neighsh; + face deadseg; + int i, j; + + // The first new subface is found at dummysh[0]. + startsh.sh = dummysh; + startsh.shver = 0; + spivotself(startsh); + assert(startsh.sh != dummysh); + sinfect(startsh); + newshlist->append(&startsh); + + // Find the rest of new subfaces by a broadth-first searching. + for (i = 0; i < newshlist->len(); i++) { + // Get a new subface s. + startsh = * (face *)(* newshlist)[i]; + for (j = 0; j < 3; j++) { + spivot(startsh, neighsh); + if (neighsh.sh != dummysh) { + if (!sinfected(neighsh)) { + // Discovered a new subface. + sinfect(neighsh); + newshlist->append(&neighsh); + } + } else { + // Found a boundary edge. + if (removeseg) { + // This side of s may be protected by a segment. + sspivot(startsh, deadseg); + if (deadseg.sh != dummysh) { + // Detach it from s. + ssdissolve(startsh); + // Delete the segment. + shellfacedealloc(subsegs, deadseg.sh); + } + } + } + senextself(startsh); + } + } + for (i = 0; i < newshlist->len(); i++) { + startsh = * (face *)(* newshlist)[i]; + suninfect(startsh); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// unifysegments() Unify identical segments and build facet connections. // +// // +// After creating the surface mesh. Each facet has its own segments. There // +// are duplicated segments between adjacent facets. This routine has three // +// purposes: // +// (1) identify the set of segments which have the same endpoints and // +// unify them into one segment, remove redundant ones; // +// (2) create the face rings of the unified segments, hence setup the // +// connections between facets; and // +// (3) set a unique marker (1-based) for each segment. // +// On finish, each segment is unique and the face ring around it (right-hand // +// rule) is constructed. The connections between facets-facets are setup. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::unifysegments() +{ + list *sfacelist; + shellface **facesperverlist; + face subsegloop, testseg; + face sface, sface1, sface2; + point torg, tdest; + REAL da1, da2; + int *idx2facelist; + int segmarker; + int idx, k, m; + + if (b->verbose > 0) { + printf(" Unifying segments.\n"); + } + + // Compute a mapping from indices of vertices to subfaces. + makesubfacemap(idx2facelist, facesperverlist); + // Initialize 'sfacelist' for constructing the face link of each segment. + sfacelist = new list(sizeof(face), NULL); + + segmarker = 1; + subsegs->traversalinit(); + subsegloop.sh = shellfacetraverse(subsegs); + while (subsegloop.sh != (shellface *) NULL) { + subsegloop.shver = 0; // For sure. + torg = sorg(subsegloop); + tdest = sdest(subsegloop); + idx = pointmark(torg) - in->firstnumber; + // Loop through the set of subfaces containing 'torg'. Get all the + // subfaces containing the edge (torg, tdest). Save and order them + // in 'sfacelist', the ordering is defined by the right-hand rule + // with thumb points from torg to tdest. + for (k = idx2facelist[idx]; k < idx2facelist[idx + 1]; k++) { + sface.sh = facesperverlist[k]; + sface.shver = 0; + // sface may be died due to the removing of duplicated subfaces. + if (!isdead(&sface) && isfacehasedge(&sface, torg, tdest)) { + // 'sface' contains this segment. + findedge(&sface, torg, tdest); + // Save it in 'sfacelist'. + if (sfacelist->len() < 2) { + sfacelist->append(&sface); + } else { + for (m = 0; m < sfacelist->len() - 1; m++) { + sface1 = * (face *)(* sfacelist)[m]; + sface2 = * (face *)(* sfacelist)[m + 1]; + da1 = facedihedral(torg, tdest, sapex(sface1), sapex(sface)); + da2 = facedihedral(torg, tdest, sapex(sface1), sapex(sface2)); + if (da1 < da2) { + break; // Insert it after m. + } + } + sfacelist->insert(m + 1, &sface); + } + } + } + if (b->verbose > 1) { + printf(" Identifying %d segments of (%d %d).\n", sfacelist->len(), + pointmark(torg), pointmark(tdest)); + } + // Set the connection between this segment and faces containing it, + // at the same time, remove redundant segments. + for (k = 0; k < sfacelist->len(); k++) { + sface = *(face *)(* sfacelist)[k]; + sspivot(sface, testseg); + // If 'testseg' is not 'subsegloop', it is a redundant segment that + // needs be removed. BE CAREFUL it may already be removed. Do not + // remove it twice, i.e., do test 'isdead()' together. + if ((testseg.sh != subsegloop.sh) && !isdead(&testseg)) { + shellfacedealloc(subsegs, testseg.sh); + } + // 'ssbond' bonds the subface and the segment together, and dissloves + // the old bond as well. + ssbond(sface, subsegloop); + } + // Set connection between these faces. + sface = *(face *)(* sfacelist)[0]; + if (sfacelist->len() > 1) { + for (k = 1; k <= sfacelist->len(); k++) { + if (k < sfacelist->len()) { + sface1 = *(face *)(* sfacelist)[k]; + } else { + sface1 = *(face *)(* sfacelist)[0]; // Form a face loop. + } + // Comment: For detecting invalid PLC, here we could check if the + // two subfaces "sface" and "sface1" are identical (skipped). + if (b->verbose > 2) { + printf(" Bond subfaces (%d, %d, %d) and (%d, %d, %d).\n", + pointmark(torg), pointmark(tdest), pointmark(sapex(sface)), + pointmark(torg), pointmark(tdest), pointmark(sapex(sface1))); + } + sbond1(sface, sface1); + sface = sface1; + } + } else { + // This segment belongs to only on subface. + sdissolve(sface); + } + // Set the unique segment marker into the unified segment. + setshellmark(subsegloop, segmarker); + // Increase the marker. + segmarker++; + // Clear the working list. + sfacelist->clear(); + subsegloop.sh = shellfacetraverse(subsegs); + } + + delete [] idx2facelist; + delete [] facesperverlist; + delete sfacelist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// assignsegmentmarkers() Assign markers given in "in->edgemarkerlist". // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::assignsegmentmarkers() +{ + shellface **segsperverlist; + face sseg; + bool isseg; + int *idx2seglist; + int end1, end2, tend1, tend2; + int index, i, j; + + if (b->verbose > 0) { + printf(" Assigning segment markers.\n"); + } + + assert(in->edgemarkerlist != NULL); + makesegmentmap(idx2seglist, segsperverlist); + + for (i = 0; i < in->numberofedges; i++) { + end1 = in->edgelist[i * 2]; + end2 = in->edgelist[i * 2 + 1]; + index = end1 - in->firstnumber; + for (j = idx2seglist[index]; j < idx2seglist[index + 1]; j++) { + sseg.sh = segsperverlist[j]; + sseg.shver = 0; + isseg = false; + tend1 = pointmark(sorg(sseg)); + tend2 = pointmark(sdest(sseg)); + if (tend1 == end1) { + if (tend2 == end2) isseg = true; + } else if (tend1 == end2) { + if (tend2 == end1) isseg = true; + } + if (isseg) { + setshellmark(sseg, in->edgemarkerlist[i]); + break; + } + } + } + + delete [] idx2seglist; + delete [] segsperverlist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// mergefacets() Merge adjacent facets to be one facet if they are // +// coplanar and have the same boundary marker. // +// // +// Segments between two merged facets will be removed from the mesh. If all // +// segments around a vertex have been removed, change its vertex type to be // +// FREESUBVERTEX. Edge flips will be performed to ensure the Delaunayness of // +// the triangulation of merged facets. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::mergefacets(queue* flipqueue) +{ + face parentsh, neighsh, neineighsh; + face segloop; + point eorg, edest; + REAL ori; + bool mergeflag, pbcflag; + int* segspernodelist; + int fidx1, fidx2; + int i, j; + + if (b->verbose > 0) { + printf(" Merging coplanar facets.\n"); + } + // Create and initialize 'segspernodelist'. + segspernodelist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) segspernodelist[i] = 0; + + // Loop the segments, counter the number of segments sharing each vertex. + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + // Increment the number of sharing segments for each endpoint. + for (i = 0; i < 2; i++) { + j = pointmark((point) segloop.sh[3 + i]); + segspernodelist[j]++; + } + segloop.sh = shellfacetraverse(subsegs); + } + + // Loop the segments, find out dead segments. + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + eorg = sorg(segloop); + edest = sdest(segloop); + spivot(segloop, parentsh); + if (parentsh.sh != dummysh) { + // This segment is not dangling. + spivot(parentsh, neighsh); + if (neighsh.sh != dummysh) { + // This segment belongs to at least two facets. + spivot(neighsh, neineighsh); + if ((parentsh.sh != neighsh.sh) && (parentsh.sh == neineighsh.sh)) { + // Exactly two subfaces at this segment. + fidx1 = shellmark(parentsh) - 1; + fidx2 = shellmark(neighsh) - 1; + pbcflag = false; + if (checkpbcs) { + pbcflag = (shellpbcgroup(parentsh) >= 0) + || (shellpbcgroup(neighsh) >= 0); + } + // Possibly merge them if they are not in the same facet. + if ((fidx1 != fidx2) && !pbcflag) { + // Test if they are coplanar. + ori = orient3d(eorg, edest, sapex(parentsh), sapex(neighsh)); + if (ori != 0.0) { + if (iscoplanar(eorg, edest, sapex(parentsh), sapex(neighsh), ori, + b->epsilon)) { + ori = 0.0; // They are assumed as coplanar. + } + } + if (ori == 0.0) { + mergeflag = (in->facetmarkerlist == (int *) NULL || + in->facetmarkerlist[fidx1] == in->facetmarkerlist[fidx2]); + if (mergeflag) { + // This segment becomes dead. + if (b->verbose > 1) { + printf(" Removing segment (%d, %d).\n", pointmark(eorg), + pointmark(edest)); + } + ssdissolve(parentsh); + ssdissolve(neighsh); + shellfacedealloc(subsegs, segloop.sh); + j = pointmark(eorg); + segspernodelist[j]--; + if (segspernodelist[j] == 0) { + setpointtype(eorg, FREESUBVERTEX); + } + j = pointmark(edest); + segspernodelist[j]--; + if (segspernodelist[j] == 0) { + setpointtype(edest, FREESUBVERTEX); + } + // Add 'parentsh' to queue checking for flip. + enqueueflipedge(parentsh, flipqueue); + } + } + } + } + } // neighsh.sh != dummysh + } // parentsh.sh != dummysh + segloop.sh = shellfacetraverse(subsegs); + } + + if (!flipqueue->empty()) { + // Restore the Delaunay property in the facet triangulation. + lawson(flipqueue); + } + + delete [] segspernodelist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// meshsurface() Create the surface mesh of a PLC. // +// // +// Let X be the PLC, the surface mesh S of X consists of triangulated facets.// +// S is created mainly in the following steps: // +// // +// (1) Form the CDT of each facet of X separately (by routine triangulate()).// +// After it is done, the subfaces of each facet are connected to each other, // +// however there is no connection between facets yet. Notice each facet has // +// its own segments, some of them are duplicated. // +// // +// (2) Remove the redundant segments created in step (1) (by routine unify- // +// segment()). The subface ring of each segment is created, the connection // +// between facets are established as well. // +// // +// The return value indicates the number of segments of X. // +// // +/////////////////////////////////////////////////////////////////////////////// + +long tetgenmesh::meshsurface() +{ + list *ptlist, *conlist; + queue *flipqueue; + tetgenio::facet *f; + tetgenio::polygon *p; + memorypool *viri; + point *idx2verlist; + point tstart, tend, *cons; + int *worklist; + int end1, end2; + int shmark, i, j; + + if (!b->quiet) { + printf("Creating surface mesh.\n"); + } + + // Compute a mapping from indices to points. + makeindex2pointmap(idx2verlist); + // // Compute a mapping from points to tets for computing abovepoints. + // makepoint2tetmap(); + // Initialize 'facetabovepointarray'. + facetabovepointarray = new point[in->numberoffacets + 1]; + for (i = 0; i < in->numberoffacets + 1; i++) { + facetabovepointarray[i] = (point) NULL; + } + if (checkpbcs) { + // Initialize the global array 'subpbcgrouptable'. + // createsubpbcgrouptable(); + } + + // Initialize working lists. + viri = new memorypool(sizeof(shellface *), 1024, POINTER, 0); + flipqueue = new queue(sizeof(badface)); + ptlist = new list(sizeof(point *), NULL, 256); + conlist = new list(sizeof(point *) * 2, NULL, 256); + worklist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) worklist[i] = 0; + + caveshlist = new arraypool(sizeof(face), 10); + caveshbdlist = new arraypool(sizeof(face), 10); + + // Loop the facet list, triangulate each facet. On finish, all subfaces + // are in 'subfaces', all segments are in 'subsegs'. Notice: there're + // redundant segments. Remember: All facet indices count from 1. + for (shmark = 1; shmark <= in->numberoffacets; shmark++) { + // Get a facet F. + f = &in->facetlist[shmark - 1]; + + // Process the duplicated points first, they are marked with type + // DUPLICATEDVERTEX by incrflipdelaunay(). Let p and q are dup. + // and the index of p is larger than q's, p is substituted by q. + // In a STL mesh, duplicated points are implicitly included. + if ((b->object == tetgenbehavior::STL) || dupverts) { + // Loop all polygons of this facet. + for (i = 0; i < f->numberofpolygons; i++) { + p = &(f->polygonlist[i]); + // Loop other vertices of this polygon. + for (j = 0; j < p->numberofvertices; j++) { + end1 = p->vertexlist[j]; + tstart = idx2verlist[end1 - in->firstnumber]; + if (pointtype(tstart) == DUPLICATEDVERTEX) { + // Reset the index of vertex-j. + tend = point2ppt(tstart); + end2 = pointmark(tend); + p->vertexlist[j] = end2; + } + } + } + } + + // Loop polygons of F, get the set V of vertices and S of segments. + for (i = 0; i < f->numberofpolygons; i++) { + // Get a polygon. + p = &(f->polygonlist[i]); + // Get the first vertex. + end1 = p->vertexlist[0]; + if ((end1 < in->firstnumber) || + (end1 >= in->firstnumber + in->numberofpoints)) { + if (!b->quiet) { + printf("Warning: Invalid the 1st vertex %d of polygon", end1); + printf(" %d in facet %d.\n", i + 1, shmark); + } + continue; // Skip this polygon. + } + tstart = idx2verlist[end1 - in->firstnumber]; + // Add tstart to V if it haven't been added yet. + if (worklist[end1] == 0) { + ptlist->append(&tstart); + worklist[end1] = 1; + } + // Loop other vertices of this polygon. + for (j = 1; j <= p->numberofvertices; j++) { + // get a vertex. + if (j < p->numberofvertices) { + end2 = p->vertexlist[j]; + } else { + end2 = p->vertexlist[0]; // Form a loop from last to first. + } + if ((end2 < in->firstnumber) || + (end2 >= in->firstnumber + in->numberofpoints)) { + if (!b->quiet) { + printf("Warning: Invalid vertex %d in polygon %d", end2, i + 1); + printf(" in facet %d.\n", shmark); + } + } else { + if (end1 != end2) { + // 'end1' and 'end2' form a segment. + tend = idx2verlist[end2 - in->firstnumber]; + // Add tstart to V if it haven't been added yet. + if (worklist[end2] == 0) { + ptlist->append(&tend); + worklist[end2] = 1; + } + // Save the segment in S (conlist). + cons = (point *) conlist->append(NULL); + cons[0] = tstart; + cons[1] = tend; + // Set the start for next continuous segment. + end1 = end2; + tstart = tend; + } else { + // Two identical vertices represent an isolated vertex of F. + if (p->numberofvertices > 2) { + // This may be an error in the input, anyway, we can continue + // by simply skipping this segment. + if (!b->quiet) { + printf("Warning: Polygon %d has two identical verts", i + 1); + printf(" in facet %d.\n", shmark); + } + } + // Ignore this vertex. + } + } + // Is the polygon degenerate (a segment or a vertex)? + if (p->numberofvertices == 2) break; + } + } + // Unmark vertices. + for (i = 0; i < ptlist->len(); i++) { + tstart = * (point *)(* ptlist)[i]; + end1 = pointmark(tstart); + assert(worklist[end1] == 1); + worklist[end1] = 0; + } + + // Create a CDT of F. + triangulate(shmark, b->epsilon * 1e+2, ptlist, conlist, f->numberofholes, + f->holelist, viri, flipqueue); + // Clear working lists. + ptlist->clear(); + conlist->clear(); + viri->restart(); + } + + delete caveshlist; + delete caveshbdlist; + caveshlist = NULL; + caveshbdlist = NULL; + + // Unify segments in 'subsegs', remove redundant segments. Face links + // of segments are also built. + unifysegments(); + /*if (in->numberofedges > 0) { + if (in->edgemarkerlist != NULL) { + assignsegmentmarkers(); + } + }*/ + + // Remember the number of input segments (for output). + insegments = subsegs->items; + + if (checkpbcs) { + // Create the global array 'segpbcgrouptable'. + // createsegpbcgrouptable(); + } + + if (b->object == tetgenbehavior::STL) { + // Remove redundant vertices (for .stl input mesh). + jettisonnodes(); + } + + if (!b->nomerge && !b->nobisect && !checkpbcs) { + // No '-M' switch - merge adjacent facets if they are coplanar. + mergefacets(flipqueue); + } + + // Create the point-to-segment map. + makepoint2segmap(); + + delete [] idx2verlist; + delete [] worklist; + delete ptlist; + delete conlist; + delete flipqueue; + delete viri; + + return subsegs->items; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// interecursive() Recursively do intersection test on a set of triangles.// +// // +// Recursively split the set 'subfacearray' of subfaces into two sets using // +// a cut plane parallel to x-, or, y-, or z-axies. The split criteria are // +// follows. Assume the cut plane is H, and H+ denotes the left halfspace of // +// H, and H- denotes the right halfspace of H; and s be a subface: // +// // +// (1) If all points of s lie at H+, put it into left array; // +// (2) If all points of s lie at H-, put it into right array; // +// (3) If some points of s lie at H+ and some of lie at H-, or some // +// points lie on H, put it into both arraies. // +// // +// Partitions by x-axis if axis == '0'; by y-axis if axis == '1'; by z-axis // +// if axis == '2'. If current cut plane is parallel to the x-axis, the next // +// one will be parallel to y-axis, and the next one after the next is z-axis,// +// and then alternately return back to x-axis. // +// // +// Stop splitting when the number of triangles of the input array is not // +// decreased anymore. Do tests on the current set. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh:: +interecursive(shellface** subfacearray, int arraysize, int axis, REAL bxmin, + REAL bxmax, REAL bymin, REAL bymax, REAL bzmin, REAL bzmax, + int* internum) +{ + shellface **leftarray, **rightarray; + face sface1, sface2; + point p1, p2, p3; + point p4, p5, p6; + enum interresult intersect; + REAL split; + bool toleft, toright; + int leftsize, rightsize; + int i, j; + + if (b->verbose > 1) { + printf(" Recur %d faces. Bbox (%g, %g, %g),(%g, %g, %g). %s-axis\n", + arraysize, bxmin, bymin, bzmin, bxmax, bymax, bzmax, + axis == 0 ? "x" : (axis == 1 ? "y" : "z")); + } + + leftarray = new shellface*[arraysize]; + if (leftarray == NULL) { + terminatetetgen(1); + } + rightarray = new shellface*[arraysize]; + if (rightarray == NULL) { + terminatetetgen(1); + } + leftsize = rightsize = 0; + + if (axis == 0) { + // Split along x-axis. + split = 0.5 * (bxmin + bxmax); + } else if (axis == 1) { + // Split along y-axis. + split = 0.5 * (bymin + bymax); + } else { + // Split along z-axis. + split = 0.5 * (bzmin + bzmax); + } + + for (i = 0; i < arraysize; i++) { + sface1.sh = subfacearray[i]; + p1 = (point) sface1.sh[3]; + p2 = (point) sface1.sh[4]; + p3 = (point) sface1.sh[5]; + toleft = toright = false; + if (p1[axis] < split) { + toleft = true; + if (p2[axis] >= split || p3[axis] >= split) { + toright = true; + } + } else if (p1[axis] > split) { + toright = true; + if (p2[axis] <= split || p3[axis] <= split) { + toleft = true; + } + } else { + // p1[axis] == split; + toleft = true; + toright = true; + } + // At least one is true; +#ifdef SELF_CHECK + assert(!(toleft == false && toright == false)); +#endif + if (toleft) { + leftarray[leftsize] = sface1.sh; + leftsize++; + } + if (toright) { + rightarray[rightsize] = sface1.sh; + rightsize++; + } + } + + if (leftsize < arraysize && rightsize < arraysize) { + // Continue to partition the input set. Now 'subfacearray' has been + // split into two sets, it's memory can be freed. 'leftarray' and + // 'rightarray' will be freed in the next recursive (after they're + // partitioned again or performing tests). + delete [] subfacearray; + // Continue to split these two sets. + if (axis == 0) { + interecursive(leftarray, leftsize, 1, bxmin, split, bymin, bymax, + bzmin, bzmax, internum); + interecursive(rightarray, rightsize, 1, split, bxmax, bymin, bymax, + bzmin, bzmax, internum); + } else if (axis == 1) { + interecursive(leftarray, leftsize, 2, bxmin, bxmax, bymin, split, + bzmin, bzmax, internum); + interecursive(rightarray, rightsize, 2, bxmin, bxmax, split, bymax, + bzmin, bzmax, internum); + } else { + interecursive(leftarray, leftsize, 0, bxmin, bxmax, bymin, bymax, + bzmin, split, internum); + interecursive(rightarray, rightsize, 0, bxmin, bxmax, bymin, bymax, + split, bzmax, internum); + } + } else { + if (b->verbose > 1) { + printf(" Checking intersecting faces.\n"); + } + // Perform a brute-force compare on the set. + for (i = 0; i < arraysize; i++) { + sface1.sh = subfacearray[i]; + p1 = (point) sface1.sh[3]; + p2 = (point) sface1.sh[4]; + p3 = (point) sface1.sh[5]; + for (j = i + 1; j < arraysize; j++) { + sface2.sh = subfacearray[j]; + p4 = (point) sface2.sh[3]; + p5 = (point) sface2.sh[4]; + p6 = (point) sface2.sh[5]; + intersect = tri_tri_inter(p1, p2, p3, p4, p5, p6); + if (intersect == INTERSECT || intersect == SHAREFACE) { + if (!b->quiet) { + if (intersect == INTERSECT) { + printf(" Facet #%d intersects facet #%d at triangles:\n", + shellmark(sface1), shellmark(sface2)); + printf(" (%4d, %4d, %4d) and (%4d, %4d, %4d)\n", + pointmark(p1), pointmark(p2), pointmark(p3), + pointmark(p4), pointmark(p5), pointmark(p6)); + } else { + printf(" Facet #%d duplicates facet #%d at triangle:\n", + shellmark(sface1), shellmark(sface2)); + printf(" (%4d, %4d, %4d)\n", pointmark(p1), pointmark(p2), + pointmark(p3)); + } + } + // Increase the number of intersecting pairs. + (*internum)++; + // Infect these two faces (although they may already be infected). + sinfect(sface1); + sinfect(sface2); + } + } + } + // Don't forget to free all three arrays. No further partition. + delete [] leftarray; + delete [] rightarray; + delete [] subfacearray; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// detectinterfaces() Detect intersecting triangles. // +// // +// Given a set of triangles, find the pairs of intersecting triangles from // +// them. Here the set of triangles is in 'subfaces' which is a surface mesh // +// of a PLC (.poly or .smesh). // +// // +// To detect whether two triangles are intersecting is done by the routine // +// 'tri_tri_inter()'. The algorithm for the test is very simple and stable. // +// It is based on geometric orientation test which uses exact arithmetics. // +// // +// Use divide-and-conquer algorithm for reducing the number of intersection // +// tests. Start from the bounding box of the input point set, recursively // +// partition the box into smaller boxes, until the number of triangles in a // +// box is not decreased anymore. Then perform triangle-triangle tests on the // +// remaining set of triangles. The memory allocated in the input set is // +// freed immediately after it has been partitioned into two arrays. So it // +// can be re-used for the consequent partitions. // +// // +// On return, the pool 'subfaces' will be cleared, and only the intersecting // +// triangles remain for output (to a .face file). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::detectinterfaces() +{ + shellface **subfacearray; + face shloop; + int internum; + int i; + + if (!b->quiet) { + printf("Detecting intersecting facets.\n"); + } + + // Construct a map from indices to subfaces; + subfacearray = new shellface*[subfaces->items]; + subfaces->traversalinit(); + shloop.sh = shellfacetraverse(subfaces); + i = 0; + while (shloop.sh != (shellface *) NULL) { + subfacearray[i] = shloop.sh; + shloop.sh = shellfacetraverse(subfaces); + i++; + } + + internum = 0; + // Recursively split the set of triangles into two sets using a cut plane + // parallel to x-, or, y-, or z-axies. Stop splitting when the number + // of subfaces is not decreasing anymore. Do tests on the current set. + interecursive(subfacearray, subfaces->items, 0, xmin, xmax, ymin, ymax, + zmin, zmax, &internum); + + if (!b->quiet) { + if (internum > 0) { + printf("\n!! Found %d pairs of faces are intersecting.\n\n", internum); + } else { + printf("\nNo faces are intersecting.\n\n"); + } + } + + if (internum > 0) { + // Traverse all subfaces, deallocate those have not been infected (they + // are not intersecting faces). Uninfect those have been infected. + // After this loop, only intersecting faces remain. + subfaces->traversalinit(); + shloop.sh = shellfacetraverse(subfaces); + while (shloop.sh != (shellface *) NULL) { + if (sinfected(shloop)) { + suninfect(shloop); + } else { + shellfacedealloc(subfaces, shloop.sh); + } + shloop.sh = shellfacetraverse(subfaces); + } + } else { + // Deallocate all subfaces. + subfaces->restart(); + } +} + +//// //// +//// //// +//// surface_cxx ////////////////////////////////////////////////////////////// + +//// constrained_cxx ////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// markacutevertices() Mark acute vertices. // +// // +// A vertex v is called acute if there are two segments sharing at v forming // +// an acute angle (i.e. smaller than 90 degree). // +// // +// This routine finds all acute vertices in the PLC and marks them as point- // +// type ACUTEVERTEX. The other vertices of segments which are non-acute will // +// be marked as NACUTEVERTEX. Vertices which are not endpoints of segments // +// (such as DUPLICATEDVERTEX, UNUSEDVERTEX, etc) are not infected. // +// // +// NOTE: This routine should be called before Steiner points are introduced. // +// That is, no point has type like FREESEGVERTEX, etc. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::markacutevertices(REAL acuteangle) +{ + shellface **segsperverlist; + face segloop, nextseg; + point pointloop, edest, eapex; + REAL cosbound, anglearc; + REAL v1[3], v2[3], L, D; + bool isacute; + int *idx2seglist; + int acutecount; + int idx, i, j, k; + + if (b->verbose > 0) { + printf(" Marking acute vertices.\n"); + } + + anglearc = acuteangle * PI / 180.0; + cosbound = cos(anglearc); + acutecount = 0; + // Constructing a map from vertex to segments. + makesegmentmap(idx2seglist, segsperverlist); + + // Loop over the set of vertices. + points->traversalinit(); + pointloop = pointtraverse(); + while (pointloop != (point) NULL) { + idx = pointmark(pointloop) - in->firstnumber; + // Only do test if p is an endpoint of some segments. + if (idx2seglist[idx + 1] > idx2seglist[idx]) { + // Init p to be non-acute. + setpointtype(pointloop, NACUTEVERTEX); + isacute = false; + // Loop through all segments sharing at p. + for (i = idx2seglist[idx]; i < idx2seglist[idx + 1] && !isacute; i++) { + segloop.sh = segsperverlist[i]; + // segloop.shver = 0; + if (sorg(segloop) != pointloop) sesymself(segloop); + edest = sdest(segloop); + for (j = i + 1; j < idx2seglist[idx + 1] && !isacute; j++) { + nextseg.sh = segsperverlist[j]; + // nextseg.shver = 0; + if (sorg(nextseg) != pointloop) sesymself(nextseg); + eapex = sdest(nextseg); + // Check the angle formed by segs (p, edest) and (p, eapex). + for (k = 0; k < 3; k++) { + v1[k] = edest[k] - pointloop[k]; + v2[k] = eapex[k] - pointloop[k]; + } + L = sqrt(v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2]); + for (k = 0; k < 3; k++) v1[k] /= L; + L = sqrt(v2[0] * v2[0] + v2[1] * v2[1] + v2[2] * v2[2]); + for (k = 0; k < 3; k++) v2[k] /= L; + D = v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; + // Is D acute? + isacute = (D >= cosbound); + } + } + if (isacute) { + // Mark p to be acute. + setpointtype(pointloop, ACUTEVERTEX); + acutecount++; + } + } + pointloop = pointtraverse(); + } + + delete [] idx2seglist; + delete [] segsperverlist; + + if ((b->verbose > 0) && (acutecount > 0)) { + printf(" %d acute vertices.\n", acutecount); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// finddirection() Find the first tetrahedron on the path from one point // +// to another. // +// // +// Find the tetrahedron that intersects a line segment L (from the origin of // +// 'searchtet' to the point 'tend'), and returns the result in 'searchtet'. // +// The origin of 'searchtet' does not change, even though the tetrahedron // +// returned may differ from the one passed in. This routine is used to find // +// the direction to move in to get from one point to another. // +// // +// The return value notes the location of the line segment L with respect to // +// 'searchtet': // +// - Returns RIGHTCOLLINEAR indicates L is collinear with the line segment // +// from the origin to the destination of 'searchtet'. // +// - Returns LEFTCOLLINEAR indicates L is collinear with the line segment // +// from the origin to the apex of 'searchtet'. // +// - Returns TOPCOLLINEAR indicates L is collinear with the line segment // +// from the origin to the opposite of 'searchtet'. // +// - Returns ACROSSEDGE indicates L intersects with the line segment from // +// the destination to the apex of 'searchtet'. // +// - Returns ACROSSFACE indicates L intersects with the face opposite to // +// the origin of 'searchtet'. // +// - Returns BELOWHULL indicates L crosses outside the mesh domain. This // +// can only happen when the domain is non-convex. // +// // +// NOTE: This routine only works correctly when the mesh is exactly Delaunay.// +// // +// If 'maxtetnumber' > 0, stop the searching process if the number of passed // +// tets is larger than it. Return BELOWHULL. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::finddirectionresult tetgenmesh:: +finddirection(triface *searchtet, point tend, long maxtetnumber) +{ + triface neightet; + point tstart, tdest, tapex, toppo; + REAL ori1, ori2, ori3; + long tetnumber; + + tstart = org(*searchtet); +#ifdef SELF_CHECK + assert(tstart != tend); +#endif + adjustedgering(*searchtet, CCW); + if (tstart != org(*searchtet)) { + enextself(*searchtet); // For keeping the same origin. + } + tdest = dest(*searchtet); + if (tdest == tend) { + return RIGHTCOLLINEAR; + } + tapex = apex(*searchtet); + if (tapex == tend) { + return LEFTCOLLINEAR; + } + + ori1 = orient3d(tstart, tdest, tapex, tend); + if (ori1 > 0.0) { + // 'tend' is below the face, get the neighbor of this side. + sym(*searchtet, neightet); + if (neightet.tet != dummytet) { + findorg(&neightet, tstart); + adjustedgering(neightet, CCW); + if (org(neightet) != tstart) { + enextself(neightet); // keep the same origin. + } + // Set the changed configuratiuon. + *searchtet = neightet; + ori1 = -1.0; + tdest = dest(*searchtet); + tapex = apex(*searchtet); + } else { + // A hull face. Only possible for a nonconvex mesh. +#ifdef SELF_CHECK + assert(nonconvex); +#endif + return BELOWHULL; + } + } + + // Repeatedly change the 'searchtet', remain 'tstart' be its origin, until + // find a tetrahedron contains 'tend' or is crossed by the line segment + // from 'tstart' to 'tend'. + tetnumber = 0l; + while ((maxtetnumber > 0) && (tetnumber <= maxtetnumber)) { + tetnumber++; + toppo = oppo(*searchtet); + if (toppo == tend) { + return TOPCOLLINEAR; + } + ori2 = orient3d(tstart, toppo, tdest, tend); + if (ori2 > 0.0) { + // 'tend' is below the face, get the neighbor at this side. + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + findorg(&neightet, tstart); + adjustedgering(neightet, CCW); + if (org(neightet) != tstart) { + enextself(neightet); // keep the same origin. + } + // Set the changed configuration. + *searchtet = neightet; + ori1 = -1.0; + tdest = dest(*searchtet); + tapex = apex(*searchtet); + // Continue the search from the changed 'searchtet'. + continue; + } else { + // A hull face. Only possible for a nonconvex mesh. +#ifdef SELF_CHECK + assert(nonconvex); +#endif + return BELOWHULL; + } + } + ori3 = orient3d(tapex, toppo, tstart, tend); + if (ori3 > 0.0) { + // 'tend' is below the face, get the neighbor at this side. + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + findorg(&neightet, tstart); + adjustedgering(neightet, CCW); + if (org(neightet) != tstart) { + enextself(neightet); // keep the same origin. + } + // Set the changed configuration. + *searchtet = neightet; + ori1 = -1.0; + tdest = dest(*searchtet); + tapex = apex(*searchtet); + // Continue the search from the changed 'searchtet'. + continue; + } else { + // A hull face. Only possible for a nonconvex mesh. +#ifdef SELF_CHECK + assert(nonconvex); +#endif + return BELOWHULL; + } + } + // Now 'ori1', 'ori2' and 'ori3' are possible be 0.0 or all < 0.0; + if (ori1 < 0.0) { + // Possible cases are: ACROSSFACE, ACROSSEDGE, TOPCOLLINEAR. + if (ori2 < 0.0) { + if (ori3 < 0.0) { + return ACROSSFACE; + } else { // ori3 == 0.0; + // Cross edge (apex, oppo) + enext2fnextself(*searchtet); + esymself(*searchtet); // org(*searchtet) == tstart; + return ACROSSEDGE; + } + } else { // ori2 == 0.0; + if (ori3 < 0.0) { + // Cross edge (dest, oppo) + fnextself(*searchtet); + esymself(*searchtet); + enextself(*searchtet); // org(*searchtet) == tstart; + return ACROSSEDGE; + } else { // ori3 == 0.0; + // Collinear with edge (org, oppo) + return TOPCOLLINEAR; + } + } + } else { // ori1 == 0.0; + // Possible cases are: RIGHTCOLLINEAR, LEFTCOLLINEAR, ACROSSEDGE. + if (ori2 < 0.0) { + if (ori3 < 0.0) { + // Cross edge (tdest, tapex) + return ACROSSEDGE; + } else { // ori3 == 0.0 + // Collinear with edge (torg, tapex) + return LEFTCOLLINEAR; + } + } else { // ori2 == 0.0; +#ifdef SELF_CHECK + assert(ori3 != 0.0); +#endif + // Collinear with edge (torg, tdest) + return RIGHTCOLLINEAR; + } + } + } + // Loop breakout. It may happen when the mesh is non-Delaunay. + return BELOWHULL; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// finddirection() Find the tet on the path from one point to another. // +// // +// The path starts from 'searchtet''s origin and ends at 'endpt'. On finish, // +// 'searchtet' contains a tet on the path, its origin does not change. // +// // +// The return value indicates one of the following cases (let 'searchtet' be // +// abcd, a is the origin of the path): // +// - ACROSSVERT, edge ab is collinear with the path; // +// - ACROSSEDGE, edge bc intersects with the path; // +// - ACROSSFACE, face bcd intersects with the path. // +// // +// WARNING: This routine is designed for convex triangulations, and will not // +// generally work after the holes and concavities have been carved. // +// - BELOWHULL2, the mesh is non-convex and the searching for the path has // +// got stucked at a non-convex boundary face. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::finddirection2(triface* searchtet, + point endpt) +{ + triface neightet; + point pa, pb, pc, pd, pn; + enum {HMOVE, RMOVE, LMOVE} nextmove; + enum {HCOPLANE, RCOPLANE, LCOPLANE, NCOPLANE} cop; + REAL hori, rori, lori; + REAL dmin, dist; + + assert((searchtet->tet != NULL) && (searchtet->tet != dummytet)); + + // The origin is fixed. + pa = org(*searchtet); + if (searchtet->ver & 01) { + // Switch to the 0th edge ring. + esymself(*searchtet); + enextself(*searchtet); + } + pb = dest(*searchtet); + if (pb == endpt) { + // pa->pb is the search edge. + return INTERVERT; + } + pc = apex(*searchtet); + if (pc == endpt) { + // pa->pc is the search edge. + enext2self(*searchtet); + esymself(*searchtet); + return INTERVERT; + } + + // Walk through tets at pa until the right one is found. + while (1) { + + pd = oppo(*searchtet); + + if (b->verbose > 2) { + printf(" From tet (%d, %d, %d, %d) to %d.\n", pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(pd), pointmark(endpt)); + } + + // Check whether the opposite vertex is 'endpt'. + if (pd == endpt) { + // pa->pd is the search edge. + fnextself(*searchtet); + enext2self(*searchtet); + esymself(*searchtet); + return INTERVERT; + } + + // Now assume that the base face abc coincides with the horizon plane, + // and d lies above the horizon. The search point 'endpt' may lie + // above or below the horizon. We test the orientations of 'endpt' + // with respect to three planes: abc (horizon), bad (right plane), + // and acd (left plane). + hori = orient3d(pa, pb, pc, endpt); + rori = orient3d(pb, pa, pd, endpt); + lori = orient3d(pa, pc, pd, endpt); + orient3dcount += 3; + + // Now decide the tet to move. It is possible there are more than one + // tet are viable moves. Use the opposite points of thier neighbors + // to discriminate, i.e., we choose the tet whose opposite point has + // the shortest distance to 'endpt'. + if (hori > 0) { + if (rori > 0) { + if (lori > 0) { + // Any of the three neighbors is a viable move. + nextmove = HMOVE; + sym(*searchtet, neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dmin = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dmin = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dist = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dist = dmin; + } + if (dist < dmin) { + nextmove = RMOVE; + dmin = dist; + } + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dist = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dist = dmin; + } + if (dist < dmin) { + nextmove = LMOVE; + dmin = dist; + } + } else { + // Two tets, below horizon and below right, are viable. + nextmove = HMOVE; + sym(*searchtet, neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dmin = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dmin = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dist = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dist = dmin; + } + if (dist < dmin) { + nextmove = RMOVE; + dmin = dist; + } + } + } else { + if (lori > 0) { + // Two tets, below horizon and below left, are viable. + nextmove = HMOVE; + sym(*searchtet, neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dmin = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dmin = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dist = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dist = dmin; + } + if (dist < dmin) { + nextmove = LMOVE; + dmin = dist; + } + } else { + // The tet below horizon is chosen. + nextmove = HMOVE; + } + } + } else { + if (rori > 0) { + if (lori > 0) { + // Two tets, below right and below left, are viable. + nextmove = RMOVE; + fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dmin = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dmin = NORM2(xmax - xmin, ymax - ymin, zmax - zmin); + } + enext2fnext(*searchtet, neightet); + symself(neightet); + if (neightet.tet != dummytet) { + pn = oppo(neightet); + dist = NORM2(endpt[0] - pn[0], endpt[1] - pn[1], endpt[2] - pn[2]); + } else { + dist = dmin; + } + if (dist < dmin) { + nextmove = LMOVE; + dmin = dist; + } + } else { + // The tet below right is chosen. + nextmove = RMOVE; + } + } else { + if (lori > 0) { + // The tet below left is chosen. + nextmove = LMOVE; + } else { + // 'endpt' lies either on the plane(s) or across face bcd. + if (hori == 0) { + if (rori == 0) { + // pa->'endpt' is COLLINEAR with pa->pb. + return INTERVERT; + } + if (lori == 0) { + // pa->'endpt' is COLLINEAR with pa->pc. + enext2self(*searchtet); + esymself(*searchtet); + return INTERVERT; + } + // pa->'endpt' crosses the edge pb->pc. + // enextself(*searchtet); + // return INTEREDGE; + cop = HCOPLANE; + break; + } + if (rori == 0) { + if (lori == 0) { + // pa->'endpt' is COLLINEAR with pa->pd. + fnextself(*searchtet); // face abd. + enext2self(*searchtet); + esymself(*searchtet); + return INTERVERT; + } + // pa->'endpt' crosses the edge pb->pd. + // fnextself(*searchtet); // face abd. + // enextself(*searchtet); + // return INTEREDGE; + cop = RCOPLANE; + break; + } + if (lori == 0) { + // pa->'endpt' crosses the edge pc->pd. + // enext2fnextself(*searchtet); // face cad + // enext2self(*searchtet); + // return INTEREDGE; + cop = LCOPLANE; + break; + } + // pa->'endpt' crosses the face bcd. + // enextfnextself(*searchtet); + // return INTERFACE; + cop = NCOPLANE; + break; + } + } + } + + // Move to the next tet, fix pa as its origin. + if (nextmove == RMOVE) { + tfnextself(*searchtet); + } else if (nextmove == LMOVE) { + enext2self(*searchtet); + tfnextself(*searchtet); + enextself(*searchtet); + } else { // HMOVE + symedgeself(*searchtet); + enextself(*searchtet); + } + // Assume convex case, we should not move to outside. + if (searchtet->tet == dummytet) { + // This should only happen when the domain is non-convex. + return BELOWHULL2; + } + assert(org(*searchtet) == pa); // SELF_CHECK + pb = dest(*searchtet); + pc = apex(*searchtet); + + } // while (1) + + // Either case INTEREDGE or INTERFACE. + /*if (b->epsilon > 0) { + // Use tolerance to re-evaluate the orientations. + if (cop != HCOPLANE) { + if (iscoplanar(pa, pb, pc, endpt, hori)) hori = 0; + } + if (cop != RCOPLANE) { + if (iscoplanar(pb, pa, pd, endpt, rori)) rori = 0; + } + if (cop != LCOPLANE) { + if (iscoplanar(pa, pc, pd, endpt, lori)) lori = 0; + } + // It is not possible that all orientations are zero. + assert(!((hori == 0) && (rori == 0) && (lori == 0))); // SELF_CHECK + }*/ + + // Now decide the degenerate cases. + if (hori == 0) { + if (rori == 0) { + // pa->'endpt' is COLLINEAR with pa->pb. + return INTERVERT; + } + if (lori == 0) { + // pa->'endpt' is COLLINEAR with pa->pc. + enext2self(*searchtet); + esymself(*searchtet); + return INTERVERT; + } + // pa->'endpt' crosses the edge pb->pc. + return INTEREDGE; + } + if (rori == 0) { + if (lori == 0) { + // pa->'endpt' is COLLINEAR with pa->pd. + fnextself(*searchtet); // face abd. + enext2self(*searchtet); + esymself(*searchtet); + return INTERVERT; + } + // pa->'endpt' crosses the edge pb->pd. + fnextself(*searchtet); // face abd. + esymself(*searchtet); + enextself(*searchtet); + return INTEREDGE; + } + if (lori == 0) { + // pa->'endpt' crosses the edge pc->pd. + enext2fnextself(*searchtet); // face cad + esymself(*searchtet); + return INTEREDGE; + } + // pa->'endpt' crosses the face bcd. + return INTERFACE; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// finddirection3() Used when finddirection2() returns BELOWHULL2. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::finddirection3(triface* searchtet, + point endpt) +{ + arraypool *startetlist; + triface *parytet, oppoface, neightet; + point startpt, pa, pb, pc; + enum interresult dir; + int types[2], poss[4]; + int pos, i, j; + + startetlist = new arraypool(sizeof(triface), 8); + startpt = org(*searchtet); + infect(*searchtet); + startetlist->newindex((void **) &parytet); + *parytet = *searchtet; + + if (b->verbose > 1) { + printf(" Search path (%d, %d) under non-convexity.\n", + pointmark(startpt), pointmark(endpt)); + } + + for (i = 0; i < (int) startetlist->objects; i++) { + parytet = (triface *) fastlookup(startetlist, i); + *searchtet = *parytet; + // assert(org(*searchtet) == startpt); + adjustedgering(*searchtet, CCW); + if (org(*searchtet) != startpt) { + enextself(*searchtet); + assert(org(*searchtet) == startpt); + } + // Go to the opposite face of startpt. + enextfnext(*searchtet, oppoface); + esymself(oppoface); + pa = org(oppoface); + pb = dest(oppoface); + pc = apex(oppoface); + // Check if face [a, b, c] intersects the searching path. + if (tri_edge_test(pa, pb, pc, startpt, endpt, NULL, 1, types, poss)) { + // They intersect. Get the type of intersection. + dir = (enum interresult) types[0]; + pos = poss[0]; + break; + } else { + dir = DISJOINT; + } + // Get the neighbor tets. + for (j = 0; j < 3; j++) { + if (j == 0) { + symedge(*searchtet, neightet); + } else if (j == 1) { + fnext(*searchtet, neightet); + symedgeself(neightet); + } else { + enext2fnext(*searchtet, neightet); + symedgeself(neightet); + } + if (neightet.tet != dummytet) { + if (!infected(neightet)) { + if (org(neightet) != startpt) esymself(neightet); + infect(neightet); + startetlist->newindex((void **) &parytet); + *parytet = neightet; + } + } + } + } + + for (i = 0; i < (int) startetlist->objects; i++) { + parytet = (triface *) fastlookup(startetlist, i); + uninfect(*parytet); + } + delete startetlist; + + if (dir == INTERVERT) { + // This path passing a vertex of the face [a, b, c]. + if (pos == 0) { + // The path acrosses pa. + enext2self(*searchtet); + esymself(*searchtet); + } else if (pos == 1) { + // The path acrosses pa. + } else { // pos == 2 + // The path acrosses pc. + fnextself(*searchtet); + enext2self(*searchtet); + esymself(*searchtet); + } + return INTERVERT; + } + if (dir == INTEREDGE) { + // This path passing an edge of the face [a, b, c]. + if (pos == 0) { + // The path intersects [pa, pb]. + } else if (pos == 1) { + // The path intersects [pb, pc]. + fnextself(*searchtet); + enext2self(*searchtet); + esymself(*searchtet); + } else { // pos == 2 + // The path intersects [pc, pa]. + enext2fnextself(*searchtet); + esymself(*searchtet); + } + return INTEREDGE; + } + if (dir == INTERFACE) { + return INTERFACE; + } + + // The path does not intersect any tet at pa. + return BELOWHULL2; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// scoutsegment() Look for a given segment in the tetrahedralization T. // +// // +// Search an edge in the tetrahedralization that matches the given segmment. // +// If such an edge exists, the segment is 'locked' at the edge. 'searchtet' // +// returns this (constrained) edge. Otherwise, the segment is missing. // +// // +// The returned value indicates one of the following cases: // +// - SHAREEDGE, the segment exists and is inserted in T; // +// - INTERVERT, the segment intersects a vertex ('refpt'). // +// - INTEREDGE, the segment intersects an edge (in 'searchtet'). // +// - INTERFACE, the segment crosses a face (in 'searchtet'). // +// // +// If the returned value is INTEREDGE or INTERFACE, i.e., the segment is // +// missing, 'refpt' returns the reference point for splitting thus segment, // +// 'searchtet' returns a tet containing the 'refpt'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::scoutsegment2(face* sseg, + triface* searchtet, point* refpt) +{ + triface neightet, reftet; + face splitsh, checkseg; + point startpt, endpt; + point pa, pb, pc, pd; + enum interresult dir; + REAL angmax, ang; + long facecount; + int hitbdry; + int types[2], poss[4]; + int pos, i; + + // Is 'searchtet' a valid handle? + if ((searchtet->tet == NULL) || (searchtet->tet == dummytet)) { + startpt = sorg(*sseg); + point2tetorg(startpt, *searchtet); + } else { + startpt = sorg(*sseg); + } + assert(org(*searchtet) == startpt); // SELF_CHECK + endpt = sdest(*sseg); + + if (b->verbose > 1) { + printf(" Scout seg (%d, %d).\n", pointmark(startpt), pointmark(endpt)); + } + + dir = finddirection2(searchtet, endpt); + + if (dir == INTERVERT) { + pd = dest(*searchtet); + if (pd == endpt) { + // Found! Insert the segment. + tsspivot1(*searchtet, checkseg); // SELF_CHECK + if (checkseg.sh == dummysh) { + neightet = *searchtet; + hitbdry = 0; + do { + tssbond1(neightet, *sseg); + tfnextself(neightet); + if (neightet.tet == dummytet) { + hitbdry++; + if (hitbdry == 2) break; + esym(*searchtet, neightet); + tfnextself(neightet); + if (neightet.tet == dummytet) break; + } + } while (neightet.tet != searchtet->tet); + } else { + // Collision! This can happy during facet recovery. + // See fig/dump-cavity-case19, -case20. + assert(checkseg.sh == sseg->sh); // SELF_CHECK + } + // The job is done. + return SHAREEDGE; + } else { + // A point is on the path. + *refpt = pd; + return INTERVERT; + } + } + + if (b->verbose > 1) { + printf(" Scout ref point of seg (%d, %d).\n", pointmark(startpt), + pointmark(endpt)); + } + facecount = across_face_count; + + enextfnextself(*searchtet); // Go to the opposite face. + symedgeself(*searchtet); // Enter the adjacent tet. + + pa = org(*searchtet); + angmax = interiorangle(pa, startpt, endpt, NULL); + *refpt = pa; + pb = dest(*searchtet); + ang = interiorangle(pb, startpt, endpt, NULL); + if (ang > angmax) { + angmax = ang; + *refpt = pb; + } + + // Check whether two segments are intersecting. + if (dir == INTEREDGE) { + tsspivot1(*searchtet, checkseg); + if (checkseg.sh != dummysh) { + printf("Error: Invalid PLC. Two segments intersect.\n"); + startpt = getsubsegfarorg(sseg); + endpt = getsubsegfardest(sseg); + pa = getsubsegfarorg(&checkseg); + pb = getsubsegfardest(&checkseg); + printf(" 1st: (%d, %d), 2nd: (%d, %d).\n", pointmark(startpt), + pointmark(endpt), pointmark(pa), pointmark(pb)); + terminatetetgen(3); + } + across_edge_count++; + } + + pc = apex(*searchtet); + ang = interiorangle(pc, startpt, endpt, NULL); + if (ang > angmax) { + angmax = ang; + *refpt = pc; + } + reftet = *searchtet; // Save the tet containing the refpt. + + // Search intersecting faces along the segment. + while (1) { + + pd = oppo(*searchtet); + + if (b->verbose > 2) { + printf(" Passing face (%d, %d, %d, %d), dir(%d).\n", pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(pd), (int) dir); + } + across_face_count++; + + // Stop if we meet 'endpt'. + if (pd == endpt) break; + + ang = interiorangle(pd, startpt, endpt, NULL); + if (ang > angmax) { + angmax = ang; + *refpt = pd; + reftet = *searchtet; + } + + // Find a face intersecting the segment. + if (dir == INTERFACE) { + // One of the three oppo faces in 'searchtet' intersects the segment. + neightet.tet = searchtet->tet; + neightet.ver = 0; + for (i = 0; i < 3; i++) { + neightet.loc = locpivot[searchtet->loc][i]; + pa = org(neightet); + pb = dest(neightet); + pc = apex(neightet); + pd = oppo(neightet); // The above point. + if (tri_edge_test(pa, pb, pc, startpt, endpt, pd, 1, types, poss)) { + dir = (enum interresult) types[0]; + pos = poss[0]; + break; + } else { + dir = DISJOINT; + pos = 0; + } + } + assert(dir != DISJOINT); // SELF_CHECK + } else { // dir == ACROSSEDGE + // Check the two opposite faces (of the edge) in 'searchtet'. + neightet = *searchtet; + neightet.ver = 0; + for (i = 0; i < 2; i++) { + neightet.loc = locverpivot[searchtet->loc][searchtet->ver][i]; + pa = org(neightet); + pb = dest(neightet); + pc = apex(neightet); + pd = oppo(neightet); // The above point. + if (tri_edge_test(pa, pb, pc, startpt, endpt, pd, 1, types, poss)) { + dir = (enum interresult) types[0]; + pos = poss[0]; + break; + } else { + dir = DISJOINT; + pos = 0; + } + } + if (dir == DISJOINT) { + // No intersection. Go to the next tet. + dir = INTEREDGE; + tfnextself(*searchtet); + continue; + } + } + + if (dir == INTERVERT) { + // This segment passing a vertex. Choose it and return. + for (i = 0; i < pos; i++) { + enextself(neightet); + } + pd = org(neightet); + if (b->verbose > 2) { + angmax = interiorangle(pd, startpt, endpt, NULL); + } + *refpt = pd; + break; + } + if (dir == INTEREDGE) { + // Get the edge intersects with the segment. + for (i = 0; i < pos; i++) { + enextself(neightet); + } + } + // Go to the next tet. + symedge(neightet, *searchtet); + + if (dir == INTEREDGE) { + // Check whether two segments are intersecting. + tsspivot1(*searchtet, checkseg); + if (checkseg.sh != dummysh) { + printf("Error: Invalid PLC! Two segments intersect.\n"); + startpt = getsubsegfarorg(sseg); + endpt = getsubsegfardest(sseg); + pa = getsubsegfarorg(&checkseg); + pb = getsubsegfardest(&checkseg); + printf(" 1st: (%d, %d), 2nd: (%d, %d).\n", pointmark(startpt), + pointmark(endpt), pointmark(pa), pointmark(pb)); + terminatetetgen(3); + } + across_edge_count++; + } + + } // while (1) + + // dir is either ACROSSVERT, or ACROSSEDGE, or ACROSSFACE. + if (b->verbose > 2) { + printf(" Refpt %d (%g), visited %ld faces.\n", pointmark(*refpt), + angmax / PI * 180.0, across_face_count - facecount); + } + if (across_face_count - facecount > across_max_count) { + across_max_count = across_face_count - facecount; + } + + *searchtet = reftet; + return dir; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getsegmentsplitpoint() Calculate a split point in the given segment. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::getsegmentsplitpoint2(face* sseg, point refpt, REAL* vt) +{ + point ei, ej, ek; + REAL split, L, d, d1, d2, d3; + int stype, sign; + int i; + + // Decide the type of this segment. + sign = 1; + ei = sorg(*sseg); + ej = sdest(*sseg); + + if (pointtype(ei) == ACUTEVERTEX) { + if (pointtype(ej) == ACUTEVERTEX) { + // Both ei and ej are ACUTEVERTEX. + stype = 0; + } else { + // ej is either a NACUTEVERTEX or a STEINERVERTEX. + stype = 1; + } + } else { + if (pointtype(ei) == NACUTEVERTEX) { + if (pointtype(ej) == ACUTEVERTEX) { + stype = 1; sign = -1; + } else { + if (pointtype(ej) == NACUTEVERTEX) { + // Both ei and ej are non-acute. + stype = 0; + } else { + // ej is a STEINERVETEX. + ek = getsubsegfardest(sseg); + if (pointtype(ek) == ACUTEVERTEX) { + stype = 1; sign = -1; + } else { + stype = 0; + } + } + } + } else { + // ei is a STEINERVERTEX. + if (pointtype(ej) == ACUTEVERTEX) { + stype = 1; sign = -1; + } else { + ek = getsubsegfarorg(sseg); + if (pointtype(ej) == NACUTEVERTEX) { + if (pointtype(ek) == ACUTEVERTEX) { + stype = 1; + } else { + stype = 0; + } + } else { + // Both ei and ej are STEINERVETEXs. ei has priority. + if (pointtype(ek) == ACUTEVERTEX) { + stype = 1; + } else { + ek = getsubsegfardest(sseg); + if (pointtype(ek) == ACUTEVERTEX) { + stype = 1; sign = -1; + } else { + stype = 0; + } + } + } + } + } + } + + // Adjust the endpoints: ei, ej. + if (sign == -1) { + sesymself(*sseg); + ei = sorg(*sseg); + ej = sdest(*sseg); + } + + if (b->verbose > 1) { + printf(" Split a type-%d seg(%d, %d) ref(%d)", stype, + pointmark(ei), pointmark(ej), pointmark(refpt)); + if (stype) { + ek = getsubsegfarorg(sseg); + printf(" ek(%d)", pointmark(ek)); + } + printf(".\n"); + } + + // Calculate the split point. + if (stype == 0) { + // Use rule-1. + L = DIST(ei, ej); + d1 = DIST(ei, refpt); + d2 = DIST(ej, refpt); + if (d1 < d2) { + // Choose ei as center. + if (d1 < 0.5 * L) { + split = d1 / L; + // Adjust split if it is close to middle. (2009-02-01) + if ((split > 0.4) || (split < 0.6)) split = 0.5; + } else { + split = 0.5; + } + for (i = 0; i < 3; i++) { + vt[i] = ei[i] + split * (ej[i] - ei[i]); + } + } else { + // Choose ej as center. + if (d2 < 0.5 * L) { + split = d2 / L; + // Adjust split if it is close to middle. (2009-02-01) + if ((split > 0.4) || (split < 0.6)) split = 0.5; + } else { + split = 0.5; + } + for (i = 0; i < 3; i++) { + vt[i] = ej[i] + split * (ei[i] - ej[i]); + } + } + r1count++; + } else { + // Use rule-2. + ek = getsubsegfarorg(sseg); + L = DIST(ek, ej); + d = DIST(ek, refpt); + split = d / L; + for (i = 0; i < 3; i++) { + vt[i] = ek[i] + split * (ej[i] - ek[i]); + } + d1 = DIST(vt, refpt); + d2 = DIST(vt, ej); + if (d1 > d2) { + // Use rule-3. + d3 = DIST(ei, refpt); + if (d1 < 0.5 * d3) { + split = (d - d1) / L; + } else { + split = (d - 0.5 * d3) / L; + } + for (i = 0; i < 3; i++) { + vt[i] = ek[i] + split * (ej[i] - ek[i]); + } + } + d1 > d2 ? r3count++ : r2count++; + } + + if (b->verbose > 1) { + printf(" split (%g), vt (%g, %g, %g).\n", split, vt[0], vt[1], vt[2]); + } +} + +void tetgenmesh::getsegmentsplitpoint3(face* seg, point refpt, REAL* steinpt) +{ + point ei, ej; + REAL Li, Lj, L; + REAL t; + int i; + + ei = sorg(*seg); + ej = sdest(*seg); + + if (b->verbose > 1) { + printf(" Get Steiner point on seg (%d, %d).\n", pointmark(ei), + pointmark(ej)); + } + + if (refpt != NULL) { + // Let ei be the closer one to refpt. + Li = distance(ei, refpt); + Lj = distance(ej, refpt); + if (Li > Lj) { + // Swap ei and ej; + sesymself(*seg); + ei = sorg(*seg); + ej = sdest(*seg); + L = Li; + Li = Lj; + Lj = L; + } + if (pointtype(ei) == ACUTEVERTEX) { + // Cut the segment by a sphere centered at ei with radius Li. + L = distance(ei, ej); + t = Li / L; // t \in (0, 1). + for (i = 0; i < 3; i++) { + steinpt[i] = ei[i] + t * (ej[i] - ei[i]); + } + // Re-use Li and Lj; + Li = distance(steinpt, refpt); + Lj = distance(steinpt, ej); + if (Li > Lj) { + // Avoid to create a very short edge at ej. + t = 0.5; + for (i = 0; i < 3; i++) { + steinpt[i] = ei[i] + t * (ej[i] - ei[i]); + } + r3count++; + } else { + r2count++; + } + } else { + // Cut the segment by the projection point of refpt. + projpt2edge(refpt, ei, ej, steinpt); + // Only for report. + L = distance(ei, ej); + Li = distance(steinpt, ei); + t = Li / L; + r1count++; + } + } else { + // Split the point at the middle. + t = 0.5; + for (i = 0; i < 3; i++) { + steinpt[i] = ei[i] + t * (ej[i] - ei[i]); + } + r1count++; + } // if (refpt == NULL) + + if (pointtype(steinpt) == UNUSEDVERTEX) { + setpointtype(steinpt, FREESEGVERTEX); + } + + if (b->verbose > 2) { + printf(" Split at t(%g).\n", t); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// delaunizesegments() Recover segments in a Delaunay tetrahedralization. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::delaunizesegments2() +{ + triface searchtet; + face splitsh; + face *psseg, sseg; // *parysh; + point refpt, newpt; + enum interresult dir; + bool visflag; + + if (b->verbose) { + printf(" Delaunizing segments.\n"); + } + + // Loop until 'subsegstack' is empty. + while (subsegstack->objects > 0l) { + // seglist is used as a stack. + subsegstack->objects--; + psseg = (face *) fastlookup(subsegstack, subsegstack->objects); + sseg = *psseg; + + if (!sinfected(sseg)) continue; // Not a missing segment. + suninfect(sseg); + + // Insert the segment. + searchtet.tet = NULL; + dir = scoutsegment2(&sseg, &searchtet, &refpt); + + if (dir != SHAREEDGE) { + // The segment is missing, split it. + spivot(sseg, splitsh); + if (dir != INTERVERT) { + // Create the new point. + makepoint(&newpt); + getsegmentsplitpoint3(&sseg, refpt, newpt); + setpointtype(newpt, FREESEGVERTEX); + setpoint2sh(newpt, sencode(sseg)); + // Split the segment by newpt. + sinsertvertex(newpt, &splitsh, &sseg, true, false); + // Insert newpt into the DT. If 'checksubfaces == 1' the current + // mesh is constrained Delaunay (but may not Delaunay). + visflag = (checksubfaces == 1); + insertvertexbw(newpt, &searchtet, true, visflag, false, false); + } else { + /*if (getpointtype(refpt) != ACUTEVERTEX) { + setpointtype(refpt, RIDGEVERTEX); + } + // Split the segment by refpt. + sinsertvertex(refpt, &splitsh, &sseg, true, false);*/ + printf("Error: Invalid PLC! A point and a segment intersect.\n"); + point pa, pb; + pa = getsubsegfarorg(&sseg); + pb = getsubsegfardest(&sseg); + printf(" Point: %d. Segment: (%d, %d).\n", pointmark(refpt), + pointmark(pa), pointmark(pb)); + terminatetetgen(3); + } + } + } + + if (b->verbose) { + printf(" %ld protecting points.\n", r1count + r2count + r3count); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// scoutsubface() Look for a given subface in the tetrahedralization T. // +// // +// 'ssub' is the subface, denoted as abc. If abc exists in T, it is 'locked' // +// at the place where the two tets sharing at it. // +// // +// 'convexflag' indicates the current mesh is convex (1) or non-convex (0). // +// // +// The returned value indicates one of the following cases: // +// - SHAREFACE, abc exists and is inserted; // +// - TOUCHEDGE, a vertex (the origin of 'searchtet') lies on ab. // +// - EDGETRIINT, all three edges of abc are missing. // +// - ACROSSTET, a tet (in 'searchtet') crosses the facet containg abc. // +// // +// If the retunred value is ACROSSTET, the subface is missing. 'searchtet' // +// returns a tet which shares the same edge as 'pssub'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::scoutsubface(face* pssub, + triface* searchtet, int convexflag) +{ + triface spintet; + face checksh; + point pa, pb, pc, pd; + enum interresult dir; + int hitbdry; + int i; + + if ((searchtet->tet == NULL) || (searchtet->tet == dummytet)) { + // Search an edge of 'ssub' in tetrahedralization. + pssub->shver = 0; + for (i = 0; i < 3; i++) { + pa = sorg(*pssub); + pb = sdest(*pssub); + // Get a tet whose origin is pa. + point2tetorg(pa, *searchtet); + // Search the edge from pa->pb. + dir = finddirection2(searchtet, pb); + if (dir == INTERVERT) { + if (dest(*searchtet) == pb) { + // Found the edge. Break the loop. + break; + } else { + // A vertex lies on the search edge. Return it. + enextself(*searchtet); + return TOUCHEDGE; + } + } else if (dir == BELOWHULL2) { + if (convexflag > 0) { + assert(0); + } + // The domain is non-convex, and we got stucked at a boundary face. + point2tetorg(pa, *searchtet); + dir = finddirection3(searchtet, pb); + if (dir == INTERVERT) { + if (dest(*searchtet) == pb) { + // Found the edge. Break the loop. + break; + } else { + // A vertex lies on the search edge. Return it. + enextself(*searchtet); + return TOUCHEDGE; + } + } + } + senextself(*pssub); + } + if (i == 3) { + // None of the three edges exists. + return EDGETRIINT; // ab intersects the face in 'searchtet'. + } + } else { + // 'searchtet' holds the current edge of 'pssub'. + pa = org(*searchtet); + pb = dest(*searchtet); + } + + pc = sapex(*pssub); + + if (b->verbose > 1) { + printf(" Scout subface (%d, %d, %d) (%ld).\n", pointmark(pa), + pointmark(pb), pointmark(pc), subfacstack->objects); + } + + // Searchtet holds edge pa->pb. Search a face with apex pc. + spintet = *searchtet; + pd = apex(spintet); + hitbdry = 0; + while (1) { + if (pd == pc) { + // Found! Insert the subface. + tspivot(spintet, checksh); // SELF_CHECK + if (checksh.sh == dummysh) { + // Comment: here we know that spintet and pssub refer to the same + // edge and the same DIRECTION: pa->pb. + if ((spintet.ver & 1) == 1) { + // Stay in CCW edge ring. + esymself(spintet); + } + if (sorg(*pssub) != org(spintet)) { + sesymself(*pssub); + } + tsbond(spintet, *pssub); + symself(spintet); + if (spintet.tet != dummytet) { + tspivot(spintet, checksh); // SELF_CHECK + assert(checksh.sh == dummysh); // SELF_CHECK + sesymself(*pssub); + tsbond(spintet, *pssub); + } + return SHAREFACE; + } else { + *searchtet = spintet; + if (checksh.sh != pssub->sh) { + // Another subface is laready inserted. + // Comment: This is possible when there are faked tets. + return COLLISIONFACE; + } else { + // The subface has already been inserted (when you do check). + return SHAREFACE; + } + } + } + if (!fnextself(spintet)) { + hitbdry++; + if (hitbdry == 2) break; + esym(*searchtet, spintet); + if (!fnextself(spintet)) break; + } + pd = apex(spintet); + if (pd == apex(*searchtet)) break; + } + + return INTERTET; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// scoutcrosstet() Scout a tetrahedron across a facet. // +// // +// A subface (abc) of the facet (F) is given in 'pssub', 'searchtet' holds // +// the edge ab, it is the tet starting the search. 'facpoints' contains all // +// points which are co-facet with a, b, and c. // +// // +// The subface (abc) was produced by a 2D CDT algorithm under the Assumption // +// that F is flat. In real data, however, F may not be strictly flat. Hence // +// a tet (abde) that crosses abc may be in one of the two cases: (i) abde // +// intersects F in its interior, or (ii) abde intersects F on its boundary. // +// In case (i) F (or part of it) is missing in DT and needs to be recovered. // +// In (ii) F is not missing, the surface mesh of F needs to be adjusted. // +// // +// This routine distinguishes the two cases by the returned value, which is // +// - INTERTET, if it is case (i), 'searchtet' is abde, d and e lies below // +// and above abc, respectively, neither d nor e is dummypoint; or // +// - INTERFACE, if it is case (ii), 'searchtet' is abde, where the face // +// abd intersects abc, i.e., d is co-facet with abc, e may be co-facet // +// with abc or dummypoint. // +// // +/////////////////////////////////////////////////////////////////////////////// + +enum tetgenmesh::interresult tetgenmesh::scoutcrosstet(face *pssub, + triface* searchtet, arraypool* facpoints) +{ + triface spintet, crossface; + point pa, pb, pc, pd, pe; + REAL ori, ori1, len, n[3]; + REAL r, dr, drmin; + bool cofacetflag; + int hitbdry; + int i; + + if (facpoints != NULL) { + // Infect all vertices of the facet. + for (i = 0; i < (int) facpoints->objects; i++) { + pd = * (point *) fastlookup(facpoints, i); + pinfect(pd); + } + } + + // Search an edge crossing the facet containing abc. + if (searchtet->ver & 01) { + esymself(*searchtet); // Adjust to 0th edge ring. + sesymself(*pssub); + } + + pa = sorg(*pssub); + pb = sdest(*pssub); + pc = sapex(*pssub); + + // 'searchtet' refers to edge pa->pb. + assert(org(*searchtet) == pa); + assert(dest(*searchtet) == pb); + + // Search an apex lies below the subface. Note that such apex may not + // exist which indicates there is a co-facet apex. + cofacetflag = false; + pd = apex(*searchtet); + spintet = *searchtet; + hitbdry = 0; + while (1) { + ori = orient3d(pa, pb, pc, pd); + if ((ori != 0) && pinfected(pd)) { + ori = 0; // Force d be co-facet with abc. + } + if (ori > 0) { + break; // Found a lower point (the apex of spintet). + } + // Go to the next face. + if (!fnextself(spintet)) { + hitbdry++; + if (hitbdry == 2) { + cofacetflag = true; break; // Not found. + } + esym(*searchtet, spintet); + if (!fnextself(spintet)) { + cofacetflag = true; break; // Not found. + } + } + pd = apex(spintet); + if (pd == apex(*searchtet)) { + cofacetflag = true; break; // Not found. + } + } + + if (!cofacetflag) { + if (hitbdry > 0) { + // The edge direction is reversed, which means we have to reverse + // the face rotation direction to find the crossing edge d->e. + esymself(spintet); + } + // Keep the edge a->b be in the CCW edge ring of spintet. + if (spintet.ver & 1) { + symedgeself(spintet); + assert(spintet.tet != dummytet); + } + // Search a tet whose apex->oppo crosses the face [a, b, c]. + // -- spintet is a face [a, b, d]. + // -- the apex (d) of spintet is below [a, b, c]. + while (1) { + pe = oppo(spintet); + ori = orient3d(pa, pb, pc, pe); + if ((ori != 0) && pinfected(pe)) { + ori = 0; // Force it to be a coplanar point. + } + if (ori == 0) { + cofacetflag = true; + break; // Found a co-facet point. + } + if (ori < 0) { + *searchtet = spintet; + break; // Found. edge [d, e]. + } + // Go to the next tet. + tfnextself(spintet); + if (spintet.tet == dummytet) { + cofacetflag = true; + break; // There is a co-facet point. + } + } + // Now if "cofacetflag != true", searchtet contains a cross tet (abde), + // where d and e lie below and above abc, respectively, and + // orient3d(a, b, d, e) < 0. + } + + if (cofacetflag) { + // There are co-facet points. Calculate a point above the subface. + facenormal2(pa, pb, pc, n, 1); + len = sqrt(DOT(n, n)); + n[0] /= len; + n[1] /= len; + n[2] /= len; + len = DIST(pa, pb); + len += DIST(pb, pc); + len += DIST(pc, pa); + len /= 3.0; + dummypoint[0] = pa[0] + len * n[0]; + dummypoint[1] = pa[1] + len * n[1]; + dummypoint[2] = pa[2] + len * n[2]; + // Search a co-facet point d, s.t. (i) [a, b, d] intersects [a, b, c], + // AND (ii) a, b, c, d has the closet circumradius of [a, b, c]. + // NOTE: (ii) is needed since there may be several points satisfy (i). + // For an example, see file2.poly. + circumsphere(pa, pb, pc, NULL, n, &r); + crossface.tet = NULL; + pe = apex(*searchtet); + spintet = *searchtet; + hitbdry = 0; + while (1) { + pd = apex(spintet); + ori = orient3d(pa, pb, pc, pd); + if ((ori == 0) || pinfected(pd)) { + ori1 = orient3d(pa, pb, dummypoint, pd); + if (ori1 > 0) { + // [a, b, d] intersects with [a, b, c]. + if (pinfected(pd)) { + len = DIST(n, pd); + dr = fabs(len - r); + if (crossface.tet == NULL) { + // This is the first cross face. + crossface = spintet; + drmin = dr; + } else { + if (dr < drmin) { + crossface = spintet; + drmin = dr; + } + } + } else { + assert(ori == 0); // SELF_CHECK + // Found a coplanar but not co-facet point (pd). + printf("Error: Invalid PLC! A point and a subface intersect\n"); + // get_origin_facet_corners(pssub, &pa, &pb, &pc); + printf(" Point %d. Subface (#%d) (%d, %d, %d)\n", + pointmark(pd), shellmark(*pssub), pointmark(pa), pointmark(pb), + pointmark(pc)); + terminatetetgen(3); + } + } + } + // Go to the next face. + if (!fnextself(spintet)) { + hitbdry++; + if (hitbdry == 2) break; + esym(*searchtet, spintet); + if (!fnextself(spintet)) break; + } + if (apex(spintet) == pe) { + break; + } + } + if(crossface.tet == NULL) { + assert(crossface.tet != NULL); // Not handled yet. + } + *searchtet = crossface; + dummypoint[0] = dummypoint[1] = dummypoint[2] = 0; + } + + if (cofacetflag) { + if (b->verbose > 1) { + printf(" Found a co-facet face (%d, %d, %d) op (%d).\n", + pointmark(pa), pointmark(pb), pointmark(apex(*searchtet)), + pointmark(oppo(*searchtet))); + } + if (facpoints != NULL) { + // Unmark all facet vertices. + for (i = 0; i < (int) facpoints->objects; i++) { + pd = * (point *) fastlookup(facpoints, i); + puninfect(pd); + } + } + // Comment: Now no vertex is infected. + /*if (getpointtype(apex(*searchtet)) == VOLVERTEX) { + // A vertex lies on the facet. + enext2self(*searchtet); // org(*searchtet) == pd + return TOUCHFACE; + }*/ + return INTERFACE; + } else { + // Return a crossing tet. + if (b->verbose > 1) { + printf(" Found a crossing tet (%d, %d, %d, %d).\n", pointmark(pa), + pointmark(pb), pointmark(apex(*searchtet)), pointmark(pe)); + } + // Comment: if facpoints != NULL, co-facet vertices are stll infected. + // They will be uninfected in formcavity(); + return INTERTET; // abc intersects the volume of 'searchtet'. + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// recoversubfacebyflips() Recover a subface by flips in the surface mesh. // +// // +// A subface [a, b, c] ('pssub') intersects with a face [a, b, d] ('cross- // +// face'), where a, b, c, and d belong to the same facet. It indicates that // +// the face [a, b, d] should appear in the surface mesh. // +// // +// This routine recovers [a, b, d] in the surface mesh through a sequence of // +// 2-to-2 flips. No Steiner points is needed. 'pssub' returns [a, b, d]. // +// // +// If 'facfaces' is not NULL, all flipped subfaces are queued for recovery. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::recoversubfacebyflips(face* pssub, triface* crossface, + arraypool *facfaces) +{ + triface neightet; + face flipfaces[2], *parysh; + face checkseg; + point pa, pb, pc, pd, pe; + REAL ori, len, n[3]; + + // Get the missing subface is [a, b, c]. + pa = sorg(*pssub); + pb = sdest(*pssub); + pc = sapex(*pssub); + + // The crossface is [a, b, d, e]. + // assert(org(*crossface) == pa); + // assert(dest(*crossface) == pb); + pd = apex(*crossface); + pe = dummypoint; // oppo(*crossface); + + if (pe == dummypoint) { + // Calculate a point above the faces. + facenormal2(pa, pb, pd, n, 1); + len = sqrt(DOT(n, n)); + n[0] /= len; + n[1] /= len; + n[2] /= len; + len = DIST(pa, pb); + len += DIST(pb, pd); + len += DIST(pd, pa); + len /= 3.0; + pe[0] = pa[0] + len * n[0]; + pe[1] = pa[1] + len * n[1]; + pe[2] = pa[2] + len * n[2]; + } + + // Adjust face [a, b, c], so that edge [b, c] crosses edge [a, d]. + ori = orient3d(pb, pc, pe, pd); + assert(ori != 0); // SELF_CHECK + + if (ori > 0) { + // Swap a and b. + sesymself(*pssub); + esymself(*crossface); // symedgeself(*crossface); + pa = sorg(*pssub); + pb = sdest(*pssub); + if (pe == dummypoint) { + pe[0] = pe[1] = pe[2] = 0; + } + pe = dummypoint; // oppo(*crossface); + } + + while (1) { + + // Flip edge [b, c] to edge [a, d]. + senext(*pssub, flipfaces[0]); + sspivot(flipfaces[0], checkseg); // SELF_CHECK + assert(checkseg.sh == dummysh); // SELF_CHECK + spivot(flipfaces[0], flipfaces[1]); + + stpivot(flipfaces[1], neightet); + if (neightet.tet != dummytet) { + // A recovered subface, clean sub<==>tet connections. + tsdissolve(neightet); + symself(neightet); + tsdissolve(neightet); + stdissolve(flipfaces[1]); + sesymself(flipfaces[1]); + stdissolve(flipfaces[1]); + sesymself(flipfaces[1]); + // flipfaces[1] refers to edge [b, c] (either b->c or c->b). + } + + flip22sub(&(flipfaces[0]), NULL); + flip22count++; + + // Comment: now flipfaces[0] is [d, a, b], flipfaces[1] is [a, d, c]. + + // Add them into list (make ensure that they must be recovered). + facfaces->newindex((void **) &parysh); + *parysh = flipfaces[0]; + facfaces->newindex((void **) &parysh); + *parysh = flipfaces[1]; + + // Find the edge [a, b]. + senext(flipfaces[0], *pssub); + assert(sorg(*pssub) == pa); // SELF_CHECK + assert(sdest(*pssub) == pb); // SELF_CHECK + + pc = sapex(*pssub); + if (pc == pd) break; + + if (pe == dummypoint) { + // Calculate a point above the faces. + facenormal2(pa, pb, pd, n, 1); + len = sqrt(DOT(n, n)); + n[0] /= len; + n[1] /= len; + n[2] /= len; + len = DIST(pa, pb); + len += DIST(pb, pd); + len += DIST(pd, pa); + len /= 3.0; + pe[0] = pa[0] + len * n[0]; + pe[1] = pa[1] + len * n[1]; + pe[2] = pa[2] + len * n[2]; + } + + while (1) { + ori = orient3d(pb, pc, pe, pd); + assert(ori != 0); // SELF_CHECK + if (ori > 0) { + senext2self(*pssub); + spivotself(*pssub); + if (sorg(*pssub) != pa) sesymself(*pssub); + pb = sdest(*pssub); + pc = sapex(*pssub); + continue; + } + break; + } + } + + if (pe == dummypoint) { + pe[0] = pe[1] = pe[2] = 0; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formcavity() Form the cavity of a missing region. // +// // +// A missing region R is a set of co-facet (co-palanr) subfaces. 'pssub' is // +// a missing subface [a, b, c]. 'crosstets' contains only one tet, [a, b, d, // +// e], where d and e lie below and above [a, b, c], respectively. Other // +// crossing tets are sought from this tet and saved in 'crosstets'. // +// // +// The cavity C is divided into two parts by R,one at top and one at bottom. // +// 'topfaces' and 'botfaces' return the upper and lower boundary faces of C. // +// 'toppoints' contains vertices of 'crosstets' in the top part of C, and so // +// does 'botpoints'. Both 'toppoints' and 'botpoints' contain vertices of R. // +// // +// NOTE: 'toppoints' may contain points which are not vertices of any top // +// faces, and so may 'botpoints'. Such points may belong to other facets and // +// need to be present after the recovery of this cavity (P1029.poly). // +// // +// A pair of boundary faces: 'firsttopface' and 'firstbotface', are saved. // +// They share the same edge in the boundary of the missing region. // +// // +// 'facpoints' contains all vertices of the facet containing R. They are // +// used for searching the crossing tets. On input all vertices are infected. // +// They are uninfected after the cavity is formed. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formcavity(face *pssub, arraypool* crosstets, + arraypool* topfaces, arraypool* botfaces, arraypool* toppoints, + arraypool* botpoints, arraypool* facpoints, arraypool* facfaces) +{ + arraypool *crossedges; + triface *parytet, crosstet, spintet, neightet, faketet; + face neighsh, checksh, *parysh; + face checkseg; + point pa, pb, pc, pf, pg; + point pd, pe; + point *ppt; + // REAL ori; + int i, j; + + // For triangle-edge test. + enum interresult dir; + int types[2], poss[4]; + + // Get the missing subface abc. + pa = sorg(*pssub); + pb = sdest(*pssub); + pc = sapex(*pssub); + + // Comment: Now all facet vertices are infected. + + // Get a crossing tet abde. + parytet = (triface *) fastlookup(crosstets, 0); // face abd. + // The edge de crosses the facet. d lies below abc. + enext2fnext(*parytet, crosstet); + enext2self(crosstet); + esymself(crosstet); // the edge d->e at face [d,e,a] + infect(crosstet); + *parytet = crosstet; // Save it in list. + + // Temporarily re-use 'topfaces' for storing crossing edges. + crossedges = topfaces; + crossedges->newindex((void **) &parytet); + *parytet = crosstet; + + // Collect all crossing tets. Each cross tet is saved in the standard + // form deab, where de is a corrsing edge, orient3d(d,e,a,b) < 0. + // NOTE: hull tets may be collected. See fig/dump-cavity-case2a(b).lua. + // Make sure that neither d nor e is dummypoint. + for (i = 0; i < (int) crossedges->objects; i++) { + crosstet = * (triface *) fastlookup(crossedges, i); + // It may already be tested. + if (!edgemarked(crosstet)) { + // Collect all tets sharing at the edge. + pg = apex(crosstet); + spintet = crosstet; + while (1) { + // Mark this edge as tested. + markedge(spintet); + if (!infected(spintet)) { + infect(spintet); + crosstets->newindex((void **) &parytet); + *parytet = spintet; + } + // Go to the neighbor tet. + tfnextself(spintet); + if (spintet.tet != dummytet) { + // Check the validity of the PLC. + tspivot(spintet, checksh); + if (checksh.sh != dummysh) { + printf("Error: Invalid PLC! Two subfaces intersect.\n"); + printf(" 1st (#%4d): (%d, %d, %d)\n", shellmark(*pssub), + pointmark(pa), pointmark(pb), pointmark(pc)); + printf(" 2nd (#%4d): (%d, %d, %d)\n", shellmark(checksh), + pointmark(sorg(checksh)), pointmark(sdest(checksh)), + pointmark(sapex(checksh))); + terminatetetgen(3); + } + } else { + // Encounter a boundary face. + assert(0); // Not handled yet. + } + if (apex(spintet) == pg) break; + } + // Detect new cross edges. + // Comment: A crossing edge must intersect one missing subface of + // this facet. We do edge-face tests. + pd = org(spintet); + pe = dest(spintet); + while (1) { + // Remember: spintet is edge d->e, d lies below [a, b, c]. + pf = apex(spintet); + // if (pf != dummypoint) { // Do not grab a hull edge. + if (!pinfected(pf)) { + for (j = 0; j < (int) facfaces->objects; j++) { + parysh = (face *) fastlookup(facfaces, j); + pa = sorg(*parysh); + pb = sdest(*parysh); + pc = sapex(*parysh); + // Check if pd->pf crosses the facet. + if (tri_edge_test(pa, pb, pc, pd, pf, NULL, 1, types, poss)) { + dir = (enum interresult) types[0]; + if ((dir == INTEREDGE) || (dir == INTERFACE)) { + // The edge d->f corsses the facet. + enext2fnext(spintet, neightet); + esymself(neightet); // d->f. + // pd must lie below the subface. + break; + } + } + // Check if pe->pf crosses the facet. + if (tri_edge_test(pa, pb, pc, pe, pf, NULL, 1, types, poss)) { + dir = (enum interresult) types[0]; + if ((dir == INTEREDGE) || (dir == INTERFACE)) { + // The edge f->e crosses the face. + enextfnext(spintet, neightet); + esymself(neightet); // f->e. + // pf must lie below the subface. + break; + } + } + } + // There must exist a crossing edge. + assert(j < (int) facfaces->objects); + /*// There exist a crossing edge, either d->f, or f->e. + ori = orient3d(pa, pb, pc, pf); + if (ori == 0) { + printf("Error: Invalid PLC! Point and subface intersect.\n"); + printf(" Point %d, subface (#%4d): (%d, %d, %d)\n", + pointmark(pf), shellmark(*pssub), pointmark(pa), + pointmark(pb), pointmark(pc)); + terminatetetgen(3); + } + if (ori < 0) { + // The edge d->f corsses the facet. + enext2fnext(spintet, neightet); + esymself(neightet); // d->f. + } else { + // The edge f->e crosses the face. + enextfnext(spintet, neightet); + esymself(neightet); // f->e. + } + */ + if (!edgemarked(neightet)) { + // Add a new cross edge. + crossedges->newindex((void **) &parytet); + *parytet = neightet; + } + } + // } + tfnextself(spintet); + if (spintet.tet == dummytet) { + // Encounter a boundary face. + assert(0); // Not handled yet. + } + if (apex(spintet) == pg) break; + } + } + } + + // Unmark all facet vertices. + for (i = 0; i < (int) facpoints->objects; i++) { + ppt = (point *) fastlookup(facpoints, i); + puninfect(*ppt); + } + + // Comments: Now no vertex is marked. Next we will mark vertices which + // belong to the top and bottom boundary faces of the cavity and put + // them in 'toppopints' and 'botpoints', respectively. + + // All cross tets are found. Unmark cross edges. + for (i = 0; i < (int) crossedges->objects; i++) { + crosstet = * (triface *) fastlookup(crossedges, i); + if (edgemarked(crosstet)) { + // Add the vertices of the cross edge [d, e] in lists. It must be + // that d lies below the facet (i.e., its a bottom vertex). + // Note that a cross edge contains no dummypoint. + pf = org(crosstet); + // assert(pf != dummypoint); // SELF_CHECK + if (!pinfected(pf)) { + pinfect(pf); + botpoints->newindex((void **) &ppt); // Add a bottom vertex. + *ppt = pf; + } + pf = dest(crosstet); + // assert(pf != dummypoint); // SELF_CHECK + if (!pinfected(pf)) { + pinfect(pf); + toppoints->newindex((void **) &ppt); // Add a top vertex. + *ppt = pf; + } + // Unmark this edge in all tets containing it. + pg = apex(crosstet); + spintet = crosstet; + while (1) { + assert(edgemarked(spintet)); // SELF_CHECK + unmarkedge(spintet); + tfnextself(spintet); // Go to the neighbor tet. + if (spintet.tet == dummytet) { + assert(0); // Not handled yet. + } + if (apex(spintet) == pg) break; + } + } + } + + if (b->verbose > 1) { + printf(" Formed cavity: %ld (%ld) cross tets (edges).\n", + crosstets->objects, crossedges->objects); + } + crossedges->restart(); + + // Find a pair of cavity boundary faces from the top and bottom sides of + // the facet each, and they share the same edge. Save them in the + // global variables: firsttopface, firstbotface. They will be used in + // fillcavity() for gluing top and bottom new tets. + for (i = 0; i < (int) crosstets->objects; i++) { + crosstet = * (triface *) fastlookup(crosstets, i); + enextfnext(crosstet, spintet); + enextself(spintet); + symedge(spintet, neightet); + // if (!infected(neightet)) { + if ((neightet.tet == dummytet) || !infected(neightet)) { + // A top face. + if (neightet.tet == dummytet) { + // Create a fake tet to hold the boundary face. + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + bond(faketet, spintet); + tspivot(spintet, checksh); + if (checksh.sh != dummysh) { + sesymself(checksh); + tsbond(faketet, checksh); + } + for (j = 0; j < 3; j++) { // Bond segments. + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + firsttopface = faketet; + } else { + firsttopface = neightet; + } + } else { + continue; // Go to the next cross tet. + } + enext2fnext(crosstet, spintet); + enext2self(spintet); + symedge(spintet, neightet); + // if (!infected(neightet)) { + if ((neightet.tet == dummytet) || !infected(neightet)) { + // A bottom face. + if (neightet.tet == dummytet) { + // Create a fake tet to hold the boundary face. + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + bond(spintet, faketet); + tspivot(spintet, checksh); + if (checksh.sh != dummysh) { + sesymself(checksh); + tsbond(faketet, checksh); + } + for (j = 0; j < 3; j++) { // Bond segments. + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + firstbotface = faketet; + } else { + firstbotface = neightet; + } + } else { + continue; + } + break; + } + assert(i < (int) crosstets->objects); // SELF_CHECK + + // Collect the top and bottom faces and the middle vertices. Since all top + // and bottom vertices have been marked in above. Unmarked vertices are + // middle vertices. + // NOTE 1: Hull tets may be collected. Process them as normal one. + // (see fig/dump-cavity-case2.lua.) + // NOTE 2: Some previously recovered subfaces may be completely + // contained in a cavity (see fig/dump-cavity-case6.lua). In such case, + // we create two faked tets to hold this subface, one at each side. + // The faked tets will be removed in fillcavity(). + for (i = 0; i < (int) crosstets->objects; i++) { + crosstet = * (triface *) fastlookup(crosstets, i); + enextfnext(crosstet, spintet); + enextself(spintet); + symedge(spintet, neightet); + // if (!infected(neightet)) { + if ((neightet.tet == dummytet) || !infected(neightet)) { + // A top face. + topfaces->newindex((void **) &parytet); + if (neightet.tet == dummytet) { + // Create a fake tet to hold the boundary face. + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + bond(spintet, faketet); + tspivot(spintet, checksh); + if (checksh.sh != dummysh) { + sesymself(checksh); + tsbond(faketet, checksh); + } + for (j = 0; j < 3; j++) { // Bond segments. + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + *parytet = faketet; + } else { + *parytet = neightet; + } + } else { + if ((neightet.tet != dummytet) && infected(neightet)) { + // Check if this side is a subface. + tspivot(spintet, neighsh); + if (neighsh.sh != dummysh) { + // Found a subface (inside the cavity)! + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + marktest(faketet); // To distinguish it from other faked tets. + sesymself(neighsh); + tsbond(faketet, neighsh); // Let it hold the subface. + for (j = 0; j < 3; j++) { // Bond segments. + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + // Add a top face (at faked tet). + topfaces->newindex((void **) &parytet); + *parytet = faketet; + } + } + } + enext2fnext(crosstet, spintet); + enext2self(spintet); + symedge(spintet, neightet); + // if (!infected(neightet)) { + if ((neightet.tet == dummytet) || !infected(neightet)) { + // A bottom face. + botfaces->newindex((void **) &parytet); + if (neightet.tet == dummytet) { + // Create a fake tet to hold the boundary face. + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + bond(spintet, faketet); + tspivot(spintet, checksh); + if (checksh.sh != dummysh) { + sesymself(checksh); + tsbond(faketet, checksh); + } + for (j = 0; j < 3; j++) { // Bond segments. + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + *parytet = faketet; + } else { + *parytet = neightet; + } + } else { + if ((neightet.tet != dummytet) && infected(neightet)) { + tspivot(spintet, neighsh); + if (neighsh.sh != dummysh) { + // Found a subface (inside the cavity)! + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + marktest(faketet); // To distinguish it from other faked tets. + sesymself(neighsh); + tsbond(faketet, neighsh); // Let it hold the subface. + for (j = 0; j < 3; j++) { // Bond segments. + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + // Add a bottom face (at faked tet). + botfaces->newindex((void **) &parytet); + *parytet = faketet; + } + } + } + // Add middle vertices if there are (skip dummypoint). + pf = org(spintet); + if (!pinfected(pf)) { + // if (pf != dummypoint) { + pinfect(pf); + botpoints->newindex((void **) &ppt); // Add a bottom vertex. + *ppt = pf; + toppoints->newindex((void **) &ppt); // Add a top vertex. + *ppt = pf; + // } + } + pf = dest(spintet); + if (!pinfected(pf)) { + // if (pf != dummypoint) { + pinfect(pf); + botpoints->newindex((void **) &ppt); // Add a bottom vertex. + *ppt = pf; + toppoints->newindex((void **) &ppt); // Add a top vertex. + *ppt = pf; + // } + } + } + + // Unmark all collected top, bottom, and middle vertices. + for (i = 0; i < (int) toppoints->objects; i++) { + ppt = (point *) fastlookup(toppoints, i); + puninfect(*ppt); + } + for (i = 0; i < (int) botpoints->objects; i++) { + ppt = (point *) fastlookup(botpoints, i); + puninfect(*ppt); + } + // Comments: Now no vertex is marked. +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// delaunizecavity() Fill a cavity by Delaunay tetrahedra. // +// // +// The tetrahedralizing cavity is the half (top or bottom part) of the whole // +// cavity. The boundary faces of the half cavity are given in 'cavfaces', // +// the bounday faces of the internal facet are not given. These faces will // +// be recovered later in fillcavity(). // +// // +// This routine first constructs the DT of the vertices by the Bowyer-Watson // +// algorithm. Then it identifies the boundary faces of the cavity in DT. // +// The DT is returned in 'newtets'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::delaunizecavity(arraypool *cavpoints, arraypool *cavfaces, + arraypool *cavshells, arraypool *newtets, arraypool *crosstets, + arraypool *misfaces) +{ + triface *parytet, searchtet, neightet, spintet, *parytet1; + triface newtet, faketet; + face checksh, tmpsh, *parysh; + face checkseg; + point pa, pb, pc, pd, pt[3], *parypt; + // badface *newflipface; + enum interresult dir; + REAL ori; + // int miscount; + int i, j, k; + + if (b->verbose > 1) { + printf(" Delaunizing cavity: %ld points, %ld faces.\n", + cavpoints->objects, cavfaces->objects); + } + + // Get four non-coplanar points (no dummypoint). + parytet = (triface *) fastlookup(cavfaces, 0); + pa = org(*parytet); + pb = dest(*parytet); + pc = apex(*parytet); + pinfect(pa); + pinfect(pb); + pinfect(pc); + pd = NULL; + for (i = 1; i < (int) cavfaces->objects; i++) { + parytet = (triface *) fastlookup(cavfaces, i); + pt[0] = org(*parytet); + pt[1] = dest(*parytet); + pt[2] = apex(*parytet); + for (j = 0; j < 3; j++) { + // if (pt[j] != dummypoint) { // Do not include a hull point. + if (!pinfected(pt[j])) { + ori = orient3d(pa, pb, pc, pt[j]); + if (ori != 0) { + pd = pt[j]; + if (ori > 0) { // Swap pa and pb. + pt[j] = pa; pa = pb; pb = pt[j]; + } + break; + } + } + // } + } + if (pd != NULL) break; + } + assert(i < (int) cavfaces->objects); // SELF_CHECK + pinfect(pd); + + // Create an init DT. + // initialDT(pa, pb, pc, pd); + // Create the initial tet. + maketetrahedron(&newtet); + if (b->verbose > 2) { + printf(" Create the first tet (%d, %d, %d, %d).\n", + pointmark(pa), pointmark(pb), pointmark(pc), pointmark(pd)); + } + setorg(newtet, pa); + setdest(newtet, pb); + setapex(newtet, pc); + setoppo(newtet, pd); + // Update the point-to-tet map. + setpoint2tet(pa, encode(newtet)); + setpoint2tet(pb, encode(newtet)); + setpoint2tet(pc, encode(newtet)); + setpoint2tet(pd, encode(newtet)); + // Bond to 'dummytet' for point location. + dummytet[0] = encode(newtet); + recenttet = newtet; + // At init, all faces of this tet are hull faces. + hullsize = 4; + + for (i = 0; i < (int) cavpoints->objects; i++) { + pt[0] = * (point *) fastlookup(cavpoints, i); + assert(pt[0] != dummypoint); // SELF_CHECK + if (!pinfected(pt[0])) { + searchtet = recenttet; + insertvertexbw(pt[0], &searchtet, true, false, false, false); + } else { + puninfect(pt[0]); // It is already inserted. + } + } + // Comment: All vertices of the cavity are NOT marked. + + while (1) { + + // Identify boundary faces. Remember interior tets. Save missing faces. + // For each identified boundary face in the new DT, we insert a subface + // temporarily at that place. The subface also contains a pointer to + // the adjacent tet outside of the cavity. We save the temp subface + // with its side facing to the interior of the cavity. + for (i = 0; i < (int) cavfaces->objects; i++) { + parytet = (triface *) fastlookup(cavfaces, i); + // Skip an interior face (due to the enlargement of the cavity). + if (infected(*parytet)) continue; + // Choose the CCW edge ring. + parytet->ver = 4; + pt[0] = org(*parytet); + pt[1] = dest(*parytet); + pt[2] = apex(*parytet); + // Create a temp subface. + makeshellface(subfaces, &tmpsh); + // setshvertices(tmpsh, pt[0], pt[1], pt[2]); + setsorg(tmpsh, pt[0]); + setsdest(tmpsh, pt[1]); + setsapex(tmpsh, pt[2]); + // Comment: This side of tmpsh faces to the outside of the cavity. + // Insert tmpsh in DT. + searchtet.tet = NULL; + dir = scoutsubface(&tmpsh, &searchtet, 1); + if (dir == SHAREFACE) { + // Let tmpsh face to the interior tet of the cavity. + if (sorg(tmpsh) == pt[0]) { + sesymself(tmpsh); + } + assert(sorg(tmpsh) == pt[1]); + assert(sdest(tmpsh) == pt[0]); + } else if (dir == COLLISIONFACE) { + // A subface is already inserted. This case can only happen when there + // exist a subface inside the cavity, and two faked tets were created + // for protecting such a subface (see fig/dum-cavity-case6). + assert(oppo(*parytet) == dummypoint); + assert(marktested(*parytet)); + // This subface is redundant. But it is needed here (to remember the + // faked tet and the real subface which is inside the cavity). + if ((searchtet.ver & 01) != 0) esymself(searchtet); + // Adjust the searchtet to edge pt[1]->pt[0]. + if (org(searchtet) != pt[1]) { + symedgeself(searchtet); + assert(org(searchtet) == pt[1]); // SELF_CHECK + } + assert(dest(searchtet) == pt[0]); // SELF_CHECK + // Only connect: tmpsh<--searchtet. So stpivot() works. + sesymself(tmpsh); + tmpsh.sh[6 + EdgeRing(tmpsh.shver)] = (shellface) encode(searchtet); + } else { + if (b->verbose > 1) { + printf(" p:draw_subface(%d, %d, %d) -- %d is missing\n", + pointmark(pt[0]), pointmark(pt[1]), pointmark(pt[2]), i); + } + shellfacedealloc(subfaces, tmpsh.sh); + // Save this face in list. + misfaces->newindex((void **) &parytet1); + *parytet1 = *parytet; + continue; + } + // Remember the boundary tet in tmpsh (use the adjacent subface slot). + tmpsh.sh[0] = (shellface) encode(*parytet); + // Save this subface. + cavshells->newindex((void **) &parysh); + *parysh = tmpsh; + } + + if (misfaces->objects > 0) { + // Removing tempoaray subfaces. + for (i = 0; i < (int) cavshells->objects; i++) { + parysh = (face *) fastlookup(cavshells, i); + stpivot(*parysh, neightet); + tsdissolve(neightet); // Detach it from adj. tets. + symself(neightet); + tsdissolve(neightet); + shellfacedealloc(subfaces, parysh->sh); + } + cavshells->restart(); + + // Infect the points which are of the cavity for detecting new + // cavity point due to the enlargement. + for (i = 0; i < (int) cavpoints->objects; i++) { + pt[0] = * (point *) fastlookup(cavpoints, i); + pinfect(pt[0]); // Mark it as inserted. + } + + // Enlarge the cavity. + for (i = 0; i < (int) misfaces->objects; i++) { + // Get a missing face. + parytet = (triface *) fastlookup(misfaces, i); + if (!infected(*parytet)) { + if (oppo(*parytet) == dummypoint) { + printf("Internal error: A convex hull is missing.\n"); + terminatetetgen(2); + } + // Put it into crossing tet list. + infect(*parytet); + crosstets->newindex((void **) &parytet1); + *parytet1 = *parytet; + // Insert the opposite point if it is not in DT. + pd = oppo(*parytet); + if (!pinfected(pd)) { + if (b->verbose > 1) { + printf(" Insert the opposite point %d.\n", pointmark(pd)); + } + pinfect(pd); + cavpoints->newindex((void **) &parypt); + *parypt = pd; + searchtet = recenttet; + insertvertexbw(pd, &searchtet, true, false, false, false); + } + // Check for a missing subface. + tspivot(*parytet, checksh); + if (checksh.sh != dummysh) { + if (b->verbose > 1) { + printf(" Queue a subface x%lx (%d, %d, %d).\n", + (unsigned long) checksh.sh, pointmark(sorg(checksh)), + pointmark(sdest(checksh)), pointmark(sapex(checksh))); + } + stdissolve(checksh); + sesymself(checksh); + stdissolve(checksh); + subfacstack->newindex((void **) &parysh); + *parysh = checksh; + } + // Add three opposite faces into the boundary list. + for (j = 0; j < 3; j++) { + fnext(*parytet, spintet); + symedge(spintet, neightet); + if ((neightet.tet == dummytet) || !infected(neightet)) { + if (b->verbose > 1) { + printf(" Add a cavface (%d, %d, %d).\n", + pointmark(org(spintet)), pointmark(dest(spintet)), + pointmark(apex(spintet))); + } + cavfaces->newindex((void **) &parytet1); + if (neightet.tet == dummytet) { + maketetrahedron(&faketet); // Create a faked tet. + setorg(faketet, org(spintet)); + setdest(faketet, dest(spintet)); + setapex(faketet, apex(spintet)); + setoppo(faketet, dummypoint); + bond(spintet, faketet); + tspivot(spintet, checksh); + if (checksh.sh != dummysh) { + sesymself(checksh); + tspivot(faketet, checksh); + } + for (k = 0; k < 3; k++) { + tsspivot1(spintet, checkseg); + if (checkseg.sh != dummysh) { + tssbond1(faketet, checkseg); + } + enextself(spintet); + enextself(faketet); + } + *parytet1 = faketet; + } else { + *parytet1 = neightet; + } + } else { + // Check if a subface is missing again. + tspivot(neightet, checksh); + if (checksh.sh != dummysh) { + if (b->verbose > 1) { + printf(" Queue a subface x%lx (%d, %d, %d).\n", + (unsigned long) checksh.sh, pointmark(sorg(checksh)), + pointmark(sdest(checksh)), pointmark(sapex(checksh))); + } + stdissolve(checksh); + sesymself(checksh); + stdissolve(checksh); + subfacstack->newindex((void **) &parysh); + *parysh = checksh; + } + } + enextself(*parytet); + } // j + } // if (!infected(parytet)) + } + + // Uninfect the points which are of the cavity. + for (i = 0; i < (int) cavpoints->objects; i++) { + pt[0] = * (point *) fastlookup(cavpoints, i); + puninfect(pt[0]); + } + + misfaces->restart(); + cavityexpcount++; + continue; + } + + break; + + } // while (1) + + // Collect all tets of the DT. All new tets are marktested. + marktest(recenttet); + newtets->newindex((void **) &parytet); + *parytet = recenttet; + for (i = 0; i < (int) newtets->objects; i++) { + searchtet = * (triface *) fastlookup(newtets, i); + for (searchtet.loc = 0; searchtet.loc < 4; searchtet.loc++) { + sym(searchtet, neightet); + if (neightet.tet != dummytet) { + if (!marktested(neightet)) { + marktest(neightet); + newtets->newindex((void **) &parytet); + *parytet = neightet; + } + } + } + } + + cavpoints->restart(); + // Comment: Now no vertex is marked. + cavfaces->restart(); + + if (cavshells->objects > (long) maxcavsize) { + maxcavsize = cavshells->objects; + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// fillcavity() Fill new tets into the cavity. // +// // +// The new tets are stored in two disjoint sets(which share the same facet). // +// 'topfaces' and 'botfaces' are the boundaries of these two sets, respect- // +// ively. 'midfaces' is empty on input, and will store faces in the facet. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::fillcavity(arraypool* topshells, arraypool* botshells, + arraypool* midfaces, arraypool* facpoints) +{ + arraypool *cavshells; + triface *parytet, bdrytet, toptet, bottet, neightet, midface, spintet; + face checksh, *parysh; + face checkseg; + point pa, pb, pc, pf, pg; + REAL ori, len, n[3]; + bool mflag, bflag; + int i, j, k; + + // Connect newtets to tets outside the cavity. + for (k = 0; k < 2; k++) { + cavshells = (k == 0 ? topshells : botshells); + if (cavshells != NULL) { + for (i = 0; i < (int) cavshells->objects; i++) { + // Get a temp subface. + parysh = (face *) fastlookup(cavshells, i); + // Get the boundary tet outsode the cavity. + decode(parysh->sh[0], bdrytet); + pa = sorg(*parysh); + pb = sdest(*parysh); + // Fix bdrytet at the edge pb->pa. + bdrytet.ver = 0; + for (j = 0; j < 3; j++) { + if (org(bdrytet) == pb) break; + enextself(bdrytet); + } + assert(j < 3); + assert(dest(bdrytet) == pa); + // pa = org(bdrytet); + // pb = dest(bdrytet); + pc = apex(bdrytet); + // Get the adjacent new tet which is in the cavity. + stpivot(*parysh, neightet); + // Fix neightet at the edge pa->pb. + neightet.ver = 0; + for (j = 0; j < 3; j++) { + if (org(neightet) == pa) break; + enextself(neightet); + } + assert(j < 3); + assert(dest(neightet) == pb); // SELF_CHECK + // Mark neightet as an interior tet of this cavity, 2009-04-24. + if (!infected(neightet)) { + infect(neightet); + } + // Comment: bdrytet may be a faked tet, Bond it if it is not + // marktested, i.e., it is not created for holding an interor + // subface. The connections will be used in fillcavity for + // finding middle faces. + if (!marktested(bdrytet)) { + // Bond the two tets. + bond(bdrytet, neightet); + // } else { + // A new boundary face. + // dummytet[0] = encode(neightet); + } + // Bond a subface (if it exists). + tspivot(bdrytet, checksh); + if (checksh.sh != dummysh) { + sesymself(checksh); + tsbond(neightet, checksh); // Also cleared the pointer to tmpsh. + } else { + tsdissolve(neightet); // No subface, clear the pointer to tmpsh. + } + // Bond subsegments + for (j = 0; j < 3; j++) { + tsspivot1(bdrytet, checkseg); + if (checkseg.sh != dummysh) { + spintet = neightet; + while (1) { + tssbond1(spintet, checkseg); + tfnextself(spintet); + if (spintet.tet == dummytet) break; // Outside the cavity. + if (!marktested(spintet)) break; // Outside the cavity. + if (spintet.tet == neightet.tet) break; // Turn back. + } + } + enextself(bdrytet); + enext2self(neightet); + } + // Update the point-to-tets map. + setpoint2tet(pa, encode(neightet)); + setpoint2tet(pb, encode(neightet)); + setpoint2tet(pc, encode(neightet)); + // Delete the temp subface. + // shellfacedealloc(subfacepool, parysh->sh); + // if (oppo(bdrytet) == dummypoint) { + // Delete a faked tet. + // tetrahedrondealloc(bdrytet.tet); + // } + } + } // if (cavshells != NULL) + } + + mflag = true; // Initialize it. + + if (midfaces != NULL) { + + // Mark all facet vertices for finding middle subfaces. + for (i = 0; i < (int) facpoints->objects; i++) { + pf = * (point *) fastlookup(facpoints, i); + pinfect(pf); + } + + // The first pair of top and bottom tets share the same edge [a, b]. + // toptet = * (triface *) fastlookup(topfaces, 0); + if (infected(firsttopface)) { + // The cavity was enlarged. This tet is included in the interior + // (as those of a crossing tet). Find the updated top boundary face + // by rotating the faces around this edge (until an uninfect tet). + pa = apex(firsttopface); + while (1) { + tfnextself(firsttopface); + assert(firsttopface.tet != dummytet); + if (!infected(firsttopface)) break; + assert(apex(firsttopface) != pa); // SELF_CHECK + } + } + toptet = firsttopface; + symedgeself(toptet); + assert(marktested(toptet)); // It must be a new tet. + // Search a subface from the top mesh. + while (1) { + fnextself(toptet); // The next face in the same tet. + pc = apex(toptet); + if (pinfected(pc)) break; // [a,b,c] is a subface. + symedgeself(toptet); // Go to the same face in the adjacent tet. + assert(toptet.tet != dummytet); + } + // Search the subface [a,b,c] in the bottom mesh. + // bottet = * (triface *) fastlookup(botfaces, 0); + if (infected(firstbotface)) { + pa = apex(firstbotface); + while (1) { + tfnextself(firstbotface); + assert(firstbotface.tet != dummytet); + if (!infected(firstbotface)) break; + assert(apex(firstbotface) != pa); // SELF_CHECK + } + } + bottet = firstbotface; + symedgeself(bottet); + assert(marktested(bottet)); // It must be a new tet. + while (1) { + fnextself(bottet); // The next face in the same tet. + pf = apex(bottet); + if (pf == pc) break; // Face matched. + if (pinfected(pf)) { + mflag = false; break; // Not matched. + } + symedgeself(bottet); + assert(bottet.tet != dummytet); + } + if (mflag) { + // Connect the two tets together. + bond(toptet, bottet); + // Both are interior tets. + infect(toptet); + infect(bottet); + // Add this face into search list. + // esymself(toptet); // Choose the 0th edge ring. + markface(toptet); + midfaces->newindex((void **) &parytet); + *parytet = toptet; + } + + // Match pairs of subfaces (middle faces), connect top and bottom tets. + for (i = 0; i < (int) midfaces->objects && mflag; i++) { + // Get a matched middle face [a, b, c] + midface = * (triface *) fastlookup(midfaces, i); + // It is inside the cavity. + assert(marktested(midface)); // SELF_CHECK + // Check the neighbors at edges [b, c] and [c, a]. + midface.ver = 0; + for (j = 0; j < 3 && mflag; j++) { + pg = apex(midface); + toptet = midface; + bflag = false; + while (1) { + // Go to the next face in the same tet. + fnextself(toptet); + pc = apex(toptet); + if (pinfected(pc)) { + break; // Find a subface. + } + // if (pc == dummypoint) { + // break; // Find a subface. + // } + /* if (pc == pg) { + // The adjacent face is not a middle face. + bflag = true; break; + }*/ + symedgeself(toptet); + assert(toptet.tet != dummytet); // The adjacent tet must exist. + // Do we walk outside the cavity? + if (!marktested(toptet)) { + // Yes, the adjacent face is not a middle face. + bflag = true; break; + } + } + if (!bflag) { + // assert(marktested(toptet)); // SELF_CHECK + if (!facemarked(toptet)) { + symedge(midface, bottet); + while (1) { + fnextself(bottet); + pf = apex(bottet); + if (pf == pc) break; // Face matched. + if (pinfected(pf)) { + mflag = false; break; // Not matched. + } + symedgeself(bottet); + assert(bottet.tet != dummytet); // The adjacent tet must exist. + } + if (mflag) { + if (marktested(bottet)) { + // Connect two tets together. + bond(toptet, bottet); + // Both are interior tets. + infect(toptet); + infect(bottet); + // Add this face into list. + // esymself(toptet); + markface(toptet); + midfaces->newindex((void **) &parytet); + *parytet = toptet; + } else { + // The 'bottet' is not inside the cavity! + // This case can happen when the cavity was enlarged, and the + // 'toptet' is a co-facet (sub)face adjacent to the missing + // region, and it is a boundary face of the top cavity. + // So the toptet and bottet should be bonded already through + // a temp subface. See fig/dump-cavity-case18. Check it. + symedge(toptet, neightet); + assert(neightet.tet == bottet.tet); // SELF_CHECK + assert(neightet.loc == bottet.loc); // SELF_CHECK + // Do not add this face into 'midfaces'. + } + } + } + } + enextself(midface); // Go to the next edge. + } // j + } // i + + } // if (midfaces != NULL) + + if (mflag) { + if (midfaces != NULL) { + if (b->verbose > 1) { + printf(" Found %ld middle subfaces.\n", midfaces->objects); + } + if (midfaces->objects > (long) maxregionsize) { + maxregionsize = (long) midfaces->objects; + } + // Unmark middle faces. + for (i = 0; i < (int) midfaces->objects; i++) { + // Get a matched middle face [a, b, c] + midface = * (triface *) fastlookup(midfaces, i); + assert(facemarked(midface)); // SELF_CHECK + unmarkface(midface); + } + } + } else { + // Faces at top and bottom are not matched. There exists non-Delaunay + // subedges. See fig/dump-cavity-case5.lua. + pa = org(toptet); + pb = dest(toptet); + pc = apex(toptet); + pf = apex(bottet); + if (0) { // if (b->verbose > 1) { + printf(" p:draw_tet(%d, %d, %d, %d) -- top tet.\n", pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(oppo(toptet))); + printf(" p:draw_tet(%d, %d, %d, %d) -- bot tet.\n", + pointmark(org(bottet)), pointmark(dest(bottet)), + pointmark(apex(bottet)), pointmark(oppo(bottet))); + } + // Calculate a point above the faces. + facenormal2(pa, pb, pc, n, 1); + len = sqrt(DOT(n, n)); + n[0] /= len; + n[1] /= len; + n[2] /= len; + len = DIST(pa, pb); + len += DIST(pb, pc); + len += DIST(pc, pa); + len /= 3.0; + dummypoint[0] = pa[0] + len * n[0]; + dummypoint[1] = pa[1] + len * n[1]; + dummypoint[2] = pa[2] + len * n[2]; + // Find the crossing edges. + ori = orient3d(pb, pc, dummypoint, pf); + assert(ori != 0); // SELF_CHECK + if (ori < 0) { + // The top edge [b, c] intersects the bot edge [a, f]. + enextself(toptet); + enextself(bottet); + } else { + // The top edge [c, a] intersects the bot edge [f, b]. + enext2self(toptet); + enext2self(bottet); + } + // Split one of the edges, choose the one has longer length. + n[0] = DIST(org(toptet), dest(toptet)); + n[1] = DIST(org(bottet), dest(bottet)); + if (n[0] > n[1]) { + pf = org(toptet); + pg = dest(toptet); + } else { + pf = org(bottet); + pg = dest(bottet); + } + if (b->verbose > 1) { + printf(" Found a non-Delaunay edge (%d, %d)\n", pointmark(pf), + pointmark(pg)); + } + // Create the midpoint of the non-Delaunay edge. + for (i = 0; i < 3; i++) { + dummypoint[i] = 0.5 * (pf[i] + pg[i]); + } + // Set a tet for searching the new point. + recenttet = firsttopface; + // dummypoint[0] = dummypoint[1] = dummypoint[2] = 0; + ndelaunayedgecount++; + } + + if (facpoints != NULL) { + // Unmark all facet vertices. + for (i = 0; i < (int) facpoints->objects; i++) { + pf = * (point *) fastlookup(facpoints, i); + puninfect(pf); + } + } + + // Delete the temp subfaces and faked tets. + for (k = 0; k < 2; k++) { + cavshells = (k == 0 ? topshells : botshells); + if (cavshells != NULL) { + for (i = 0; i < (int) cavshells->objects; i++) { + parysh = (face *) fastlookup(cavshells, i); + decode(parysh->sh[0], bdrytet); + if (oppo(bdrytet) == dummypoint) { + sym(bdrytet, neightet); + if (neightet.tet != dummytet) { + // This side is a hull face (not an interior subface). + dissolve(neightet); + dummytet[0] = encode(neightet); + tspivot(neightet, checksh); + if (checksh.sh != dummysh) { + assert(checksh.sh != parysh->sh); + // Dis-coonection tet-subface bond. + sesymself(checksh); + stdissolve(checksh); + } + } + // Delete a faked tet. + tetrahedrondealloc(bdrytet.tet); + } + shellfacedealloc(subfaces, parysh->sh); + } + } + } + + topshells->restart(); + if (botshells != NULL) { + botshells->restart(); + } + if (midfaces != NULL) { + midfaces->restart(); + } + // Comment: Now no vertex is marked. + + return mflag; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// carvecavity() Delete old tets and outer new tets of the cavity. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::carvecavity(arraypool *crosstets, arraypool *topnewtets, + arraypool *botnewtets) +{ + arraypool *newtets; + triface *parytet, *pnewtet, neightet; + face checkseg; //, *parysh; + // int hitbdry; + int i, j, k; + + /*// NOTE: Some subsegments may contained inside the cavity. They must be + // queued for recovery. See fig/dump-cavity-case20. + for (i = 0; i < (int) crosstets->objects; i++) { + parytet = (triface *) fastlookup(crosstets, i); + assert(infected(*parytet)); // SELF_CHECK + if (parytet->tet[8] != NULL) { + for (j = 0; j < 6; j++) { + parytet->loc = edge2locver[j][0]; + parytet->ver = edge2locver[j][1]; + tsspivot1(*parytet, checkseg); + if (checkseg.sh != dummysh) { + if (!sinfected(checkseg)) { + // It is not queued yet. + neightet = *parytet; + hitbdry = 0; + while (1) { + tfnextself(neightet); + if (neightet.tet == dummytet) { + hitbdry++; + if (hitbdry == 2) break; + esym(*parytet, neightet); + tfnextself(neightet); + if (neightet.tet == dummytet) break; + } + if (!infected(neightet)) break; + if (apex(neightet) == apex(*parytet)) break; + } + if (infected(neightet)) { + if (b->verbose > 1) { + printf(" Queue a missing segment (%d, %d).\n", + pointmark(sorg(checkseg)), pointmark(sdest(checkseg))); + } + sinfect(checkseg); + subsegstack->newindex((void **) &parysh); + *parysh = checkseg; + } + } + } + } + } + }*/ + + // Delete the old tets in cavity. + for (i = 0; i < (int) crosstets->objects; i++) { + parytet = (triface *) fastlookup(crosstets, i); + tetrahedrondealloc(parytet->tet); + } + crosstets->restart(); // crosstets will be re-used. + + // Collect infected new tets in cavity. + for (k = 0; k < 2; k++) { + newtets = (k == 0 ? topnewtets : botnewtets); + if (newtets != NULL) { + for (i = 0; i < (int) newtets->objects; i++) { + parytet = (triface *) fastlookup(newtets, i); + if (infected(*parytet)) { + crosstets->newindex((void **) &pnewtet); + *pnewtet = *parytet; + } + } + } + } + // Collect all new tets in cavity. + for (i = 0; i < (int) crosstets->objects; i++) { + parytet = (triface *) fastlookup(crosstets, i); + if (i == 0) { + recenttet = *parytet; // Remember a live handle. + } + for (j = 0; j < 4; j++) { + decode(parytet->tet[j], neightet); + if (marktested(neightet)) { // Is it a new tet? + if (!infected(neightet)) { + // Find an interior tet. + assert(neightet.tet != dummytet); // SELF_CHECK + infect(neightet); + crosstets->newindex((void **) &pnewtet); + *pnewtet = neightet; + } + } + } + } + + // Delete outer new tets (those new tets which are not infected). + for (k = 0; k < 2; k++) { + newtets = (k == 0 ? topnewtets : botnewtets); + if (newtets != NULL) { + for (i = 0; i < (int) newtets->objects; i++) { + parytet = (triface *) fastlookup(newtets, i); + if (infected(*parytet)) { + // This is an interior tet. + uninfect(*parytet); + unmarktest(*parytet); + } else { + // An outer tet. Delete it. + tetrahedrondealloc(parytet->tet); + } + } + } + } + + crosstets->restart(); + topnewtets->restart(); + if (botnewtets != NULL) { + botnewtets->restart(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// restorecavity() Reconnect old tets and delete new tets of the cavity. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::restorecavity(arraypool *crosstets, arraypool *topnewtets, + arraypool *botnewtets) +{ + triface *parytet, neightet; + face checksh; + point *ppt; + int i, j; + + // Reconnect crossing tets to cavity boundary. + for (i = 0; i < (int) crosstets->objects; i++) { + parytet = (triface *) fastlookup(crosstets, i); + assert(infected(*parytet)); // SELF_CHECK + if (i == 0) { + recenttet = *parytet; // Remember a live handle. + } + parytet->ver = 0; + for (parytet->loc = 0; parytet->loc < 4; parytet->loc++) { + sym(*parytet, neightet); + // The neighbor may be a deleted faked tet. + if (isdead(&neightet) || (neightet.tet == dummytet)) { + dissolve(*parytet); // Detach a faked tet. + // Remember a boundary tet. + dummytet[0] = encode(*parytet); + } else if (!infected(neightet)) { + bond(*parytet, neightet); + tspivot(*parytet, checksh); + if (checksh.sh != dummysh) { + tsbond(*parytet, checksh); + } + } + } + // Update the point-to-tet map. + parytet->loc = 0; + ppt = (point *) &(parytet->tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(*parytet)); + } + } + + // Uninfect all crossing tets. + for (i = 0; i < (int) crosstets->objects; i++) { + parytet = (triface *) fastlookup(crosstets, i); + uninfect(*parytet); + } + + // Delete new tets. + for (i = 0; i < (int) topnewtets->objects; i++) { + parytet = (triface *) fastlookup(topnewtets, i); + tetrahedrondealloc(parytet->tet); + } + + if (botnewtets != NULL) { + for (i = 0; i < (int) botnewtets->objects; i++) { + parytet = (triface *) fastlookup(botnewtets, i); + tetrahedrondealloc(parytet->tet); + } + } + + crosstets->restart(); + topnewtets->restart(); + if (botnewtets != NULL) { + botnewtets->restart(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splitsubedge() Split a non-Delaunay edge (not a segment) in the // +// surface mesh of a facet. // +// // +// The new point 'newpt' will be inserted in the tetrahedral mesh if it does // +// not cause any existing (sub)segments become non-Delaunay. Otherwise, the // +// new point is not inserted and one of such subsegments will be split. // +// // +// Next,the actual inserted new point is also inserted into the surface mesh.// +// Non-Delaunay segments and newly created subfaces are queued for recovery. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::splitsubedge(point newpt, face *searchsh, arraypool *facfaces, + arraypool *facpoints) +{ + // queue *flipqueue; + triface searchtet; + face splitsh; + face *psseg, sseg; // *parysh; + point pa, pb; + enum locateresult loc; + int s, i; + + // Try to insert the point. Do not insert if it will encroach any segment + // (noencsegflag is TRUE). Queue encroacged subfaces. + assert(subsegstack->objects == 0l); // SELF_CHECK + searchtet = recenttet; // Start search it from recentet + // loc = insertvertexbw(newpt, &searchtet, true, true, true, false); + // Always insert this point, missing segments are queued. 2009-06-11. + loc = insertvertexbw(newpt, &searchtet, true, true, false, false); + + if (loc == ENCSEGMENT) { + // Some segments are encroached. Randomly pick one to split. + assert(subsegstack->objects > 0l); + s = randomnation(subsegstack->objects); + psseg = (face *) fastlookup(subsegstack, s); + sseg = *psseg; + pa = sorg(sseg); + pb = sdest(sseg); + for (i = 0; i < 3; i++) newpt[i] = 0.5 * (pa[i] + pb[i]); + setpointtype(newpt, FREESEGVERTEX); + setpoint2sh(newpt, sencode(sseg)); + // Uninfect all queued segments. + for (i = 0; i < (int) subsegstack->objects; i++) { + psseg = (face *) fastlookup(subsegstack, i); + suninfect(*psseg); + } + subsegstack->restart(); // Clear the queue. + // Split the segment. Two subsegments are queued. + sinsertvertex(newpt, searchsh, &sseg, true, false); + // Insert the point. Missing segments are queued. + searchtet = recenttet; // Start search it from recentet + insertvertexbw(newpt, &searchtet, true, true, false, false); + } else { + /*// Calc an above point for point location in surface triangulation. + calculateabovepoint(facpoints, NULL, NULL, NULL); + // Insert the new point on facet. New subfaces are queued for reocvery. + loc = sinsertvertex(newpt, searchsh, NULL, true, false); + if (loc == OUTSIDE) { + assert(0); // Not handled yet. + } + // Clear the above point. + dummypoint[0] = dummypoint[1] = dummypoint[2] = 0; + */ + // Set the abovepoint of f for point location. + abovepoint = facetabovepointarray[shellmark(*searchsh)]; + if (abovepoint == (point) NULL) { + getfacetabovepoint(searchsh); + } + // Insert the new point on facet. New subfaces are queued for reocvery. + loc = sinsertvertex(newpt, searchsh, NULL, true, false); + if (loc == OUTSIDE) { + assert(0); // Not handled yet. + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// constrainedfacets() Recover subfaces saved in 'subfacestack'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::constrainedfacets2() +{ + arraypool *crosstets, *topnewtets, *botnewtets; + arraypool *topfaces, *botfaces, *midfaces; + arraypool *topshells, *botshells, *facfaces; + arraypool *toppoints, *botpoints, *facpoints; + triface *parytet, searchtet, neightet; + face *pssub, ssub, neighsh; + face checkseg; + point *ppt, pt, newpt; + enum interresult dir; + bool success, delaunayflag; + long bakflip22count; + long cavitycount; + int facetcount; + int bakhullsize; + int s, i, j; + + if (b->verbose) { + printf(" Constraining facets.\n"); + } + + // Initialize arrays. + crosstets = new arraypool(sizeof(triface), 10); + topnewtets = new arraypool(sizeof(triface), 10); + botnewtets = new arraypool(sizeof(triface), 10); + topfaces = new arraypool(sizeof(triface), 10); + botfaces = new arraypool(sizeof(triface), 10); + midfaces = new arraypool(sizeof(triface), 10); + toppoints = new arraypool(sizeof(point), 8); + botpoints = new arraypool(sizeof(point), 8); + facpoints = new arraypool(sizeof(point), 8); + facfaces = new arraypool(sizeof(face), 10); + topshells = new arraypool(sizeof(face), 10); + botshells = new arraypool(sizeof(face), 10); + + bakflip22count = flip22count; + cavitycount = 0; + facetcount = 0; + + // Loop until 'subfacstack' is empty. + while (subfacstack->objects > 0l) { + subfacstack->objects--; + pssub = (face *) fastlookup(subfacstack, subfacstack->objects); + ssub = *pssub; + + if (ssub.sh[3] == NULL) continue; // Skip a dead subface. + + stpivot(ssub, neightet); + if (neightet.tet == dummytet) { + sesymself(ssub); + stpivot(ssub, neightet); + } + + if (neightet.tet == dummytet) { + // Find an unrecovered subface. + smarktest(ssub); + facfaces->newindex((void **) &pssub); + *pssub = ssub; + // Get all subfaces and vertices of the same facet. + for (i = 0; i < (int) facfaces->objects; i++) { + ssub = * (face *) fastlookup(facfaces, i); + for (j = 0; j < 3; j++) { + sspivot(ssub, checkseg); + if (checkseg.sh == dummysh) { + spivot(ssub, neighsh); + assert(neighsh.sh != dummysh); // SELF_CHECK + if (!smarktested(neighsh)) { + // It may be already recovered. + stpivot(neighsh, neightet); + if (neightet.tet == dummytet) { + sesymself(neighsh); + stpivot(neighsh, neightet); + } + if (neightet.tet == dummytet) { + // Add it into list. + smarktest(neighsh); + facfaces->newindex((void **) &pssub); + *pssub = neighsh; + } + } + } + pt = sorg(ssub); + if (!pinfected(pt)) { + pinfect(pt); + facpoints->newindex((void **) &ppt); + *ppt = pt; + } + senextself(ssub); + } // j + } // i + // Have found all facet subfaces (vertices). Uninfect them. + for (i = 0; i < (int) facfaces->objects; i++) { + pssub = (face *) fastlookup(facfaces, i); + sunmarktest(*pssub); + } + for (i = 0; i < (int) facpoints->objects; i++) { + ppt = (point *) fastlookup(facpoints, i); + puninfect(*ppt); + } + if (b->verbose > 1) { + printf(" Recover facet #%d: %ld subfaces, %ld vertices.\n", + facetcount + 1, facfaces->objects, facpoints->objects); + } + facetcount++; + + // Loop until 'facfaces' is empty. + while (facfaces->objects > 0l) { + // Get the last subface of this array. + facfaces->objects--; + pssub = (face *) fastlookup(facfaces, facfaces->objects); + ssub = *pssub; + + stpivot(ssub, neightet); + if (neightet.tet == dummytet) { + sesymself(ssub); + stpivot(ssub, neightet); + } + + if (neightet.tet != dummytet) continue; // Not a missing subface. + + // Insert the subface. + searchtet.tet = NULL; + dir = scoutsubface(&ssub, &searchtet, 1); + if (dir == SHAREFACE) continue; // The subface is inserted. + assert(dir != COLLISIONFACE); // SELF_CHECK + + // Not exist. Push the subface back into stack. + s = randomnation(facfaces->objects + 1); + facfaces->newindex((void **) &pssub); + *pssub = * (face *) fastlookup(facfaces, s); + * (face *) fastlookup(facfaces, s) = ssub; + + if (dir == EDGETRIINT) continue; // All three edges are missing. + + // Search for a crossing tet. + dir = scoutcrosstet(&ssub, &searchtet, facpoints); + + if (dir == INTERTET) { + // Recover subfaces by local retetrahedralization. + cavitycount++; + bakhullsize = hullsize; + checksubsegs = checksubfaces = 0; + crosstets->newindex((void **) &parytet); + *parytet = searchtet; + // Form a cavity of crossing tets. + formcavity(&ssub, crosstets, topfaces, botfaces, toppoints, + botpoints, facpoints, facfaces); + delaunayflag = true; + // Tetrahedralize the top part. Re-use 'midfaces'. + success = delaunizecavity(toppoints, topfaces, topshells, + topnewtets, crosstets, midfaces); + if (success) { + // Tetrahedralize the bottom part. Re-use 'midfaces'. + success = delaunizecavity(botpoints, botfaces, botshells, + botnewtets, crosstets, midfaces); + if (success) { + // Fill the cavity with new tets. + success = fillcavity(topshells, botshells, midfaces, facpoints); + if (success) { + // Delete old tets and outer new tets. + carvecavity(crosstets, topnewtets, botnewtets); + } + } else { + delaunayflag = false; + } + } else { + delaunayflag = false; + } + if (!success) { + // Restore old tets and delete new tets. + restorecavity(crosstets, topnewtets, botnewtets); + } + /*if (!delaunayflag) { + dump_facetof(&ssub, "facet1.lua"); + while (futureflip != NULL) { + formedgecavity(futureflip->forg, futureflip->fdest, crosstets, + topfaces, toppoints); + crosstets->restart(); + topfaces->restart(); + toppoints->restart(); + futureflip = futureflip->nextitem; + } + flippool->restart(); + outnodes(0); + checkmesh(); + checkshells(1); + assert(0); // Stop the program. + }*/ + hullsize = bakhullsize; + checksubsegs = checksubfaces = 1; + } else if (dir == INTERFACE) { + // Recover subfaces by flipping edges in surface mesh. + recoversubfacebyflips(&ssub, &searchtet, facfaces); + success = true; + } else { // dir == TOUCHFACE + assert(0); + } + if (!success) break; + } // while + + if (facfaces->objects > 0l) { + // Found a non-Delaunay edge, split it (or a segment close to it). + // Create a new point at the middle of this edge, its coordinates + // were saved in dummypoint in 'fillcavity()'. + makepoint(&newpt); + for (i = 0; i < 3; i++) newpt[i] = dummypoint[i]; + setpointtype(newpt, FREESUBVERTEX); + setpoint2sh(newpt, sencode(ssub)); + dummypoint[0] = dummypoint[1] = dummypoint[2] = 0; + // Insert the new point. Starting search it from 'ssub'. + splitsubedge(newpt, &ssub, facfaces, facpoints); + facfaces->restart(); + } + // Clear the list of facet vertices. + facpoints->restart(); + + // Some subsegments may be queued, recover them. + if (subsegstack->objects > 0l) { + b->verbose--; // Suppress the message output. + delaunizesegments2(); + b->verbose++; + } + // Now the mesh should be constrained Delaunay. + } // if (neightet.tet == NULL) + } + + if (b->verbose) { + printf(" %ld subedge flips.\n", flip22count - bakflip22count); + printf(" %ld cavities remeshed.\n", cavitycount); + } + + // Delete arrays. + delete crosstets; + delete topnewtets; + delete botnewtets; + delete topfaces; + delete botfaces; + delete midfaces; + delete toppoints; + delete botpoints; + delete facpoints; + delete facfaces; + delete topshells; + delete botshells; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// formskeleton() Form a constrained tetrahedralization. // +// // +// The segments and facets of a PLS will be recovered. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::formskeleton(clock_t& tv) +{ + triface searchtet; + face *pssub, ssub; + int s, i; + + if (!b->quiet) { + printf("Recovering boundaries.\n"); + } + + caveshlist = new arraypool(sizeof(face), 10); + caveshbdlist = new arraypool(sizeof(face), 10); + + // Put all segments into the list. + if (b->nojettison == 1) { // '-J' option (for debug) + // The sequential order. + subsegs->traversalinit(); + for (i = 0; i < subsegs->items; i++) { + ssub.sh = shellfacetraverse(subsegs); + sinfect(ssub); // Only save it once. + subsegstack->newindex((void **) &pssub); + *pssub = ssub; + } + } else { + // Randomly order the segments. + subsegs->traversalinit(); + for (i = 0; i < subsegs->items; i++) { + s = randomnation(i + 1); + // Move the s-th seg to the i-th. + subsegstack->newindex((void **) &pssub); + *pssub = * (face *) fastlookup(subsegstack, s); + // Put i-th seg to be the s-th. + ssub.sh = shellfacetraverse(subsegs); + sinfect(ssub); // Only save it once. + pssub = (face *) fastlookup(subsegstack, s); + *pssub = ssub; + } + } + + // Segments will be introduced. + checksubsegs = 1; + // Recover segments. + delaunizesegments2(); + + tv = clock(); + + // Randomly order the subfaces. + subfaces->traversalinit(); + for (i = 0; i < subfaces->items; i++) { + s = randomnation(i + 1); + // Move the s-th subface to the i-th. + subfacstack->newindex((void **) &pssub); + *pssub = * (face *) fastlookup(subfacstack, s); + // Put i-th subface to be the s-th. + ssub.sh = shellfacetraverse(subfaces); + pssub = (face *) fastlookup(subfacstack, s); + *pssub = ssub; + } + + // Subfaces will be introduced. + checksubfaces = 1; + // Recover facets. + constrainedfacets2(); + + delete caveshlist; + delete caveshbdlist; + caveshlist = NULL; + caveshbdlist = NULL; + + // Detach all segments from tets. + tetrahedrons->traversalinit(); + searchtet.tet = tetrahedrontraverse(); + while (searchtet.tet != (tetrahedron *) NULL) { + if (searchtet.tet[8] != NULL) { + for (i = 0; i < 6; i++) { + searchtet.loc = edge2locver[i][0]; + searchtet.ver = edge2locver[i][1]; + tssdissolve1(searchtet); + } + searchtet.tet[8] = NULL; + } + searchtet.tet = tetrahedrontraverse(); + } + // Now no segment is bonded to tets. + checksubsegs = 0; + // Delete the memory. + tet2segpool->restart(); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// infecthull() Virally infect all of the tetrahedra of the convex hull // +// that are not protected by subfaces. Where there are // +// subfaces, set boundary markers as appropriate. // +// // +// Memorypool 'viri' is used to return all the infected tetrahedra. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::infecthull(memorypool *viri) +{ + triface tetloop, tsymtet; + tetrahedron **deadtet; + face hullface; + // point horg, hdest, hapex; + + if (b->verbose > 1) { + printf(" Marking concavities for elimination.\n"); + } + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Is this tetrahedron on the hull? + for (tetloop.loc = 0; tetloop.loc < 4; tetloop.loc++) { + sym(tetloop, tsymtet); + if (tsymtet.tet == dummytet) { + // Is the tetrahedron protected by a subface? + tspivot(tetloop, hullface); + if (hullface.sh == dummysh) { + // The tetrahedron is not protected; infect it. + if (!infected(tetloop)) { + infect(tetloop); + deadtet = (tetrahedron **) viri->alloc(); + *deadtet = tetloop.tet; + break; // Go and get next tet. + } + } else { + // The tetrahedron is protected; set boundary markers if appropriate. + if (shellmark(hullface) == 0) { + setshellmark(hullface, 1); + /* + horg = sorg(hullface); + hdest = sdest(hullface); + hapex = sapex(hullface); + if (pointmark(horg) == 0) { + setpointmark(horg, 1); + } + if (pointmark(hdest) == 0) { + setpointmark(hdest, 1); + } + if (pointmark(hapex) == 0) { + setpointmark(hapex, 1); + } + */ + } + } + } + } + tetloop.tet = tetrahedrontraverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// plague() Spread the virus from all infected tets to any neighbors not // +// protected by subfaces. // +// // +// This routine identifies all the tetrahedra that will die, and marks them // +// as infected. They are marked to ensure that each tetrahedron is added to // +// the virus pool only once, so the procedure will terminate. 'viri' returns // +// all infected tetrahedra which are outside the domian. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::plague(memorypool *viri) +{ + tetrahedron **virusloop; + tetrahedron **deadtet; + triface testtet, neighbor; + face neighsh, testseg; + face spinsh, casingin, casingout; + int firstdadsub; + int i; + + if (b->verbose > 1) { + printf(" Marking neighbors of marked tetrahedra.\n"); + } + firstdadsub = 0; + // Loop through all the infected tetrahedra, spreading the virus to + // their neighbors, then to their neighbors' neighbors. + viri->traversalinit(); + virusloop = (tetrahedron **) viri->traverse(); + while (virusloop != (tetrahedron **) NULL) { + testtet.tet = *virusloop; + // Temporarily uninfect this tetrahedron, not necessary. + uninfect(testtet); + // Check each of the tetrahedron's four neighbors. + for (testtet.loc = 0; testtet.loc < 4; testtet.loc++) { + // Find the neighbor. + sym(testtet, neighbor); + // Check for a shell between the tetrahedron and its neighbor. + tspivot(testtet, neighsh); + // Check if the neighbor is nonexistent or already infected. + if ((neighbor.tet == dummytet) || infected(neighbor)) { + if (neighsh.sh != dummysh) { + // There is a subface separating the tetrahedron from its neighbor, + // but both tetrahedra are dying, so the subface dies too. + // Before deallocte this subface, dissolve the connections between + // other subfaces, subsegments and tetrahedra. + neighsh.shver = 0; + if (!firstdadsub) { + firstdadsub = 1; // Report the problem once. + if (!b->quiet) { + printf("Warning: Detecting an open face (%d, %d, %d).\n", + pointmark(sorg(neighsh)), pointmark(sdest(neighsh)), + pointmark(sapex(neighsh))); + } + } + // For keep the same enext() direction. + findedge(&testtet, sorg(neighsh), sdest(neighsh)); + for (i = 0; i < 3; i++) { + sspivot(neighsh, testseg); + if (testseg.sh != dummysh) { + // A subsegment is found at this side, dissolve this subface + // from the face link of this subsegment. + testseg.shver = 0; + spinsh = neighsh; + if (sorg(spinsh) != sorg(testseg)) { + sesymself(spinsh); + } + spivot(spinsh, casingout); + if ((casingout.sh == spinsh.sh) || (casingout.sh == dummysh)) { + // This is a trivial face link, only 'neighsh' itself, + // the subsegment at this side is also died. + shellfacedealloc(subsegs, testseg.sh); + } else { + spinsh = casingout; + do { + casingin = spinsh; + spivotself(spinsh); + } while (spinsh.sh != neighsh.sh); + // Set the link casingin->casingout. + sbond1(casingin, casingout); + // Bond the subsegment anyway. + ssbond(casingin, testseg); + } + } + senextself(neighsh); + enextself(testtet); + } + if (neighbor.tet != dummytet) { + // Make sure the subface doesn't get deallocated again later + // when the infected neighbor is visited. + tsdissolve(neighbor); + } + // This subface has been separated. + if (in->mesh_dim > 2) { + shellfacedealloc(subfaces, neighsh.sh); + } else { + // Dimension is 2. keep it for output. + // Dissolve tets at both sides of this subface. + stdissolve(neighsh); + sesymself(neighsh); + stdissolve(neighsh); + } + } + } else { // The neighbor exists and is not infected. + if (neighsh.sh == dummysh) { + // There is no subface protecting the neighbor, infect it. + infect(neighbor); + // Ensure that the neighbor's neighbors will be infected. + deadtet = (tetrahedron **) viri->alloc(); + *deadtet = neighbor.tet; + } else { // The neighbor is protected by a subface. + // Remove this tetrahedron from the subface. + stdissolve(neighsh); + // The subface becomes a boundary. Set markers accordingly. + if (shellmark(neighsh) == 0) { + setshellmark(neighsh, 1); + } + // This side becomes hull. Update the handle in dummytet. + dummytet[0] = encode(neighbor); + } + } + } + // Remark the tetrahedron as infected, so it doesn't get added to the + // virus pool again. + infect(testtet); + virusloop = (tetrahedron **) viri->traverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// regionplague() Spread regional attributes and/or volume constraints // +// (from a .poly file) throughout the mesh. // +// // +// This procedure operates in two phases. The first phase spreads an attri- // +// bute and/or a volume constraint through a (facet-bounded) region. The // +// second phase uninfects all infected tetrahedra, returning them to normal. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh:: +regionplague(memorypool *regionviri, REAL attribute, REAL volume) +{ + tetrahedron **virusloop; + tetrahedron **regiontet; + triface testtet, neighbor; + face neighsh; + + if (b->verbose > 1) { + printf(" Marking neighbors of marked tetrahedra.\n"); + } + // Loop through all the infected tetrahedra, spreading the attribute + // and/or volume constraint to their neighbors, then to their neighbors' + // neighbors. + regionviri->traversalinit(); + virusloop = (tetrahedron **) regionviri->traverse(); + while (virusloop != (tetrahedron **) NULL) { + testtet.tet = *virusloop; + // Temporarily uninfect this tetrahedron, not necessary. + uninfect(testtet); + if (b->regionattrib) { + // Set an attribute. + setelemattribute(testtet.tet, in->numberoftetrahedronattributes, + attribute); + } + if (b->varvolume) { + // Set a volume constraint. + setvolumebound(testtet.tet, volume); + } + // Check each of the tetrahedron's four neighbors. + for (testtet.loc = 0; testtet.loc < 4; testtet.loc++) { + // Find the neighbor. + sym(testtet, neighbor); + // Check for a subface between the tetrahedron and its neighbor. + tspivot(testtet, neighsh); + // Make sure the neighbor exists, is not already infected, and + // isn't protected by a subface, or is protected by a nonsolid + // subface. + if ((neighbor.tet != dummytet) && !infected(neighbor) + && (neighsh.sh == dummysh)) { + // Infect the neighbor. + infect(neighbor); + // Ensure that the neighbor's neighbors will be infected. + regiontet = (tetrahedron **) regionviri->alloc(); + *regiontet = neighbor.tet; + } + } + // Remark the tetrahedron as infected, so it doesn't get added to the + // virus pool again. + infect(testtet); + virusloop = (tetrahedron **) regionviri->traverse(); + } + + // Uninfect all tetrahedra. + if (b->verbose > 1) { + printf(" Unmarking marked tetrahedra.\n"); + } + regionviri->traversalinit(); + virusloop = (tetrahedron **) regionviri->traverse(); + while (virusloop != (tetrahedron **) NULL) { + testtet.tet = *virusloop; + uninfect(testtet); + virusloop = (tetrahedron **) regionviri->traverse(); + } + // Empty the virus pool. + regionviri->restart(); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeholetets() Remove tetrahedra which are outside the domain. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::removeholetets(memorypool* viri) +{ + tetrahedron **virusloop; + triface testtet, neighbor; + point checkpt; + int *tetspernodelist; + int i, j; + + if (b->verbose > 1) { + printf(" Deleting marked tetrahedra.\n"); + } + + // Create and initialize 'tetspernodelist'. + tetspernodelist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) tetspernodelist[i] = 0; + + // Loop the tetrahedra list, counter the number of tets sharing each node. + tetrahedrons->traversalinit(); + testtet.tet = tetrahedrontraverse(); + while (testtet.tet != (tetrahedron *) NULL) { + // Increment the number of sharing tets for each endpoint. + for (i = 0; i < 4; i++) { + j = pointmark((point) testtet.tet[4 + i]); + tetspernodelist[j]++; + } + testtet.tet = tetrahedrontraverse(); + } + + viri->traversalinit(); + virusloop = (tetrahedron **) viri->traverse(); + while (virusloop != (tetrahedron **) NULL) { + testtet.tet = *virusloop; + // Record changes in the number of boundary faces, and disconnect + // dead tetrahedra from their neighbors. + for (testtet.loc = 0; testtet.loc < 4; testtet.loc++) { + sym(testtet, neighbor); + if (neighbor.tet == dummytet) { + // There is no neighboring tetrahedron on this face, so this face + // is a boundary face. This tetrahedron is being deleted, so this + // boundary face is deleted. + hullsize--; + } else { + // Disconnect the tetrahedron from its neighbor. + dissolve(neighbor); + // There is a neighboring tetrahedron on this face, so this face + // becomes a boundary face when this tetrahedron is deleted. + hullsize++; + } + } + // Check the four corners of this tet if they're isolated. + for (i = 0; i < 4; i++) { + checkpt = (point) testtet.tet[4 + i]; + j = pointmark(checkpt); + tetspernodelist[j]--; + if (tetspernodelist[j] == 0) { + // If it is added volume vertex or '-j' is not used, delete it. + if ((pointtype(checkpt) == FREEVOLVERTEX) || !b->nojettison) { + setpointtype(checkpt, UNUSEDVERTEX); + unuverts++; + } + } + } + // Return the dead tetrahedron to the pool of tetrahedra. + tetrahedrondealloc(testtet.tet); + virusloop = (tetrahedron **) viri->traverse(); + } + + delete [] tetspernodelist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// assignregionattribs() Assign each tetrahedron a region number. // +// // +// This routine is called when '-AA' switch is specified. Every tetrahedron // +// of a (bounded) region will get a integer number to that region. Default, // +// regions are numbered as 1, 2, 3, etc. However, if a number has already // +// been used (set by user in the region section in .poly or .smesh), it is // +// skipped and the next available number will be used. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::assignregionattribs() +{ + list *regionnumlist; + list *regiontetlist; + triface tetloop, regiontet, neightet; + face checksh; + bool flag; + int regionnum, num; + int attridx, count; + int i; + + if (b->verbose > 1) { + printf(" Assign region numbers.\n"); + } + + regionnumlist = new list(sizeof(int), NULL, 256); + regiontetlist = new list(sizeof(triface), NULL, 1024); + attridx = in->numberoftetrahedronattributes; + + // Loop through all tets. Infect tets which already have a region number, + // and save the used numbers in 'regionnumlist'. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + if (!infected(tetloop)) { + regionnum = (int) elemattribute(tetloop.tet, attridx); + if (regionnum != 0.0) { + // Found a numbered region tet. + infect(tetloop); + regiontetlist->append(&tetloop); + // Found and infect all tets in this region. + for (i = 0; i < regiontetlist->len(); i++) { + regiontet = * (triface *)(* regiontetlist)[i]; + for (regiontet.loc = 0; regiontet.loc < 4; regiontet.loc++) { + // Is there a boundary face? + tspivot(regiontet, checksh); + if (checksh.sh == dummysh) { + sym(regiontet, neightet); + if ((neightet.tet != dummytet) && !infected(neightet)) { +#ifdef SELF_CHECK + // neightet should have the same region number. Check it. + num = (int) elemattribute(neightet.tet, attridx); + assert(num == regionnum); +#endif + infect(neightet); + regiontetlist->append(&neightet); + } + } + } + } + // Add regionnum to list if it is not exist. + flag = false; + for (i = 0; i < regionnumlist->len() && !flag; i++) { + num = * (int *)(* regionnumlist)[i]; + flag = (num == regionnum); + } + if (!flag) regionnumlist->append(®ionnum); + // Clear list for the next region. + regiontetlist->clear(); + } + } + tetloop.tet = tetrahedrontraverse(); + } + + if (b->verbose) { + printf(" %d user-specified regions.\n", regionnumlist->len()); + } + + // Now loop the tets again. Assign region numbers to uninfected tets. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + regionnum = 1; // Start region number. + count = 0; + while (tetloop.tet != (tetrahedron *) NULL) { + if (!infected(tetloop)) { + // An unassigned region tet. + count++; + do { + flag = false; + // Check if the region number has been used. + for (i = 0; i < regionnumlist->len() && !flag; i++) { + num = * (int *)(* regionnumlist)[i]; + flag = (num == regionnum); + } + if (flag) regionnum++; + } while (flag); + setelemattribute(tetloop.tet, attridx, (REAL) regionnum); + infect(tetloop); + regiontetlist->append(&tetloop); + // Found and infect all tets in this region. + for (i = 0; i < regiontetlist->len(); i++) { + regiontet = * (triface *)(* regiontetlist)[i]; + for (regiontet.loc = 0; regiontet.loc < 4; regiontet.loc++) { + // Is there a boundary face? + tspivot(regiontet, checksh); + if (checksh.sh == dummysh) { + sym(regiontet, neightet); + if ((neightet.tet != dummytet) && !infected(neightet)) { +#ifdef SELF_CHECK + // neightet should have not been assigned yet. Check it. + num = (int) elemattribute(neightet.tet, attridx); + assert(num == 0); +#endif + setelemattribute(neightet.tet, attridx, (REAL) regionnum); + infect(neightet); + regiontetlist->append(&neightet); + } + } + } + } + regiontetlist->clear(); + regionnum++; // The next region number. + } + tetloop.tet = tetrahedrontraverse(); + } + + // Uninfect all tets. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { +#ifdef SELF_CHECK + assert(infected(tetloop)); +#endif + uninfect(tetloop); + tetloop.tet = tetrahedrontraverse(); + } + + if (b->verbose) { + printf(" %d regions are numbered.\n", count); + } + + delete regionnumlist; + delete regiontetlist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// carveholes() Find the holes and infect them. Find the volume // +// constraints and infect them. Infect the convex hull. // +// Spread the infection and kill tetrahedra. Spread the // +// volume constraints. // +// // +// This routine mainly calls other routines to carry out all these functions.// +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::carveholes() +{ + memorypool *holeviri, *regionviri; + tetrahedron *tptr, **holetet, **regiontet; + triface searchtet, *holetets, *regiontets; + enum locateresult intersect; + int i; + + if (!b->quiet) { + printf("Removing exterior tetrahedra.\n"); + if ((b->verbose > 1) && (in->numberofholes > 0)) { + printf(" Marking holes for elimination.\n"); + } + } + + // Initialize a pool of viri to be used for holes, concavities. + holeviri = new memorypool(sizeof(tetrahedron *), 1024, POINTER, 0); + // Mark as infected any unprotected tetrahedra on the boundary. + infecthull(holeviri); + + if (in->numberofholes > 0) { + // Allocate storage for the tetrahedra in which hole points fall. + holetets = (triface *) new triface[in->numberofholes]; + // Infect each tetrahedron in which a hole lies. + for (i = 0; i < 3 * in->numberofholes; i += 3) { + // Ignore holes that aren't within the bounds of the mesh. + if ((in->holelist[i] >= xmin) && (in->holelist[i] <= xmax) + && (in->holelist[i + 1] >= ymin) + && (in->holelist[i + 1] <= ymax) + && (in->holelist[i + 2] >= zmin) + && (in->holelist[i + 2] <= zmax)) { + searchtet.tet = dummytet; + // Find a tetrahedron that contains the hole. + intersect = locate(&in->holelist[i], &searchtet); + if ((intersect != OUTSIDE) && (!infected(searchtet))) { + // Record the tetrahedron for processing carve hole. + holetets[i / 3] = searchtet; + } + } + } + // Infect the hole tetrahedron. This is done by marking the tet as + // infected and including the tetrahedron in the virus pool. + for (i = 0; i < in->numberofholes; i++) { + infect(holetets[i]); + holetet = (tetrahedron **) holeviri->alloc(); + *holetet = holetets[i].tet; + } + // Free up memory. + delete [] holetets; + } + + // Mark as infected all tets of the holes and concavities. + plague(holeviri); + // The virus pool contains all outside tets now. + + // Is -A switch in use. + if (b->regionattrib) { + // Assign every tetrahedron a regional attribute of zero. + tetrahedrons->traversalinit(); + tptr = tetrahedrontraverse(); + while (tptr != (tetrahedron *) NULL) { + setelemattribute(tptr, in->numberoftetrahedronattributes, 0.0); + tptr = tetrahedrontraverse(); + } + } + + if (in->numberofregions > 0) { + if (b->verbose > 1) { + if (b->regionattrib) { + if (b->varvolume) { + printf("Spreading regional attributes and volume constraints.\n"); + } else { + printf("Spreading regional attributes.\n"); + } + } else { + printf("Spreading regional volume constraints.\n"); + } + } + // Allocate storage for the tetrahedra in which region points fall. + regiontets = (triface *) new triface[in->numberofregions]; + // Find the starting tetrahedron for each region. + for (i = 0; i < in->numberofregions; i++) { + regiontets[i].tet = dummytet; + // Ignore region points that aren't within the bounds of the mesh. + if ((in->regionlist[5 * i] >= xmin) + && (in->regionlist[5 * i] <= xmax) + && (in->regionlist[5 * i + 1] >= ymin) + && (in->regionlist[5 * i + 1] <= ymax) + && (in->regionlist[5 * i + 2] >= zmin) + && (in->regionlist[5 * i + 2] <= zmax)) { + searchtet.tet = dummytet; + // Find a tetrahedron that contains the region point. + intersect = locate(&in->regionlist[5 * i], &searchtet); + if ((intersect != OUTSIDE) && (!infected(searchtet))) { + // Record the tetrahedron for processing after the + // holes have been carved. + regiontets[i] = searchtet; + } + } + } + // Initialize a pool to be used for regional attrs, and/or regional + // volume constraints. + regionviri = new memorypool(sizeof(tetrahedron *), 1024, POINTER, 0); + // Find and set all regions. + for (i = 0; i < in->numberofregions; i++) { + if (regiontets[i].tet != dummytet) { + // Make sure the tetrahedron under consideration still exists. + // It may have been eaten by the virus. + if (!isdead(&(regiontets[i]))) { + // Put one tetrahedron in the virus pool. + infect(regiontets[i]); + regiontet = (tetrahedron **) regionviri->alloc(); + *regiontet = regiontets[i].tet; + // Apply one region's attribute and/or volume constraint. + regionplague(regionviri, in->regionlist[5 * i + 3], + in->regionlist[5 * i + 4]); + // The virus pool should be empty now. + } + } + } + // Free up memory. + delete [] regiontets; + delete regionviri; + } + + // Now acutually remove the outside and hole tets. + removeholetets(holeviri); + // The mesh is nonconvex now. + nonconvex = 1; + + // Update the point-to-tet map. + makepoint2tetmap(); + + if (b->regionattrib) { + if (b->regionattrib > 1) { + // -AA switch. Assign each tet a region number (> 0). + assignregionattribs(); + } + // Note the fact that each tetrahedron has an additional attribute. + in->numberoftetrahedronattributes++; + } + + // Free up memory. + delete holeviri; +} + +//// //// +//// //// +//// constrained_cxx ////////////////////////////////////////////////////////// + +//// steiner_cxx ////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// initializecavity() Initialize the cavity. // +// // +// A cavity C is bounded by a list of faces, called fronts. Each front f is // +// hold by a tet t adjacent to C, t is not in C (uninfected). If f is a hull // +// face, t does't exist, a fake tet t' is created to hold f. t' has the same // +// vertices as f but no opposite. t' will be removed automatically after C // +// is filled with new tets (by carvecavity()). // +// // +// The faces of C are given in two lists. 'floorlist' is a set of subfaces, // +// each subface has been oriented to face to the inside of C. 'ceillist' is // +// a set of tetrahedral faces. 'frontlist' returns the initialized fronts. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::initializecavity(list* floorlist, list* ceillist, + list* frontlist, list *ptlist, list* glueshlist) +{ + triface neightet, casingtet; + triface faketet; + face worksh; + point *ppt; + int i, j; + + // Infect all points of the re-triangulated cavity. + for (i = 0; i < ptlist->len(); i++) { + ppt = (point *)(* ptlist)[i]; + pinfect(*ppt); + } + + // Initialize subfaces of C. + for (i = 0; i < floorlist->len(); i++) { + // Get a subface s. + worksh = * (face *)(* floorlist)[i]; +#ifdef SELF_CHECK + // Current side of s should be empty. + stpivot(worksh, neightet); + assert(neightet.tet == dummytet); +#endif + // Do not insert it if some of its vertices are not in Mesh. + ppt = (point *) &(worksh.sh[3]); + for (j = 0; j < 3; j++) { + if (!pinfected(ppt[j])) break; + } + if (j < 3) { + // Found a subface lies outside the cavity. See an example in + // dump-SteinerRemoval-case2.lua. + // Add this subface in glueshlist (to process it later). + glueshlist->append(&worksh); + // Do not add this face into frontlist. + continue; + } + // Get the adjacent tet t. + sesymself(worksh); + stpivot(worksh, casingtet); + // Does t exist? + if (casingtet.tet == dummytet) { + // Create a fake tet t' to hold f temporarily. + maketetrahedron(&faketet); + setorg(faketet, sorg(worksh)); + setdest(faketet, sdest(worksh)); + setapex(faketet, sapex(worksh)); + setoppo(faketet, (point) NULL); // Indicates it is 'fake'. + tsbond(faketet, worksh); + frontlist->append(&faketet); + } else { + frontlist->append(&casingtet); + } + } + // Initialize tet faces of C. + for (i = 0; i < ceillist->len(); i++) { + // Get a tet face c. + neightet = * (triface *) (* ceillist)[i]; +#ifdef SELF_CHECK + // The tet of c must be inside C (going to be deleted). + assert(infected(neightet)); +#endif + // Get the adjacent tet t. + sym(neightet, casingtet); + // Does t exist? + if (casingtet.tet == dummytet) { + // No. Create a fake tet t' to hold f temporarily. + maketetrahedron(&faketet); + // Be sure that the vertices of t' are CCW oriented. + adjustedgering(neightet, CW); // CW edge ring. + setorg(faketet, org(neightet)); + setdest(faketet, dest(neightet)); + setapex(faketet, apex(neightet)); + setoppo(faketet, (point) NULL); // Indicates it is 'fake'. + // Bond t' to a subface if it exists. + tspivot(neightet, worksh); + if (worksh.sh != dummysh) { + sesymself(worksh); + tsbond(faketet, worksh); + } + // Bond c <--> t'. So we're able to find t' and remove it. + bond(faketet, neightet); + // c may become uninfected due to the bond(). + infect(neightet); + frontlist->append(&faketet); + } else { + frontlist->append(&casingtet); + } + } + + // Uninfect all points of the re-triangulated cavity. + for (i = 0; i < ptlist->len(); i++) { + ppt = (point *)(* ptlist)[i]; + puninfect(*ppt); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// delaunizecavvertices() Form a DT of the vertices of a cavity. // +// // +// 'floorptlist' and 'ceilptlist' are the vertices of the cavity. // +// // +// The tets of the DT are created directly in the pool 'tetrahedrons', i.e., // +// no auxiliary data structure and memory are required. The trick is at the // +// time they're created, there are no connections between them to the other // +// tets in the pool. You can imagine they form an ioslated island. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::delaunizecavvertices(triface* oldtet, list* floorptlist, + list* ceilptlist, list* newtetlist, queue* flipque) +{ + point *insertarray; + triface bakhulltet, newtet; + long bakhullsize; + long arraysize; + bool success; + int bakchksub; + int i, j; + + // Prepare the array of points for inserting. + arraysize = floorptlist->len(); + if (ceilptlist != (list *) NULL) { + arraysize += ceilptlist->len(); + } + insertarray = new point[arraysize]; + for (i = 0; i < floorptlist->len(); i++) { + insertarray[i] = * (point *)(* floorptlist)[i]; + } + if (ceilptlist != (list *) NULL) { + for (j = 0; j < ceilptlist->len(); j++) { + insertarray[i + j] = * (point *)(* ceilptlist)[j]; + } + } + + // The incrflipdelaunay() is re-used. Backup global variables. + decode(dummytet[0], bakhulltet); + bakhullsize = hullsize; + bakchksub = checksubfaces; + checksubfaces = 0; + b->verbose--; + + // Form the DT by incremental flip Delaunay algorithm. Do not jump for + // point location, do not merge points. + success = incrflipdelaunay(oldtet, insertarray, arraysize, false, false, + 0.0, flipque); + + delete [] insertarray; + + if (success) { + // Get a tet in D. + decode(dummytet[0], newtet); + newtetlist->append(&newtet); + // Get all tets of D. + retrievenewtets(newtetlist); + } + + // Restore global variables. + dummytet[0] = encode(bakhulltet); + hullsize = bakhullsize; + checksubfaces = bakchksub; + b->verbose++; + + return success; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// retrievenewtets() Retrieve the newly created tets. // +// // +// On input, 'newtetlist' contains at least one alive new tet. From this tet,// +// other new tets can be found by a broadth-first searching. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::retrievenewtets(list* newtetlist) +{ + triface searchtet, casingtet; + int i; + + // There may be dead tets due to flip32(). Delete them first. + for (i = 0; i < newtetlist->len(); i++) { + searchtet = * (triface *)(* newtetlist)[i]; + if (isdead(&searchtet)) { + newtetlist->del(i, 0); i--; + continue; + } + infect(searchtet); + } + // It is possible that all tets are deleted. Check it. 2009-07-27. + if (newtetlist->len() == 0) { + // We must add a live tet to the list for the retrieving. + decode(dummytet[0], searchtet); + assert(searchtet.tet != dummytet); + assert(!isdead(&searchtet)); + infect(searchtet); + newtetlist->append(&searchtet); + } + // Find all new tets. + for (i = 0; i < newtetlist->len(); i++) { + searchtet = * (triface *)(* newtetlist)[i]; + for (searchtet.loc = 0; searchtet.loc < 4; searchtet.loc++) { + sym(searchtet, casingtet); + if ((casingtet.tet != dummytet) && !infected(casingtet)) { + infect(casingtet); + newtetlist->append(&casingtet); + } + } + } + // Uninfect new tets. + for (i = 0; i < newtetlist->len(); i++) { + searchtet = * (triface *)(* newtetlist)[i]; + uninfect(searchtet); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// insertauxsubface() Fix an auxilary subface in place. // +// // +// An auxilary subface s is fixed in D as it is a real subface, but s has no // +// vertices and neighbors. It has two uses: (1) it protects an identfied // +// front f in D; (2) it serves the link to bond a tet in C and f later. The // +// first neighbor of s (s->sh[0]) stores a pointer to f. // +// // +// 'front' is a front f of C. idfront' t is a tet in D where f is identified // +// be a face of it. s will be fixed between t and its neighbor. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::insertauxsubface(triface* front, triface* idfront) +{ + triface neightet; + face auxsh; + + // Create the aux subface s. + makeshellface(subfaces, &auxsh); + // Bond s <--> t. + tsbond(*idfront, auxsh); + // Does t's neighbor n exist? + sym(*idfront, neightet); + if (neightet.tet != dummytet) { + // Bond s <--> n. + sesymself(auxsh); + tsbond(neightet, auxsh); + } + // Let s remember f. + auxsh.sh[0] = (shellface) encode(*front); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// scoutfront() Scout a face in D. // +// // +// Search a 'front' f in D. If f is found, return TRUE and the face of D is // +// returned in 'idfront'. Otherwise, return FALSE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::scoutfront(triface* front, triface* idfront) +{ + triface spintet; + face checksh; // For debug. + point pa, pb, pc; + enum finddirectionresult col; + int hitbdry; + + // Let the front we're searching is abc. + pa = org(*front); + pb = dest(*front); + + point2tetorg(pa, *idfront); + assert(org(*idfront) == pa); + recenttet = *idfront; + + // Search a tet having edge ab. + col = finddirection(idfront, pb, tetrahedrons->items); + if (col == RIGHTCOLLINEAR) { + // b is just the destination. + } else if (col == LEFTCOLLINEAR) { + enext2self(*idfront); + esymself(*idfront); + } else if (col == TOPCOLLINEAR) { + fnextself(*idfront); + enext2self(*idfront); + esymself(*idfront); + } else if (col == BELOWHULL) { + // This front must be a dangling subface outside the cavity. + // See an example in dump-SteinerRemoval-case2.lua. + assert(0); + } + + if (dest(*idfront) == pb) { + // Search a tet having face abc + pc = apex(*front); + spintet = *idfront; + hitbdry = 0; + do { + if (apex(spintet) == pc) { + // Found abc. Insert an auxilary subface s at idfront. + // insertauxsubface(front, &spintet); + *idfront = spintet; + return true; + } + if (!fnextself(spintet)) { + hitbdry ++; + if (hitbdry < 2) { + esym(*idfront, spintet); + if (!fnextself(spintet)) { + hitbdry ++; + } + } + } + if (apex(spintet) == apex(*idfront)) break; + } while (hitbdry < 2); + } + + // f is missing in D. + if (b->verbose > 1) { + printf(" Front (%d, %d, %d) is missing.\n", pointmark(pa), + pointmark(pb), pointmark(apex(*front))); + } + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// gluefronts() Glue two fronts together. // +// // +// This is a support routine for identifyfront(). Two fronts f and f1 are // +// found indentical. This is caused by the non-coplanarity of vertices of a // +// facet. Hence f and f1 are a subface and a tet. They are not fronts of the // +// cavity anymore. This routine glues f and f1 together. // +// // +// A tet containing this front and not in the cavity is added into 'gluetet- // +// list' (either f or f1). It will be used to maintain the point-to-tet map. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::gluefronts(triface* front, triface* front1, list* gluetetlist, + list *glueshlist) +{ + face consh; + + // Glue f and f1 together. There're four cases: + // (1) both f and f1 are not fake; + // (2) f is not fake, f1 is fake; + // (3) f is fake and f1 is not fake; + // (4) both f and f1 are fake. + // Case (4) should be not possible. + + // Is there a concrete subface c at f. + tspivot(*front, consh); + if (consh.sh != dummysh) { + sesymself(consh); + tsbond(*front1, consh); // Bond: f1 <--> c. + sesymself(consh); + // Save this subface if it is not a temp subface. In case the mesh cavity + // fails, we need to restore the original state. + if (!isdead(&consh)) { + // Save this subface into list. + glueshlist->append(&consh); + } + } + // Does f hold by a fake tet. + if (oppo(*front) == (point) NULL) { + // f is fake. Case (3) or (4). + assert(oppo(*front1) != (point) NULL); // Eliminate (4). + // Case (3). + if (consh.sh != dummysh) { + stdissolve(consh); // Dissolve: c -x-> f. + } + // Dealloc f. + tetrahedrondealloc(front->tet); + // f1 becomes a hull. let 'dummytet' bond to it. + dummytet[0] = encode(*front1); + } else { + // Case (1) or (2). + bond(*front, *front1); // Bond f1 <--> f. + // Add f into list. + gluetetlist->append(front); + } + // Is f a fake tet? + if (!isdead(front)) { + // No. Check for case (2). + tspivot(*front1, consh); + // Is f1 fake? + if (oppo(*front1) == (point) NULL) { + // Case (2) or (4) + assert(oppo(*front) != (point) NULL); // Eliminate (4). + // Case (2). + if (consh.sh != dummysh) { + stdissolve(consh); // Dissolve: c -x-> f1. + sesymself(consh); // Bond: f <--> c. + tsbond(*front, consh); + // Save this subface if it is not a temp subface. In case the mesh + // cavity fails, we need to restore the original state. + if (!isdead(&consh)) { + // Save this subface into list. + glueshlist->append(&consh); + } + } + // Dissolve: f -x->f1. + dissolve(*front); + // Dealloc f1. + tetrahedrondealloc(front1->tet); + // f becomes a hull. let 'dummytet' bond to it. + dummytet[0] = encode(*front); + } else { + // Case (1). + if (consh.sh != dummysh) { + sesymself(consh); + tsbond(*front, consh); // Bond: f <--> c. + // Save this subface if it is not a temp subface. In case the mesh + // cavity fails, we need to restore the original state. + if (!isdead(&consh)) { + // Save this subface into list. + glueshlist->append(&consh); + } + } + // Add f1 into list. + gluetetlist->append(front1); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// identifyfronts() Identify cavity faces in D. // +// // +// 'frontlist' are fronts of C need indentfying. This routine searches each // +// front f in D. Once f is found, an auxilary subface s is inserted in D at // +// the face. If f is not found in D, remove it from frontlist and save it in // +// 'misfrontlist'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::identifyfronts(list* frontlist, list* misfrontlist, + list* gluetetlist, list* glueshlist) +{ + triface front, front1, tfront; + triface idfront, neightet; + face auxsh, checksh; + int len, i, j; + + misfrontlist->clear(); + + // Identify all fronts in D. + for (i = 0; i < frontlist->len(); i++) { + // Get a front f. + front = * (triface *)( *frontlist)[i]; + if (scoutfront(&front, &idfront)) { + // Found f. Insert an aux subface s. + tspivot(idfront, auxsh); + if (auxsh.sh != dummysh) { // Does s already exist? + // There're two identical fronts, f (front) and f1 (s.sh[0])! + decode((tetrahedron) auxsh.sh[0], front1); + assert((front1.tet != dummytet) && !infected(front1)); + // Detach s in D. + tsdissolve(idfront); + sym(idfront, neightet); + if (neightet.tet != dummytet) { + tsdissolve(neightet); + } + // s has fulfilled its duty. Can be deleted. + shellfacedealloc(subfaces, auxsh.sh); + // Remove f from frontlist. + frontlist->del(i, 1); i--; + // Remove f1 from frontlist. + len = frontlist->len(); + for (j = 0; j < frontlist->len(); j++) { + tfront = * (triface *)(* frontlist)[j]; + if ((tfront.tet == front1.tet) && (tfront.loc == front1.loc)) { + // Found f1 in list. Check f1 != f. + assert((tfront.tet != front.tet) || (tfront.loc != front.loc)); + frontlist->del(j, 1); i--; + break; + } + } + assert((frontlist->len() + 1) == len); + // Glue f and f1 together. + gluefronts(&front, &front1, gluetetlist, glueshlist); + } else { + // Insert an aux subface to protect f in D. + insertauxsubface(&front, &idfront); + } + } else { + // f is missing. + frontlist->del(i, 1); i--; + // Are there two identical fronts, f (front) and f1 (front1)? + for (j = 0; j < misfrontlist->len(); j++) { + front1 = * (triface *)(* misfrontlist)[j]; + if (isfacehaspoint(&front1, org(front)) && + isfacehaspoint(&front1, dest(front)) && + isfacehaspoint(&front1, apex(front))) break; + } + if (j < misfrontlist->len()) { + // Found an identical front f1. Remove f1 from the list. + misfrontlist->del(j, 1); + // Glue f and f1 together. + gluefronts(&front, &front1, gluetetlist, glueshlist); + } else { + // Add f into misfrontlist. + misfrontlist->append(&front); + } + } + } + return misfrontlist->len() == 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// detachauxsubfaces() Detach auxilary subfaces in D. // +// // +// This is a reverse routine of identifyfronts(). Some fronts are missing in // +// D. C can not be easily tetrahedralized. It needs remediation (expansion, // +// or constrained flips, or adding a Steiner point). This routine detaches // +// the auxilary subfaces have been inserted in D and delete them. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::detachauxsubfaces(list* newtetlist) +{ + triface newtet, neightet; + face auxsh; + int i; + + for (i = 0; i < newtetlist->len(); i++) { + // Get a new tet t. + newtet = * (triface *)(* newtetlist)[i]; + // t may e dead due to flips. + if (isdead(&newtet)) continue; + assert(!infected(newtet)); + // Check the four faces of t. + for (newtet.loc = 0; newtet.loc < 4; newtet.loc++) { + tspivot(newtet, auxsh); + if (auxsh.sh != dummysh) { + // An auxilary subface s. + assert(sorg(auxsh) == (point) NULL); + tsdissolve(newtet); // t -x-> s. + sym(newtet, neightet); + if (neightet.tet != dummytet) { + assert(!isdead(&neightet)); + tsdissolve(neightet); // n -x-> s. + } + // Delete s. + shellfacedealloc(subfaces, auxsh.sh); + } + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// carvecavity() Remove redundant (outside) tetrahedra from D. // +// // +// The fronts of C have been identified in D. Hence C can be tetrahedralized // +// by removing the tets outside C. The CDT is then updated by filling C with // +// the remaining tets (inside C) of D. // +// // +// Each front is protected by an auxilary subface s in D. s has a pointer to // +// f (s.sh[0]). f can be used to classified the in- and out- tets of C (the // +// CW orientation of f faces to the inside of C). The classified out-tets of // +// C are marked (infected) for removing. // +// // +// Notice that the out-tets may not only the tets on the CH of C, but also // +// tets completely inside D, eg., there is a "hole" in D. Such tets must be // +// marked during classification. The hole tets are poped up and removed too. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::carvecavity(list* newtetlist, list* outtetlist, + list* gluetetlist, queue* flipque) +{ + triface newtet, neightet, front, intet, outtet, oldtet; + face auxsh, consh; + point pa, pb, pc; + point pointptr; + REAL ori; + bool success; + int i; + + // Clear work list. + outtetlist->clear(); + success = true; + + // Classify in- and out- tets in D. Mark and queue classified out-tets. + for (i = 0; i < newtetlist->len() && success; i++) { + // Get a new tet t. + newtet = * (triface *)(* newtetlist)[i]; + assert(!isdead(&newtet)); + // Skip an infected tet (it's an out tet). + if (!infected(newtet)) { + // Look for aux subfaces attached at t. + for (newtet.loc = 0; newtet.loc < 4; newtet.loc++) { + tspivot(newtet, auxsh); + if (auxsh.sh != dummysh) { + // Get the front f. + decode((tetrahedron) auxsh.sh[0], front); + // Let f face to the inside of C. + adjustedgering(front, CW); + pa = org(front); + pb = dest(front); + pc = apex(front); + // Has this side a neighbor n? + sym(newtet, neightet); + if ((neightet.tet != dummytet) && !infected(neightet)) { + // Classify t and n (one is "in" and another is "out"). + ori = orient3d(pa, pb, pc, oppo(newtet)); + if (ori == 0.0) { + printf("Internal error at front %d.\n", i); + assert(0); + } + if (ori < 0.0) { + // t is in-tet. n is out-tet. + outtet = neightet; + intet = newtet; + } else { + // n is in-tet. t is out-tet. + outtet = newtet; + intet = neightet; + } + if (!infected(outtet)) { + // Check the special case: if this tet is protected by four + // subfaces, i.e., all 4 faces of this tet are fronts. + // See an example in dbg/dump-SteinerRemoval-case3.lua + neightet = outtet; + for (neightet.loc = 0; neightet.loc < 4; neightet.loc++) { + tspivot(neightet, auxsh); + if (auxsh.sh == dummysh) break; + } + if (neightet.loc < 4) { + // It is an outside tet. Add it into list. + infect(outtet); + outtetlist->append(&outtet); + } + } + } else { + intet = newtet; + } + // Make sure that the intet is not iversed. + ori = orient3d(pa, pb, pc, oppo(intet)); + assert(ori != 0); + if (ori > 0) { + // Found an inversed inside tet. Stop and return. + if (b->verbose > 1) { + printf(" Intet x%lx %d (%d, %d, %d, %d) is iversed.\n", + (unsigned long) intet.tet, intet.loc, pointmark(pa), + pointmark(pb), pointmark(pc), pointmark(oppo(intet))); + } + success = false; + break; + } + } else { + // This side is not protected. Check if it is a hull face. + // Comment: This check is necessary. It is possible that all + // protected subfaces have been moved in 'gluetetlist'. + // If so, without this check, the newtets become orphans + // and remain in the output. 2009-07-29. + sym(newtet, neightet); + if (neightet.tet == dummytet) { + // Found an out tet. + if (!infected(newtet)) { + infect(newtet); + outtetlist->append(&newtet); + } + break; + } + } + } // for (newtet.loc) + } // if (!infected) + } + + if (!success) { + // Found inversed tet. The carvecavity failed. + for (i = 0; i < outtetlist->len(); i++) { + outtet = * (triface *)(* outtetlist)[i]; + uninfect(outtet); + } + outtetlist->clear(); + return false; + } + + // Find and mark all out-tets. + for (i = 0; i < outtetlist->len(); i++) { + outtet = * (triface *)(* outtetlist)[i]; + for (outtet.loc = 0; outtet.loc < 4; outtet.loc++) { + sym(outtet, neightet); + // Does the neighbor exist and unmarked? + if ((neightet.tet != dummytet) && !infected(neightet)) { + // Is it protected by an aux subface? + tspivot(outtet, auxsh); + if (auxsh.sh == dummysh) { + // It's an out-tet. + infect(neightet); + outtetlist->append(&neightet); + } + } + } + } + + // Remove the out- (and hole) tets. + for (i = 0; i < outtetlist->len(); i++) { + // Get an out-tet t. + outtet = * (triface *)(* outtetlist)[i]; + assert(!isdead(&outtet)); + // Detach t from the in-tets. + for (outtet.loc = 0; outtet.loc < 4; outtet.loc++) { + // Is there an aux subface s? + tspivot(outtet, auxsh); + if (auxsh.sh != dummysh) { + // Get the neighbor n. + sym(outtet, neightet); + // assert(!infected(neightet)); // t must be in-tet. + if (infected(neightet)) { + printf("Error: A front face (%d, %d, %d) x%lx got deleted.\n", + pointmark(org(neightet)), pointmark(dest(neightet)), + pointmark(apex(neightet)), (unsigned long) auxsh.sh); + printf(" p:draw_tet(%d, %d, %d, %d) -- in\n", + pointmark(org(neightet)), pointmark(dest(neightet)), + pointmark(apex(neightet)), pointmark(oppo(neightet))); + printf(" p:draw_tet(%d, %d, %d, %d) -- out\n", + pointmark(org(outtet)), pointmark(dest(outtet)), + pointmark(apex(outtet)), pointmark(oppo(outtet))); + assert(0); + } + // Detach n -x-> t. + dissolve(neightet); + } + } + // Dealloc the tet. + tetrahedrondealloc(outtet.tet); + } + + // Connect the in-tets of C to fronts. Remove aux subfaces and fake tets. + for (i = 0; i < newtetlist->len(); i++) { + // Get a new tet t. + newtet = * (triface *)(* newtetlist)[i]; + // t may be an out-tet and has got deleted. + if (isdead(&newtet)) continue; + // t is an in-tet. Look for aux subfaces attached at t. + for (newtet.loc = 0; newtet.loc < 4; newtet.loc++) { + // Is there an aux subface s? + tspivot(newtet, auxsh); + if (auxsh.sh != dummysh) { + // Get the front f. + decode((tetrahedron) auxsh.sh[0], front); + assert((front.tet != dummytet) && !infected(front)); + // s has fulfilled its duty. Can be deleted. + tsdissolve(newtet); // dissolve: t -x-> s. + // Delete s. + shellfacedealloc(subfaces, auxsh.sh); + // Connect the newtet t and front f. + // Is there a concrete subface c at f. + tspivot(front, consh); + if (consh.sh != dummysh) { + sesymself(consh); + // Bond: t <--> c. + tsbond(newtet, consh); + } + // Update point-to-tet map. + pointptr = org(front); + setpoint2tet(pointptr, encode(newtet)); + pointptr = dest(front); + setpoint2tet(pointptr, encode(newtet)); + pointptr = apex(front); + setpoint2tet(pointptr, encode(newtet)); + // Does f hold by a fake tet. + if (oppo(front) == (point) NULL) { + // f is fake. + if (consh.sh != dummysh) { + sesymself(consh); + // Dissolve: c -x-> f. + stdissolve(consh); + } + // Detach the fake tet from its old cavity tet. This is necessary + // in case the mesh of other cavities are failed, and we have to + // restore the original status. 2009-07-24. + sym(front, oldtet); + if (oldtet.tet != dummytet) { + assert(infected(oldtet)); + dissolve(oldtet); + } + // Dealloc f. + tetrahedrondealloc(front.tet); + // f becomes a hull. let 'dummytet' bond to it. + dummytet[0] = encode(newtet); + } else { + // Bond t <--> f. + bond(newtet, front); + } + // t may be non-locally Delaunay and flipable. + if (flipque != (queue *) NULL) { + enqueueflipface(newtet, flipque); + } + } + } + // Let the corners of t2 point to it for fast searching. + pointptr = org(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = dest(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = apex(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = oppo(newtet); + setpoint2tet(pointptr, encode(newtet)); + } + // The cavity has been re-tetrahedralized. + + // Maintain point-to-tet map. + for (i = 0; i < gluetetlist->len(); i++) { + // Get a new tet t. + newtet = * (triface *)(* gluetetlist)[i]; + if (isdead(&newtet)) { + assert(0); + } + pointptr = org(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = dest(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = apex(newtet); + setpoint2tet(pointptr, encode(newtet)); + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// replacepolygonsubs() Substitute the subfaces of a polygon. // +// // +// 'oldshlist' (T_old) contains the old subfaces of P. It will be replaced // +// by 'newshlist' (T_new) of new subfaces. Each boundary edge of P is bonded // +// to 'dummysh' in T_new. // +// // +// Notice that Not every boundary edge of T_new is able to bond to a subface,// +// e.g., when it is a segment recovered by removing a Steiner point in it. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::replacepolygonsubs(list* oldshlist, list* newshlist) +{ + face newsh, oldsh, spinsh; + face casingout, casingin; + face checkseg; + point pa, pb; + int i, j, k, l; + + for (i = 0; i < newshlist->len(); i++) { + // Get a new subface s. + newsh = * (face *)(* newshlist)[i]; + // Check the three edges of s. + for (k = 0; k < 3; k++) { + spivot(newsh, casingout); + // Is it a boundary edge? + if (casingout.sh == dummysh) { + // Find the old subface s_o having the same edge as s. + pa = sorg(newsh); + pb = sdest(newsh); + for (j = 0; j < oldshlist->len(); j++) { + oldsh = * (face *)(* oldshlist)[j]; + for (l = 0; l < 3; l++) { + if (((sorg(oldsh) == pa) && (sdest(oldsh) == pb)) || + ((sorg(oldsh) == pb) && (sdest(oldsh) == pa))) break; + senextself(oldsh); + } + if (l < 3) break; + } + // Is there a matched edge? + if (j < oldshlist->len()) { + // Get the neighbor subface s_out. + spivot(oldsh, casingout); + sspivot(oldsh, checkseg); + if (checkseg.sh != dummysh) { + if (casingout.sh != dummysh) { + if (oldsh.sh == casingout.sh) { + // A subface is self-bounded. Not possible. + assert(0); // DEBUG + } + // A segment. Insert s into the face ring, ie, s_in->s->s_out. + spinsh = casingout; + do { + casingin = spinsh; + spivotself(spinsh); + } while (sapex(spinsh) != sapex(oldsh)); + assert(casingin.sh != oldsh.sh); + // Bond s_in -> s -> s_out (and dissolve s_in -> s_old -> s_out). + sbond1(casingin, newsh); + sbond1(newsh, casingout); + } else { + sbond(newsh, casingout); + } + // Bond the segment. + ssbond(newsh, checkseg); + } else { + // Bond s <-> s_out (and dissolve s_out -> s_old). + sbond(newsh, casingout); + } + // Unbound oldsh to indicate it's neighbor has been replaced. + // It will be used to indentfy the edge in the inverse. + sdissolve(oldsh); + ssdissolve(oldsh); + } + } + // Go to the next edge of s. + senextself(newsh); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// orientnewsubs() Orient new subfaces facing to the inside of cavity. // +// // +// 'newshlist' contains new subfaces of the cavity C (created by re-triangu- // +// lation the polygon P). They're not necessary facing to the inside of C. // +// 'orientsh', faces to the inside of C, is used to adjust new subfaces. The // +// normal of the new subfaces is returned in 'norm'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::orientnewsubs(list* newshlist, face* orientsh, REAL* norm) +{ + face *newsh; + point pa, pb, pc; + REAL ref[3], ori, len, l; + int i; + + // Calculate the normal of 'orientsh'. + pa = sorg(*orientsh); + pb = sdest(*orientsh); + pc = sapex(*orientsh); + // facenormal(pa, pb, pc, norm, &len); + facenormal2(pa, pb, pc, norm, 1); + // for (i = 0; i < 3; i++) ref[i] = pa[i] + norm[i]; + len = sqrt(norm[0]*norm[0]+norm[1]*norm[1]+norm[2]*norm[2]); + for (i = 0; i < 3; i++) norm[i] /= len; + // Get the longest edge length of [a, b, c] + len = distance(pa, pb); + l = distance(pb, pc); + if (len < l) len = l; + l = distance(pc, pa); + if (len < l) len = l; + // Calculate a local above point. + for (i = 0; i < 3; i++) ref[i] = pa[i] + len * norm[i]; + + // Orient new subfaces. Let the normal above each one. + for (i = 0; i < newshlist->len(); i++) { + newsh = (face *)(* newshlist)[i]; + pa = sorg(*newsh); + pb = sdest(*newsh); + pc = sapex(*newsh); + ori = orient3d(pa, pb, pc, ref); + assert(ori != 0.0); + if (ori > 0.0) { + sesymself(*newsh); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// registerelemflip() Register an elementary flip T23, T32, or T22. // +// // +// If return TRUE, the flip is registered, otherwise, return FALSE, which // +// means a conflict, this flip already exists. // +// // +// Depending on the flip type, not all input points are used, those unused // +// points are set to be dummypoint for easily processing. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::registerelemflip(enum fliptype ft, point pa1, point pb1, + point pc1, point pa2, point pb2, point pc2) +{ + elemflip *ef; + bool rflag; + int i; + + rflag = false; // The flip has not registed yet. + + pinfect(pa1); + pinfect(pb1); + pinfect(pc1); + pinfect(pa2); + pinfect(pb2); + pinfect(pc2); + + // Search the list for a registered flip. + for (i = 0; i < (int) elemfliplist->objects; i++) { + ef = (elemflip *) fastlookup(elemfliplist, i); + if (ef->ft == ft) { + rflag = (pinfected(ef->pset1[0]) && pinfected(ef->pset1[1]) && + pinfected(ef->pset1[2])); + if (rflag) { + rflag = (pinfected(ef->pset2[0]) && pinfected(ef->pset2[1]) && + pinfected(ef->pset2[2])); + if (rflag) { + break; // This flip has been registed before. + } + } + } + } + + puninfect(pa1); + puninfect(pb1); + puninfect(pc1); + puninfect(pa2); + puninfect(pb2); + puninfect(pc2); + + if (rflag) { + if (b->verbose > 1) { + printf(" Flip: %s", ft == T23 ? "T23" : (ft == T32 ? "T32" : "T22")); + printf(" (%d, %d, %d) - (%d, %d, %d) is registered.\n", pointmark(pa1), + pointmark(pb1), pointmark(pc1), pointmark(pa2), pointmark(pb2), + pointmark(pc2)); + } + return false; + } + + // Register this flip. + elemfliplist->newindex((void **) &ef); + ef->ft = ft; + ef->pset1[0] = pa1; + ef->pset1[1] = pb1; + ef->pset1[2] = pc1; + ef->pset2[0] = pa2; + ef->pset2[1] = pb2; + ef->pset2[2] = pc2; + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// check4fixededge() Check if the given edge [a, b] is a fixed edge. // +// // +// A fixed edge is saved in the "fixededgelist". Return TRUE if [a, b] has // +// already existed in the list, otherwise, return FALSE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::check4fixededge(point pa, point pb) +{ + point *ppt; + int i; + + pinfect(pa); + pinfect(pb); + + for (i = 0; i < (int) fixededgelist->objects; i++) { + ppt = (point *) fastlookup(fixededgelist, i); + if (pinfected(ppt[0]) && pinfected(ppt[1])) { + if (b->verbose > 1) { + printf(" Edge (%d, %d) is fixed.\n", pointmark(pa), + pointmark(pb)); + } + break; // This edge already exists. + } + } + + puninfect(pa); + puninfect(pb); + + return i < (int) fixededgelist->objects; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeedgebyflips() Remove an edge by flips. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removeedgebyflips(triface* remedge, int *flipcount) +{ + triface abcd; //, badc; // Tet configuration at edge ab. + // triface baccasing, abdcasing; + triface abtetlist[21]; // Old configuration at ab, save maximum 20 tets. + triface bftetlist[21]; // Old configuration at bf, save maximum 20 tets. + triface newtetlist[90]; // New configuration after removing ab. + face checksh; + point pa, pb; + bool remflag, subflag; + int n, n1, m, i; //, j; + + triface newtet; // For update point-to-tet map. + point *ppt; + int j; + + pa = org(*remedge); + pb = dest(*remedge); + + if (b->verbose > 1) { + printf(" Remove edge (%d, %d).\n", pointmark(pa), pointmark(pb)); + } + + // Get the tets configuration at ab. Collect maximum 10 tets. + subflag = false; + abcd = *remedge; + adjustedgering(abcd, CW); + n = 0; + abtetlist[n] = abcd; + do { + // Is the list full? + if (n == 20) break; + // Stop if a subface appears. + tspivot(abtetlist[n], checksh); + if (checksh.sh != dummysh) { + // ab is either a segment or a facet edge. The latter case is not + // handled yet! An edge flip is needed. + if (b->verbose > 1) { + printf(" Can't remove a fixed face (%d, %d, %d).\n", pointmark(pa), + pointmark(pb), pointmark(apex(abtetlist[n]))); + } + subflag = true; break; // return false; + } + // Get the next tet at ab. + if (!fnext(abtetlist[n], abtetlist[n + 1])) { + // This edge is on the hull (2-to-2 flip case). + subflag = true; break; // assert(0); // Not handled yet. + } + n++; + } while (apex(abtetlist[n]) != apex(abcd)); + + if (subflag) { + // The face link contains subfaces, stop. + return false; + } + + // Do not flip this edge if it has been fixed (for recovering a face). + if (check4fixededge(pa, pb)) { + return false; + } + + // 2 < n < 20. + if (n == 3) { + // There are three tets at ab. Try to do a flip32 at ab. + remflag = removeedgebyflip32(NULL, abtetlist, newtetlist, NULL); + } else if ((n > 3) && (n <= b->maxflipedgelinksize)) { + // Four tets case. Try to do edge transformation. + remflag = removeedgebytranNM(NULL,n,abtetlist,newtetlist,NULL,NULL,NULL); + } else { + if (b->verbose > 1) { + printf(" !! Unhandled case: n = %d.\n", n); + } + remflag = false; + } + + if (remflag) { + // Delete the old tets. + for (i = 0; i < n; i++) { + tetrahedrondealloc(abtetlist[i].tet); + } + m = (n - 2) * 2; // The numebr of new tets. + if (b->verbose > 1) { + printf(" Done flip %d-to-%d.\n", n, m); + } + // Update the point-to-tet map + for (i = 0; i < m; i++) { + newtet = newtetlist[i]; + ppt = (point *) &(newtet.tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(newtet)); + } + } + *flipcount = *flipcount + 1; + return true; + } + + if (n <= b->maxflipedgelinksize) { + // Try to do a combination of flips. + n1 = 0; + remflag = removeedgebycombNM(NULL, n, abtetlist, &n1, bftetlist, + newtetlist, NULL); + if (remflag) { + // Delete the old tets. + for (i = 0; i < n; i++) { + tetrahedrondealloc(abtetlist[i].tet); + } + for (i = 0; i < n1; i++) { + if (!isdead(&(bftetlist[i]))) { + tetrahedrondealloc(bftetlist[i].tet); + } + } + m = ((n1 - 2) * 2 - 1) + (n - 3) * 2; // The number of new tets. + if (b->verbose > 1) { + printf(" Done flip %d-to-%d (n-1=%d, n1=%d). ", n+n1-2, m, n-1,n1); + printf("\n"); + } + // Update the point-to-tet map + for (i = 0; i < m; i++) { + newtet = newtetlist[i]; + ppt = (point *) &(newtet.tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(newtet)); + } + } + *flipcount = *flipcount + 1; + return true; + } + } + + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removefacebyflips() Remove a face by a sequence of flips. // +// // +// The face should not be a subface. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removefacebyflips(triface* remface, int *flipcount) +{ + triface neightet, checkface1, checkface2; + face checksh1, checksh2; + point pa, pb, pc, pd, pe; + enum interresult dir; + REAL ori; + int types[2], poss[4]; + int i; + + adjustedgering(*remface, CCW); + sym(*remface, neightet); + if (neightet.tet == dummytet) { + // A boundary face. It is not flipable. + return false; + } + pd = oppo(*remface); + pe = oppo(neightet); + + if (b->verbose > 1) { + printf(" Remove face (%d, %d, %d) %d, %d\n", pointmark(org(*remface)), + pointmark(dest(*remface)), pointmark(apex(*remface)), + pointmark(pd), pointmark(pe)); + } + + // Do not remove this face if it is a fixed face. + tspivot(*remface, checksh1); + if (checksh1.sh != dummysh) { + if (b->verbose > 1) { + printf(" Can't remove a fixed face (%d, %d, %d)\n", + pointmark(org(*remface)), pointmark(dest(*remface)), + pointmark(apex(*remface))); + } + return false; + } + + // Check if edge [d, e] intersects the flip face [a, b, c]. + for (i = 0; i < 3; i++) { + pa = org(*remface); + pb = dest(*remface); + pc = apex(*remface); + ori = orient3d(pa, pb, pd, pe); + if (ori <= 0) break; // Coplanar or Above. + enextself(*remface); + } + + if (i == 3) { + // A 2-to-3 flip is found. + // Regist the flipping face. + if (!registerelemflip(T23, pa, pb, pc, pd, pe, dummypoint)) { + // Detected a potential flip loop. + return false; + } + // Do a 2-to-3 flip. + flip23(remface, NULL); + *flipcount = *flipcount + 1; + return true; + } + + if (ori == 0) { + // Check if [a, b] is a hull edge. If so a flip22() could apply. + fnext(*remface, checkface1); + tspivot(checkface1, checksh1); + symedge(*remface, neightet); + fnext(neightet, checkface2); + tspivot(checkface2, checksh2); + // First check if it is a protected face. + if ((checksh1.sh == dummysh) && (checksh2.sh == dummysh)) { + // Check if it is a hull face. + symself(checkface1); + symself(checkface2); + if ((checkface1.tet == dummytet) && (checkface2.tet == dummytet)) { + // Check if the edge [a, b] intersects [d, e] in its interior. + if (tri_edge_test(pa, pb, pc, pd, pe, NULL, 1, types, poss)) { + dir = (enum interresult) types[0]; + if (dir == INTEREDGE) { + // Edge [d, e] intersects [a, b, c]. A flip 2-to-2 is found. + // Check if the edge [a, b] is a fixed one (for recovering a face). + if (check4fixededge(pa, pb)) { + // [a, b] is a fixed edge. Stop the flip. + return false; + } + // Regist this flip. + if (!registerelemflip(T22, pa, pb, dummypoint, pd, pe, + dummypoint)) { + // Detected a potential flip loop. + return false; + } + // We can flip this edge [a, b]. + flip22(remface, NULL); + *flipcount = *flipcount + 1; + return true; + } else { + // Either a or b is collinear with edge [d, e]. NOT flipable. + assert(dir == INTERVERT); + return false; + } + } else { + // [a,b] does not intersect with [d, e]. Don't do a 2-to-2 flip. + // See an example in dbg/dump-nflip22-case.lua + return false; + } + } + } else { + if (b->verbose > 1) { + printf(" Can't remove a fixed face (%d, %d, %d).\n", pointmark(pa), + pointmark(pb), pointmark(apex(neightet))); + } + return false; + } + } + + // The edge [d, e] does not intersect [a, b, c]. Try to flip edge [a, b]. + // Comment: We've found that the edge [a, b] is locally non-convex. It + // must be an interior edge. + return removeedgebyflips(remface, flipcount); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// recoveredgebyflips() Recover edge [a, b] by a sequence of flips. // +// // +// The edge to be recovered is from a = org(*searchtet) to b. Return TRUE if // +// the edge [a, b] is recovered, and retruned in 'searchtet', otherwise, // +// return FALSE. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::recoveredgebyflips(triface *searchtet,point pb,int *flipcount) +{ + triface remface; + point pa; + enum interresult dir; + bool success; + + pa = org(*searchtet); + + if (b->verbose > 1) { + printf(" Recover edge (%d, %d)\n", pointmark(pa), pointmark(pb)); + } + + assert(elemfliplist->objects == 0l); + + while (1) { + + // Go to the intersected face, try to flip it. + enextfnext(*searchtet, remface); + + // Try to remove this crossing face. + success = removefacebyflips(&remface, flipcount); + if (!success) break; + + point2tetorg(pa, *searchtet); + assert(org(*searchtet) == pa); + dir = finddirection2(searchtet, pb); + if (dir == INTERVERT) { + break; // The edge has found. + } + + } // while (1) + + // Clear the recorded flip list. + elemfliplist->restart(); + + return success; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// recoverfacebyflips() Recover a missing face by a sequence of flips. // +// // +// Assume that at least one of the edges of the face exists in the current // +// mesh. The face is recovered by continusly removing all crossing edges of // +// this face. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::recoverfacebyflips(triface* front, int *flipcount) +{ + triface searchtet, spintet, bdrytet; + triface remedge, remface; + point pa, pb, pc, pd, pe, *ppt; + enum interresult dir; + bool success; + int hitbdry; + int i; + + if (b->verbose > 1) { + printf(" Recover face (%d, %d, %d)\n", pointmark(org(*front)), + pointmark(dest(*front)), pointmark(apex(*front))); + } + + assert(fixededgelist->objects == 0l); + + // First recover three edges of this face. + for (i = 0; i < 3; i++) { + pa = org(*front); + pb = dest(*front); + pc = apex(*front); // The apex. + point2tetorg(pa, searchtet); + assert(org(searchtet) == pa); + dir = finddirection2(&searchtet, pb); + if (dir == BELOWHULL2) { + // Detect an outside front. This happens when a new subface created by + // re-triangulating is actually outside the cavity. The gluefront() + // is not called in this case. There must be an existing face which + // lies outside the cavity that matches this subface. + // An example is dump-SteinerRemoval-case2.lua. 2009-07-06. + // fixededgelist->restart(); + // return false; + assert(0); + } + if (dir != INTERVERT) { + if (!recoveredgebyflips(&searchtet, pb, flipcount)) { + // Failed to recover edge [a, b], so does the face. + fixededgelist->restart(); + return false; + } + } + // DIR == INTERVERT + if (dest(searchtet) != pb) { + // There eixsts a collonear edge but not the desired one. + // Failed to recover edge [a, b], so does the face. + fixededgelist->restart(); + return false; + } + // Save this edge to avoid flipping it away. + fixededgelist->newindex((void **) &ppt); + ppt[0] = pa; + ppt[1] = pb; + // Go to the next edge. + enextself(*front); + } + + assert(elemfliplist->objects == 0l); + + while (1) { + + success = false; + + // Adjust edge [a->b] to be in the CCW edge ring. + adjustedgering(searchtet, CCW); + if (org(searchtet) != pa) { + fnextself(searchtet); + esymself(searchtet); + } + assert(org(searchtet) == pa); + assert(dest(searchtet) == pb); + + spintet = searchtet; + hitbdry = 0; + do { + if (apex(spintet) == pc) { + // Found abc. Insert an auxilary subface s at idfront. + insertauxsubface(front, &spintet); + success = true; + break; // return true; + } + if (!fnextself(spintet)) { + bdrytet = spintet; // Save the boundary face. + hitbdry ++; + if (hitbdry < 2) { + esym(searchtet, spintet); + if (!fnextself(spintet)) { + hitbdry++; + } + } + } + if (apex(spintet) == apex(searchtet)) break; + } while (hitbdry < 2); + + if (success) break; + + if (hitbdry > 0) { + // Adjust searchtet to be the boundary face at edge [pa->pb]. + searchtet = bdrytet; + adjustedgering(searchtet, CCW); + pa = org(searchtet); + pb = dest(searchtet); + } + + // Comments: + // Remember that 'front' is the face [a, b, c]. 'spintet' is a tet + // [a, b, d, e] at edge [a->b]. + // We first check if the edge [d, e] intersects face [a, b, c], if it + // does, we try to flip the edge [d, e] away. + // We then check if the edge [b, c] intersects face [a, d, e], if it + // does, we try to flip the face [a, d, e] away. + // We then check if the edge [a, c] intersects face [b, d, e], if it + // does, we try to flip the face [b, d, e] away. + + // Search a crossing edge/face and try to flip it away. + remedge.tet = remface.tet = NULL; + spintet = searchtet; + hitbdry = 0; + do { + pd = apex(spintet); + pe = oppo(spintet); + // Check if edge [d, e] intersects [a, b, c]. + if (tri_edge_test(pa, pb, pc, pd, pe, NULL, 0, NULL, NULL)) { + remedge = spintet; + enextfnextself(remedge); + enextself(remedge); // Edge [pd->pe]. + break; + } + // Check if [b, c] intersects [a, d, e]. + if (!iscollinear(pa, pd, pe, b->epsilon)) { + if (tri_edge_test(pa, pd, pe, pb, pc, NULL, 0, NULL, NULL)) { + remface = spintet; + enext2fnextself(remface); // Face [a, d, e]. + break; + } + } + if (!iscollinear(pb, pd, pe, b->epsilon)) { + // Check if [a, c] intersects [b, d, e]. + if (tri_edge_test(pb, pd, pe, pa, pc, NULL, 0, NULL, NULL)) { + remface = spintet; + enextfnextself(remface); // Face [b, d, e]. + break; + } + } + tfnextself(spintet); + if (spintet.tet == dummytet) { + break; // Meet boundary. + } + if (apex(spintet) == apex(searchtet)) break; + } while (hitbdry < 2); + + if (remedge.tet != NULL) { + // Try to remove this crossing edge. + success = removeedgebyflips(&remedge, flipcount); + } else if (remface.tet != NULL) { + /*// Do not flip it if it is a subface. + tspivot(remface, checksh); + if (checksh.sh != dummysh) { + return false; + }*/ + success = removefacebyflips(&remface, flipcount); + } else { + // Haven't found a crossing edge or face. + success = false; + } + + if (!success) break; + + point2tetorg(pa, searchtet); + assert(org(searchtet) == pa); + dir = finddirection2(&searchtet, pb); + assert(dest(searchtet) == pb); + + } // while (1) + + // Clear the recored flips. + elemfliplist->restart(); + // Clear the fixed edges. + fixededgelist->restart(); + + return success; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// constrainedcavity() Tetrahedralize a cavity by constrained tetrahedra. // +// // +// The cavity C is bounded by faces F in 'floorlist' and 'ceillist'. 'ptlist'// +// V is the set of vertices of C. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::constrainedcavity(triface* oldtet, list* floorlist, + list* ceillist, list* ptlist, list* frontlist, list* misfrontlist, + list* newtetlist, list* gluetetlist, list* glueshlist, queue* flipque) +{ + triface misfront, newtet; + point pointptr; // Used with gluetetlist. + bool success; + int misfacecount; + int flipcount, totalflipcount; + int i; + + if (b->verbose > 1) { + printf(" Constrained cavity (%d floors, %d ceilings, %d vertices).\n", + floorlist->len(), ceillist->len(), ptlist->len()); + } + + // Initialize the cavity C. + initializecavity(floorlist, ceillist, frontlist, ptlist, glueshlist); + // Form the D of the vertices of C. + success = delaunizecavvertices(oldtet, ptlist, NULL, newtetlist, flipque); + + if (success) { + // Identify faces of C in D. + if (!identifyfronts(frontlist, misfrontlist, gluetetlist, glueshlist)) { + // Some faces are missing. + totalflipcount = 0; + // Try to recover missing faces by flips. + do { + misfacecount = misfrontlist->len(); + flipcount = 0; + for (i = 0; i < misfrontlist->len(); i++) { + // Get a missing front f. + misfront = * (triface *)(* misfrontlist)[i]; + // Let f face toward the inside of C. + // adjustedgering(misfront, CW); + // if (recoverfront(&misfront, newtetlist, flipque)) { + if (recoverfacebyflips(&misfront, &flipcount)) { + // f has been recovered. + frontlist->append(&misfront); + misfrontlist->del(i, 0); i--; + } + } + totalflipcount += flipcount; + // Have all faces been recovered? + if (misfrontlist->len() == 0) break; + // Continue the loop if some missing faces have been recovered. + } while (misfacecount > misfrontlist->len()); + // Retrieve new tets and purge dead tets in D. + retrievenewtets(newtetlist); + } + success = (misfrontlist->len() == 0); + } // if (success) + + if (success) { + // All fronts have identified in D. Get the shape of C by removing out + // tets of C. 'misfrontlist' is reused for removing out tets. + // Don't do flip since the new tets may get deleted later. + if (carvecavity(newtetlist, misfrontlist, gluetetlist, NULL)) { + return true; + } + } + + // { + // Fail to tetrahedralize C. + // Remove aux subfaces. + detachauxsubfaces(newtetlist); + // Remove new tets. + for (i = 0; i < newtetlist->len(); i++) { + newtet = * (triface *)(* newtetlist)[i]; + assert(!isdead(&newtet)); + tetrahedrondealloc(newtet.tet); + } + newtetlist->clear(); + // Restore faces of C in frontlist. + for (i = 0; i < misfrontlist->len(); i++) { + misfront = * (triface *)(* misfrontlist)[i]; + frontlist->append(&misfront); + } + // Some fronts have been removed from the front list (in gluefronts()). + // Maintain point-to-tet map. + for (i = 0; i < gluetetlist->len(); i++) { + // Get a tet t which lies outside the current cavity. + newtet = * (triface *)(* gluetetlist)[i]; + if (isdead(&newtet)) { + assert(0); + } + pointptr = org(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = dest(newtet); + setpoint2tet(pointptr, encode(newtet)); + pointptr = apex(newtet); + setpoint2tet(pointptr, encode(newtet)); + } + return false; + // } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// findrelocatepoint() Find new location for relocating a point. // +// // +// 'frontlist' contains the boundary faces of the cavity C. Some fronts are // +// visible by 'stpt' p, some are coplanar with p. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::findrelocatepoint2(point steinpt, point relocatept, + REAL* normal, list* frontlist, list* oldtetlist) +{ + triface oldtet, front; + point pa, pb, pc; + REAL farpt[3], fcent[3], candpt[3], searchpt[3]; + REAL dist, factor; + REAL ori, stepx, minvol, minvol1; + bool stopflag; + // int iter; + int i, j; + + if (b->verbose > 1) { + printf(" Find new location for point %d.\n", pointmark(steinpt)); + } + + // Calculate a far enough point on the normal direction. + for (i = 0; i < 3; i++) { + farpt[i] = steinpt[i] + longest * normal[i]; + } + + // Find the face in oldtet intersecting with the line steinpt->farpt. + for (i = 0; i < oldtetlist->len(); i++) { + oldtet = * (triface *)(* oldtetlist)[i]; + pa = org(oldtet); + pb = dest(oldtet); + pc = apex(oldtet); + if (tri_edge_test(pa, pb, pc, steinpt, farpt, farpt, 0, NULL, NULL)) { + // projpt2face(steinpt, pa, pb, pc, fcent); + // Find the intersected face. Calculate the intersection. + planelineint(pa, pb, pc, steinpt, farpt, fcent, &factor); + if (factor != 0) { // assert(factor != 0); + if (b->verbose > 1) { + printf("p:show_vector(%g, %g, %g, %g, %g, %g) -- L\n", steinpt[0], + steinpt[1], steinpt[2], fcent[0], fcent[1], fcent[2]); + } + break; + } + } + } + // There must be an interseced face. + if (i == oldtetlist->len()) { + return false; // assert(0); + } + + // Start search a relocating point which maximize the min. vol. + dist = distance(steinpt, fcent); + stepx = dist / 100.0; // Divide the segment into 100 pieces. + minvol = 0; + stopflag = false; + for (i = 1; i < 100 && !stopflag; i++) { + // Calculate a candidate point. + for (j = 0; j < 3; j++) { + candpt[j] = steinpt[j] + (stepx * (double) i) * (fcent[j] - steinpt[j]); + } + minvol1 = 0; + for (j = 0; j < frontlist->len(); j++) { + front = * (triface *)(* frontlist)[j]; + // Let f face inside C. (f is a face of tet adjacent to C). + adjustedgering(front, CW); + pa = org(front); + pb = dest(front); + pc = apex(front); + ori = orient3d(pa, pb, pc, candpt); + if (ori >= 0) { + // An invisible front. (1) fails. + stopflag = true; + break; + } + if (j == 0) { + minvol1 = -ori; + } else { + if (minvol1 > (-ori)) { + minvol1 = -ori; + } + } + } // j + if (!stopflag) { + if (minvol < minvol1) { + // The min. vol. is improved by this candidate. Choose it. + for (j = 0; j < 3; j++) searchpt[j] = candpt[j]; + minvol = minvol1; + } else { + // The min. vol. begins to decrease. Stop the search. + stopflag = true; + } + } + } // i + + if (minvol > 0) { + // We've found a valid relocation. Choose it. + if (b->verbose > 1) { + printf("p:show_vector(%g, %g, %g, %g, %g, %g) -- Relo\n", steinpt[0], + steinpt[1], steinpt[2], searchpt[0], searchpt[1], searchpt[2]); + } + for (i = 0; i < 3; i++) relocatept[i] = searchpt[i]; + return true; + } else { + return false; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// relocatepoint() Relocate a point into the cavity. // +// // +// 'frontlist' contains the boundary faces of the cavity C. All fronts must // +// be visible by 'steinpt'. Some fronts may hold by 'fake' tets (they are // +// hull faces). Fake tets will be removed when they're finished. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::relocatepoint(point steinpt, triface* oldtet, list* frontlist, + list* newtetlist, queue* flipque) +{ + triface front, newtet, newface, neightet; + face checksh; + point pa, pb; + REAL attrib, volume; + bool bdflag; + int i, j, k, l; + + if (b->verbose > 1) { + printf(" Insert Steiner point (%.12g, %.12g, %.12g) %d.\n", + steinpt[0], steinpt[1], steinpt[2], pointmark(steinpt)); + } + // Clear the list first. + newtetlist->clear(); + + // Create the tets formed by fronts and 'steinpt'. + for (i = 0; i < frontlist->len(); i++) { + // Get a front f. + front = * (triface *)(* frontlist)[i]; + // Let f face inside C. (f is a face of tet adjacent to C). + adjustedgering(front, CW); + if (b->verbose > 2) { + printf(" Get front (%d, %d, %d).\n", pointmark(org(front)), + pointmark(dest(front)), pointmark(apex(front))); + } + maketetrahedron(&newtet); + newtetlist->append(&newtet); + setorg(newtet, org(front)); + setdest(newtet, dest(front)); + setapex(newtet, apex(front)); + setoppo(newtet, steinpt); + if (oldtet != (triface *) NULL) { + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + attrib = elemattribute(oldtet->tet, j); + setelemattribute(newtet.tet, j, attrib); + } + if (b->varvolume) { + volume = volumebound(oldtet->tet); + setvolumebound(newtet.tet, volume); + } + } + // Update the point-to-tet map. + pa = org(front); + setpoint2tet(pa, encode(newtet)); + pa = dest(front); + setpoint2tet(pa, encode(newtet)); + pa = apex(front); + setpoint2tet(pa, encode(newtet)); + setpoint2tet(steinpt, encode(newtet)); + // 'front' may be a 'fake' tet. + tspivot(front, checksh); + if (oppo(front) == (point) NULL) { + if (checksh.sh != dummysh) { + stdissolve(checksh); + } + // Detach the fake tet from its old cavity tet. This is necessary + // in case the mesh of other cavities are failed, and we have to + // restore the original status. 2009-07-28. + sym(front, neightet); + if (neightet.tet != dummytet) { + assert(infected(neightet)); + dissolve(neightet); + } + // Dealloc the 'fake' tet. + tetrahedrondealloc(front.tet); + // This side (newtet) is a boundary face, let 'dummytet' bond to it. + // Otherwise, 'dummytet' may point to a dead tetrahedron after the + // old cavity tets are removed. + dummytet[0] = encode(newtet); + } else { + // Bond two tetrahedra, also dissolve the old bond at 'front'. + bond(newtet, front); + } + if (checksh.sh != dummysh) { + sesymself(checksh); + tsbond(newtet, checksh); + } + if (flipque != (queue *) NULL) { + // f may be non-locally Delaunay and flipable. + enqueueflipface(newtet, flipque); + } + // The three neighbors are open. Will be finished later. + } + + // Connect new tets in C. All connecting faces must contain 'steinpt'. + // The following code should be re-written. 2009-07-30. + for (i = 0; i < newtetlist->len(); i++) { + newtet = * (triface *)(* newtetlist)[i]; + newtet.ver = 0; + for (j = 0; j < 3; j++) { + fnext(newtet, newface); + sym(newface, neightet); + if (neightet.tet == dummytet) { + // Find a neightet to connect it. + bdflag = false; + pa = org(newface); + pb = dest(newface); + assert(apex(newface) == steinpt); + for (k = i + 1; k < newtetlist->len() && !bdflag; k++) { + neightet = * (triface *)(* newtetlist)[k]; + neightet.ver = 0; + for (l = 0; l < 3; l++) { + if ((org(neightet) == pa && dest(neightet) == pb) || + (org(neightet) == pb && dest(neightet) == pa)) { + // Find the neighbor. + fnextself(neightet); + assert(apex(neightet) == steinpt); + // Now neightet is a face same as newface, bond them. + bond(newface, neightet); + bdflag = true; + break; + } + enextself(neightet); + } + } + if (!bdflag) { + assert(0); // break; // The relocation failed. + } + } + enextself(newtet); + } + if (j < 3) break; + } + + if (i < newtetlist->len()) { + // Relocation failed. Delete new tets. + for (i = 0; i < newtetlist->len(); i++) { + newtet = * (triface *)(* newtetlist)[i]; + tetrahedrondealloc(newtet.tet); + } + return false; + } + + if (flipque != (queue *) NULL) { + // Recover locally Delaunay faces. + lawson3d(flipque); + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// findcollapseedge() Find collapseable edge to suppress an endpoint. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::findcollapseedge(point suppt, point *conpt, list* oldtetlist, + list* ptlist) +{ + triface front; + point pt, pa, pb, pc; + REAL *lenarray, ltmp, ori; + bool visflag; + int *idxarray, itmp; + int n, i, j; + + if (b->verbose > 2) { + printf(" Search an edge (in %d edges) for collapse %d.\n", + ptlist->len(), pointmark(suppt)); + } + + // Candidate edges are p to the points of B(p) (in 'ptlist'). + n = ptlist->len(); + lenarray = new REAL[n]; + idxarray = new int[n]; + // Sort the points of B(p) by distance to p. + for (i = 0; i < n; i++) { + pt = * (point *)(* ptlist)[i]; + lenarray[i] = distance(suppt, pt); + idxarray[i] = i; + } + // Bubble sort. + for (i = 0; i < n - 1; i++) { + for (j = 0; j < n - 1 - i; j++) { + if (lenarray[j + 1] < lenarray[j]) { // compare the two neighbors + ltmp = lenarray[j]; // swap a[j] and a[j + 1] + lenarray[j] = lenarray[j + 1]; + lenarray[j + 1] = ltmp; + itmp = idxarray[j]; // swap a[j] and a[j + 1] + idxarray[j] = idxarray[j + 1]; + idxarray[j + 1] = itmp; + } + } + } + // For each point q of B(p), test if the edge (p, q) can be collapseed. + for (i = 0; i < n; i++) { + pt = * (point *)(* ptlist)[idxarray[i]]; + // Is q visible by faces of B(p) not with q as a vertex. + lenarray[i] = 0.0; // zero volume. + visflag = true; + for (j = 0; j < oldtetlist->len() && visflag; j++) { + front = * (triface *)(* oldtetlist)[j]; + // Let f face to inside of B(p). + adjustedgering(front, CCW); + pa = org(front); + pb = dest(front); + pc = apex(front); + // Is f contains q? + if ((pa != pt) && (pb != pt) && (pc != pt)) { + ori = orient3d(pa, pb, pc, pt); + if (ori != 0.0) { + if (iscoplanar(pa, pb, pc, pt, ori, b->epsilon * 1e+2)) ori = 0.0; + } + visflag = ori < 0.0; + if (visflag) { + // Visible, set the smallest volume. + if (j == 0) { + lenarray[i] = fabs(ori); + } else { + lenarray[i] = fabs(ori) < lenarray[i] ? fabs(ori) : lenarray[i]; + } + } else { + // Invisible. Do not collapse (p, q). + lenarray[i] = 0.0; + } + } + } + if ((b->verbose > 2) && visflag) { + printf(" Got candidate %d vol(%g).\n", pointmark(pt), lenarray[i]); + } + } + + // Select the largest non-zero volume (result in ltmp). + ltmp = lenarray[0]; + itmp = idxarray[0]; + for (i = 1; i < n; i++) { + if (lenarray[i] != 0.0) { + if (lenarray[i] > ltmp) { + ltmp = lenarray[i]; + itmp = idxarray[i]; // The index to find the point. + } + } + } + + delete [] lenarray; + delete [] idxarray; + + if (ltmp == 0.0) { + // No edge can be collapseed. + *conpt = (point) NULL; + return false; + } else { + pt = * (point *)(* ptlist)[itmp]; + *conpt = pt; + return true; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// collapseedge() Remove a point by edge collapse. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::collapseedge(point suppt, point conpt, list* oldtetlist, + list* deadtetlist) +{ + triface oldtet, deadtet; + triface adjtet1, adjtet2; + face adjsh; + point pa, pb, pc; + int i, j; + + if (b->verbose > 2) { + printf(" Collapse edge (%d,%d).\n", pointmark(suppt), pointmark(conpt)); + } + + // Loop in B(p), replace p with np, queue dead tets, uninfect old tets. + for (i = 0; i < oldtetlist->len(); i++) { + oldtet = * (triface *)(* oldtetlist)[i]; // assert(infected(oldtet)); + uninfect(oldtet); + pa = org(oldtet); + pb = dest(oldtet); + pc = apex(oldtet); + assert(oppo(oldtet) == suppt); + setoppo(oldtet, conpt); + if ((pa == conpt) || (pb == conpt) || (pc == conpt)) { + deadtetlist->append(&oldtet); // a collpased tet. + } else { + // A non-collapse tet. Update point-to-tet map. + setpoint2tet(pa, encode(oldtet)); + setpoint2tet(pb, encode(oldtet)); + setpoint2tet(pc, encode(oldtet)); + setpoint2tet(conpt, encode(oldtet)); + } + } + // Loop in deadtetlist, glue adjacent tets of dead tets. + for (i = 0; i < deadtetlist->len(); i++) { + deadtet = * (triface *)(* deadtetlist)[i]; + // Get the adjacent tet n1 (outside B(p)). + sym(deadtet, adjtet1); + tspivot(deadtet, adjsh); + // Find the edge in deadtet opposite to conpt. + adjustedgering(deadtet, CCW); + for (j = 0; j < 3; j++) { + if (apex(deadtet) == conpt) break; + enextself(deadtet); + } + assert(j < 3); + // Get another adjacent tet n2. + fnext(deadtet, adjtet2); + symself(adjtet2); + assert(adjtet2.tet != dummytet); // n2 is inside B(p). + if (adjtet1.tet != dummytet) { + bond(adjtet1, adjtet2); // Bond n1 <--> n2. + } else { + dissolve(adjtet2); // Dissolve at n2. + dummytet[0] = encode(adjtet2); // Let dummytet holds n2. + } + if (adjsh.sh != dummysh) { + tsbond(adjtet2, adjsh); // Bond s <--> n2. + } + // Collapse deadtet. + tetrahedrondealloc(deadtet.tet); + } + deadtetlist->clear(); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// deallocfaketets() Deleted fake tets at fronts. // +// // +// This routine is only called when the findrelocatepoint() routine fails. // +// In other cases, the fake tets are removed automatically in carvecavity() // +// or relocatepoint(). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::deallocfaketets(list* frontlist) +{ + triface front, neightet; + face checksh; + bool infectflag; + int i; + + for (i = 0; i < frontlist->len(); i++) { + // Get a front f. + front = * (triface *)(* frontlist)[i]; + // Let f face inside C. (f is a face of tet adjacent to C). + adjustedgering(front, CW); + sym(front, neightet); + tspivot(front, checksh); + if (oppo(front) == (point) NULL) { + if (b->verbose > 2) { + printf(" Get fake tet (%d, %d, %d).\n", pointmark(org(front)), + pointmark(dest(front)), pointmark(apex(front))); + } + if (neightet.tet != dummytet) { + // The neightet may be infected. After dissolve it, the infect flag + // will be lost. Save the flag and restore it later. + infectflag = infected(neightet); + dissolve(neightet); + if (infectflag) { + infect(neightet); + } + } + if (checksh.sh != dummysh) { + infectflag = sinfected(checksh); + stdissolve(checksh); + if (infectflag) { + sinfect(checksh); + } + } + // Dealloc the 'fake' tet. + tetrahedrondealloc(front.tet); + // If 'neightet' is a hull face, let 'dummytet' bond to it. It is + // a 'dummytet' when this front was created from a new subface. + // In such case, it should not be bounded. + if (neightet.tet != dummytet) { + dummytet[0] = encode(neightet); + } + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// restorepolyhedron() Restore the tetrahedralization in a polyhedron. // +// // +// This routine is only called when the operation of suppressing a point is // +// aborted (eg., findrelocatepoint() routine fails). The polyhedron has been // +// remeshed by new tets. This routine restore the old tets in it. // +// // +// 'oldtetlist' contains the list of old tets. Each old tet t_o assumes that // +// it still connects to a tet t_b of the mesh, however, t_b does not connect // +// to t_o, this routine resets the connection such that t_b <--> t_o. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::restorepolyhedron(list* oldtetlist) +{ + triface oldtet, neightet, neineitet; + face checksh; + point *ppt; + int i, j; + + for (i = 0; i < oldtetlist->len(); i++) { + // Get an old tet t_o. + oldtet = * (triface *)(* oldtetlist)[i]; + // Check the four sides of t_o. + for (oldtet.loc = 0; oldtet.loc < 4; oldtet.loc++) { + sym(oldtet, neightet); + tspivot(oldtet, checksh); + if (neightet.tet != dummytet) { + assert(!isdead(&neightet)); // SELF_CHECK 2009-07-24 + sym(neightet, neineitet); + if (neineitet.tet != oldtet.tet) { + // This face of t_o is a boundary of P. + bond(neightet, oldtet); + if (checksh.sh != dummysh) { + tsbond(oldtet, checksh); + } + } + } else { + // t_o has a hull face. It should be the boundary of P. + tsbond(oldtet, checksh); + // Let dummytet[0] points to it. + dummytet[0] = encode(oldtet); + } + } + // Update the point-to-tet map. + ppt = (point *) &(oldtet.tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(oldtet)); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// suppressfacetpoint() Suppress a point inside a facet. // +// // +// The point p inside a facet F will be suppressed from F by either being // +// deleted from the mesh or being relocated into the volume. // +// // +// 'supsh' is a subface f of F, and p = sapex(f); the other parameters are // +// working lists which are empty at the beginning and the end. // +// // +// 'optflag' is used for mesh optimization. If it is set, after removing p, // +// test the object function on each new tet, queue bad tets. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::suppressfacetpoint(face* supsh, list* frontlist, + list* misfrontlist, list* ptlist, list* conlist, memorypool* viri, + queue* flipque, bool noreloc, bool optflag) +{ + list *oldtetlist[2], *newtetlist[2]; + list *oldshlist, *newshlist; + list *gluetetlist; + list *glueshlist; + triface oldtet, newtet, neightet; + face oldsh, newsh; + point suppt, newpt[2]; + point *cons, *ppt; + enum interresult dir; + REAL norm[3]; + bool success; + int bakchecksubfaces; + int shmark; + int i, j; + + suppt = sapex(*supsh); + if (b->verbose > 1) { + printf(" Suppress point %d in facet.\n", pointmark(suppt)); + } + + // Initialize working lists, variables. + for (i = 0; i < 2; i++) { + oldtetlist[i] = (list *) NULL; + newtetlist[i] = (list *) NULL; + newpt[i] = (point) NULL; + } + gluetetlist = new list(sizeof(triface), NULL, 256); + glueshlist = new list(sizeof(face), NULL, 256); + oldshlist = new list(sizeof(face), NULL, 256); + newshlist = new list(sizeof(face), NULL, 256); + success = true; // Assume p can be suppressed. + + bakchecksubfaces = checksubfaces; + checksubfaces = 0; + + // Find subs of C(p). + oldshlist->append(supsh); + formstarpolygon(suppt, oldshlist, ptlist); + // Get the edges of C(p). They form a closed polygon. + for (i = 0; i < oldshlist->len(); i++) { + oldsh = * (face *)(* oldshlist)[i]; + cons = (point *) conlist->append(NULL); + cons[0] = sorg(oldsh); + cons[1] = sdest(oldsh); + } + // Re-triangulate the old C(p). + shmark = shellmark(*supsh); + triangulate(shmark, b->epsilon, ptlist, conlist, 0, NULL, viri, flipque); + // Get new subs of C(p), remove protected segments. + retrievenewsubs(newshlist, true); + // Substitute the old C(p) with the new C(p) + replacepolygonsubs(oldshlist, newshlist); + // Clear work lists. + ptlist->clear(); + conlist->clear(); + flipque->clear(); + viri->restart(); + + checksubfaces = bakchecksubfaces; + + // B(p) (tets with p as a vertex) has been separated into two parts + // (B_0(p) and B_1(p)) by F. Process them individually. + for (i = 0; i < 2 && success; i++) { + if (i == 1) sesymself(*supsh); + // Get a tet containing p. + stpivot(*supsh, oldtet); + // Is this part empty? + if (oldtet.tet == dummytet) continue; + // Allocate spaces for storing (old and new) B_i(p). + oldtetlist[i] = new list(sizeof(triface), NULL, 256); + newtetlist[i] = new list(sizeof(triface), NULL, 256); + // Form old B_i(p) in oldtetlist[i]. + assert(!isdead(&oldtet)); + oldtetlist[i]->append(&oldtet); + formstarpolyhedron(suppt, oldtetlist[i], ptlist, false); + // Infect the tets in old B_i(p) (they're going to be delete). + for (j = 0; j < oldtetlist[i]->len(); j++) { + oldtet = * (triface *)(* (oldtetlist[i]))[j]; + infect(oldtet); + } + // Preparation for re-tetrahedralzing old B_i(p). + orientnewsubs(newshlist, supsh, norm); + // Tetrahedralize old B_i(p). + success = constrainedcavity(&oldtet, newshlist, oldtetlist[i], ptlist, + frontlist, misfrontlist, newtetlist[i], gluetetlist, glueshlist, + flipque); + // If p is not suppressed, do relocation if 'noreloc' is not set. + if (!success && !noreloc) { + // Try to relocate p into the old B_i(p). + makepoint(&(newpt[i])); + // success = findrelocatepoint(suppt, newpt[i], norm, frontlist, + // oldtetlist[i]); + success = findrelocatepoint2(suppt, newpt[i], norm, frontlist, + oldtetlist[i]); + // Initialize newpt = suppt. + // for (j = 0; j < 3; j++) newpt[i][j] = suppt[j]; + // success = smoothvolpoint(newpt[i], frontlist, true); + if (success) { + // p is relocated by newpt[i]. Now insert it. Don't do flip since + // the new tets may get deleted again. + relocatepoint(newpt[i], &oldtet, frontlist, newtetlist[i], NULL); + setpointtype(newpt[i], FREEVOLVERTEX); + relverts++; + } else { + // Fail to relocate p. Clean fake tets and quit this option. + deallocfaketets(frontlist); + pointdealloc(newpt[i]); + newpt[i] = (point) NULL; + assert(newtetlist[i]->len() == 0); + } + } + if (!success && noreloc) { + // Failed and no point relocation. Clean fake tets. + deallocfaketets(frontlist); + } + // Clear work lists. + ptlist->clear(); + frontlist->clear(); + misfrontlist->clear(); + // Do not clear gluetetlist. gluetetlist->clear(); + // Do not clear glueshlist. + flipque->clear(); + } + + if (success) { + // p has been removed! (Still in the pool). + setpointtype(suppt, UNUSEDVERTEX); + unuverts++; + // Delete old C(p). + for (i = 0; i < oldshlist->len(); i++) { + oldsh = * (face *)(* oldshlist)[i]; + if (i == 0) { + // Update the 'hullsize' if C(p) is on the hull. + stpivot(oldsh, oldtet); + if (oldtet.tet != dummytet) { + sesymself(oldsh); + stpivot(oldsh, oldtet); + } + if (oldtet.tet == dummytet) { + // A boundary face. Update the 'hullsize'. + j = oldshlist->len() - newshlist->len(); + assert(j > 0); + hullsize -= j; + } + } + shellfacedealloc(subfaces, oldsh.sh); + } + // Delete old B_i(p). + for (i = 0; i < 2; i++) { + if (oldtetlist[i] != (list *) NULL) { + // Delete tets of the old B_i(p). + for (j = 0; j < oldtetlist[i]->len(); j++) { + oldtet = * (triface *)(* (oldtetlist[i]))[j]; + assert(!isdead(&oldtet)); + tetrahedrondealloc(oldtet.tet); + } + } + } + if (optflag) { + // Check for new bad-quality tets. + for (i = 0; i < 2; i++) { + if (newtetlist[i] != (list *) NULL) { + for (j = 0; j < newtetlist[i]->len(); j++) { + newtet = * (triface *)(* (newtetlist[i]))[j]; + if (!isdead(&newtet)) checktet4opt(&newtet, true); + } + } + } + } + // Insert outside new subfaces (if there are). 2009-07-08. + for (i = 0; i < glueshlist->len(); i++) { + newsh = * (face *)(* glueshlist)[i]; + // Insert it into mesh (it may be already inserted). + newtet.tet = NULL; + // The mesh may be non-convex (set convexflag = 0). + dir = scoutsubface(&newsh, &newtet, 0); + if (dir != SHAREFACE) { + assert(0); + } + } + } else { + // p is not suppressed. Recover the original state. + unsupverts++; + // Restore the old C(p). + replacepolygonsubs(newshlist, oldshlist); + // Delete subs of the new C(p) + for (i = 0; i < newshlist->len(); i++) { + newsh = * (face *)(* newshlist)[i]; + shellfacedealloc(subfaces, newsh.sh); + } + // Delete new subfaces in glueshlist. 2009-07-07 + for (i = 0; i < glueshlist->len(); i++) { + newsh = * (face *)(* glueshlist)[i]; + for (j = 0; j < 2; j++) { + stpivot(newsh, oldtet); + if (oldtet.tet != dummytet) { + tsdissolve(oldtet); + } + sesymself(newsh); + } + shellfacedealloc(subfaces, newsh.sh); + } + // Restore old B_i(p). + for (i = 0; i < 2; i++) { + if (oldtetlist[i] != (list *) NULL) { + // Uninfect tets of old B_i(p). + for (j = 0; j < oldtetlist[i]->len(); j++) { + oldtet = * (triface *)(* (oldtetlist[i]))[j]; + assert(infected(oldtet)); + uninfect(oldtet); + } + // Has it been re-meshed? + // if (newtetlist[i]->len() > 0) { + // Restore the old B_i(p). + restorepolyhedron(oldtetlist[i]); + // Delete tets of the new B_i(p); + for (j = 0; j < newtetlist[i]->len(); j++) { + newtet = * (triface *)(* (newtetlist[i]))[j]; + // Some new tets may already be deleted (by carvecavity()). + if (!isdead(&newtet)) { + tetrahedrondealloc(newtet.tet); + } + } + // } + // Dealloc newpt[i] if it exists. + if (newpt[i] != (point) NULL) { + pointdealloc(newpt[i]); + relverts--; + } + } + } + // Detach new subfaces attached to glue tets. 2009-07-10. + for (i = 0; i < gluetetlist->len(); i++) { + oldtet = * (triface *)(* gluetetlist)[i]; + if (!isdead(&oldtet)) { + // It contains a new subface which has already been deleted (in above). + tspivot(oldtet, newsh); + assert(isdead(&newsh)); + tsdissolve(oldtet); + sym(oldtet, neightet); + if (neightet.tet != dummytet) { + tsdissolve(neightet); + } + } + } + // Update the point-to-subface map. 2009-07-22. + for (i = 0; i < oldshlist->len(); i++) { + oldsh = * (face *)(* oldshlist)[i]; + ppt = (point *) &(oldsh.sh[3]); + for (j = 0; j < 3; j++) { + setpoint2sh(ppt[j], sencode(oldsh)); + } + } + } + + // Delete work lists. + delete oldshlist; + delete newshlist; + for (i = 0; i < 2; i++) { + if (oldtetlist[i] != (list *) NULL) { + delete oldtetlist[i]; + delete newtetlist[i]; + } + } + delete gluetetlist; + delete glueshlist; + + return success; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// suppresssegpoint() Suppress a point on a segment. // +// // +// The point p on a segment S will be suppressed from S by either being // +// deleted from the mesh or being relocated into the volume. // +// // +// 'supseg' is the segment S, and p = sdest(S); the other parameters are // +// working lists which are empty at the beginning and the end. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::suppresssegpoint(face* supseg, list* spinshlist, + list* newsegshlist, list* frontlist, list* misfrontlist, list* ptlist, + list* conlist, memorypool* viri, queue* flipque, bool noreloc, bool optflag) +{ + list **oldtetlist, **newtetlist; + list **oldshlist, **newshlist; + list *pnewshlist, *dnewshlist; + list *gluetetlist; + list *glueshlist; + triface oldtet, newtet, neightet, spintet; + face oldsh, newsh, *worksharray; + face startsh, spinsh, segsh1, segsh2; + face nsupseg, newseg, prevseg, nextseg; + point suppt, *newpt; + point pa, pb, pc, pd, *cons, *ppt; + enum interresult dir; + REAL pnorm[2][3], norm[3], len; + bool success; + int bakchecksubfaces; + int shmark; + int n, i, j, k; + + // Get the Steiner point p. + assert(supseg->shver < 2); + suppt = sdest(*supseg); + // Find the segment ab split by p. + senext(*supseg, nsupseg); + spivotself(nsupseg); + assert(nsupseg.sh != dummysh); + nsupseg.shver = 0; + if (sorg(nsupseg) != suppt) sesymself(nsupseg); + assert(sorg(nsupseg) == suppt); + pa = sorg(*supseg); + pb = sdest(nsupseg); + if (b->verbose > 1) { + printf(" Remove point %d on segment (%d, %d).\n", + pointmark(suppt), pointmark(pa), pointmark(pb)); + } + + // Let startsh s containing p. + spivot(*supseg, startsh); + spinsh = startsh; + do { + // Adjust spinsh to be the edge [pa, suppt]. + findedge(&spinsh, pa, suppt); + // Save it in list. + spinshlist->append(&spinsh); + // Go to the next facet. + spivotself(spinsh); + if (spinsh.sh == dummysh) break; + } while (spinsh.sh != startsh.sh); + + n = spinshlist->len(); + + if (n > 2) { + // Order the subfaces to be counterclockwise around edge [pa, suppt]. + worksharray = new face[n]; // Temporarily use it. + for (i = 0; i < n; i++) { + worksharray[i] = * (face *)(* spinshlist)[i]; + sinfect(worksharray[i]); + } + spinshlist->clear(); // Clear the list for the re-ordering. + for (i = 0; i < n; i++) { + worksharray[i] = * (face *)(* spinshlist)[i]; + if (sinfected(worksharray[i])) { + // Collect subfaces at this segment. + startsh = worksharray[i]; + stpivot(startsh, neightet); + if (neightet.tet == dummytet) { + sesymself(startsh); + stpivot(startsh, neightet); + assert(neightet.tet != dummytet); + } + // Adjust neightet to be the edge [pa, suppt]. + findedge(&neightet, pa, suppt); + // Adjust neightet to be the boundary face (if there exists). + spintet = neightet; + while (1) { + if (!fnextself(spintet)) { + esymself(spintet); + break; + } + if (apex(spintet) == apex(neightet)) break; + } + // Start from spintet, collect all subfaces at this segment. + neightet = spintet; + pc = org(spintet); + pd = dest(spintet); + // [pc, pd] is the rotating edge (axis). It may be either + // [pa, suppt] or [suppt, pa]. + while (1) { + tspivot(spintet, spinsh); + if (spinsh.sh != dummysh) { + assert(sinfected(spinsh)); + suninfect(spinsh); + // Let spinsh be the same oriented edge as spintet. + findedge(&spinsh, pc, pd); + spinshlist->append(&spinsh); + } + if (!fnextself(spintet)) break; + if (apex(spintet) == apex(neightet)) break; + } + } + assert(!sinfected(worksharray[i])); + } // i + delete [] worksharray; + } + + if (spinshlist->len() == 1) { + // This case has not handled yet. + // printf("Unhandled case: segment only belongs to one facet.\n"); + spinshlist->clear(); + unsupverts++; + return false; + } + + // Suppose ab is shared by n facets (n > 1), then there are n B(p) (tets + // with p as a vertex). Some B(p) may be empty, eg, outside. + // n = spinshlist->len(); + oldtetlist = new list*[n]; + newtetlist = new list*[n]; + oldshlist = new list*[n]; + newshlist = new list*[n]; + newpt = new point[n]; + for (i = 0; i < n; i++) { + oldtetlist[i] = (list *) NULL; + newtetlist[i] = (list *) NULL; + oldshlist[i] = (list *) NULL; + newshlist[i] = (list *) NULL; + newpt[i] = (point) NULL; + } + gluetetlist = new list(sizeof(triface), NULL, 256); + glueshlist = new list(sizeof(face), NULL, 256); + + // Create a new segment ab (result in newseg). + makeshellface(subsegs, &newseg); + setsorg(newseg, pa); + setsdest(newseg, pb); + // ab gets the same mark and segment type as ap. + setshellmark(newseg, shellmark(*supseg)); + setshelltype(newseg, shelltype(*supseg)); + if (b->quality && varconstraint) { + // Copy the areabound into the new subsegment. + setareabound(newseg, areabound(*supseg)); + } + // Save the old connection at a. + senext2(*supseg, prevseg); + spivotself(prevseg); + if (prevseg.sh != dummysh) { + prevseg.shver = 0; + if (sdest(prevseg) != pa) sesymself(prevseg); + assert(sdest(prevseg) == pa); + senextself(prevseg); + senext2self(newseg); + sbond(newseg, prevseg); + newseg.shver = 0; + } + // Save the old connection at b. + senext(nsupseg, nextseg); + spivotself(nextseg); + if (nextseg.sh != dummysh) { + nextseg.shver = 0; + if (sorg(nextseg) != pb) sesymself(nextseg); + assert(sorg(nextseg) == pb); + senext2self(nextseg); + senextself(newseg); + sbond(newseg, nextseg); + newseg.shver = 0; + } + + bakchecksubfaces = checksubfaces; + checksubfaces = 0; + + // Re-triangulate C(p) (subs with p as a vertex) to remove p. + for (i = 0; i < spinshlist->len(); i++) { + spinsh = * (face *)(* spinshlist)[i]; + // Allocate spaces for C_i(p). + oldshlist[i] = new list(sizeof(face), NULL, 256); + newshlist[i] = new list(sizeof(face), NULL, 256); + // Get the subs of C_i(p). + oldshlist[i]->append(&spinsh); + formstarpolygon(suppt, oldshlist[i], ptlist); + // Find the edges of C_i(p). It DOES NOT form a closed polygon. + for (j = 0; j < oldshlist[i]->len(); j++) { + oldsh = * (face *)(* (oldshlist[i]))[j]; + cons = (point *) conlist->append(NULL); + cons[0] = sorg(oldsh); + cons[1] = sdest(oldsh); + } + // The C_i(p) isn't closed without ab. Add it to it. + cons = (point *) conlist->append(NULL); + cons[0] = pa; + cons[1] = pb; + // Re-triangulate C_i(p). + shmark = shellmark(spinsh); + triangulate(shmark, b->epsilon, ptlist, conlist, 0, NULL, viri, flipque); + // Get new subs of C_i(p), remove protected segments. + retrievenewsubs(newshlist[i], true); + // Substitute old C_i(p) with the new C_i(p). !IT IS NOT COMPLETE! + replacepolygonsubs(oldshlist[i], newshlist[i]); + // Find the new subface s having edge ab. + for (j = 0; j < newshlist[i]->len(); j++) { + segsh1 = * (face *)(* (newshlist[i]))[j]; + for (k = 0; k < 3; k++) { + if (((sorg(segsh1) == pa) && (sdest(segsh1) == pb)) || + ((sorg(segsh1) == pb) && (sdest(segsh1) == pa))) break; + senextself(segsh1); + } + if (k < 3) break; // Found. + } + assert(j < newshlist[i]->len()); // ab must exist. + // Bond s and ab together. The C_i(p) is completedly substituted. + ssbond(segsh1, newseg); + // Save s for forming the face ring of ab. + newsegshlist->append(&segsh1); + // Clear work lists. + ptlist->clear(); + conlist->clear(); + flipque->clear(); + viri->restart(); + } + // Form the face ring of ab. + for (i = 0; i < newsegshlist->len(); i++) { + segsh1 = * (face *)(* newsegshlist)[i]; + if ((i + 1) == newsegshlist->len()) { + segsh2 = * (face *)(* newsegshlist)[0]; + } else { + segsh2 = * (face *)(* newsegshlist)[i + 1]; + } + sbond1(segsh1, segsh2); + } + + checksubfaces = bakchecksubfaces; + + // A work list for keeping subfaces from two facets. + dnewshlist = new list(sizeof(face), NULL, 256); + success = true; // Assume p is suppressable. + + // Suppress p in all B(p). B_i(p) is looped wrt the right-hand rule of ab. + for (i = 0; i < spinshlist->len() && success; i++) { + // Get an old subface s (ap) of a facet. + spinsh = * (face *)(* spinshlist)[i]; + // // Let the edge direction of s be a->b. Hence all subfaces follow + // // the right-hand rule of ab. + // if (sorg(spinsh) != pa) sesymself(spinsh); + // spinsh has been directed. Do not change its orientation now. + // Get a tet t of B_i(p). + stpivot(spinsh, oldtet); + // Is B_i(p) empty? + if (oldtet.tet == dummytet) continue; + // Allocate spaces for B_i(p). + oldtetlist[i] = new list(sizeof(triface), NULL, 256); + newtetlist[i] = new list(sizeof(triface), NULL, 256); + // Find all tets of old B_i(p). + oldtetlist[i]->append(&oldtet); + formstarpolyhedron(suppt, oldtetlist[i], ptlist, false); + // Infect tets of old B_i(p) (they're going to be deleted). + for (j = 0; j < oldtetlist[i]->len(); j++) { + oldtet = * (triface *)(* (oldtetlist[i]))[j]; + infect(oldtet); + } + // Collect new subfaces (of two facets) bounded B_i(p). + for (k = 0; k < 2; k++) { + if ((i + k) < spinshlist->len()) { + pnewshlist = newshlist[i + k]; + segsh1 = * (face *)(* spinshlist)[i + k]; + } else { + pnewshlist = newshlist[0]; + segsh1 = * (face *)(* spinshlist)[0]; + } + /*// Adjust the orientation of segsh1 to face to the inside of C. + if (k == 0) { + if (sorg(segsh1) != pa) sesymself(segsh1); + assert(sorg(segsh1) == pa); + } else { + if (sdest(segsh1) != pa) sesymself(segsh1); + assert(sdest(segsh1) == pa); + }*/ + if (k == 0) { + // segsh1 has already been directed pointing to the inside of C. + } else { + // Reverse the direction of segsh1. + sesymself(segsh1); + } + // its orientation now. + // Preparation for re-tetrahedralzing old B_i(p). + orientnewsubs(pnewshlist, &segsh1, pnorm[k]); + for (j = 0; j < pnewshlist->len(); j++) { + dnewshlist->append((face *)(* pnewshlist)[j]); + } + } + // Tetrahedralize B_i(p). + success = constrainedcavity(&oldtet, dnewshlist, oldtetlist[i], ptlist, + frontlist, misfrontlist, newtetlist[i], gluetetlist, glueshlist, + flipque); + if (!success && !noreloc) { + // C must be finished by re-locating the steiner point. + makepoint(&(newpt[i])); + for (j = 0; j < 3; j++) norm[j] = 0.5 * (pnorm[0][j] + pnorm[1][j]); + // Normialize the normal. + len = sqrt(norm[0] * norm[0] + norm[1] * norm[1] + norm[2] * norm[2]); + assert(len != 0); + for (j = 0; j < 3; j++) norm[j] /= len; + // success = findrelocatepoint(suppt, newpt[i], norm, frontlist, + // oldtetlist[i]); + success = findrelocatepoint2(suppt, newpt[i], norm, frontlist, + oldtetlist[i]); + // success = findrelocatepoint3(suppt, pa, pb, newpt[i], norm, frontlist, + // oldtetlist[i]); + // for (j = 0; j < 3; j++) newpt[i][j] = suppt[j]; + // success = smoothvolpoint(newpt[i], frontlist, true); + if (success) { + // p is relocated by newpt[i]. Now insert it. Don't do flip since + // the new tets may get deleted again. + if (relocatepoint(newpt[i], &oldtet, frontlist, newtetlist[i], NULL)) { + setpointtype(newpt[i], FREEVOLVERTEX); + relverts++; + } else { + // The faked tets are deleted in above route. + pointdealloc(newpt[i]); + newpt[i] = (point) NULL; + newtetlist[i]->clear(); + success = false; + } + } else { + // Fail to relocate p. Clean fake tets and quit this option. + deallocfaketets(frontlist); + pointdealloc(newpt[i]); + newpt[i] = (point) NULL; + assert(newtetlist[i]->len() == 0); + } + } + if (!success && noreloc) { + // Failed and no point relocation. Clean fake tets. + deallocfaketets(frontlist); + } + // Clear work lists. + dnewshlist->clear(); + ptlist->clear(); + frontlist->clear(); + misfrontlist->clear(); + // Do not clear gluetetlist. // gluetetlist->clear(); + // Do not clear glueshlist. + flipque->clear(); + } + + if (success) { + // p has been suppressed. (Still in the pool). + setpointtype(suppt, UNUSEDVERTEX); + unuverts++; + // Update the point-to-seg map. + setpoint2seg(pa, sencode(newseg)); + setpoint2seg(pb, sencode(newseg)); + // Delete old segments ap, pb. + shellfacedealloc(subsegs, supseg->sh); + shellfacedealloc(subsegs, nsupseg.sh); + // Delete subs of old C_i(p). + for (i = 0; i < spinshlist->len(); i++) { + for (j = 0; j < oldshlist[i]->len(); j++) { + oldsh = * (face *)(* (oldshlist[i]))[j]; + if (j == 0) { + // Update 'hullsize' if C_i(p) is on the hull. + stpivot(oldsh, oldtet); + if (oldtet.tet != dummytet) { + sesymself(oldsh); + stpivot(oldsh, oldtet); + } + if (oldtet.tet == dummytet) { + // Update 'hullsize'. + k = oldshlist[i]->len() - newshlist[i]->len(); + assert(k > 0); + hullsize -= k; + } + } + shellfacedealloc(subfaces, oldsh.sh); + } + } + // Delete tets old B_i(p). + for (i = 0; i < spinshlist->len(); i++) { + // Delete them if it is not empty. + if (oldtetlist[i] != (list *) NULL) { + for (j = 0; j < oldtetlist[i]->len(); j++) { + oldtet = * (triface *)(* (oldtetlist[i]))[j]; + assert(!isdead(&oldtet)); + tetrahedrondealloc(oldtet.tet); + } + } + } + if (optflag) { + for (i = 0; i < spinshlist->len(); i++) { + // Check for new bad-quality tets. + if (newtetlist[i] != (list *) NULL) { + for (j = 0; j < newtetlist[i]->len(); j++) { + newtet = * (triface *)(* (newtetlist[i]))[j]; + if (!isdead(&newtet)) checktet4opt(&newtet, true); + } + } + } + } + // Insert outside new subfaces (if there are). 2009-07-08. + for (i = 0; i < glueshlist->len(); i++) { + newsh = * (face *)(* glueshlist)[i]; + // Insert it into mesh (it may be already inserted). + newtet.tet = NULL; + // The mesh may be non-convex (set convexflag = 0). + dir = scoutsubface(&newsh, &newtet, 0); + if (dir != SHAREFACE) { + assert(0); + } + } + } else { + // p is not suppressed. Recover the original state. + unsupverts++; + // Restore old connection at a. + senext2(*supseg, prevseg); + spivotself(prevseg); + if (prevseg.sh != dummysh) { + prevseg.shver = 0; + if (sdest(prevseg) != pa) sesymself(prevseg); + assert(sdest(prevseg) == pa); + senextself(prevseg); + senext2self(*supseg); + sbond(*supseg, prevseg); + senextself(*supseg); // Restore original state. + assert(supseg->shver < 2); + } + // Restore old connection at b. + senext(nsupseg, nextseg); + spivotself(nextseg); + if (nextseg.sh != dummysh) { + nextseg.shver = 0; + if (sorg(nextseg) != pb) sesymself(nextseg); + assert(sorg(nextseg) == pb); + senext2self(nextseg); + senextself(nsupseg); + sbond(nsupseg, nextseg); + // nsupseg.shver = 0; + senext2self(nsupseg); // Restore original state + assert(nsupseg.shver < 2); + } + // Delete the new segment ab. + shellfacedealloc(subsegs, newseg.sh); + // Restore old C_i(p). + for (i = 0; i < spinshlist->len(); i++) { + replacepolygonsubs(newshlist[i], oldshlist[i]); + // Delete subs of the new C_i(p) + for (j = 0; j < newshlist[i]->len(); j++) { + newsh = * (face *)(* (newshlist[i]))[j]; + shellfacedealloc(subfaces, newsh.sh); + } + } + // Delete new subfaces in glueshlist. 2009-07-07. + for (i = 0; i < glueshlist->len(); i++) { + newsh = * (face *)(* glueshlist)[i]; + if (!isdead(&newsh)) { + // Disconnect adjacent tets. + for (j = 0; j < 2; j++) { + stpivot(newsh, oldtet); + if (oldtet.tet != dummytet) { + tsdissolve(oldtet); + } + sesymself(newsh); + } + shellfacedealloc(subfaces, newsh.sh); + } + } + // Restore old B_i(p). + for (i = 0; i < spinshlist->len(); i++) { + if (oldtetlist[i] != (list *) NULL) { + // Uninfect tets of old B_i(p). + for (j = 0; j < oldtetlist[i]->len(); j++) { + oldtet = * (triface *)(* (oldtetlist[i]))[j]; + assert(infected(oldtet)); + uninfect(oldtet); + } + // Has it been re-meshed? + // if (newtetlist[i]->len() > 0) { + // Restore the old B_i(p). + restorepolyhedron(oldtetlist[i]); + // Delete tets of the new B_i(p); + for (j = 0; j < newtetlist[i]->len(); j++) { + newtet = * (triface *)(* (newtetlist[i]))[j]; + // Some new tets may already be deleted (by carvecavity()). + if (!isdead(&newtet)) { + tetrahedrondealloc(newtet.tet); + } + } + // } + // Dealloc newpt[i] if it exists. + if (newpt[i] != (point) NULL) { + pointdealloc(newpt[i]); + relverts--; + } + } + } + // Detach new subfaces attached to glue tets. 2009-07-10. + for (i = 0; i < gluetetlist->len(); i++) { + oldtet = * (triface *)(* gluetetlist)[i]; + if (!isdead(&oldtet)) { + // It contains a new subface which has already been deleted (in above). + tspivot(oldtet, newsh); + assert(isdead(&newsh)); + tsdissolve(oldtet); + sym(oldtet, neightet); + if (neightet.tet != dummytet) { + tsdissolve(neightet); + } + } + } + // Update the point-to-subface map. 2009-07-22. + for (i = 0; i < spinshlist->len(); i++) { + for (j = 0; j < oldshlist[i]->len(); j++) { + oldsh = * (face *)(* oldshlist[i])[j]; + ppt = (point *) &(oldsh.sh[3]); + for (k = 0; k < 3; k++) { + setpoint2sh(ppt[k], sencode(oldsh)); + } + } + } + } + + // Delete work lists. + delete [] newpt; // BUG fixed. Thanks dmyan, June 23, 2007. + delete dnewshlist; + for (i = 0; i < spinshlist->len(); i++) { + delete oldshlist[i]; + delete newshlist[i]; + } + delete [] oldshlist; + delete [] newshlist; + for (i = 0; i < spinshlist->len(); i++) { + if (oldtetlist[i] != (list *) NULL) { + delete oldtetlist[i]; + delete newtetlist[i]; + } + } + delete [] oldtetlist; + delete [] newtetlist; + delete gluetetlist; + delete glueshlist; + // Clear work lists. + newsegshlist->clear(); + spinshlist->clear(); + + return success; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// suppressvolpoint() Suppress a point inside mesh. // +// // +// The point p = org(suptet) is inside the mesh and will be suppressed from // +// the mesh. Note that p may not be suppressed. // +// // +// 'optflag' is used for mesh optimization. If it is set, after removing p, // +// test the object function on each new tet, queue bad tets. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::suppressvolpoint(triface* suptet, list* frontlist, + list* misfrontlist, list* ptlist, queue* flipque, bool optflag) +{ + list *myfrontlist, *mymisfrontlist, *myptlist; + list *oldtetlist, *newtetlist; + list *gluetetlist; + list *glueshlist; + list *newshlist; // a dummy list. + queue *myflipque; + triface oldtet, newtet; + point suppt, conpt, *ppt; + bool success; + int j, k; + + // Allocate spaces for storing (old and new) B(p). + oldtetlist = new list(sizeof(triface), NULL, 256); + newtetlist = new list(sizeof(triface), NULL, 256); + gluetetlist = new list(sizeof(triface), NULL, 256); + glueshlist = new list(sizeof(face), NULL, 256); + newshlist = new list(sizeof(face), NULL, 256); + // Allocate work lists if user doesn't supply them. + myfrontlist = mymisfrontlist = myptlist = (list *) NULL; + myflipque = (queue *) NULL; + if (frontlist == (list *) NULL) { + myfrontlist = new list(sizeof(triface), NULL, 256); + frontlist = myfrontlist; + mymisfrontlist = new list(sizeof(triface), NULL, 256); + misfrontlist = mymisfrontlist; + myptlist = new list(sizeof(point *), NULL, 256); + ptlist = myptlist; + myflipque = new queue(sizeof(badface)); + flipque = myflipque; + } + + suppt = org(*suptet); + oldtet = *suptet; + success = true; // Assume p can be suppressed. + + if (b->verbose > 1) { + printf(" Remove point %d in mesh.\n", pointmark(suppt)); + } + + // Form old B(p) in oldtetlist. + oldtetlist->append(&oldtet); + formstarpolyhedron(suppt, oldtetlist, ptlist, false); + // Infect the tets in old B(p) (they're going to be delete). + for (j = 0; j < oldtetlist->len(); j++) { + oldtet = * (triface *)(* oldtetlist)[j]; + infect(oldtet); + } + // Tetrahedralize old B(p). + success = constrainedcavity(&oldtet, newshlist, oldtetlist, ptlist, + frontlist, misfrontlist, newtetlist, gluetetlist, glueshlist, flipque); + if (!success) { + // Unable to suppress p. + deallocfaketets(frontlist); + // Try to collapse an edge at p. + conpt = (point) NULL; + assert(newtetlist->len() == 0); + if (findcollapseedge(suppt, &conpt, oldtetlist, ptlist)) { + // Collapse the edge suppt->conpt. Re-use newtetlist. + collapseedge(suppt, conpt, oldtetlist, newtetlist); + // The oldtetlist contains newtetlist. + if (optflag) { + assert(newtetlist->len() == 0); + for (j = 0; j < oldtetlist->len(); j++) { + newtet = * (triface *)(* oldtetlist)[j]; + newtetlist->append(&newtet); + } + } + oldtetlist->clear(); // Do not delete them. + collapverts++; + success = true; + } + } + if (success) { + // p has been removed! (Still in the pool). + setpointtype(suppt, UNUSEDVERTEX); + unuverts++; + suprelverts++; + // Delete old B(p). + for (j = 0; j < oldtetlist->len(); j++) { + oldtet = * (triface *)(* oldtetlist)[j]; + assert(!isdead(&oldtet)); + tetrahedrondealloc(oldtet.tet); + } + if (optflag) { + // Check for new bad tets. + for (j = 0; j < newtetlist->len(); j++) { + newtet = * (triface *)(* newtetlist)[j]; + if (!isdead(&newtet)) checktet4opt(&newtet, true); + } + } + } else { + // p is not suppressed. Recover the original state. + // Uninfect tets of old B(p). + for (j = 0; j < oldtetlist->len(); j++) { + oldtet = * (triface *)(* oldtetlist)[j]; + assert(infected(oldtet)); + uninfect(oldtet); + // Update the point-to-tet map. + ppt = (point *) &(oldtet.tet[4]); + for (k = 0; k < 4; k++) { + setpoint2tet(ppt[k], encode(oldtet)); + } + } + } + + // Clear work lists. + ptlist->clear(); + frontlist->clear(); + misfrontlist->clear(); + gluetetlist->clear(); + glueshlist->clear(); + flipque->clear(); + // Deallocate work lists. + if (myfrontlist != (list *) NULL) { + delete myfrontlist; + delete mymisfrontlist; + delete myptlist; + delete myflipque; + } + delete oldtetlist; + delete newtetlist; + delete gluetetlist; + delete glueshlist; + delete newshlist; + + return success; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removesteiners2() Remove Steiner points. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::removesteiners2() +{ + list *frontlist, *misfrontlist; + list *spinshlist, *newsegshlist; + list *ptlist, *conlist; + memorypool *viri; + queue *flipque; + triface searchtet, checktet; + face searchsh; + face searchseg; + point pa, pt; + enum verttype vtype; + bool remflag, success; //, optflag; + int oldnum, rmstein; + int unsupbdrycount; // Count the unsuppressed boundary Steiner points. + int iter, i, j; + + if (!b->quiet) { + printf("Removing Steiner points.\n"); + } + + // Initialize work lists. + frontlist = new list(sizeof(triface), NULL); + misfrontlist = new list(sizeof(triface), NULL); + spinshlist = new list(sizeof(face), NULL); + newsegshlist = new list(sizeof(face), NULL); + ptlist = new list(sizeof(point *), NULL); + conlist = new list(sizeof(point *) * 2, NULL); + flipque = new queue(sizeof(badface)); + viri = new memorypool(sizeof(shellface *), 1024, POINTER, 0); + + caveshlist = new arraypool(sizeof(face), 10); + caveshbdlist = new arraypool(sizeof(face), 10); + + oldnum = unuverts; + relverts = suprelverts = collapverts = unsupverts; + + iter = 0; + i = 0; + + do { // iter + unsupbdrycount = 0; + // Initialize the two arrays (global values). + fixededgelist = new arraypool(sizeof(point) * 2, 8); + elemfliplist = new arraypool(sizeof(elemflip), 8); + + do { // i + rmstein = unuverts; + points->traversalinit(); + pa = pointtraverse(); + while (pa != NULL) { + j = pointmark(pa) - in->firstnumber; + if (j >= in->numberofpoints) { + // pa is not an input points. + vtype = pointtype(pa); + if ((vtype == FREESEGVERTEX) || (vtype == FREESUBVERTEX) || + (vtype == FREEVOLVERTEX)) { + i++; + if (b->verbose > 1) { + printf(" Removing %d-th Steiner point %d.\n", i, pointmark(pa)); + } + } + if (vtype == FREESEGVERTEX) { + remflag = false; + // pa is not an input point. + if (b->nobisect == 1) { + point2segorg(pa, searchseg); + sstpivot(&searchseg, &checktet); + assert(checktet.tet != dummytet); + pt = apex(checktet); + do { + if (!fnextself(checktet)) { + // Meet a boundary face - p is on the hull. + remflag = true; + break; + } + } while (apex(checktet) != pt); + } else { + // '-YY'. Remove p whatever s is a hull face or not. + remflag = true; + } + if (remflag) { + point2segorg(pa, searchseg); + sesymself(searchseg); // pa = sdest(); + success = suppresssegpoint(&searchseg, spinshlist, newsegshlist, + frontlist, misfrontlist, ptlist, conlist, viri, flipque, + false, false); + } + } else if (vtype == FREESUBVERTEX) { + remflag = false; + // pa is not an input point. + if (b->nobisect == 1) { + // '-Y'. Remove p if s is a hull face. + point2shorg(pa, searchsh); + stpivot(searchsh, checktet); + if (checktet.tet != dummytet) { + sesymself(searchsh); + stpivot(searchsh, checktet); + } + remflag = (checktet.tet == dummytet); + } else { + // '-YY'. Remove p whatever s is a hull face or not. + remflag = true; + } + if (remflag) { + point2shorg(pa, searchsh); + senextself(searchsh); // pa = sapex(); + success = suppressfacetpoint(&searchsh, frontlist, misfrontlist, + ptlist, conlist, viri, flipque, false, false); + } + } else if (vtype == FREEVOLVERTEX) { + // pa is not an input point. + point2tetorg(pa, searchtet); + success = suppressvolpoint(&searchtet, frontlist, misfrontlist, + ptlist, flipque, false); + } + } // if (j >= in->numberofpoints) + pa = pointtraverse(); + } + // Continue if any Steiner point has been removed. + } while (unuverts > rmstein); + + delete fixededgelist; + delete elemfliplist; + fixededgelist = NULL; + elemfliplist = NULL; + + if (b->optlevel > 0) { // b->optlevel is set by -s. + // Improve the local mesh quality at relocated Steiner points. + b_steinerflag = true; + optimizemesh2(true); + b_steinerflag = false; + + // Smooth the relocated vertices (also count unsupressed vertices). + points->traversalinit(); + pa = pointtraverse(); + while (pa != NULL) { + j = pointmark(pa) - in->firstnumber; + if (j >= in->numberofpoints) { + // pa is not an input point. + vtype = pointtype(pa); + if (vtype == FREEVOLVERTEX) { + point2tetorg(pa, searchtet); + frontlist->append(&searchtet); + formstarpolyhedron(pa, frontlist, NULL, false); + smoothpoint(pa, NULL, NULL, frontlist, false, NULL); + frontlist->clear(); + } else if (vtype == FREESEGVERTEX) { + remflag = false; + // pa is not an input point. + if (b->nobisect == 1) { + point2segorg(pa, searchseg); + sstpivot(&searchseg, &checktet); + assert(checktet.tet != dummytet); + pt = apex(checktet); + do { + if (!fnextself(checktet)) { + // Meet a boundary face - p is on the hull. + remflag = true; + break; + } + } while (apex(checktet) != pt); + } else { + // '-YY'. Remove p whatever s is a hull face or not. + remflag = true; + } + if (remflag) { + unsupbdrycount++; + } + } else if (vtype == FREESUBVERTEX) { + remflag = false; + // pa is not an input point. + if (b->nobisect == 1) { + // '-Y'. Remove p if s is a hull face. + point2shorg(pa, searchsh); + stpivot(searchsh, checktet); + if (checktet.tet != dummytet) { + sesymself(searchsh); + stpivot(searchsh, checktet); + } + remflag = (checktet.tet == dummytet); + } else { + // '-YY'. Remove p whatever s is a hull face or not. + remflag = true; + } + if (remflag) { + unsupbdrycount++; + } + } + } + pa = pointtraverse(); + } + } + + if (unsupbdrycount == 0) { + break; // No unsupressed boundary points left. + } + iter++; + } while ((b->optlevel > 0) && (iter < b->optpasses)); + // Comment: default b->optpasses is 3, it can be set by -ss option. + + if (b->verbose > 0) { + printf(" %d points removed from boundary.\n", unuverts - oldnum); + // if (relverts > 0) { + printf(" %d points relocated (%d suppressed, %d collapsed).\n", + relverts, suprelverts - collapverts, collapverts); + if (unsupverts > 0) { + printf(" %d points were unsuppressed.\n", unsupverts); + } + if (unsupbdrycount > 0) { + printf(" !! %d points remain in the boundary.\n", unsupbdrycount); + } + printf(" %d points remain in the interior.\n", relverts-suprelverts); + // } + } + + /*// DEBUG Dump extremly bad tets. + badtetrahedrons = new memorypool(sizeof(badface), ELEPERBLOCK, POINTER, 0); + cosmaxdihed = cos(179.999 * PI / 180.0); + cosmindihed = cos(0.1 * PI / 180.0); + tallslivers(true); + dumpbadtets(); + delete badtetrahedrons; + badtetrahedrons = NULL; + // DEBUG END */ + + delete caveshlist; + delete caveshbdlist; + caveshlist = NULL; + caveshbdlist = NULL; + + // Delete work lists. + delete frontlist; + delete misfrontlist; + delete spinshlist; + delete newsegshlist; + delete ptlist; + delete conlist; + delete flipque; + delete viri; +} + +//// //// +//// //// +//// steiner_cxx ////////////////////////////////////////////////////////////// + +//// reconstruct_cxx ////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// transfernodes() Transfer nodes from 'io->pointlist' to 'this->points'. // +// // +// Initializing 'this->points'. Transferring all points from 'in->pointlist'// +// into it. All points are indexed (start from in->firstnumber). Each point // +// is initialized be UNUSEDVERTEX. The bounding box (xmin, xmax, ymin, ymax,// +// zmin, zmax) and the diameter (longest) of the point set are calculated. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::transfernodes() +{ + point pointloop; + REAL x, y, z; + int coordindex; + int attribindex; + int mtrindex; + int i, j; + + // Read the points. + coordindex = 0; + attribindex = 0; + mtrindex = 0; + for (i = 0; i < in->numberofpoints; i++) { + makepoint(&pointloop); + // Read the point coordinates. + x = pointloop[0] = in->pointlist[coordindex++]; + y = pointloop[1] = in->pointlist[coordindex++]; + z = pointloop[2] = in->pointlist[coordindex++]; + // Read the point attributes. + for (j = 0; j < in->numberofpointattributes; j++) { + pointloop[3 + j] = in->pointattributelist[attribindex++]; + } + // Read the point metric tensor. + for (j = 0; j < in->numberofpointmtrs; j++) { + pointloop[pointmtrindex + j] = in->pointmtrlist[mtrindex++]; + } + // Determine the smallest and largests x, y and z coordinates. + if (i == 0) { + xmin = xmax = x; + ymin = ymax = y; + zmin = zmax = z; + } else { + xmin = (x < xmin) ? x : xmin; + xmax = (x > xmax) ? x : xmax; + ymin = (y < ymin) ? y : ymin; + ymax = (y > ymax) ? y : ymax; + zmin = (z < zmin) ? z : zmin; + zmax = (z > zmax) ? z : zmax; + } + } + // 'longest' is the largest possible edge length formed by input vertices. + x = xmax - xmin; + y = ymax - ymin; + z = zmax - zmin; + longest = sqrt(x * x + y * y + z * z); + if (longest == 0.0) { + printf("Error: The point set is trivial.\n"); + terminatetetgen(3); + } + // Two identical points are distinguished by 'lengthlimit'. + lengthlimit = longest * b->epsilon * 1e+2; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// reconstructmesh() Reconstruct a tetrahedral mesh. // +// // +// The list of tetrahedra will be read from 'in->tetrahedronlist'. If 'in-> // +// trifacelist' is not empty, boundary faces (faces with a non-zero marker) // +// from this list will be inserted into the mesh. In addition, this routine // +// automatically detects boundary faces (subfaces): all hull faces will be // +// recognized as subfaces, internal faces between two tetrahedra which have // +// different region attributes will also be recognized as subfaces. // +// // +// Subsegments will be identified after subfaces are reconstructed. Edges at // +// the intersections of non-coplanar subfaces are recognized as subsegments. // +// Edges between two coplanar subfaces with different boundary markers are // +// also recognized as subsegments. // +// // +// The facet index of each subface will be set automatically after we have // +// recovered subfaces and subsegments. That is, the set of subfaces, which // +// are coplanar and have the same boundary marker will be recognized as a // +// facet and has a unique index, stored as the facet marker in each subface // +// of the set, the real boundary marker of each subface will be found in // +// 'in->facetmarkerlist' by the index. Facet index will be used in Delaunay // +// refinement for detecting two incident facets. // +// // +// Points which are not corners of tetrahedra will be inserted into the mesh.// +// Return the number of faces on the hull after the reconstruction. // +// // +/////////////////////////////////////////////////////////////////////////////// + +long tetgenmesh::reconstructmesh() +{ + tetrahedron **tetsperverlist; + shellface **facesperverlist; + triface tetloop, neightet, neineightet, spintet; + face subloop, neighsh, neineighsh; + face sface1, sface2; + face checkseg, subseg; + point *idx2verlist; + point torg, tdest, tapex, toppo; + point norg, napex; + list *neighshlist, *markerlist; + REAL sign, attrib, volume; + REAL da1, da2; + bool bondflag, insertsegflag; + int *idx2tetlist; + int *idx2facelist; + int *worklist; + int facetidx, marker; + int iorg, idest, iapex, ioppo; + int pivot, ipivot, isum; + int maxbandwidth; + int index, i, j, k; + + if (!b->quiet) { + printf("Reconstructing mesh.\n"); + } + + // Create a map from index to points. + makeindex2pointmap(idx2verlist); + + // Create the tetrahedra. + for (i = 0; i < in->numberoftetrahedra; i++) { + // Create a new tetrahedron and set its four corners, make sure that + // four corners form a positive orientation. + maketetrahedron(&tetloop); + index = i * in->numberofcorners; + // Although there may be 10 nodes, we only read the first 4. + iorg = in->tetrahedronlist[index] - in->firstnumber; + idest = in->tetrahedronlist[index + 1] - in->firstnumber; + iapex = in->tetrahedronlist[index + 2] - in->firstnumber; + ioppo = in->tetrahedronlist[index + 3] - in->firstnumber; + torg = idx2verlist[iorg]; + tdest = idx2verlist[idest]; + tapex = idx2verlist[iapex]; + toppo = idx2verlist[ioppo]; + sign = orient3d(torg, tdest, tapex, toppo); + if (sign > 0.0) { + norg = torg; torg = tdest; tdest = norg; + } else if (sign == 0.0) { + if (!b->quiet) { + printf("Warning: Tet %d is degenerate.\n", i + in->firstnumber); + } + } + setorg(tetloop, torg); + setdest(tetloop, tdest); + setapex(tetloop, tapex); + setoppo(tetloop, toppo); + // Temporarily set the vertices be type FREEVOLVERTEX, to indicate that + // they belong to the mesh. These types may be changed later. + setpointtype(torg, FREEVOLVERTEX); + setpointtype(tdest, FREEVOLVERTEX); + setpointtype(tapex, FREEVOLVERTEX); + setpointtype(toppo, FREEVOLVERTEX); + // Set element attributes if they exist. + for (j = 0; j < in->numberoftetrahedronattributes; j++) { + index = i * in->numberoftetrahedronattributes; + attrib = in->tetrahedronattributelist[index + j]; + setelemattribute(tetloop.tet, j, attrib); + } + // If -a switch is used (with no number follows) Set a volume + // constraint if it exists. + if (b->varvolume) { + if (in->tetrahedronvolumelist != (REAL *) NULL) { + volume = in->tetrahedronvolumelist[i]; + } else { + volume = -1.0; + } + setvolumebound(tetloop.tet, volume); + } + } + + // Set the connection between tetrahedra. + hullsize = 0l; + // Create a map from nodes to tetrahedra. + maketetrahedronmap(idx2tetlist, tetsperverlist); + // Initialize the worklist. + worklist = new int[points->items]; + for (i = 0; i < points->items; i++) worklist[i] = 0; + maxbandwidth = 0; + + // Loop all tetrahedra, bond two tetrahedra if they share a common face. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Loop the four sides of the tetrahedron. + for (tetloop.loc = 0; tetloop.loc < 4; tetloop.loc++) { + sym(tetloop, neightet); + if (neightet.tet != dummytet) continue; // This side has finished. + torg = org(tetloop); + tdest = dest(tetloop); + tapex = apex(tetloop); + iorg = pointmark(torg) - in->firstnumber; + idest = pointmark(tdest) - in->firstnumber; + iapex = pointmark(tapex) - in->firstnumber; + worklist[iorg] = 1; + worklist[idest] = 1; + worklist[iapex] = 1; + // Pick the vertex which has the lowest degree. + if ((idx2tetlist[iorg + 1] - idx2tetlist[iorg]) > + (idx2tetlist[idest + 1] - idx2tetlist[idest])) { + if ((idx2tetlist[idest + 1] - idx2tetlist[idest]) > + (idx2tetlist[iapex + 1] - idx2tetlist[iapex])) { + pivot = iapex; + } else { + pivot = idest; + } + } else { + if ((idx2tetlist[iorg + 1] - idx2tetlist[iorg]) > + (idx2tetlist[iapex + 1] - idx2tetlist[iapex])) { + pivot = iapex; + } else { + pivot = iorg; + } + } + if ((idx2tetlist[pivot + 1] - idx2tetlist[pivot]) > maxbandwidth) { + maxbandwidth = idx2tetlist[pivot + 1] - idx2tetlist[pivot]; + } + bondflag = false; + // Search its neighbor in the adjacent tets of the pivoted vertex. + for (j = idx2tetlist[pivot]; j < idx2tetlist[pivot + 1] && !bondflag; + j++) { + // Quickly check if this tet contains the neighbor. + isum = 0; + for (k = 0; k < 4; k++) { + norg = (point) tetsperverlist[j][4 + k]; + ipivot = pointmark(norg) - in->firstnumber; + isum += worklist[ipivot]; + } + if (isum != 3) continue; + if (tetsperverlist[j] == tetloop.tet) continue; // Skip myself. + // This tet contains its neighbor, find the face and bond them. + neightet.tet = tetsperverlist[j]; + for (neightet.loc = 0; neightet.loc < 4; neightet.loc++) { + norg = oppo(neightet); + ipivot = pointmark(norg) - in->firstnumber; + if (worklist[ipivot] == 0) { + // Find! Bond them together and break the loop. +#ifdef SELF_CHECK + sym(neightet, neineightet); + assert(neineightet.tet == dummytet); +#endif + bond(tetloop, neightet); + bondflag = true; + break; + } + } + } + if (!bondflag) { + hullsize++; // It's a hull face. + // Bond this side to outer space. + dummytet[0] = encode(tetloop); + if ((in->pointmarkerlist != (int *) NULL) && !b->coarse) { + // Set its three corners's markers be boundary (hull) vertices. + if (in->pointmarkerlist[iorg] == 0) { + in->pointmarkerlist[iorg] = 1; + } + if (in->pointmarkerlist[idest] == 0) { + in->pointmarkerlist[idest] = 1; + } + if (in->pointmarkerlist[iapex] == 0) { + in->pointmarkerlist[iapex] = 1; + } + } + } + worklist[iorg] = 0; + worklist[idest] = 0; + worklist[iapex] = 0; + } + tetloop.tet = tetrahedrontraverse(); + } + + if (b->verbose) { + printf(" Maximal vertex degree = %d.\n", maxbandwidth); + } + + // Subfaces will be inserted into the mesh. It has two phases: + // (1) Insert subfaces provided by user (in->trifacelist); + // (2) Create subfaces for hull faces (if they're not subface yet) and + // interior faces which separate two different materials. + + // Phase (1). Is there a list of user-provided subfaces? + if (in->trifacelist != (int *) NULL) { + // Recover subfaces from 'in->trifacelist'. + for (i = 0; i < in->numberoftrifaces; i++) { + index = i * 3; + iorg = in->trifacelist[index] - in->firstnumber; + idest = in->trifacelist[index + 1] - in->firstnumber; + iapex = in->trifacelist[index + 2] - in->firstnumber; + // Look for the location of this subface. + worklist[iorg] = 1; + worklist[idest] = 1; + worklist[iapex] = 1; + // Pick the vertex which has the lowest degree. + if ((idx2tetlist[iorg + 1] - idx2tetlist[iorg]) > + (idx2tetlist[idest + 1] - idx2tetlist[idest])) { + if ((idx2tetlist[idest + 1] - idx2tetlist[idest]) > + (idx2tetlist[iapex + 1] - idx2tetlist[iapex])) { + pivot = iapex; + } else { + pivot = idest; + } + } else { + if ((idx2tetlist[iorg + 1] - idx2tetlist[iorg]) > + (idx2tetlist[iapex + 1] - idx2tetlist[iapex])) { + pivot = iapex; + } else { + pivot = iorg; + } + } + bondflag = false; + // Search its neighbor in the adjacent tets of torg. + for (j = idx2tetlist[pivot]; j < idx2tetlist[pivot + 1] && !bondflag; + j++) { + // Quickly check if this tet contains the neighbor. + isum = 0; + for (k = 0; k < 4; k++) { + norg = (point) tetsperverlist[j][4 + k]; + ipivot = pointmark(norg) - in->firstnumber; + isum += worklist[ipivot]; + } + if (isum != 3) continue; + neightet.tet = tetsperverlist[j]; + for (neightet.loc = 0; neightet.loc < 4; neightet.loc++) { + norg = oppo(neightet); + ipivot = pointmark(norg) - in->firstnumber; + if (worklist[ipivot] == 0) { + bondflag = true; // Find! + break; + } + } + } + if (bondflag) { + // Create a new subface and insert it into the mesh. + makeshellface(subfaces, &subloop); + torg = idx2verlist[iorg]; + tdest = idx2verlist[idest]; + tapex = idx2verlist[iapex]; + setsorg(subloop, torg); + setsdest(subloop, tdest); + setsapex(subloop, tapex); + // Set the vertices be FREESUBVERTEX to indicate they belong to a + // facet of the domain. They may be changed later. + setpointtype(torg, FREESUBVERTEX); + setpointtype(tdest, FREESUBVERTEX); + setpointtype(tapex, FREESUBVERTEX); + if (in->trifacemarkerlist != (int *) NULL) { + setshellmark(subloop, in->trifacemarkerlist[i]); + } + adjustedgering(neightet, CCW); + findedge(&subloop, org(neightet), dest(neightet)); + tsbond(neightet, subloop); + sym(neightet, neineightet); + if (neineightet.tet != dummytet) { + sesymself(subloop); + tsbond(neineightet, subloop); + } + } else { + if (!b->quiet) { + printf("Warning: Subface %d is discarded.\n", i + in->firstnumber); + } + } + worklist[iorg] = 0; + worklist[idest] = 0; + worklist[iapex] = 0; + } + } + + // Phase (2). Indentify subfaces from the mesh. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Loop the four sides of the tetrahedron. + for (tetloop.loc = 0; tetloop.loc < 4; tetloop.loc++) { + tspivot(tetloop, subloop); + if (subloop.sh != dummysh) continue; + bondflag = false; + sym(tetloop, neightet); + if (neightet.tet == dummytet) { + // It's a hull face. Insert a subface at here. + bondflag = true; + } else { + // It's an interior face. Insert a subface if two tetrahedra have + // different attributes (i.e., they belong to two regions). + if (in->numberoftetrahedronattributes > 0) { + if (elemattribute(neightet.tet, + in->numberoftetrahedronattributes - 1) != + elemattribute(tetloop.tet, + in->numberoftetrahedronattributes - 1)) { + bondflag = true; + } + } + } + if (bondflag) { + adjustedgering(tetloop, CCW); + makeshellface(subfaces, &subloop); + torg = org(tetloop); + tdest = dest(tetloop); + tapex = apex(tetloop); + setsorg(subloop, torg); + setsdest(subloop, tdest); + setsapex(subloop, tapex); + // Set the vertices be FREESUBVERTEX to indicate they belong to a + // facet of the domain. They may be changed later. + setpointtype(torg, FREESUBVERTEX); + setpointtype(tdest, FREESUBVERTEX); + setpointtype(tapex, FREESUBVERTEX); + tsbond(tetloop, subloop); + if (neightet.tet != dummytet) { + sesymself(subloop); + tsbond(neightet, subloop); + } + } + } + tetloop.tet = tetrahedrontraverse(); + } + + // Set the connection between subfaces. A subsegment may have more than + // two subfaces sharing it, 'neighshlist' stores all subfaces sharing + // one edge. + neighshlist = new list(sizeof(face), NULL); + // Create a map from nodes to subfaces. + makesubfacemap(idx2facelist, facesperverlist); + + // Loop over the set of subfaces, setup the connection between subfaces. + subfaces->traversalinit(); + subloop.sh = shellfacetraverse(subfaces); + while (subloop.sh != (shellface *) NULL) { + for (i = 0; i < 3; i++) { + spivot(subloop, neighsh); + if (neighsh.sh == dummysh) { + // This side is 'empty', operate on it. + torg = sorg(subloop); + tdest = sdest(subloop); + tapex = sapex(subloop); + neighshlist->append(&subloop); + iorg = pointmark(torg) - in->firstnumber; + // Search its neighbor in the adjacent list of torg. + for (j = idx2facelist[iorg]; j < idx2facelist[iorg + 1]; j++) { + neighsh.sh = facesperverlist[j]; + if (neighsh.sh == subloop.sh) continue; + neighsh.shver = 0; + if (isfacehasedge(&neighsh, torg, tdest)) { + findedge(&neighsh, torg, tdest); + // Insert 'neighsh' into 'neighshlist'. + if (neighshlist->len() < 2) { + neighshlist->append(&neighsh); + } else { + for (index = 0; index < neighshlist->len() - 1; index++) { + sface1 = * (face *)(* neighshlist)[index]; + sface2 = * (face *)(* neighshlist)[index + 1]; + da1 = facedihedral(torg, tdest, sapex(sface1), sapex(neighsh)); + da2 = facedihedral(torg, tdest, sapex(sface1), sapex(sface2)); + if (da1 < da2) { + break; // Insert it after index. + } + } + neighshlist->insert(index + 1, &neighsh); + } + } + } + // Bond the subfaces in 'neighshlist'. + if (neighshlist->len() > 1) { + neighsh = * (face *)(* neighshlist)[0]; + for (j = 1; j <= neighshlist->len(); j++) { + if (j < neighshlist->len()) { + neineighsh = * (face *)(* neighshlist)[j]; + } else { + neineighsh = * (face *)(* neighshlist)[0]; + } + sbond1(neighsh, neineighsh); + neighsh = neineighsh; + } + } else { + // No neighbor subface be found, bond 'subloop' to itself. + sdissolve(subloop); // sbond(subloop, subloop); + } + neighshlist->clear(); + } + senextself(subloop); + } + subloop.sh = shellfacetraverse(subfaces); + } + + + // Segments will be introudced. Each segment has a unique marker (1-based). + marker = 1; + subfaces->traversalinit(); + subloop.sh = shellfacetraverse(subfaces); + while (subloop.sh != (shellface *) NULL) { + for (i = 0; i < 3; i++) { + sspivot(subloop, subseg); + if (subseg.sh == dummysh) { + // This side has no subsegment bonded, check it. + torg = sorg(subloop); + tdest = sdest(subloop); + tapex = sapex(subloop); + spivot(subloop, neighsh); + spivot(neighsh, neineighsh); + insertsegflag = false; + if (subloop.sh == neighsh.sh || subloop.sh != neineighsh.sh) { + // This side is either self-bonded or more than two subfaces, + // insert a subsegment at this side. + insertsegflag = true; + } else { + // Only two subfaces case. +#ifdef SELF_CHECK + assert(subloop.sh != neighsh.sh); +#endif + napex = sapex(neighsh); + sign = orient3d(torg, tdest, tapex, napex); + if (iscoplanar(torg, tdest, tapex, napex, sign, b->epsilon)) { + // Although they are coplanar, we still need to check if they + // have the same boundary marker. + insertsegflag = (shellmark(subloop) != shellmark(neighsh)); + } else { + // Non-coplanar. + insertsegflag = true; + } + } + if (insertsegflag) { + // Create a subsegment at this side. + makeshellface(subsegs, &subseg); + setsorg(subseg, torg); + setsdest(subseg, tdest); + // The two vertices have been marked as FREESUBVERTEX. Now mark + // them as NACUTEVERTEX. + setpointtype(torg, NACUTEVERTEX); + setpointtype(tdest, NACUTEVERTEX); + setshellmark(subseg, marker); + marker++; + // Bond all subfaces to this subsegment. + neighsh = subloop; + do { + ssbond(neighsh, subseg); + spivotself(neighsh); + if (neighsh.sh == dummysh) { + break; // Only one facet case. + } + } while (neighsh.sh != subloop.sh); + } + } + senextself(subloop); + } + subloop.sh = shellfacetraverse(subfaces); + } + + // Remember the number of input segments. + insegments = subsegs->items; + // Find the acute vertices and set them be type ACUTEVERTEX. + + // Indentify facets and set the facet marker (1-based) for subfaces. + markerlist = new list(sizeof(int), NULL, 256); + + subfaces->traversalinit(); + subloop.sh = shellfacetraverse(subfaces); + while (subloop.sh != (shellface *) NULL) { + // Only operate on uninfected subface, after operating, infect it. + if (!sinfected(subloop)) { + // A new facet is found. + marker = shellmark(subloop); + markerlist->append(&marker); + facetidx = markerlist->len(); // 'facetidx' starts from 1. + setshellmark(subloop, facetidx); + sinfect(subloop); + neighshlist->append(&subloop); + // Find out all subfaces of this facet (bounded by subsegments). + for (i = 0; i < neighshlist->len(); i++) { + neighsh = * (face *) (* neighshlist)[i]; + for (j = 0; j < 3; j++) { + sspivot(neighsh, subseg); + if (subseg.sh == dummysh) { + spivot(neighsh, neineighsh); + if (!sinfected(neineighsh)) { + // 'neineighsh' is in the same facet as 'subloop'. +#ifdef SELF_CHECK + assert(shellmark(neineighsh) == marker); +#endif + setshellmark(neineighsh, facetidx); + sinfect(neineighsh); + neighshlist->append(&neineighsh); + } + } + senextself(neighsh); + } + } + neighshlist->clear(); + } + subloop.sh = shellfacetraverse(subfaces); + } + // Uninfect all subfaces. + subfaces->traversalinit(); + subloop.sh = shellfacetraverse(subfaces); + while (subloop.sh != (shellface *) NULL) { +#ifdef SELF_CHECK + assert(sinfected(subloop)); +#endif + suninfect(subloop); + subloop.sh = shellfacetraverse(subfaces); + } + // Save the facet markers in 'in->facetmarkerlist'. + in->numberoffacets = markerlist->len(); + in->facetmarkerlist = new int[in->numberoffacets]; + for (i = 0; i < in->numberoffacets; i++) { + marker = * (int *) (* markerlist)[i]; + in->facetmarkerlist[i] = marker; + } + // Initialize the 'facetabovepointlist'. + facetabovepointarray = new point[in->numberoffacets + 1]; + for (i = 0; i < in->numberoffacets + 1; i++) { + facetabovepointarray[i] = (point) NULL; + } + + // The mesh contains boundary now. + checksubfaces = 1; + // The mesh is nonconvex now. + nonconvex = 1; + + /*// Is there periodic boundary confitions? + if (checkpbcs) { + tetgenio::pbcgroup *pg; + pbcdata *pd; + // Initialize the global array 'subpbcgrouptable'. + createsubpbcgrouptable(); + // Loop for each pbcgroup i. + for (i = 0; i < in->numberofpbcgroups; i++) { + pg = &(in->pbcgrouplist[i]); + pd = &(subpbcgrouptable[i]); + // Find all subfaces of pd, set each subface's group id be i. + for (j = 0; j < 2; j++) { + subfaces->traversalinit(); + subloop.sh = shellfacetraverse(subfaces); + while (subloop.sh != (shellface *) NULL) { + facetidx = shellmark(subloop); + marker = in->facetmarkerlist[facetidx - 1]; + if (marker == pd->fmark[j]) { + setshellpbcgroup(subloop, i); + pd->ss[j] = subloop; + } + subloop.sh = shellfacetraverse(subfaces); + } + } + if (pg->pointpairlist != (int *) NULL) { + // Set the connections between pbc point pairs. + for (j = 0; j < pg->numberofpointpairs; j++) { + iorg = pg->pointpairlist[j * 2] - in->firstnumber; + idest = pg->pointpairlist[j * 2 + 1] - in->firstnumber; + torg = idx2verlist[iorg]; + tdest = idx2verlist[idest]; + setpoint2pbcpt(torg, tdest); + setpoint2pbcpt(tdest, torg); + } + } + } + // Create the global array 'segpbcgrouptable'. + createsegpbcgrouptable(); + }*/ + + delete markerlist; + delete neighshlist; + delete [] worklist; + delete [] idx2tetlist; + delete [] tetsperverlist; + delete [] idx2facelist; + delete [] facesperverlist; + delete [] idx2verlist; + + return hullsize; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// insertconstrainedpoints() Insert a list of constrained points. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::insertconstrainedpoints(tetgenio *addio) +{ + queue *flipqueue; + triface searchtet; + face checksh, checkseg; + point newpoint; + enum locateresult loc; + REAL *attr; + bool insertflag; + int covertices, outvertices; + int index; + int i, j; + + if (!b->quiet) { + printf("Insert additional points into mesh.\n"); + } + + // Initialize 'flipqueue'. + flipqueue = new queue(sizeof(badface)); + recenttet.tet = dummytet; + covertices = outvertices = 0; + + index = 0; + for (i = 0; i < addio->numberofpoints; i++) { + // Create a newpoint. + makepoint(&newpoint); + newpoint[0] = addio->pointlist[index++]; + newpoint[1] = addio->pointlist[index++]; + newpoint[2] = addio->pointlist[index++]; + // Read the add point attributes if current points have attributes. + if ((addio->numberofpointattributes > 0) && + (in->numberofpointattributes > 0)) { + attr = addio->pointattributelist + addio->numberofpointattributes * i; + for (j = 0; j < in->numberofpointattributes; j++) { + if (j < addio->numberofpointattributes) { + newpoint[3 + j] = attr[j]; + } + } + } + // Find the location of the inserted point. + searchtet = recenttet; + loc = locate(newpoint, &searchtet); + if (loc != ONVERTEX) { + loc = adjustlocate(newpoint, &searchtet, loc, b->epsilon2); + } + if (loc == OUTSIDE) { + loc = hullwalk(newpoint, &searchtet); + if (loc == OUTSIDE) { + // Perform a brute-force search. + tetrahedrons->traversalinit(); + searchtet.tet = tetrahedrontraverse(); + while (searchtet.tet != (tetrahedron *) NULL) { + loc = adjustlocate(newpoint, &searchtet, OUTSIDE, b->epsilon2); + if (loc != OUTSIDE) break; + searchtet.tet = tetrahedrontraverse(); + } + } + } + // Insert the point if it not lies outside or on a vertex. + insertflag = true; + switch (loc) { + case INTETRAHEDRON: + setpointtype(newpoint, FREEVOLVERTEX); + splittetrahedron(newpoint, &searchtet, flipqueue); + break; + case ONFACE: + tspivot(searchtet, checksh); + if (checksh.sh != dummysh) { + // It is a boundary face. Don't insert it if -Y option is used. + if (b->nobisect) { + insertflag = false; + } else { + setpointtype(newpoint, FREESUBVERTEX); + setpoint2sh(newpoint, sencode(checksh)); + } + } else { + setpointtype(newpoint, FREEVOLVERTEX); + } + if (insertflag) { + splittetface(newpoint, &searchtet, flipqueue); + } + break; + case ENCSEGMENT: + case ONEDGE: + tsspivot(&searchtet, &checkseg); + if (checkseg.sh != dummysh) { + if (b->nobisect) { + insertflag = false; + } else { + setpointtype(newpoint, FREESEGVERTEX); + setpoint2seg(newpoint, sencode(checkseg)); + } + } else { + tspivot(searchtet, checksh); + if (checksh.sh != dummysh) { + if (b->nobisect) { + insertflag = false; + } else { + setpointtype(newpoint, FREESUBVERTEX); + setpoint2sh(newpoint, sencode(checksh)); + } + } else { + setpointtype(newpoint, FREEVOLVERTEX); + } + } + if (insertflag) { + splittetedge(newpoint, &searchtet, flipqueue); + } + break; + case ONVERTEX: + insertflag = false; + covertices++; + break; + case OUTSIDE: + insertflag = false; + outvertices++; + break; + } + // Remember the tetrahedron for next point searching. + recenttet = searchtet; + if (!insertflag) { + pointdealloc(newpoint); + } else { + lawson3d(flipqueue); + } + } + + if (b->verbose) { + if (covertices > 0) { + printf(" %d constrained points already exist.\n", covertices); + } + if (outvertices > 0) { + printf(" %d constrained points lie outside the mesh.\n", outvertices); + } + printf(" %d constrained points have been inserted.\n", + addio->numberofpoints - covertices - outvertices); + } + + delete flipqueue; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// p1interpolatebgm() Set pt size by p^1 interpolation in background mesh.// +// // +// On input, 'bgmtet' is a suggesting tet in background mesh for searching // +// 'pt'. It returns the tet containing 'pt'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::p1interpolatebgm(point pt, triface* bgmtet, long *scount) +{ + point bgmpt[4]; + enum locateresult loc; + REAL vol, volpt[4], weights[4]; + int i; + + loc = bgm->preciselocate(pt, bgmtet, bgm->tetrahedrons->items); + if (loc == OUTSIDE) { + loc = bgm->hullwalk(pt, bgmtet); + if (loc == OUTSIDE) { + // Perform a brute-force search. + if (!b->quiet && b->verbose) { + printf("Warning: Global point location.\n"); + } + if (scount) (*scount)++; + bgm->tetrahedrons->traversalinit(); // in bgm + bgmtet->tet = bgm->tetrahedrontraverse(); // in bgm + while (bgmtet->tet != (tetrahedron *) NULL) { + loc = bgm->adjustlocate(pt, bgmtet, OUTSIDE, b->epsilon); + if (loc != OUTSIDE) break; + bgmtet->tet = bgm->tetrahedrontraverse(); // in bgm + } + } + } + if (loc != OUTSIDE) { + // Let p remember t. + setpoint2bgmtet(pt, encode(*bgmtet)); // in m + // get the corners of t. + for (i = 0; i < 4; i++) bgmpt[i] = (point) bgmtet->tet[4 + i]; + // Calculate the weighted coordinates of p in t. + vol = orient3d(bgmpt[0], bgmpt[1], bgmpt[2], bgmpt[3]); + volpt[0] = orient3d(pt, bgmpt[1], bgmpt[2], bgmpt[3]); + volpt[1] = orient3d(bgmpt[0], pt, bgmpt[2], bgmpt[3]); + volpt[2] = orient3d(bgmpt[0], bgmpt[1], pt, bgmpt[3]); + volpt[3] = orient3d(bgmpt[0], bgmpt[1], bgmpt[2], pt); + for (i = 0; i < 4; i++) weights[i] = fabs(volpt[i] / vol); + // Interpolate the solution for p. + for (i = 0; i < bgm->in->numberofpointmtrs; i++) { + pt[pointmtrindex + i] = weights[0] * bgmpt[0][bgm->pointmtrindex + i] + + weights[1] * bgmpt[1][bgm->pointmtrindex + i] + + weights[2] * bgmpt[2][bgm->pointmtrindex + i] + + weights[3] * bgmpt[3][bgm->pointmtrindex + i]; + } + } else { + setpoint2bgmtet(pt, (tetrahedron) NULL); // in m + } + return loc != OUTSIDE; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// interpolatesizemap() Interpolate the point sizes in the given size map.// +// // +// The size map is specified on each node of the background mesh. The points // +// of current mesh get their sizes by interpolating. // +// // +// This function operation on two meshes simultaneously, the current mesh m, // +// and the background mesh bgm. After this function, each point p in m will // +// have a pointer to a tet of bgm. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::interpolatesizemap() +{ + list *adjtetlist; + triface tetloop, neightet, bgmtet; + point searchpt; + long scount; + int *worklist; + int sepcount; + int i; + + if (b->verbose) { + printf(" Interpolating size map.\n"); + } + + worklist = new int[points->items + 1]; + for (i = 0; i < points->items + 1; i++) worklist[i] = 0; + sepcount = 0; + scount = 0l; + + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + if (!infected(tetloop)) { + // Find a new subdomain. + adjtetlist = new list(sizeof(triface), NULL, 1024); + infect(tetloop); + // Search the four corners in background mesh. + for (i = 0; i < 4; i++) { + searchpt = (point) tetloop.tet[4 + i]; + // Mark the point for avoiding multiple searchings. + // assert(worklist[pointmark(searchpt)] == 0); + worklist[pointmark(searchpt)] = 1; + // Does it contain a pointer to bgm tet? + bgm->decode(point2bgmtet(searchpt), bgmtet); + if (bgm->isdead(&bgmtet)) { + bgmtet = bgm->recenttet; + } + if (p1interpolatebgm(searchpt, &bgmtet, &scount)) { + bgm->recenttet = bgmtet; + } + } // for (i = 0; i < 4; i++) + // Collect all tets in this region. + adjtetlist->append(&tetloop); + // Collect the tets in the subdomain. + for (i = 0; i < adjtetlist->len(); i++) { + tetloop = * (triface *)(* adjtetlist)[i]; + for (tetloop.loc = 0; tetloop.loc < 4; tetloop.loc++) { + sym(tetloop, neightet); + if ((neightet.tet != dummytet) && !infected(neightet)) { + // Only need to search for the opposite point. + searchpt = oppo(neightet); + if (worklist[pointmark(searchpt)] == 0) { + worklist[pointmark(searchpt)] = 1; + decode(point2bgmtet(searchpt), bgmtet); + if (bgm->isdead(&bgmtet)) { + bgmtet = bgm->recenttet; + } + if (p1interpolatebgm(searchpt, &bgmtet, &scount)) { + bgm->recenttet = bgmtet; + } + } + infect(neightet); + adjtetlist->append(&neightet); + } + } + } + // Increase the number of separated domains. + sepcount++; + delete adjtetlist; + } // if (!infect()) + tetloop.tet = tetrahedrontraverse(); + } + + // Unmark all tets. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + assert(infected(tetloop)); + uninfect(tetloop); + tetloop.tet = tetrahedrontraverse(); + } + delete [] worklist; + +#ifdef SELF_CHECK + if (b->verbose && scount > 0l) { + printf(" %ld brute-force searches.\n", scount); + } + if (b->verbose && sepcount > 0) { + printf(" %d separate domains.\n", sepcount); + } +#endif +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// duplicatebgmesh() Duplicate current mesh to background mesh. // +// // +// Current mesh 'this' is copied into 'this->bgm'.Both meshes share the same // +// input tetgenio object, 'this->in', same tetgenbehavior object 'this->b'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::duplicatebgmesh() +{ + triface tetloop, btetloop; + triface symtet, bsymtet; + face bhullsh, bneighsh; + point *idx2bplist, *tetptbaklist; + point ploop, bploop; + int idx, i; + + if (!b->quiet) { + printf("Duplicating background mesh.\n"); + } + + // The background mesh itself has no background mesh. + // assert(bgm->bgm == (tetgenmesh *) NULL); + // The space for metric tensor should be allocated. + // assert(bgm->sizeoftensor > 0); + + // Copy point list. + idx2bplist = new point[points->items + 1]; + idx = in->firstnumber; + points->traversalinit(); + ploop = pointtraverse(); + while (ploop != (point) NULL) { + bgm->makepoint(&bploop); + // Copy coordinates, attributes. + for (i = 0; i < 3 + in->numberofpointattributes; i++) { + bploop[i] = ploop[i]; + } + // Transfer the metric tensor. + for (i = 0; i < bgm->sizeoftensor; i++) { + bploop[bgm->pointmtrindex + i] = ploop[pointmtrindex + i]; + // Metric tensor should have a positive value. + if (bploop[bgm->pointmtrindex + i] <= 0.0) { + printf("Error: Point %d has non-positive size %g (-m option).\n", + bgm->pointmark(bploop), bploop[bgm->pointmtrindex + i]); + terminatetetgen(3); + } + } + // Remember the point for searching. + idx2bplist[idx++] = bploop; + ploop = pointtraverse(); + } + + // Copy tetrahedra list. + tetptbaklist = new point[tetrahedrons->items + 1]; + idx = in->firstnumber; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + bgm->maketetrahedron(&btetloop); + // Set the four corners. + for (i = 0; i < 4; i++) { + ploop = (point) tetloop.tet[4 + i]; + bploop = idx2bplist[pointmark(ploop)]; + btetloop.tet[4 + i] = (tetrahedron) bploop; + } + // Remember the tet for setting neighbor connections. + tetptbaklist[idx++] = (point) tetloop.tet[4]; + tetloop.tet[4] = (tetrahedron) btetloop.tet; + tetloop.tet = tetrahedrontraverse(); + } + + // Set the connections between background tetrahedra. Create background + // hull subfaces. Create the map of point-to-bgmtet. + idx = in->firstnumber; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Get the corresponding background tet. + btetloop.tet = (tetrahedron *) tetloop.tet[4]; + // Set the four neighbors. + for (tetloop.loc = 0; tetloop.loc < 4; tetloop.loc++) { + btetloop.loc = tetloop.loc; + sym(tetloop, symtet); + if ((symtet.tet != dummytet) && (symtet.tet > tetloop.tet)) { + // Operate on the un-connected interior face. + bsymtet.tet = (tetrahedron *) symtet.tet[4]; // The saved bgm tet. + bsymtet.loc = symtet.loc; + bgm->bond(btetloop, bsymtet); + } else if (symtet.tet == dummytet) { + // Create a subface in background mesh. + bgm->makeshellface(bgm->subfaces, &bhullsh); + bgm->adjustedgering(btetloop, CCW); // face to inside. + bgm->setsorg(bhullsh, bgm->org(btetloop)); + bgm->setsdest(bhullsh, bgm->dest(btetloop)); + bgm->setsapex(bhullsh, bgm->apex(btetloop)); + bgm->tsbond(btetloop, bhullsh); + // Remember a hull face for point location. + bgm->dummytet[0] = bgm->encode(btetloop); + } + } + // Restore the backup tet point. + tetloop.tet[4] = (tetrahedron) tetptbaklist[idx++]; + // Make the point-to-bgmtet map for size interpolation. + btetloop.loc = 0; + for (i = 0; i < 4; i++) { + ploop = (point) tetloop.tet[4 + i]; + setpoint2bgmtet(ploop, bgm->encode(btetloop)); + } + // Go to the next tet, btet. + tetloop.tet = tetrahedrontraverse(); + } + + // Connect bgm hull subfaces. Note: all hull subfaces form a 2-manifold. + bgm->subfaces->traversalinit(); + bhullsh.sh = bgm->shellfacetraverse(bgm->subfaces); + while (bhullsh.sh != (shellface *) NULL) { + bhullsh.shver = 0; + bgm->stpivot(bhullsh, btetloop); + assert(btetloop.tet != bgm->dummytet); + bgm->adjustedgering(btetloop, CCW); + for (i = 0; i < 3; i++) { + bgm->spivot(bhullsh, bneighsh); + if (bneighsh.sh == bgm->dummysh) { + // This side is open, operate on it. + bsymtet = btetloop; + while (bgm->fnextself(bsymtet)); + bgm->tspivot(bsymtet, bneighsh); + bgm->findedge(&bneighsh, bgm->sdest(bhullsh), bgm->sorg(bhullsh)); + bgm->sbond(bhullsh, bneighsh); + } + bgm->enextself(btetloop); + bgm->senextself(bhullsh); + } + bhullsh.sh = bgm->shellfacetraverse(bgm->subfaces); + } + + delete [] tetptbaklist; + delete [] idx2bplist; +} + +//// //// +//// //// +//// reconstruct_cxx ////////////////////////////////////////////////////////// + +//// refine_cxx /////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// marksharpsegments() Mark sharp segments. // +// // +// A segment s is called sharp if it is in one of the two cases: // +// (1) There is a segment s' intersecting with s. The internal angle (*) // +// between s and s' is acute. // +// (2) There are two facets f1 and f2 intersecting at s. The internal // +// dihedral angle (*) between f1 and f2 is acute. // +// This routine finds the sharp segments and marked them as type SHARP. // +// // +// The minimum angle between segments (minfaceang) and the minimum dihedral // +// angle between facets (minfacetdihed) are calulcated. // +// // +// (*) The internal angle (or dihedral) bewteen two features means the angle // +// inside the mesh domain. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::marksharpsegments(REAL sharpangle) +{ + triface adjtet; + face startsh, spinsh, neighsh; + face segloop, prevseg, nextseg; + point eorg, edest; + REAL ang, smallang; + bool issharp; + int sharpsegcount; + + if (b->verbose > 0) { + printf(" Marking sharp segments.\n"); + } + + smallang = sharpangle * PI / 180.; + sharpsegcount = 0; + eorg = edest = (point) NULL; // To avoid compiler warnings. + + // A segment s may have been split into many subsegments. Operate the one + // which contains the origin of s. Then mark the rest of subsegments. + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + segloop.shver = 0; + senext2(segloop, prevseg); + spivotself(prevseg); + if (prevseg.sh == dummysh) { + // Operate on this seg s. + issharp = false; + spivot(segloop, startsh); + if (startsh.sh != dummysh) { + // First check if two facets form an acute dihedral angle at s. + eorg = sorg(segloop); + edest = sdest(segloop); + spinsh = startsh; + do { + if (sorg(spinsh) != eorg) { + sesymself(spinsh); + } + // Only do test when the spinsh is faceing inward. + stpivot(spinsh, adjtet); + if (adjtet.tet != dummytet) { + // Get the subface on the adjacent facet. + spivot(spinsh, neighsh); + // Do not calculate if it is self-bonded. + if ((neighsh.sh != dummysh) && (neighsh.sh != spinsh.sh)) { + // Calculate the dihedral angle between the two subfaces. + ang = facedihedral(eorg, edest, sapex(spinsh), sapex(neighsh)); + // Only do check if a sharp angle has not been found. + if (!issharp) issharp = (ang < smallang); + // Remember the smallest facet dihedral angle. + minfacetdihed = minfacetdihed < ang ? minfacetdihed : ang; + } + } + // Go to the next facet. + spivotself(spinsh); + if (spinsh.sh == dummysh) break; // A single subface case. + } while (spinsh.sh != startsh.sh); + // if (!issharp) { + // Second check if s forms an acute angle with another seg. + spinsh = startsh; + do { + if (sorg(spinsh) != eorg) { + sesymself(spinsh); + } + // Calculate the angle between s and s' of this facet. + neighsh = spinsh; + // Rotate edges around 'eorg' until meeting another seg s'. Such + // seg (s') must exist since the facet is segment-bounded. + // The sum of the angles of faces at 'eorg' gives the internal + // angle between the two segments. + ang = 0.0; + do { + ang += interiorangle(eorg, sdest(neighsh), sapex(neighsh), NULL); + senext2self(neighsh); + sspivot(neighsh, nextseg); + if (nextseg.sh != dummysh) break; + // Go to the next coplanar subface. + spivotself(neighsh); + assert(neighsh.sh != dummysh); + if (sorg(neighsh) != eorg) { + sesymself(neighsh); + } + } while (true); + // Only do check if a sharp angle has not been found. + if (!issharp) issharp = (ang < smallang); + // Remember the smallest input face angle. + minfaceang = minfaceang < ang ? minfaceang : ang; + // Go to the next facet. + spivotself(spinsh); + if (spinsh.sh == dummysh) break; // A single subface case. + } while (spinsh.sh != startsh.sh); + // } + } + if (issharp) { + setshelltype(segloop, SHARP); + // Set the type for all subsegments at forwards. + edest = sdest(segloop); + senext(segloop, nextseg); + spivotself(nextseg); + while (nextseg.sh != dummysh) { + setshelltype(nextseg, SHARP); + // Adjust the direction of nextseg. + nextseg.shver = 0; + if (sorg(nextseg) != edest) { + sesymself(nextseg); + } + assert(sorg(nextseg) == edest); + edest = sdest(nextseg); + // Go the next connected subsegment at edest. + senextself(nextseg); + spivotself(nextseg); + } + sharpsegcount++; + } + } + segloop.sh = shellfacetraverse(subsegs); + } + + // So far we have marked all segments which have an acute dihedral angle + // or whose ORIGINs have an acute angle. In the un-marked subsegments, + // there are possible ones whose DESTINATIONs have an acute angle. + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + // Only operate if s is non-sharp and contains the dest. + segloop.shver = 0; + senext(segloop, nextseg); + spivotself(nextseg); + // if ((nextseg.sh == dummysh) && (shelltype(segloop) != SHARP)) { + if (nextseg.sh == dummysh) { + // issharp = false; + issharp = (shelltype(segloop) == SHARP); + spivot(segloop, startsh); + if (startsh.sh != dummysh) { + // Check if s forms an acute angle with another seg. + eorg = sdest(segloop); + spinsh = startsh; + do { + if (sorg(spinsh) != eorg) { + sesymself(spinsh); + } + // Calculate the angle between s and s' of this facet. + neighsh = spinsh; + ang = 0.0; + do { + ang += interiorangle(eorg, sdest(neighsh), sapex(neighsh), NULL); + senext2self(neighsh); + sspivot(neighsh, nextseg); + if (nextseg.sh != dummysh) break; + // Go to the next coplanar subface. + spivotself(neighsh); + assert(neighsh.sh != dummysh); + if (sorg(neighsh) != eorg) { + sesymself(neighsh); + } + } while (true); + // Only do check if a sharp angle has not been found. + if (!issharp) issharp = (ang < smallang); + // Remember the smallest input face angle. + minfaceang = minfaceang < ang ? minfaceang : ang; + // Go to the next facet. + spivotself(spinsh); + if (spinsh.sh == dummysh) break; // A single subface case. + } while (spinsh.sh != startsh.sh); + } + if (issharp) { + setshelltype(segloop, SHARP); + // Set the type for all subsegments at backwards. + eorg = sorg(segloop); + senext2(segloop, prevseg); + spivotself(prevseg); + while (prevseg.sh != dummysh) { + setshelltype(prevseg, SHARP); + // Adjust the direction of prevseg. + prevseg.shver = 0; + if (sdest(prevseg) != eorg) { + sesymself(prevseg); + } + assert(sdest(prevseg) == eorg); + eorg = sorg(prevseg); + // Go to the next connected subsegment at eorg. + senext2self(prevseg); + spivotself(prevseg); + } + sharpsegcount++; + } + } + segloop.sh = shellfacetraverse(subsegs); + } + + if ((b->verbose > 0) && (sharpsegcount > 0)) { + printf(" %d sharp segments.\n", sharpsegcount); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// decidefeaturepointsizes() Decide the sizes for all feature points. // +// // +// A feature point is a point on a sharp segment. Every feature point p will // +// be assigned a positive size which is the radius of the protecting ball. // +// // +// The size of a feature point may be specified by one of the following ways:// +// (1) directly specifying on an input vertex (by using .mtr file); // +// (2) imposing a fixed maximal volume constraint ('-a__' option); // +// (3) imposing a maximal volume constraint in a region ('-a' option); // +// (4) imposing a maximal area constraint on a facet (in .var file); // +// (5) imposing a maximal length constraint on a segment (in .var file); // +// (6) combining (1) - (5). // +// (7) automatically deriving a size if none of (1) - (6) is available. // +// In case (7),the size of p is set to be the smallest edge length among all // +// edges connecting at p. The final size of p is the minimum of (1) - (7). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::decidefeaturepointsizes() +{ + list *tetlist, *verlist; + shellface **segsperverlist; + triface starttet; + face shloop; + face checkseg, prevseg, nextseg, testseg; + point ploop, adjpt, e1, e2; + REAL lfs_0, len, vol, maxlen, varlen; + bool isfeature; + int *idx2seglist; + int featurecount; + int idx, i, j; + + if (b->verbose > 0) { + printf(" Deciding feature-point sizes.\n"); + } + + // Constructing a map from vertices to segments. + makesegmentmap(idx2seglist, segsperverlist); + // Initialize working lists. + tetlist = new list(sizeof(triface), NULL, 256); + verlist = new list(sizeof(point *), NULL, 256); + + if (b->fixedvolume) { + // A fixed volume constraint is imposed. This gives an upper bound of + // the maximal radius of the protect ball of a vertex. + maxlen = pow(6.0 * b->maxvolume, 1.0/3.0); + } + + // First only assign a size of p if p is not a Steiner point. The size of + // a Steiner point will be interpolated later from the endpoints of the + // segment on which it lies. + featurecount = 0; + points->traversalinit(); + ploop = pointtraverse(); + while (ploop != (point) NULL) { + if (pointtype(ploop) != FREESEGVERTEX) { + // Is p a feature point? + isfeature = false; + idx = pointmark(ploop) - in->firstnumber; + for (i = idx2seglist[idx]; i < idx2seglist[idx + 1] && !isfeature; i++) { + checkseg.sh = segsperverlist[i]; + isfeature = (shelltype(checkseg) == SHARP); + } + // Decide the size of p if it is on a sharp segment. + if (isfeature) { + // Find a tet containing p; + sstpivot(&checkseg, &starttet); + // Form star(p). + tetlist->append(&starttet); + formstarpolyhedron(ploop, tetlist, verlist, true); + // Decide the size for p if no input size is given on input. + if (ploop[pointmtrindex] == 0.0) { + // Calculate lfs_0(p). + lfs_0 = longest; + for (i = 0; i < verlist->len(); i++) { + adjpt = * (point *)(* verlist)[i]; + if (pointtype(adjpt) == FREESEGVERTEX) { + // A Steiner point q. Find the seg it lies on. + sdecode(point2seg(adjpt), checkseg); + assert(checkseg.sh != dummysh); + checkseg.shver = 0; + // Find the origin of this seg. + prevseg = checkseg; + e1 = sorg(prevseg); + do { + senext2(prevseg, testseg); + spivotself(testseg); + if (testseg.sh == dummysh) break; + // Go to the previous subseg. + prevseg = testseg; + // Adjust the direction of the previous subsegment. + prevseg.shver = 0; + if (sdest(prevseg) != e1) { + sesymself(prevseg); + } + assert(sdest(prevseg) == e1); + e1 = sorg(prevseg); + } while (true); + // Find the dest of this seg. + nextseg = checkseg; + e2 = sdest(nextseg); + do { + senext(nextseg, testseg); + spivotself(testseg); + if (testseg.sh == dummysh) break; + // Go to the next subseg. + nextseg = testseg; + // Adjust the direction of the nextseg. + nextseg.shver = 0; + if (sorg(nextseg) != e2) { + sesymself(nextseg); + } + assert(sorg(nextseg) == e2); + e2 = sdest(nextseg); + } while (true); + // e1 = sorg(prevseg); + // e2 = sdest(nextseg); + // Check if p is the origin or the dest of this seg. + if (ploop == e1) { + // Set q to be the dest of this seg. + adjpt = e2; + } else if (ploop == e2) { + // Set q to be the org of this seg. + adjpt = e1; + } + } + len = distance(ploop, adjpt); + if (lfs_0 > len) lfs_0 = len; + } + ploop[pointmtrindex] = lfs_0; + } + if (b->fixedvolume) { + // A fixed volume constraint is imposed. Adjust H(p) <= maxlen. + if (ploop[pointmtrindex] > maxlen) { + ploop[pointmtrindex] = maxlen; + } + } + if (b->varvolume) { + // Variant volume constraints are imposed. Adjust H(p) <= varlen. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + vol = volumebound(starttet.tet); + if (vol > 0.0) { + varlen = pow(6 * vol, 1.0/3.0); + if (ploop[pointmtrindex] > varlen) { + ploop[pointmtrindex] = varlen; + } + } + } + } + // Clear working lists. + tetlist->clear(); + verlist->clear(); + featurecount++; + } else { + // NO feature point, set the size of p be zero. + ploop[pointmtrindex] = 0.0; + } + } // if (pointtype(ploop) != FREESEGVERTEX) { + ploop = pointtraverse(); + } + + if (b->verbose > 1) { + printf(" %d feature points.\n", featurecount); + } + + if (!b->refine) { + // Second only assign sizes for all Steiner points. A Steiner point p + // inserted on a sharp segment s is assigned a size by interpolating + // the sizes of the original endpoints of s. + featurecount = 0; + points->traversalinit(); + ploop = pointtraverse(); + while (ploop != (point) NULL) { + if (pointtype(ploop) == FREESEGVERTEX) { + if (ploop[pointmtrindex] == 0.0) { + sdecode(point2seg(ploop), checkseg); + assert(checkseg.sh != dummysh); + if (shelltype(checkseg) == SHARP) { + checkseg.shver = 0; + // Find the origin of this seg. + prevseg = checkseg; + e1 = sorg(prevseg); + do { + senext2(prevseg, testseg); + spivotself(testseg); + if (testseg.sh == dummysh) break; + prevseg = testseg; // Go the previous subseg. + // Adjust the direction of this subsegmnt. + prevseg.shver = 0; + if (sdest(prevseg) != e1) { + sesymself(prevseg); + } + assert(sdest(prevseg) == e1); + e1 = sorg(prevseg); + } while (true); + // Find the dest of this seg. + nextseg = checkseg; + e2 = sdest(nextseg); + do { + senext(nextseg, testseg); + spivotself(testseg); + if (testseg.sh == dummysh) break; + nextseg = testseg; // Go the next subseg. + // Adjust the direction of this subsegment. + nextseg.shver = 0; + if (sorg(nextseg) != e2) { + sesymself(nextseg); + } + assert(sorg(nextseg) == e2); + e2 = sdest(nextseg); + } while (true); + // e1 = sorg(prevseg); + // e2 = sdest(nextseg); + len = distance(e1, e2); + lfs_0 = distance(e1, ploop); + // The following assert() happens when -Y option is used. + if (b->nobisect == 0) { + assert(lfs_0 < len); + } + ploop[pointmtrindex] = e1[pointmtrindex] + + (lfs_0 / len) * (e2[pointmtrindex] - e1[pointmtrindex]); + featurecount++; + } else { + // NO feature point, set the size of p be zero. + ploop[pointmtrindex] = 0.0; + } // if (shelltype(checkseg) == SHARP) + } // if (ploop[pointmtrindex] == 0.0) + } // if (pointtype(ploop) != FREESEGVERTEX) + ploop = pointtraverse(); + } + if ((b->verbose > 1) && (featurecount > 0)) { + printf(" %d Steiner feature points.\n", featurecount); + } + } + + if (varconstraint) { + // A .var file exists. Adjust feature sizes. + if (in->facetconstraintlist) { + // Have facet area constrains. + subfaces->traversalinit(); + shloop.sh = shellfacetraverse(subfaces); + while (shloop.sh != (shellface *) NULL) { + varlen = areabound(shloop); + if (varlen > 0.0) { + // Check if the three corners are feature points. + varlen = sqrt(varlen); + for (j = 0; j < 3; j++) { + ploop = (point) shloop.sh[3 + j]; + isfeature = false; + idx = pointmark(ploop) - in->firstnumber; + for (i = idx2seglist[idx]; i < idx2seglist[idx + 1] && !isfeature; + i++) { + checkseg.sh = segsperverlist[i]; + isfeature = (shelltype(checkseg) == SHARP); + } + if (isfeature) { + assert(ploop[pointmtrindex] > 0.0); + if (ploop[pointmtrindex] > varlen) { + ploop[pointmtrindex] = varlen; + } + } + } // for (j = 0; j < 3; j++) + } + shloop.sh = shellfacetraverse(subfaces); + } + } + if (in->segmentconstraintlist) { + // Have facet area constrains. + subsegs->traversalinit(); + shloop.sh = shellfacetraverse(subsegs); + while (shloop.sh != (shellface *) NULL) { + varlen = areabound(shloop); + if (varlen > 0.0) { + // Check if the two endpoints are feature points. + for (j = 0; j < 2; j++) { + ploop = (point) shloop.sh[3 + j]; + isfeature = false; + idx = pointmark(ploop) - in->firstnumber; + for (i = idx2seglist[idx]; i < idx2seglist[idx + 1] && !isfeature; + i++) { + checkseg.sh = segsperverlist[i]; + isfeature = (shelltype(checkseg) == SHARP); + } + if (isfeature) { + assert(ploop[pointmtrindex] > 0.0); + if (ploop[pointmtrindex] > varlen) { + ploop[pointmtrindex] = varlen; + } + } + } // for (j = 0; j < 2; j++) + } + shloop.sh = shellfacetraverse(subsegs); + } + } + } // if (varconstraint) + + delete [] segsperverlist; + delete [] idx2seglist; + delete tetlist; + delete verlist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// enqueueencsub() Add an encroached subface into the queue. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::enqueueencsub(face* testsub, point encpt, int quenumber, + REAL* cent) +{ + badface *encsub; + int i; + + if (!smarktested(*testsub)) { + if (!shell2badface(*testsub)) { + encsub = (badface *) badsubfaces->alloc(); + encsub->ss = *testsub; + encsub->forg = sorg(*testsub); + encsub->fdest = sdest(*testsub); + encsub->fapex = sapex(*testsub); + encsub->foppo = (point) encpt; + for (i = 0; i < 3; i++) encsub->cent[i] = cent[i]; + encsub->nextitem = (badface *) NULL; + // Set the pointer of 'encsubseg' into 'testsub'. It has two purposes: + // (1) We can regonize it is encroached; (2) It is uniquely queued. + setshell2badface(encsub->ss, encsub); + // Add the subface to the end of a queue (quenumber = 2, high priority). + *subquetail[quenumber] = encsub; + // Maintain a pointer to the NULL pointer at the end of the queue. + subquetail[quenumber] = &encsub->nextitem; + if (b->verbose > 2) { + printf(" Queuing subface (%d, %d, %d) [%d].\n", + pointmark(encsub->forg), pointmark(encsub->fdest), + pointmark(encsub->fapex), quenumber); + } + } + } else { + if (b->verbose > 2) { + printf(" Ignore an encroached subface (%d, %d, %d).\n", + pointmark(sorg(*testsub)), pointmark(sdest(*testsub)), + pointmark(sapex(*testsub))); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// dequeueencsub() Remove an enc-subface from the front of the queue. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::badface* tetgenmesh::dequeueencsub(int* pquenumber) +{ + badface *result; + int quenumber; + + // Look for a nonempty queue. + for (quenumber = 2; quenumber >= 0; quenumber--) { + result = subquefront[quenumber]; + if (result != (badface *) NULL) { + // Remove the badface from the queue. + subquefront[quenumber] = result->nextitem; + // Maintain a pointer to the NULL pointer at the end of the queue. + if (subquefront[quenumber] == (badface *) NULL) { + subquetail[quenumber] = &subquefront[quenumber]; + } + *pquenumber = quenumber; + return result; + } + } + return (badface *) NULL; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// enqueuebadtet() Add a tetrahedron into the queue. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::enqueuebadtet(triface* testtet, REAL ratio2, REAL* cent) +{ + badface *newbadtet; + int queuenumber; + int i; + + // Allocate space for the bad tetrahedron. + newbadtet = (badface *) badtetrahedrons->alloc(); + newbadtet->tt = *testtet; + newbadtet->key = ratio2; + if (cent != NULL) { + for (i = 0; i < 3; i++) newbadtet->cent[i] = cent[i]; + } else { + for (i = 0; i < 3; i++) newbadtet->cent[i] = 0.0; + } + newbadtet->forg = org(*testtet); + newbadtet->fdest = dest(*testtet); + newbadtet->fapex = apex(*testtet); + newbadtet->foppo = oppo(*testtet); + newbadtet->nextitem = (badface *) NULL; + // Determine the appropriate queue to put the bad tetrahedron into. + if (ratio2 > b->goodratio) { + // queuenumber = (int) ((ratio2 - b->goodratio) / 0.5); + queuenumber = (int) (64.0 - 64.0 / ratio2); + // 'queuenumber' may overflow (negative) caused by a very large ratio. + if ((queuenumber > 63) || (queuenumber < 0)) { + queuenumber = 63; + } + } else { + // It's not a bad ratio; put the tet in the lowest-priority queue. + queuenumber = 0; + } + + // Are we inserting into an empty queue? + if (tetquefront[queuenumber] == (badface *) NULL) { + // Yes. Will this become the highest-priority queue? + if (queuenumber > firstnonemptyq) { + // Yes, this is the highest-priority queue. + nextnonemptyq[queuenumber] = firstnonemptyq; + firstnonemptyq = queuenumber; + } else { + // No. Find the queue with next higher priority. + i = queuenumber + 1; + while (tetquefront[i] == (badface *) NULL) { + i++; + } + // Mark the newly nonempty queue as following a higher-priority queue. + nextnonemptyq[queuenumber] = nextnonemptyq[i]; + nextnonemptyq[i] = queuenumber; + } + // Put the bad tetrahedron at the beginning of the (empty) queue. + tetquefront[queuenumber] = newbadtet; + } else { + // Add the bad tetrahedron to the end of an already nonempty queue. + tetquetail[queuenumber]->nextitem = newbadtet; + } + // Maintain a pointer to the last tetrahedron of the queue. + tetquetail[queuenumber] = newbadtet; + + if (b->verbose > 2) { + printf(" Queueing bad tet: (%d, %d, %d, %d), ratio %g, qnum %d.\n", + pointmark(newbadtet->forg), pointmark(newbadtet->fdest), + pointmark(newbadtet->fapex), pointmark(newbadtet->foppo), + sqrt(ratio2), queuenumber); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// dequeuebadtet() Remove a tetrahedron from the front of the queue. // +// // +/////////////////////////////////////////////////////////////////////////////// + +tetgenmesh::badface* tetgenmesh::topbadtetra() +{ + // Keep a record of which queue was accessed in case dequeuebadtetra() + // is called later. + recentq = firstnonemptyq; + // If no queues are nonempty, return NULL. + if (firstnonemptyq < 0) { + return (badface *) NULL; + } else { + // Return the first tetrahedron of the highest-priority queue. + return tetquefront[firstnonemptyq]; + } +} + +void tetgenmesh::dequeuebadtet() +{ + badface *deadbadtet; + int i; + + // If queues were empty last time topbadtetra() was called, do nothing. + if (recentq >= 0) { + // Find the tetrahedron last returned by topbadtetra(). + deadbadtet = tetquefront[recentq]; + // Remove the tetrahedron from the queue. + tetquefront[recentq] = deadbadtet->nextitem; + // If this queue is now empty, update the list of nonempty queues. + if (deadbadtet == tetquetail[recentq]) { + // Was this the highest-priority queue? + if (firstnonemptyq == recentq) { + // Yes; find the queue with next lower priority. + firstnonemptyq = nextnonemptyq[firstnonemptyq]; + } else { + // No; find the queue with next higher priority. + i = recentq + 1; + while (tetquefront[i] == (badface *) NULL) { + i++; + } + nextnonemptyq[i] = nextnonemptyq[recentq]; + } + } + // Return the bad tetrahedron to the pool. + badfacedealloc(badtetrahedrons, deadbadtet); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checkseg4encroach() Check a subsegment to see if it is encroached. // +// // +// A segment s is encroached if there is a vertex lies inside or on its dia- // +// metral circumsphere, i.e., s faces an angle theta > 90 degrees. // +// // +// If 'testpt' (p) != NULL, only test if 'testseg' (s) is encroached by it, // +// else, check all apexes of faces around s. Return TRUE if s is encroached. // +// If and 'enqflag' is TRUE, add it into 'badsubsegs' if s is encroached. // +// // +// If 'prefpt' != NULL, it returns the reference point (defined in my paper) // +// if it exists. This point is will be used to split s. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::checkseg4encroach(face* testseg, point testpt, point* prefpt, + bool enqflag) +{ + badface *encsubseg; + triface starttet, spintet; + point eorg, edest, eapex, encpt; + REAL cent[3], radius, dist, diff; + REAL maxradius; + bool enq; + int hitbdry; + + enq = false; + eorg = sorg(*testseg); + edest = sdest(*testseg); + cent[0] = 0.5 * (eorg[0] + edest[0]); + cent[1] = 0.5 * (eorg[1] + edest[1]); + cent[2] = 0.5 * (eorg[2] + edest[2]); + radius = distance(cent, eorg); + + if (varconstraint && (areabound(*testseg) > 0.0)) { + enq = (2.0 * radius) > areabound(*testseg); + } + + if (!enq) { + maxradius = 0.0; + if (testpt == (point) NULL) { + // Check if it is encroached by traversing all faces containing it. + sstpivot(testseg, &starttet); + eapex = apex(starttet); + spintet = starttet; + hitbdry = 0; + do { + dist = distance(cent, apex(spintet)); + diff = dist - radius; + if (fabs(diff) / radius <= b->epsilon) diff = 0.0; // Rounding. + if (diff <= 0.0) { + // s is encroached. + enq = true; + if (prefpt != (point *) NULL) { + // Find the reference point. + encpt = apex(spintet); + circumsphere(eorg, edest, encpt, NULL, NULL, &dist); + if (dist > maxradius) { + // Rememebr this point. + *prefpt = encpt; + maxradius = dist; + } + } else { + break; + } + } + if (!fnextself(spintet)) { + hitbdry++; + if (hitbdry < 2) { + esym(starttet, spintet); + if (!fnextself(spintet)) { + hitbdry++; + } + } + } + } while (apex(spintet) != eapex && (hitbdry < 2)); + } else { + // Only check if 'testseg' is encroached by 'testpt'. + dist = distance(cent, testpt); + diff = dist - radius; + if (fabs(diff) / radius <= b->epsilon) diff = 0.0; // Rounding. + enq = (diff <= 0.0); + } + } + + if (enq && enqflag) { + // This segment is encroached and should be repaired. + if (!smarktested(*testseg)) { + if (!shell2badface(*testseg)) { // Is it not queued yet? + if (b->verbose > 2) { + printf(" Queuing encroaching subsegment (%d, %d).\n", + pointmark(eorg), pointmark(edest)); + } + encsubseg = (badface *) badsubsegs->alloc(); + encsubseg->ss = *testseg; + encsubseg->forg = eorg; + encsubseg->fdest = edest; + encsubseg->foppo = (point) NULL; // Not used. + // Set the pointer of 'encsubseg' into 'testseg'. It has two purposes: + // (1) We can regonize it is encroached; (2) It is uniquely queued. + setshell2badface(encsubseg->ss, encsubseg); + } + } else { + // This segment has been rejected for splitting. Do not queue it. + if (b->verbose > 2) { + printf(" Ignore a rejected encroaching subsegment (%d, %d).\n", + pointmark(eorg), pointmark(edest)); + } + } + } + + return enq; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checksub4encroach() Check a subface to see if it is encroached. // +// // +// A subface f is encroached if there is a vertex inside or on its diametral // +// circumsphere. // +// // +// If 'testpt (p) != NULL', test if 'testsub' (f) is encroached by it, else, // +// test if f is encroached by one of the two opposites of the adjacent tets. // +// Return TRUE if f is encroached and queue it if 'enqflag' is set. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::checksub4encroach(face* testsub, point testpt, bool enqflag) +{ + triface abuttet; + point pa, pb, pc, encpt; + REAL A[4][4], rhs[4], D; + REAL cent[3], area; + REAL radius, dist, diff; + bool enq; + int indx[4]; + int quenumber; + + enq = false; + radius = 0.0; + encpt = (point) NULL; + + pa = sorg(*testsub); + pb = sdest(*testsub); + pc = sapex(*testsub); + + // Compute the coefficient matrix A (3x3). + A[0][0] = pb[0] - pa[0]; + A[0][1] = pb[1] - pa[1]; + A[0][2] = pb[2] - pa[2]; // vector V1 (pa->pb) + A[1][0] = pc[0] - pa[0]; + A[1][1] = pc[1] - pa[1]; + A[1][2] = pc[2] - pa[2]; // vector V2 (pa->pc) + cross(A[0], A[1], A[2]); // vector V3 (V1 X V2) + + if (varconstraint && (areabound(*testsub) > 0.0)) { + // Check if the subface has too big area. + area = 0.5 * sqrt(dot(A[2], A[2])); + enq = area > areabound(*testsub); + if (enq) { + quenumber = 2; // A queue of subfaces having too big area. + } + } + + // Compute the right hand side vector b (3x1). + rhs[0] = 0.5 * dot(A[0], A[0]); + rhs[1] = 0.5 * dot(A[1], A[1]); + rhs[2] = 0.0; + // Solve the 3 by 3 equations use LU decomposition with partial pivoting + // and backward and forward substitute.. + if (lu_decmp(A, 3, indx, &D, 0)) { + lu_solve(A, 3, indx, rhs, 0); + cent[0] = pa[0] + rhs[0]; + cent[1] = pa[1] + rhs[1]; + cent[2] = pa[2] + rhs[2]; + radius = sqrt(rhs[0] * rhs[0] + rhs[1] * rhs[1] + rhs[2] * rhs[2]); + } + + if (!enq) { + // Check if the subface is encroached. + if (testpt == (point) NULL) { + stpivot(*testsub, abuttet); + if (abuttet.tet != dummytet) { + dist = distance(cent, oppo(abuttet)); + diff = dist - radius; + if (fabs(diff) / radius <= b->epsilon) diff = 0.0; // Rounding. + enq = (diff <= 0.0); + if (enq) encpt = oppo(abuttet); + } + if (!enq) { + sesymself(*testsub); + stpivot(*testsub, abuttet); + if (abuttet.tet != dummytet) { + dist = distance(cent, oppo(abuttet)); + diff = dist - radius; + if (fabs(diff) / radius <= b->epsilon) diff = 0.0; // Rounding. + enq = (diff <= 0.0); + if (enq) encpt = oppo(abuttet); + } + } + } else { + dist = distance(cent, testpt); + diff = dist - radius; + if (fabs(diff) / radius <= b->epsilon) diff = 0.0; // Rounding. + enq = (diff <= 0.0); + } + if (enq) { + quenumber = 0; // A queue of encroached subfaces. + } + } + + if (enq && enqflag) { + enqueueencsub(testsub, encpt, quenumber, cent); + } + + return enq; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checktet4badqual() Test a tetrahedron for quality measures. // +// // +// Tests a tetrahedron to see if it satisfies the minimum ratio condition // +// and the maximum volume condition. Tetrahedra that aren't upto spec are // +// added to the bad tetrahedron queue. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::checktet4badqual(triface* testtet, bool enqflag) +{ + point pa, pb, pc, pd, pe1, pe2; + REAL vda[3], vdb[3], vdc[3]; + REAL vab[3], vbc[3], vca[3]; + REAL N[4][3], A[4][4], rhs[4], D; + REAL elen[6], circumcent[3]; + REAL bicent[3], offcent[3]; + REAL volume, L, cosd; + REAL radius2, smlen2, ratio2; + REAL dist, sdist, split; + bool enq; + int indx[4]; + int sidx, i, j; + + pa = (point) testtet->tet[4]; + pb = (point) testtet->tet[5]; + pc = (point) testtet->tet[6]; + pd = (point) testtet->tet[7]; + + // Get the edge vectors vda: d->a, vdb: d->b, vdc: d->c. + // Set the matrix A = [vda, vdb, vdc]^T. + for (i = 0; i < 3; i++) A[0][i] = vda[i] = pa[i] - pd[i]; + for (i = 0; i < 3; i++) A[1][i] = vdb[i] = pb[i] - pd[i]; + for (i = 0; i < 3; i++) A[2][i] = vdc[i] = pc[i] - pd[i]; + // Get the rest edge vectors + for (i = 0; i < 3; i++) vab[i] = pb[i] - pa[i]; + for (i = 0; i < 3; i++) vbc[i] = pc[i] - pb[i]; + for (i = 0; i < 3; i++) vca[i] = pa[i] - pc[i]; + + // Lu-decompose the matrix A. + lu_decmp(A, 3, indx, &D, 0); + // Get the volume of abcd. + volume = (A[indx[0]][0] * A[indx[1]][1] * A[indx[2]][2]) / 6.0; + if (volume < 0.0) volume = -volume; + // Check the radiu-edge ratio of the tet. + rhs[0] = 0.5 * dot(vda, vda); + rhs[1] = 0.5 * dot(vdb, vdb); + rhs[2] = 0.5 * dot(vdc, vdc); + lu_solve(A, 3, indx, rhs, 0); + // Get the circumcenter. + for (i = 0; i < 3; i++) circumcent[i] = pd[i] + rhs[i]; + // Get the square of the circumradius. + radius2 = dot(rhs, rhs); + // Find the square of the shortest edge length. + elen[0] = dot(vda, vda); + elen[1] = dot(vdb, vdb); + elen[2] = dot(vdc, vdc); + elen[3] = dot(vab, vab); + elen[4] = dot(vbc, vbc); + elen[5] = dot(vca, vca); + smlen2 = elen[0]; sidx = 0; + for (i = 1; i < 6; i++) { + if (smlen2 > elen[i]) { smlen2 = elen[i]; sidx = i; } + } + // Calculate the square of radius-edge ratio. + ratio2 = radius2 / smlen2; + // Check whether the ratio is smaller than permitted. + enq = ratio2 > b->goodratio; + if (!enq) { + // abcd has good ratio. + // ratio2 = 0.0; + // if (b->offcenter) { + // Test if it is a sliver. + // Compute the 4 face normals (N[0], ..., N[3]). + for (j = 0; j < 3; j++) { + for (i = 0; i < 3; i++) rhs[i] = 0.0; + rhs[j] = 1.0; // Positive means the inside direction + lu_solve(A, 3, indx, rhs, 0); + for (i = 0; i < 3; i++) N[j][i] = rhs[i]; + } + // Get the fourth normal by summing up the first three. + for (i = 0; i < 3; i++) N[3][i] = - N[0][i] - N[1][i] - N[2][i]; + // Normalized the normals. + for (i = 0; i < 4; i++) { + L = sqrt(dot(N[i], N[i])); + if (L > 0.0) { + for (j = 0; j < 3; j++) N[i][j] /= L; + } + } + // N[0] is the normal of face bcd. Test the dihedral angles at edge + // cd, bd, and bc to see if they are too small or too big. + for (i = 1; i < 4 && !enq; i++) { + cosd = -dot(N[0], N[i]); // Edge cd, bd, bc. + enq = cosd > cosmindihed; + } + if (!enq) { + for (i = 2; i < 4 && !enq; i++) { + cosd = -dot(N[1], N[i]); // Edge ad, ac + enq = cosd > cosmindihed; + } + if (!enq) { + cosd = -dot(N[2], N[3]); // Edge ab + enq = cosd > cosmindihed; + } + } + // } + } else if (b->offcenter) { + // abcd has bad-quality. Use off-center instead of circumcenter. + switch (sidx) { + case 0: // edge da. + pe1 = pd; pe2 = pa; break; + case 1: // edge db. + pe1 = pd; pe2 = pb; break; + case 2: // edge dc. + pe1 = pd; pe2 = pc; break; + case 3: // edge ab. + pe1 = pa; pe2 = pb; break; + case 4: // edge bc. + pe1 = pb; pe2 = pc; break; + case 5: // edge ca. + pe1 = pc; pe2 = pa; break; + default: + pe1 = pe2 = (point) NULL; // Avoid a compile warning. + } + // The shortest edge is e1->e2. + for (i = 0; i < 3; i++) bicent[i] = 0.5 * (pe1[i] + pe2[i]); + dist = distance(bicent, circumcent); + // sdist = sqrt(smlen2) * sin(PI / 3.0); // A icoso-triangle. + // The following formulae is from + sdist = b->alpha3 * (b->minratio+sqrt(b->goodratio-0.25))* sqrt(smlen2); + split = sdist / dist; + if (split > 1.0) split = 1.0; + // Get the off-center. + for (i = 0; i < 3; i++) { + offcent[i] = bicent[i] + split * (circumcent[i] - bicent[i]); + } + } + + if (!enq && (b->varvolume || b->fixedvolume)) { + // Check if the tet has too big volume. + enq = b->fixedvolume && (volume > b->maxvolume); + if (!enq && b->varvolume) { + enq = (volume > volumebound(testtet->tet)) && + (volumebound(testtet->tet) > 0.0); + } + } + + if (!enq) { + // Check if the user-defined sizing function is satisfied. + if (b->metric) { + if (in->tetunsuitable != NULL) { + // Execute the user-defined meshing sizing evaluation. + pa = (point) testtet->tet[4]; + pb = (point) testtet->tet[5]; + pc = (point) testtet->tet[6]; + pd = (point) testtet->tet[7]; + enq = (*(in->tetunsuitable))(pa, pb, pc, pd, elen, volume); + } else { + // assert(b->alpha1 > 0.0); + sdist = sqrt(radius2) / b->alpha1; + for (i = 0; i < 4; i++) { + pa = (point) testtet->tet[4 + i]; + // Get the indicated size of p. + dist = pa[pointmtrindex]; // dist = b->alpha1 * pa[pointmtrindex]; + enq = ((dist < sdist) && (dist > 0.0)); + if (enq) break; // It is bad wrt. a node constraint. + // *** Experiment ! Stop test if c is inside H(a). + // if ((dist > 0.0) && (dist > sdist)) break; + } + } + // *** Experiment ! + // enq = (i == 4); // Does c lies outside all sparse-ball? + } // if (b->metric) + } + + if (enq && enqflag) { + if (b->offcenter && (ratio2 > b->goodratio)) { + for (i = 0; i < 3; i++) circumcent[i] = offcent[i]; + } + enqueuebadtet(testtet, ratio2, circumcent); + } + + return enq; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// acceptsegpt() Check if a segment point can be inserted or not. // +// // +// Segment(ab) is indicated to be split by a point p (\in ab). This routine // +// decides whether p can be inserted or not. // +// // +// p can not be inserted either the '-Y' option is used and ab is a hull // +// segment or '-YY' option is used. // +// // +// p can be inserted if it is in one of the following cases: // +// (1) if L = |a - b| is too long wrt the edge constraint; or // +// (2) if |x - p| > \alpha_2 H(x) for x = a, b; or // +// (3) if 'refpt' != NULL. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::acceptsegpt(point segpt, point refpt, face* splitseg) +{ + point p[2]; + REAL L, lfs; + int i, j; + + // This segment must have not been checked (and rejected) yet. + assert(!smarktested(*splitseg)); + + if (b->nobisect == 1) { + // '-Y'. It can not be split if it is on the hull. + triface spintet; + point pc; + sstpivot(splitseg, &spintet); + assert(spintet.tet != dummytet); + pc = apex(spintet); + do { + if (!fnextself(spintet)) { + // Meet a boundary face - s is on the hull. + return false; + } + } while (pc != apex(spintet)); + } else if (b->nobisect > 1) { + // '-YY'. Do not split it. + return false; + } + + p[0] = sorg(*splitseg); + p[1] = sdest(*splitseg); + if (varconstraint && (areabound(*splitseg) > 0)) { + lfs = areabound(*splitseg); + L = distance(p[0], p[1]); + if (L > lfs) { + return true; // case (1) + } + } + + j = 0; // Use j to count the number of inside balls. + for (i = 0; i < 2; i++) { + // Check if p is inside the protect ball of q. + if (p[i][pointmtrindex] > 0.0) { + lfs = b->alpha2 * p[i][pointmtrindex]; + L = distance(p[i], segpt); + if (L < lfs) j++; // p is inside ball. + } + } + if (j == 0) return true; // case (3). + + // If 'refpt' != NULL, force p to be inserted. + if (refpt != (point) NULL) { + cdtenforcesegpts++; + return true; + } + + // Do not split it. + rejsegpts++; + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// acceptfacpt() Check if a facet point can be inserted or not. // +// // +// 'subceillist' is CBC(p). 'verlist' (V) is empty on input, it returns the // +// set of vertices of CBC(p). // +// // +// p can not be inserted either the '-Y' option is used and the facet is on // +// the hull or '-YY' option is used. // +// // +// p can be inserted if |p - v| > \alpha_2 H(v), for all v \in V. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::acceptfacpt(point facpt, list* subceillist, list* verlist) +{ + face *testsh; + point p[2], ploop; + REAL L, lfs; + int idx, i, j; + + if (b->nobisect == 1) { + // '-Y'. p can not be inserted if CBC(p) is on the hull. + triface testtet; + testsh = (face *)(* subceillist)[0]; + stpivot(*testsh, testtet); + if (testtet.tet != dummytet) { + sesymself(*testsh); + stpivot(*testsh, testtet); + } + if (testtet.tet == dummytet) return false; + } else if (b->nobisect > 1) { + // '-YY'. Do not split s. + return false; + } + + // Collect the vertices of CBC(p), save them in V. + for (i = 0; i < subceillist->len(); i++) { + testsh = (face *)(* subceillist)[i]; + p[0] = sorg(*testsh); + p[1] = sdest(*testsh); + for (j = 0; j < 2; j++) { + idx = pointmark(p[j]); + if (idx >= 0) { + setpointmark(p[j], -idx - 1); + verlist->append(&(p[j])); + } + } + } + + j = 0; // Use j to count the number of inside balls. + for (i = 0; i < verlist->len(); i++) { + ploop = * (point *)(* verlist)[i]; + // Uninfect q. + idx = pointmark(ploop); + setpointmark(ploop, -(idx + 1)); + // Check if p is inside the protect ball of q. + if (ploop[pointmtrindex] > 0.0) { + lfs = b->alpha2 * ploop[pointmtrindex]; + L = distance(ploop, facpt); + if (L < lfs) j++; // p is inside ball. + } + } + verlist->clear(); + + if (j == 0) return true; // case (3). + + rejsubpts++; + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// acceptvolpt() Check if a volume point can be inserted or not. // +// // +// 'ceillist' is B(p). 'verlist' (V) is empty on input, it returns the set // +// of vertices of B(p). // +// // +// p can be split if |p - v| > \alpha_2 H(v), for all v \in V. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::acceptvolpt(point volpt, list* ceillist, list* verlist) +{ + triface* testtet; + point p[3], ploop; + REAL L, lfs; + int idx, i, j; + + // Collect the vertices of CBC(p), save them in V. + for (i = 0; i < ceillist->len(); i++) { + testtet = (triface *)(* ceillist)[i]; + p[0] = org(*testtet); + p[1] = dest(*testtet); + p[2] = apex(*testtet); + for (j = 0; j < 3; j++) { + idx = pointmark(p[j]); + if (idx >= 0) { + setpointmark(p[j], -idx - 1); + verlist->append(&(p[j])); + } + } + } + + j = 0; // Use j to counte the number of inside balls. + for (i = 0; i < verlist->len(); i++) { + ploop = * (point *)(* verlist)[i]; + // Uninfect q. + idx = pointmark(ploop); + setpointmark(ploop, -(idx + 1)); + // Check if p is inside the protect ball of q. + if (ploop[pointmtrindex] > 0.0) { + lfs = b->alpha2 * ploop[pointmtrindex]; + L = distance(ploop, volpt); + if (L < lfs) j++; // p is inside the protect ball. + } + } + verlist->clear(); + + if (j == 0) return true; // case (2). + + rejtetpts++; + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// getsplitpoint() Get the inserting point in a segment. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::getsplitpoint(point e1, point e2, point refpt, point newpt) +{ + point ei, ej; + REAL split, L, d1, d2; + bool acutea, acuteb; + int i; + + if (refpt != (point) NULL) { + // Use the CDT rules to split the segment. + acutea = (pointtype(e1) == ACUTEVERTEX); + acuteb = (pointtype(e2) == ACUTEVERTEX); + if (acutea ^ acuteb) { + // Only one endpoint is acute. Use rule-2 or rule-3. + ei = acutea ? e1 : e2; + ej = acutea ? e2 : e1; + L = distance(ei, ej); + // Apply rule-2. + d1 = distance(ei, refpt); + split = d1 / L; + for (i = 0; i < 3; i++) newpt[i] = ei[i] + split * (ej[i] - ei[i]); + // Check if rule-3 is needed. + d2 = distance(refpt, newpt); + if (d2 > (L - d1)) { + // Apply rule-3. + if ((d1 - d2) > (0.5 * d1)) { + split = (d1 - d2) / L; + } else { + split = 0.5 * d1 / L; + } + for (i = 0; i < 3; i++) newpt[i] = ei[i] + split * (ej[i] - ei[i]); + if (b->verbose > 1) { + printf(" Found by rule-3:"); + } + r3count++; + } else { + if (b->verbose > 1) { + printf(" Found by rule-2:"); + } + r2count++; + } + if (b->verbose > 1) { + printf(" center %d, split = %.12g.\n", pointmark(ei), split); + } + } else { + // Both endpoints are acute or not. Split it at the middle. + for (i = 0; i < 3; i++) newpt[i] = 0.5 * (e1[i] + e2[i]); + } + } else { + // Split the segment at its midpoint. + for (i = 0; i < 3; i++) newpt[i] = 0.5 * (e1[i] + e2[i]); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// setnewpointsize() Set the size for a new point. // +// // +// The size of the new point p is interpolated either from a background mesh // +// (b->bgmesh) or from the two input endpoints. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::setnewpointsize(point newpt, point e1, point e2) +{ + if (b->metric) { + // Interpolate the point size in a background mesh. + triface bgmtet; + // Get a tet in background mesh for locating p. + decode(point2bgmtet(e1), bgmtet); + p1interpolatebgm(newpt, &bgmtet, NULL); + } else { + if (e2 != (point) NULL) { + // Interpolate the size between the two endpoints. + REAL split, l, d; + l = distance(e1, e2); + d = distance(e1, newpt); + split = d / l; +#ifdef SELF_CHECK + // Check if e1 and e2 are endpoints of a sharp segment. + assert(e1[pointmtrindex] > 0.0); + assert(e2[pointmtrindex] > 0.0); +#endif + newpt[pointmtrindex] = (1.0 - split) * e1[pointmtrindex] + + split * e2[pointmtrindex]; + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splitencseg() Split an enc-seg and recover the Delaunayness by flips. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::splitencseg(point newpt, face* splitseg, list* tetlist, + list* sublist, list* verlist, queue* flipque, bool chkencsub, bool chkbadtet, + bool optflag) +{ + list *mytetlist; + queue *myflipque; + triface starttet; + face startsh, spinsh, checksh; + int i; + + if (optflag) { + mytetlist = new list(sizeof(triface), NULL, 1024); + myflipque = new queue(sizeof(badface)); + tetlist = mytetlist; + flipque = myflipque; + } + + // Use the base orientation (important in this routine). + splitseg->shver = 0; + // Insert p, this should always success. + sstpivot(splitseg, &starttet); + if (splittetedge(newpt, &starttet, flipque)) { + // Remove locally non-Delaunay faces by flipping. + lawson3d(flipque); + } else { + if (optflag) { + delete mytetlist; + delete myflipque; + } + return false; + } + + if (!optflag) { + // Check the two new subsegs to see if they're encroached (not by p). + for (i = 0; i < 2; i++) { + //if (!shell2badface(*splitseg)) { + checkseg4encroach(splitseg, NULL, NULL, true); + //} + if (i == 1) break; // Two new segs have been checked. + senextself(*splitseg); + spivotself(*splitseg); +#ifdef SELF_CHECK + assert(splitseg->sh != (shellface *) NULL); +#endif + splitseg->shver = 0; + } + // Check the new subfaces to see if they're encroached (not by p). + if (chkencsub) { + spivot(*splitseg, startsh); + spinsh = startsh; + do { + sublist->append(&spinsh); + formstarpolygon(newpt, sublist, verlist); + for (i = 0; i < sublist->len(); i++) { + checksh = * (face *)(* sublist)[i]; + //if (!shell2badface(checksh)) { + checksub4encroach(&checksh, NULL, true); + //} + } + sublist->clear(); + if (verlist) verlist->clear(); + spivotself(spinsh); + if (spinsh.sh == dummysh) { + break; // There's only one facet having this segment. + } + } while (spinsh.sh != startsh.sh); + } + } // if (!optflag) + + // Collect the new tets connecting at p. + sstpivot(splitseg, &starttet); + tetlist->append(&starttet); + formstarpolyhedron(newpt, tetlist, verlist, true); + + if (!optflag) { + // Check if p encroaches adjacent segments. + tallencsegs(newpt, 1, &tetlist); + if (chkencsub) { + // Check if p encroaches adjacent subfaces. + tallencsubs(newpt, 1, &tetlist); + } + if (chkbadtet) { + // Check if there are new bad quality tets at p. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + checktet4badqual(&starttet, true); + } + } + tetlist->clear(); + } else { + // Check if new tets are non-optimal. + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + checktet4opt(&starttet, true); + } + delete mytetlist; + delete myflipque; + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tallencsegs() Check for encroached segments and save them in list. // +// // +// If 'testpt' (p) != NULL, only check if segments are encroached by p, else,// +// check all the nearby mesh vertices. // +// // +// If 'ceillists' (B_i(p)) != NULL, there are 'n' B_i(p)s, only check the // +// segments which are on B_i(p)s, else, check the entire list of segments // +// (in the pool 'this->subsegs'). // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::tallencsegs(point testpt, int n, list **ceillists) +{ + list *ceillist; + triface ceiltet; + face checkseg; + int enccount; // long oldencnum; + int i, j, k; + + // Remember the current number of encroached segments. + // oldencnum = badsubsegs->items; + + // Count the number of encroached segments. + enccount = 0; + + if (ceillists != (list **) NULL) { + for (k = 0; k < n; k++) { + ceillist = ceillists[k]; + // Check the segments on B_i(p). + for (i = 0; i < ceillist->len(); i++) { + ceiltet = * (triface *)(* ceillist)[i]; + ceiltet.ver = 0; + for (j = 0; j < 3; j++) { + tsspivot(&ceiltet, &checkseg); + if (checkseg.sh != dummysh) { + // Found a segment. Test it if it isn't in enc-list. + // if (!shell2badface(checkseg)) { + if (checkseg4encroach(&checkseg, testpt, NULL, true)) { + enccount++; + } + // } + } + enextself(ceiltet); + } + } + } + } else { + // Check the entire list of segments. + subsegs->traversalinit(); + checkseg.sh = shellfacetraverse(subsegs); + while (checkseg.sh != (shellface *) NULL) { + // Test it if it isn't in enc-list. + // if (!shell2badface(checkseg)) { + if (checkseg4encroach(&checkseg, testpt, NULL, true)) { + enccount++; + } + // } + checkseg.sh = shellfacetraverse(subsegs); + } + } + + // return (badsubsegs->items > oldencnum); + return enccount > 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tallencsubs() Find all encroached subfaces and save them in list. // +// // +// If 'testpt' (p) != NULL, only check if subfaces are encroached by p, else,// +// check the adjacent vertices of subfaces. // +// // +// If 'ceillists' (B_i(p)) != NULL, there are 'n' B_i(p)s, only check the // +// subfaces which are on B_i(p)s, else, check the entire list of subfaces // +// (in the pool 'this->subfaces'). // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::tallencsubs(point testpt, int n, list** ceillists) +{ + list *ceillist; + triface ceiltet; + face checksh; + int enccount; //long oldencnum; + int i, k; + + // Remember the current number of encroached segments. + // oldencnum = badsubfaces->items; + + enccount = 0; // Count the number encroached subfaces. + + if (ceillists != (list **) NULL) { + for (k = 0; k < n; k++) { + ceillist = ceillists[k]; + // Check the subfaces on B_i(p). + for (i = 0; i < ceillist->len(); i++) { + ceiltet = * (triface *)(* ceillist)[i]; + tspivot(ceiltet, checksh); + if (checksh.sh != dummysh) { + // Found a subface. Test it if it isn't in enc-list. + //if (!shell2badface(checksh)) { + if (checksub4encroach(&checksh, testpt, true)) { + enccount++; + } + //} + } + } + } + } else { + // Check the entire list of subfaces. + subfaces->traversalinit(); + checksh.sh = shellfacetraverse(subfaces); + while (checksh.sh != (shellface *) NULL) { + // Test it if it isn't in enc-list. + // if (!shell2badface(checksh)) { + if (checksub4encroach(&checksh, testpt, true)) { + enccount++; + } + // } + checksh.sh = shellfacetraverse(subfaces); + } + } + + //return (badsubfaces->items > oldencnum); + return enccount > 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tallbadtetrahedrons() Queue all the bad-quality tetrahedra in the mesh.// +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::tallbadtetrahedrons() +{ + triface tetloop; + + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + checktet4badqual(&tetloop, true); + tetloop.tet = tetrahedrontraverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// repairencsegs() Repair (split) all the encroached segments. // +// // +// Each encroached segment is repaired by splitting it - inserting a vertex // +// at or near its midpoint. Newly inserted vertices may encroach upon other // +// subsegments, these are also repaired. // +// // +// 'chkencsub' and 'chkbadtet' are two flags that specify whether one should // +// take note of new encroaced subfaces and bad quality tets that result from // +// inserting vertices to repair encroached subsegments. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::repairencsegs(bool chkencsub, bool chkbadtet) +{ + list **tetlists, **ceillists; + list **sublists, **subceillists; + list *tetlist, *sublist; + queue *flipque; + badface *encloop; + face splitseg; + point newpt, refpt; + point e1, e2; + int nmax, n; + + n = 0; + nmax = 128; + if (!b->fliprepair) { + tetlists = new list*[nmax]; + ceillists = new list*[nmax]; + sublists = new list*[nmax]; + subceillists = new list*[nmax]; + } else { + tetlist = new list(sizeof(triface), NULL, 1024); + sublist = new list(sizeof(face), NULL, 256); + flipque = new queue(sizeof(badface)); + } + + // Loop until the pool 'badsubsegs' is empty. Note that steinerleft == -1 + // if an unlimited number of Steiner points is allowed. + while ((badsubsegs->items > 0) && (steinerleft != 0)) { + badsubsegs->traversalinit(); + encloop = badfacetraverse(badsubsegs); + while ((encloop != (badface *) NULL) && (steinerleft != 0)) { + // Get an encroached subsegment s. + splitseg = encloop->ss; + // Clear the in-queue flag in s. + setshell2badface(splitseg, NULL); + if ((sorg(splitseg) == encloop->forg) && + (sdest(splitseg) == encloop->fdest)) { + if (b->verbose > 1) { + printf(" Get an enc-seg (%d, %d)\n", pointmark(encloop->forg), + pointmark(encloop->fdest)); + } + refpt = (point) NULL; + if (b->conformdel) { + // Look for a reference point. + checkseg4encroach(&splitseg, NULL, &refpt, false); + } + // Create the new point p (at the middle of s). + makepoint(&newpt); + getsplitpoint(encloop->forg, encloop->fdest, refpt, newpt); + setpointtype(newpt, FREESEGVERTEX); + setpoint2seg(newpt, sencode(splitseg)); + // Decide whether p can be inserted or not. + if (acceptsegpt(newpt, refpt, &splitseg)) { + // Save the endpoints of the seg for size interpolation. + e1 = sorg(splitseg); + if (shelltype(splitseg) == SHARP) { + e2 = sdest(splitseg); + } else { + e2 = (point) NULL; // No need to do size interoplation. + } + if (!b->fliprepair) { + // Form BC(p), B(p), CBC(p)s, and C(p)s. + formbowatcavity(newpt, &splitseg, NULL, &n, &nmax, sublists, + subceillists, tetlists, ceillists); + // Validate/update BC(p), B(p), CBC(p)s, and C(p)s. + if (trimbowatcavity(newpt, &splitseg, n, sublists, subceillists, + tetlists, ceillists, -1.0)) { + bowatinsertsite(newpt, &splitseg, n, sublists, subceillists, + tetlists, ceillists, NULL, flipque, true, + chkencsub, chkbadtet); + setnewpointsize(newpt, e1, e2); + if (steinerleft > 0) steinerleft--; + } else { + // p did not insert for invalid B(p). + pointdealloc(newpt); + } + // Free the memory allocated in formbowatcavity(). + releasebowatcavity(&splitseg, n, sublists, subceillists, tetlists, + ceillists); + } else { + if (splitencseg(newpt, &splitseg, tetlist, sublist, NULL, flipque, + chkencsub, chkbadtet, false)) { + setnewpointsize(newpt, e1, e2); + if (steinerleft > 0) steinerleft--; + } else { + // Fail to split the segment. It MUST be caused by a very flat + // tet connected at the splitting segment. We do not handle + // this case yet. Hopefully, the later repairs will remove + // the flat tet and hence the segment can be split later. + pointdealloc(newpt); + } + } + } else { + // This segment can not be split for not meeting the rules in + // acceptsegpt(). Mark it to avoid re-checking it later. + smarktest(splitseg); + // p did not accept for insertion. + pointdealloc(newpt); + } // if (checkseg4splitting(newpt, &splitseg)) + } // if ((encloop->forg == pa) && (encloop->fdest == pb)) + badfacedealloc(badsubsegs, encloop); // Remove this entry from list. + encloop = badfacetraverse(badsubsegs); // Get the next enc-segment. + } // while ((encloop != (badface *) NULL) && (steinerleft != 0)) + } // while ((badsubsegs->items > 0) && (steinerleft != 0)) + + if (!b->fliprepair) { + delete [] tetlists; + delete [] ceillists; + delete [] sublists; + delete [] subceillists; + } else { + delete tetlist; + delete sublist; + delete flipque; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// repairencsubs() Repair (split) all the encroached subfaces. // +// // +// Each encroached subface is repaired by splitting it - inserting a vertex // +// at or near its circumcenter. Newly inserted vertices may encroach upon // +// other subfaces, these are also repaired. // +// // +// 'chkbadtet' is a flag that specifies whether one should take note of new // +// bad quality tets that result from inserted vertices. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::repairencsubs(bool chkbadtet) +{ + list *tetlists[2], *ceillists[2]; + list *sublist, *subceillist; + list *verlist; + badface *encloop; + face splitsub, symsplitsub; + point newpt, e1; + enum locateresult loc; + REAL normal[3], len; + bool reject; + long oldptnum, oldencsegnum; + int quenumber, n, i; + + n = 0; + sublist = (list *) NULL; + subceillist = (list *) NULL; + verlist = new list(sizeof(point *), NULL, 256); + + // Loop until the pool 'badsubfaces' is empty. Note that steinerleft == -1 + // if an unlimited number of Steiner points is allowed. + while ((badsubfaces->items > 0) && (steinerleft != 0)) { + // Get an encroached subface f. + encloop = dequeueencsub(&quenumber); + splitsub = encloop->ss; + // Clear the in-queue flag of f. + setshell2badface(splitsub, NULL); + // f may not be the same one when it was determined to be encroached. + if (!isdead(&splitsub) + && (sorg(splitsub) == encloop->forg) + && (sdest(splitsub) == encloop->fdest) + && (sapex(splitsub) == encloop->fapex)) { + if (b->verbose > 1) { + printf(" Dequeuing ensub (%d, %d, %d) [%d].\n", + pointmark(encloop->forg), pointmark(encloop->fdest), + pointmark(encloop->fapex), quenumber); + } + // Create a new point p at the circumcenter of f. + makepoint(&newpt); + for (i = 0; i < 3; i++) newpt[i] = encloop->cent[i]; + setpointtype(newpt, FREESUBVERTEX); + setpoint2sh(newpt, sencode(splitsub)); + // Set the abovepoint of f for point location. + abovepoint = facetabovepointarray[shellmark(splitsub)]; + if (abovepoint == (point) NULL) { + // getfacetabovepoint(&splitsub); + // Calculate an abovepoint in dummypoint. + facenormal2(encloop->forg, encloop->fdest, encloop->fapex, normal, 1); + len = sqrt(DOT(normal, normal)); + normal[0] /= len; + normal[1] /= len; + normal[2] /= len; + len = DIST(encloop->forg, encloop->fdest); + len += DIST(encloop->fdest, encloop->fapex); + len += DIST(encloop->fapex, encloop->forg); + len /= 3.0; + dummypoint[0] = encloop->forg[0] + len * normal[0]; + dummypoint[1] = encloop->forg[1] + len * normal[1]; + dummypoint[2] = encloop->forg[2] + len * normal[2]; + abovepoint = dummypoint; + } + // Locate p, start from f, stop at segment (1), use a tolerance to + // detect ONVERTEX or OUTSIDE case. Update f on return. + loc = locatesub(newpt, &splitsub, 1, b->epsilon * 1e+2); + if ((loc != ONVERTEX) && (loc != OUTSIDE)) { + // Form BC(p), B(p), CBC(p) and C(p). + formbowatcavity(newpt, NULL, &splitsub, &n, NULL, &sublist, + &subceillist, tetlists, ceillists); + // Check for encroached subsegments (on B(p)). + oldencsegnum = badsubsegs->items; + reject = tallencsegs(newpt, 2, ceillists); + if (reject && (oldencsegnum == badsubsegs->items)) { + // 'newpt' encroaches upon some subsegments. But none of them can + // be split. So this subface can't be split as well. Mark it to + // avoid re-checking it later. + smarktest(encloop->ss); + } + // Execute point accept rule if p does not encroach upon any segment. + if (!reject) { + reject = !acceptfacpt(newpt, subceillist, verlist); + if (reject) { + // 'newpt' lies in some protecting balls. This subface can't be + // split. Mark it to avoid re-checking it later. + smarktest(encloop->ss); + } + } + if (!reject) { + // Validate/update cavity. + reject = !trimbowatcavity(newpt, NULL, n, &sublist, &subceillist, + tetlists, ceillists, -1.0); + } + if (!reject) { + // CBC(p) should include s, so that s can be removed after CBC(p) + // is remeshed. However, if there are locally non-Delaunay faces + // and encroached subsegments, s may not be collected in CBC(p). + // p should not be inserted in such case. + reject = !sinfected(encloop->ss); + } + if (!reject) { + // Save a point for size interpolation. + e1 = sorg(splitsub); + bowatinsertsite(newpt, NULL, n, &sublist, &subceillist, tetlists, + ceillists, NULL, NULL, true, true, chkbadtet); + setnewpointsize(newpt, e1, NULL); + if (steinerleft > 0) steinerleft--; + } else { + // p is rejected for the one of the following reasons: + // (1) BC(p) is not valid. + // (2) s does not in CBC(p). + // (3) p encroaches upon some segments (queued); or + // (4) p is rejected by point accepting rule, or + // (5) due to the rejection of symp (the PBC). + pointdealloc(newpt); + } // if (!reject) + // Release the cavity and free the memory. + releasebowatcavity(NULL,n,&sublist,&subceillist,tetlists,ceillists); + if (reject) { + // Are there queued encroached subsegments. + if (badsubsegs->items > 0) { + // Repair enc-subsegments. + oldptnum = points->items; + repairencsegs(true, chkbadtet); + /*if (points->items > oldptnum) { + // Some enc-subsegments got split. Try to repair f later. + splitsub = encloop->ss; + if (!isdead(&splitsub)) { + if (!shell2badface(splitsub)) { + checksub4encroach(&splitsub, NULL, true); + } + } + }*/ + } + } + } else { + // Don't insert p for one of the following reasons: + // (1) Locate on an existing vertex; or + // (2) locate outside the domain. + // Case (1) should not be possible. If such vertex v exists, it is + // the circumcenter of f, ie., f is non-Delaunay. Either f was got + // split before by v, but survived after v was inserted, or the + // same for a f' which is nearly co-circular with f. Whatsoever, + // there are encroached segs by v, but the routine tallencsegs() + // did not find them out. + if (loc == ONVERTEX) { + printf("Internal error in repairencsubs():\n"); + printf(" During repairing encroached subface (%d, %d, %d)\n", + pointmark(encloop->forg), pointmark(encloop->fdest), + pointmark(encloop->fapex)); + printf(" New point %d is coincident with an existing vertex %d\n", + pointmark(newpt), pointmark(sorg(splitsub))); + terminatetetgen(2); + } + assert(loc == OUTSIDE); + // The circumcenter lies outside of the facet. Mark it to avoid + // rechecking it later. + smarktest(encloop->ss); + // Case (2) can happen when thers is a segment s which is close to f + // and is non-conforming Delaunay. The circumcenter of f encroaches + // upon s, but the circumcenter of s is rejected for insertion. + pointdealloc(newpt); + } // if ((loc != ONVERTEX) && (loc != OUTSIDE)) + } /*else { + if (!isdead(&splitsub)) { + // The subface has been changed, re-check it. + checksub4encroach(&splitsub, NULL, true); + } + } // if (!isdead(&splitsub) && (sorg(splitsub) == encloop->forg) && + */ + // Remove this entry from list. + badfacedealloc(badsubfaces, encloop); + } // while ((badsubfaces->items > 0) && (steinerleft != 0)) + + delete verlist; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// repairbadtets() Repair all bad-quality tetrahedra. // +// // +// All bad-quality tets are stored in pool 'badtetrahedrons'. Each bad tet // +// is repaired by inserting a point at or near its circumcenter. However, if // +// this point encroaches any subsegment or subface, it is not inserted. Ins- // +// tead the encroached segment and subface are split. Newly inserted points // +// may create other bad-quality tets, these are also repaired. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::repairbadtets() +{ + list *tetlist, *ceillist; + list *verlist; + arraypool *histtetarray; + badface *badtet; + triface starttet; + point newpt, e1; + enum locateresult loc; + bool reject; + long oldptnum; + int i; + + tetlist = new list(sizeof(triface), NULL, 1024); + ceillist = new list(sizeof(triface), NULL, 1024); + verlist = new list(sizeof(point *), NULL, 256); + + histtetarray = new arraypool(sizeof(triface), 8); + + // Loop until pool 'badtetrahedrons' is empty. Note that steinerleft == -1 + // if an unlimited number of Steiner points is allowed. + while ((badtetrahedrons->items > 0) && (steinerleft != 0)) { + // Get a bad-quality tet t. + badtet = topbadtetra(); + // Make sure that the tet is still the same one when it was tested. + // Subsequent transformations may have made it a different tet. + if ((badtet != (badface *) NULL) && !isdead(&badtet->tt) + && org(badtet->tt) == badtet->forg + && dest(badtet->tt) == badtet->fdest + && apex(badtet->tt) == badtet->fapex + && oppo(badtet->tt) == badtet->foppo) { + if (b->verbose > 1) { + printf(" Dequeuing btet (%d, %d, %d, %d).\n", + pointmark(badtet->forg), pointmark(badtet->fdest), + pointmark(badtet->fapex), pointmark(badtet->foppo)); + } + // Create the new point p (at the circumcenter of t). + makepoint(&newpt); + for (i = 0; i < 3; i++) newpt[i] = badtet->cent[i]; + setpointtype(newpt, FREEVOLVERTEX); + // Locate p. + starttet = badtet->tt; + //loc = preciselocate(newpt, &starttet, tetrahedrons->items); + loc = locate2(newpt, &starttet, histtetarray); + if (b->verbose > 1) { + printf(" loc = %d.\n", (int) loc); + } + if ((loc != ONVERTEX) && (loc != OUTSIDE)) { + // For BC(p) and B(p). + infect(starttet); + tetlist->append(&starttet); + formbowatcavityquad(newpt, tetlist, ceillist); + // Check for encroached subsegments. + reject = tallencsegs(newpt, 1, &ceillist); + if (!reject) { + // Check for encroached subfaces. + reject = tallencsubs(newpt, 1, &ceillist); + } + // Execute point accepting rule if p does not encroach upon any + // subsegment and subface. + if (!reject) { + reject = !acceptvolpt(newpt, ceillist, verlist); + } + if (!reject) { + reject = !trimbowatcavity(newpt, NULL, 1, NULL, NULL, &tetlist, + &ceillist, -1.0); + } + if (!reject) { + // BC(p) should include t, so that t can be removed after BC(p) is + // remeshed. However, if there are locally non-Delaunay faces + // and encroached subsegments/subfaces, t may not be collected + // in BC(p). p should not be inserted in such case. + reject = !infected(badtet->tt); + if (reject) outbowatcircumcount++; + } + if (!reject) { + // Save a point for size interpolation. + e1 = org(starttet); + // Insert p. + bowatinsertsite(newpt, NULL, 1, NULL, NULL, &tetlist, &ceillist, + NULL, NULL, false, false, true); + setnewpointsize(newpt, e1, NULL); + if (steinerleft > 0) steinerleft--; + } else { + // p is rejected for one of the following reasons: + // (1) BC(p) is not valid. + // (2) t does not in BC(p). + // (3) p encroaches upon some segments; + // (4) p encroaches upon some subfaces; + // (5) p is rejected by the point accepting rule. + pointdealloc(newpt); + // Uninfect tets of BC(p). + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + uninfect(starttet); + } + } + tetlist->clear(); + ceillist->clear(); + // Split encroached subsegments/subfaces if there are. + if (reject) { + oldptnum = points->items; + if (badsubsegs->items > 0) { + repairencsegs(true, true); + } + if (badsubfaces->items > 0) { + repairencsubs(true); + } + if (points->items > oldptnum) { + // Some encroaching subsegments/subfaces got split. Re-queue the + // tet if it is still alive. + starttet = badtet->tt; + if (!isdead(&starttet)) { + checktet4badqual(&starttet, true); + } + } + } + } else { + // Do not insert p. The reason may be one of: + // (1) p is coincident (ONVERTEX) with an existing vertex; or + // (2) p is outside (OUTSIDE) the mesh. + // Case (1) should not be possible. If such vertex v exists, it is + // the circumcenter of t, ie., t is non-Delaunay. Either t was got + // split before by v, but survived after v was inserted, or the + // same for a t' which is nearly co-spherical with t. Whatsoever, + // there are encroached segments or subfaces by v but the routines + // tallencsegs() or tallencsubs() did not find them out. + /*if (loc == ONVERTEX) { + printf("Internal error in repairbadtets():\n"); + printf(" During repairing bad tet (%d, %d, %d, %d)\n", + pointmark(badtet->forg), pointmark(badtet->fdest), + pointmark(badtet->fapex), pointmark(badtet->foppo)); + printf(" New point %d is coincident with an existing vertex %d\n", + pointmark(newpt), pointmark(org(starttet))); + terminatetetgen(2); + }*/ + // Case (2) can happen when there is a segment s (or subface f) which + // is close to f and is non-conforming Delaunay. The circumcenter + // of t encroaches upon s (or f), but the circumcenter of s (or f) + // is rejected for insertion. + pointdealloc(newpt); + } // if ((loc != ONVERTEX) && (loc != OUTSIDE)) + } // if (!isdead(&badtet->tt) && org(badtet->tt) == badtet->forg && + // Remove the tet from the queue. + dequeuebadtet(); + } // while ((badtetrahedrons->items > 0) && (steinerleft != 0)) + + delete tetlist; + delete ceillist; + delete verlist; + delete histtetarray; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// enforcequality() Refine the mesh. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::enforcequality() +{ + long total, vertcount; + int i; + + if (!b->quiet) { + printf("Adding Steiner points to enforce quality.\n"); + } + + total = vertcount = 0l; + if (b->conformdel) { + r2count = r3count = 0l; + } + + // If both '-D' and '-r' options are used. + if (b->conformdel && b->refine) { + markacutevertices(65.0); + } + // If '-m' is not used. + if (!b->metric) { + // Find and mark all sharp segments. + marksharpsegments(65.0); + // Decide the sizes for feature points. + decidefeaturepointsizes(); + } + + // Initialize the pool of encroached subsegments. + badsubsegs = new memorypool(sizeof(badface), SUBPERBLOCK, POINTER, 0); + // Looking for encroached subsegments. + tallencsegs(NULL, 0, NULL); + if (b->verbose && badsubsegs->items > 0) { + printf(" Splitting encroached subsegments.\n"); + } + vertcount = points->items; + // Fix encroached segments without noting any enc subfaces. + repairencsegs(false, false); + if (b->verbose > 0) { + printf(" %ld split points.\n", points->items - vertcount); + } + total += points->items - vertcount; + + // Initialize the pool of encroached subfaces. + badsubfaces = new memorypool(sizeof(badface), SUBPERBLOCK, POINTER, 0); + // Initialize the priority queues of badfaces. + for (i = 0; i < 3; i++) subquefront[i] = (badface *) NULL; + for (i = 0; i < 3; i++) subquetail[i] = &subquefront[i]; + // Looking for encroached subfaces. + tallencsubs(NULL, 0, NULL); + if (b->verbose && badsubfaces->items > 0) { + printf(" Splitting encroached subfaces.\n"); + } + vertcount = points->items; + // Fix encroached subfaces without noting bad tetrahedra. + repairencsubs(false); + if (b->verbose > 0) { + printf(" %ld split points.\n", points->items - vertcount); + } + total += points->items - vertcount; + // At this point, the mesh should be conforming Delaunay if no input + // angle is smaller than 90 degree. + + // Next, fix bad quality tetrahedra. + if ((b->minratio > 0.0) || b->varvolume || b->fixedvolume) { + // Initialize the pool of bad tets + badtetrahedrons = new memorypool(sizeof(badface), ELEPERBLOCK, POINTER, 0); + // Initialize the priority queues of bad tets. + for (i = 0; i < 64; i++) tetquefront[i] = (badface *) NULL; + firstnonemptyq = -1; + recentq = -1; + // Looking for bad quality tets. + cosmaxdihed = cos(b->maxdihedral * PI / 180.0); + cosmindihed = cos(b->mindihedral * PI / 180.0); + tallbadtetrahedrons(); + if (b->verbose && badtetrahedrons->items > 0) { + printf(" Splitting bad tetrahedra.\n"); + } + vertcount = points->items; + repairbadtets(); + if (b->verbose > 0) { + printf(" %ld refinement points.\n", points->items - vertcount); + } + total += points->items - vertcount; + delete badtetrahedrons; + } + + if (b->verbose > 0) { + printf(" Totally added %ld points.\n", total); + } + + delete badsubfaces; + delete badsubsegs; +} + +//// //// +//// //// +//// refine_cxx /////////////////////////////////////////////////////////////// + +//// optimize_cxx ///////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// checktet4ill() Check a tet to see if it is illegal. // +// // +// A tet is "illegal" if it spans on one input facet. Save the tet in queue // +// if it is illegal and the flag 'enqflag' is set. // +// // +// Note: Such case can happen when the input facet has non-coplanar vertices // +// and the Delaunay tetrahedralization of the vertices may creat such tets. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::checktet4ill(triface* testtet, bool enqflag) +{ + badface *newbadtet; + triface checktet; + face checksh1, checksh2; + face checkseg; + bool illflag; + int i; + + illflag = false; + for (testtet->loc = 0; testtet->loc < 4; testtet->loc++) { + tspivot(*testtet, checksh1); + if (checksh1.sh != dummysh) { + testtet->ver = 0; + findedge(&checksh1, org(*testtet), dest(*testtet)); + for (i = 0; i < 3; i++) { + fnext(*testtet, checktet); + tspivot(checktet, checksh2); + if (checksh2.sh != dummysh) { + // Two subfaces share this edge. + sspivot(checksh1, checkseg); + if (checkseg.sh == dummysh) { + // The four corners of the tet are on one facet. Illegal! Try to + // flip the opposite edge of the current one. + enextfnextself(*testtet); + enextself(*testtet); + illflag = true; + break; + } + } + enextself(*testtet); + senextself(checksh1); + } + } + if (illflag) break; + } + + if (illflag && enqflag) { + // Allocate space for the bad tetrahedron. + newbadtet = (badface *) badtetrahedrons->alloc(); + newbadtet->tt = *testtet; + newbadtet->key = -1.0; // = 180 degree. + for (i = 0; i < 3; i++) newbadtet->cent[i] = 0.0; + newbadtet->forg = org(*testtet); + newbadtet->fdest = dest(*testtet); + newbadtet->fapex = apex(*testtet); + newbadtet->foppo = oppo(*testtet); + newbadtet->nextitem = (badface *) NULL; + if (b->verbose > 2) { + printf(" Queueing illtet: (%d, %d, %d, %d).\n", + pointmark(newbadtet->forg), pointmark(newbadtet->fdest), + pointmark(newbadtet->fapex), pointmark(newbadtet->foppo)); + } + } + + return illflag; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checktet4opt() Check a tet to see if it needs to be optimized. // +// // +// A tet t needs to be optimized if it fails to certain quality measures. // +// The only quality measure currently used is the maximal dihedral angle at // +// edges. The desired maximal dihedral angle is 'b->maxdihedal' (set by the // +// '-qqq' option. // +// // +// A tet may have one, two, or three big dihedral angles. Examples: Let the // +// tet t = abcd, and its four corners are nearly co-planar. Then t has one // +// big dihedral angle if d is very close to the edge ab; t has three big // +// dihedral angles if d's projection on the face abc is also inside abc, i.e.// +// the shape of t likes a hat; finally, t has two big dihedral angles if d's // +// projection onto abc is outside abc. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::checktet4opt(triface* testtet, bool enqflag) +{ + badface *newbadtet; + point pa, pb, pc, pd; + REAL N[4][3], len; + REAL cosd; + int count; + int i, j; + + pa = (point) testtet->tet[4]; + pb = (point) testtet->tet[5]; + pc = (point) testtet->tet[6]; + pd = (point) testtet->tet[7]; + // Compute the 4 face normals: N[0] cbd, N[1] acd, N[2] bad, N[3] abc. + tetallnormal(pa, pb, pc, pd, N, NULL); + // Normalize the normals. + for (i = 0; i < 4; i++) { + len = sqrt(dot(N[i], N[i])); + if (len != 0.0) { + for (j = 0; j < 3; j++) N[i][j] /= len; + } + } + + count = 0; + + // Find all large dihedral angles. + for (i = 0; i < 6; i++) { + // Locate the edge i and calculate the dihedral angle at the edge. + testtet->loc = 0; + testtet->ver = 0; + switch (i) { + case 0: // edge ab + cosd = -dot(N[2], N[3]); + break; + case 1: // edge cd + enextfnextself(*testtet); + enextself(*testtet); + cosd = -dot(N[0], N[1]); + break; + case 2: // edge bd + enextfnextself(*testtet); + enext2self(*testtet); + cosd = -dot(N[0], N[2]); + break; + case 3: // edge bc + enextself(*testtet); + cosd = -dot(N[0], N[3]); + break; + case 4: // edge ad + enext2fnextself(*testtet); + enextself(*testtet); + cosd = -dot(N[1], N[2]); + break; + case 5: // edge ac + enext2self(*testtet); + cosd = -dot(N[1], N[3]); + break; + } + if (cosd < cosmaxdihed) { + // A bigger dihedral angle. + count++; + if (enqflag) { + // Allocate space for the bad tetrahedron. + newbadtet = (badface *) badtetrahedrons->alloc(); + newbadtet->tt = *testtet; + newbadtet->key = cosd; + for (j = 0; j < 3; j++) newbadtet->cent[j] = 0.0; + newbadtet->forg = org(*testtet); + newbadtet->fdest = dest(*testtet); + newbadtet->fapex = apex(*testtet); + newbadtet->foppo = oppo(*testtet); + newbadtet->nextitem = (badface *) NULL; + if (b->verbose > 2) { + printf(" Queueing tet: (%d, %d, %d, %d), dihed %g (degree).\n", + pointmark(newbadtet->forg), pointmark(newbadtet->fdest), + pointmark(newbadtet->fapex), pointmark(newbadtet->foppo), + acos(cosd) * 180.0 / PI); + } + } + } + } + + return count > 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// removeedge() Remove an edge // +// // +// 'remedge' is a tet (abcd) having the edge ab wanted to be removed. Local // +// reconnecting operations are used to remove edge ab. The following opera- // +// tion will be tryed. // +// // +// If ab is on the hull, and abc and abd are both hull faces. Then ab can be // +// removed by stripping abcd from the mesh. However, if ab is a segemnt, do // +// the operation only if 'b->optlevel' > 1 and 'b->nobisect == 0'. // +// // +// If ab is an internal edge, there are n tets contains it. Then ab can be // +// removed if there exists another m tets which can replace the n tets with- // +// out changing the boundary of the n tets. // +// // +// If 'optflag' is set. The value 'remedge->key' means cos(theta), where // +// 'theta' is the maximal dishedral angle at ab. In this case, even if the // +// n-to-m flip exists, it will not be performed if the maximum dihedral of // +// the new tets is larger than 'theta'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::removeedge(badface* remedge, bool optflag) +{ + triface abcd, badc; // Tet configuration at edge ab. + triface baccasing, abdcasing; + triface abtetlist[21]; // Old configuration at ab, save maximum 20 tets. + triface bftetlist[21]; // Old configuration at bf, save maximum 20 tets. + triface newtetlist[90]; // New configuration after removing ab. + face checksh; + //enum fliptype fty; + REAL key; + bool remflag, subflag; + int n, n1, m, i, j, k; + + triface newtet; + point *ppt; + + // First try to strip abcd from the mesh. This needs to check either ab + // or cd is on the hull. Try to strip it whichever is true. + abcd = remedge->tt; + adjustedgering(abcd, CCW); + k = 0; + do { + sym(abcd, baccasing); + // Is the tet on the hull? + if (baccasing.tet == dummytet) { + fnext(abcd, badc); + sym(badc, abdcasing); + if (abdcasing.tet == dummytet) { + // Strip the tet from the mesh -> ab is removed as well. + if (removetetbypeeloff(&abcd, newtetlist)) { + if (b->verbose > 1) { + printf(" Stripped tet from the mesh.\n"); + } + optcount[0]++; + opt_tet_peels++; + // edge is removed. Test new tets for further optimization. + for (i = 0; i < 2; i++) { + if (optflag) { + checktet4opt(&(newtetlist[i]), true); + } else { + checktet4ill(&(newtetlist[i]), true); + } + } + // Update the point-to-tet map + for (i = 0; i < 2; i++) { + newtet = newtetlist[i]; + ppt = (point *) &(newtet.tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(newtet)); + } + } + return true; + } + } + } + // Check if the oppsite edge cd is on the hull. + enext2fnextself(abcd); + enext2self(abcd); + esymself(abcd); // --> cdab + k++; + } while (k < 2); + + // Get the tets configuration at ab. Collect maximum 10 tets. + subflag = false; + abcd = remedge->tt; + adjustedgering(abcd, CW); + n = 0; + abtetlist[n] = abcd; + do { + // Is the list full? + if (n == 20) break; + // Stop if a subface appears. + tspivot(abtetlist[n], checksh); + if (checksh.sh != dummysh) { + // ab is either a segment or a facet edge. The latter case is not + // handled yet! An edge flip is needed. + subflag = true; break; // return false; + } + // Get the next tet at ab. + fnext(abtetlist[n], abtetlist[n + 1]); + n++; + } while (apex(abtetlist[n]) != apex(abcd)); + + remflag = false; + key = remedge->key; + + if (subflag && optflag) { + /*abcd = remedge->tt; + adjustedgering(abcd, CCW); + // Try to flip face cda or cdb to improve quality. + for (j = 0; j < 2; j++) { + if (j == 0) { + enext2fnext(abcd, abtetlist[0]); // Goto cda. + } else { + enextfnext(abcd, abtetlist[0]); // Goto cdb. + } + fty = categorizeface(abtetlist[0]); + if (fty == T23) { + // A 2-to-3 flip is possible. + sym(abtetlist[0], abtetlist[1]); + assert(abtetlist[1].tet != dummytet); + n = 2; + m = 3; + remflag = removefacebyflip23(&key, abtetlist, newtetlist, NULL); + } else if (fty == T22) { + // A 2-to-2 or 4-to-4 flip is possible. + n = 2; + newtetlist[0] = abtetlist[0]; + adjustedgering(newtetlist[0], CW); + fnext(newtetlist[0], newtetlist[1]); + assert(newtetlist[1].tet != dummytet); + // May it is 4-to-4 flip. + if (fnext(newtetlist[1], newtetlist[2])) { + fnext(newtetlist[2], newtetlist[3]); + assert(newtetlist[3].tet != dummytet); + n = 4; + } + m = n; + remflag = removeedgebyflip22(&key, n, newtetlist, NULL); + } + // Has quality been improved? + if (remflag) { + if (b->verbose > 1) { + printf(" Done flip %d-to-%d. Qual: %g -> %g.\n", n, m, + acos(remedge->key) / PI * 180.0, acos(key) / PI * 180.0); + } + // Delete the old tets. Note, flip22() does not create new tets. + if (m == 3) { + for (i = 0; i < n; i++) { + tetrahedrondealloc(abtetlist[i].tet); + } + } + for (i = 0; i < m; i++) { + checktet4opt(&(newtetlist[i]), true); + } + // Update the point-to-tet map + for (i = 0; i < m; i++) { + newtet = newtetlist[i]; + ppt = (point *) &(newtet.tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(newtet)); + } + } + optcount[1]++; + opt_face_flips++; + return true; + } + } // j + */ + // Faces are not flipable. Return. + return false; + } + + // 2 < n < 20. + if (n == 3) { + // There are three tets at ab. Try to do a flip32 at ab. + remflag = removeedgebyflip32(&key, abtetlist, newtetlist, NULL); + } else if ((n > 3) && (n <= b->maxflipedgelinksize)) { + // Four tets case. Try to do edge transformation. + remflag = removeedgebytranNM(&key,n,abtetlist,newtetlist,NULL,NULL,NULL); + } else { + if (b->verbose > 1) { + printf(" !! Unhandled case: n = %d.\n", n); + } + } + if (remflag) { + optcount[n]++; + // Delete the old tets. + for (i = 0; i < n; i++) { + tetrahedrondealloc(abtetlist[i].tet); + } + m = (n - 2) * 2; // The numebr of new tets. + if (b->verbose > 1) { + printf(" Done flip %d-to-%d. ", n, m); + if (optflag) { + printf("Qual: %g -> %g.", acos(remedge->key) / PI * 180.0, + acos(key) / PI * 180.0); + } + printf("\n"); + } + } + + if (!remflag && (key == remedge->key) && (n <= b->maxflipedgelinksize)) { + // Try to do a combination of flips. + n1 = 0; + remflag = removeedgebycombNM(&key, n, abtetlist, &n1, bftetlist, + newtetlist, NULL); + if (remflag) { + optcount[9]++; + // Delete the old tets. + for (i = 0; i < n; i++) { + tetrahedrondealloc(abtetlist[i].tet); + } + for (i = 0; i < n1; i++) { + if (!isdead(&(bftetlist[i]))) { + tetrahedrondealloc(bftetlist[i].tet); + } + } + m = ((n1 - 2) * 2 - 1) + (n - 3) * 2; // The number of new tets. + if (b->verbose > 1) { + printf(" Done flip %d-to-%d (n-1=%d, n1=%d). ", n+n1-2, m, n-1,n1); + if (optflag) { + printf("Qual: %g -> %g.", acos(remedge->key) / PI * 180.0, + acos(key) / PI * 180.0); + } + printf("\n"); + } + } + } + + if (remflag) { + // edge is removed. Test new tets for further optimization. + for (i = 0; i < m; i++) { + if (optflag) { + checktet4opt(&(newtetlist[i]), true); + } else { + checktet4ill(&(newtetlist[i]), true); + } + } + // Update the point-to-tet map + for (i = 0; i < m; i++) { + newtet = newtetlist[i]; + ppt = (point *) &(newtet.tet[4]); + for (j = 0; j < 4; j++) { + setpoint2tet(ppt[j], encode(newtet)); + } + } + opt_edge_flips++; + } + + return remflag; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// smoothpoint() Smooth a volume/segment point. // +// // +// 'smthpt' (p) is inside the polyhedron (C) bounded by faces in 'starlist'. // +// This routine moves p inside C until an object function is maximized. // +// // +// Default, the CCW edge ring of the faces on C points to p. If 'invtori' is // +// TRUE, the orientation is inversed. // +// // +// If 'key' != NULL, it contains an object value to be improved. Current it // +// means the cosine of the largest dihedral angle. In such case, the point // +// is smoothed only if the final configuration improves the object value, it // +// is returned by the 'key'. // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::smoothpoint(point smthpt, point e1, point e2, list *starlist, + bool invtori, REAL *key) +{ + triface starttet; + point pa, pb, pc; + REAL fcent[3], startpt[3], nextpt[3], bestpt[3]; + REAL iniTmax, oldTmax, newTmax; + REAL ori, aspT, aspTmax, imprate; + REAL cosd, maxcosd; + bool segflag, randflag; //, subflag; + int numdirs; + int iter, i, j; + + // Is p a segment vertex? + segflag = (e1 != (point) NULL); + // Decide the number of moving directions. + numdirs = segflag ? 2 : starlist->len(); + randflag = numdirs > 10; + if (randflag) { + numdirs = 10; // Maximum 10 directions. + } + + // Calculate the initial object value (the largest aspect ratio). + for (i = 0; i < starlist->len(); i++) { + starttet = * (triface *)(* starlist)[i]; + adjustedgering(starttet, !invtori ? CCW : CW); + pa = org(starttet); + pb = dest(starttet); + pc = apex(starttet); + aspT = tetaspectratio(pa, pb, pc, smthpt); + if (i == 0) { + aspTmax = aspT; + } else { + aspTmax = aspT > aspTmax ? aspT : aspTmax; + } + } + iniTmax = aspTmax; + + if (b->verbose > 1) { + printf(" Smooth %s point %d (%g, %g, %g).\n", segflag ? "seg" : "vol", + pointmark(smthpt), smthpt[0], smthpt[1], smthpt[2]); + printf(" Initial max L/h = %g.\n", iniTmax); + } + for (i = 0; i < 3; i++) { + bestpt[i] = startpt[i] = smthpt[i]; + } + + // Do iteration until the new aspTmax does not decrease. + newTmax = iniTmax; + iter = 0; + while (true) { + // Find the best next location. + oldTmax = newTmax; + for (i = 0; i < numdirs; i++) { + // Calculate the moved point (saved in 'nextpt'). + if (!segflag) { + if (randflag) { + // Randomly pick a direction. + j = (int) randomnation(starlist->len()); + } else { + j = i; + } + starttet = * (triface *)(* starlist)[j]; + adjustedgering(starttet, !invtori ? CCW : CW); + pa = org(starttet); + pb = dest(starttet); + pc = apex(starttet); + for (j = 0; j < 3; j++) { + fcent[j] = (pa[j] + pb[j] + pc[j]) / 3.0; + } + } else { + for (j = 0; j < 3; j++) { + fcent[j] = (i == 0 ? e1[j] : e2[j]); + } + } + for (j = 0; j < 3; j++) { + nextpt[j] = startpt[j] + 0.01 * (fcent[j] - startpt[j]); + } + // Get the largest object value for the new location. + for (j = 0; j < starlist->len(); j++) { + starttet = * (triface *)(* starlist)[j]; + adjustedgering(starttet, !invtori ? CCW : CW); + pa = org(starttet); + pb = dest(starttet); + pc = apex(starttet); + ori = orient3d(pa, pb, pc, nextpt); + if (ori < 0.0) { + aspT = tetaspectratio(pa, pb, pc, nextpt); + if (j == 0) { + aspTmax = aspT; + } else { + aspTmax = aspT > aspTmax ? aspT : aspTmax; + } + } else { + // An invalid new tet. Discard this point. + aspTmax = newTmax; + } // if (ori < 0.0) + // Stop looping when the object value is bigger than before. + if (aspTmax >= newTmax) break; + } // for (j = 0; j < starlist->len(); j++) + if (aspTmax < newTmax) { + // Save the improved object value and the location. + newTmax = aspTmax; + for (j = 0; j < 3; j++) bestpt[j] = nextpt[j]; + } + } // for (i = 0; i < starlist->len(); i++) + // Does the object value improved much? + imprate = fabs(oldTmax - newTmax) / oldTmax; + if (imprate < 1e-3) break; + // Yes, move p to the new location and continue. + for (j = 0; j < 3; j++) startpt[j] = bestpt[j]; + iter++; + } // while (true) + + if (iter > 0) { + // The point is moved. + if (key) { + // Check if the quality is improved by the smoothed point. + maxcosd = 0.0; // = cos(90). + for (j = 0; j < starlist->len(); j++) { + starttet = * (triface *)(* starlist)[j]; + adjustedgering(starttet, !invtori ? CCW : CW); + pa = org(starttet); + pb = dest(starttet); + pc = apex(starttet); + tetalldihedral(pa, pb, pc, startpt, NULL, &cosd, NULL); + if (cosd < *key) { + // This quality will not be improved. Stop. + iter = 0; break; + } else { + // Remeber the worst quality value (of the new configuration). + maxcosd = maxcosd < cosd ? maxcosd : cosd; + } + } + if (iter > 0) *key = maxcosd; + } + } + + if (iter > 0) { + if (segflag) smoothsegverts++; + for (i = 0; i < 3; i++) smthpt[i] = startpt[i]; + if (b->verbose > 1) { + printf(" Move to new location (%g, %g, %g).\n", smthpt[0], smthpt[1], + smthpt[2]); + printf(" Final max L/h = %g. (%d iterations)\n", newTmax, iter); + if (key) { + printf(" Max. dihed = %g (degree).\n", acos(*key) / PI * 180.0); + } + } + return true; + } else { + if (b->verbose > 1) { + printf(" Not smoothed.\n"); + } + return false; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// smoothsliver() Remove a sliver by smoothing a vertex of it. // +// // +// The 'slivtet' represents a sliver abcd, and ab is the current edge which // +// has a large dihedral angle (close to 180 degree). // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::smoothsliver(badface* remedge, list *starlist) +{ + triface checktet; + point smthpt; + bool smthed; + int idx, i, j; + + // Find a Steiner volume point and smooth it. + smthed = false; + for (i = 0; i < 4 && !smthed; i++) { + smthpt = (point) remedge->tt.tet[4 + i]; + // Is it a volume point? + if (pointtype(smthpt) == FREEVOLVERTEX) { + // Is it a Steiner point? + idx = pointmark(smthpt) - in->firstnumber; + if (!(idx < in->numberofpoints)) { + // Smooth a Steiner volume point. + starlist->append(&(remedge->tt.tet)); + formstarpolyhedron(smthpt, starlist, NULL, false); + smthed = smoothpoint(smthpt,NULL,NULL,starlist,false,&remedge->key); + // If it is smoothed. Queue new bad tets. + if (smthed) { + for (j = 0; j < starlist->len(); j++) { + checktet = * (triface *)(* starlist)[j]; + checktet4opt(&checktet, true); + } + } + starlist->clear(); + } + } + } + + /* Omit to smooth segment points. This may cause infinite loop. + if (smthed) { + return true; + } + face abseg, nextseg, prevseg; + point pt[2]; + // Check if ab is a segment. + tsspivot(slivtet, &abseg); + if (abseg.sh == dummysh) { + // ab is not a segment. Check if a or b is a Steiner segment point. + for (i = 0; i < 2 && !smthed; i++) { + smthpt = (i == 0 ? org(*slivtet) : dest(*slivtet)); + if (pointtype(smthpt) == FREESEGVERTEX) { + // Is it a Steiner point? + idx = pointmark(smthpt) - in->firstnumber; + if (!(idx < in->numberofpoints)) { + // Smooth a Steiner segment point. Get the segment. + sdecode(point2sh(smthpt), nextseg); + locateseg(smthpt, &nextseg); + assert(sorg(nextseg) == smthpt); + pt[0] = sdest(nextseg); + senext2(nextseg, prevseg); + spivotself(prevseg); + prevseg.shver = 0; + if (sorg(prevseg) == smthpt) sesymself(prevseg); + assert(sdest(prevseg) == smthpt); + pt[1] = sorg(prevseg); + starlist->append(slivtet); + formstarpolyhedron(smthpt, starlist, NULL, true); + smthed = smoothpoint(smthpt, pt[0], pt[1], starlist, false); + // If it is smoothed. Check if the tet is still a sliver. + if (smthed) checktet4opt(slivtet, true); + starlist->clear(); + } + } + } + } + */ + + return smthed; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// splitsliver() Remove a sliver by inserting a point. // +// // +// The 'remedge->tt' represents a sliver abcd, ab is the current edge which // +// has a large dihedral angle (close to 180 degree). // +// // +/////////////////////////////////////////////////////////////////////////////// + +bool tetgenmesh::splitsliver(badface *remedge, list *tetlist, list *ceillist) +{ + triface starttet; + face checkseg; + point newpt, pt[4]; + bool remflag; + int i; + + // Let 'remedge->tt' be the edge [a, b]. + starttet = remedge->tt; + + // Go to the opposite edge [c, d]. + adjustedgering(starttet, CCW); + enextfnextself(starttet); + enextself(starttet); + + // Check if cd is a segment. + tsspivot(&starttet, &checkseg); + if (b->nobisect == 0) { + if (checkseg.sh != dummysh) { + // cd is a segment. The seg will be split. + checkseg.shver = 0; + pt[0] = sorg(checkseg); + pt[1] = sdest(checkseg); + makepoint(&newpt); + getsplitpoint(pt[0], pt[1], NULL, newpt); + setpointtype(newpt, FREESEGVERTEX); + setpoint2seg(newpt, sencode(checkseg)); + // Insert p, this should always success. + sstpivot(&checkseg, &starttet); + splittetedge(newpt, &starttet, NULL); + // Collect the new tets connecting at p. + sstpivot(&checkseg, &starttet); + ceillist->append(&starttet); + formstarpolyhedron(newpt, ceillist, NULL, true); + setnewpointsize(newpt, pt[0], NULL); + if (steinerleft > 0) steinerleft--; + // Smooth p. + smoothpoint(newpt, pt[0], pt[1], ceillist, false, NULL); + // Queue new slivers. + for (i = 0; i < ceillist->len(); i++) { + starttet = * (triface *)(* ceillist)[i]; + checktet4opt(&starttet, true); + } + ceillist->clear(); + return true; + } + } + + // Create the new point p (at the circumcenter of t). + makepoint(&newpt); + /*// Get the four corners. + for (i = 0; i < 4; i++) { + pt[i] = (point) starttet.tet[4 + i]; + } + for (i = 0; i < 3; i++) { + newpt[i] = 0.25 * (pt[0][i] + pt[1][i] + pt[2][i] + pt[3][i]); + }*/ + pt[0] = org(starttet); + pt[1] = dest(starttet); + for (i = 0; i < 3; i++) { + newpt[i] = 0.5 * (pt[0][i] + pt[1][i]); + } + setpointtype(newpt, FREEVOLVERTEX); + + // Form the Bowyer-Watson cavity of p. + remflag = false; + infect(starttet); + tetlist->append(&starttet); + formbowatcavityquad(newpt, tetlist, ceillist); + if (trimbowatcavity(newpt, NULL, 1, NULL, NULL, &tetlist, &ceillist, -1.0)) { + // Smooth p. + if (smoothpoint( newpt, NULL, NULL, ceillist, false, &remedge->key)) { + // Insert p. + bowatinsertsite(newpt, NULL, 1, NULL, NULL, &tetlist, &ceillist, NULL, + NULL, false, false, false); + setnewpointsize(newpt, pt[0], NULL); + if (steinerleft > 0) steinerleft--; + // Queue new slivers. + for (i = 0; i < ceillist->len(); i++) { + starttet = * (triface *)(* ceillist)[i]; + checktet4opt(&starttet, true); + } + remflag = true; + } // if (smoothpoint) + } // if (trimbowatcavity) + + if (!remflag) { + // p is rejected for BC(p) is not valid. + pointdealloc(newpt); + // Uninfect tets of BC(p). + for (i = 0; i < tetlist->len(); i++) { + starttet = * (triface *)(* tetlist)[i]; + uninfect(starttet); + } + } + tetlist->clear(); + ceillist->clear(); + + return remflag; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// tallslivers() Queue all the slivers in the mesh. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::tallslivers(bool optflag) +{ + triface tetloop; + + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + if (optflag) { + checktet4opt(&tetloop, true); + } else { + checktet4ill(&tetloop, true); + } + tetloop.tet = tetrahedrontraverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// optimizemesh() Improving the mesh quality. // +// // +// Available mesh optimizing operations are: (1) multiple edge flips (3-to-2,// +// 4-to-4, 5-to-6, etc), (2) free vertex deletion, (3) new vertex insertion. // +// (1) is mandatory, while (2) and (3) are optionally. // +// // +// The variable 'b->optlevel' (set after '-s') determines the use of these // +// operations. If it is: 0, do no optimization; 1, only do (1) operation; 2, // +// do (1) and (2) operations; 3, do all operations. Deault, b->optlvel = 2. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::optimizemesh2(bool optflag) +{ + list *splittetlist, *tetlist, *ceillist; + badface *remtet, *newbadtet; + REAL maxdihed, objdihed, cosobjdihed; + long oldflipcount, newflipcount; + long oldpointcount; + int slivercount; + int optpasscount; + int iter, i; + + // Cosines of the six dihedral angles of the tet [a, b, c, d]. + // From cosdd[0] to cosdd[5]: ab, bc, ca, ad, bd, cd. + REAL cosdd[6]; + //int j; + + if (!b->quiet) { + if (optflag) { + if (b_steinerflag) { + // This routine is called from removesteiners2(); + } else { + printf("Optimizing mesh.\n"); + } + } else { + printf("Repairing mesh.\n"); + } + } + + if (optflag) { + if (b_steinerflag) { + // This routine is called from removesteiners2(); + cosmaxdihed = cos(179.0 * PI / 180.0); + cosmindihed = cos(1.0 * PI / 180.0); + // The radian of the maximum dihedral angle. + maxdihed = 179.0 / 180.0 * PI; + } else { + cosmaxdihed = cos(b->maxdihedral * PI / 180.0); + cosmindihed = cos(b->mindihedral * PI / 180.0); + // The radian of the maximum dihedral angle. + maxdihed = b->maxdihedral / 180.0 * PI; + // A sliver has an angle large than 'objdihed' will be split. + objdihed = b->maxdihedral + 5.0; + if (objdihed < 175.0) objdihed = 175.0; + objdihed = objdihed / 180.0 * PI; + cosobjdihed = cos(objdihed); + } + } + + // Initialize the pool of bad tets. + badtetrahedrons = new memorypool(sizeof(badface), ELEPERBLOCK, POINTER, 0); + // Looking for non-optimal tets. + tallslivers(optflag); + + oldpointcount = points->items; + opt_tet_peels = opt_face_flips = opt_edge_flips = 0l; + oldflipcount = newflipcount = 0l; + smoothsegverts = 0l; + optpasscount = 0; + + if (optflag && (b->verbose)) { + printf(" level = %d.\n", b->optlevel); + } + + // Start the mesh optimization iteration. + do { + + if (optflag && (b->verbose > 1)) { + printf(" level = %d.\n", b->optlevel); + } + + // Improve the mesh quality by flips. + iter = 0; + do { + oldflipcount = newflipcount; + // Loop in the list of bad tets. + badtetrahedrons->traversalinit(); + remtet = badfacetraverse(badtetrahedrons); + while (remtet != (badface *) NULL) { + if (!isdead(&remtet->tt) && (org(remtet->tt) == remtet->forg) && + (dest(remtet->tt) == remtet->fdest) && + (apex(remtet->tt) == remtet->fapex) && + (oppo(remtet->tt) == remtet->foppo)) { + if (b->verbose > 1) { + printf(" Repair tet (%d, %d, %d, %d) %g (degree).\n", + pointmark(remtet->forg), pointmark(remtet->fdest), + pointmark(remtet->fapex), pointmark(remtet->foppo), + acos(remtet->key) / PI * 180.0); + } + if (removeedge(remtet, optflag)) { + // Remove the badtet from the list. + badfacedealloc(badtetrahedrons, remtet); + } + } else { + // Remove the badtet from the list. + badfacedealloc(badtetrahedrons, remtet); + } + remtet = badfacetraverse(badtetrahedrons); + } + iter++; + if (iter > 10) break; // Stop at 10th iterations. + // Count the total number of flips. + newflipcount = opt_tet_peels + opt_face_flips + opt_edge_flips; + // Continue if there are bad tets and new flips. + } while ((badtetrahedrons->items > 0) && (newflipcount > oldflipcount)); + + if (b_steinerflag) { + // This routine was called from removesteiner2(). Do not repair + // the bad tets by splitting. + badtetrahedrons->restart(); + } + + if ((badtetrahedrons->items > 0l) && optflag && (b->optlevel > 2)) { + // Get a list of slivers and try to split them. + splittetlist = new list(sizeof(badface), NULL, 256); + tetlist = new list(sizeof(triface), NULL, 256); + ceillist = new list(sizeof(triface), NULL, 256); + + // Form a list of slivers to be split and clean the pool. + badtetrahedrons->traversalinit(); + remtet = badfacetraverse(badtetrahedrons); + while (remtet != (badface *) NULL) { + splittetlist->append(remtet); + remtet = badfacetraverse(badtetrahedrons); + } + // Clean the pool of bad tets. + badtetrahedrons->restart(); + slivercount = 0; + for (i = 0; i < splittetlist->len(); i++) { + remtet = (badface *)(* splittetlist)[i]; + if (!isdead(&remtet->tt) && org(remtet->tt) == remtet->forg && + dest(remtet->tt) == remtet->fdest && + apex(remtet->tt) == remtet->fapex && + oppo(remtet->tt) == remtet->foppo) { + // Calculate the six dihedral angles of this tet. + adjustedgering(remtet->tt, CCW); + remtet->forg = org(remtet->tt); + remtet->fdest = dest(remtet->tt); + remtet->fapex = apex(remtet->tt); + remtet->foppo = oppo(remtet->tt); + tetalldihedral(remtet->forg, remtet->fdest, remtet->fapex, + remtet->foppo, cosdd, NULL, NULL); + // Is it a large angle? + if (cosdd[0] < cosobjdihed) { + slivercount++; + remtet->key = cosdd[0]; + if (b->verbose > 1) { + printf(" Split tet (%d, %d, %d, %d) %g (degree).\n", + pointmark(remtet->forg), pointmark(remtet->fdest), + pointmark(remtet->fapex), pointmark(remtet->foppo), + acos(remtet->key) / PI * 180.0); + } + /*if (b->verbose && ((acos(cosdd[0]) / PI * 180) > 179)) { + // For DEBUG only. + printf(" p:draw_tet(%d, %d, %d, %d) -- %d (", + pointmark(remtet->forg), pointmark(remtet->fdest), + pointmark(remtet->fapex), pointmark(remtet->foppo), + slivercount); + // Print the 6 dihedral angles. + for (j = 0; j < 5; j++) { + printf("%4.1f, ", acos(cosdd[j]) / PI * 180.0); + } + printf("%4.1f)\n", acos(cosdd[5]) / PI * 180.0); + }*/ + // Queue this tet. + newbadtet = (badface *) badtetrahedrons->alloc(); + *newbadtet = *remtet; + // Try to remove this tet. + if (!smoothsliver(remtet, tetlist)) { + splitsliver(remtet, tetlist, ceillist); + } + } + } + } // i + + delete splittetlist; + delete tetlist; + delete ceillist; + } + + optpasscount++; + } while ((badtetrahedrons->items > 0) && (optpasscount < b->optpasses)); + + if (b->verbose) { + if (opt_tet_peels > 0l) { + printf(" %ld tet removals.\n", opt_tet_peels); + } + if (opt_face_flips > 0l) { + printf(" %ld face flips.\n", opt_face_flips); + } + if (opt_edge_flips > 0l) { + printf(" %ld edge flips.\n", opt_edge_flips); + } + if ((points->items - oldpointcount) > 0l) { + printf(" %ld point insertions", points->items - oldpointcount); + if (smoothsegverts > 0) { + printf(" (%d on segment)", smoothsegverts); + } + printf("\n"); + } + } + + delete badtetrahedrons; + badtetrahedrons = (memorypool *) NULL; +} + +//// //// +//// //// +//// optimize_cxx ///////////////////////////////////////////////////////////// + +//// output_cxx /////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// jettisonnodes() Jettison unused or duplicated vertices. // +// // +// Unused points are those input points which are outside the mesh domain or // +// have no connection (isolated) to the mesh. Duplicated points exist for // +// example if the input PLC is read from a .stl mesh file (marked during the // +// Delaunay tetrahedralization step. This routine remove these points from // +// points list. All existing points are reindexed. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::jettisonnodes() +{ + point pointloop; + bool jetflag; + int oldidx, newidx; + int remcount; + + if (!b->quiet) { + printf("Jettisoning redundants points.\n"); + } + + points->traversalinit(); + pointloop = pointtraverse(); + oldidx = newidx = 0; // in->firstnumber; + remcount = 0; + while (pointloop != (point) NULL) { + jetflag = (pointtype(pointloop) == DUPLICATEDVERTEX) || + (pointtype(pointloop) == UNUSEDVERTEX); + if (jetflag) { + // It is a duplicated point, delete it. + pointdealloc(pointloop); + remcount++; + } else { + // Re-index it. + setpointmark(pointloop, newidx + in->firstnumber); + if (in->pointmarkerlist != (int *) NULL) { + if (oldidx < in->numberofpoints) { + // Re-index the point marker as well. + in->pointmarkerlist[newidx] = in->pointmarkerlist[oldidx]; + } + } + newidx++; + } + oldidx++; + if (oldidx == in->numberofpoints) { + // Update the numbe of input points (Because some were removed). + in->numberofpoints -= remcount; + // Remember this number for output original input nodes. + jettisoninverts = remcount; + } + pointloop = pointtraverse(); + } + if (b->verbose) { + printf(" %d duplicated vertices have been removed.\n", dupverts); + printf(" %d unused vertices have been removed.\n", unuverts); + } + dupverts = 0; + unuverts = 0; + + // The following line ensures that dead items in the pool of nodes cannot + // be allocated for the new created nodes. This ensures that the input + // nodes will occur earlier in the output files, and have lower indices. + points->deaditemstack = (void *) NULL; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// highorder() Create extra nodes for quadratic subparametric elements. // +// // +// 'highordertable' is an array (size = numberoftetrahedra * 6) for storing // +// high-order nodes of each tetrahedron. This routine is used only when -o2 // +// switch is used. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::highorder() +{ + triface tetloop, worktet; + triface spintet, adjtet; + point torg, tdest, tapex; + point *extralist, *adjextralist; + point newpoint; + int hitbdry, ptmark; + int i, j; + + if (!b->quiet) { + printf("Adding vertices for second-order tetrahedra.\n"); + } + + // Initialize the 'highordertable'. + highordertable = new point[tetrahedrons->items * 6]; + if (highordertable == (point *) NULL) { + terminatetetgen(1); + } + + // The following line ensures that dead items in the pool of nodes cannot + // be allocated for the extra nodes associated with high order elements. + // This ensures that the primary nodes (at the corners of elements) will + // occur earlier in the output files, and have lower indices, than the + // extra nodes. + points->deaditemstack = (void *) NULL; + + // Assign an entry for each tetrahedron to find its extra nodes. At the + // mean while, initialize all extra nodes be NULL. + i = 0; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + tetloop.tet[highorderindex] = (tetrahedron) &highordertable[i]; + for (j = 0; j < 6; j++) { + highordertable[i + j] = (point) NULL; + } + i += 6; + tetloop.tet = tetrahedrontraverse(); + } + + // To create a unique node on each edge. Loop over all tetrahedra, and + // look at the six edges of each tetrahedron. If the extra node in + // the tetrahedron corresponding to this edge is NULL, create a node + // for this edge, at the same time, set the new node into the extra + // node lists of all other tetrahedra sharing this edge. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Get the list of extra nodes. + extralist = (point *) tetloop.tet[highorderindex]; + worktet.tet = tetloop.tet; + for (i = 0; i < 6; i++) { + if (extralist[i] == (point) NULL) { + // Operate on this edge. + worktet.loc = edge2locver[i][0]; + worktet.ver = edge2locver[i][1]; + // Create a new node on this edge. + torg = org(worktet); + tdest = dest(worktet); + // Create a new node in the middle of the edge. + newpoint = (point) points->alloc(); + // Interpolate its attributes. + for (j = 0; j < 3 + in->numberofpointattributes; j++) { + newpoint[j] = 0.5 * (torg[j] + tdest[j]); + } + ptmark = (int) points->items - (in->firstnumber == 1 ? 0 : 1); + setpointmark(newpoint, ptmark); + // Add this node to its extra node list. + extralist[i] = newpoint; + // Set 'newpoint' into extra node lists of other tetrahedra + // sharing this edge. + tapex = apex(worktet); + spintet = worktet; + hitbdry = 0; + while (hitbdry < 2) { + if (fnextself(spintet)) { + // Get the extra node list of 'spintet'. + adjextralist = (point *) spintet.tet[highorderindex]; + // Find the index of its extra node list. + j = locver2edge[spintet.loc][spintet.ver]; + // Only set 'newpoint' into 'adjextralist' if it is a NULL. + // Because two faces can belong to the same tetrahedron. + if (adjextralist[j] == (point) NULL) { + adjextralist[j] = newpoint; + } + if (apex(spintet) == tapex) { + break; + } + } else { + hitbdry++; + if (hitbdry < 2) { + esym(worktet, spintet); + } + } + } + } + } + tetloop.tet = tetrahedrontraverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// numberedges() Count the number of edges, save in "meshedges". // +// // +// This routine is called when '-p' or '-r', and '-E' options are used. The // +// total number of edges depends on the genus of the input surface mesh. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::numberedges() +{ + triface tetloop, worktet, spintet; + int hitbdry, i; + + if (!b->plc && !b->refine) { + // Using the Euler formula (V-E+F-T=1) to get the total number of edges. + long faces = (4l * tetrahedrons->items + hullsize) / 2l; + meshedges = points->items + faces - tetrahedrons->items - 1l; + return; + } + + meshedges = 0l; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + // Count the number of Voronoi faces. Look at the six edges of each + // tetrahedron. Count the edge only if the tetrahedron's pointer is + // smaller than those of all other tetrahedra that share the edge. + worktet.tet = tetloop.tet; + for (i = 0; i < 6; i++) { + worktet.loc = edge2locver[i][0]; + worktet.ver = edge2locver[i][1]; + adjustedgering(worktet, CW); + spintet = worktet; + hitbdry = 0; + while (hitbdry < 2) { + if (fnextself(spintet)) { + if (apex(spintet) == apex(worktet)) break; + if (spintet.tet < worktet.tet) break; + } else { + hitbdry++; + if (hitbdry < 2) { + esym(worktet, spintet); + fnextself(spintet); // In the same tet. + } + } + } + // Count this edge if no adjacent tets are smaller than this tet. + if (spintet.tet >= worktet.tet) { + meshedges++; + } + } + tetloop.tet = tetrahedrontraverse(); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outnodes() Output the points to a .node file or a tetgenio structure. // +// // +// Note: each point has already been numbered on input (the first index is // +// 'in->firstnumber'). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outnodes(tetgenio* out) +{ + FILE *outfile; + char outnodefilename[FILENAMESIZE]; + shellface subptr; + triface adjtet; + face subloop; + point pointloop; + point *extralist, ep[3]; + int nextras, bmark, shmark, marker; + int coordindex, attribindex; + int pointnumber, firstindex; + int index, i; + + if (out == (tetgenio *) NULL) { + strcpy(outnodefilename, b->outfilename); + strcat(outnodefilename, ".node"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outnodefilename); + } else { + printf("Writing nodes.\n"); + } + } + + nextras = in->numberofpointattributes; + bmark = !b->nobound && in->pointmarkerlist; + + // Avoid compile warnings. + outfile = (FILE *) NULL; + marker = coordindex = 0; + + if (out == (tetgenio *) NULL) { + outfile = fopen(outnodefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outnodefilename); + terminatetetgen(3); + } + // Number of points, number of dimensions, number of point attributes, + // and number of boundary markers (zero or one). + fprintf(outfile, "%ld %d %d %d\n", points->items, 3, nextras, bmark); + } else { + // Allocate space for 'pointlist'; + out->pointlist = new REAL[points->items * 3]; + if (out->pointlist == (REAL *) NULL) { + terminatetetgen(1); + } + // Allocate space for 'pointattributelist' if necessary; + if (nextras > 0) { + out->pointattributelist = new REAL[points->items * nextras]; + if (out->pointattributelist == (REAL *) NULL) { + terminatetetgen(1); + } + } + // Allocate space for 'pointmarkerlist' if necessary; + if (bmark) { + out->pointmarkerlist = new int[points->items]; + if (out->pointmarkerlist == (int *) NULL) { + terminatetetgen(1); + } + } + out->numberofpoints = points->items; + out->numberofpointattributes = nextras; + coordindex = 0; + attribindex = 0; + } + + if (bmark && (b->plc || b->refine)) { + // Initialize the point2tet field of each point. + points->traversalinit(); + pointloop = pointtraverse(); + while (pointloop != (point) NULL) { + setpoint2tet(pointloop, (tetrahedron) NULL); + pointloop = pointtraverse(); + } + // Make a map point-to-subface. Hence a boundary point will get the + // facet marker from that facet where it lies on. + subfaces->traversalinit(); + subloop.sh = shellfacetraverse(subfaces); + while (subloop.sh != (shellface *) NULL) { + subloop.shver = 0; + // Check all three points of the subface. + for (i = 0; i < 3; i++) { + pointloop = (point) subloop.sh[3 + i]; + setpoint2tet(pointloop, (tetrahedron) sencode(subloop)); + } + if (b->order == 2) { + // '-o2' switch. Set markers for quadratic nodes of this subface. + stpivot(subloop, adjtet); + if (adjtet.tet == dummytet) { + sesymself(subloop); + stpivot(subloop, adjtet); + } + assert(adjtet.tet != dummytet); + extralist = (point *) adjtet.tet[highorderindex]; + switch (adjtet.loc) { + case 0: + ep[0] = extralist[0]; + ep[1] = extralist[1]; + ep[2] = extralist[2]; + break; + case 1: + ep[0] = extralist[0]; + ep[1] = extralist[4]; + ep[2] = extralist[3]; + break; + case 2: + ep[0] = extralist[1]; + ep[1] = extralist[5]; + ep[2] = extralist[4]; + break; + case 3: + ep[0] = extralist[2]; + ep[1] = extralist[3]; + ep[2] = extralist[5]; + break; + default: break; + } + for (i = 0; i < 3; i++) { + setpoint2tet(ep[i], (tetrahedron) sencode(subloop)); + } + } + subloop.sh = shellfacetraverse(subfaces); + } + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + + points->traversalinit(); + pointloop = pointtraverse(); + pointnumber = firstindex; // in->firstnumber; + index = 0; + while (pointloop != (point) NULL) { + if (bmark) { + // Default the vertex has a zero marker. + marker = 0; + // Is it an input vertex? + if (index < in->numberofpoints) { + // Input point's marker is directly copied to output. + marker = in->pointmarkerlist[index]; + } + // Is it a boundary vertex has marker zero? + if ((marker == 0) && (b->plc || b->refine)) { + subptr = (shellface) point2tet(pointloop); + if (subptr != (shellface) NULL) { + // Default a boundary vertex has marker 1. + marker = 1; + if (in->facetmarkerlist != (int *) NULL) { + // The vertex gets the marker from the facet it lies on. + sdecode(subptr, subloop); + shmark = shellmark(subloop); + marker = in->facetmarkerlist[shmark - 1]; + } + } + } + } + if (out == (tetgenio *) NULL) { + // Point number, x, y and z coordinates. + fprintf(outfile, "%4d %.17g %.17g %.17g", pointnumber, + pointloop[0], pointloop[1], pointloop[2]); + for (i = 0; i < nextras; i++) { + // Write an attribute. + fprintf(outfile, " %.17g", pointloop[3 + i]); + } + if (bmark) { + // Write the boundary marker. + fprintf(outfile, " %d", marker); + } + fprintf(outfile, "\n"); + } else { + // X, y, and z coordinates. + out->pointlist[coordindex++] = pointloop[0]; + out->pointlist[coordindex++] = pointloop[1]; + out->pointlist[coordindex++] = pointloop[2]; + // Point attributes. + for (i = 0; i < nextras; i++) { + // Output an attribute. + out->pointattributelist[attribindex++] = pointloop[3 + i]; + } + if (bmark) { + // Output the boundary marker. + out->pointmarkerlist[index] = marker; + } + } + pointloop = pointtraverse(); + pointnumber++; + index++; + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outmetrics() Output the metric to a file (*.mtr) or a tetgenio obj. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outmetrics(tetgenio* out) +{ + FILE *outfile; + char outmtrfilename[FILENAMESIZE]; + list *tetlist, *ptlist; + triface tetloop; + point ptloop, neipt; + REAL lave, len; // lmin, lmax, + int mtrindex; + int i; + + if (out == (tetgenio *) NULL) { + strcpy(outmtrfilename, b->outfilename); + strcat(outmtrfilename, ".mtr"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outmtrfilename); + } else { + printf("Writing metrics.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + mtrindex = 0; + + if (out == (tetgenio *) NULL) { + outfile = fopen(outmtrfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outmtrfilename); + terminatetetgen(3); + } + // Number of points, number of point metrices, + // fprintf(outfile, "%ld %d\n", points->items, sizeoftensor + 3); + fprintf(outfile, "%ld %d\n", points->items, 1); + } else { + // Allocate space for 'pointmtrlist' if necessary; + // out->pointmtrlist = new REAL[points->items * (sizeoftensor + 3)]; + out->pointmtrlist = new REAL[points->items]; + if (out->pointmtrlist == (REAL *) NULL) { + terminatetetgen(1); + } + out->numberofpointmtrs = 1; // (sizeoftensor + 3); + mtrindex = 0; + } + + // Initialize the point2tet field of each point. + points->traversalinit(); + ptloop = pointtraverse(); + while (ptloop != (point) NULL) { + setpoint2tet(ptloop, (tetrahedron) NULL); + ptloop = pointtraverse(); + } + // Create the point-to-tet map. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + for (i = 0; i < 4; i++) { + ptloop = (point) tetloop.tet[4 + i]; + setpoint2tet(ptloop, encode(tetloop)); + } + tetloop.tet = tetrahedrontraverse(); + } + + tetlist = new list(sizeof(triface), NULL, 256); + ptlist = new list(sizeof(point *), NULL, 256); + + points->traversalinit(); + ptloop = pointtraverse(); + while (ptloop != (point) NULL) { + decode(point2tet(ptloop), tetloop); + if (!isdead(&tetloop)) { + // Form the star of p. + tetlist->append(&tetloop); + formstarpolyhedron(ptloop, tetlist, ptlist, true); + // lmin = longest; + // lmax = 0.0; + lave = 0.0; + for (i = 0; i < ptlist->len(); i++) { + neipt = * (point *)(* ptlist)[i]; + len = distance(ptloop, neipt); + // lmin = lmin < len ? lmin : len; + // lmax = lmax > len ? lmax : len; + lave += len; + } + lave /= ptlist->len(); + } + if (out == (tetgenio *) NULL) { + for (i = 0; i < sizeoftensor; i++) { + fprintf(outfile, "%-16.8e ", ptloop[pointmtrindex + i]); + } + if (ptlist->len() > 0) { + // fprintf(outfile, "%-16.8e %-16.8e %-16.8e", lmin, lmax, lave); + fprintf(outfile, "%-16.8e ", lave); + } else { + fprintf(outfile, "0.0 "); // fprintf(outfile, "0.0 0.0 0.0"); + } + fprintf(outfile, "\n"); + } else { + // for (i = 0; i < sizeoftensor; i++) { + // out->pointmtrlist[mtrindex++] = ptloop[pointmtrindex + i]; + // } + if (ptlist->len() > 0) { + // out->pointmtrlist[mtrindex++] = lmin; + // out->pointmtrlist[mtrindex++] = lmax; + out->pointmtrlist[mtrindex++] = lave; + } else { + // out->pointmtrlist[mtrindex++] = 0.0; + // out->pointmtrlist[mtrindex++] = 0.0; + out->pointmtrlist[mtrindex++] = 0.0; + } + } + tetlist->clear(); + ptlist->clear(); + ptloop = pointtraverse(); + } + + delete tetlist; + delete ptlist; + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outelements() Output the tetrahedra to an .ele file or a tetgenio // +// structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outelements(tetgenio* out) +{ + FILE *outfile; + char outelefilename[FILENAMESIZE]; + tetrahedron* tptr; + triface worktet, spintet; + int *tlist; + REAL *talist; + int firstindex, shift; + int pointindex; + int attribindex; + point p1, p2, p3, p4; + point *extralist; + int elementnumber; + int eextras; + int hitbdry, i; + + if (out == (tetgenio *) NULL) { + strcpy(outelefilename, b->outfilename); + strcat(outelefilename, ".ele"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outelefilename); + } else { + printf("Writing elements.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + tlist = (int *) NULL; + talist = (double *) NULL; + pointindex = attribindex = 0; + + eextras = in->numberoftetrahedronattributes; + if (out == (tetgenio *) NULL) { + outfile = fopen(outelefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outelefilename); + terminatetetgen(3); + } + // Number of tetras, points per tetra, attributes per tetra. + fprintf(outfile, "%ld %d %d\n", tetrahedrons->items, + b->order == 1 ? 4 : 10, eextras); + } else { + // Allocate memory for output tetrahedra. + out->tetrahedronlist = new int[tetrahedrons->items * + (b->order == 1 ? 4 : 10)]; + if (out->tetrahedronlist == (int *) NULL) { + terminatetetgen(1); + } + // Allocate memory for output tetrahedron attributes if necessary. + if (eextras > 0) { + out->tetrahedronattributelist = new REAL[tetrahedrons->items * eextras]; + if (out->tetrahedronattributelist == (REAL *) NULL) { + terminatetetgen(1); + } + } + out->numberoftetrahedra = tetrahedrons->items; + out->numberofcorners = b->order == 1 ? 4 : 10; + out->numberoftetrahedronattributes = eextras; + tlist = out->tetrahedronlist; + talist = out->tetrahedronattributelist; + pointindex = 0; + attribindex = 0; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift the output indices by 1. + } + + // Count the total edge numbers. + meshedges = 0l; + + tetrahedrons->traversalinit(); + tptr = tetrahedrontraverse(); + elementnumber = firstindex; // in->firstnumber; + while (tptr != (tetrahedron *) NULL) { + if (b->noelewritten == 2) { + // Reverse the orientation, such that Orient3D() > 0. + p1 = (point) tptr[5]; + p2 = (point) tptr[4]; + } else { + p1 = (point) tptr[4]; + p2 = (point) tptr[5]; + } + p3 = (point) tptr[6]; + p4 = (point) tptr[7]; + if (out == (tetgenio *) NULL) { + // Tetrahedron number, indices for four points. + fprintf(outfile, "%5d %5d %5d %5d %5d", elementnumber, + pointmark(p1) - shift, pointmark(p2) - shift, + pointmark(p3) - shift, pointmark(p4) - shift); + if (b->order == 2) { + extralist = (point *) tptr[highorderindex]; + // Tetrahedron number, indices for four points plus six extra points. + fprintf(outfile, " %5d %5d %5d %5d %5d %5d", + pointmark(extralist[0]) - shift, pointmark(extralist[1]) - shift, + pointmark(extralist[2]) - shift, pointmark(extralist[3]) - shift, + pointmark(extralist[4]) - shift, pointmark(extralist[5]) - shift); + } + for (i = 0; i < eextras; i++) { + fprintf(outfile, " %.17g", elemattribute(tptr, i)); + } + fprintf(outfile, "\n"); + } else { + tlist[pointindex++] = pointmark(p1) - shift; + tlist[pointindex++] = pointmark(p2) - shift; + tlist[pointindex++] = pointmark(p3) - shift; + tlist[pointindex++] = pointmark(p4) - shift; + if (b->order == 2) { + extralist = (point *) tptr[highorderindex]; + tlist[pointindex++] = pointmark(extralist[0]) - shift; + tlist[pointindex++] = pointmark(extralist[1]) - shift; + tlist[pointindex++] = pointmark(extralist[2]) - shift; + tlist[pointindex++] = pointmark(extralist[3]) - shift; + tlist[pointindex++] = pointmark(extralist[4]) - shift; + tlist[pointindex++] = pointmark(extralist[5]) - shift; + } + for (i = 0; i < eextras; i++) { + talist[attribindex++] = elemattribute(tptr, i); + } + } + if (b->neighout) { + // Remember the index of this element. + //* (int *) (tptr + elemmarkerindex) = elementnumber; + setelemmarker(tptr, elementnumber); + } + // Count the number of Voronoi faces. Look at the six edges of each + // tetrahedron. Count the edge only if the tetrahedron's pointer is + // smaller than those of all other tetrahedra that share the edge. + worktet.tet = tptr; + for (i = 0; i < 6; i++) { + worktet.loc = edge2locver[i][0]; + worktet.ver = edge2locver[i][1]; + adjustedgering(worktet, CW); + spintet = worktet; + hitbdry = 0; + while (hitbdry < 2) { + if (fnextself(spintet)) { + if (apex(spintet) == apex(worktet)) break; + if (spintet.tet < worktet.tet) break; + } else { + hitbdry++; + if (hitbdry < 2) { + esym(worktet, spintet); + fnextself(spintet); // In the same tet. + } + } + } + // Count this edge if no adjacent tets are smaller than this tet. + if (spintet.tet >= worktet.tet) { + meshedges++; + } + } + tptr = tetrahedrontraverse(); + elementnumber++; + } + if (b->neighout) { + // Set the outside element marker. + //* (int *) (dummytet + elemmarkerindex) = -1; + setelemmarker(dummytet, -1); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outfaces() Output all faces to a .face file or a tetgenio structure. // +// // +// This routines outputs all triangular faces (including outer boundary // +// faces and inner faces) of this mesh. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outfaces(tetgenio* out) +{ + FILE *outfile; + char facefilename[FILENAMESIZE]; + int *elist; + int *emlist; + int neigh1, neigh2; + int index; + triface tface, tsymface; + face checkmark; + point torg, tdest, tapex; + long faces; + int bmark, faceid, marker; + int firstindex, shift; + int facenumber; + + if (out == (tetgenio *) NULL) { + strcpy(facefilename, b->outfilename); + strcat(facefilename, ".face"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", facefilename); + } else { + printf("Writing faces.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + elist = (int *) NULL; + emlist = (int *) NULL; + index = marker = 0; + + faces = (4l * tetrahedrons->items + hullsize) / 2l; + bmark = !b->nobound && in->facetmarkerlist; + + if (out == (tetgenio *) NULL) { + outfile = fopen(facefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", facefilename); + terminatetetgen(3); + } + fprintf(outfile, "%ld %d\n", faces, bmark); + } else { + // Allocate memory for 'trifacelist'. + out->trifacelist = new int[faces * 3]; + if (out->trifacelist == (int *) NULL) { + terminatetetgen(1); + } + // Allocate memory for 'trifacemarkerlist' if necessary. + if (bmark) { + out->trifacemarkerlist = new int[faces]; + if (out->trifacemarkerlist == (int *) NULL) { + terminatetetgen(1); + } + } + if (b->neighout > 1) { + // '-nn' switch. + out->adjtetlist = new int[faces * 2]; + if (out->adjtetlist == (int *) NULL) { + terminatetetgen(1); + } + } + out->numberoftrifaces = faces; + elist = out->trifacelist; + emlist = out->trifacemarkerlist; + index = 0; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift the output indices by 1. + } + + tetrahedrons->traversalinit(); + tface.tet = tetrahedrontraverse(); + facenumber = firstindex; // in->firstnumber; + // To loop over the set of faces, loop over all tetrahedra, and look at + // the four faces of each one. If there isn't another tetrahedron + // adjacent to this face, operate on the face. If there is another + // adjacent tetrahedron, operate on the face only if the current + // tetrahedron has a smaller pointer than its neighbor. This way, each + // face is considered only once. + while (tface.tet != (tetrahedron *) NULL) { + for (tface.loc = 0; tface.loc < 4; tface.loc ++) { + sym(tface, tsymface); + if ((tsymface.tet == dummytet) || (tface.tet < tsymface.tet)) { + torg = org(tface); + tdest = dest(tface); + tapex = apex(tface); + if (bmark) { + // Get the boundary marker of this face. If it is an inner face, + // it has no boundary marker, set it be zero. + if (b->useshelles) { + // Shell face is used. + tspivot(tface, checkmark); + if (checkmark.sh == dummysh) { + marker = 0; // It is an inner face. + } else { + faceid = shellmark(checkmark) - 1; + marker = in->facetmarkerlist[faceid]; + } + } else { + // Shell face is not used, only distinguish outer and inner face. + marker = tsymface.tet != dummytet ? 1 : 0; + } + } + if (b->neighout > 1) { + // '-nn' switch. Output adjacent tets indices. + //neigh1 = * (int *)(tface.tet + elemmarkerindex); + neigh1 = getelemmarker(tface.tet); + if (tsymface.tet != dummytet) { + //neigh2 = * (int *)(tsymface.tet + elemmarkerindex); + neigh2 = getelemmarker(tsymface.tet); + } else { + neigh2 = -1; + } + } + if (out == (tetgenio *) NULL) { + // Face number, indices of three vertices. + fprintf(outfile, "%5d %4d %4d %4d", facenumber, + pointmark(torg) - shift, pointmark(tdest) - shift, + pointmark(tapex) - shift); + if (bmark) { + // Output a boundary marker. + fprintf(outfile, " %d", marker); + } + if (b->neighout > 1) { + fprintf(outfile, " %5d %5d", neigh1, neigh2); + } + fprintf(outfile, "\n"); + } else { + // Output indices of three vertices. + elist[index++] = pointmark(torg) - shift; + elist[index++] = pointmark(tdest) - shift; + elist[index++] = pointmark(tapex) - shift; + if (bmark) { + emlist[facenumber - in->firstnumber] = marker; + } + if (b->neighout > 1) { + out->adjtetlist[(facenumber - in->firstnumber) * 2] = neigh1; + out->adjtetlist[(facenumber - in->firstnumber) * 2 + 1] = neigh2; + } + } + facenumber++; + } + } + tface.tet = tetrahedrontraverse(); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outhullfaces() Output outer boundary faces to a .face file or a // +// tetgenio structure. // +// // +// The normal of each face is arranged to point inside of the domain (use // +// right-hand rule). This routines will outputs convex hull faces if the // +// mesh is a Delaunay tetrahedralization. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outhullfaces(tetgenio* out) +{ + FILE *outfile; + char facefilename[FILENAMESIZE]; + int *elist; + int index; + triface tface, tsymface; + face checkmark; + point torg, tdest, tapex; + int firstindex, shift; + int facenumber; + + if (out == (tetgenio *) NULL) { + strcpy(facefilename, b->outfilename); + strcat(facefilename, ".face"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", facefilename); + } else { + printf("Writing faces.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + elist = (int *) NULL; + index = 0; + + if (out == (tetgenio *) NULL) { + outfile = fopen(facefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", facefilename); + terminatetetgen(3); + } + fprintf(outfile, "%ld 0\n", hullsize); + } else { + // Allocate memory for 'trifacelist'. + out->trifacelist = new int[hullsize * 3]; + if (out->trifacelist == (int *) NULL) { + terminatetetgen(1); + } + out->numberoftrifaces = hullsize; + elist = out->trifacelist; + index = 0; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift the output indices by 1. + } + + tetrahedrons->traversalinit(); + tface.tet = tetrahedrontraverse(); + facenumber = firstindex; // in->firstnumber; + // To loop over the set of hull faces, loop over all tetrahedra, and look + // at the four faces of each one. If there isn't another tetrahedron + // adjacent to this face, operate on the face. + while (tface.tet != (tetrahedron *) NULL) { + for (tface.loc = 0; tface.loc < 4; tface.loc ++) { + sym(tface, tsymface); + if (tsymface.tet == dummytet) { + torg = org(tface); + tdest = dest(tface); + tapex = apex(tface); + if (out == (tetgenio *) NULL) { + // Face number, indices of three vertices. + fprintf(outfile, "%5d %4d %4d %4d", facenumber, + pointmark(torg) - shift, pointmark(tdest) - shift, + pointmark(tapex) - shift); + fprintf(outfile, "\n"); + } else { + // Output indices of three vertices. + elist[index++] = pointmark(torg) - shift; + elist[index++] = pointmark(tdest) - shift; + elist[index++] = pointmark(tapex) - shift; + } + facenumber++; + } + } + tface.tet = tetrahedrontraverse(); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outsubfaces() Output subfaces (i.e. boundary faces) to a .face file or // +// a tetgenio structure. // +// // +// The boundary faces are exist in 'subfaces'. For listing triangle vertices // +// in the same sense for all triangles in the mesh, the direction determined // +// by right-hand rule is pointer to the inside of the volume. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outsubfaces(tetgenio* out) +{ + FILE *outfile; + char facefilename[FILENAMESIZE]; + int *elist; + int *emlist; + int index, index1, index2; + triface abuttingtet; + face faceloop; + point torg, tdest, tapex; + int bmark, faceid, marker; + int firstindex, shift; + int neigh1, neigh2; + int facenumber; + + if (out == (tetgenio *) NULL) { + strcpy(facefilename, b->outfilename); + strcat(facefilename, ".face"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", facefilename); + } else { + printf("Writing faces.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + elist = (int *) NULL; + emlist = (int *) NULL; + index = index1 = index2 = 0; + faceid = marker = 0; + neigh1 = neigh2 = 0; + + bmark = !b->nobound && in->facetmarkerlist; + + if (out == (tetgenio *) NULL) { + outfile = fopen(facefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", facefilename); + terminatetetgen(3); + } + // Number of subfaces. + fprintf(outfile, "%ld %d\n", subfaces->items, bmark); + } else { + // Allocate memory for 'trifacelist'. + out->trifacelist = new int[subfaces->items * 3]; + if (out->trifacelist == (int *) NULL) { + terminatetetgen(1); + } + if (bmark) { + // Allocate memory for 'trifacemarkerlist'. + out->trifacemarkerlist = new int[subfaces->items]; + if (out->trifacemarkerlist == (int *) NULL) { + terminatetetgen(1); + } + } + if (b->neighout > 1) { + // '-nn' switch. + out->adjtetlist = new int[subfaces->items * 2]; + if (out->adjtetlist == (int *) NULL) { + terminatetetgen(1); + } + } + out->numberoftrifaces = subfaces->items; + elist = out->trifacelist; + emlist = out->trifacemarkerlist; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift the output indices by 1. + } + + subfaces->traversalinit(); + faceloop.sh = shellfacetraverse(subfaces); + facenumber = firstindex; // in->firstnumber; + while (faceloop.sh != (shellface *) NULL) { + stpivot(faceloop, abuttingtet); + if (abuttingtet.tet == dummytet) { + sesymself(faceloop); + stpivot(faceloop, abuttingtet); + } + if (abuttingtet.tet != dummytet) { + // If there is a tetrahedron containing this subface, orient it so + // that the normal of this face points to inside of the volume by + // right-hand rule. + adjustedgering(abuttingtet, CCW); + torg = org(abuttingtet); + tdest = dest(abuttingtet); + tapex = apex(abuttingtet); + } else { + // This may happen when only a surface mesh be generated. + torg = sorg(faceloop); + tdest = sdest(faceloop); + tapex = sapex(faceloop); + } + if (bmark) { + faceid = shellmark(faceloop) - 1; + marker = in->facetmarkerlist[faceid]; + } + if (b->neighout > 1) { + // '-nn' switch. Output adjacent tets indices. + neigh1 = -1; + stpivot(faceloop, abuttingtet); + if (abuttingtet.tet != dummytet) { + //neigh1 = * (int *)(abuttingtet.tet + elemmarkerindex); + neigh1 = getelemmarker(abuttingtet.tet); + } + neigh2 = -1; + sesymself(faceloop); + stpivot(faceloop, abuttingtet); + if (abuttingtet.tet != dummytet) { + //neigh2 = * (int *)(abuttingtet.tet + elemmarkerindex); + neigh2 = getelemmarker(abuttingtet.tet); + } + } + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%5d %4d %4d %4d", facenumber, + pointmark(torg) - shift, pointmark(tdest) - shift, + pointmark(tapex) - shift); + if (bmark) { + fprintf(outfile, " %d", marker); + } + if (b->neighout > 1) { + fprintf(outfile, " %5d %5d", neigh1, neigh2); + } + fprintf(outfile, "\n"); + } else { + // Output three vertices of this face; + elist[index++] = pointmark(torg) - shift; + elist[index++] = pointmark(tdest) - shift; + elist[index++] = pointmark(tapex) - shift; + if (bmark) { + emlist[index1++] = marker; + } + if (b->neighout > 1) { + out->adjtetlist[index2++] = neigh1; + out->adjtetlist[index2++] = neigh2; + } + } + facenumber++; + faceloop.sh = shellfacetraverse(subfaces); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outedges() Output all edges to a .edge file or a structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outedges(tetgenio* out) +{ + FILE *outfile; + char edgefilename[FILENAMESIZE]; + int *elist, *emlist; + int index, index1; + triface tetloop, worktet, spintet; + face checkseg; + point torg, tdest; + int firstindex, shift; + int edgenumber, faceid, marker; + int hitbdry, i; + + if (out == (tetgenio *) NULL) { + strcpy(edgefilename, b->outfilename); + strcat(edgefilename, ".edge"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", edgefilename); + } else { + printf("Writing edges.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + elist = (int *) NULL; + emlist = (int *) NULL; + index = index1 = 0; + faceid = marker = 0; + + if (out == (tetgenio *) NULL) { + outfile = fopen(edgefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", edgefilename); + terminatetetgen(3); + } + // Write the number of edges, boundary markers (0 or 1). + fprintf(outfile, "%ld %d\n", meshedges, !b->nobound); + } else { + // Allocate memory for 'edgelist'. + out->edgelist = new int[meshedges * 2]; + if (out->edgelist == (int *) NULL) { + terminatetetgen(1); + } + if (!b->nobound) { + out->edgemarkerlist = new int[meshedges]; + } + out->numberofedges = meshedges; + elist = out->edgelist; + emlist = out->edgemarkerlist; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift (reduce) the output indices by 1. + } + + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + edgenumber = firstindex; // in->firstnumber; + while (tetloop.tet != (tetrahedron *) NULL) { + // Count the number of Voronoi faces. Look at the six edges of each + // tetrahedron. Count the edge only if the tetrahedron's pointer is + // smaller than those of all other tetrahedra that share the edge. + worktet.tet = tetloop.tet; + for (i = 0; i < 6; i++) { + worktet.loc = edge2locver[i][0]; + worktet.ver = edge2locver[i][1]; + adjustedgering(worktet, CW); + spintet = worktet; + hitbdry = 0; + while (hitbdry < 2) { + if (fnextself(spintet)) { + if (apex(spintet) == apex(worktet)) break; + if (spintet.tet < worktet.tet) break; + } else { + hitbdry++; + if (hitbdry < 2) { + esym(worktet, spintet); + fnextself(spintet); // In the same tet. + } + } + } + // Count this edge if no adjacent tets are smaller than this tet. + if (spintet.tet >= worktet.tet) { + torg = org(worktet); + tdest = dest(worktet); + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%5d %4d %4d", edgenumber, + pointmark(torg) - shift, pointmark(tdest) - shift); + } else { + // Output three vertices of this face; + elist[index++] = pointmark(torg) - shift; + elist[index++] = pointmark(tdest) - shift; + } + if (!b->nobound) { + // Check if the edge is a segment. + tsspivot(&worktet, &checkseg); + if (checkseg.sh != dummysh) { + marker = shellmark(checkseg); + if (marker == 0) { // Does it have no marker? + marker = 1; // Set the default marker for this segment. + } + } else { + marker = 0; // It's not a segment. + } + if (out == (tetgenio *) NULL) { + fprintf(outfile, " %d", marker); + } else { + emlist[index1++] = marker; + } + } + if (out == (tetgenio *) NULL) { + fprintf(outfile, "\n"); + } + edgenumber++; + } + } + tetloop.tet = tetrahedrontraverse(); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outsubsegments() Output segments to a .edge file or a structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outsubsegments(tetgenio* out) +{ + FILE *outfile; + char edgefilename[FILENAMESIZE]; + int *elist; + int index; + face edgeloop; + point torg, tdest; + int firstindex, shift; + int edgenumber; + + if (out == (tetgenio *) NULL) { + strcpy(edgefilename, b->outfilename); + strcat(edgefilename, ".edge"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", edgefilename); + } else { + printf("Writing edges.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + elist = (int *) NULL; + index = 0; + + if (out == (tetgenio *) NULL) { + outfile = fopen(edgefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", edgefilename); + terminatetetgen(3); + } + // Number of subsegments. + fprintf(outfile, "%ld\n", subsegs->items); + } else { + // Allocate memory for 'edgelist'. + out->edgelist = new int[subsegs->items * 2]; + if (out->edgelist == (int *) NULL) { + terminatetetgen(1); + } + out->numberofedges = subsegs->items; + elist = out->edgelist; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift the output indices by 1. + } + + subsegs->traversalinit(); + edgeloop.sh = shellfacetraverse(subsegs); + edgenumber = firstindex; // in->firstnumber; + while (edgeloop.sh != (shellface *) NULL) { + torg = sorg(edgeloop); + tdest = sdest(edgeloop); + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%5d %4d %4d\n", edgenumber, + pointmark(torg) - shift, pointmark(tdest) - shift); + } else { + // Output three vertices of this face; + elist[index++] = pointmark(torg) - shift; + elist[index++] = pointmark(tdest) - shift; + } + edgenumber++; + edgeloop.sh = shellfacetraverse(subsegs); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outneighbors() Output tet neighbors to a .neigh file or a structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outneighbors(tetgenio* out) +{ + FILE *outfile; + char neighborfilename[FILENAMESIZE]; + int *nlist; + int index; + triface tetloop, tetsym; + int neighbor1, neighbor2, neighbor3, neighbor4; + int firstindex; + int elementnumber; + + if (out == (tetgenio *) NULL) { + strcpy(neighborfilename, b->outfilename); + strcat(neighborfilename, ".neigh"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", neighborfilename); + } else { + printf("Writing neighbors.\n"); + } + } + + // Avoid compile warnings. + outfile = (FILE *) NULL; + nlist = (int *) NULL; + index = 0; + + if (out == (tetgenio *) NULL) { + outfile = fopen(neighborfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", neighborfilename); + terminatetetgen(3); + } + // Number of tetrahedra, four faces per tetrahedron. + fprintf(outfile, "%ld %d\n", tetrahedrons->items, 4); + } else { + // Allocate memory for 'neighborlist'. + out->neighborlist = new int[tetrahedrons->items * 4]; + if (out->neighborlist == (int *) NULL) { + terminatetetgen(1); + } + nlist = out->neighborlist; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + elementnumber = firstindex; // in->firstnumber; + while (tetloop.tet != (tetrahedron *) NULL) { + tetloop.loc = 2; + sym(tetloop, tetsym); + //neighbor1 = * (int *) (tetsym.tet + elemmarkerindex); + neighbor1 = getelemmarker(tetsym.tet); + tetloop.loc = 3; + sym(tetloop, tetsym); + //neighbor2 = * (int *) (tetsym.tet + elemmarkerindex); + neighbor2 = getelemmarker(tetsym.tet); + tetloop.loc = 1; + sym(tetloop, tetsym); + //neighbor3 = * (int *) (tetsym.tet + elemmarkerindex); + neighbor3 = getelemmarker(tetsym.tet); + tetloop.loc = 0; + sym(tetloop, tetsym); + //neighbor4 = * (int *) (tetsym.tet + elemmarkerindex); + neighbor4 = getelemmarker(tetsym.tet); + if (out == (tetgenio *) NULL) { + // Tetrahedra number, neighboring tetrahedron numbers. + fprintf(outfile, "%4d %4d %4d %4d %4d\n", elementnumber, + neighbor1, neighbor2, neighbor3, neighbor4); + } else { + nlist[index++] = neighbor1; + nlist[index++] = neighbor2; + nlist[index++] = neighbor3; + nlist[index++] = neighbor4; + } + tetloop.tet = tetrahedrontraverse(); + elementnumber++; + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outvoronoi() Output the Voronoi diagram to .v.node, .v.edge, v.face, // +// and .v.cell. // +// // +// The Voronoi diagram is the geometric dual of the Delaunay triangulation. // +// The Voronoi vertices are the circumcenters of Delaunay tetrahedra. Each // +// Voronoi edge connects two Voronoi vertices at two sides of a common Dela- // +// unay face. At a face of convex hull, it becomes a ray (goto the infinity).// +// A Voronoi face is the convex hull of all Voronoi vertices around a common // +// Delaunay edge. It is a closed polygon for any interal Delaunay edge. At a // +// ridge, it is unbounded. Each Voronoi cell is the convex hull of all Vor- // +// onoi vertices around a common Delaunay vertex. It is a polytope for any // +// internal Delaunay vertex. It is an unbounded polyhedron for a Delaunay // +// vertex belonging to the convex hull. // +// // +// Comment: Special thanks to Victor Liu for finding and fixing few bugs. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outvoronoi(tetgenio* out) +{ + FILE *outfile; + char outfilename[FILENAMESIZE]; + tetgenio::voroedge *vedge; + tetgenio::vorofacet *vfacet; + list *tetlist, *ptlist; + triface tetloop, worktet, spintet; + point pt[4], ptloop, neipt; + REAL ccent[3], infvec[3], vec1[3], vec2[3], L; + long faces, edges; + int *tetfaceindexarray, *tetedgeindexarray; + int arraysize, *vertarray; + int vpointcount, vedgecount, vfacecount, tcount; + int index, shift; + int end1, end2; + int hitbdry, i, j, k; + + // Output Voronoi vertices to .v.node file. + if (out == (tetgenio *) NULL) { + strcpy(outfilename, b->outfilename); + strcat(outfilename, ".v.node"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outfilename); + } else { + printf("Writing Voronoi vertices.\n"); + } + } + + // Determine the first index (0 or 1). + shift = (b->zeroindex ? 0 : in->firstnumber); + // The number of Delaunay faces (= the number of Voronoi edges). + faces = (4l * tetrahedrons->items + hullsize) / 2l; + // The number of Delaunay edges (= the number of Voronoi faces). + // edges = points->items + faces - tetrahedrons->items - 1; + edges = meshedges; + outfile = (FILE *) NULL; // Avoid compile warnings. + + if (out == (tetgenio *) NULL) { + outfile = fopen(outfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outfilename); + terminatetetgen(3); + } + // Number of voronoi points, 3 dim, no attributes, no marker. + fprintf(outfile, "%ld 3 0 0\n", tetrahedrons->items); + } else { + // Allocate space for 'vpointlist'. + out->numberofvpoints = (int) tetrahedrons->items; + out->vpointlist = new REAL[out->numberofvpoints * 3]; + if (out->vpointlist == (REAL *) NULL) { + terminatetetgen(1); + } + } + + // Loop the tetrahedronlist once, do the following: + // (1) Output Voronoi vertices (the circumcenter of the tetrahedron). + // (2) Make a map from points-to-tetrahedra (for Voronoi cells). + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + vpointcount = 0; + index = 0; + while (tetloop.tet != (tetrahedron *) NULL) { + // Calculate the circumcenter. + for (i = 0; i < 4; i++) { + pt[i] = (point) tetloop.tet[4 + i]; + setpoint2tet(pt[i], encode(tetloop)); + } + circumsphere(pt[0], pt[1], pt[2], pt[3], ccent, NULL); + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%4d %16.8e %16.8e %16.8e\n", vpointcount + shift, + ccent[0], ccent[1], ccent[2]); + } else { + out->vpointlist[index++] = ccent[0]; + out->vpointlist[index++] = ccent[1]; + out->vpointlist[index++] = ccent[2]; + } + // Remember the index of this element. + * (int *) (tetloop.tet + elemmarkerindex) = vpointcount; + vpointcount++; + tetloop.tet = tetrahedrontraverse(); + } + // Set the outside element marker. + * (int *) (dummytet + elemmarkerindex) = -1; + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } + + // Output Voronoi edges to .v.edge file. + if (out == (tetgenio *) NULL) { + strcpy(outfilename, b->outfilename); + strcat(outfilename, ".v.edge"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outfilename); + } else { + printf("Writing Voronoi edges.\n"); + } + } + + if (out == (tetgenio *) NULL) { + outfile = fopen(outfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outfilename); + terminatetetgen(3); + } + // Number of Voronoi edges, no marker. + fprintf(outfile, "%ld 0\n", faces); + } else { + // Allocate space for 'vpointlist'. + out->numberofvedges = (int) faces; + out->vedgelist = new tetgenio::voroedge[out->numberofvedges]; + } + + // Loop the tetrahedronlist once, output the Voronoi edges. The index of + // each Voronoi edge corresponding to the index of the Delaunay face. + // The four faces' indices of each tetrahedron are saved in the list + // 'tetfaceindexarray', in the entry of i, where i (0-based) is the + // index of this tetrahedron (= vpointcount). + tetfaceindexarray = new int[tetrahedrons->items * 4]; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + vedgecount = 0; + index = 0; + while (tetloop.tet != (tetrahedron *) NULL) { + // Count the number of Voronoi edges. Look at the four faces of each + // tetrahedron. Count the face if the tetrahedron's pointer is + // smaller than its neighbor's or the neighbor is outside. + end1 = * (int *) (tetloop.tet + elemmarkerindex); + for (i = 0; i < 4; i++) { + decode(tetloop.tet[i], worktet); + if ((worktet.tet == dummytet) || (tetloop.tet < worktet.tet)) { + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%4d %4d", vedgecount + shift, end1 + shift); + } else { + vedge = &(out->vedgelist[index++]); + vedge->v1 = end1 + shift; + } + end2 = * (int *) (worktet.tet + elemmarkerindex); + // Note that end2 may be -1 (worktet.tet is outside). + if (end2 == -1) { + // Calculate the out normal of this hull face. + worktet.tet = tetloop.tet; + worktet.loc = i; + worktet.ver = 1; // The CW edge ring. + pt[0] = org(worktet); + pt[1] = dest(worktet); + pt[2] = apex(worktet); + for (j = 0; j < 3; j++) vec1[j] = pt[1][j] - pt[0][j]; + for (j = 0; j < 3; j++) vec2[j] = pt[2][j] - pt[0][j]; + cross(vec1, vec2, infvec); + // Normalize it. + L = sqrt(infvec[0] * infvec[0] + infvec[1] * infvec[1] + + infvec[2] * infvec[2]); + if (L > 0) for (j = 0; j < 3; j++) infvec[j] /= L; + if (out == (tetgenio *) NULL) { + fprintf(outfile, " -1"); + fprintf(outfile, " %g %g %g\n", infvec[0], infvec[1], infvec[2]); + } else { + vedge->v2 = -1; + vedge->vnormal[0] = infvec[0]; + vedge->vnormal[1] = infvec[1]; + vedge->vnormal[2] = infvec[2]; + } + } else { + if (out == (tetgenio *) NULL) { + fprintf(outfile, " %4d\n", end2 + shift); + } else { + vedge->v2 = end2 + shift; + vedge->vnormal[0] = 0.0; + vedge->vnormal[1] = 0.0; + vedge->vnormal[2] = 0.0; + } + } + // Save the face index in this tet and its neighbor if exists. + tetfaceindexarray[end1 * 4 + i] = vedgecount; + if (end2 != -1) { + tetfaceindexarray[end2 * 4 + worktet.loc] = vedgecount; + } + vedgecount++; + } + } + tetloop.tet = tetrahedrontraverse(); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } + + // Output Voronoi faces to .v.face file. + if (out == (tetgenio *) NULL) { + strcpy(outfilename, b->outfilename); + strcat(outfilename, ".v.face"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outfilename); + } else { + printf("Writing Voronoi faces.\n"); + } + } + + if (out == (tetgenio *) NULL) { + outfile = fopen(outfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outfilename); + terminatetetgen(3); + } + // Number of Voronoi faces. + fprintf(outfile, "%ld 0\n", edges); + } else { + out->numberofvfacets = edges; + out->vfacetlist = new tetgenio::vorofacet[out->numberofvfacets]; + if (out->vfacetlist == (tetgenio::vorofacet *) NULL) { + terminatetetgen(1); + } + } + + // Loop the tetrahedronlist once, Output Voronoi facets. The index of each + // Voronoi facet corresponding to the index of the Delaunay edge. The + // six edges' indices of each tetrahedron are saved in the list 'tetedge- + // indexarray', in the entry of i, where i (0-based) is the index of + // this tetrahedron (= vpointcount). + tetedgeindexarray = new int[tetrahedrons->items * 6]; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + vfacecount = 0; + while (tetloop.tet != (tetrahedron *) NULL) { + // Count the number of Voronoi faces. Look at the six edges of each + // tetrahedron. Count the edge only if the tetrahedron's pointer is + // smaller than those of all other tetrahedra that share the edge. + worktet = tetloop; + for (i = 0; i < 6; i++) { + worktet.loc = edge2locver[i][0]; + worktet.ver = edge2locver[i][1]; + // Now count the number of tets surrounding this edge. + tcount = 1; + adjustedgering(worktet, CW); + spintet = worktet; + hitbdry = 0; + while (hitbdry < 2) { + if (fnextself(spintet)) { + if (apex(spintet) == apex(worktet)) break; + if (spintet.tet < worktet.tet) break; + tcount++; + } else { + hitbdry++; + if (hitbdry < 2) { + esym(worktet, spintet); + fnextself(spintet); // In the same tet. + } + } + } + // Count this edge if no adjacent tets are smaller than this tet. + if (spintet.tet >= worktet.tet) { + // Get the two endpoints of this edge. + pt[0] = org(worktet); + pt[1] = dest(worktet); + end1 = pointmark(pt[0]) - in->firstnumber; + end2 = pointmark(pt[1]) - in->firstnumber; + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%4d %4d %4d %-2d ", vfacecount + shift, + end1 + shift, end2 + shift, tcount + (hitbdry > 0)); + } else { + vfacet = &(out->vfacetlist[vfacecount]); + vfacet->c1 = end1 + shift; + vfacet->c2 = end2 + shift; + vfacet->elist = new int[tcount + (hitbdry > 0) + 1]; + vfacet->elist[0] = tcount + (hitbdry > 0); + index = 1; + } + // If hitbdry > 0, then spintet is a hull face. + if (hitbdry > 0) { + // The edge list starts with a ray. + vpointcount = * (int *) (spintet.tet + elemmarkerindex); + vedgecount = tetfaceindexarray[vpointcount * 4 + spintet.loc]; + if (out == (tetgenio *) NULL) { + fprintf(outfile, " %d", vedgecount + shift); + } else { + vfacet->elist[index++] = vedgecount + shift; + } + // Save this facet number in tet. + tetedgeindexarray[vpointcount * 6 + + locver2edge[spintet.loc][spintet.ver]] = vfacecount; + esymself(spintet); + fnextself(spintet); // In the same tet. + } + // Output internal Voronoi edges. + for (j = 0; j < tcount; j++) { + vpointcount = * (int *) (spintet.tet + elemmarkerindex); + vedgecount = tetfaceindexarray[vpointcount * 4 + spintet.loc]; + if (out == (tetgenio *) NULL) { + fprintf(outfile, " %d", vedgecount + shift); + } else { + vfacet->elist[index++] = vedgecount + shift; + } + // Save this facet number in tet. + tetedgeindexarray[vpointcount * 6 + + locver2edge[spintet.loc][spintet.ver]] = vfacecount; + fnextself(spintet); + } + if (out == (tetgenio *) NULL) { + fprintf(outfile, "\n"); + } + vfacecount++; + } + } // if (i = 0; i < 6; i++) + tetloop.tet = tetrahedrontraverse(); + } + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } + + // Output Voronoi cells to .v.cell file. + if (out == (tetgenio *) NULL) { + strcpy(outfilename, b->outfilename); + strcat(outfilename, ".v.cell"); + } + + if (!b->quiet) { + if (out == (tetgenio *) NULL) { + printf("Writing %s.\n", outfilename); + } else { + printf("Writing Voronoi cells.\n"); + } + } + + if (out == (tetgenio *) NULL) { + outfile = fopen(outfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", outfilename); + terminatetetgen(3); + } + // Number of Voronoi cells. + fprintf(outfile, "%ld\n", points->items); + } else { + out->numberofvcells = points->items; + out->vcelllist = new int*[out->numberofvcells]; + if (out->vcelllist == (int **) NULL) { + terminatetetgen(1); + } + } + + // Loop through point list, for each point, output a Voronoi cell. + tetlist = new list(sizeof(triface), NULL, 256); + ptlist = new list(sizeof(point *), NULL, 256); + points->traversalinit(); + ptloop = pointtraverse(); + vpointcount = 0; + while (ptloop != (point) NULL) { + decode(point2tet(ptloop), tetloop); + // assert(!isdead(&tetloop)); + if (!isdead(&tetloop)) { + // Form the star of p. + tetlist->append(&tetloop); + formstarpolyhedron(ptloop, tetlist, ptlist, true); + tcount = ptlist->len(); + if (out == (tetgenio *) NULL) { + fprintf(outfile, "%4d %-2d ", vpointcount + shift, tcount); + } else { + arraysize = tcount; + vertarray = new int[arraysize + 1]; + out->vcelllist[vpointcount] = vertarray; + vertarray[0] = arraysize; + index = 1; + } + // List Voronoi facets bounding this cell. + for (i = 0; i < ptlist->len(); i++) { + neipt = * (point *)(* ptlist)[i]; + // Find a tet in tetlist having edge (ptloop, neipt) -- Very Slow. + for (j = 0; j < tetlist->len(); j++) { + tetloop = * (triface *)(* tetlist)[j]; + for (k = 0; k < 6; k++) { + tetloop.loc = edge2locver[k][0]; + tetloop.ver = edge2locver[k][1]; + if (org(tetloop) == ptloop) { + if (dest(tetloop) == neipt) break; + } else if (org(tetloop) == neipt) { + if (dest(tetloop) == ptloop) break; + } + } + if (k < 6) break; // Found this edge. + } + assert(j < tetlist->len()); + // k is the right edge number. + end1 = * (int *) (tetloop.tet + elemmarkerindex); + vfacecount = tetedgeindexarray[end1 * 6 + k]; + if (out == (tetgenio *) NULL) { + fprintf(outfile, " %d", vfacecount + shift); + } else { + vertarray[index++] = vfacecount + shift; + } + } // for (i = 0; i < ptlist->len(); i++) { + if (out == (tetgenio *) NULL) { + fprintf(outfile, "\n"); + } + vpointcount++; + } + tetlist->clear(); + ptlist->clear(); + ptloop = pointtraverse(); + } + delete tetlist; + delete ptlist; + delete [] tetfaceindexarray; + delete [] tetedgeindexarray; + + if (out == (tetgenio *) NULL) { + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outsmesh() Write surface mesh to a .smesh file, which can be read and // +// tetrahedralized by TetGen. // +// // +// You can specify a filename (without suffix) in 'smfilename'. If you don't // +// supply a filename (let smfilename be NULL), the default name stored in // +// 'tetgenbehavior' will be used. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outsmesh(char* smfilename) +{ + FILE *outfile; + char nodfilename[FILENAMESIZE]; + char smefilename[FILENAMESIZE]; + face faceloop; + point p1, p2, p3; + int firstindex, shift; + int bmark; + int faceid, marker; + int i; + + if (smfilename != (char *) NULL && smfilename[0] != '\0') { + strcpy(smefilename, smfilename); + } else if (b->outfilename[0] != '\0') { + strcpy(smefilename, b->outfilename); + } else { + strcpy(smefilename, "unnamed"); + } + strcpy(nodfilename, smefilename); + strcat(smefilename, ".smesh"); + strcat(nodfilename, ".node"); + + if (!b->quiet) { + printf("Writing %s.\n", smefilename); + } + outfile = fopen(smefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", smefilename); + return; + } + + // Determine the first index (0 or 1). + firstindex = b->zeroindex ? 0 : in->firstnumber; + shift = 0; // Default no shiftment. + if ((in->firstnumber == 1) && (firstindex == 0)) { + shift = 1; // Shift the output indices by 1. + } + + fprintf(outfile, "# %s. TetGen's input file.\n", smefilename); + fprintf(outfile, "\n# part 1: node list.\n"); + fprintf(outfile, "0 3 0 0 # nodes are found in %s.\n", nodfilename); + + marker = 0; // avoid compile warning. + bmark = !b->nobound && in->facetmarkerlist; + + fprintf(outfile, "\n# part 2: facet list.\n"); + // Number of facets, boundary marker. + fprintf(outfile, "%ld %d\n", subfaces->items, bmark); + + subfaces->traversalinit(); + faceloop.sh = shellfacetraverse(subfaces); + while (faceloop.sh != (shellface *) NULL) { + p1 = sorg(faceloop); + p2 = sdest(faceloop); + p3 = sapex(faceloop); + if (bmark) { + faceid = shellmark(faceloop) - 1; + if (faceid >= 0) { + marker = in->facetmarkerlist[faceid]; + } else { + marker = 0; // This subface must be added manually later. + } + } + fprintf(outfile, "3 %4d %4d %4d", pointmark(p1) - shift, + pointmark(p2) - shift, pointmark(p3) - shift); + if (bmark) { + fprintf(outfile, " %d", marker); + } + fprintf(outfile, "\n"); + faceloop.sh = shellfacetraverse(subfaces); + } + + // Copy input holelist. + fprintf(outfile, "\n# part 3: hole list.\n"); + fprintf(outfile, "%d\n", in->numberofholes); + for (i = 0; i < in->numberofholes; i++) { + fprintf(outfile, "%d %g %g %g\n", i + in->firstnumber, + in->holelist[i * 3], in->holelist[i * 3 + 1], + in->holelist[i * 3 + 2]); + } + + // Copy input regionlist. + fprintf(outfile, "\n# part 4: region list.\n"); + fprintf(outfile, "%d\n", in->numberofregions); + for (i = 0; i < in->numberofregions; i++) { + fprintf(outfile, "%d %g %g %g %d %g\n", i + in->firstnumber, + in->regionlist[i * 5], in->regionlist[i * 5 + 1], + in->regionlist[i * 5 + 2], (int) in->regionlist[i * 5 + 3], + in->regionlist[i * 5 + 4]); + } + + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outmesh2medit() Write mesh to a .mesh file, which can be read and // +// rendered by Medit (a free mesh viewer from INRIA). // +// // +// You can specify a filename (without suffix) in 'mfilename'. If you don't // +// supply a filename (let mfilename be NULL), the default name stored in // +// 'tetgenbehavior' will be used. The output file will have the suffix .mesh.// +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outmesh2medit(char* mfilename) +{ + FILE *outfile; + char mefilename[FILENAMESIZE]; + tetrahedron* tetptr; + triface tface, tsymface; + face segloop, checkmark; + point ptloop, p1, p2, p3, p4; + long faces; + int pointnumber; + int i; + + if (mfilename != (char *) NULL && mfilename[0] != '\0') { + strcpy(mefilename, mfilename); + } else if (b->outfilename[0] != '\0') { + strcpy(mefilename, b->outfilename); + } else { + strcpy(mefilename, "unnamed"); + } + strcat(mefilename, ".mesh"); + + if (!b->quiet) { + printf("Writing %s.\n", mefilename); + } + outfile = fopen(mefilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", mefilename); + return; + } + + fprintf(outfile, "MeshVersionFormatted 1\n"); + fprintf(outfile, "\n"); + fprintf(outfile, "Dimension\n"); + fprintf(outfile, "3\n"); + fprintf(outfile, "\n"); + + fprintf(outfile, "\n# Set of mesh vertices\n"); + fprintf(outfile, "Vertices\n"); + fprintf(outfile, "%ld\n", points->items); + + points->traversalinit(); + ptloop = pointtraverse(); + pointnumber = 1; // Medit need start number form 1. + while (ptloop != (point) NULL) { + // Point coordinates. + fprintf(outfile, "%.17g %.17g %.17g", ptloop[0], ptloop[1], ptloop[2]); + if (in->numberofpointattributes > 0) { + // Write an attribute, ignore others if more than one. + fprintf(outfile, " %.17g\n", ptloop[3]); + } else { + fprintf(outfile, " 0\n"); + } + setpointmark(ptloop, pointnumber); + ptloop = pointtraverse(); + pointnumber++; + } + + // Compute the number of edges. + faces = (4l * tetrahedrons->items + hullsize) / 2l; + + fprintf(outfile, "\n# Set of Triangles\n"); + fprintf(outfile, "Triangles\n"); + fprintf(outfile, "%ld\n", faces); + + tetrahedrons->traversalinit(); + tface.tet = tetrahedrontraverse(); + // To loop over the set of faces, loop over all tetrahedra, and look at + // the four faces of each tetrahedron. If there isn't another tetrahedron + // adjacent to the face, operate on the face. If there is another adj- + // acent tetrahedron, operate on the face only if the current tetrahedron + // has a smaller pointer than its neighbor. This way, each face is + // considered only once. + while (tface.tet != (tetrahedron *) NULL) { + for (tface.loc = 0; tface.loc < 4; tface.loc ++) { + sym(tface, tsymface); + if (tface.tet < tsymface.tet || tsymface.tet == dummytet) { + p1 = org (tface); + p2 = dest(tface); + p3 = apex(tface); + fprintf(outfile, "%5d %5d %5d", + pointmark(p1), pointmark(p2), pointmark(p3)); + fprintf(outfile, " 0\n"); + } + } + tface.tet = tetrahedrontraverse(); + } + + fprintf(outfile, "\n# Set of Tetrahedra\n"); + fprintf(outfile, "Tetrahedra\n"); + fprintf(outfile, "%ld\n", tetrahedrons->items); + + tetrahedrons->traversalinit(); + tetptr = tetrahedrontraverse(); + while (tetptr != (tetrahedron *) NULL) { + p1 = (point) tetptr[4]; + p2 = (point) tetptr[5]; + p3 = (point) tetptr[6]; + p4 = (point) tetptr[7]; + fprintf(outfile, "%5d %5d %5d %5d", + pointmark(p1), pointmark(p2), pointmark(p3), pointmark(p4)); + if (in->numberoftetrahedronattributes > 0) { + fprintf(outfile, " %.17g", elemattribute(tetptr, 0)); + } else { + fprintf(outfile, " 0"); + } + fprintf(outfile, "\n"); + tetptr = tetrahedrontraverse(); + } + + fprintf(outfile, "\nCorners\n"); + fprintf(outfile, "%d\n", in->numberofpoints); + + for (i = 0; i < in->numberofpoints; i++) { + fprintf(outfile, "%4d\n", i + 1); + } + + if (b->useshelles) { + fprintf(outfile, "\nEdges\n"); + fprintf(outfile, "%ld\n", subsegs->items); + + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + p1 = sorg(segloop); + p2 = sdest(segloop); + fprintf(outfile, "%5d %5d", pointmark(p1), pointmark(p2)); + fprintf(outfile, " 0\n"); + segloop.sh = shellfacetraverse(subsegs); + } + } + + fprintf(outfile, "\nEnd\n"); + fclose(outfile); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outmesh2gid() Write mesh to a .ele.msh file and a .face.msh file, // +// which can be imported and rendered by Gid. // +// // +// You can specify a filename (without suffix) in 'gfilename'. If you don't // +// supply a filename (let gfilename be NULL), the default name stored in // +// 'tetgenbehavior' will be used. The suffixes (.ele.msh and .face.msh) will // +// be automatically added. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outmesh2gid(char* gfilename) +{ + FILE *outfile; + char gidfilename[FILENAMESIZE]; + tetrahedron* tetptr; + triface tface, tsymface; + face sface; + point ptloop, p1, p2, p3, p4; + int pointnumber; + int elementnumber; + + if (gfilename != (char *) NULL && gfilename[0] != '\0') { + strcpy(gidfilename, gfilename); + } else if (b->outfilename[0] != '\0') { + strcpy(gidfilename, b->outfilename); + } else { + strcpy(gidfilename, "unnamed"); + } + strcat(gidfilename, ".ele.msh"); + + if (!b->quiet) { + printf("Writing %s.\n", gidfilename); + } + outfile = fopen(gidfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", gidfilename); + return; + } + + fprintf(outfile, "mesh dimension = 3 elemtype tetrahedron nnode = 4\n"); + fprintf(outfile, "coordinates\n"); + + points->traversalinit(); + ptloop = pointtraverse(); + pointnumber = 1; // Gid need start number form 1. + while (ptloop != (point) NULL) { + // Point coordinates. + fprintf(outfile, "%4d %.17g %.17g %.17g", pointnumber, + ptloop[0], ptloop[1], ptloop[2]); + if (in->numberofpointattributes > 0) { + // Write an attribute, ignore others if more than one. + fprintf(outfile, " %.17g", ptloop[3]); + } + fprintf(outfile, "\n"); + setpointmark(ptloop, pointnumber); + ptloop = pointtraverse(); + pointnumber++; + } + + fprintf(outfile, "end coordinates\n"); + fprintf(outfile, "elements\n"); + + tetrahedrons->traversalinit(); + tetptr = tetrahedrontraverse(); + elementnumber = 1; + while (tetptr != (tetrahedron *) NULL) { + p1 = (point) tetptr[4]; + p2 = (point) tetptr[5]; + p3 = (point) tetptr[6]; + p4 = (point) tetptr[7]; + fprintf(outfile, "%5d %5d %5d %5d %5d", elementnumber, + pointmark(p1), pointmark(p2), pointmark(p3), pointmark(p4)); + if (in->numberoftetrahedronattributes > 0) { + fprintf(outfile, " %.17g", elemattribute(tetptr, 0)); + } + fprintf(outfile, "\n"); + tetptr = tetrahedrontraverse(); + elementnumber++; + } + + fprintf(outfile, "end elements\n"); + fclose(outfile); + + if (gfilename != (char *) NULL && gfilename[0] != '\0') { + strcpy(gidfilename, gfilename); + } else if (b->outfilename[0] != '\0') { + strcpy(gidfilename, b->outfilename); + } else { + strcpy(gidfilename, "unnamed"); + } + strcat(gidfilename, ".face.msh"); + + if (!b->quiet) { + printf("Writing %s.\n", gidfilename); + } + outfile = fopen(gidfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", gidfilename); + return; + } + + fprintf(outfile, "mesh dimension = 3 elemtype triangle nnode = 3\n"); + fprintf(outfile, "coordinates\n"); + + points->traversalinit(); + ptloop = pointtraverse(); + pointnumber = 1; // Gid need start number form 1. + while (ptloop != (point) NULL) { + // Point coordinates. + fprintf(outfile, "%4d %.17g %.17g %.17g", pointnumber, + ptloop[0], ptloop[1], ptloop[2]); + if (in->numberofpointattributes > 0) { + // Write an attribute, ignore others if more than one. + fprintf(outfile, " %.17g", ptloop[3]); + } + fprintf(outfile, "\n"); + setpointmark(ptloop, pointnumber); + ptloop = pointtraverse(); + pointnumber++; + } + + fprintf(outfile, "end coordinates\n"); + fprintf(outfile, "elements\n"); + + tetrahedrons->traversalinit(); + tface.tet = tetrahedrontraverse(); + elementnumber = 1; + while (tface.tet != (tetrahedron *) NULL) { + for (tface.loc = 0; tface.loc < 4; tface.loc ++) { + sym(tface, tsymface); + if ((tface.tet < tsymface.tet) || (tsymface.tet == dummytet)) { + p1 = org(tface); + p2 = dest(tface); + p3 = apex(tface); + if (tsymface.tet == dummytet) { + // It's a hull face, output it. + fprintf(outfile, "%5d %d %d %d\n", elementnumber, + pointmark(p1), pointmark(p2), pointmark(p3)); + elementnumber++; + } else if (b->useshelles) { + // Only output it if it's a subface. + tspivot(tface, sface); + if (sface.sh != dummysh) { + fprintf(outfile, "%5d %d %d %d\n", elementnumber, + pointmark(p1), pointmark(p2), pointmark(p3)); + elementnumber++; + } + } + } + } + tface.tet = tetrahedrontraverse(); + } + + fprintf(outfile, "end elements\n"); + fclose(outfile); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outmesh2off() Write the mesh to an .off file. // +// // +// .off, the Object File Format, is one of the popular file formats from the // +// Geometry Center's Geomview package (http://www.geomview.org). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outmesh2off(char* ofilename) +{ + FILE *outfile; + char offfilename[FILENAMESIZE]; + triface tface, tsymface; + point ptloop, p1, p2, p3; + long faces; + int shift; + + if (ofilename != (char *) NULL && ofilename[0] != '\0') { + strcpy(offfilename, ofilename); + } else if (b->outfilename[0] != '\0') { + strcpy(offfilename, b->outfilename); + } else { + strcpy(offfilename, "unnamed"); + } + strcat(offfilename, ".off"); + + if (!b->quiet) { + printf("Writing %s.\n", offfilename); + } + outfile = fopen(offfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", offfilename); + return; + } + + // Calculate the number of triangular faces in the tetrahedral mesh. + faces = (4l * tetrahedrons->items + hullsize) / 2l; + + // Number of points, faces, and edges(not used, here show hullsize). + fprintf(outfile, "OFF\n%ld %ld %ld\n", points->items, faces, hullsize); + + // Write the points. + points->traversalinit(); + ptloop = pointtraverse(); + while (ptloop != (point) NULL) { + fprintf(outfile, " %.17g %.17g %.17g\n",ptloop[0], ptloop[1], ptloop[2]); + ptloop = pointtraverse(); + } + + // OFF always use zero as the first index. + shift = in->firstnumber == 1 ? 1 : 0; + + tetrahedrons->traversalinit(); + tface.tet = tetrahedrontraverse(); + // To loop over the set of faces, loop over all tetrahedra, and look at + // the four faces of each tetrahedron. If there isn't another tetrahedron + // adjacent to the face, operate on the face. If there is another adj- + // acent tetrahedron, operate on the face only if the current tetrahedron + // has a smaller pointer than its neighbor. This way, each face is + // considered only once. + while (tface.tet != (tetrahedron *) NULL) { + for (tface.loc = 0; tface.loc < 4; tface.loc ++) { + sym(tface, tsymface); + if ((tface.tet < tsymface.tet) || (tsymface.tet == dummytet)) { + p1 = org(tface); + p2 = dest(tface); + p3 = apex(tface); + // Face number, indices of three vertexs. + fprintf(outfile, "3 %4d %4d %4d\n", pointmark(p1) - shift, + pointmark(p2) - shift, pointmark(p3) - shift); + } + } + tface.tet = tetrahedrontraverse(); + } + + fprintf(outfile, "# Generated by %s\n", b->commandline); + fclose(outfile); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// outmesh2vtk() Save mesh to file in VTK Legacy format. // +// // +// This function was contributed by Bryn Llyod from ETH, 2007. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::outmesh2vtk(char* ofilename) +{ + FILE *outfile; + char vtkfilename[FILENAMESIZE]; + point pointloop; + tetrahedron* tptr; + double x, y, z; + int n1, n2, n3, n4; + int nnodes = 4; + int celltype = 10; + + int NEL = tetrahedrons->items; + int NN = points->items; + + if (ofilename != (char *) NULL && ofilename[0] != '\0') { + strcpy(vtkfilename, ofilename); + } else if (b->outfilename[0] != '\0') { + strcpy(vtkfilename, b->outfilename); + } else { + strcpy(vtkfilename, "unnamed"); + } + strcat(vtkfilename, ".vtk"); + + if (!b->quiet) { + printf("Writing %s.\n", vtkfilename); + } + outfile = fopen(vtkfilename, "w"); + if (outfile == (FILE *) NULL) { + printf("File I/O Error: Cannot create file %s.\n", vtkfilename); + return; + } + + //always write big endian + //bool ImALittleEndian = !testIsBigEndian(); + + fprintf(outfile, "# vtk DataFile Version 2.0\n"); + fprintf(outfile, "Unstructured Grid\n"); + fprintf(outfile, "ASCII\n"); // BINARY + fprintf(outfile, "DATASET UNSTRUCTURED_GRID\n"); + fprintf(outfile, "POINTS %d double\n", NN); + + points->traversalinit(); + pointloop = pointtraverse(); + for(int id=0; idtraversalinit(); + tptr = tetrahedrontraverse(); + //elementnumber = firstindex; // in->firstnumber; + if (b->order == 2) { + printf(" Write VTK not implemented for order 2 elements \n"); + return; + } + while (tptr != (tetrahedron *) NULL) { + point p1 = (point) tptr[4]; + point p2 = (point) tptr[5]; + point p3 = (point) tptr[6]; + point p4 = (point) tptr[7]; + n1 = pointmark(p1) - in->firstnumber; + n2 = pointmark(p2) - in->firstnumber; + n3 = pointmark(p3) - in->firstnumber; + n4 = pointmark(p4) - in->firstnumber; + //if(ImALittleEndian){ + // swapBytes((unsigned char *) &nnodes, sizeof(nnodes)); + // swapBytes((unsigned char *) &n1, sizeof(n1)); + // swapBytes((unsigned char *) &n2, sizeof(n2)); + // swapBytes((unsigned char *) &n3, sizeof(n3)); + // swapBytes((unsigned char *) &n4, sizeof(n4)); + //} + //fwrite((char*)(&nnodes),sizeof(int), 1, outfile); + //fwrite((char*)(&n1),sizeof(int), 1, outfile); + //fwrite((char*)(&n2),sizeof(int), 1, outfile); + //fwrite((char*)(&n3),sizeof(int), 1, outfile); + //fwrite((char*)(&n4),sizeof(int), 1, outfile); + fprintf(outfile, "%d %4d %4d %4d %4d\n", nnodes, n1, n2, n3, n4); + tptr = tetrahedrontraverse(); + } + fprintf(outfile, "\n"); + + fprintf(outfile, "CELL_TYPES %d\n", NEL); + for(int tid=0; tidquiet) { + printf(" Checking consistency of mesh...\n"); + } + + horrors = 0; + // Run through the list of tetrahedra, checking each one. + tetrahedrons->traversalinit(); + tetraloop.tet = tetrahedrontraverse(); + while (tetraloop.tet != (tetrahedron *) NULL) { + // Check all four faces of the tetrahedron. + for (tetraloop.loc = 0; tetraloop.loc < 4; tetraloop.loc++) { + tetorg = org(tetraloop); + tetdest = dest(tetraloop); + tetapex = apex(tetraloop); + tetoppo = oppo(tetraloop); + if (tetraloop.loc == 0) { // Only test for inversion once. + oritest = orient3d(tetorg, tetdest, tetapex, tetoppo); + if (oritest >= 0.0) { + printf(" !! !! %s ", oritest > 0.0 ? "Inverted" : "Degenerated"); + printtet(&tetraloop); + printf(" orient3d = %.17g.\n", oritest); + horrors++; + } + } + // Find the neighboring tetrahedron on this face. + sym(tetraloop, oppotet); + if (oppotet.tet != dummytet) { + // Check if it is a dead tet. + if (!isdead(&oppotet)) { + // Check that the tetrahedron's neighbor knows it's a neighbor. + sym(oppotet, oppooppotet); + if ((tetraloop.tet != oppooppotet.tet) + || (tetraloop.loc != oppooppotet.loc)) { + printf(" !! !! Asymmetric tetra-tetra bond:\n"); + if (tetraloop.tet == oppooppotet.tet) { + printf(" (Right tetrahedron, wrong orientation)\n"); + } + printf(" First "); + printtet(&tetraloop); + printf(" Second (nonreciprocating) "); + printtet(&oppotet); + horrors++; + } + } else { + printf(" !! !! A dead neighbor:\n"); + printtet(&tetraloop); + horrors++; + } + } + } + /*if (infected(tetraloop)) { + pts = (point *) &(tetraloop.tet[4]); + printf(" !! tet (%d, %d, %d, %d) is infected.\n", pointmark(pts[0]), + pointmark(pts[1]), pointmark(pts[2]), pointmark(pts[3])); + horrors++; + } + if (marktested(tetraloop)) { + pts = (point *) &(tetraloop.tet[4]); + printf(" !! tet (%d, %d, %d, %d) is marktested.\n", pointmark(pts[0]), + pointmark(pts[1]), pointmark(pts[2]), pointmark(pts[3])); + horrors++; + }*/ + tetraloop.tet = tetrahedrontraverse(); + } + if (horrors == 0) { + if (!b->quiet) { + printf(" In my studied opinion, the mesh appears to be consistent.\n"); + } + } else if (horrors == 1) { + printf(" !! !! !! !! Precisely one festering wound discovered.\n"); + } else { + printf(" !! !! !! !! %d abominations witnessed.\n", horrors); + } + + return horrors; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checkshells() Test the boundary mesh for topological consistency. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::checkshells() +{ + triface oppotet, oppooppotet, testtet; + face shloop, segloop, spin; + face testsh, testseg, testshsh; + point shorg, shdest, segorg, segdest; + REAL checksign; + bool same; + int horrors; + int i, j; + + if (!b->quiet) { + printf(" Checking consistency of the mesh boundary...\n"); + } + horrors = 0; + + // Run through the list of subfaces, checking each one. + subfaces->traversalinit(); + shloop.sh = shellfacetraverse(subfaces); + while (shloop.sh != (shellface *) NULL) { + // Check two connected tetrahedra if they exist. + shloop.shver = 0; + stpivot(shloop, oppotet); + if (oppotet.tet != dummytet) { + // Check if the tet and the face have the same vertices. + for (i = 0; i < 3; i++) { + pinfect((point) shloop.sh[3 + i]); + } + for (j = 0; j < 3; j++) { + if (org(oppotet) == NULL) break; + if (!pinfected(org(oppotet))) break; + enextself(oppotet); + } + for (i = 0; i < 3; i++) { + puninfect((point) shloop.sh[3 + i]); + } + if (j < 3) { + printf(" !! !! Wrong subface-tet connection.\n"); + printf(" p:draw_subface(%d, %d, %d).\n", pointmark(sorg(shloop)), + pointmark(sdest(shloop)), pointmark(sapex(shloop))); + printf(" p:draw_tet(%d, %d, %d, %d).\n", + pointmark(org(oppotet)), pointmark(dest(oppotet)), + pointmark(apex(oppotet)), pointmark(oppo(oppotet))); + horrors++; + } + tspivot(oppotet, testsh); + if (testsh.sh != shloop.sh) { + printf(" !! !! Wrong tetra-subface connection.\n"); + printf(" Tetra: "); + printtet(&oppotet); + printf(" Subface: "); + printsh(&shloop); + horrors++; + } + if (oppo(oppotet) != (point) NULL) { + adjustedgering(oppotet, CCW); + checksign = orient3d(sorg(shloop), sdest(shloop), sapex(shloop), + oppo(oppotet)); + if (checksign >= 0.0) { + printf(" !! !! Wrong subface orientation.\n"); + printf(" Subface: "); + printsh(&shloop); + horrors++; + } + } + } + sesymself(shloop); + stpivot(shloop, oppooppotet); + if (oppooppotet.tet != dummytet) { + tspivot(oppooppotet, testsh); + if (testsh.sh != shloop.sh) { + printf(" !! !! Wrong tetra-subface connection.\n"); + printf(" Tetra: "); + printtet(&oppooppotet); + printf(" Subface: "); + printsh(&shloop); + horrors++; + } + if (oppotet.tet != dummytet) { + sym(oppotet, testtet); + if (testtet.tet != oppooppotet.tet) { + printf(" !! !! Wrong tetra-subface-tetra connection.\n"); + printf(" Tetra 1: "); + printtet(&oppotet); + printf(" Subface: "); + printsh(&shloop); + printf(" Tetra 2: "); + printtet(&oppooppotet); + horrors++; + } + } + if (oppo(oppooppotet) != (point) NULL) { + adjustedgering(oppooppotet, CCW); + checksign = orient3d(sorg(shloop), sdest(shloop), sapex(shloop), + oppo(oppooppotet)); + if (checksign >= 0.0) { + printf(" !! !! Wrong subface orientation.\n"); + printf(" Subface: "); + printsh(&shloop); + horrors++; + } + } + } + // Check connection between subfaces. + shloop.shver = 0; + for (i = 0; i < 3; i++) { + shorg = sorg(shloop); + shdest = sdest(shloop); + sspivot(shloop, testseg); + if (testseg.sh != dummysh) { + segorg = sorg(testseg); + segdest = sdest(testseg); + same = ((shorg == segorg) && (shdest == segdest)) + || ((shorg == segdest) && (shdest == segorg)); + if (!same) { + printf(" !! !! Wrong subface-subsegment connection.\n"); + printf(" Subface: "); + printsh(&shloop); + printf(" Subsegment: "); + printsh(&testseg); + horrors++; + } + } + spivot(shloop, testsh); + if (testsh.sh != dummysh) { + // Check if the subface is self-bonded. + if (testsh.sh == shloop.sh) { + printf(" !! !! Subface is self-bonded.\n"); + printsh(&shloop); + horrors++; + } + segorg = sorg(testsh); + segdest = sdest(testsh); + same = ((shorg == segorg) && (shdest == segdest)) + || ((shorg == segdest) && (shdest == segorg)); + if (!same) { + printf(" !! !! Wrong subface-subface connection.\n"); + printf(" Subface 1: "); + printsh(&shloop); + printf(" Subface 2: "); + printsh(&testsh); + horrors++; + } + spivot(testsh, testshsh); + shorg = sorg(testshsh); + shdest = sdest(testshsh); + same = ((shorg == segorg) && (shdest == segdest)) + || ((shorg == segdest) && (shdest == segorg)); + if (!same) { + printf(" !! !! Wrong subface-subface connection.\n"); + printf(" Subface 1: "); + printsh(&testsh); + printf(" Subface 2: "); + printsh(&testshsh); + horrors++; + } + if (testseg.sh == dummysh) { + if (testshsh.sh != shloop.sh) { + printf(" !! !! Wrong subface-subface connection.\n"); + printf(" Subface 1: "); + printsh(&shloop); + printf(" Subface 2: "); + printsh(&testsh); + horrors++; + } + } + } + senextself(shloop); + } + if (sinfected(shloop)) { + printf(" !! subface (%d, %d, %d) is infected.\n", + pointmark(sorg(shloop)), pointmark(sdest(shloop)), + pointmark(sapex(shloop))); + horrors++; + } + if (!b->quality) { + // During refinement, subfaces/subsegs rejected to be split were + // marktested. In other cases, they should be not. + if (smarktested(shloop)) { + printf(" !! subface (%d, %d, %d) is marktested.\n", + pointmark(sorg(shloop)), pointmark(sdest(shloop)), + pointmark(sapex(shloop))); + horrors++; + } + } + shloop.sh = shellfacetraverse(subfaces); + } + + if (horrors > 0) { + return horrors; + } + + // Run through the list of subsegs, checking each one. + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + segorg = sorg(segloop); + segdest = sdest(segloop); + spivot(segloop, testsh); + if (testsh.sh == dummysh) { + printf(" !! !! Wrong subsegment-subface connection.\n"); + printf(" Subsegment: "); + printsh(&segloop); + horrors++; + segloop.sh = shellfacetraverse(subsegs); + continue; + } + shorg = sorg(testsh); + shdest = sdest(testsh); + same = ((shorg == segorg) && (shdest == segdest)) + || ((shorg == segdest) && (shdest == segorg)); + if (!same) { + printf(" !! !! Wrong subsegment-subface connection.\n"); + printf(" Subsegment : "); + printsh(&segloop); + printf(" Subface : "); + printsh(&testsh); + horrors++; + segloop.sh = shellfacetraverse(subsegs); + continue; + } + // Check the connection of face loop around this subsegment. + spin = testsh; + i = 0; + do { + spivotself(spin); + if (spin.sh != dummysh) { + shorg = sorg(spin); + shdest = sdest(spin); + same = ((shorg == segorg) && (shdest == segdest)) + || ((shorg == segdest) && (shdest == segorg)); + if (!same) { + printf(" !! !! Wrong subsegment-subface connection.\n"); + printf(" Subsegment : "); + printsh(&segloop); + printf(" Subface : "); + printsh(&testsh); + horrors++; + break; + } + i++; + } else { + break; + } + } while (spin.sh != testsh.sh && i < 1000); + if (i >= 1000) { + printf(" !! !! Wrong subsegment-subface connection.\n"); + printf(" Subsegment : "); + printsh(&segloop); + horrors++; + } + segloop.sh = shellfacetraverse(subsegs); + } + if (horrors == 0) { + if (!b->quiet) { + printf(" Mesh boundaries connected correctly.\n"); + } + } else { + printf(" !! !! !! !! %d boundary connection viewed with horror.\n", + horrors); + } + return horrors; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checksegments() Check the connections between tetrahedra and segments. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::checksegments() +{ + triface tetloop, neightet; + face sseg, checkseg; + point pa, pb; + int hitbdry; + int horrors, i; + + if (!b->quiet) { + printf(" Checking tet-seg connections...\n"); + } + + horrors = 0; + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != NULL) { + // Loop the six edges of the tet. + if (tetloop.tet[8] != NULL) { + for (i = 0; i < 6; i++) { + tetloop.loc = edge2locver[i][0]; + tetloop.ver = edge2locver[i][1]; + tsspivot1(tetloop, sseg); + if (sseg.sh != dummysh) { + // Check if they are the same edge. + sseg.shver = 0; + pa = (point) sorg(sseg); + pb = (point) sdest(sseg); + if (!(((org(tetloop) == pa) && (dest(tetloop) == pb)) || + ((org(tetloop) == pb) && (dest(tetloop) == pa)))) { + printf(" !! Wrong tet-seg connection.\n"); + printf(" Tet: x%lx (%d, %d, %d, %d) - Seg: x%lx (%d, %d).\n", + (unsigned long) tetloop.tet, pointmark(org(tetloop)), + pointmark(dest(tetloop)), pointmark(apex(tetloop)), + pointmark(oppo(tetloop)), (unsigned long) sseg.sh, + pointmark(pa), pointmark(pb)); + horrors++; + } else { + // Loop all tets sharing at this edge. + neightet = tetloop; + hitbdry = 0; + do { + tsspivot1(neightet, checkseg); + if (checkseg.sh != sseg.sh) { + printf(" !! Wrong tet-seg connection.\n"); + printf(" Tet: x%lx (%d, %d, %d, %d) - ", + (unsigned long) tetloop.tet, pointmark(org(tetloop)), + pointmark(dest(tetloop)), pointmark(apex(tetloop)), + pointmark(oppo(tetloop))); + if (checkseg.sh != NULL) { + printf("Seg x%lx (%d, %d).\n", (unsigned long) checkseg.sh, + pointmark(sorg(checkseg)), pointmark(sdest(checkseg))); + } else { + printf("Seg: NULL.\n"); + } + horrors++; + } + tfnextself(neightet); + if (neightet.tet == dummytet) { + hitbdry++; + if (hitbdry == 2) break; + esym(tetloop, neightet); + tfnextself(neightet); + if (neightet.tet == dummytet) break; + } + } while (neightet.tet != tetloop.tet); + } + } + } + } + tetloop.tet = tetrahedrontraverse(); + } + + if (horrors == 0) { + printf(" Segments are connected properly.\n"); + } else { + printf(" !! !! !! !! Found %d missing connections.\n", horrors); + } + + return horrors; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checkdelaunay() Ensure that the mesh is constrained Delaunay. // +// // +// If 'flipqueue' is not NULL, non-locally Delaunay faces are saved in it. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int tetgenmesh::checkdelaunay(REAL eps, queue* flipqueue) +{ + triface tetraloop; + triface oppotet; + face opposhelle; + point tetorg, tetdest, tetapex, tetoppo; + point oppooppo; + REAL sign; + int shouldbedelaunay; + int horrors; + + if (!b->quiet) { + printf(" Checking Delaunay property of the mesh...\n"); + } + horrors = 0; + // Run through the list of triangles, checking each one. + tetrahedrons->traversalinit(); + tetraloop.tet = tetrahedrontraverse(); + while (tetraloop.tet != (tetrahedron *) NULL) { + // Check all four faces of the tetrahedron. + for (tetraloop.loc = 0; tetraloop.loc < 4; tetraloop.loc++) { + tetorg = org(tetraloop); + tetdest = dest(tetraloop); + tetapex = apex(tetraloop); + tetoppo = oppo(tetraloop); + sym(tetraloop, oppotet); + oppooppo = oppo(oppotet); + // Only do testif there is an adjoining tetrahedron whose pointer is + // larger (to ensure that each pair isn't tested twice). + shouldbedelaunay = (oppotet.tet != dummytet) + && (tetoppo != (point) NULL) + && (oppooppo != (point) NULL) + && (tetraloop.tet < oppotet.tet); + if (checksubfaces && shouldbedelaunay) { + // If a shell face separates the tetrahedra, then the face is + // constrained, so no local Delaunay test should be done. + tspivot(tetraloop, opposhelle); + if (opposhelle.sh != dummysh){ + shouldbedelaunay = 0; + } + } + if (shouldbedelaunay) { + sign = insphere(tetdest, tetorg, tetapex, tetoppo, oppooppo); + if ((sign > 0.0) && (eps > 0.0)) { + if (iscospheric(tetdest, tetorg, tetapex, tetoppo, oppooppo, sign, + eps)) sign = 0.0; + } + if (sign > 0.0) { + if (flipqueue) { + enqueueflipface(tetraloop, flipqueue); + } + horrors++; + } + } + } + tetraloop.tet = tetrahedrontraverse(); + } + + if (flipqueue == (queue *) NULL) { + if (horrors == 0) { + if (!b->quiet) { + printf(" The mesh is %s.\n", + checksubfaces ? "constrained Delaunay" : "Delaunay"); + } + } else { + printf(" !! !! !! !! %d obscenities viewed with horror.\n", horrors); + } + } + + return horrors; +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// checkconforming() Ensure that the mesh is conforming Delaunay. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::checkconforming() +{ + face segloop, shloop; + int encsubsegs, encsubfaces; + + if (!b->quiet) { + printf(" Checking conforming Delaunay property of mesh...\n"); + } + encsubsegs = encsubfaces = 0; + // Run through the list of subsegments, check each one. + subsegs->traversalinit(); + segloop.sh = shellfacetraverse(subsegs); + while (segloop.sh != (shellface *) NULL) { + if (checkseg4encroach(&segloop, NULL, NULL, false)) { + printf(" !! !! Non-conforming subsegment: (%d, %d)\n", + pointmark(sorg(segloop)), pointmark(sdest(segloop))); + encsubsegs++; + } + segloop.sh = shellfacetraverse(subsegs); + } + // Run through the list of subfaces, check each one. + subfaces->traversalinit(); + shloop.sh = shellfacetraverse(subfaces); + while (shloop.sh != (shellface *) NULL) { + if (checksub4encroach(&shloop, NULL, false)) { + printf(" !! !! Non-conforming subface: (%d, %d, %d)\n", + pointmark(sorg(shloop)), pointmark(sdest(shloop)), + pointmark(sapex(shloop))); + encsubfaces++; + } + shloop.sh = shellfacetraverse(subfaces); + } + if (encsubsegs == 0 && encsubfaces == 0) { + if (!b->quiet) { + printf(" The mesh is conforming Delaunay.\n"); + } + } else { + if (encsubsegs > 0) { + printf(" !! !! %d subsegments are non-conforming.\n", encsubsegs); + } + if (encsubfaces > 0) { + printf(" !! !! %d subfaces are non-conforming.\n", encsubfaces); + } + } +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// algorithmicstatistics() Print statistics about the mesh algorithms. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::algorithmicstatistics() +{ + printf("Algorithmic statistics:\n\n"); + + printf(" Number of orient3d tests: %ld\n", orient3dcount); + printf(" Number of insphere tests: %ld\n", inspherecount); + printf(" Number of symbolic insphere tests: %ld\n", insphere_sos_count); + printf(" Number of visited tets in point location: %ld\n", ptloc_count); + printf(" Maximal number of tets per point location: %ld\n",ptloc_max_count); + printf(" Number of hull sites: %ld\n", inserthullcount); + printf(" Number of 1-to-4 flips: %ld\n", flip14count); + printf(" Number of 2-to-6 flips: %ld\n", flip26count); + printf(" Number of n-t-2n flips: %ld\n", flipn2ncount); + + if (!b->plc) { + if (1) { + printf(" Number of deleted tets: %ld\n", totaldeadtets); + printf(" Number of created tets: %ld\n", totalbowatcavsize); + printf(" Maximum number of tets per new point: %ld\n", maxbowatcavsize); + // printf(" Number of 3-to-2 flips: %ld\n", flip32count); + } else { + // printf(" Number of 3-to-2 flips: %ld\n", flip32count); + // printf(" Number of 2-to-3 flips: %ld\n", flip23count); + // printf(" Number of n-to-m flips: %ld\n", flipnmcount); + // printf(" Total number of primitive flips: %ld\n", + // flip23count + flip32count); + } + } + + if (b->plc) { + printf(" Number of 2-to-2 flips: %ld\n", flip22count); + // printf(" Number of tri-edge inter (coplanar) tests: %ld (%ld)\n", + // triedgcount, triedgcopcount); + printf(" Number of crossed faces (edges) in scout segs: %ld (%ld)\n", + across_face_count, across_edge_count); + printf(" Maximal number of crossed faces per segment: %ld\n", + across_max_count); + printf(" Number of rule-1 points: %ld\n", r1count); + printf(" Number of rule-2 points: %ld\n", r2count); + printf(" Number of rule-3 points: %ld\n", r3count); + printf(" Maximal size of a missing region: %ld\n", maxregionsize); + printf(" Maximal size of a recovered cavity: %ld\n", maxcavsize); + printf(" Number of non-Delaunay edges: %ld\n", ndelaunayedgecount); + printf(" Number of cavity expansions: %ld\n", cavityexpcount); + } + + // printf(" Total point location time (millisec): %g\n", tloctime * 1e+3); + // printf(" Total point insertion time (millisec): %g\n",tinserttime*1e+3); + // if (b->bowyerwatson == 0) { + // printf(" Total flip time (millisec): %g\n", tfliptime * 1e+3); + // } + + printf("\n"); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// qualitystatistics() Print statistics about the quality of the mesh. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::qualitystatistics() +{ + triface tetloop, neightet; + point p[4]; + char sbuf[128]; + REAL radiusratiotable[12]; + REAL aspectratiotable[12]; + REAL A[4][4], rhs[4], D; + REAL V[6][3], N[4][3], H[4]; // edge-vectors, face-normals, face-heights. + REAL edgelength[6], alldihed[6], faceangle[3]; + REAL shortest, longest; + REAL smallestvolume, biggestvolume; + REAL smallestratio, biggestratio; + REAL smallestdiangle, biggestdiangle; + REAL smallestfaangle, biggestfaangle; + REAL tetvol, minaltitude; + REAL cirradius, minheightinv; // insradius; + REAL shortlen, longlen; + REAL tetaspect, tetradius; + REAL smalldiangle, bigdiangle; + REAL smallfaangle, bigfaangle; + int radiustable[12]; + int aspecttable[16]; + int dihedangletable[18]; + int faceangletable[18]; + int indx[4]; + int radiusindex; + int aspectindex; + int tendegree; + int i, j; + + printf("Mesh quality statistics:\n\n"); + + // Avoid compile warnings. + shortlen = longlen = 0.0; + smalldiangle = bigdiangle = 0.0; + + radiusratiotable[0] = 0.707; radiusratiotable[1] = 1.0; + radiusratiotable[2] = 1.1; radiusratiotable[3] = 1.2; + radiusratiotable[4] = 1.4; radiusratiotable[5] = 1.6; + radiusratiotable[6] = 1.8; radiusratiotable[7] = 2.0; + radiusratiotable[8] = 2.5; radiusratiotable[9] = 3.0; + radiusratiotable[10] = 10.0; radiusratiotable[11] = 0.0; + + aspectratiotable[0] = 1.5; aspectratiotable[1] = 2.0; + aspectratiotable[2] = 2.5; aspectratiotable[3] = 3.0; + aspectratiotable[4] = 4.0; aspectratiotable[5] = 6.0; + aspectratiotable[6] = 10.0; aspectratiotable[7] = 15.0; + aspectratiotable[8] = 25.0; aspectratiotable[9] = 50.0; + aspectratiotable[10] = 100.0; aspectratiotable[11] = 0.0; + + for (i = 0; i < 12; i++) radiustable[i] = 0; + for (i = 0; i < 12; i++) aspecttable[i] = 0; + for (i = 0; i < 18; i++) dihedangletable[i] = 0; + for (i = 0; i < 18; i++) faceangletable[i] = 0; + + minaltitude = xmax - xmin + ymax - ymin + zmax - zmin; + minaltitude = minaltitude * minaltitude; + shortest = minaltitude; + longest = 0.0; + smallestvolume = minaltitude; + biggestvolume = 0.0; + smallestratio = minaltitude; + biggestratio = 0.0; + smallestdiangle = smallestfaangle = 180.0; + biggestdiangle = biggestfaangle = 0.0; + + // Loop all elements, calculate quality parameters for each element. + tetrahedrons->traversalinit(); + tetloop.tet = tetrahedrontraverse(); + while (tetloop.tet != (tetrahedron *) NULL) { + + // Get four vertices: p0, p1, p2, p3. + for (i = 0; i < 4; i++) p[i] = (point) tetloop.tet[4 + i]; + // Set the edge vectors: V[0], ..., V[5] + for (i = 0; i < 3; i++) V[0][i] = p[0][i] - p[3][i]; // V[0]: p3->p0. + for (i = 0; i < 3; i++) V[1][i] = p[1][i] - p[3][i]; // V[1]: p3->p1. + for (i = 0; i < 3; i++) V[2][i] = p[2][i] - p[3][i]; // V[2]: p3->p2. + for (i = 0; i < 3; i++) V[3][i] = p[1][i] - p[0][i]; // V[3]: p0->p1. + for (i = 0; i < 3; i++) V[4][i] = p[2][i] - p[1][i]; // V[4]: p1->p2. + for (i = 0; i < 3; i++) V[5][i] = p[0][i] - p[2][i]; // V[5]: p2->p0. + // Set the matrix A = [V[0], V[1], V[2]]^T. + for (j = 0; j < 3; j++) { + for (i = 0; i < 3; i++) A[j][i] = V[j][i]; + } + // Decompose A just once. + lu_decmp(A, 3, indx, &D, 0); + // Get the tet volume. + tetvol = fabs(A[indx[0]][0] * A[indx[1]][1] * A[indx[2]][2]) / 6.0; + // Get the three faces normals. + for (j = 0; j < 3; j++) { + for (i = 0; i < 3; i++) rhs[i] = 0.0; + rhs[j] = 1.0; // Positive means the inside direction + lu_solve(A, 3, indx, rhs, 0); + for (i = 0; i < 3; i++) N[j][i] = rhs[i]; + } + // Get the fourth face normal by summing up the first three. + for (i = 0; i < 3; i++) N[3][i] = - N[0][i] - N[1][i] - N[2][i]; + // Get the radius of the circumsphere. + for (i = 0; i < 3; i++) rhs[i] = 0.5 * dot(V[i], V[i]); + lu_solve(A, 3, indx, rhs, 0); + cirradius = sqrt(dot(rhs, rhs)); + // Normalize the face normals. + for (i = 0; i < 4; i++) { + // H[i] is the inverse of height of its corresponding face. + H[i] = sqrt(dot(N[i], N[i])); + for (j = 0; j < 3; j++) N[i][j] /= H[i]; + } + // Get the radius of the inscribed sphere. + // insradius = 1.0 / (H[0] + H[1] + H[2] + H[3]); + // Get the biggest H[i] (corresponding to the smallest height). + minheightinv = H[0]; + for (i = 1; i < 3; i++) { + if (H[i] > minheightinv) minheightinv = H[i]; + } + // Get the squares of the edge lengthes. + for (i = 0; i < 6; i++) edgelength[i] = dot(V[i], V[i]); + // Get the dihedrals (in degree) at each edges. + j = 0; + for (i = 1; i < 4; i++) { + alldihed[j] = -dot(N[0], N[i]); // Edge cd, bd, bc. + if (alldihed[j] < -1.0) alldihed[j] = -1; // Rounding. + else if (alldihed[j] > 1.0) alldihed[j] = 1; + alldihed[j] = acos(alldihed[j]) / PI * 180.0; + j++; + } + for (i = 2; i < 4; i++) { + alldihed[j] = -dot(N[1], N[i]); // Edge ad, ac. + if (alldihed[j] < -1.0) alldihed[j] = -1; // Rounding. + else if (alldihed[j] > 1.0) alldihed[j] = 1; + alldihed[j] = acos(alldihed[j]) / PI * 180.0; + j++; + } + alldihed[j] = -dot(N[2], N[3]); // Edge ab. + if (alldihed[j] < -1.0) alldihed[j] = -1; // Rounding. + else if (alldihed[j] > 1.0) alldihed[j] = 1; + alldihed[j] = acos(alldihed[j]) / PI * 180.0; + + // Calculate the longest and shortest edge length. + for (i = 0; i < 6; i++) { + if (i == 0) { + shortlen = longlen = edgelength[i]; + } else { + shortlen = edgelength[i] < shortlen ? edgelength[i] : shortlen; + longlen = edgelength[i] > longlen ? edgelength[i] : longlen; + } + if (edgelength[i] > longest) { + longest = edgelength[i]; + } + if (edgelength[i] < shortest) { + shortest = edgelength[i]; + } + } + + // Calculate the largest and smallest volume. + if (tetvol < smallestvolume) { + smallestvolume = tetvol; + } + if (tetvol > biggestvolume) { + biggestvolume = tetvol; + } + + // Calculate the largest and smallest dihedral angles. + for (i = 0; i < 6; i++) { + if (i == 0) { + smalldiangle = bigdiangle = alldihed[i]; + } else { + smalldiangle = alldihed[i] < smalldiangle ? alldihed[i] : smalldiangle; + bigdiangle = alldihed[i] > bigdiangle ? alldihed[i] : bigdiangle; + } + if (alldihed[i] < smallestdiangle) { + smallestdiangle = alldihed[i]; + } + if (alldihed[i] > biggestdiangle) { + biggestdiangle = alldihed[i]; + } + } + // Accumulate the corresponding number in the dihedral angle histogram. + if (smalldiangle < 5.0) { + tendegree = 0; + } else if (smalldiangle >= 5.0 && smalldiangle < 10.0) { + tendegree = 1; + } else if (smalldiangle >= 80.0 && smalldiangle < 110.0) { + tendegree = 9; // Angles between 80 to 110 degree are in one entry. + } else { + tendegree = (int) (smalldiangle / 10.); + if (smalldiangle < 80.0) { + tendegree++; // In the left column. + } else { + tendegree--; // In the right column. + } + } + dihedangletable[tendegree]++; + if (bigdiangle >= 80.0 && bigdiangle < 110.0) { + tendegree = 9; // Angles between 80 to 110 degree are in one entry. + } else if (bigdiangle >= 170.0 && bigdiangle < 175.0) { + tendegree = 16; + } else if (bigdiangle >= 175.0) { + tendegree = 17; + } else { + tendegree = (int) (bigdiangle / 10.); + if (bigdiangle < 80.0) { + tendegree++; // In the left column. + } else { + tendegree--; // In the right column. + } + } + dihedangletable[tendegree]++; + + // Calulate the largest and smallest face angles. + tetloop.ver = 0; + for (tetloop.loc = 0; tetloop.loc < 4; tetloop.loc++) { + sym(tetloop, neightet); + // Only do the calulation once for a face. + if ((neightet.tet == dummytet) || (tetloop.tet < neightet.tet)) { + p[0] = org(tetloop); + p[1] = dest(tetloop); + p[2] = apex(tetloop); + faceangle[0] = interiorangle(p[0], p[1], p[2], NULL); + faceangle[1] = interiorangle(p[1], p[2], p[0], NULL); + faceangle[2] = PI - (faceangle[0] + faceangle[1]); + // Translate angles into degrees. + for (i = 0; i < 3; i++) { + faceangle[i] = (faceangle[i] * 180.0) / PI; + } + // Calculate the largest and smallest face angles. + for (i = 0; i < 3; i++) { + if (i == 0) { + smallfaangle = bigfaangle = faceangle[i]; + } else { + smallfaangle = faceangle[i] < smallfaangle ? + faceangle[i] : smallfaangle; + bigfaangle = faceangle[i] > bigfaangle ? faceangle[i] : bigfaangle; + } + if (faceangle[i] < smallestfaangle) { + smallestfaangle = faceangle[i]; + } + if (faceangle[i] > biggestfaangle) { + biggestfaangle = faceangle[i]; + } + } + tendegree = (int) (smallfaangle / 10.); + faceangletable[tendegree]++; + tendegree = (int) (bigfaangle / 10.); + faceangletable[tendegree]++; + } + } + + // Calculate aspect ratio and radius-edge ratio for this element. + tetradius = cirradius / sqrt(shortlen); + // tetaspect = sqrt(longlen) / (2.0 * insradius); + tetaspect = sqrt(longlen) * minheightinv; + // Remember the largest and smallest aspect ratio.. + if (tetaspect < smallestratio) { + smallestratio = tetaspect; + } + if (tetaspect > biggestratio) { + biggestratio = tetaspect; + } + // Accumulate the corresponding number in the aspect ratio histogram. + aspectindex = 0; + while ((tetaspect > aspectratiotable[aspectindex]) && (aspectindex < 11)) { + aspectindex++; + } + aspecttable[aspectindex]++; + radiusindex = 0; + while ((tetradius > radiusratiotable[radiusindex]) && (radiusindex < 11)) { + radiusindex++; + } + radiustable[radiusindex]++; + + tetloop.tet = tetrahedrontraverse(); + } + + shortest = sqrt(shortest); + longest = sqrt(longest); + minaltitude = sqrt(minaltitude); + + printf(" Smallest volume: %16.5g | Largest volume: %16.5g\n", + smallestvolume, biggestvolume); + printf(" Shortest edge: %16.5g | Longest edge: %16.5g\n", + shortest, longest); + printf(" Smallest aspect ratio: %9.5g | Largest aspect ratio: %9.5g\n", + smallestratio, biggestratio); + sprintf(sbuf, "%.17g", biggestfaangle); + if (strlen(sbuf) > 8) { + sbuf[8] = '\0'; + } + printf(" Smallest facangle: %14.5g | Largest facangle: %s\n", + smallestfaangle, sbuf); + sprintf(sbuf, "%.17g", biggestdiangle); + if (strlen(sbuf) > 8) { + sbuf[8] = '\0'; + } + printf(" Smallest dihedral: %14.5g | Largest dihedral: %s\n\n", + smallestdiangle, sbuf); + + /* + printf(" Radius-edge ratio histogram:\n"); + printf(" < %-6.6g : %8d | %6.6g - %-6.6g : %8d\n", + radiusratiotable[0], radiustable[0], radiusratiotable[5], + radiusratiotable[6], radiustable[6]); + for (i = 1; i < 5; i++) { + printf(" %6.6g - %-6.6g : %8d | %6.6g - %-6.6g : %8d\n", + radiusratiotable[i - 1], radiusratiotable[i], radiustable[i], + radiusratiotable[i + 5], radiusratiotable[i + 6], + radiustable[i + 6]); + } + printf(" %6.6g - %-6.6g : %8d | %6.6g - : %8d\n", + radiusratiotable[4], radiusratiotable[5], radiustable[5], + radiusratiotable[10], radiustable[11]); + printf(" (A tetrahedron's radius-edge ratio is its radius of "); + printf("circumsphere divided\n"); + printf(" by its shortest edge length)\n\n"); + */ + + printf(" Aspect ratio histogram:\n"); + printf(" < %-6.6g : %8d | %6.6g - %-6.6g : %8d\n", + aspectratiotable[0], aspecttable[0], aspectratiotable[5], + aspectratiotable[6], aspecttable[6]); + for (i = 1; i < 5; i++) { + printf(" %6.6g - %-6.6g : %8d | %6.6g - %-6.6g : %8d\n", + aspectratiotable[i - 1], aspectratiotable[i], aspecttable[i], + aspectratiotable[i + 5], aspectratiotable[i + 6], + aspecttable[i + 6]); + } + printf(" %6.6g - %-6.6g : %8d | %6.6g - : %8d\n", + aspectratiotable[4], aspectratiotable[5], aspecttable[5], + aspectratiotable[10], aspecttable[11]); + printf(" (A tetrahedron's aspect ratio is its longest edge length"); + printf(" divided by its\n"); + printf(" smallest side height)\n\n"); + + printf(" Face angle histogram:\n"); + for (i = 0; i < 9; i++) { + printf(" %3d - %3d degrees: %8d | %3d - %3d degrees: %8d\n", + i * 10, i * 10 + 10, faceangletable[i], + i * 10 + 90, i * 10 + 100, faceangletable[i + 9]); + } + if (minfaceang != PI) { + printf(" Minimum input face angle is %g (degree).\n", + minfaceang / PI * 180.0); + } + printf("\n"); + + printf(" Dihedral angle histogram:\n"); + // Print the three two rows: + printf(" %3d - %2d degrees: %8d | %3d - %3d degrees: %8d\n", + 0, 5, dihedangletable[0], 80, 110, dihedangletable[9]); + printf(" %3d - %2d degrees: %8d | %3d - %3d degrees: %8d\n", + 5, 10, dihedangletable[1], 110, 120, dihedangletable[10]); + // Print the third to seventh rows. + for (i = 2; i < 7; i++) { + printf(" %3d - %2d degrees: %8d | %3d - %3d degrees: %8d\n", + (i - 1) * 10, (i - 1) * 10 + 10, dihedangletable[i], + (i - 1) * 10 + 110, (i - 1) * 10 + 120, dihedangletable[i + 9]); + } + // Print the last two rows. + printf(" %3d - %2d degrees: %8d | %3d - %3d degrees: %8d\n", + 60, 70, dihedangletable[7], 170, 175, dihedangletable[16]); + printf(" %3d - %2d degrees: %8d | %3d - %3d degrees: %8d\n", + 70, 80, dihedangletable[8], 175, 180, dihedangletable[17]); + if (minfacetdihed != PI) { + printf(" Minimum input facet dihedral angle is %g (degree).\n", + minfacetdihed / PI * 180.0); + } + printf("\n"); +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// statistics() Print all sorts of cool facts. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetgenmesh::statistics() +{ + printf("\nStatistics:\n\n"); + printf(" Input points: %d\n", in->numberofpoints + jettisoninverts); + if (b->refine) { + printf(" Input tetrahedra: %d\n", in->numberoftetrahedra); + } + if (b->plc) { + printf(" Input facets: %d\n", in->numberoffacets); + printf(" Input segments: %ld\n", insegments); + printf(" Input holes: %d\n", in->numberofholes); + printf(" Input regions: %d\n", in->numberofregions); + } + + printf("\n Mesh points: %ld\n", points->items); + printf(" Mesh tetrahedra: %ld\n", tetrahedrons->items); + printf(" Mesh faces: %ld\n", (4l * tetrahedrons->items + hullsize) / 2l); + printf(" Mesh edges: %ld\n", meshedges); + + if (b->plc || b->refine) { + printf(" Mesh boundary faces: %ld\n", subfaces->items); + printf(" Mesh boundary edges: %ld\n\n", subsegs->items); + } else { + printf(" Convex hull faces: %ld\n\n", hullsize); + } + + if (b->verbose > 0) { + if (b->plc || b->refine) { + qualitystatistics(); + } + // algorithmicstatistics(); + } +} + +//// //// +//// //// +//// report_cxx /////////////////////////////////////////////////////////////// + +//// main_cxx ///////////////////////////////////////////////////////////////// +//// //// +//// //// + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetrahedralize() The interface for users using TetGen library to // +// generate tetrahedral meshes with all features. // +// // +// The sequence is roughly as follows. Many of these steps can be skipped, // +// depending on the command line switches. // +// // +// - Initialize constants and parse the command line. // +// - Read the vertices from a file and either // +// - tetrahedralize them (no -r), or // +// - read an old mesh from files and reconstruct it (-r). // +// - Insert the PLC segments and facets (-p). // +// - Read the holes (-p), regional attributes (-pA), and regional volume // +// constraints (-pa). Carve the holes and concavities, and spread the // +// regional attributes and volume constraints. // +// - Enforce the constraints on minimum quality bound (-q) and maximum // +// volume (-a). Also enforce the conforming Delaunay property (-q and -a). // +// - Promote the mesh's linear tetrahedra to higher order elements (-o). // +// - Write the output files and print the statistics. // +// - Check the consistency and Delaunay property of the mesh (-C). // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetrahedralize(tetgenbehavior *b, tetgenio *in, tetgenio *out, + tetgenio *addin, tetgenio *bgmin) +{ + tetgenmesh m; + // Variables for timing the performance of TetGen (defined in time.h). + clock_t tv[17]; + + tv[0] = clock(); + + m.b = b; + m.in = in; + m.macheps = exactinit(); + m.steinerleft = b->steiner; + if (b->metric) { + m.bgm = new tetgenmesh(); + m.bgm->b = b; + m.bgm->in = bgmin; + m.bgm->macheps = exactinit(); + } + m.initializepools(); + m.transfernodes(); + + tv[1] = clock(); + + if (b->refine) { + m.reconstructmesh(); + } else { + m.delaunizevertices(); + if (m.hullsize == 0l) { + printf("The input point set does not span a 3D subspace.\n"); + return; + } + } + + tv[2] = clock(); + + if (!b->quiet) { + if (b->refine) { + printf("Mesh reconstruction seconds:"); + } else { + printf("Delaunay seconds:"); + } + printf(" %g\n", (tv[2] - tv[1]) / (REAL) CLOCKS_PER_SEC); + } + + if (b->metric) { + if (bgmin != (tetgenio *) NULL) { + m.bgm->initializepools(); + m.bgm->transfernodes(); + m.bgm->reconstructmesh(); + } else { + m.bgm->in = in; + m.bgm->initializepools(); + m.duplicatebgmesh(); + } + } + + tv[3] = clock(); + + if (!b->quiet) { + if (b->metric) { + printf("Background mesh reconstruct seconds: %g\n", + (tv[3] - tv[2]) / (REAL) CLOCKS_PER_SEC); + } + } + + if (b->useshelles && !b->refine) { + m.meshsurface(); + tv[14] = clock(); + if (b->diagnose != 1) { + m.markacutevertices(60.0); + m.formskeleton(tv[15]); + } else { + m.detectinterfaces(); + } + } + + tv[4] = clock(); + + if (!b->quiet) { + if (b->useshelles && !b->refine) { + if (b->diagnose != 1) { + printf("Boundary recovery "); + } else { + printf("Intersection "); + } + printf("seconds: %g\n", (tv[4] - tv[3]) / (REAL) CLOCKS_PER_SEC); + /*if ((b->diagnose != 1) && (b->verbose > 0)) { + printf(" Surface mesh seconds: %g\n", + (tv[14] - tv[3]) / (REAL) CLOCKS_PER_SEC); + printf(" Segment recovery seconds: %g\n", + (tv[15] - tv[14]) / (REAL) CLOCKS_PER_SEC); + printf(" Facet recovery seconds: %g\n", + (tv[4] - tv[15]) / (REAL) CLOCKS_PER_SEC); + }*/ + } + } + + if (b->plc && !(b->diagnose == 1)) { + m.carveholes(); + } + + tv[5] = clock(); + + if (!b->quiet) { + if (b->plc && !(b->diagnose == 1)) { + printf("Hole seconds: %g\n", (tv[5] - tv[4]) / (REAL) CLOCKS_PER_SEC); + } + } + + if ((b->plc || b->refine) && !(b->diagnose == 1)) { + m.optimizemesh2(false); + } + + tv[6] = clock(); + + if (!b->quiet) { + if ((b->plc || b->refine) && !(b->diagnose == 1)) { + printf("Repair seconds: %g\n", (tv[6] - tv[5]) / (REAL) CLOCKS_PER_SEC); + } + } + + if ((b->plc && b->nobisect) && !(b->diagnose == 1)) { + m.removesteiners2(); + } + + tv[7] = clock(); + + if (!b->quiet) { + if ((b->plc && b->nobisect) && !(b->diagnose == 1)) { + printf("Steiner removal seconds: %g\n", + (tv[7] - tv[6]) / (REAL) CLOCKS_PER_SEC); + } + } + + if (b->insertaddpoints && (addin != (tetgenio *) NULL)) { + if (addin->numberofpoints > 0) { + m.insertconstrainedpoints(addin); + } + } + + tv[8] = clock(); + + if (!b->quiet) { + if ((b->plc || b->refine) && (b->insertaddpoints)) { + printf("Constrained points seconds: %g\n", + (tv[8] - tv[7]) / (REAL) CLOCKS_PER_SEC); + } + } + + if (b->metric) { + m.interpolatesizemap(); + } + + tv[9] = clock(); + + if (!b->quiet) { + if (b->metric) { + printf("Size interpolating seconds: %g\n", + (tv[9] - tv[8]) / (REAL) CLOCKS_PER_SEC); + } + } + + //if (b->coarse) { + // m.removesteiners2(true); + //} + + tv[10] = clock(); + + if (!b->quiet) { + if (b->coarse) { + printf("Mesh coarsening seconds: %g\n", + (tv[10] - tv[9]) / (REAL) CLOCKS_PER_SEC); + } + } + + if (b->quality) { + m.enforcequality(); + } + + tv[11] = clock(); + + if (!b->quiet) { + if (b->quality) { + printf("Quality seconds: %g\n", + (tv[11] - tv[10]) / (REAL) CLOCKS_PER_SEC); + } + } + + if (b->quality && (b->optlevel > 0)) { + m.optimizemesh2(true); + } + + tv[12] = clock(); + + if (!b->quiet) { + if (b->quality && (b->optlevel > 0)) { + printf("Optimize seconds: %g\n", + (tv[12] - tv[11]) / (REAL) CLOCKS_PER_SEC); + } + } + + if (!b->nojettison && ((m.dupverts > 0) || (m.unuverts > 0) + || (b->refine && (in->numberofcorners == 10)))) { + m.jettisonnodes(); + } + + if (b->order > 1) { + m.highorder(); + } + + if (!b->quiet) { + printf("\n"); + } + + if (out != (tetgenio *) NULL) { + out->firstnumber = in->firstnumber; + out->mesh_dim = in->mesh_dim; + } + + if (b->nonodewritten || b->noiterationnum) { + if (!b->quiet) { + printf("NOT writing a .node file.\n"); + } + } else { + if (b->diagnose == 1) { + if (m.subfaces->items > 0l) { + m.outnodes(out); // Only output when self-intersecting faces exist. + } + } else { + m.outnodes(out); + if (b->metric) { //if (b->quality && b->metric) { + m.outmetrics(out); + } + } + } + + if (b->noelewritten == 1) { + if (!b->quiet) { + printf("NOT writing an .ele file.\n"); + } + m.numberedges(); + } else { + if (!(b->diagnose == 1)) { + if (m.tetrahedrons->items > 0l) { + m.outelements(out); + } + } + } + + if (b->nofacewritten) { + if (!b->quiet) { + printf("NOT writing an .face file.\n"); + } + } else { + if (b->facesout) { + if (m.tetrahedrons->items > 0l) { + m.outfaces(out); // Output all faces. + } + } else { + if (b->diagnose == 1) { + if (m.subfaces->items > 0l) { + m.outsubfaces(out); // Only output self-intersecting faces. + } + } else if (b->plc || b->refine) { + if (m.subfaces->items > 0l) { + m.outsubfaces(out); // Output boundary faces. + } + } else { + if (m.tetrahedrons->items > 0l) { + m.outhullfaces(out); // Output convex hull faces. + } + } + } + } + + //if (m.checkpbcs) { + // m.outpbcnodes(out); + //} + + if (b->edgesout) { + if (b->edgesout > 1) { + m.outedges(out); // -ee, output all mesh edges. + } else { + m.outsubsegments(out); // -e, only output subsegments. + } + } + + if (!out && b->plc && + ((b->object == tetgenbehavior::OFF) || + (b->object == tetgenbehavior::PLY) || + (b->object == tetgenbehavior::STL))) { + m.outsmesh(b->outfilename); + } + + if (!out && b->meditview) { + m.outmesh2medit(b->outfilename); + } + + if (!out && b->gidview) { + m.outmesh2gid(b->outfilename); + } + + if (!out && b->geomview) { + m.outmesh2off(b->outfilename); + } + + if (!out && b->vtkview) { + m.outmesh2vtk(b->outfilename); + } + + if (b->neighout) { + m.outneighbors(out); + } + + if (b->voroout) { + m.outvoronoi(out); + } + + tv[13] = clock(); + + if (!b->quiet) { + printf("\nOutput seconds: %g\n", + (tv[13] - tv[12]) / (REAL) CLOCKS_PER_SEC); + printf("Total running seconds: %g\n", + (tv[13] - tv[0]) / (REAL) CLOCKS_PER_SEC); + } + + if (b->docheck) { + m.checkmesh(); + if (m.checksubfaces) { + m.checkshells(); + } + if (b->docheck > 1) { + if (m.checkdelaunay(0.0, NULL) > 0) { + assert(0); + } + if (b->docheck > 2) { + if (b->quality || b->refine) { + m.checkconforming(); + } + } + } + } + + if (!b->quiet) { + m.statistics(); + } + + if (b->metric) { + delete m.bgm; + } +} + +#ifndef TETLIBRARY + +/////////////////////////////////////////////////////////////////////////////// +// // +// main() The entrance for running TetGen from command line. // +// // +/////////////////////////////////////////////////////////////////////////////// + +int main(int argc, char *argv[]) + +#else // with TETLIBRARY + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetrahedralize() The entrance for calling TetGen from another program. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetrahedralize(char *switches, tetgenio *in, tetgenio *out, + tetgenio *addin, tetgenio *bgmin) + +#endif // not TETLIBRARY + +{ + tetgenbehavior b; + +#ifndef TETLIBRARY + + tetgenio in, addin, bgmin; + + if (!b.parse_commandline(argc, argv)) { + terminatetetgen(0); + } + if (b.refine) { + if (!in.load_tetmesh(b.infilename)) { + terminatetetgen(3); + } + } else { + if (!in.load_plc(b.infilename, (int) b.object)) { + terminatetetgen(3); + } + } + if (b.insertaddpoints) { + if (!addin.load_node(b.addinfilename)) { + addin.numberofpoints = 0l; + } + } + if (b.metric) { + if (!bgmin.load_tetmesh(b.bgmeshfilename)) { + bgmin.numberoftetrahedra = 0l; + } + } + + if (bgmin.numberoftetrahedra > 0l) { + tetrahedralize(&b, &in, NULL, &addin, &bgmin); + } else { + tetrahedralize(&b, &in, NULL, &addin, NULL); + } + + return 0; + +#else // with TETLIBRARY + + if (!b.parse_commandline(switches)) { + terminatetetgen(1); + } + tetrahedralize(&b, in, out, addin, bgmin); + +#endif // not TETLIBRARY +} + +//// //// +//// //// +//// main_cxx ///////////////////////////////////////////////////////////////// + diff --git a/src/TETGEN/tetgen.h b/src/TETGEN/tetgen.h new file mode 100644 index 0000000..f43bd0c --- /dev/null +++ b/src/TETGEN/tetgen.h @@ -0,0 +1,3483 @@ +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen // +// // +// A Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator // +// // +// Version 1.4 // +// September 6, December 13, 2010 // +// January 19, 2011 // +// // +// Copyright (C) 2002--2011 // +// Hang Si // +// Research Group: Numerical Mathematics and Scientific Computing // +// Weierstrass Institute for Applied Analysis and Stochastics (WIAS) // +// Mohrenstr. 39, 10117 Berlin, Germany // +// si@wias-berlin.de // +// // +// TetGen is freely available through the website: http://tetgen.berlios.de. // +// It may be copied, modified, and redistributed for non-commercial use. // +// Please consult the file LICENSE for the detailed copyright notices. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen is a library to generate tetrahedral meshes for 3D domains. It's // +// main purpose is to generate suitable tetrahedral meshes for numerical // +// simulations using finite element and finite volume methods. // +// // +// TetGen incorporates a suit of geometrical and mesh generation algorithms. // +// A brief description of algorithms used in TetGen is found in the first // +// section of the user's manual. References are given for users who are // +// interesting in these approaches. The main references are given below: // +// // +// The efficient Delaunay tetrahedralization algorithm is: H. Edelsbrunner // +// and N. R. Shah, "Incremental Topological Flipping Works for Regular // +// Triangulations". Algorithmica 15: 223--241, 1996. // +// // +// The constrained Delaunay tetrahedralization algorithm is described in: // +// H. Si and K. Gaertner, "Meshing Piecewise Linear Complexes by Constr- // +// ained Delaunay Tetrahedralizations". In Proceeding of the 14th Inter- // +// national Meshing Roundtable. September 2005. // +// // +// The mesh refinement algorithm is from: Hang Si, "Adaptive Tetrahedral // +// Mesh Generation by Constrained Delaunay Refinement". International // +// Journal for Numerical Methods in Engineering, 75(7): 856--880, 2008. // +// // +// The mesh data structure of TetGen is a combination of two types of mesh // +// data structures. The tetrahedron-based mesh data structure introduced // +// by Shewchuk is eligible for tetrahedralization algorithms. The triangle // +// -edge data structure developed by Muecke is adopted for representing // +// boundary elements: subfaces and subsegments. // +// // +// J. R. Shewchuk, "Delaunay Refinement Mesh Generation". PhD thesis, // +// Carnegie Mellon University, Pittsburgh, PA, 1997. // +// // +// E. P. Muecke, "Shapes and Implementations in Three-Dimensional // +// Geometry". PhD thesis, Univ. of Illinois, Urbana, Illinois, 1993. // +// // +// The research of mesh generation is definitly on the move. Many State-of- // +// the-art algorithms need implementing and evaluating. I heartily welcome // +// any new algorithm especially for generating quality conforming Delaunay // +// meshes and anisotropic conforming Delaunay meshes. // +// // +// TetGen is supported by the "pdelib" project of Weierstrass Institute for // +// Applied Analysis and Stochastics (WIAS) in Berlin. It is a collection // +// of software components for solving non-linear partial differential // +// equations including 2D and 3D mesh generators, sparse matrix solvers, // +// and scientific visualization tools, etc. For more information please // +// visit: http://www.wias-berlin.de/software/pdelib. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetgen.h // +// // +// Header file of the TetGen library. Also is the user-level header file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +#ifndef tetgenH +#define tetgenH + +#include +#include +#include +#include +#include +//#include //qiu stop the assert to abort the program + + +// The types 'intptr_t' and 'uintptr_t' are signed and unsigned integer types, +// respectively. They are guaranteed to be the same width as a pointer. +// They are defined in by the C99 Standard. +// However, Microsoft Visual C++ doesn't ship with this header file yet. We +// need to define them. (Thanks to Steven G. Johnson from MIT for the +// following piece of code.) + +// Define the _MSC_VER symbol if you are using Microsoft Visual C++. + +// #define _MSC_VER + +// Define the _WIN64 symbol if you are running TetGen on Win64. + +// #define _WIN64 + +#ifdef _MSC_VER // Microsoft Visual C++ +# ifdef _WIN64 + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +# else // not _WIN64 + typedef int intptr_t; + typedef unsigned int uintptr_t; +# endif +#else // not Visual C++ +# include +#endif + +// To compile TetGen as a library instead of an executable program, define +// the TETLIBRARY symbol. + +// #define TETLIBRARY + +// Uncomment the following line to disable assert macros. These macros are +// inserted in places where I hope to catch bugs. + +// #define NDEBUG + +// To insert lots of self-checks for internal errors, define the SELF_CHECK +// symbol. This will slow down the program a bit. + +// #define SELF_CHECK + +// For single precision ( which will save some memory and reduce paging ), +// define the symbol SINGLE by using the -DSINGLE compiler switch or by +// writing "#define SINGLE" below. +// +// For double precision ( which will allow you to refine meshes to a smaller +// edge length), leave SINGLE undefined. + +// #define SINGLE + +#ifdef SINGLE + #define REAL float +#else + #define REAL double +#endif // not defined SINGLE + +//qiu for exporting the class and function in +#ifdef WIN32 +# ifndef Standard_EXPORT +# define Standard_EXPORT __declspec( dllexport ) +# endif +#else +# define Standard_EXPORT +#endif + +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen Library Overview // +// // +// TetGen library is comprised by several data types and global functions. // +// // +// There are three main data types: tetgenio, tetgenbehavior, and tetgenmesh.// +// Tetgenio is used to pass data into and out of TetGen library; tetgenbeha- // +// vior keeps the runtime options and thus controls the behaviors of TetGen; // +// tetgenmesh, the biggest data type I've ever defined, contains mesh data // +// structures and mesh traversing and transformation operators. The meshing // +// algorithms are implemented on top of it. These data types are defined as // +// C++ classes. // +// // +// There are few global functions. tetrahedralize() is provided for calling // +// TetGen from another program. Two functions: orient3d() and insphere() are // +// incorporated from a public C code provided by Shewchuk. They performing // +// exact geometrical tests. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class tetgenio // +// // +// The interface for passing data into and out of the library of TetGen. // +// // +// The tetgenio data structure is actually a collection of arrays of points, // +// facets, tetrahedra, and so forth. The library will read and write these // +// arrays according to the options specified in tetgenbehavior structure. // +// // +// If you want to program with the library of TetGen, it's necessary for you // +// to understand this data type,while the other two structures can be hidden // +// through calling the global function "tetrahedralize()". Each array corre- // +// sponds to a list of data in the file formats of TetGen. It is necessary // +// to understand TetGen's input/output file formats (see user's manual). // +// // +// Once an object of tetgenio is declared, no array is created. One has to // +// allocate enough memory for them, e.g., use the "new" operator in C++. On // +// deletion of the object, the memory occupied by these arrays needs to be // +// freed. Routine deinitialize() will be automatically called. It will de- // +// allocate the memory for an array if it is not a NULL. However, it assumes // +// that the memory is allocated by the C++ "new" operator. If you use malloc // +// (), you should free() them and set the pointers to NULLs before reaching // +// deinitialize(). // +// // +// tetgenio ontains routines for reading and writing TetGen's files, i.e., // +// .node, .poly, .smesh, .ele, .face, and .edge files. Both the library of // +// TetGen and TetView use these routines to process input files. // +// // +/////////////////////////////////////////////////////////////////////////////// + +class Standard_EXPORT tetgenio { + + public: + + // Maximum number of characters in a file name (including the null). + enum {FILENAMESIZE = 1024}; + + // Maxi. numbers of chars in a line read from a file (incl. the null). + enum {INPUTLINESIZE = 1024}; + + // The polygon data structure. A "polygon" describes a simple polygon + // (no holes). It is not necessarily convex. Each polygon contains a + // number of corners (points) and the same number of sides (edges). + // Note that the points of the polygon must be given in either counter- + // clockwise or clockwise order and they form a ring, so every two + // consective points forms an edge of the polygon. + typedef struct { + int *vertexlist; + int numberofvertices; + } polygon; + + static void init(polygon* p) { + p->vertexlist = (int *) NULL; + p->numberofvertices = 0; + } + + // The facet data structure. A "facet" describes a facet. Each facet is + // a polygonal region possibly with holes, edges, and points in it. + typedef struct { + polygon *polygonlist; + int numberofpolygons; + REAL *holelist; + int numberofholes; + } facet; + + static void init(facet* f) { + f->polygonlist = (polygon *) NULL; + f->numberofpolygons = 0; + f->holelist = (REAL *) NULL; + f->numberofholes = 0; + } + + // A 'voroedge' is an edge of the Voronoi diagram. It corresponds to a + // Delaunay face. Each voroedge is either a line segment connecting + // two Voronoi vertices or a ray starting from a Voronoi vertex to an + // "infinite vertex". 'v1' and 'v2' are two indices pointing to the + // list of Voronoi vertices. 'v1' must be non-negative, while 'v2' may + // be -1 if it is a ray, in this case, the unit normal of this ray is + // given in 'vnormal'. + typedef struct { + int v1, v2; + REAL vnormal[3]; + } voroedge; + + // A 'vorofacet' is an facet of the Voronoi diagram. It corresponds to a + // Delaunay edge. Each Voronoi facet is a convex polygon formed by a + // list of Voronoi edges, it may not be closed. 'c1' and 'c2' are two + // indices pointing into the list of Voronoi cells, i.e., the two cells + // share this facet. 'elist' is an array of indices pointing into the + // list of Voronoi edges, 'elist[0]' saves the number of Voronoi edges + // (including rays) of this facet. + typedef struct { + int c1, c2; + int *elist; + } vorofacet; + + // The periodic boundary condition group data structure. A "pbcgroup" + // contains the definition of a pbc and the list of pbc point pairs. + // 'fmark1' and 'fmark2' are the facetmarkers of the two pbc facets f1 + // and f2, respectively. 'transmat' is the transformation matrix which + // maps a point in f1 into f2. An array of pbc point pairs are saved + // in 'pointpairlist'. The first point pair is at indices [0] and [1], + // followed by remaining pairs. Two integers per pair. + typedef struct { + int fmark1, fmark2; + REAL transmat[4][4]; + int numberofpointpairs; + int *pointpairlist; + } pbcgroup; + + // A callback function for mesh refinement. + typedef bool (* TetSizeFunc)(REAL*, REAL*, REAL*, REAL*, REAL*, REAL); + + // Items are numbered starting from 'firstnumber' (0 or 1), default is 0. + int firstnumber; + + // Dimension of the mesh (2 or 3), default is 3. + int mesh_dim; + + // Does the lines in .node file contain index or not, default is TRUE. + bool useindex; + + // 'pointlist': An array of point coordinates. The first point's x + // coordinate is at index [0] and its y coordinate at index [1], its + // z coordinate is at index [2], followed by the coordinates of the + // remaining points. Each point occupies three REALs. + // 'pointattributelist': An array of point attributes. Each point's + // attributes occupy 'numberofpointattributes' REALs. + // 'pointmtrlist': An array of metric tensors at points. Each point's + // tensor occupies 'numberofpointmtr' REALs. + // `pointmarkerlist': An array of point markers; one int per point. + REAL *pointlist; + REAL *pointattributelist; + REAL *pointmtrlist; + int *pointmarkerlist; + int numberofpoints; + int numberofpointattributes; + int numberofpointmtrs; + + // `elementlist': An array of element (triangle or tetrahedron) corners. + // The first element's first corner is at index [0], followed by its + // other corners in counterclockwise order, followed by any other + // nodes if the element represents a nonlinear element. Each element + // occupies `numberofcorners' ints. + // `elementattributelist': An array of element attributes. Each + // element's attributes occupy `numberofelementattributes' REALs. + // `elementconstraintlist': An array of constraints, i.e. triangle's + // area or tetrahedron's volume; one REAL per element. Input only. + // `neighborlist': An array of element neighbors; 3 or 4 ints per + // element. Output only. + int *tetrahedronlist; + REAL *tetrahedronattributelist; + REAL *tetrahedronvolumelist; + int *neighborlist; + int numberoftetrahedra; + int numberofcorners; + int numberoftetrahedronattributes; + + // `facetlist': An array of facets. Each entry is a structure of facet. + // `facetmarkerlist': An array of facet markers; one int per facet. + facet *facetlist; + int *facetmarkerlist; + int numberoffacets; + + // `holelist': An array of holes. The first hole's x, y and z + // coordinates are at indices [0], [1] and [2], followed by the + // remaining holes. Three REALs per hole. + REAL *holelist; + int numberofholes; + + // `regionlist': An array of regional attributes and volume constraints. + // The first constraint's x, y and z coordinates are at indices [0], + // [1] and [2], followed by the regional attribute at index [3], foll- + // owed by the maximum volume at index [4]. Five REALs per constraint. + // Note that each regional attribute is used only if you select the `A' + // switch, and each volume constraint is used only if you select the + // `a' switch (with no number following). + REAL *regionlist; + int numberofregions; + + // `facetconstraintlist': An array of facet maximal area constraints. + // Two REALs per constraint. The first (at index [0]) is the facet + // marker (cast it to int), the second (at index [1]) is its maximum + // area bound. + REAL *facetconstraintlist; + int numberoffacetconstraints; + + // `segmentconstraintlist': An array of segment max. length constraints. + // Three REALs per constraint. The first two (at indcies [0] and [1]) + // are the indices of the endpoints of the segment, the third (at index + // [2]) is its maximum length bound. + REAL *segmentconstraintlist; + int numberofsegmentconstraints; + + // 'pbcgrouplist': An array of periodic boundary condition groups. + pbcgroup *pbcgrouplist; + int numberofpbcgroups; + + // `trifacelist': An array of triangular face endpoints. The first + // face's endpoints are at indices [0], [1] and [2], followed by the + // remaining faces. Three ints per face. + // `adjtetlist': An array of adjacent tetrahedra to the faces of + // trifacelist. Each face has at most two adjacent tets, the first + // face's adjacent tets are at [0], [1]. Two ints per face. A '-1' + // indicates outside (no adj. tet). This list is output when '-nn' + // switch is used. + // `trifacemarkerlist': An array of face markers; one int per face. + int *trifacelist; + int *adjtetlist; + int *trifacemarkerlist; + int numberoftrifaces; + + // `edgelist': An array of edge endpoints. The first edge's endpoints + // are at indices [0] and [1], followed by the remaining edges. Two + // ints per edge. + // `edgemarkerlist': An array of edge markers; one int per edge. + int *edgelist; + int *edgemarkerlist; + int numberofedges; + + // 'vpointlist': An array of Voronoi vertex coordinates (like pointlist). + // 'vedgelist': An array of Voronoi edges. Each entry is a 'voroedge'. + // 'vfacetlist': An array of Voronoi facets. Each entry is a 'vorofacet'. + // 'vcelllist': An array of Voronoi cells. Each entry is an array of + // indices pointing into 'vfacetlist'. The 0th entry is used to store + // the length of this array. + REAL *vpointlist; + voroedge *vedgelist; + vorofacet *vfacetlist; + int **vcelllist; + int numberofvpoints; + int numberofvedges; + int numberofvfacets; + int numberofvcells; + + // A callback function. + TetSizeFunc tetunsuitable; + + // Input & output routines. + bool load_node_call(FILE* infile, int markers, char* nodefilename); + bool load_node(char* filebasename); + bool load_var(char*); + bool load_mtr(char*); + bool load_poly(char*); + bool load_pbc(char*); + bool load_off(char*); + bool load_ply(char*); + bool load_stl(char*); + bool load_medit(char*); + bool load_vtk(char*); + bool load_plc(char*, int); + bool load_tetmesh(char*); + void save_nodes(char*); + void save_elements(char*); + void save_faces(char*); + void save_edges(char*); + void save_neighbors(char*); + void save_poly(char*); + + // Read line and parse string functions. + char *readline(char* string, FILE* infile, int *linenumber); + char *findnextfield(char* string); + char *readnumberline(char* string, FILE* infile, char* infilename); + char *findnextnumber(char* string); + + // Initialize routine. + void initialize() + { + firstnumber = 0; // Default item index is numbered from Zero. + mesh_dim = 3; // Default mesh dimension is 3. + useindex = true; + + pointlist = (REAL *) NULL; + pointattributelist = (REAL *) NULL; + pointmtrlist = (REAL *) NULL; + pointmarkerlist = (int *) NULL; + numberofpoints = 0; + numberofpointattributes = 0; + numberofpointmtrs = 0; + + tetrahedronlist = (int *) NULL; + tetrahedronattributelist = (REAL *) NULL; + tetrahedronvolumelist = (REAL *) NULL; + neighborlist = (int *) NULL; + numberoftetrahedra = 0; + numberofcorners = 4; // Default is 4 nodes per element. + numberoftetrahedronattributes = 0; + + trifacelist = (int *) NULL; + adjtetlist = (int *) NULL; + trifacemarkerlist = (int *) NULL; + numberoftrifaces = 0; + + facetlist = (facet *) NULL; + facetmarkerlist = (int *) NULL; + numberoffacets = 0; + + edgelist = (int *) NULL; + edgemarkerlist = (int *) NULL; + numberofedges = 0; + + holelist = (REAL *) NULL; + numberofholes = 0; + + regionlist = (REAL *) NULL; + numberofregions = 0; + + facetconstraintlist = (REAL *) NULL; + numberoffacetconstraints = 0; + segmentconstraintlist = (REAL *) NULL; + numberofsegmentconstraints = 0; + + pbcgrouplist = (pbcgroup *) NULL; + numberofpbcgroups = 0; + + vpointlist = (REAL *) NULL; + vedgelist = (voroedge *) NULL; + vfacetlist = (vorofacet *) NULL; + vcelllist = (int **) NULL; + numberofvpoints = 0; + numberofvedges = 0; + numberofvfacets = 0; + numberofvcells = 0; + + tetunsuitable = NULL; + } + + // Free the memory allocated in 'tetgenio'. + void deinitialize() + { + facet *f; + polygon *p; + pbcgroup *pg; + int i, j; + + // This routine assumes that the memory was allocated by + // C++ memory allocation operator 'new'. + + if (pointlist != (REAL *) NULL) { + delete [] pointlist; + } + if (pointattributelist != (REAL *) NULL) { + delete [] pointattributelist; + } + if (pointmtrlist != (REAL *) NULL) { + delete [] pointmtrlist; + } + if (pointmarkerlist != (int *) NULL) { + delete [] pointmarkerlist; + } + + if (tetrahedronlist != (int *) NULL) { + delete [] tetrahedronlist; + } + if (tetrahedronattributelist != (REAL *) NULL) { + delete [] tetrahedronattributelist; + } + if (tetrahedronvolumelist != (REAL *) NULL) { + delete [] tetrahedronvolumelist; + } + if (neighborlist != (int *) NULL) { + delete [] neighborlist; + } + + if (trifacelist != (int *) NULL) { + delete [] trifacelist; + } + if (adjtetlist != (int *) NULL) { + delete [] adjtetlist; + } + if (trifacemarkerlist != (int *) NULL) { + delete [] trifacemarkerlist; + } + + if (edgelist != (int *) NULL) { + delete [] edgelist; + } + if (edgemarkerlist != (int *) NULL) { + delete [] edgemarkerlist; + } + + if (facetlist != (facet *) NULL) { + for (i = 0; i < numberoffacets; i++) { + f = &facetlist[i]; + for (j = 0; j < f->numberofpolygons; j++) { + p = &f->polygonlist[j]; + delete [] p->vertexlist; + } + delete [] f->polygonlist; + if (f->holelist != (REAL *) NULL) { + delete [] f->holelist; + } + } + delete [] facetlist; + } + if (facetmarkerlist != (int *) NULL) { + delete [] facetmarkerlist; + } + + if (holelist != (REAL *) NULL) { + delete [] holelist; + } + if (regionlist != (REAL *) NULL) { + delete [] regionlist; + } + if (facetconstraintlist != (REAL *) NULL) { + delete [] facetconstraintlist; + } + if (segmentconstraintlist != (REAL *) NULL) { + delete [] segmentconstraintlist; + } + if (pbcgrouplist != (pbcgroup *) NULL) { + for (i = 0; i < numberofpbcgroups; i++) { + pg = &(pbcgrouplist[i]); + if (pg->pointpairlist != (int *) NULL) { + delete [] pg->pointpairlist; + } + } + delete [] pbcgrouplist; + } + if (vpointlist != (REAL *) NULL) { + delete [] vpointlist; + } + if (vedgelist != (voroedge *) NULL) { + delete [] vedgelist; + } + if (vfacetlist != (vorofacet *) NULL) { + for (i = 0; i < numberofvfacets; i++) { + delete [] vfacetlist[i].elist; + } + delete [] vfacetlist; + } + if (vcelllist != (int **) NULL) { + for (i = 0; i < numberofvcells; i++) { + delete [] vcelllist[i]; + } + delete [] vcelllist; + } + } + + // Constructor & destructor. + tetgenio() {initialize();} + ~tetgenio() {deinitialize();} +}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class tetgenbehavior // +// // +// The object holding a collection of options controlling TetGen's behavior. // +// See "command line switches" in User's manual. // +// // +// parse_commandline() provides an simple interface to set the vaules of the // +// variables. It accepts the standard parameters (e.g., 'argc' and 'argv') // +// that pass to C/C++ main() function. Alternatively a string which contains // +// the command line options can be used as its parameter. // +// // +/////////////////////////////////////////////////////////////////////////////// + +class tetgenbehavior { + + public: + + // Labels define the objects which are acceptable by TetGen. They are + // recognized by the file extensions. + // - NODES, a list of nodes (.node); + // - POLY, a piecewise linear complex (.poly or .smesh); + // - OFF, a polyhedron (.off, Geomview's file format); + // - PLY, a polyhedron (.ply, file format from gatech); + // - STL, a surface mesh (.stl, stereolithography format); + // - MEDIT, a surface mesh (.mesh, Medit's file format); + // - MESH, a tetrahedral mesh (.ele). + // If no extension is available, the imposed commandline switch + // (-p or -r) implies the object. + + enum objecttype {NONE, NODES, POLY, OFF, PLY, STL, MEDIT, VTK, MESH}; + + // Variables of command line switches. Each variable corresponds to a + // switch and will be initialized. + + int plc; // '-p' switch, 0. + int quality; // '-q' switch, 0. + int refine; // '-r' switch, 0. + int coarse; // '-R' switch, 0. + int metric; // '-m' switch, 0. + int varvolume; // '-a' switch without number, 0. + int fixedvolume; // '-a' switch with number, 0. + int insertaddpoints; // '-i' switch, 0. + int regionattrib; // '-A' switch, 0. + int conformdel; // '-D' switch, 0. + int diagnose; // '-d' switch, 0. + int zeroindex; // '-z' switch, 0. + int btree; // -u, 1. + int max_btreenode_size; // number after -u, 100. + int optlevel; // number specified after '-s' switch, 3. + int optpasses; // number specified after '-ss' switch, 3. + int order; // element order, specified after '-o' switch, 1. + int facesout; // '-f' switch, 0. + int edgesout; // '-e' switch, 0. + int neighout; // '-n' switch, 0. + int voroout; // '-v',switch, 0. + int meditview; // '-g' switch, 0. + int gidview; // '-G' switch, 0. + int geomview; // '-O' switch, 0. + int vtkview; // '-K' switch, 0. + int nobound; // '-B' switch, 0. + int nonodewritten; // '-N' switch, 0. + int noelewritten; // '-E' switch, 0. + int nofacewritten; // '-F' switch, 0. + int noiterationnum; // '-I' switch, 0. + int nomerge; // '-M',switch, 0. + int nobisect; // count of how often '-Y' switch is selected, 0. + int noflip; // do not perform flips. '-X' switch. 0. + int nojettison; // do not jettison redundants nodes. '-J' switch. 0. + int steiner; // number after '-S' switch. 0. + int fliprepair; // '-X' switch, 1. + int offcenter; // '-R' switch, 0. + int docheck; // '-C' switch, 0. + int quiet; // '-Q' switch, 0. + int verbose; // count of how often '-V' switch is selected, 0. + int useshelles; // '-p', '-r', '-q', '-d', or '-R' switch, 0. + int maxflipedgelinksize; // The maximum flippable edge link size 10. + REAL minratio; // number after '-q' switch, 2.0. + REAL goodratio; // number calculated from 'minratio', 0.0. + REAL minangle; // minimum angle bound, 20.0. + REAL goodangle; // cosine squared of minangle, 0.0. + REAL maxvolume; // number after '-a' switch, -1.0. + REAL mindihedral; // number after '-qq' switch, 5.0. + REAL maxdihedral; // number after '-qqq' switch, 165.0. + REAL alpha1; // number after '-m' switch, sqrt(2). + REAL alpha2; // number after '-mm' switch, 1.0. + REAL alpha3; // number after '-mmm' switch, 0.6. + REAL epsilon; // number after '-T' switch, 1.0e-8. + REAL epsilon2; // number after '-TT' switch, 1.0e-5. + enum objecttype object; // determined by -p, or -r switch. NONE. + + // Variables used to save command line switches and in/out file names. + char commandline[1024]; + char infilename[1024]; + char outfilename[1024]; + char addinfilename[1024]; + char bgmeshfilename[1024]; + + void syntax(); + void usage(); + + // Command line parse routine. + bool parse_commandline(int argc, char **argv); + bool parse_commandline(char *switches) { + return parse_commandline(0, &switches); + } + + // Initialize all variables. + tetgenbehavior() + { + plc = 0; + quality = 0; + refine = 0; + coarse = 0; + metric = 0; + minratio = 2.0; + goodratio = 0.0; + minangle = 20.0; + goodangle = 0.0; + maxdihedral = 165.0; + mindihedral = 5.0; + varvolume = 0; + fixedvolume = 0; + maxvolume = -1.0; + regionattrib = 0; + insertaddpoints = 0; + diagnose = 0; + offcenter = 0; + conformdel = 0; + alpha1 = sqrt(2.0); + alpha2 = 1.0; + alpha3 = 0.6; + zeroindex = 0; + btree = 1; + max_btreenode_size = 100; + facesout = 0; + edgesout = 0; + neighout = 0; + voroout = 0; + meditview = 0; + gidview = 0; + geomview = 0; + vtkview = 0; + optlevel = 3; + optpasses = 3; + order = 1; + nojettison = 0; + nobound = 0; + nonodewritten = 0; + noelewritten = 0; + nofacewritten = 0; + noiterationnum = 0; + nobisect = 0; + noflip = 0; + steiner = -1; + fliprepair = 1; + nomerge = 0; + docheck = 0; + quiet = 0; + verbose = 0; + useshelles = 0; + maxflipedgelinksize = 10; + epsilon = 1.0e-8; + epsilon2 = 1.0e-5; + object = NONE; + + commandline[0] = '\0'; + infilename[0] = '\0'; + outfilename[0] = '\0'; + addinfilename[0] = '\0'; + bgmeshfilename[0] = '\0'; + } + + ~tetgenbehavior() + { + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class tetgenmesh // +// // +// The object to store, generate, and refine a tetrahedral mesh. // +// // +// It implements the mesh data structures and functions to create and update // +// a tetrahedral mesh according to the specified options. // +// // +/////////////////////////////////////////////////////////////////////////////// + +class tetgenmesh { + + public: + + // Maximum number of characters in a file name (including the null). + enum {FILENAMESIZE = 1024}; + + // For efficiency, a variety of data structures are allocated in bulk. + // The following constants determine how many of each structure is + // allocated at once. + enum {VERPERBLOCK = 4092, SUBPERBLOCK = 4092, ELEPERBLOCK = 8188}; + + // Used for the point location scheme of Mucke, Saias, and Zhu, to + // decide how large a random sample of tetrahedra to inspect. + enum {SAMPLEFACTOR = 11}; + + // Labels that signify two edge rings of a triangle (see Muecke's thesis). + enum {CCW = 0, CW = 1}; + + // Labels that signify whether a record consists primarily of pointers + // or of floating-point words. Used for data alignment. + enum wordtype {POINTER, FLOATINGPOINT}; + + // Labels that signify the type of a vertex. + enum verttype {UNUSEDVERTEX, DUPLICATEDVERTEX, NACUTEVERTEX, ACUTEVERTEX, + FREESEGVERTEX, FREESUBVERTEX, FREEVOLVERTEX, DEADVERTEX = -32768}; + + // Labels that signify the type of a subface/subsegment. + enum shestype {NSHARP, SHARP}; + + // Labels that signify the type of flips can be applied on a face. + enum fliptype {T23, T32, T22, T44, N32, N40, FORBIDDENFACE, FORBIDDENEDGE}; + + // Labels that signify the result of triangle-triangle intersection test. + enum interresult {DISJOINT, INTERSECT, SHAREVERTEX, SHAREEDGE, SHAREFACE, + TOUCHEDGE, TOUCHFACE, INTERVERT, INTEREDGE, INTERFACE, INTERTET, + TRIEDGEINT, EDGETRIINT, COLLISIONFACE, INTERSUBSEG, INTERSUBFACE, + BELOWHULL2}; + + // Labels that signify the result of point location. + enum locateresult {INTETRAHEDRON, ONFACE, ONEDGE, ONVERTEX, OUTSIDE, + ENCSEGMENT}; + + // Labels that signify the result of vertex insertion. + enum insertsiteresult {SUCCESSINTET, SUCCESSONFACE, SUCCESSONEDGE, + DUPLICATEPOINT, OUTSIDEPOINT}; + + // Labels that signify the result of direction finding. + enum finddirectionresult {ACROSSEDGE, ACROSSFACE, LEFTCOLLINEAR, + RIGHTCOLLINEAR, TOPCOLLINEAR, BELOWHULL}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh elements // +// // +// There are four types of mesh elements: tetrahedra, subfaces, subsegments, // +// and points, where subfaces and subsegments are triangles and edges which // +// appear on boundaries. A tetrahedralization of a 3D point set comprises // +// tetrahedra and points; a surface mesh of a 3D domain comprises subfaces // +// subsegments and points. The elements of all the four types consist of a // +// tetrahedral mesh of a 3D domain. However, TetGen uses three data types: // +// 'tetrahedron', 'shellface', and 'point'. A 'tetrahedron' is a tetrahedron;// +// while a 'shellface' can be either a subface or a subsegment; and a 'point'// +// is a point. These three data types, linked by pointers comprise a mesh. // +// // +// A tetrahedron primarily consists of a list of 4 pointers to its corners, // +// a list of 4 pointers to its adjoining tetrahedra, a list of 4 pointers to // +// its adjoining subfaces (when subfaces are needed). Optinoally, (depending // +// on the selected switches), it may contain an arbitrary number of user- // +// defined floating-point attributes, an optional maximum volume constraint // +// (for -a switch), and a pointer to a list of high-order nodes (-o2 switch).// +// Since the size of a tetrahedron is not determined until running time. // +// // +// The data structure of tetrahedron also stores the geometrical information.// +// Let t be a tetrahedron, v0, v1, v2, and v3 be the 4 nodes corresponding // +// to the order of their storage in t. v3 always has a negative orientation // +// with respect to v0, v1, v2 (ie,, v3 lies above the oriented plane passes // +// through v0, v1, v2). Let the 4 faces of t be f0, f1, f2, and f3. Vertices // +// of each face are stipulated as follows: f0 (v0, v1, v2), f1 (v0, v3, v1), // +// f2 (v1, v3, v2), f3 (v2, v3, v0). // +// // +// A subface has 3 pointers to vertices, 3 pointers to adjoining subfaces, 3 // +// pointers to adjoining subsegments, 2 pointers to adjoining tetrahedra, a // +// boundary marker(an integer). Like a tetrahedron, the pointers to vertices,// +// subfaces, and subsegments are ordered in a way that indicates their geom- // +// etric relation. Let s be a subface, v0, v1 and v2 be the 3 nodes corres- // +// ponding to the order of their storage in s, e0, e1 and e2 be the 3 edges,// +// then we have: e0 (v0, v1), e1 (v1, v2), e2 (v2, v0). // +// // +// A subsegment has exactly the same data fields as a subface has, but only // +// uses some of them. It has 2 pointers to its endpoints, 2 pointers to its // +// adjoining (and collinear) subsegments, a pointer to a subface containing // +// it (there may exist any number of subfaces having it, choose one of them // +// arbitrarily). The geometric relation between its endpoints and adjoining // +// subsegments is kept with respect to the storing order of its endpoints. // +// // +// The data structure of point is relatively simple. A point is a list of // +// floating-point numbers, starting with the x, y, and z coords, followed by // +// an arbitrary number of optional user-defined floating-point attributes, // +// an integer boundary marker, an integer for the point type, and a pointer // +// to a tetrahedron (used for speeding up point location). // +// // +// For a tetrahedron on a boundary (or a hull) of the mesh, some or all of // +// the adjoining tetrahedra may not be present. For an interior tetrahedron, // +// often no neighboring subfaces are present, Such absent tetrahedra and // +// subfaces are never represented by the NULL pointers; they are represented // +// by two special records: `dummytet', the tetrahedron fills "outer space", // +// and `dummysh', the vacuous subfaces which are omnipresent. // +// // +// Tetrahedra and adjoining subfaces are glued together through the pointers // +// saved in each data fields of them. Subfaces and adjoining subsegments are // +// connected in the same fashion. However, there are no pointers directly // +// gluing tetrahedra and adjoining subsegments. For the purpose of saving // +// space, the connections between tetrahedra and subsegments are entirely // +// mediated through subfaces. The following part explains how subfaces are // +// connected in TetGen. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// Subface-subface and subface-subsegment connections // +// // +// Adjoining subfaces sharing a common edge are connected in such a way that // +// they form a face ring around the edge. It is indeed a single linked list // +// which is cyclic, e.g., one can start from any subface in it and traverse // +// back. When the edge is not a subsegment, the ring only has two coplanar // +// subfaces which are pointing to each other. Otherwise, the face ring may // +// have any number of subfaces (and are not all coplanar). // +// // +// How is the face ring formed? Let s be a subsegment, f is one of subfaces // +// containing s as an edge. The direction of s is stipulated from its first // +// endpoint to its second (according to their storage in s). Once the dir of // +// s is determined, the other two edges of f are oriented to follow this dir.// +// The "directional normal" N_f is a vector formed from any point in f and a // +// points orthogonally above f. // +// // +// The face ring of s is a cyclic ordered set of subfaces containing s, i.e.,// +// F(s) = {f1, f2, ..., fn}, n >= 1. Where the order is defined as follows: // +// let fi, fj be two faces in F(s), the "normal-angle", NAngle(i,j) (range // +// from 0 to 360 degree) is the angle between the N_fi and N_fj; then fi is // +// in front of fj (or symbolically, fi < fj) if there exists another fk in // +// F(s), and NAangle(k, i) < NAngle(k, j). The face ring of s is: f1 < f2 < // +// ... < fn < f1. // +// // +// The easiest way to imagine how a face ring is formed is to use the right- // +// hand rule. Make a fist using your right hand with the thumb pointing to // +// the direction of the subsegment. The face ring is connected following the // +// direction of your fingers. // +// // +// The subface and subsegment are also connected through pointers stored in // +// their own data fields. Every subface has a pointer to its adjoining sub- // +// segment. However, a subsegment only has one pointer to a subface which is // +// containing it. Such subface can be chosen arbitrarily, other subfaces are // +// found through the face ring. // +// // +/////////////////////////////////////////////////////////////////////////////// + + // The tetrahedron data structure. Fields of a tetrahedron contains: + // - a list of four adjoining tetrahedra; + // - a list of four vertices; + // - a list of four subfaces (optional, used for -p switch); + // - a list of user-defined floating-point attributes (optional); + // - a volume constraint (optional, used for -a switch); + // - an integer of element marker (optional, used for -n switch); + // - a pointer to a list of high-ordered nodes (optional, -o2 switch); + + typedef REAL **tetrahedron; + + // The shellface data structure. Fields of a shellface contains: + // - a list of three adjoining subfaces; + // - a list of three vertices; + // - a list of two adjoining tetrahedra; + // - a list of three adjoining subsegments; + // - a pointer to a badface containing it (used for -q); + // - an area constraint (optional, used for -q); + // - an integer for boundary marker; + // - an integer for type: SHARPSEGMENT, NONSHARPSEGMENT, ...; + // - an integer for pbc group (optional, if in->pbcgrouplist exists); + + typedef REAL **shellface; + + // The point data structure. It is actually an array of REALs: + // - x, y and z coordinates; + // - a list of user-defined point attributes (optional); + // - a list of REALs of a user-defined metric tensor (optional); + // - a pointer to a simplex (tet, tri, edge, or vertex); + // - a pointer to a parent (or duplicate) point; + // - a pointer to a tet in background mesh (optional); + // - a pointer to another pbc point (optional); + // - an integer for boundary marker; + // - an integer for verttype: INPUTVERTEX, FREEVERTEX, ...; + + typedef REAL *point; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh handles // +// // +// Two special data types, 'triface' and 'face' are defined for maintaining // +// and updating meshes. They are like pointers (or handles), which allow you // +// to hold one particular part of the mesh, i.e., a tetrahedron, a triangle, // +// an edge and a vertex. However, these data types do not themselves store // +// any part of the mesh. The mesh is made of the data types defined above. // +// // +// Muecke's "triangle-edge" data structure is the prototype for these data // +// types. It allows a universal representation for every tetrahedron, // +// triangle, edge and vertex. For understanding the following descriptions // +// of these handle data structures, readers are required to read both the // +// introduction and implementation detail of "triangle-edge" data structure // +// in Muecke's thesis. // +// // +// A 'triface' represents a face of a tetrahedron and an oriented edge of // +// the face simultaneously. It has a pointer 'tet' to a tetrahedron, an // +// integer 'loc' (range from 0 to 3) as the face index, and an integer 'ver' // +// (range from 0 to 5) as the edge version. A face of the tetrahedron can be // +// uniquly determined by the pair (tet, loc), and an oriented edge of this // +// face can be uniquly determined by the triple (tet, loc, ver). Therefore, // +// different usages of one triface are possible. If we only use the pair // +// (tet, loc), it refers to a face, and if we add the 'ver' additionally to // +// the pair, it is an oriented edge of this face. // +// // +// A 'face' represents a subface and an oriented edge of it simultaneously. // +// It has a pointer 'sh' to a subface, an integer 'shver'(range from 0 to 5) // +// as the edge version. The pair (sh, shver) determines a unique oriented // +// edge of this subface. A 'face' is also used to represent a subsegment, // +// in this case, 'sh' points to the subsegment, and 'shver' indicates the // +// one of two orientations of this subsegment, hence, it only can be 0 or 1. // +// // +// Mesh navigation and updating are accomplished through a set of mesh // +// manipulation primitives which operate on trifaces and faces. They are // +// introduced below. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class triface { + + public: + + tetrahedron* tet; + int loc, ver; + + // Constructors; + triface() : tet(0), loc(0), ver(0) {} + // Operators; + triface& operator=(const triface& t) { + tet = t.tet; loc = t.loc; ver = t.ver; + return *this; + } + bool operator==(triface& t) { + return tet == t.tet && loc == t.loc && ver == t.ver; + } + bool operator!=(triface& t) { + return tet != t.tet || loc != t.loc || ver != t.ver; + } + }; + + class face { + + public: + + shellface *sh; + int shver; + + // Constructors; + face() : sh(0), shver(0) {} + // Operators; + face& operator=(const face& s) { + sh = s.sh; shver = s.shver; + return *this; + } + bool operator==(face& s) {return (sh == s.sh) && (shver == s.shver);} + bool operator!=(face& s) {return (sh != s.sh) || (shver != s.shver);} + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// The badface structure // +// // +// A multiple usages structure. Despite of its name, a 'badface' can be used // +// to represent the following objects: // +// - a face of a tetrahedron which is (possibly) non-Delaunay; // +// - an encroached subsegment or subface; // +// - a bad-quality tetrahedron, i.e, has too large radius-edge ratio; // +// - a sliver, i.e., has good radius-edge ratio but nearly zero volume; // +// - a degenerate tetrahedron (see routine checkdegetet()). // +// - a recently flipped face (saved for undoing the flip later). // +// // +// It has the following fields: 'tt' holds a tetrahedron; 'ss' holds a sub- // +// segment or subface; 'cent' is the circumcent of 'tt' or 'ss', 'key' is a // +// special value depending on the use, it can be either the square of the // +// radius-edge ratio of 'tt' or the flipped type of 'tt'; 'forg', 'fdest', // +// 'fapex', and 'foppo' are vertices saved for checking the object in 'tt' // +// or 'ss' is still the same when it was stored; 'noppo' is the fifth vertex // +// of a degenerate point set. 'previtem' and 'nextitem' implement a double // +// link for managing many basfaces. // +// // +/////////////////////////////////////////////////////////////////////////////// + + struct badface { + triface tt; + face ss; + REAL key; + REAL cent[3]; + point forg, fdest, fapex, foppo; + point noppo; + struct badface *previtem, *nextitem; + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Elementary flip data structure // +// // +// A data structure to record three types of elementary flips, which are // +// 2-to-3, 3-to-2, and 2-to-2 flips. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class elemflip { + + public: + + enum fliptype ft; // ft \in {T23, T32, T22}. + point pset1[3]; + point pset2[3]; + + elemflip() { + ft = T23; // Default. + pset1[0] = pset1[1] = pset1[2] = (point) NULL; + pset2[0] = pset2[1] = pset2[2] = (point) NULL; + } + + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// The pbcdata structure // +// // +// A pbcdata stores data of a periodic boundary condition defined on a pair // +// of facets or segments. Let f1 and f2 define a pbcgroup. 'fmark' saves the // +// facet markers of f1 and f2; 'ss' contains two subfaces belong to f1 and // +// f2, respectively. Let s1 and s2 define a segment pbcgroup. 'segid' are // +// the segment ids of s1 and s2; 'ss' contains two segments belong to s1 and // +// s2, respectively. 'transmat' are two transformation matrices. transmat[0] // +// transforms a point of f1 (or s1) into a point of f2 (or s2), transmat[1] // +// does the inverse. // +// // +/////////////////////////////////////////////////////////////////////////////// + + struct pbcdata { + int fmark[2]; + int segid[2]; + face ss[2]; + REAL transmat[2][4][4]; + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Fast lookup tables for mesh manipulation primitives. // +// // +// Mesh manipulation primitives (given below) are basic operations on mesh // +// data structures. They answer basic queries on mesh handles, such as "what // +// is the origin (or destination, or apex) of the face?", "what is the next // +// (or previous) edge in the edge ring?", and "what is the next face in the // +// face ring?", and so on. // +// // +// The implementation of teste basic queries can take advangtage of the fact // +// that the mesh data structures additionally store geometric informations. // +// For example, we have ordered the 4 vertices (from 0 to 3) and the 4 faces // +// (from 0 to 3) of a tetrahedron, and for each face of the tetrahedron, a // +// sequence of vertices has stipulated, therefore the origin of any face of // +// the tetrahedron can be quickly determined by a table 'locver2org', which // +// takes the index of the face and the edge version as inputs. A list of // +// fast lookup tables are defined below. They're just like global variables. // +// These tables are initialized at the runtime. // +// // +/////////////////////////////////////////////////////////////////////////////// + + // For enext() primitive, uses 'ver' as the index. + static int ve[6]; + + // For org(), dest() and apex() primitives, uses 'ver' as the index. + static int vo[6], vd[6], va[6]; + + // For org(), dest() and apex() primitives, uses 'loc' as the first + // index and 'ver' as the second index. + static int locver2org[4][6]; + static int locver2dest[4][6]; + static int locver2apex[4][6]; + + // For oppo() primitives, uses 'loc' as the index. + static int loc2oppo[4]; + + // For fnext() primitives, uses 'loc' as the first index and 'ver' as + // the second index, returns an array containing a new 'loc' and a + // new 'ver'. Note: Only valid for 'ver' equals one of {0, 2, 4}. + static int locver2nextf[4][6][2]; + + // The edge number (from 0 to 5) of a tet is defined as follows: + static int locver2edge[4][6]; + static int edge2locver[6][2]; + + // The map from a given face ('loc') to the other three faces in the tet. + // and the map from a given face's edge ('loc', 'ver') to other two + // faces in the tet opposite to this edge. (used in speeding the Bowyer- + // Watson cavity construction). + static int locpivot[4][3]; + static int locverpivot[4][6][2]; + + // For enumerating three edges of a triangle. + static int plus1mod3[3]; + static int minus1mod3[3]; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh manipulation primitives // +// // +// A serial of mesh operations such as topological maintenance, navigation, // +// local modification, etc., is accomplished through a set of mesh manipul- // +// ation primitives. These primitives are indeed very simple functions which // +// take one or two handles ('triface's and 'face's) as parameters, perform // +// basic operations such as "glue two tetrahedra at a face", "return the // +// origin of a tetrahedron", "return the subface adjoining at the face of a // +// tetrahedron", and so on. // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Primitives for tetrahedra. + inline void decode(tetrahedron ptr, triface& t); + inline tetrahedron encode(triface& t); + inline void sym(triface& t1, triface& t2); + inline void symself(triface& t); + inline void bond(triface& t1, triface& t2); + inline void dissolve(triface& t); + inline point org(triface& t); + inline point dest(triface& t); + inline point apex(triface& t); + inline point oppo(triface& t); + inline void setorg(triface& t, point pointptr); + inline void setdest(triface& t, point pointptr); + inline void setapex(triface& t, point pointptr); + inline void setoppo(triface& t, point pointptr); + inline void esym(triface& t1, triface& t2); + inline void esymself(triface& t); + inline void enext(triface& t1, triface& t2); + inline void enextself(triface& t); + inline void enext2(triface& t1, triface& t2); + inline void enext2self(triface& t); + inline bool fnext(triface& t1, triface& t2); + inline bool fnextself(triface& t); + inline void symedge(triface& t1, triface& t2); + inline void symedgeself(triface& t); + inline void tfnext(triface& t1, triface& t2); + inline void tfnextself(triface& t); + inline void enextfnext(triface& t1, triface& t2); + inline void enextfnextself(triface& t); + inline void enext2fnext(triface& t1, triface& t2); + inline void enext2fnextself(triface& t); + inline REAL elemattribute(tetrahedron* ptr, int attnum); + inline void setelemattribute(tetrahedron* ptr, int attnum, REAL value); + inline REAL volumebound(tetrahedron* ptr); + inline void setvolumebound(tetrahedron* ptr, REAL value); + inline int getelemmarker(tetrahedron* ptr); + inline void setelemmarker(tetrahedron* ptr, int value); + inline void infect(triface& t); + inline void uninfect(triface& t); + inline bool infected(triface& t); + inline void marktest(triface& t); + inline void unmarktest(triface& t); + inline bool marktested(triface& t); + inline void markface(triface& t); + inline void unmarkface(triface& t); + inline bool facemarked(triface& t); + inline void markedge(triface& t); + inline void unmarkedge(triface& t); + inline bool edgemarked(triface& t); + + // Primitives for subfaces and subsegments. + inline void sdecode(shellface sptr, face& s); + inline shellface sencode(face& s); + inline void spivot(face& s1, face& s2); + inline void spivotself(face& s); + inline void sbond(face& s1, face& s2); + inline void sbond1(face& s1, face& s2); + inline void sdissolve(face& s); + inline point sorg(face& s); + inline point sdest(face& s); + inline point sapex(face& s); + inline void setsorg(face& s, point pointptr); + inline void setsdest(face& s, point pointptr); + inline void setsapex(face& s, point pointptr); + inline void sesym(face& s1, face& s2); + inline void sesymself(face& s); + inline void senext(face& s1, face& s2); + inline void senextself(face& s); + inline void senext2(face& s1, face& s2); + inline void senext2self(face& s); + inline void sfnext(face&, face&); + inline void sfnextself(face&); + inline badface* shell2badface(face& s); + inline void setshell2badface(face& s, badface* value); + inline REAL areabound(face& s); + inline void setareabound(face& s, REAL value); + inline int shellmark(face& s); + inline void setshellmark(face& s, int value); + inline enum shestype shelltype(face& s); + inline void setshelltype(face& s, enum shestype value); + inline int shellpbcgroup(face& s); + inline void setshellpbcgroup(face& s, int value); + inline void sinfect(face& s); + inline void suninfect(face& s); + inline bool sinfected(face& s); + + // Primitives for interacting tetrahedra and subfaces. + inline void tspivot(triface& t, face& s); + inline void stpivot(face& s, triface& t); + inline void tsbond(triface& t, face& s); + inline void tsdissolve(triface& t); + inline void stdissolve(face& s); + + // Primitives for interacting subfaces and subsegs. + inline void sspivot(face& s, face& edge); + inline void ssbond(face& s, face& edge); + inline void ssdissolve(face& s); + + inline void tsspivot1(triface& t, face& seg); + inline void tssbond1(triface& t, face& seg); + inline void tssdissolve1(triface& t); + + // Primitives for points. + inline int pointmark(point pt); + inline void setpointmark(point pt, int value); + inline enum verttype pointtype(point pt); + inline void setpointtype(point pt, enum verttype value); + inline void pinfect(point pt); + inline void puninfect(point pt); + inline bool pinfected(point pt); + inline tetrahedron point2tet(point pt); + inline void setpoint2tet(point pt, tetrahedron value); + inline shellface point2sh(point pt); + inline void setpoint2sh(point pt, shellface value); + inline shellface point2seg(point pt); + inline void setpoint2seg(point pt, shellface value); + inline point point2ppt(point pt); + inline void setpoint2ppt(point pt, point value); + inline tetrahedron point2bgmtet(point pt); + inline void setpoint2bgmtet(point pt, tetrahedron value); + inline point point2pbcpt(point pt); + inline void setpoint2pbcpt(point pt, point value); + + // Advanced primitives. + inline void adjustedgering(triface& t, int direction); + inline void adjustedgering(face& s, int direction); + inline bool isdead(triface* t); + inline bool isdead(face* s); + inline bool isfacehaspoint(triface* t, point testpoint); + inline bool isfacehaspoint(face* t, point testpoint); + inline bool isfacehasedge(face* s, point tend1, point tend2); + inline bool issymexist(triface* t); + void getnextsface(face*, face*); + void tsspivot(triface*, face*); + void sstpivot(face*, triface*); + void point2tetorg(point, triface&); + void point2shorg(point, face&); + void point2segorg(point, face&); + bool findorg(triface* t, point dorg); + bool findorg(face* s, point dorg); + void findedge(triface* t, point eorg, point edest); + void findedge(face* s, point eorg, point edest); + void getonextseg(face* s, face* lseg); + void getseghasorg(face* sseg, point dorg); + point getsubsegfarorg(face* sseg); + point getsubsegfardest(face* sseg); + void printtet(triface*); + void printsh(face*); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Arraypool // +// // +// Each arraypool contains an array of pointers to a number of blocks. Each // +// block contains the same fixed number of objects. Each index of the array // +// addesses a particular object in the pool. The most significant bits add- // +// ress the index of the block containing the object. The less significant // +// bits address this object within the block. // +// // +// 'objectbytes' is the size of one object in blocks; 'log2objectsperblock' // +// is the base-2 logarithm of 'objectsperblock'; 'objects' counts the number // +// of allocated objects; 'totalmemory' is the totoal memorypool in bytes. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class arraypool { + + public: + + int objectbytes; + int objectsperblock; + int log2objectsperblock; + int toparraylen; + char **toparray; + long objects; + unsigned long totalmemory; + + void restart(); + void poolinit(int sizeofobject, int log2objperblk); + char* getblock(int objectindex); + void* lookup(int objectindex); + int newindex(void **newptr); + + arraypool(int sizeofobject, int log2objperblk); + ~arraypool(); + }; + +// fastlookup() -- A fast, unsafe operation. Return the pointer to the object +// with a given index. Note: The object's block must have been allocated, +// i.e., by the function newindex(). + +#define fastlookup(pool, index) \ + (void *) ((pool)->toparray[(index) >> (pool)->log2objectsperblock] + \ + ((index) & ((pool)->objectsperblock - 1)) * (pool)->objectbytes) + + +// A function: int cmp(const T &, const T &), is said to realize a +// linear order on the type T if there is a linear order <= on T such +// that for all x and y in T satisfy the following relation: +// -1 if x < y. +// comp(x, y) = 0 if x is equivalent to y. +// +1 if x > y. +// A 'compfunc' is a pointer to a linear-order function. + + typedef int (*compfunc) (const void *, const void *); + +/////////////////////////////////////////////////////////////////////////////// +// // +// List // +// // +// An array of items with automatically reallocation of memory. // +// // +// 'base' is the starting address of the array. 'itembytes' is the size of // +// each item in byte. // +// // +// 'items' is the number of items stored in list. 'maxitems' indicates how // +// many items can be stored in this list. 'expandsize' is the increasing // +// size (items) when the list is full. // +// // +// The index of list always starts from zero, i.e., for a list L contains // +// n elements, the first element is L[0], and the last element is L[n-1]. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class list { + + public: + + char *base; + int itembytes; + int items, maxitems, expandsize; + compfunc comp; + + list(int itbytes, compfunc pcomp, int mitems = 256, int exsize = 128) { + listinit(itbytes, pcomp, mitems, exsize); + } + ~list() { free(base); } + + void *operator[](int i) { return (void *) (base + i * itembytes); } + + void listinit(int itbytes, compfunc pcomp, int mitems, int exsize); + void setcomp(compfunc compf) { comp = compf; } + void clear() { items = 0; } + int len() { return items; } + void *append(void* appitem); + void *insert(int pos, void* insitem); + void del(int pos, int order); + int hasitem(void* checkitem); + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Memorypool // +// // +// A type used to allocate memory. // +// // +// firstblock is the first block of items. nowblock is the block from which // +// items are currently being allocated. nextitem points to the next slab // +// of free memory for an item. deaditemstack is the head of a linked list // +// (stack) of deallocated items that can be recycled. unallocateditems is // +// the number of items that remain to be allocated from nowblock. // +// // +// Traversal is the process of walking through the entire list of items, and // +// is separate from allocation. Note that a traversal will visit items on // +// the "deaditemstack" stack as well as live items. pathblock points to // +// the block currently being traversed. pathitem points to the next item // +// to be traversed. pathitemsleft is the number of items that remain to // +// be traversed in pathblock. // +// // +// itemwordtype is set to POINTER or FLOATINGPOINT, and is used to suggest // +// what sort of word the record is primarily made up of. alignbytes // +// determines how new records should be aligned in memory. itembytes and // +// itemwords are the length of a record in bytes (after rounding up) and // +// words. itemsperblock is the number of items allocated at once in a // +// single block. items is the number of currently allocated items. // +// maxitems is the maximum number of items that have been allocated at // +// once; it is the current number of items plus the number of records kept // +// on deaditemstack. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class memorypool { + + public: + + void **firstblock, **nowblock; + void *nextitem; + void *deaditemstack; + void **pathblock; + void *pathitem; + wordtype itemwordtype; + int alignbytes; + int itembytes, itemwords; + int itemsperblock; + long items, maxitems; + int unallocateditems; + int pathitemsleft; + + memorypool(); + memorypool(int, int, enum wordtype, int); + ~memorypool(); + + void poolinit(int, int, enum wordtype, int); + void restart(); + void *alloc(); + void dealloc(void*); + void traversalinit(); + void *traverse(); + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Queue // +// // +// A 'queue' is a FIFO data structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class queue : public memorypool { + + public: + + void **head, **tail; + int linkitembytes; + int linkitems; // Not count 'head' and 'tail'. + + queue(int bytecount, int itemcount = 256) { + linkitembytes = bytecount; + poolinit(bytecount + sizeof(void *), itemcount, POINTER, 0); + head = (void **) alloc(); + tail = (void **) alloc(); + *head = (void *) tail; + *tail = NULL; + linkitems = 0; + } + + void clear() { + // Reset the pool. + restart(); + // Initialize all variables. + head = (void **) alloc(); + tail = (void **) alloc(); + *head = (void *) tail; + *tail = NULL; + linkitems = 0; + } + + long len() { return linkitems; } + bool empty() { return linkitems == 0; } + + void *push(void* newitem) { + void **newnode = tail; + if (newitem != (void *) NULL) { + memcpy((void *)(newnode + 1), newitem, linkitembytes); + } + tail = (void **) alloc(); + *tail = NULL; + *newnode = (void *) tail; + linkitems++; + return (void *)(newnode + 1); + } + + void *pop() { + if (linkitems > 0) { + void **deadnode = (void **) *head; + *head = *deadnode; + dealloc((void *) deadnode); + linkitems--; + return (void *)(deadnode + 1); + } else { + return NULL; + } + } + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Memory managment routines // +// // +/////////////////////////////////////////////////////////////////////////////// + + void dummyinit(int, int); + void initializepools(); + void tetrahedrondealloc(tetrahedron*); + tetrahedron *tetrahedrontraverse(); + void shellfacedealloc(memorypool*, shellface*); + shellface *shellfacetraverse(memorypool*); + void badfacedealloc(memorypool*, badface*); + badface *badfacetraverse(memorypool*); + void pointdealloc(point); + point pointtraverse(); + void maketetrahedron(triface*); + void makeshellface(memorypool*, face*); + void makepoint(point*); + + void makepoint2tetmap(); + void makepoint2segmap(); + void makeindex2pointmap(point*&); + void makesegmentmap(int*&, shellface**&); + void makesubfacemap(int*&, shellface**&); + void maketetrahedronmap(int*&, tetrahedron**&); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Geometric functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + // PI is the ratio of a circle's circumference to its diameter. + static REAL PI; + + // Triangle-triangle intersection test + enum interresult edge_vert_col_inter(REAL*, REAL*, REAL*); + enum interresult edge_edge_cop_inter(REAL*, REAL*, REAL*, REAL*, REAL*); + enum interresult tri_vert_cop_inter(REAL*, REAL*, REAL*, REAL*, REAL*); + enum interresult tri_edge_cop_inter(REAL*, REAL*, REAL*,REAL*,REAL*,REAL*); + enum interresult tri_edge_inter_tail(REAL*, REAL*, REAL*, REAL*, REAL*, + REAL, REAL); + enum interresult tri_edge_inter(REAL*, REAL*, REAL*, REAL*, REAL*); + enum interresult tri_tri_inter(REAL*, REAL*, REAL*, REAL*, REAL*, REAL*); + int tri_edge_2d(point, point, point, point, point, point, int, int*, int*); + int tri_edge_test(point, point, point, point, point, point, int, int*, int*); + + // Geometric tests + REAL incircle3d(point pa, point pb, point pc, point pd); + REAL insphere_s(REAL*, REAL*, REAL*, REAL*, REAL*); + bool iscollinear(REAL*, REAL*, REAL*, REAL eps); + bool iscoplanar(REAL*, REAL*, REAL*, REAL*, REAL vol6, REAL eps); + bool iscospheric(REAL*, REAL*, REAL*, REAL*, REAL*, REAL vol24, REAL eps); + + // Linear algebra functions + inline REAL dot(REAL* v1, REAL* v2); + inline void cross(REAL* v1, REAL* v2, REAL* n); + bool lu_decmp(REAL lu[4][4], int n, int* ps, REAL* d, int N); + void lu_solve(REAL lu[4][4], int n, int* ps, REAL* b, int N); + + // Geometric calculations + inline REAL distance(REAL* p1, REAL* p2); + REAL shortdistance(REAL* p, REAL* e1, REAL* e2); + REAL shortdistance(REAL* p, REAL* e1, REAL* e2, REAL* e3); + REAL interiorangle(REAL* o, REAL* p1, REAL* p2, REAL* n); + void projpt2edge(REAL* p, REAL* e1, REAL* e2, REAL* prj); + void projpt2face(REAL* p, REAL* f1, REAL* f2, REAL* f3, REAL* prj); + void facenormal(REAL* pa, REAL* pb, REAL* pc, REAL* n, REAL* nlen); + void facenormal2(point pa, point pb, point pc, REAL *n, int pivot); + void edgeorthonormal(REAL* e1, REAL* e2, REAL* op, REAL* n); + REAL facedihedral(REAL* pa, REAL* pb, REAL* pc1, REAL* pc2); + void tetalldihedral(point, point, point, point, REAL*, REAL*, REAL*); + void tetallnormal(point, point, point, point, REAL N[4][3], REAL* volume); + REAL tetaspectratio(point, point, point, point); + bool circumsphere(REAL*, REAL*, REAL*, REAL*, REAL* cent, REAL* radius); + void inscribedsphere(REAL*, REAL*, REAL*, REAL*, REAL* cent, REAL* radius); + void rotatepoint(REAL* p, REAL rotangle, REAL* p1, REAL* p2); + void planelineint(REAL*, REAL*, REAL*, REAL*, REAL*, REAL*, REAL*); + + // Point location routines. + unsigned long randomnation(unsigned int choices); + REAL distance2(tetrahedron* tetptr, point p); + void randomsample(point searchpt, triface *searchtet); + enum locateresult locate(point searchpt, triface* searchtet); + enum locateresult locate2(point searchpt, triface* searchtet, arraypool*); + enum locateresult preciselocate(point searchpt, triface* searchtet, long); + enum locateresult adjustlocate(point, triface*, enum locateresult, REAL); + enum locateresult hullwalk(point searchpt, triface* hulltet); + enum locateresult locatesub(point searchpt, face* searchsh, int, REAL); + enum locateresult adjustlocatesub(point, face*, enum locateresult, REAL); + enum locateresult locateseg(point searchpt, face* searchseg); + enum locateresult adjustlocateseg(point, face*, enum locateresult, REAL); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh update functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void enqueueflipface(triface&, queue*); + void enqueueflipedge(face&, queue*); + void flip23(triface*, queue*); + void flip32(triface*, queue*); + void flip22(triface*, queue*); + void flip22sub(face*, queue*); + long lawson3d(queue* flipqueue); + long lawson(queue* flipqueue); + + bool removetetbypeeloff(triface *striptet, triface*); + bool removefacebyflip23(REAL *key, triface*, triface*, queue*); + bool removeedgebyflip22(REAL *key, int, triface*, queue*); + bool removeedgebyflip32(REAL *key, triface*, triface*, queue*); + bool removeedgebytranNM(REAL*,int,triface*,triface*,point,point,queue*); + bool removeedgebycombNM(REAL*,int,triface*,int*,triface*,triface*,queue*); + + void splittetrahedron(point, triface*, queue*); + void splittetface(point, triface*, queue*); + void splitsubface(point, face*, queue*); + bool splittetedge(point, triface*, queue*); + void splitsubedge(point, face*, queue*); + + void formstarpolyhedron(point pt, list* tetlist, list* verlist, bool); + void formbowatcavitysub(point, face*, list*, list*); + void formbowatcavityquad(point, list*, list*); + void formbowatcavitysegquad(point, list*, list*); + void formbowatcavity(point bp, face* bpseg, face* bpsh, int* n, int* nmax, + list** sublists, list** subceillists, list** tetlists, + list** ceillists); + void releasebowatcavity(face*, int, list**, list**, list**, list**); + bool validatebowatcavityquad(point bp, list* ceillist, REAL maxcosd); + void updatebowatcavityquad(list* tetlist, list* ceillist); + void updatebowatcavitysub(list* sublist, list* subceillist, int* cutcount); + bool trimbowatcavity(point bp, face* bpseg, int n, list** sublists, + list** subceillists, list** tetlists,list** ceillists, + REAL maxcosd); + void bowatinsertsite(point bp, face* splitseg, int n, list** sublists, + list** subceillists, list** tetlists, list** ceillists, + list* verlist, queue* flipque, bool chkencseg, + bool chkencsub, bool chkbadtet); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Delaunay tetrahedralization functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Point sorting routines. + void btree_sort(point*, int, int, REAL, REAL, REAL, REAL, REAL, REAL, int); + void btree_insert(point insertpt); + void btree_search(point searchpt, triface* searchtet); + void ordervertices(point* vertexarray, int arraysize); + + enum locateresult insertvertexbw(point insertpt, triface *searchtet, + bool bwflag, bool visflag, + bool noencsegflag, bool noencsubflag); + bool unifypoint(point testpt, triface*, enum locateresult, REAL); + bool incrflipdelaunay(triface*, point*, long, bool, bool, REAL, queue*); + long delaunizevertices(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Surface triangulation functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + enum locateresult sinsertvertex(point insertpt, face *splitsh,face *splitseg, + bool bwflag, bool cflag); + void formstarpolygon(point pt, list* trilist, list* verlist); + void getfacetabovepoint(face* facetsh); + bool incrflipdelaunaysub(int shmark, REAL eps, list*, int, REAL*, queue*); + enum finddirectionresult finddirectionsub(face* searchsh, point tend); + void insertsubseg(face* tri); + bool scoutsegmentsub(face* searchsh, point tend); + void flipedgerecursive(face* flipedge, queue* flipqueue); + void constrainededge(face* startsh, point tend, queue* flipqueue); + void recoversegment(point tstart, point tend, queue* flipqueue); + void infecthullsub(memorypool* viri); + void plaguesub(memorypool* viri); + void carveholessub(int holes, REAL* holelist, memorypool* viri); + void triangulate(int shmark, REAL eps, list* ptlist, list* conlist,int holes, + REAL* holelist, memorypool* viri, queue*); + void retrievenewsubs(list* newshlist, bool removeseg); + void unifysegments(); + void assignsegmentmarkers(); + void mergefacets(queue* flipqueue); + long meshsurface(); + + // Detect intersecting facets of PLC. + void interecursive(shellface** subfacearray, int arraysize, int axis, + REAL bxmin, REAL bxmax, REAL bymin, REAL bymax, + REAL bzmin, REAL bzmax, int* internum); + void detectinterfaces(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Constrained Delaunay tetrahedralization functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Segment recovery routines. + void markacutevertices(REAL acuteangle); + enum finddirectionresult finddirection(triface* searchtet, point, long); + enum interresult finddirection2(triface* searchtet, point); + enum interresult finddirection3(triface* searchtet, point); + enum interresult scoutsegment2(face*, triface*, point*); + void getsegmentsplitpoint2(face* sseg, point refpt, REAL* vt); + void getsegmentsplitpoint3(face* sseg, point refpt, REAL* vt); + void delaunizesegments2(); + + // Facets recovery routines. + enum interresult scoutsubface(face* ssub, triface* searchtet, int); + enum interresult scoutcrosstet(face* ssub, triface* searchtet, arraypool*); + void recoversubfacebyflips(face* pssub, triface* crossface, arraypool*); + void formcavity(face*, arraypool*, arraypool*, arraypool*, arraypool*, + arraypool*, arraypool*, arraypool*); + bool delaunizecavity(arraypool*, arraypool*, arraypool*, arraypool*, + arraypool*, arraypool*); + bool fillcavity(arraypool*, arraypool*, arraypool*, arraypool*); + void carvecavity(arraypool*, arraypool*, arraypool*); + void restorecavity(arraypool*, arraypool*, arraypool*); + void splitsubedge(point, face*, arraypool*, arraypool*); + void constrainedfacets2(); + + void formskeleton(clock_t&); + + // Carving out holes and concavities routines. + void infecthull(memorypool *viri); + void plague(memorypool *viri); + void regionplague(memorypool *viri, REAL attribute, REAL volume); + void removeholetets(memorypool *viri); + void assignregionattribs(); + void carveholes(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Steiner points removal functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void initializecavity(list* floorlist, list* ceillist, list* frontlist, + list* ptlist, list* gluelist); + bool delaunizecavvertices(triface*, list*, list*, list*, queue*); + void retrievenewtets(list* newtetlist); + void insertauxsubface(triface* front, triface* idfront); + bool scoutfront(triface* front, triface* idfront); + void gluefronts(triface* front, triface* front1, list* gluetetlist, + list* glueshlist); + bool identifyfronts(list* frontlist,list* misfrontlist,list* gluetetlist, + list* glueshlist); + void detachauxsubfaces(list* newtetlist); + bool carvecavity(list* newtetlist, list* outtetlist, list* gluetetlist, + queue* flipque); + + void replacepolygonsubs(list* oldshlist, list* newshlist); + void orientnewsubs(list* newshlist, face* orientsh, REAL* norm); + bool registerelemflip(enum fliptype ft, point pa1, point pb1, point pc1, + point pa2, point pb2, point pc2); + bool check4fixededge(point pa, point pb); + bool removeedgebyflips(triface* remedge, int*); + bool removefacebyflips(triface* remface, int*); + bool recoveredgebyflips(triface* searchtet, point pb, int*); + bool recoverfacebyflips(triface* front, int*); + bool constrainedcavity(triface* oldtet, list* floorlist, list* ceillist, + list* ptlist, list* frontlist, list* misfrontlist, + list* newtetlist, list* gluetetlist, list* glueshlist, + queue* flipque); + bool findrelocatepoint2(point sp, point np, REAL* n, list*, list*); + bool relocatepoint(point steinpt, triface* oldtet, list*, list*, queue*); + bool findcollapseedge(point suppt, point* conpt, list* oldtetlist, list*); + void collapseedge(point suppt, point conpt, list* oldtetlist, list*); + void deallocfaketets(list* frontlist); + void restorepolyhedron(list* oldtetlist); + bool suppressfacetpoint(face* supsh, list* frontlist, list* misfrontlist, + list* ptlist, list* conlist, memorypool* viri, + queue* flipque, bool noreloc, bool optflag); + bool suppresssegpoint(face* supseg, list* spinshlist, list* newsegshlist, + list* frontlist, list* misfrontlist, list* ptlist, + list* conlist, memorypool* viri, queue* flipque, + bool noreloc, bool optflag); + bool suppressvolpoint(triface* suptet, list* frontlist, list* misfrontlist, + list* ptlist, queue* flipque, bool optflag); + void removesteiners2(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh rebuild functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void transfernodes(); + long reconstructmesh(); + void insertconstrainedpoints(tetgenio *addio); + bool p1interpolatebgm(point pt, triface* bgmtet, long *scount); + void interpolatesizemap(); + void duplicatebgmesh(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh refinement functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void marksharpsegments(REAL sharpangle); + void decidefeaturepointsizes(); + void enqueueencsub(face* ss, point encpt, int quenumber, REAL* cent); + badface* dequeueencsub(int* quenumber); + void enqueuebadtet(triface* tt, REAL key, REAL* cent); + badface* topbadtetra(); + void dequeuebadtet(); + bool checkseg4encroach(face* testseg, point testpt, point*, bool enqflag); + bool checksub4encroach(face* testsub, point testpt, bool enqflag); + bool checktet4badqual(triface* testtet, bool enqflag); + bool acceptsegpt(point segpt, point refpt, face* splitseg); + bool acceptfacpt(point facpt, list* subceillist, list* verlist); + bool acceptvolpt(point volpt, list* ceillist, list* verlist); + void getsplitpoint(point e1, point e2, point refpt, point newpt); + void setnewpointsize(point newpt, point e1, point e2); + bool splitencseg(point, face*, list*, list*, list*,queue*,bool,bool,bool); + bool tallencsegs(point testpt, int n, list** ceillists); + bool tallencsubs(point testpt, int n, list** ceillists); + void tallbadtetrahedrons(); + void repairencsegs(bool chkencsub, bool chkbadtet); + void repairencsubs(bool chkbadtet); + void repairbadtets(); + void enforcequality(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh optimization routines // +// // +/////////////////////////////////////////////////////////////////////////////// + + bool checktet4ill(triface* testtet, bool enqflag); + bool checktet4opt(triface* testtet, bool enqflag); + bool removeedge(badface* remedge, bool optflag); + bool smoothpoint(point smthpt, point, point, list*, bool, REAL*); + bool smoothsliver(badface* remedge, list *starlist); + bool splitsliver(badface* remedge, list *tetlist, list *ceillist); + void tallslivers(bool optflag); + void optimizemesh2(bool optflag); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh output functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void jettisonnodes(); + void highorder(); + void numberedges(); + void outnodes(tetgenio*); + void outmetrics(tetgenio*); + void outelements(tetgenio*); + void outfaces(tetgenio*); + void outhullfaces(tetgenio*); + void outsubfaces(tetgenio*); + void outedges(tetgenio*); + void outsubsegments(tetgenio*); + void outneighbors(tetgenio*); + void outvoronoi(tetgenio*); + void outsmesh(char*); + void outmesh2medit(char*); + void outmesh2gid(char*); + void outmesh2off(char*); + void outmesh2vtk(char*); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh check functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + int checkmesh(); + int checkshells(); + int checksegments(); + int checkdelaunay(REAL, queue*); + void checkconforming(); + void algorithmicstatistics(); + void qualitystatistics(); + void statistics(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Debug functions // +// // +/////////////////////////////////////////////////////////////////////////////// + /* + void ptet(triface* t); + void psh(face* s); + int pteti(int i, int j, int k, int l); + void pface(int i, int j, int k); + bool pedge(int i, int j); + int psubface(int i, int j, int k); + void psubseg(int i, int j); + int pmark(point p); + void pvert(point p); + int pverti(int i); + REAL test_orient3d(int i, int j, int k, int l); + REAL test_insphere(int i, int j, int k, int l, int m); + REAL test_insphere_s(int i, int j, int k, int l, int m); + void print_tetarray(arraypool* tetarray); + void print_tetlist(list* tetlist); + void print_facearray(arraypool* facearray); + void print_facelist(list* facelist); + void print_subfacearray(arraypool* subfacearray); + void print_subfacelist(list* subfacelist); + void dump_facetof(face* pssub); + void print_fliptetlist(triface *fliptet); + void print_deaditemstack(void* deaditemstack); + int check_deaditemstack(void* deaditemstack, uintptr_t addr); + void print_abtetlist(triface *abtetlist, int len); + int checkpoint2tetmap(); + int checkpoint2submap(); + int checkpoint2segmap(); + */ +/////////////////////////////////////////////////////////////////////////////// +// // +// Class variables // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Pointer to the input data (a set of nodes, a PLC, or a mesh). + tetgenio *in; + + // Pointer to the options (and filenames). + tetgenbehavior *b; + + // Pointer to a background mesh (contains size specification map). + tetgenmesh *bgm; + + // Variables used to allocate and access memory for tetrahedra, subfaces + // subsegments, points, encroached subfaces, encroached subsegments, + // bad-quality tetrahedra, and so on. + memorypool *tetrahedrons; + memorypool *subfaces; + memorypool *subsegs; + memorypool *points; + memorypool *badsubsegs; + memorypool *badsubfaces; + memorypool *badtetrahedrons; + memorypool *tet2segpool, *tet2subpool; + + // Pointer to the 'tetrahedron' that occupies all of "outer space". + tetrahedron *dummytet; + tetrahedron *dummytetbase; // Keep base address so we can free it later. + + // Pointer to the omnipresent subface. Referenced by any tetrahedron, + // or subface that isn't connected to a subface at that location. + shellface *dummysh; + shellface *dummyshbase; // Keep base address so we can free it later. + + // Entry to find the binary tree nodes (-u option). + arraypool *btreenode_list; + // The maximum size of a btree node (number after -u option) is + int max_btreenode_size; // <= b->max_btreenode_size. + // The maximum btree depth (for bookkeeping). + int max_btree_depth; + + // Arrays used by Bowyer-Watson algorithm. + arraypool *cavetetlist, *cavebdrylist, *caveoldtetlist; + arraypool *caveshlist, *caveshbdlist; + // Stacks used by the boundary recovery algorithm. + arraypool *subsegstack, *subfacstack; + + // Two handles used in constrained facet recovery. + triface firsttopface, firstbotface; + + // An array for registering elementary flips. + arraypool *elemfliplist; + + // An array of fixed edges for facet recovering by flips. + arraypool *fixededgelist; + + // A point above the plane in which the facet currently being used lies. + // It is used as a reference point for orient3d(). + point *facetabovepointarray, abovepoint, dummypoint; + + // Array (size = numberoftetrahedra * 6) for storing high-order nodes of + // tetrahedra (only used when -o2 switch is selected). + point *highordertable; + + // Arrays for storing and searching pbc data. 'subpbcgrouptable', (size + // is numberofpbcgroups) for pbcgroup of subfaces. 'segpbcgrouptable', + // a list for pbcgroup of segments. Because a segment can have several + // pbcgroup incident on it, its size is unknown on input, it will be + // found in 'createsegpbcgrouptable()'. + pbcdata *subpbcgrouptable; + list *segpbcgrouptable; + // A map for searching the pbcgroups of a given segment. 'idx2segpglist' + // (size = number of input segments + 1), and 'segpglist'. + int *idx2segpglist, *segpglist; + + // Queues that maintain the bad (badly-shaped or too large) tetrahedra. + // The tails are pointers to the pointers that have to be filled in to + // enqueue an item. The queues are ordered from 63 (highest priority) + // to 0 (lowest priority). + badface *subquefront[3], **subquetail[3]; + badface *tetquefront[64], *tetquetail[64]; + int nextnonemptyq[64]; + int firstnonemptyq, recentq; + + // Pointer to a recently visited tetrahedron. Improves point location + // if proximate points are inserted sequentially. + triface recenttet; + + REAL xmax, xmin, ymax, ymin, zmax, zmin; // Bounding box of points. + REAL longest; // The longest possible edge length. + REAL lengthlimit; // The limiting length of a new edge. + long hullsize; // Number of faces of convex hull. + long insegments; // Number of input segments. + long meshedges; // Number of output mesh edges. + int steinerleft; // Number of Steiner points not yet used. + int sizeoftensor; // Number of REALs per metric tensor. + int pointmtrindex; // Index to find the metric tensor of a point. + int point2simindex; // Index to find a simplex adjacent to a point. + int pointmarkindex; // Index to find boundary marker of a point. + int point2pbcptindex; // Index to find a pbc point to a point. + int highorderindex; // Index to find extra nodes for highorder elements. + int elemattribindex; // Index to find attributes of a tetrahedron. + int volumeboundindex; // Index to find volume bound of a tetrahedron. + int elemmarkerindex; // Index to find marker of a tetrahedron. + int shmarkindex; // Index to find boundary marker of a subface. + int areaboundindex; // Index to find area bound of a subface. + int checksubfaces; // Are there subfaces in the mesh yet? + int checksubsegs; // Are there subsegs in the mesh yet? + int checkpbcs; // Are there periodic boundary conditions? + int varconstraint; // Are there variant (node, seg, facet) constraints? + int nonconvex; // Is current mesh non-convex? + int dupverts; // Are there duplicated vertices? + int unuverts; // Are there unused vertices? + int relverts; // The number of relocated vertices. + int suprelverts; // The number of suppressed relocated vertices. + int collapverts; // The number of collapsed relocated vertices. + int unsupverts; // The number of unsuppressed vertices. + int smoothsegverts; // The number of smoothed vertices. + int jettisoninverts; // The number of jettisoned input vertices. + long samples; // Number of random samples for point location. + unsigned long randomseed; // Current random number seed. + REAL macheps; // The machine epsilon. + REAL cosmaxdihed, cosmindihed; // The cosine values of max/min dihedral. + REAL minfaceang, minfacetdihed; // The minimum input (dihedral) angles. + int maxcavfaces, maxcavverts; // The size of the largest cavity. + bool b_steinerflag; + + // Algorithm statistical counters. + long ptloc_count, ptloc_max_count; + long orient3dcount; + long inspherecount, insphere_sos_count; + long flip14count, flip26count, flipn2ncount; + long flip22count; + long inserthullcount; + long maxbowatcavsize, totalbowatcavsize, totaldeadtets; + long across_face_count, across_edge_count, across_max_count; + long maxcavsize, maxregionsize; + long ndelaunayedgecount, cavityexpcount; + long opt_tet_peels, opt_face_flips, opt_edge_flips; + + long abovecount; // Number of abovepoints calculation. + long bowatvolcount, bowatsubcount, bowatsegcount; // Bowyer-Watsons. + long updvolcount, updsubcount, updsegcount; // Bow-Wat cavities updates. + long failvolcount, failsubcount, failsegcount; // Bow-Wat fails. + long outbowatcircumcount; // Number of circumcenters outside Bowat-cav. + long r1count, r2count, r3count; // Numbers of edge splitting rules. + long cdtenforcesegpts; // Number of CDT enforcement points. + long rejsegpts, rejsubpts, rejtetpts; // Number of rejected points. + long optcount[10]; // Numbers of various optimizing operations. + long flip23s, flip32s, flip22s, flip44s; // Number of flips performed. + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class constructor & destructor // +// // +/////////////////////////////////////////////////////////////////////////////// + + tetgenmesh() + { + bgm = (tetgenmesh *) NULL; + in = (tetgenio *) NULL; + b = (tetgenbehavior *) NULL; + + tetrahedrons = (memorypool *) NULL; + subfaces = (memorypool *) NULL; + subsegs = (memorypool *) NULL; + points = (memorypool *) NULL; + badsubsegs = (memorypool *) NULL; + badsubfaces = (memorypool *) NULL; + badtetrahedrons = (memorypool *) NULL; + tet2segpool = NULL; + tet2subpool = NULL; + + dummytet = (tetrahedron *) NULL; + dummytetbase = (tetrahedron *) NULL; + dummysh = (shellface *) NULL; + dummyshbase = (shellface *) NULL; + + facetabovepointarray = (point *) NULL; + abovepoint = (point) NULL; + dummypoint = NULL; + btreenode_list = (arraypool *) NULL; + highordertable = (point *) NULL; + subpbcgrouptable = (pbcdata *) NULL; + segpbcgrouptable = (list *) NULL; + idx2segpglist = (int *) NULL; + segpglist = (int *) NULL; + + cavetetlist = NULL; + cavebdrylist = NULL; + caveoldtetlist = NULL; + caveshlist = caveshbdlist = NULL; + subsegstack = subfacstack = NULL; + + elemfliplist = (arraypool *) NULL; + fixededgelist = (arraypool *) NULL; + + xmax = xmin = ymax = ymin = zmax = zmin = 0.0; + longest = 0.0; + hullsize = 0l; + insegments = 0l; + meshedges = 0l; + pointmtrindex = 0; + pointmarkindex = 0; + point2simindex = 0; + point2pbcptindex = 0; + highorderindex = 0; + elemattribindex = 0; + volumeboundindex = 0; + shmarkindex = 0; + areaboundindex = 0; + checksubfaces = 0; + checksubsegs = 0; + checkpbcs = 0; + varconstraint = 0; + nonconvex = 0; + dupverts = 0; + unuverts = 0; + relverts = 0; + suprelverts = 0; + collapverts = 0; + unsupverts = 0; + jettisoninverts = 0; + samples = 0l; + randomseed = 1l; + macheps = 0.0; + minfaceang = minfacetdihed = PI; + b_steinerflag = false; + + ptloc_count = ptloc_max_count = 0l; + orient3dcount = 0l; + inspherecount = insphere_sos_count = 0l; + flip14count = flip26count = flipn2ncount = 0l; + flip22count = 0l; + inserthullcount = 0l; + maxbowatcavsize = totalbowatcavsize = totaldeadtets = 0l; + across_face_count = across_edge_count = across_max_count = 0l; + maxcavsize = maxregionsize = 0l; + ndelaunayedgecount = cavityexpcount = 0l; + opt_tet_peels = opt_face_flips = opt_edge_flips = 0l; + + maxcavfaces = maxcavverts = 0; + abovecount = 0l; + bowatvolcount = bowatsubcount = bowatsegcount = 0l; + updvolcount = updsubcount = updsegcount = 0l; + outbowatcircumcount = 0l; + failvolcount = failsubcount = failsegcount = 0l; + r1count = r2count = r3count = 0l; + cdtenforcesegpts = 0l; + rejsegpts = rejsubpts = rejtetpts = 0l; + flip23s = flip32s = flip22s = flip44s = 0l; + } // tetgenmesh() + + ~tetgenmesh() + { + bgm = (tetgenmesh *) NULL; + in = (tetgenio *) NULL; + b = (tetgenbehavior *) NULL; + + if (tetrahedrons != (memorypool *) NULL) { + delete tetrahedrons; + } + if (subfaces != (memorypool *) NULL) { + delete subfaces; + } + if (subsegs != (memorypool *) NULL) { + delete subsegs; + } + if (points != (memorypool *) NULL) { + delete points; + } + if (tet2segpool != NULL) { + delete tet2segpool; + } + if (tet2subpool != NULL) { + delete tet2subpool; + } + if (dummytetbase != (tetrahedron *) NULL) { + delete [] dummytetbase; + } + if (dummyshbase != (shellface *) NULL) { + delete [] dummyshbase; + } + if (facetabovepointarray != (point *) NULL) { + delete [] facetabovepointarray; + } + if (dummypoint != NULL) { + delete [] dummypoint; + } + if (highordertable != (point *) NULL) { + delete [] highordertable; + } + if (subpbcgrouptable != (pbcdata *) NULL) { + delete [] subpbcgrouptable; + } + if (segpbcgrouptable != (list *) NULL) { + delete segpbcgrouptable; + delete [] idx2segpglist; + delete [] segpglist; + } + + if (cavetetlist != NULL) { + delete cavetetlist; + delete cavebdrylist; + delete caveoldtetlist; + } + if (subsegstack != NULL) { + delete subsegstack; + } + if (subfacstack != NULL) { + delete subfacstack; + } + } // ~tetgenmesh() + +}; // End of class tetgenmesh. + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetrahedralize() Interface for using TetGen's library to generate // +// Delaunay tetrahedralizations, constrained Delaunay // +// tetrahedralizations, quality tetrahedral meshes. // +// // +// 'in' is an object of 'tetgenio' which contains a PLC you want to tetrahed-// +// ralize or a previously generated tetrahedral mesh you want to refine. It // +// must not be a NULL. 'out' is another object of 'tetgenio' for storing the // +// generated tetrahedral mesh. It can be a NULL. If so, the output will be // +// saved to file(s). If 'bgmin' != NULL, it contains a background mesh which // +// defines a mesh size distruction function. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetrahedralize(tetgenbehavior *b, tetgenio *in, tetgenio *out, + tetgenio *addin = NULL, tetgenio *bgmin = NULL); + +#ifdef TETLIBRARY +void Standard_EXPORT tetrahedralize(char *switches, tetgenio *in, tetgenio *out, + tetgenio *addin = NULL, tetgenio *bgmin = NULL); +#endif // #ifdef TETLIBRARY + +/////////////////////////////////////////////////////////////////////////////// +// // +// terminatetetgen() Terminate TetGen with a given exit code. // +// // +/////////////////////////////////////////////////////////////////////////////// + +inline void terminatetetgen(int x) +{ +#ifdef TETLIBRARY + throw x; +#else + switch (x) { + case 1: // Out of memory. + printf("Error: Out of memory.\n"); + break; + case 2: // Encounter an internal error. + printf(" Please report this bug to sihang@mail.berlios.de. Include\n"); + printf(" the message above, your input data set, and the exact\n"); + printf(" command line you used to run this program, thank you.\n"); + break; + default: + printf("Program stopped.\n"); + } // switch (x) + exit(x); +#endif // #ifdef TETLIBRARY +} + + + +//qiu +//to avoid assertion to abort the program, which cause the SALOME to crash, +//we define a new assertion and just throw a make it exit + +#ifdef WIN32 +# define __ASSERT_VOID_CAST (void) +# define assert(expr) ((expr) ? __ASSERT_VOID_CAST(0) : throwExp()) + inline void throwExp(void) { +# ifdef TETLIBRARY + throw 11; +# else + exit(11); +# endif // #ifdef TETLIBRARY +} +#else //Linux +# define __ASSERT_VOID_CAST (void) + inline void __assert_fail (__const char *__assertion, __const char *__file, + unsigned int __line) + { + printf("An input error was detected. The following assertion failed.\n"); + printf(__assertion); + printf("; in file "); + printf(__file); + printf(", line %d",__line); + +# ifdef TETLIBRARY + throw 11; +# else + exit(11); +# endif // #ifdef TETLIBRARY + + } +# define assert(expr) \ + ((expr) \ + ? __ASSERT_VOID_CAST(0) \ + : __assert_fail (__STRING(expr), __FILE__, __LINE__)) +#endif + + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Geometric predicates // +// // +// Return one of the values +1, 0, and -1 on basic geometric questions such // +// as the orientation of point sets, in-circle, and in-sphere tests. They // +// are basic units for implmenting geometric algorithms. TetGen uses two 3D // +// geometric predicates: the orientation and in-sphere tests. // +// // +// Orientation test: let a, b, c be a sequence of 3 non-collinear points in // +// R^3. They defines a unique hypeplane H. Let H+ and H- be the two spaces // +// separated by H, which are defined as follows (using the left-hand rule): // +// make a fist using your left hand in such a way that your fingers follow // +// the order of a, b and c, then your thumb is pointing to H+. Given any // +// point d in R^3, the orientation test returns +1 if d lies in H+, -1 if d // +// lies in H-, or 0 if d lies on H. // +// // +// In-sphere test: let a, b, c, d be 4 non-coplanar points in R^3. They // +// defines a unique circumsphere S. Given any point e in R^3, the in-sphere // +// test returns +1 if e lies inside S, or -1 if e lies outside S, or 0 if e // +// lies on S. // +// // +// The following routines use arbitrary precision floating-point arithmetic. // +// They are provided by J. R. Schewchuk in public domain (http://www.cs.cmu. // +// edu/~quake/robust.html). The source code are in "predicates.cxx". // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL exactinit(); +REAL orient3d(REAL *pa, REAL *pb, REAL *pc, REAL *pd); +REAL insphere(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Inline functions of mesh data structures // +// // +/////////////////////////////////////////////////////////////////////////////// + +// Some macros for convenience + +#define Div2 >> 1 +#define Mod2 & 01 + +// NOTE: These bit operators should only be used in macros below. + +// Get orient(Range from 0 to 2) from face version(Range from 0 to 5). + +#define Orient(V) ((V) Div2) + +// Determine edge ring(0 or 1) from face version(Range from 0 to 5). + +#define EdgeRing(V) ((V) Mod2) + +// +// Begin of primitives for tetrahedra +// + +// Each tetrahedron contains four pointers to its neighboring tetrahedra, +// with face indices. To save memory, both information are kept in a +// single pointer. To make this possible, all tetrahedra are aligned to +// eight-byte boundaries, so that the last three bits of each pointer are +// zeros. A face index (in the range 0 to 3) is compressed into the last +// two bits of each pointer by the function 'encode()'. The function +// 'decode()' decodes a pointer, extracting a face index and a pointer to +// the beginning of a tetrahedron. + +inline void tetgenmesh::decode(tetrahedron ptr, triface& t) { + t.loc = (int) ((uintptr_t) (ptr) & (uintptr_t) 3); + t.tet = (tetrahedron *) ((uintptr_t) (ptr) & ~(uintptr_t) 7); +} + +inline tetgenmesh::tetrahedron tetgenmesh::encode(triface& t) { + return (tetrahedron) ((uintptr_t) t.tet | (uintptr_t) t.loc); +} + +// sym() finds the abutting tetrahedron on the same face. + +inline void tetgenmesh::sym(triface& t1, triface& t2) { + tetrahedron ptr = t1.tet[t1.loc]; + decode(ptr, t2); +} + +inline void tetgenmesh::symself(triface& t) { + tetrahedron ptr = t.tet[t.loc]; + decode(ptr, t); +} + +// Bond two tetrahedra together at their faces. + +inline void tetgenmesh::bond(triface& t1, triface& t2) { + t1.tet[t1.loc] = encode(t2); + t2.tet[t2.loc] = encode(t1); +} + +// Dissolve a bond (from one side). Note that the other tetrahedron will +// still think it is connected to this tetrahedron. Usually, however, +// the other tetrahedron is being deleted entirely, or bonded to another +// tetrahedron, so it doesn't matter. + +inline void tetgenmesh::dissolve(triface& t) { + t.tet[t.loc] = (tetrahedron) dummytet; +} + +// These primitives determine or set the origin, destination, apex or +// opposition of a tetrahedron with respect to 'loc' and 'ver'. + +inline tetgenmesh::point tetgenmesh::org(triface& t) { + return (point) t.tet[locver2org[t.loc][t.ver] + 4]; +} + +inline tetgenmesh::point tetgenmesh::dest(triface& t) { + return (point) t.tet[locver2dest[t.loc][t.ver] + 4]; +} + +inline tetgenmesh::point tetgenmesh::apex(triface& t) { + return (point) t.tet[locver2apex[t.loc][t.ver] + 4]; +} + +inline tetgenmesh::point tetgenmesh::oppo(triface& t) { + return (point) t.tet[loc2oppo[t.loc] + 4]; +} + +inline void tetgenmesh::setorg(triface& t, point pointptr) { + t.tet[locver2org[t.loc][t.ver] + 4] = (tetrahedron) pointptr; +} + +inline void tetgenmesh::setdest(triface& t, point pointptr) { + t.tet[locver2dest[t.loc][t.ver] + 4] = (tetrahedron) pointptr; +} + +inline void tetgenmesh::setapex(triface& t, point pointptr) { + t.tet[locver2apex[t.loc][t.ver] + 4] = (tetrahedron) pointptr; +} + +inline void tetgenmesh::setoppo(triface& t, point pointptr) { + t.tet[loc2oppo[t.loc] + 4] = (tetrahedron) pointptr; +} + +// These primitives were drived from Mucke's triangle-edge data structure +// to change face-edge relation in a tetrahedron (esym, enext and enext2) +// or between two tetrahedra (fnext). + +// If e0 = e(i, j), e1 = e(j, i), that is e0 and e1 are the two directions +// of the same undirected edge of a face. e0.sym() = e1 and vice versa. + +inline void tetgenmesh::esym(triface& t1, triface& t2) { + t2.tet = t1.tet; + t2.loc = t1.loc; + t2.ver = t1.ver + (EdgeRing(t1.ver) ? -1 : 1); +} + +inline void tetgenmesh::esymself(triface& t) { + t.ver += (EdgeRing(t.ver) ? -1 : 1); +} + +// If e0 and e1 are both in the same edge ring of a face, e1 = e0.enext(). + +inline void tetgenmesh::enext(triface& t1, triface& t2) { + t2.tet = t1.tet; + t2.loc = t1.loc; + t2.ver = ve[t1.ver]; +} + +inline void tetgenmesh::enextself(triface& t) { + t.ver = ve[t.ver]; +} + +// enext2() is equal to e2 = e0.enext().enext() + +inline void tetgenmesh::enext2(triface& t1, triface& t2) { + t2.tet = t1.tet; + t2.loc = t1.loc; + t2.ver = ve[ve[t1.ver]]; +} + +inline void tetgenmesh::enext2self(triface& t) { + t.ver = ve[ve[t.ver]]; +} + +// If f0 and f1 are both in the same face ring of a face, f1 = f0.fnext(). +// If f1 exists, return true. Otherwise, return false, i.e., f0 is a +// boundary or hull face. + +inline bool tetgenmesh::fnext(triface& t1, triface& t2) +{ + // Get the next face. + t2.loc = locver2nextf[t1.loc][t1.ver][0]; + // Is the next face in the same tet? + if (t2.loc != -1) { + // It's in the same tet. Get the edge version. + t2.ver = locver2nextf[t1.loc][t1.ver][1]; + t2.tet = t1.tet; + } else { + // The next face is in the neigbhour of 't1'. + sym(t1, t2); + if (t2.tet != dummytet) { + // Find the corresponding edge in t2. + point torg; + int tloc, tver, i; + t2.ver = 0; + torg = org(t1); + for (i = 0; (i < 3) && (org(t2) != torg); i++) { + enextself(t2); + } + // Go to the next face in t2. + tloc = t2.loc; + tver = t2.ver; + t2.loc = locver2nextf[tloc][tver][0]; + t2.ver = locver2nextf[tloc][tver][1]; + } + } + return t2.tet != dummytet; +} + +inline bool tetgenmesh::fnextself(triface& t1) +{ + triface t2; + + // Get the next face. + t2.loc = locver2nextf[t1.loc][t1.ver][0]; + // Is the next face in the same tet? + if (t2.loc != -1) { + // It's in the same tet. Get the edge version. + t2.ver = locver2nextf[t1.loc][t1.ver][1]; + t1.loc = t2.loc; + t1.ver = t2.ver; + } else { + // The next face is in the neigbhour of 't1'. + sym(t1, t2); + if (t2.tet != dummytet) { + // Find the corresponding edge in t2. + point torg; + int i; + t2.ver = 0; + torg = org(t1); + for (i = 0; (i < 3) && (org(t2) != torg); i++) { + enextself(t2); + } + t1.loc = locver2nextf[t2.loc][t2.ver][0]; + t1.ver = locver2nextf[t2.loc][t2.ver][1]; + t1.tet = t2.tet; + } + } + return t2.tet != dummytet; +} + +// Given a face t1, find the face f2 in the adjacent tet. If t2 is not +// a dummytet, then t1 and t2 refer to the same edge. Moreover, t2's +// edge must be in 0th edge ring, e.g., t2.ver is one of {0, 2, 4}. +// No matter what edge version t1 is. + +inline void tetgenmesh::symedge(triface& t1, triface& t2) +{ + decode(t1.tet[t1.loc], t2); + if (t2.tet != dummytet) { + // Search the edge of t1 in t2. + point tapex = apex(t1); + if ((point) (t2.tet[locver2apex[t2.loc][0] + 4]) == tapex) { + t2.ver = 0; + } else if ((point) (t2.tet[locver2apex[t2.loc][2] + 4]) == tapex) { + t2.ver = 2; + } else { + assert((point) (t2.tet[locver2apex[t2.loc][4] + 4]) == tapex); + t2.ver = 4; + } + } +} + +inline void tetgenmesh::symedgeself(triface& t) +{ + tetrahedron ptr; + point tapex; + + ptr = t.tet[t.loc]; + tapex = apex(t); + + decode(ptr, t); + if (t.tet != dummytet) { + // Search the edge of t1 in t2. + if ((point) (t.tet[locver2apex[t.loc][0] + 4]) == tapex) { + t.ver = 0; + } else if ((point) (t.tet[locver2apex[t.loc][2] + 4]) == tapex) { + t.ver = 2; + } else { + assert((point) (t.tet[locver2apex[t.loc][4] + 4]) == tapex); + t.ver = 4; + } + } +} + +// Given a face t1, find the next face t2 in the face ring, t1 and t2 +// are in two different tetrahedra. If the next face is a hull face, +// t2 is dummytet. + +inline void tetgenmesh::tfnext(triface& t1, triface& t2) +{ + int *iptr; + + if ((t1.ver & 1) == 0) { + t2.tet = t1.tet; + iptr = locver2nextf[t1.loc][t1.ver]; + t2.loc = iptr[0]; + t2.ver = iptr[1]; + symedgeself(t2); // t2.tet may be dummytet. + } else { + symedge(t1, t2); + if (t2.tet != dummytet) { + iptr = locver2nextf[t2.loc][t2.ver]; + t2.loc = iptr[0]; + t2.ver = iptr[1]; + } + } +} + +inline void tetgenmesh::tfnextself(triface& t) +{ + int *iptr; + + if ((t.ver & 1) == 0) { + iptr = locver2nextf[t.loc][t.ver]; + t.loc = iptr[0]; + t.ver = iptr[1]; + symedgeself(t); // t.tet may be dummytet. + } else { + symedgeself(t); + if (t.tet != dummytet) { + iptr = locver2nextf[t.loc][t.ver]; + t.loc = iptr[0]; + t.ver = iptr[1]; + } + } +} + +// enextfnext() and enext2fnext() are combination primitives of enext(), +// enext2() and fnext(). + +inline void tetgenmesh::enextfnext(triface& t1, triface& t2) { + enext(t1, t2); + fnextself(t2); +} + +inline void tetgenmesh::enextfnextself(triface& t) { + enextself(t); + fnextself(t); +} + +inline void tetgenmesh::enext2fnext(triface& t1, triface& t2) { + enext2(t1, t2); + fnextself(t2); +} + +inline void tetgenmesh::enext2fnextself(triface& t) { + enext2self(t); + fnextself(t); +} + +// Check or set a tetrahedron's attributes. + +inline REAL tetgenmesh::elemattribute(tetrahedron* ptr, int attnum) { + return ((REAL *) (ptr))[elemattribindex + attnum]; +} + +inline void tetgenmesh:: +setelemattribute(tetrahedron* ptr, int attnum, REAL value){ + ((REAL *) (ptr))[elemattribindex + attnum] = value; +} + +// Check or set a tetrahedron's maximum volume bound. + +inline REAL tetgenmesh::volumebound(tetrahedron* ptr) { + return ((REAL *) (ptr))[volumeboundindex]; +} + +inline void tetgenmesh::setvolumebound(tetrahedron* ptr, REAL value) { + ((REAL *) (ptr))[volumeboundindex] = value; +} + +// Check or set a tetrahedron's marker. + +inline int tetgenmesh::getelemmarker(tetrahedron* ptr) { + return ((int *) (ptr))[elemmarkerindex]; +} + +inline void tetgenmesh::setelemmarker(tetrahedron* ptr, int value) { + ((int *) (ptr))[elemmarkerindex] = value; +} + +// infect(), infected(), uninfect() -- primitives to flag or unflag a +// tetrahedron. The last bit of the element marker is flagged (1) +// or unflagged (0). + +inline void tetgenmesh::infect(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= (int) 1; +} + +inline void tetgenmesh::uninfect(triface& t) { + ((int *) (t.tet))[elemmarkerindex] &= ~(int) 1; +} + +// Test a tetrahedron for viral infection. + +inline bool tetgenmesh::infected(triface& t) { + return (((int *) (t.tet))[elemmarkerindex] & (int) 1) != 0; +} + +// marktest(), marktested(), unmarktest() -- primitives to flag or unflag a +// tetrahedron. The last second bit of the element marker is marked (1) +// or unmarked (0). +// One needs them in forming Bowyer-Watson cavity, to mark a tetrahedron if +// it has been checked (for Delaunay case) so later check can be avoided. + +inline void tetgenmesh::marktest(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= (int) 2; +} + +inline void tetgenmesh::unmarktest(triface& t) { + ((int *) (t.tet))[elemmarkerindex] &= ~(int) 2; +} + +inline bool tetgenmesh::marktested(triface& t) { + return (((int *) (t.tet))[elemmarkerindex] & (int) 2) != 0; +} + +// markface(), unmarkface(), facemarked() -- primitives to flag or unflag a +// face of a tetrahedron. From the last 3rd to 6th bits are used for +// face markers, e.g., the last third bit corresponds to loc = 0. +// One use of the face marker is in flip algorithm. Each queued face (check +// for locally Delaunay) is marked. + +inline void tetgenmesh::markface(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= (int) (4<<(t).loc); +} + +inline void tetgenmesh::unmarkface(triface& t) { + ((int *) (t.tet))[elemmarkerindex] &= ~(int) (4<<(t).loc); +} + +inline bool tetgenmesh::facemarked(triface& t) { + return (((int *) (t.tet))[elemmarkerindex] & (int) (4<<(t).loc)) != 0; +} + +// markedge(), unmarkedge(), edgemarked() -- primitives to flag or unflag an +// edge of a tetrahedron. From the last 7th to 12th bits are used for +// edge markers, e.g., the last 7th bit corresponds to the 0th edge, etc. +// Remark: The last 7th bit is marked by 2^6 = 64. + +inline void tetgenmesh::markedge(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= + (int) (64<> (int) 2; + // return ((int *) (s.sh))[shmarkindex]; +} + +inline void tetgenmesh::setshellmark(face& s, int value) { + ((int *) ((s).sh))[shmarkindex] = (value << (int) 2) + + ((((int *) ((s).sh))[shmarkindex]) & (int) 3); + // ((int *) (s.sh))[shmarkindex] = value; +} + +// These two primitives set or read the type of the subface or subsegment. + +inline enum tetgenmesh::shestype tetgenmesh::shelltype(face& s) { + return (enum shestype) ((int *) (s.sh))[shmarkindex + 1]; +} + +inline void tetgenmesh::setshelltype(face& s, enum shestype value) { + ((int *) (s.sh))[shmarkindex + 1] = (int) value; +} + +// These two primitives set or read the pbc group of the subface. + +inline int tetgenmesh::shellpbcgroup(face& s) { + return ((int *) (s.sh))[shmarkindex + 2]; +} + +inline void tetgenmesh::setshellpbcgroup(face& s, int value) { + ((int *) (s.sh))[shmarkindex + 2] = value; +} + +// sinfect(), sinfected(), suninfect() -- primitives to flag or unflag a +// subface. The last bit of ((int *) ((s).sh))[shmarkindex] is flaged. + +inline void tetgenmesh::sinfect(face& s) { + ((int *) ((s).sh))[shmarkindex] = + (((int *) ((s).sh))[shmarkindex] | (int) 1); + // s.sh[6] = (shellface) ((unsigned long) s.sh[6] | (unsigned long) 4l); +} + +inline void tetgenmesh::suninfect(face& s) { + ((int *) ((s).sh))[shmarkindex] = + (((int *) ((s).sh))[shmarkindex] & ~(int) 1); + // s.sh[6] = (shellface)((unsigned long) s.sh[6] & ~(unsigned long) 4l); +} + +// Test a subface for viral infection. + +inline bool tetgenmesh::sinfected(face& s) { + return (((int *) ((s).sh))[shmarkindex] & (int) 1) != 0; +} + +// smarktest(), smarktested(), sunmarktest() -- primitives to flag or unflag +// a subface. The last 2nd bit of ((int *) ((s).sh))[shmarkindex] is flaged. + +#define smarktest(s) \ + ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] | (int) 2) + +#define sunmarktest(s) \ + ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] & ~(int) 2) + +#define smarktested(s) ((((int *) ((s).sh))[shmarkindex] & (int) 2) != 0) + +// +// End of primitives for subfaces/subsegments +// + +// +// Begin of primitives for interacting between tetrahedra and subfaces +// + +// tspivot() finds a subface abutting on this tetrahdera. + +inline void tetgenmesh::tspivot(triface& t, face& s) { + if ((t).tet[9] != NULL) { + sdecode(((shellface *) (t).tet[9])[(t).loc], s); + } else { + (s).sh = dummysh; + } + //shellface sptr = (shellface) t.tet[8 + t.loc]; + //sdecode(sptr, s); +} + +// stpivot() finds a tetrahedron abutting a subface. + +inline void tetgenmesh::stpivot(face& s, triface& t) { + tetrahedron ptr = (tetrahedron) s.sh[6 + EdgeRing(s.shver)]; + decode(ptr, t); +} + +// tsbond() bond a tetrahedron to a subface. + +inline void tetgenmesh::tsbond(triface& t, face& s) { + if ((t).tet[9] == NULL) { + // Allocate space for this tet. + (t).tet[9] = (tetrahedron) tet2subpool->alloc(); + // NULL all fields in this space. + for (int i = 0; i < 4; i++) { + ((shellface *) (t).tet[9])[i] = (shellface) dummysh; + } + } + // Bond t <==> s. + ((shellface *) (t).tet[9])[(t).loc] = sencode(s); + //t.tet[8 + t.loc] = (tetrahedron) sencode(s); + s.sh[6 + EdgeRing(s.shver)] = (shellface) encode(t); +} + +// tsdissolve() dissolve a bond (from the tetrahedron side). + +inline void tetgenmesh::tsdissolve(triface& t) { + if ((t).tet[9] != NULL) { + ((shellface *) (t).tet[9])[(t).loc] = (shellface) dummysh; + } + // t.tet[8 + t.loc] = (tetrahedron) dummysh; +} + +// stdissolve() dissolve a bond (from the subface side). + +inline void tetgenmesh::stdissolve(face& s) { + s.sh[6 + EdgeRing(s.shver)] = (shellface) dummytet; +} + +// +// End of primitives for interacting between tetrahedra and subfaces +// + +// +// Begin of primitives for interacting between subfaces and subsegs +// + +// sspivot() finds a subsegment abutting a subface. + +inline void tetgenmesh::sspivot(face& s, face& edge) { + shellface sptr = (shellface) s.sh[8 + Orient(s.shver)]; + sdecode(sptr, edge); +} + +// ssbond() bond a subface to a subsegment. + +inline void tetgenmesh::ssbond(face& s, face& edge) { + s.sh[8 + Orient(s.shver)] = sencode(edge); + edge.sh[0] = sencode(s); +} + +// ssdisolve() dissolve a bond (from the subface side) + +inline void tetgenmesh::ssdissolve(face& s) { + s.sh[8 + Orient(s.shver)] = (shellface) dummysh; +} + +// +// End of primitives for interacting between subfaces and subsegs +// + +// +// Begin of primitives for interacting between tet and subsegs. +// + +inline void tetgenmesh::tsspivot1(triface& t, face& s) +{ + if ((t).tet[8] != NULL) { + sdecode(((shellface *) (t).tet[8])[locver2edge[(t).loc][(t).ver]], s); + } else { + (s).sh = dummysh; + } + // shellface sptr = (shellface) t.tet[8 + locver2edge[t.loc][t.ver]]; + // sdecode(sptr, seg); +} + +// Only bond/dissolve at tet's side, but not vice versa. + +inline void tetgenmesh::tssbond1(triface& t, face& s) +{ + if ((t).tet[8] == NULL) { + // Allocate space for this tet. + (t).tet[8] = (tetrahedron) tet2segpool->alloc(); + // NULL all fields in this space. + for (int i = 0; i < 6; i++) { + ((shellface *) (t).tet[8])[i] = (shellface) dummysh; + } + } + // Bond the segment. + ((shellface *) (t).tet[8])[locver2edge[(t).loc][(t).ver]] = sencode((s)); + // t.tet[8 + locver2edge[t.loc][t.ver]] = (tetrahedron) sencode(seg); +} + +inline void tetgenmesh::tssdissolve1(triface& t) +{ + if ((t).tet[8] != NULL) { + ((shellface *) (t).tet[8])[locver2edge[(t).loc][(t).ver]] + = (shellface) dummysh; + } + // t.tet[8 + locver2edge[t.loc][t.ver]] = (tetrahedron) dummysh; +} + +// +// End of primitives for interacting between tet and subsegs. +// + +// +// Begin of primitives for points +// + +inline int tetgenmesh::pointmark(point pt) { + return ((int *) (pt))[pointmarkindex]; +} + +inline void tetgenmesh::setpointmark(point pt, int value) { + ((int *) (pt))[pointmarkindex] = value; +} + +// These two primitives set and read the type of the point. +// The last significant bit of this integer is used by pinfect/puninfect. + +inline enum tetgenmesh::verttype tetgenmesh::pointtype(point pt) { + return (enum verttype) (((int *) (pt))[pointmarkindex + 1] >> (int) 1); +} + +inline void tetgenmesh::setpointtype(point pt, enum verttype value) { + ((int *) (pt))[pointmarkindex + 1] = + ((int) value << 1) + (((int *) (pt))[pointmarkindex + 1] & (int) 1); +} + +// pinfect(), puninfect(), pinfected() -- primitives to flag or unflag +// a point. The last bit of the integer '[pointindex+1]' is flaged. + +inline void tetgenmesh::pinfect(point pt) { + ((int *) (pt))[pointmarkindex + 1] |= (int) 1; +} + +inline void tetgenmesh::puninfect(point pt) { + ((int *) (pt))[pointmarkindex + 1] &= ~(int) 1; +} + +inline bool tetgenmesh::pinfected(point pt) { + return (((int *) (pt))[pointmarkindex + 1] & (int) 1) != 0; +} + +// These following primitives set and read a pointer to a tetrahedron +// a subface/subsegment, a point, or a tet of background mesh. + +inline tetgenmesh::tetrahedron tetgenmesh::point2tet(point pt) { + return ((tetrahedron *) (pt))[point2simindex]; +} + +inline void tetgenmesh::setpoint2tet(point pt, tetrahedron value) { + ((tetrahedron *) (pt))[point2simindex] = value; +} + +inline tetgenmesh::shellface tetgenmesh::point2sh(point pt) { + return (shellface) ((tetrahedron *) (pt))[point2simindex + 1]; +} + +inline void tetgenmesh::setpoint2sh(point pt, shellface value) { + ((tetrahedron *) (pt))[point2simindex + 1] = (tetrahedron) value; +} + +inline tetgenmesh::shellface tetgenmesh::point2seg(point pt) { + return (shellface) ((tetrahedron *) (pt))[point2simindex + 2]; +} + +inline void tetgenmesh::setpoint2seg(point pt, shellface value) { + ((tetrahedron *) (pt))[point2simindex + 2] = (tetrahedron) value; +} + +inline tetgenmesh::point tetgenmesh::point2ppt(point pt) { + return (point) ((tetrahedron *) (pt))[point2simindex + 3]; +} + +inline void tetgenmesh::setpoint2ppt(point pt, point value) { + ((tetrahedron *) (pt))[point2simindex + 3] = (tetrahedron) value; +} + +inline tetgenmesh::tetrahedron tetgenmesh::point2bgmtet(point pt) { + return ((tetrahedron *) (pt))[point2simindex + 4]; +} + +inline void tetgenmesh::setpoint2bgmtet(point pt, tetrahedron value) { + ((tetrahedron *) (pt))[point2simindex + 4] = value; +} + +// These primitives set and read a pointer to its pbc point. + +inline tetgenmesh::point tetgenmesh::point2pbcpt(point pt) { + return (point) ((tetrahedron *) (pt))[point2pbcptindex]; +} + +inline void tetgenmesh::setpoint2pbcpt(point pt, point value) { + ((tetrahedron *) (pt))[point2pbcptindex] = (tetrahedron) value; +} + +// +// End of primitives for points +// + +// +// Begin of advanced primitives +// + +// adjustedgering() adjusts the edge version so that it belongs to the +// indicated edge ring. The 'direction' only can be 0(CCW) or 1(CW). +// If the edge is not in the wanted edge ring, reverse it. + +inline void tetgenmesh::adjustedgering(triface& t, int direction) { + if (EdgeRing(t.ver) != direction) { + esymself(t); + } +} + +inline void tetgenmesh::adjustedgering(face& s, int direction) { + if (EdgeRing(s.shver) != direction) { + sesymself(s); + } +} + +// isdead() returns TRUE if the tetrahedron or subface has been dealloced. + +inline bool tetgenmesh::isdead(triface* t) { + if (t->tet == (tetrahedron *) NULL) return true; + else return t->tet[4] == (tetrahedron) NULL; +} + +inline bool tetgenmesh::isdead(face* s) { + if (s->sh == (shellface *) NULL) return true; + else return s->sh[3] == (shellface) NULL; +} + +// isfacehaspoint() returns TRUE if the 'testpoint' is one of the vertices +// of the tetface 't' subface 's'. + +inline bool tetgenmesh::isfacehaspoint(triface* t, point testpoint) { + return ((org(*t) == testpoint) || (dest(*t) == testpoint) || + (apex(*t) == testpoint)); +} + +inline bool tetgenmesh::isfacehaspoint(face* s, point testpoint) { + return (s->sh[3] == (shellface) testpoint) || + (s->sh[4] == (shellface) testpoint) || + (s->sh[5] == (shellface) testpoint); +} + +// isfacehasedge() returns TRUE if the edge (given by its two endpoints) is +// one of the three edges of the subface 's'. + +inline bool tetgenmesh::isfacehasedge(face* s, point tend1, point tend2) { + return (isfacehaspoint(s, tend1) && isfacehaspoint(s, tend2)); +} + +// issymexist() returns TRUE if the adjoining tetrahedron is not 'duumytet'. + +inline bool tetgenmesh::issymexist(triface* t) { + tetrahedron *ptr = (tetrahedron *) + ((unsigned long)(t->tet[t->loc]) & ~(unsigned long)7l); + return ptr != dummytet; +} + +// dot() returns the dot product: v1 dot v2. + +inline REAL tetgenmesh::dot(REAL* v1, REAL* v2) +{ + return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; +} + +// cross() computes the cross product: n = v1 cross v2. + +inline void tetgenmesh::cross(REAL* v1, REAL* v2, REAL* n) +{ + n[0] = v1[1] * v2[2] - v2[1] * v1[2]; + n[1] = -(v1[0] * v2[2] - v2[0] * v1[2]); + n[2] = v1[0] * v2[1] - v2[0] * v1[1]; +} + +// distance() computs the Euclidean distance between two points. +inline REAL tetgenmesh::distance(REAL* p1, REAL* p2) +{ + return sqrt((p2[0] - p1[0]) * (p2[0] - p1[0]) + + (p2[1] - p1[1]) * (p2[1] - p1[1]) + + (p2[2] - p1[2]) * (p2[2] - p1[2])); +} + +// Linear algebra operators. + +#define NORM2(x, y, z) ((x) * (x) + (y) * (y) + (z) * (z)) + +#define DIST(p1, p2) \ + sqrt(NORM2((p2)[0] - (p1)[0], (p2)[1] - (p1)[1], (p2)[2] - (p1)[2])) + +#define DOT(v1, v2) \ + ((v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2]) + +#define CROSS(v1, v2, n) \ + (n)[0] = (v1)[1] * (v2)[2] - (v2)[1] * (v1)[2];\ + (n)[1] = -((v1)[0] * (v2)[2] - (v2)[0] * (v1)[2]);\ + (n)[2] = (v1)[0] * (v2)[1] - (v2)[0] * (v1)[1] + +#define SETVECTOR3(V, a0, a1, a2) (V)[0] = (a0); (V)[1] = (a1); (V)[2] = (a2) + +#define SWAP2(a0, a1, tmp) (tmp) = (a0); (a0) = (a1); (a1) = (tmp) + +/////////////////////////////////////////////////////////////////////////////// +// // +// Two inline functions used in read/write VTK files. // +// // +/////////////////////////////////////////////////////////////////////////////// + +inline void swapBytes(unsigned char* var, int size) +{ + int i = 0; + int j = size - 1; + char c; + + while (i < j) { + c = var[i]; var[i] = var[j]; var[j] = c; + i++, j--; + } +} + +inline bool testIsBigEndian() +{ + short word = 0x4321; + if((*(char *)& word) != 0x21) + return true; + else + return false; +} + +#endif // #ifndef tetgenH diff --git a/src/TETGEN/tetgen.h.original b/src/TETGEN/tetgen.h.original new file mode 100644 index 0000000..69f4a21 --- /dev/null +++ b/src/TETGEN/tetgen.h.original @@ -0,0 +1,3431 @@ +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen // +// // +// A Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator // +// // +// Version 1.4 // +// September 6, December 13, 2010 // +// January 19, 2011 // +// // +// Copyright (C) 2002--2011 // +// Hang Si // +// Research Group: Numerical Mathematics and Scientific Computing // +// Weierstrass Institute for Applied Analysis and Stochastics (WIAS) // +// Mohrenstr. 39, 10117 Berlin, Germany // +// si@wias-berlin.de // +// // +// TetGen is freely available through the website: http://tetgen.berlios.de. // +// It may be copied, modified, and redistributed for non-commercial use. // +// Please consult the file LICENSE for the detailed copyright notices. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen is a library to generate tetrahedral meshes for 3D domains. It's // +// main purpose is to generate suitable tetrahedral meshes for numerical // +// simulations using finite element and finite volume methods. // +// // +// TetGen incorporates a suit of geometrical and mesh generation algorithms. // +// A brief description of algorithms used in TetGen is found in the first // +// section of the user's manual. References are given for users who are // +// interesting in these approaches. The main references are given below: // +// // +// The efficient Delaunay tetrahedralization algorithm is: H. Edelsbrunner // +// and N. R. Shah, "Incremental Topological Flipping Works for Regular // +// Triangulations". Algorithmica 15: 223--241, 1996. // +// // +// The constrained Delaunay tetrahedralization algorithm is described in: // +// H. Si and K. Gaertner, "Meshing Piecewise Linear Complexes by Constr- // +// ained Delaunay Tetrahedralizations". In Proceeding of the 14th Inter- // +// national Meshing Roundtable. September 2005. // +// // +// The mesh refinement algorithm is from: Hang Si, "Adaptive Tetrahedral // +// Mesh Generation by Constrained Delaunay Refinement". International // +// Journal for Numerical Methods in Engineering, 75(7): 856--880, 2008. // +// // +// The mesh data structure of TetGen is a combination of two types of mesh // +// data structures. The tetrahedron-based mesh data structure introduced // +// by Shewchuk is eligible for tetrahedralization algorithms. The triangle // +// -edge data structure developed by Muecke is adopted for representing // +// boundary elements: subfaces and subsegments. // +// // +// J. R. Shewchuk, "Delaunay Refinement Mesh Generation". PhD thesis, // +// Carnegie Mellon University, Pittsburgh, PA, 1997. // +// // +// E. P. Muecke, "Shapes and Implementations in Three-Dimensional // +// Geometry". PhD thesis, Univ. of Illinois, Urbana, Illinois, 1993. // +// // +// The research of mesh generation is definitly on the move. Many State-of- // +// the-art algorithms need implementing and evaluating. I heartily welcome // +// any new algorithm especially for generating quality conforming Delaunay // +// meshes and anisotropic conforming Delaunay meshes. // +// // +// TetGen is supported by the "pdelib" project of Weierstrass Institute for // +// Applied Analysis and Stochastics (WIAS) in Berlin. It is a collection // +// of software components for solving non-linear partial differential // +// equations including 2D and 3D mesh generators, sparse matrix solvers, // +// and scientific visualization tools, etc. For more information please // +// visit: http://www.wias-berlin.de/software/pdelib. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetgen.h // +// // +// Header file of the TetGen library. Also is the user-level header file. // +// // +/////////////////////////////////////////////////////////////////////////////// + +#ifndef tetgenH +#define tetgenH + +#include +#include +#include +#include +#include +#include + +// The types 'intptr_t' and 'uintptr_t' are signed and unsigned integer types, +// respectively. They are guaranteed to be the same width as a pointer. +// They are defined in by the C99 Standard. +// However, Microsoft Visual C++ doesn't ship with this header file yet. We +// need to define them. (Thanks to Steven G. Johnson from MIT for the +// following piece of code.) + +// Define the _MSC_VER symbol if you are using Microsoft Visual C++. + +// #define _MSC_VER + +// Define the _WIN64 symbol if you are running TetGen on Win64. + +// #define _WIN64 + +#ifdef _MSC_VER // Microsoft Visual C++ +# ifdef _WIN64 + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +# else // not _WIN64 + typedef int intptr_t; + typedef unsigned int uintptr_t; +# endif +#else // not Visual C++ +# include +#endif + +// To compile TetGen as a library instead of an executable program, define +// the TETLIBRARY symbol. + +// #define TETLIBRARY + +// Uncomment the following line to disable assert macros. These macros are +// inserted in places where I hope to catch bugs. + +// #define NDEBUG + +// To insert lots of self-checks for internal errors, define the SELF_CHECK +// symbol. This will slow down the program a bit. + +// #define SELF_CHECK + +// For single precision ( which will save some memory and reduce paging ), +// define the symbol SINGLE by using the -DSINGLE compiler switch or by +// writing "#define SINGLE" below. +// +// For double precision ( which will allow you to refine meshes to a smaller +// edge length), leave SINGLE undefined. + +// #define SINGLE + +#ifdef SINGLE + #define REAL float +#else + #define REAL double +#endif // not defined SINGLE + +/////////////////////////////////////////////////////////////////////////////// +// // +// TetGen Library Overview // +// // +// TetGen library is comprised by several data types and global functions. // +// // +// There are three main data types: tetgenio, tetgenbehavior, and tetgenmesh.// +// Tetgenio is used to pass data into and out of TetGen library; tetgenbeha- // +// vior keeps the runtime options and thus controls the behaviors of TetGen; // +// tetgenmesh, the biggest data type I've ever defined, contains mesh data // +// structures and mesh traversing and transformation operators. The meshing // +// algorithms are implemented on top of it. These data types are defined as // +// C++ classes. // +// // +// There are few global functions. tetrahedralize() is provided for calling // +// TetGen from another program. Two functions: orient3d() and insphere() are // +// incorporated from a public C code provided by Shewchuk. They performing // +// exact geometrical tests. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class tetgenio // +// // +// The interface for passing data into and out of the library of TetGen. // +// // +// The tetgenio data structure is actually a collection of arrays of points, // +// facets, tetrahedra, and so forth. The library will read and write these // +// arrays according to the options specified in tetgenbehavior structure. // +// // +// If you want to program with the library of TetGen, it's necessary for you // +// to understand this data type,while the other two structures can be hidden // +// through calling the global function "tetrahedralize()". Each array corre- // +// sponds to a list of data in the file formats of TetGen. It is necessary // +// to understand TetGen's input/output file formats (see user's manual). // +// // +// Once an object of tetgenio is declared, no array is created. One has to // +// allocate enough memory for them, e.g., use the "new" operator in C++. On // +// deletion of the object, the memory occupied by these arrays needs to be // +// freed. Routine deinitialize() will be automatically called. It will de- // +// allocate the memory for an array if it is not a NULL. However, it assumes // +// that the memory is allocated by the C++ "new" operator. If you use malloc // +// (), you should free() them and set the pointers to NULLs before reaching // +// deinitialize(). // +// // +// tetgenio ontains routines for reading and writing TetGen's files, i.e., // +// .node, .poly, .smesh, .ele, .face, and .edge files. Both the library of // +// TetGen and TetView use these routines to process input files. // +// // +/////////////////////////////////////////////////////////////////////////////// + +class tetgenio { + + public: + + // Maximum number of characters in a file name (including the null). + enum {FILENAMESIZE = 1024}; + + // Maxi. numbers of chars in a line read from a file (incl. the null). + enum {INPUTLINESIZE = 1024}; + + // The polygon data structure. A "polygon" describes a simple polygon + // (no holes). It is not necessarily convex. Each polygon contains a + // number of corners (points) and the same number of sides (edges). + // Note that the points of the polygon must be given in either counter- + // clockwise or clockwise order and they form a ring, so every two + // consective points forms an edge of the polygon. + typedef struct { + int *vertexlist; + int numberofvertices; + } polygon; + + static void init(polygon* p) { + p->vertexlist = (int *) NULL; + p->numberofvertices = 0; + } + + // The facet data structure. A "facet" describes a facet. Each facet is + // a polygonal region possibly with holes, edges, and points in it. + typedef struct { + polygon *polygonlist; + int numberofpolygons; + REAL *holelist; + int numberofholes; + } facet; + + static void init(facet* f) { + f->polygonlist = (polygon *) NULL; + f->numberofpolygons = 0; + f->holelist = (REAL *) NULL; + f->numberofholes = 0; + } + + // A 'voroedge' is an edge of the Voronoi diagram. It corresponds to a + // Delaunay face. Each voroedge is either a line segment connecting + // two Voronoi vertices or a ray starting from a Voronoi vertex to an + // "infinite vertex". 'v1' and 'v2' are two indices pointing to the + // list of Voronoi vertices. 'v1' must be non-negative, while 'v2' may + // be -1 if it is a ray, in this case, the unit normal of this ray is + // given in 'vnormal'. + typedef struct { + int v1, v2; + REAL vnormal[3]; + } voroedge; + + // A 'vorofacet' is an facet of the Voronoi diagram. It corresponds to a + // Delaunay edge. Each Voronoi facet is a convex polygon formed by a + // list of Voronoi edges, it may not be closed. 'c1' and 'c2' are two + // indices pointing into the list of Voronoi cells, i.e., the two cells + // share this facet. 'elist' is an array of indices pointing into the + // list of Voronoi edges, 'elist[0]' saves the number of Voronoi edges + // (including rays) of this facet. + typedef struct { + int c1, c2; + int *elist; + } vorofacet; + + // The periodic boundary condition group data structure. A "pbcgroup" + // contains the definition of a pbc and the list of pbc point pairs. + // 'fmark1' and 'fmark2' are the facetmarkers of the two pbc facets f1 + // and f2, respectively. 'transmat' is the transformation matrix which + // maps a point in f1 into f2. An array of pbc point pairs are saved + // in 'pointpairlist'. The first point pair is at indices [0] and [1], + // followed by remaining pairs. Two integers per pair. + typedef struct { + int fmark1, fmark2; + REAL transmat[4][4]; + int numberofpointpairs; + int *pointpairlist; + } pbcgroup; + + // A callback function for mesh refinement. + typedef bool (* TetSizeFunc)(REAL*, REAL*, REAL*, REAL*, REAL*, REAL); + + // Items are numbered starting from 'firstnumber' (0 or 1), default is 0. + int firstnumber; + + // Dimension of the mesh (2 or 3), default is 3. + int mesh_dim; + + // Does the lines in .node file contain index or not, default is TRUE. + bool useindex; + + // 'pointlist': An array of point coordinates. The first point's x + // coordinate is at index [0] and its y coordinate at index [1], its + // z coordinate is at index [2], followed by the coordinates of the + // remaining points. Each point occupies three REALs. + // 'pointattributelist': An array of point attributes. Each point's + // attributes occupy 'numberofpointattributes' REALs. + // 'pointmtrlist': An array of metric tensors at points. Each point's + // tensor occupies 'numberofpointmtr' REALs. + // `pointmarkerlist': An array of point markers; one int per point. + REAL *pointlist; + REAL *pointattributelist; + REAL *pointmtrlist; + int *pointmarkerlist; + int numberofpoints; + int numberofpointattributes; + int numberofpointmtrs; + + // `elementlist': An array of element (triangle or tetrahedron) corners. + // The first element's first corner is at index [0], followed by its + // other corners in counterclockwise order, followed by any other + // nodes if the element represents a nonlinear element. Each element + // occupies `numberofcorners' ints. + // `elementattributelist': An array of element attributes. Each + // element's attributes occupy `numberofelementattributes' REALs. + // `elementconstraintlist': An array of constraints, i.e. triangle's + // area or tetrahedron's volume; one REAL per element. Input only. + // `neighborlist': An array of element neighbors; 3 or 4 ints per + // element. Output only. + int *tetrahedronlist; + REAL *tetrahedronattributelist; + REAL *tetrahedronvolumelist; + int *neighborlist; + int numberoftetrahedra; + int numberofcorners; + int numberoftetrahedronattributes; + + // `facetlist': An array of facets. Each entry is a structure of facet. + // `facetmarkerlist': An array of facet markers; one int per facet. + facet *facetlist; + int *facetmarkerlist; + int numberoffacets; + + // `holelist': An array of holes. The first hole's x, y and z + // coordinates are at indices [0], [1] and [2], followed by the + // remaining holes. Three REALs per hole. + REAL *holelist; + int numberofholes; + + // `regionlist': An array of regional attributes and volume constraints. + // The first constraint's x, y and z coordinates are at indices [0], + // [1] and [2], followed by the regional attribute at index [3], foll- + // owed by the maximum volume at index [4]. Five REALs per constraint. + // Note that each regional attribute is used only if you select the `A' + // switch, and each volume constraint is used only if you select the + // `a' switch (with no number following). + REAL *regionlist; + int numberofregions; + + // `facetconstraintlist': An array of facet maximal area constraints. + // Two REALs per constraint. The first (at index [0]) is the facet + // marker (cast it to int), the second (at index [1]) is its maximum + // area bound. + REAL *facetconstraintlist; + int numberoffacetconstraints; + + // `segmentconstraintlist': An array of segment max. length constraints. + // Three REALs per constraint. The first two (at indcies [0] and [1]) + // are the indices of the endpoints of the segment, the third (at index + // [2]) is its maximum length bound. + REAL *segmentconstraintlist; + int numberofsegmentconstraints; + + // 'pbcgrouplist': An array of periodic boundary condition groups. + pbcgroup *pbcgrouplist; + int numberofpbcgroups; + + // `trifacelist': An array of triangular face endpoints. The first + // face's endpoints are at indices [0], [1] and [2], followed by the + // remaining faces. Three ints per face. + // `adjtetlist': An array of adjacent tetrahedra to the faces of + // trifacelist. Each face has at most two adjacent tets, the first + // face's adjacent tets are at [0], [1]. Two ints per face. A '-1' + // indicates outside (no adj. tet). This list is output when '-nn' + // switch is used. + // `trifacemarkerlist': An array of face markers; one int per face. + int *trifacelist; + int *adjtetlist; + int *trifacemarkerlist; + int numberoftrifaces; + + // `edgelist': An array of edge endpoints. The first edge's endpoints + // are at indices [0] and [1], followed by the remaining edges. Two + // ints per edge. + // `edgemarkerlist': An array of edge markers; one int per edge. + int *edgelist; + int *edgemarkerlist; + int numberofedges; + + // 'vpointlist': An array of Voronoi vertex coordinates (like pointlist). + // 'vedgelist': An array of Voronoi edges. Each entry is a 'voroedge'. + // 'vfacetlist': An array of Voronoi facets. Each entry is a 'vorofacet'. + // 'vcelllist': An array of Voronoi cells. Each entry is an array of + // indices pointing into 'vfacetlist'. The 0th entry is used to store + // the length of this array. + REAL *vpointlist; + voroedge *vedgelist; + vorofacet *vfacetlist; + int **vcelllist; + int numberofvpoints; + int numberofvedges; + int numberofvfacets; + int numberofvcells; + + // A callback function. + TetSizeFunc tetunsuitable; + + // Input & output routines. + bool load_node_call(FILE* infile, int markers, char* nodefilename); + bool load_node(char* filebasename); + bool load_var(char*); + bool load_mtr(char*); + bool load_poly(char*); + bool load_pbc(char*); + bool load_off(char*); + bool load_ply(char*); + bool load_stl(char*); + bool load_medit(char*); + bool load_vtk(char*); + bool load_plc(char*, int); + bool load_tetmesh(char*); + void save_nodes(char*); + void save_elements(char*); + void save_faces(char*); + void save_edges(char*); + void save_neighbors(char*); + void save_poly(char*); + + // Read line and parse string functions. + char *readline(char* string, FILE* infile, int *linenumber); + char *findnextfield(char* string); + char *readnumberline(char* string, FILE* infile, char* infilename); + char *findnextnumber(char* string); + + // Initialize routine. + void initialize() + { + firstnumber = 0; // Default item index is numbered from Zero. + mesh_dim = 3; // Default mesh dimension is 3. + useindex = true; + + pointlist = (REAL *) NULL; + pointattributelist = (REAL *) NULL; + pointmtrlist = (REAL *) NULL; + pointmarkerlist = (int *) NULL; + numberofpoints = 0; + numberofpointattributes = 0; + numberofpointmtrs = 0; + + tetrahedronlist = (int *) NULL; + tetrahedronattributelist = (REAL *) NULL; + tetrahedronvolumelist = (REAL *) NULL; + neighborlist = (int *) NULL; + numberoftetrahedra = 0; + numberofcorners = 4; // Default is 4 nodes per element. + numberoftetrahedronattributes = 0; + + trifacelist = (int *) NULL; + adjtetlist = (int *) NULL; + trifacemarkerlist = (int *) NULL; + numberoftrifaces = 0; + + facetlist = (facet *) NULL; + facetmarkerlist = (int *) NULL; + numberoffacets = 0; + + edgelist = (int *) NULL; + edgemarkerlist = (int *) NULL; + numberofedges = 0; + + holelist = (REAL *) NULL; + numberofholes = 0; + + regionlist = (REAL *) NULL; + numberofregions = 0; + + facetconstraintlist = (REAL *) NULL; + numberoffacetconstraints = 0; + segmentconstraintlist = (REAL *) NULL; + numberofsegmentconstraints = 0; + + pbcgrouplist = (pbcgroup *) NULL; + numberofpbcgroups = 0; + + vpointlist = (REAL *) NULL; + vedgelist = (voroedge *) NULL; + vfacetlist = (vorofacet *) NULL; + vcelllist = (int **) NULL; + numberofvpoints = 0; + numberofvedges = 0; + numberofvfacets = 0; + numberofvcells = 0; + + tetunsuitable = NULL; + } + + // Free the memory allocated in 'tetgenio'. + void deinitialize() + { + facet *f; + polygon *p; + pbcgroup *pg; + int i, j; + + // This routine assumes that the memory was allocated by + // C++ memory allocation operator 'new'. + + if (pointlist != (REAL *) NULL) { + delete [] pointlist; + } + if (pointattributelist != (REAL *) NULL) { + delete [] pointattributelist; + } + if (pointmtrlist != (REAL *) NULL) { + delete [] pointmtrlist; + } + if (pointmarkerlist != (int *) NULL) { + delete [] pointmarkerlist; + } + + if (tetrahedronlist != (int *) NULL) { + delete [] tetrahedronlist; + } + if (tetrahedronattributelist != (REAL *) NULL) { + delete [] tetrahedronattributelist; + } + if (tetrahedronvolumelist != (REAL *) NULL) { + delete [] tetrahedronvolumelist; + } + if (neighborlist != (int *) NULL) { + delete [] neighborlist; + } + + if (trifacelist != (int *) NULL) { + delete [] trifacelist; + } + if (adjtetlist != (int *) NULL) { + delete [] adjtetlist; + } + if (trifacemarkerlist != (int *) NULL) { + delete [] trifacemarkerlist; + } + + if (edgelist != (int *) NULL) { + delete [] edgelist; + } + if (edgemarkerlist != (int *) NULL) { + delete [] edgemarkerlist; + } + + if (facetlist != (facet *) NULL) { + for (i = 0; i < numberoffacets; i++) { + f = &facetlist[i]; + for (j = 0; j < f->numberofpolygons; j++) { + p = &f->polygonlist[j]; + delete [] p->vertexlist; + } + delete [] f->polygonlist; + if (f->holelist != (REAL *) NULL) { + delete [] f->holelist; + } + } + delete [] facetlist; + } + if (facetmarkerlist != (int *) NULL) { + delete [] facetmarkerlist; + } + + if (holelist != (REAL *) NULL) { + delete [] holelist; + } + if (regionlist != (REAL *) NULL) { + delete [] regionlist; + } + if (facetconstraintlist != (REAL *) NULL) { + delete [] facetconstraintlist; + } + if (segmentconstraintlist != (REAL *) NULL) { + delete [] segmentconstraintlist; + } + if (pbcgrouplist != (pbcgroup *) NULL) { + for (i = 0; i < numberofpbcgroups; i++) { + pg = &(pbcgrouplist[i]); + if (pg->pointpairlist != (int *) NULL) { + delete [] pg->pointpairlist; + } + } + delete [] pbcgrouplist; + } + if (vpointlist != (REAL *) NULL) { + delete [] vpointlist; + } + if (vedgelist != (voroedge *) NULL) { + delete [] vedgelist; + } + if (vfacetlist != (vorofacet *) NULL) { + for (i = 0; i < numberofvfacets; i++) { + delete [] vfacetlist[i].elist; + } + delete [] vfacetlist; + } + if (vcelllist != (int **) NULL) { + for (i = 0; i < numberofvcells; i++) { + delete [] vcelllist[i]; + } + delete [] vcelllist; + } + } + + // Constructor & destructor. + tetgenio() {initialize();} + ~tetgenio() {deinitialize();} +}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class tetgenbehavior // +// // +// The object holding a collection of options controlling TetGen's behavior. // +// See "command line switches" in User's manual. // +// // +// parse_commandline() provides an simple interface to set the vaules of the // +// variables. It accepts the standard parameters (e.g., 'argc' and 'argv') // +// that pass to C/C++ main() function. Alternatively a string which contains // +// the command line options can be used as its parameter. // +// // +/////////////////////////////////////////////////////////////////////////////// + +class tetgenbehavior { + + public: + + // Labels define the objects which are acceptable by TetGen. They are + // recognized by the file extensions. + // - NODES, a list of nodes (.node); + // - POLY, a piecewise linear complex (.poly or .smesh); + // - OFF, a polyhedron (.off, Geomview's file format); + // - PLY, a polyhedron (.ply, file format from gatech); + // - STL, a surface mesh (.stl, stereolithography format); + // - MEDIT, a surface mesh (.mesh, Medit's file format); + // - MESH, a tetrahedral mesh (.ele). + // If no extension is available, the imposed commandline switch + // (-p or -r) implies the object. + + enum objecttype {NONE, NODES, POLY, OFF, PLY, STL, MEDIT, VTK, MESH}; + + // Variables of command line switches. Each variable corresponds to a + // switch and will be initialized. + + int plc; // '-p' switch, 0. + int quality; // '-q' switch, 0. + int refine; // '-r' switch, 0. + int coarse; // '-R' switch, 0. + int metric; // '-m' switch, 0. + int varvolume; // '-a' switch without number, 0. + int fixedvolume; // '-a' switch with number, 0. + int insertaddpoints; // '-i' switch, 0. + int regionattrib; // '-A' switch, 0. + int conformdel; // '-D' switch, 0. + int diagnose; // '-d' switch, 0. + int zeroindex; // '-z' switch, 0. + int btree; // -u, 1. + int max_btreenode_size; // number after -u, 100. + int optlevel; // number specified after '-s' switch, 3. + int optpasses; // number specified after '-ss' switch, 3. + int order; // element order, specified after '-o' switch, 1. + int facesout; // '-f' switch, 0. + int edgesout; // '-e' switch, 0. + int neighout; // '-n' switch, 0. + int voroout; // '-v',switch, 0. + int meditview; // '-g' switch, 0. + int gidview; // '-G' switch, 0. + int geomview; // '-O' switch, 0. + int vtkview; // '-K' switch, 0. + int nobound; // '-B' switch, 0. + int nonodewritten; // '-N' switch, 0. + int noelewritten; // '-E' switch, 0. + int nofacewritten; // '-F' switch, 0. + int noiterationnum; // '-I' switch, 0. + int nomerge; // '-M',switch, 0. + int nobisect; // count of how often '-Y' switch is selected, 0. + int noflip; // do not perform flips. '-X' switch. 0. + int nojettison; // do not jettison redundants nodes. '-J' switch. 0. + int steiner; // number after '-S' switch. 0. + int fliprepair; // '-X' switch, 1. + int offcenter; // '-R' switch, 0. + int docheck; // '-C' switch, 0. + int quiet; // '-Q' switch, 0. + int verbose; // count of how often '-V' switch is selected, 0. + int useshelles; // '-p', '-r', '-q', '-d', or '-R' switch, 0. + int maxflipedgelinksize; // The maximum flippable edge link size 10. + REAL minratio; // number after '-q' switch, 2.0. + REAL goodratio; // number calculated from 'minratio', 0.0. + REAL minangle; // minimum angle bound, 20.0. + REAL goodangle; // cosine squared of minangle, 0.0. + REAL maxvolume; // number after '-a' switch, -1.0. + REAL mindihedral; // number after '-qq' switch, 5.0. + REAL maxdihedral; // number after '-qqq' switch, 165.0. + REAL alpha1; // number after '-m' switch, sqrt(2). + REAL alpha2; // number after '-mm' switch, 1.0. + REAL alpha3; // number after '-mmm' switch, 0.6. + REAL epsilon; // number after '-T' switch, 1.0e-8. + REAL epsilon2; // number after '-TT' switch, 1.0e-5. + enum objecttype object; // determined by -p, or -r switch. NONE. + + // Variables used to save command line switches and in/out file names. + char commandline[1024]; + char infilename[1024]; + char outfilename[1024]; + char addinfilename[1024]; + char bgmeshfilename[1024]; + + void syntax(); + void usage(); + + // Command line parse routine. + bool parse_commandline(int argc, char **argv); + bool parse_commandline(char *switches) { + return parse_commandline(0, &switches); + } + + // Initialize all variables. + tetgenbehavior() + { + plc = 0; + quality = 0; + refine = 0; + coarse = 0; + metric = 0; + minratio = 2.0; + goodratio = 0.0; + minangle = 20.0; + goodangle = 0.0; + maxdihedral = 165.0; + mindihedral = 5.0; + varvolume = 0; + fixedvolume = 0; + maxvolume = -1.0; + regionattrib = 0; + insertaddpoints = 0; + diagnose = 0; + offcenter = 0; + conformdel = 0; + alpha1 = sqrt(2.0); + alpha2 = 1.0; + alpha3 = 0.6; + zeroindex = 0; + btree = 1; + max_btreenode_size = 100; + facesout = 0; + edgesout = 0; + neighout = 0; + voroout = 0; + meditview = 0; + gidview = 0; + geomview = 0; + vtkview = 0; + optlevel = 3; + optpasses = 3; + order = 1; + nojettison = 0; + nobound = 0; + nonodewritten = 0; + noelewritten = 0; + nofacewritten = 0; + noiterationnum = 0; + nobisect = 0; + noflip = 0; + steiner = -1; + fliprepair = 1; + nomerge = 0; + docheck = 0; + quiet = 0; + verbose = 0; + useshelles = 0; + maxflipedgelinksize = 10; + epsilon = 1.0e-8; + epsilon2 = 1.0e-5; + object = NONE; + + commandline[0] = '\0'; + infilename[0] = '\0'; + outfilename[0] = '\0'; + addinfilename[0] = '\0'; + bgmeshfilename[0] = '\0'; + } + + ~tetgenbehavior() + { + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class tetgenmesh // +// // +// The object to store, generate, and refine a tetrahedral mesh. // +// // +// It implements the mesh data structures and functions to create and update // +// a tetrahedral mesh according to the specified options. // +// // +/////////////////////////////////////////////////////////////////////////////// + +class tetgenmesh { + + public: + + // Maximum number of characters in a file name (including the null). + enum {FILENAMESIZE = 1024}; + + // For efficiency, a variety of data structures are allocated in bulk. + // The following constants determine how many of each structure is + // allocated at once. + enum {VERPERBLOCK = 4092, SUBPERBLOCK = 4092, ELEPERBLOCK = 8188}; + + // Used for the point location scheme of Mucke, Saias, and Zhu, to + // decide how large a random sample of tetrahedra to inspect. + enum {SAMPLEFACTOR = 11}; + + // Labels that signify two edge rings of a triangle (see Muecke's thesis). + enum {CCW = 0, CW = 1}; + + // Labels that signify whether a record consists primarily of pointers + // or of floating-point words. Used for data alignment. + enum wordtype {POINTER, FLOATINGPOINT}; + + // Labels that signify the type of a vertex. + enum verttype {UNUSEDVERTEX, DUPLICATEDVERTEX, NACUTEVERTEX, ACUTEVERTEX, + FREESEGVERTEX, FREESUBVERTEX, FREEVOLVERTEX, DEADVERTEX = -32768}; + + // Labels that signify the type of a subface/subsegment. + enum shestype {NSHARP, SHARP}; + + // Labels that signify the type of flips can be applied on a face. + enum fliptype {T23, T32, T22, T44, N32, N40, FORBIDDENFACE, FORBIDDENEDGE}; + + // Labels that signify the result of triangle-triangle intersection test. + enum interresult {DISJOINT, INTERSECT, SHAREVERTEX, SHAREEDGE, SHAREFACE, + TOUCHEDGE, TOUCHFACE, INTERVERT, INTEREDGE, INTERFACE, INTERTET, + TRIEDGEINT, EDGETRIINT, COLLISIONFACE, INTERSUBSEG, INTERSUBFACE, + BELOWHULL2}; + + // Labels that signify the result of point location. + enum locateresult {INTETRAHEDRON, ONFACE, ONEDGE, ONVERTEX, OUTSIDE, + ENCSEGMENT}; + + // Labels that signify the result of vertex insertion. + enum insertsiteresult {SUCCESSINTET, SUCCESSONFACE, SUCCESSONEDGE, + DUPLICATEPOINT, OUTSIDEPOINT}; + + // Labels that signify the result of direction finding. + enum finddirectionresult {ACROSSEDGE, ACROSSFACE, LEFTCOLLINEAR, + RIGHTCOLLINEAR, TOPCOLLINEAR, BELOWHULL}; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh elements // +// // +// There are four types of mesh elements: tetrahedra, subfaces, subsegments, // +// and points, where subfaces and subsegments are triangles and edges which // +// appear on boundaries. A tetrahedralization of a 3D point set comprises // +// tetrahedra and points; a surface mesh of a 3D domain comprises subfaces // +// subsegments and points. The elements of all the four types consist of a // +// tetrahedral mesh of a 3D domain. However, TetGen uses three data types: // +// 'tetrahedron', 'shellface', and 'point'. A 'tetrahedron' is a tetrahedron;// +// while a 'shellface' can be either a subface or a subsegment; and a 'point'// +// is a point. These three data types, linked by pointers comprise a mesh. // +// // +// A tetrahedron primarily consists of a list of 4 pointers to its corners, // +// a list of 4 pointers to its adjoining tetrahedra, a list of 4 pointers to // +// its adjoining subfaces (when subfaces are needed). Optinoally, (depending // +// on the selected switches), it may contain an arbitrary number of user- // +// defined floating-point attributes, an optional maximum volume constraint // +// (for -a switch), and a pointer to a list of high-order nodes (-o2 switch).// +// Since the size of a tetrahedron is not determined until running time. // +// // +// The data structure of tetrahedron also stores the geometrical information.// +// Let t be a tetrahedron, v0, v1, v2, and v3 be the 4 nodes corresponding // +// to the order of their storage in t. v3 always has a negative orientation // +// with respect to v0, v1, v2 (ie,, v3 lies above the oriented plane passes // +// through v0, v1, v2). Let the 4 faces of t be f0, f1, f2, and f3. Vertices // +// of each face are stipulated as follows: f0 (v0, v1, v2), f1 (v0, v3, v1), // +// f2 (v1, v3, v2), f3 (v2, v3, v0). // +// // +// A subface has 3 pointers to vertices, 3 pointers to adjoining subfaces, 3 // +// pointers to adjoining subsegments, 2 pointers to adjoining tetrahedra, a // +// boundary marker(an integer). Like a tetrahedron, the pointers to vertices,// +// subfaces, and subsegments are ordered in a way that indicates their geom- // +// etric relation. Let s be a subface, v0, v1 and v2 be the 3 nodes corres- // +// ponding to the order of their storage in s, e0, e1 and e2 be the 3 edges,// +// then we have: e0 (v0, v1), e1 (v1, v2), e2 (v2, v0). // +// // +// A subsegment has exactly the same data fields as a subface has, but only // +// uses some of them. It has 2 pointers to its endpoints, 2 pointers to its // +// adjoining (and collinear) subsegments, a pointer to a subface containing // +// it (there may exist any number of subfaces having it, choose one of them // +// arbitrarily). The geometric relation between its endpoints and adjoining // +// subsegments is kept with respect to the storing order of its endpoints. // +// // +// The data structure of point is relatively simple. A point is a list of // +// floating-point numbers, starting with the x, y, and z coords, followed by // +// an arbitrary number of optional user-defined floating-point attributes, // +// an integer boundary marker, an integer for the point type, and a pointer // +// to a tetrahedron (used for speeding up point location). // +// // +// For a tetrahedron on a boundary (or a hull) of the mesh, some or all of // +// the adjoining tetrahedra may not be present. For an interior tetrahedron, // +// often no neighboring subfaces are present, Such absent tetrahedra and // +// subfaces are never represented by the NULL pointers; they are represented // +// by two special records: `dummytet', the tetrahedron fills "outer space", // +// and `dummysh', the vacuous subfaces which are omnipresent. // +// // +// Tetrahedra and adjoining subfaces are glued together through the pointers // +// saved in each data fields of them. Subfaces and adjoining subsegments are // +// connected in the same fashion. However, there are no pointers directly // +// gluing tetrahedra and adjoining subsegments. For the purpose of saving // +// space, the connections between tetrahedra and subsegments are entirely // +// mediated through subfaces. The following part explains how subfaces are // +// connected in TetGen. // +// // +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// // +// Subface-subface and subface-subsegment connections // +// // +// Adjoining subfaces sharing a common edge are connected in such a way that // +// they form a face ring around the edge. It is indeed a single linked list // +// which is cyclic, e.g., one can start from any subface in it and traverse // +// back. When the edge is not a subsegment, the ring only has two coplanar // +// subfaces which are pointing to each other. Otherwise, the face ring may // +// have any number of subfaces (and are not all coplanar). // +// // +// How is the face ring formed? Let s be a subsegment, f is one of subfaces // +// containing s as an edge. The direction of s is stipulated from its first // +// endpoint to its second (according to their storage in s). Once the dir of // +// s is determined, the other two edges of f are oriented to follow this dir.// +// The "directional normal" N_f is a vector formed from any point in f and a // +// points orthogonally above f. // +// // +// The face ring of s is a cyclic ordered set of subfaces containing s, i.e.,// +// F(s) = {f1, f2, ..., fn}, n >= 1. Where the order is defined as follows: // +// let fi, fj be two faces in F(s), the "normal-angle", NAngle(i,j) (range // +// from 0 to 360 degree) is the angle between the N_fi and N_fj; then fi is // +// in front of fj (or symbolically, fi < fj) if there exists another fk in // +// F(s), and NAangle(k, i) < NAngle(k, j). The face ring of s is: f1 < f2 < // +// ... < fn < f1. // +// // +// The easiest way to imagine how a face ring is formed is to use the right- // +// hand rule. Make a fist using your right hand with the thumb pointing to // +// the direction of the subsegment. The face ring is connected following the // +// direction of your fingers. // +// // +// The subface and subsegment are also connected through pointers stored in // +// their own data fields. Every subface has a pointer to its adjoining sub- // +// segment. However, a subsegment only has one pointer to a subface which is // +// containing it. Such subface can be chosen arbitrarily, other subfaces are // +// found through the face ring. // +// // +/////////////////////////////////////////////////////////////////////////////// + + // The tetrahedron data structure. Fields of a tetrahedron contains: + // - a list of four adjoining tetrahedra; + // - a list of four vertices; + // - a list of four subfaces (optional, used for -p switch); + // - a list of user-defined floating-point attributes (optional); + // - a volume constraint (optional, used for -a switch); + // - an integer of element marker (optional, used for -n switch); + // - a pointer to a list of high-ordered nodes (optional, -o2 switch); + + typedef REAL **tetrahedron; + + // The shellface data structure. Fields of a shellface contains: + // - a list of three adjoining subfaces; + // - a list of three vertices; + // - a list of two adjoining tetrahedra; + // - a list of three adjoining subsegments; + // - a pointer to a badface containing it (used for -q); + // - an area constraint (optional, used for -q); + // - an integer for boundary marker; + // - an integer for type: SHARPSEGMENT, NONSHARPSEGMENT, ...; + // - an integer for pbc group (optional, if in->pbcgrouplist exists); + + typedef REAL **shellface; + + // The point data structure. It is actually an array of REALs: + // - x, y and z coordinates; + // - a list of user-defined point attributes (optional); + // - a list of REALs of a user-defined metric tensor (optional); + // - a pointer to a simplex (tet, tri, edge, or vertex); + // - a pointer to a parent (or duplicate) point; + // - a pointer to a tet in background mesh (optional); + // - a pointer to another pbc point (optional); + // - an integer for boundary marker; + // - an integer for verttype: INPUTVERTEX, FREEVERTEX, ...; + + typedef REAL *point; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh handles // +// // +// Two special data types, 'triface' and 'face' are defined for maintaining // +// and updating meshes. They are like pointers (or handles), which allow you // +// to hold one particular part of the mesh, i.e., a tetrahedron, a triangle, // +// an edge and a vertex. However, these data types do not themselves store // +// any part of the mesh. The mesh is made of the data types defined above. // +// // +// Muecke's "triangle-edge" data structure is the prototype for these data // +// types. It allows a universal representation for every tetrahedron, // +// triangle, edge and vertex. For understanding the following descriptions // +// of these handle data structures, readers are required to read both the // +// introduction and implementation detail of "triangle-edge" data structure // +// in Muecke's thesis. // +// // +// A 'triface' represents a face of a tetrahedron and an oriented edge of // +// the face simultaneously. It has a pointer 'tet' to a tetrahedron, an // +// integer 'loc' (range from 0 to 3) as the face index, and an integer 'ver' // +// (range from 0 to 5) as the edge version. A face of the tetrahedron can be // +// uniquly determined by the pair (tet, loc), and an oriented edge of this // +// face can be uniquly determined by the triple (tet, loc, ver). Therefore, // +// different usages of one triface are possible. If we only use the pair // +// (tet, loc), it refers to a face, and if we add the 'ver' additionally to // +// the pair, it is an oriented edge of this face. // +// // +// A 'face' represents a subface and an oriented edge of it simultaneously. // +// It has a pointer 'sh' to a subface, an integer 'shver'(range from 0 to 5) // +// as the edge version. The pair (sh, shver) determines a unique oriented // +// edge of this subface. A 'face' is also used to represent a subsegment, // +// in this case, 'sh' points to the subsegment, and 'shver' indicates the // +// one of two orientations of this subsegment, hence, it only can be 0 or 1. // +// // +// Mesh navigation and updating are accomplished through a set of mesh // +// manipulation primitives which operate on trifaces and faces. They are // +// introduced below. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class triface { + + public: + + tetrahedron* tet; + int loc, ver; + + // Constructors; + triface() : tet(0), loc(0), ver(0) {} + // Operators; + triface& operator=(const triface& t) { + tet = t.tet; loc = t.loc; ver = t.ver; + return *this; + } + bool operator==(triface& t) { + return tet == t.tet && loc == t.loc && ver == t.ver; + } + bool operator!=(triface& t) { + return tet != t.tet || loc != t.loc || ver != t.ver; + } + }; + + class face { + + public: + + shellface *sh; + int shver; + + // Constructors; + face() : sh(0), shver(0) {} + // Operators; + face& operator=(const face& s) { + sh = s.sh; shver = s.shver; + return *this; + } + bool operator==(face& s) {return (sh == s.sh) && (shver == s.shver);} + bool operator!=(face& s) {return (sh != s.sh) || (shver != s.shver);} + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// The badface structure // +// // +// A multiple usages structure. Despite of its name, a 'badface' can be used // +// to represent the following objects: // +// - a face of a tetrahedron which is (possibly) non-Delaunay; // +// - an encroached subsegment or subface; // +// - a bad-quality tetrahedron, i.e, has too large radius-edge ratio; // +// - a sliver, i.e., has good radius-edge ratio but nearly zero volume; // +// - a degenerate tetrahedron (see routine checkdegetet()). // +// - a recently flipped face (saved for undoing the flip later). // +// // +// It has the following fields: 'tt' holds a tetrahedron; 'ss' holds a sub- // +// segment or subface; 'cent' is the circumcent of 'tt' or 'ss', 'key' is a // +// special value depending on the use, it can be either the square of the // +// radius-edge ratio of 'tt' or the flipped type of 'tt'; 'forg', 'fdest', // +// 'fapex', and 'foppo' are vertices saved for checking the object in 'tt' // +// or 'ss' is still the same when it was stored; 'noppo' is the fifth vertex // +// of a degenerate point set. 'previtem' and 'nextitem' implement a double // +// link for managing many basfaces. // +// // +/////////////////////////////////////////////////////////////////////////////// + + struct badface { + triface tt; + face ss; + REAL key; + REAL cent[3]; + point forg, fdest, fapex, foppo; + point noppo; + struct badface *previtem, *nextitem; + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Elementary flip data structure // +// // +// A data structure to record three types of elementary flips, which are // +// 2-to-3, 3-to-2, and 2-to-2 flips. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class elemflip { + + public: + + enum fliptype ft; // ft \in {T23, T32, T22}. + point pset1[3]; + point pset2[3]; + + elemflip() { + ft = T23; // Default. + pset1[0] = pset1[1] = pset1[2] = (point) NULL; + pset2[0] = pset2[1] = pset2[2] = (point) NULL; + } + + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// The pbcdata structure // +// // +// A pbcdata stores data of a periodic boundary condition defined on a pair // +// of facets or segments. Let f1 and f2 define a pbcgroup. 'fmark' saves the // +// facet markers of f1 and f2; 'ss' contains two subfaces belong to f1 and // +// f2, respectively. Let s1 and s2 define a segment pbcgroup. 'segid' are // +// the segment ids of s1 and s2; 'ss' contains two segments belong to s1 and // +// s2, respectively. 'transmat' are two transformation matrices. transmat[0] // +// transforms a point of f1 (or s1) into a point of f2 (or s2), transmat[1] // +// does the inverse. // +// // +/////////////////////////////////////////////////////////////////////////////// + + struct pbcdata { + int fmark[2]; + int segid[2]; + face ss[2]; + REAL transmat[2][4][4]; + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Fast lookup tables for mesh manipulation primitives. // +// // +// Mesh manipulation primitives (given below) are basic operations on mesh // +// data structures. They answer basic queries on mesh handles, such as "what // +// is the origin (or destination, or apex) of the face?", "what is the next // +// (or previous) edge in the edge ring?", and "what is the next face in the // +// face ring?", and so on. // +// // +// The implementation of teste basic queries can take advangtage of the fact // +// that the mesh data structures additionally store geometric informations. // +// For example, we have ordered the 4 vertices (from 0 to 3) and the 4 faces // +// (from 0 to 3) of a tetrahedron, and for each face of the tetrahedron, a // +// sequence of vertices has stipulated, therefore the origin of any face of // +// the tetrahedron can be quickly determined by a table 'locver2org', which // +// takes the index of the face and the edge version as inputs. A list of // +// fast lookup tables are defined below. They're just like global variables. // +// These tables are initialized at the runtime. // +// // +/////////////////////////////////////////////////////////////////////////////// + + // For enext() primitive, uses 'ver' as the index. + static int ve[6]; + + // For org(), dest() and apex() primitives, uses 'ver' as the index. + static int vo[6], vd[6], va[6]; + + // For org(), dest() and apex() primitives, uses 'loc' as the first + // index and 'ver' as the second index. + static int locver2org[4][6]; + static int locver2dest[4][6]; + static int locver2apex[4][6]; + + // For oppo() primitives, uses 'loc' as the index. + static int loc2oppo[4]; + + // For fnext() primitives, uses 'loc' as the first index and 'ver' as + // the second index, returns an array containing a new 'loc' and a + // new 'ver'. Note: Only valid for 'ver' equals one of {0, 2, 4}. + static int locver2nextf[4][6][2]; + + // The edge number (from 0 to 5) of a tet is defined as follows: + static int locver2edge[4][6]; + static int edge2locver[6][2]; + + // The map from a given face ('loc') to the other three faces in the tet. + // and the map from a given face's edge ('loc', 'ver') to other two + // faces in the tet opposite to this edge. (used in speeding the Bowyer- + // Watson cavity construction). + static int locpivot[4][3]; + static int locverpivot[4][6][2]; + + // For enumerating three edges of a triangle. + static int plus1mod3[3]; + static int minus1mod3[3]; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh manipulation primitives // +// // +// A serial of mesh operations such as topological maintenance, navigation, // +// local modification, etc., is accomplished through a set of mesh manipul- // +// ation primitives. These primitives are indeed very simple functions which // +// take one or two handles ('triface's and 'face's) as parameters, perform // +// basic operations such as "glue two tetrahedra at a face", "return the // +// origin of a tetrahedron", "return the subface adjoining at the face of a // +// tetrahedron", and so on. // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Primitives for tetrahedra. + inline void decode(tetrahedron ptr, triface& t); + inline tetrahedron encode(triface& t); + inline void sym(triface& t1, triface& t2); + inline void symself(triface& t); + inline void bond(triface& t1, triface& t2); + inline void dissolve(triface& t); + inline point org(triface& t); + inline point dest(triface& t); + inline point apex(triface& t); + inline point oppo(triface& t); + inline void setorg(triface& t, point pointptr); + inline void setdest(triface& t, point pointptr); + inline void setapex(triface& t, point pointptr); + inline void setoppo(triface& t, point pointptr); + inline void esym(triface& t1, triface& t2); + inline void esymself(triface& t); + inline void enext(triface& t1, triface& t2); + inline void enextself(triface& t); + inline void enext2(triface& t1, triface& t2); + inline void enext2self(triface& t); + inline bool fnext(triface& t1, triface& t2); + inline bool fnextself(triface& t); + inline void symedge(triface& t1, triface& t2); + inline void symedgeself(triface& t); + inline void tfnext(triface& t1, triface& t2); + inline void tfnextself(triface& t); + inline void enextfnext(triface& t1, triface& t2); + inline void enextfnextself(triface& t); + inline void enext2fnext(triface& t1, triface& t2); + inline void enext2fnextself(triface& t); + inline REAL elemattribute(tetrahedron* ptr, int attnum); + inline void setelemattribute(tetrahedron* ptr, int attnum, REAL value); + inline REAL volumebound(tetrahedron* ptr); + inline void setvolumebound(tetrahedron* ptr, REAL value); + inline int getelemmarker(tetrahedron* ptr); + inline void setelemmarker(tetrahedron* ptr, int value); + inline void infect(triface& t); + inline void uninfect(triface& t); + inline bool infected(triface& t); + inline void marktest(triface& t); + inline void unmarktest(triface& t); + inline bool marktested(triface& t); + inline void markface(triface& t); + inline void unmarkface(triface& t); + inline bool facemarked(triface& t); + inline void markedge(triface& t); + inline void unmarkedge(triface& t); + inline bool edgemarked(triface& t); + + // Primitives for subfaces and subsegments. + inline void sdecode(shellface sptr, face& s); + inline shellface sencode(face& s); + inline void spivot(face& s1, face& s2); + inline void spivotself(face& s); + inline void sbond(face& s1, face& s2); + inline void sbond1(face& s1, face& s2); + inline void sdissolve(face& s); + inline point sorg(face& s); + inline point sdest(face& s); + inline point sapex(face& s); + inline void setsorg(face& s, point pointptr); + inline void setsdest(face& s, point pointptr); + inline void setsapex(face& s, point pointptr); + inline void sesym(face& s1, face& s2); + inline void sesymself(face& s); + inline void senext(face& s1, face& s2); + inline void senextself(face& s); + inline void senext2(face& s1, face& s2); + inline void senext2self(face& s); + inline void sfnext(face&, face&); + inline void sfnextself(face&); + inline badface* shell2badface(face& s); + inline void setshell2badface(face& s, badface* value); + inline REAL areabound(face& s); + inline void setareabound(face& s, REAL value); + inline int shellmark(face& s); + inline void setshellmark(face& s, int value); + inline enum shestype shelltype(face& s); + inline void setshelltype(face& s, enum shestype value); + inline int shellpbcgroup(face& s); + inline void setshellpbcgroup(face& s, int value); + inline void sinfect(face& s); + inline void suninfect(face& s); + inline bool sinfected(face& s); + + // Primitives for interacting tetrahedra and subfaces. + inline void tspivot(triface& t, face& s); + inline void stpivot(face& s, triface& t); + inline void tsbond(triface& t, face& s); + inline void tsdissolve(triface& t); + inline void stdissolve(face& s); + + // Primitives for interacting subfaces and subsegs. + inline void sspivot(face& s, face& edge); + inline void ssbond(face& s, face& edge); + inline void ssdissolve(face& s); + + inline void tsspivot1(triface& t, face& seg); + inline void tssbond1(triface& t, face& seg); + inline void tssdissolve1(triface& t); + + // Primitives for points. + inline int pointmark(point pt); + inline void setpointmark(point pt, int value); + inline enum verttype pointtype(point pt); + inline void setpointtype(point pt, enum verttype value); + inline void pinfect(point pt); + inline void puninfect(point pt); + inline bool pinfected(point pt); + inline tetrahedron point2tet(point pt); + inline void setpoint2tet(point pt, tetrahedron value); + inline shellface point2sh(point pt); + inline void setpoint2sh(point pt, shellface value); + inline shellface point2seg(point pt); + inline void setpoint2seg(point pt, shellface value); + inline point point2ppt(point pt); + inline void setpoint2ppt(point pt, point value); + inline tetrahedron point2bgmtet(point pt); + inline void setpoint2bgmtet(point pt, tetrahedron value); + inline point point2pbcpt(point pt); + inline void setpoint2pbcpt(point pt, point value); + + // Advanced primitives. + inline void adjustedgering(triface& t, int direction); + inline void adjustedgering(face& s, int direction); + inline bool isdead(triface* t); + inline bool isdead(face* s); + inline bool isfacehaspoint(triface* t, point testpoint); + inline bool isfacehaspoint(face* t, point testpoint); + inline bool isfacehasedge(face* s, point tend1, point tend2); + inline bool issymexist(triface* t); + void getnextsface(face*, face*); + void tsspivot(triface*, face*); + void sstpivot(face*, triface*); + void point2tetorg(point, triface&); + void point2shorg(point, face&); + void point2segorg(point, face&); + bool findorg(triface* t, point dorg); + bool findorg(face* s, point dorg); + void findedge(triface* t, point eorg, point edest); + void findedge(face* s, point eorg, point edest); + void getonextseg(face* s, face* lseg); + void getseghasorg(face* sseg, point dorg); + point getsubsegfarorg(face* sseg); + point getsubsegfardest(face* sseg); + void printtet(triface*); + void printsh(face*); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Arraypool // +// // +// Each arraypool contains an array of pointers to a number of blocks. Each // +// block contains the same fixed number of objects. Each index of the array // +// addesses a particular object in the pool. The most significant bits add- // +// ress the index of the block containing the object. The less significant // +// bits address this object within the block. // +// // +// 'objectbytes' is the size of one object in blocks; 'log2objectsperblock' // +// is the base-2 logarithm of 'objectsperblock'; 'objects' counts the number // +// of allocated objects; 'totalmemory' is the totoal memorypool in bytes. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class arraypool { + + public: + + int objectbytes; + int objectsperblock; + int log2objectsperblock; + int toparraylen; + char **toparray; + long objects; + unsigned long totalmemory; + + void restart(); + void poolinit(int sizeofobject, int log2objperblk); + char* getblock(int objectindex); + void* lookup(int objectindex); + int newindex(void **newptr); + + arraypool(int sizeofobject, int log2objperblk); + ~arraypool(); + }; + +// fastlookup() -- A fast, unsafe operation. Return the pointer to the object +// with a given index. Note: The object's block must have been allocated, +// i.e., by the function newindex(). + +#define fastlookup(pool, index) \ + (void *) ((pool)->toparray[(index) >> (pool)->log2objectsperblock] + \ + ((index) & ((pool)->objectsperblock - 1)) * (pool)->objectbytes) + + +// A function: int cmp(const T &, const T &), is said to realize a +// linear order on the type T if there is a linear order <= on T such +// that for all x and y in T satisfy the following relation: +// -1 if x < y. +// comp(x, y) = 0 if x is equivalent to y. +// +1 if x > y. +// A 'compfunc' is a pointer to a linear-order function. + + typedef int (*compfunc) (const void *, const void *); + +/////////////////////////////////////////////////////////////////////////////// +// // +// List // +// // +// An array of items with automatically reallocation of memory. // +// // +// 'base' is the starting address of the array. 'itembytes' is the size of // +// each item in byte. // +// // +// 'items' is the number of items stored in list. 'maxitems' indicates how // +// many items can be stored in this list. 'expandsize' is the increasing // +// size (items) when the list is full. // +// // +// The index of list always starts from zero, i.e., for a list L contains // +// n elements, the first element is L[0], and the last element is L[n-1]. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class list { + + public: + + char *base; + int itembytes; + int items, maxitems, expandsize; + compfunc comp; + + list(int itbytes, compfunc pcomp, int mitems = 256, int exsize = 128) { + listinit(itbytes, pcomp, mitems, exsize); + } + ~list() { free(base); } + + void *operator[](int i) { return (void *) (base + i * itembytes); } + + void listinit(int itbytes, compfunc pcomp, int mitems, int exsize); + void setcomp(compfunc compf) { comp = compf; } + void clear() { items = 0; } + int len() { return items; } + void *append(void* appitem); + void *insert(int pos, void* insitem); + void del(int pos, int order); + int hasitem(void* checkitem); + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Memorypool // +// // +// A type used to allocate memory. // +// // +// firstblock is the first block of items. nowblock is the block from which // +// items are currently being allocated. nextitem points to the next slab // +// of free memory for an item. deaditemstack is the head of a linked list // +// (stack) of deallocated items that can be recycled. unallocateditems is // +// the number of items that remain to be allocated from nowblock. // +// // +// Traversal is the process of walking through the entire list of items, and // +// is separate from allocation. Note that a traversal will visit items on // +// the "deaditemstack" stack as well as live items. pathblock points to // +// the block currently being traversed. pathitem points to the next item // +// to be traversed. pathitemsleft is the number of items that remain to // +// be traversed in pathblock. // +// // +// itemwordtype is set to POINTER or FLOATINGPOINT, and is used to suggest // +// what sort of word the record is primarily made up of. alignbytes // +// determines how new records should be aligned in memory. itembytes and // +// itemwords are the length of a record in bytes (after rounding up) and // +// words. itemsperblock is the number of items allocated at once in a // +// single block. items is the number of currently allocated items. // +// maxitems is the maximum number of items that have been allocated at // +// once; it is the current number of items plus the number of records kept // +// on deaditemstack. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class memorypool { + + public: + + void **firstblock, **nowblock; + void *nextitem; + void *deaditemstack; + void **pathblock; + void *pathitem; + wordtype itemwordtype; + int alignbytes; + int itembytes, itemwords; + int itemsperblock; + long items, maxitems; + int unallocateditems; + int pathitemsleft; + + memorypool(); + memorypool(int, int, enum wordtype, int); + ~memorypool(); + + void poolinit(int, int, enum wordtype, int); + void restart(); + void *alloc(); + void dealloc(void*); + void traversalinit(); + void *traverse(); + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Queue // +// // +// A 'queue' is a FIFO data structure. // +// // +/////////////////////////////////////////////////////////////////////////////// + + class queue : public memorypool { + + public: + + void **head, **tail; + int linkitembytes; + int linkitems; // Not count 'head' and 'tail'. + + queue(int bytecount, int itemcount = 256) { + linkitembytes = bytecount; + poolinit(bytecount + sizeof(void *), itemcount, POINTER, 0); + head = (void **) alloc(); + tail = (void **) alloc(); + *head = (void *) tail; + *tail = NULL; + linkitems = 0; + } + + void clear() { + // Reset the pool. + restart(); + // Initialize all variables. + head = (void **) alloc(); + tail = (void **) alloc(); + *head = (void *) tail; + *tail = NULL; + linkitems = 0; + } + + long len() { return linkitems; } + bool empty() { return linkitems == 0; } + + void *push(void* newitem) { + void **newnode = tail; + if (newitem != (void *) NULL) { + memcpy((void *)(newnode + 1), newitem, linkitembytes); + } + tail = (void **) alloc(); + *tail = NULL; + *newnode = (void *) tail; + linkitems++; + return (void *)(newnode + 1); + } + + void *pop() { + if (linkitems > 0) { + void **deadnode = (void **) *head; + *head = *deadnode; + dealloc((void *) deadnode); + linkitems--; + return (void *)(deadnode + 1); + } else { + return NULL; + } + } + }; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Memory managment routines // +// // +/////////////////////////////////////////////////////////////////////////////// + + void dummyinit(int, int); + void initializepools(); + void tetrahedrondealloc(tetrahedron*); + tetrahedron *tetrahedrontraverse(); + void shellfacedealloc(memorypool*, shellface*); + shellface *shellfacetraverse(memorypool*); + void badfacedealloc(memorypool*, badface*); + badface *badfacetraverse(memorypool*); + void pointdealloc(point); + point pointtraverse(); + void maketetrahedron(triface*); + void makeshellface(memorypool*, face*); + void makepoint(point*); + + void makepoint2tetmap(); + void makepoint2segmap(); + void makeindex2pointmap(point*&); + void makesegmentmap(int*&, shellface**&); + void makesubfacemap(int*&, shellface**&); + void maketetrahedronmap(int*&, tetrahedron**&); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Geometric functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + // PI is the ratio of a circle's circumference to its diameter. + static REAL PI; + + // Triangle-triangle intersection test + enum interresult edge_vert_col_inter(REAL*, REAL*, REAL*); + enum interresult edge_edge_cop_inter(REAL*, REAL*, REAL*, REAL*, REAL*); + enum interresult tri_vert_cop_inter(REAL*, REAL*, REAL*, REAL*, REAL*); + enum interresult tri_edge_cop_inter(REAL*, REAL*, REAL*,REAL*,REAL*,REAL*); + enum interresult tri_edge_inter_tail(REAL*, REAL*, REAL*, REAL*, REAL*, + REAL, REAL); + enum interresult tri_edge_inter(REAL*, REAL*, REAL*, REAL*, REAL*); + enum interresult tri_tri_inter(REAL*, REAL*, REAL*, REAL*, REAL*, REAL*); + int tri_edge_2d(point, point, point, point, point, point, int, int*, int*); + int tri_edge_test(point, point, point, point, point, point, int, int*, int*); + + // Geometric tests + REAL incircle3d(point pa, point pb, point pc, point pd); + REAL insphere_s(REAL*, REAL*, REAL*, REAL*, REAL*); + bool iscollinear(REAL*, REAL*, REAL*, REAL eps); + bool iscoplanar(REAL*, REAL*, REAL*, REAL*, REAL vol6, REAL eps); + bool iscospheric(REAL*, REAL*, REAL*, REAL*, REAL*, REAL vol24, REAL eps); + + // Linear algebra functions + inline REAL dot(REAL* v1, REAL* v2); + inline void cross(REAL* v1, REAL* v2, REAL* n); + bool lu_decmp(REAL lu[4][4], int n, int* ps, REAL* d, int N); + void lu_solve(REAL lu[4][4], int n, int* ps, REAL* b, int N); + + // Geometric calculations + inline REAL distance(REAL* p1, REAL* p2); + REAL shortdistance(REAL* p, REAL* e1, REAL* e2); + REAL shortdistance(REAL* p, REAL* e1, REAL* e2, REAL* e3); + REAL interiorangle(REAL* o, REAL* p1, REAL* p2, REAL* n); + void projpt2edge(REAL* p, REAL* e1, REAL* e2, REAL* prj); + void projpt2face(REAL* p, REAL* f1, REAL* f2, REAL* f3, REAL* prj); + void facenormal(REAL* pa, REAL* pb, REAL* pc, REAL* n, REAL* nlen); + void facenormal2(point pa, point pb, point pc, REAL *n, int pivot); + void edgeorthonormal(REAL* e1, REAL* e2, REAL* op, REAL* n); + REAL facedihedral(REAL* pa, REAL* pb, REAL* pc1, REAL* pc2); + void tetalldihedral(point, point, point, point, REAL*, REAL*, REAL*); + void tetallnormal(point, point, point, point, REAL N[4][3], REAL* volume); + REAL tetaspectratio(point, point, point, point); + bool circumsphere(REAL*, REAL*, REAL*, REAL*, REAL* cent, REAL* radius); + void inscribedsphere(REAL*, REAL*, REAL*, REAL*, REAL* cent, REAL* radius); + void rotatepoint(REAL* p, REAL rotangle, REAL* p1, REAL* p2); + void planelineint(REAL*, REAL*, REAL*, REAL*, REAL*, REAL*, REAL*); + + // Point location routines. + unsigned long randomnation(unsigned int choices); + REAL distance2(tetrahedron* tetptr, point p); + void randomsample(point searchpt, triface *searchtet); + enum locateresult locate(point searchpt, triface* searchtet); + enum locateresult locate2(point searchpt, triface* searchtet, arraypool*); + enum locateresult preciselocate(point searchpt, triface* searchtet, long); + enum locateresult adjustlocate(point, triface*, enum locateresult, REAL); + enum locateresult hullwalk(point searchpt, triface* hulltet); + enum locateresult locatesub(point searchpt, face* searchsh, int, REAL); + enum locateresult adjustlocatesub(point, face*, enum locateresult, REAL); + enum locateresult locateseg(point searchpt, face* searchseg); + enum locateresult adjustlocateseg(point, face*, enum locateresult, REAL); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh update functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void enqueueflipface(triface&, queue*); + void enqueueflipedge(face&, queue*); + void flip23(triface*, queue*); + void flip32(triface*, queue*); + void flip22(triface*, queue*); + void flip22sub(face*, queue*); + long lawson3d(queue* flipqueue); + long lawson(queue* flipqueue); + + bool removetetbypeeloff(triface *striptet, triface*); + bool removefacebyflip23(REAL *key, triface*, triface*, queue*); + bool removeedgebyflip22(REAL *key, int, triface*, queue*); + bool removeedgebyflip32(REAL *key, triface*, triface*, queue*); + bool removeedgebytranNM(REAL*,int,triface*,triface*,point,point,queue*); + bool removeedgebycombNM(REAL*,int,triface*,int*,triface*,triface*,queue*); + + void splittetrahedron(point, triface*, queue*); + void splittetface(point, triface*, queue*); + void splitsubface(point, face*, queue*); + bool splittetedge(point, triface*, queue*); + void splitsubedge(point, face*, queue*); + + void formstarpolyhedron(point pt, list* tetlist, list* verlist, bool); + void formbowatcavitysub(point, face*, list*, list*); + void formbowatcavityquad(point, list*, list*); + void formbowatcavitysegquad(point, list*, list*); + void formbowatcavity(point bp, face* bpseg, face* bpsh, int* n, int* nmax, + list** sublists, list** subceillists, list** tetlists, + list** ceillists); + void releasebowatcavity(face*, int, list**, list**, list**, list**); + bool validatebowatcavityquad(point bp, list* ceillist, REAL maxcosd); + void updatebowatcavityquad(list* tetlist, list* ceillist); + void updatebowatcavitysub(list* sublist, list* subceillist, int* cutcount); + bool trimbowatcavity(point bp, face* bpseg, int n, list** sublists, + list** subceillists, list** tetlists,list** ceillists, + REAL maxcosd); + void bowatinsertsite(point bp, face* splitseg, int n, list** sublists, + list** subceillists, list** tetlists, list** ceillists, + list* verlist, queue* flipque, bool chkencseg, + bool chkencsub, bool chkbadtet); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Delaunay tetrahedralization functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Point sorting routines. + void btree_sort(point*, int, int, REAL, REAL, REAL, REAL, REAL, REAL, int); + void btree_insert(point insertpt); + void btree_search(point searchpt, triface* searchtet); + void ordervertices(point* vertexarray, int arraysize); + + enum locateresult insertvertexbw(point insertpt, triface *searchtet, + bool bwflag, bool visflag, + bool noencsegflag, bool noencsubflag); + bool unifypoint(point testpt, triface*, enum locateresult, REAL); + bool incrflipdelaunay(triface*, point*, long, bool, bool, REAL, queue*); + long delaunizevertices(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Surface triangulation functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + enum locateresult sinsertvertex(point insertpt, face *splitsh,face *splitseg, + bool bwflag, bool cflag); + void formstarpolygon(point pt, list* trilist, list* verlist); + void getfacetabovepoint(face* facetsh); + bool incrflipdelaunaysub(int shmark, REAL eps, list*, int, REAL*, queue*); + enum finddirectionresult finddirectionsub(face* searchsh, point tend); + void insertsubseg(face* tri); + bool scoutsegmentsub(face* searchsh, point tend); + void flipedgerecursive(face* flipedge, queue* flipqueue); + void constrainededge(face* startsh, point tend, queue* flipqueue); + void recoversegment(point tstart, point tend, queue* flipqueue); + void infecthullsub(memorypool* viri); + void plaguesub(memorypool* viri); + void carveholessub(int holes, REAL* holelist, memorypool* viri); + void triangulate(int shmark, REAL eps, list* ptlist, list* conlist,int holes, + REAL* holelist, memorypool* viri, queue*); + void retrievenewsubs(list* newshlist, bool removeseg); + void unifysegments(); + void assignsegmentmarkers(); + void mergefacets(queue* flipqueue); + long meshsurface(); + + // Detect intersecting facets of PLC. + void interecursive(shellface** subfacearray, int arraysize, int axis, + REAL bxmin, REAL bxmax, REAL bymin, REAL bymax, + REAL bzmin, REAL bzmax, int* internum); + void detectinterfaces(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Constrained Delaunay tetrahedralization functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Segment recovery routines. + void markacutevertices(REAL acuteangle); + enum finddirectionresult finddirection(triface* searchtet, point, long); + enum interresult finddirection2(triface* searchtet, point); + enum interresult finddirection3(triface* searchtet, point); + enum interresult scoutsegment2(face*, triface*, point*); + void getsegmentsplitpoint2(face* sseg, point refpt, REAL* vt); + void getsegmentsplitpoint3(face* sseg, point refpt, REAL* vt); + void delaunizesegments2(); + + // Facets recovery routines. + enum interresult scoutsubface(face* ssub, triface* searchtet, int); + enum interresult scoutcrosstet(face* ssub, triface* searchtet, arraypool*); + void recoversubfacebyflips(face* pssub, triface* crossface, arraypool*); + void formcavity(face*, arraypool*, arraypool*, arraypool*, arraypool*, + arraypool*, arraypool*, arraypool*); + bool delaunizecavity(arraypool*, arraypool*, arraypool*, arraypool*, + arraypool*, arraypool*); + bool fillcavity(arraypool*, arraypool*, arraypool*, arraypool*); + void carvecavity(arraypool*, arraypool*, arraypool*); + void restorecavity(arraypool*, arraypool*, arraypool*); + void splitsubedge(point, face*, arraypool*, arraypool*); + void constrainedfacets2(); + + void formskeleton(clock_t&); + + // Carving out holes and concavities routines. + void infecthull(memorypool *viri); + void plague(memorypool *viri); + void regionplague(memorypool *viri, REAL attribute, REAL volume); + void removeholetets(memorypool *viri); + void assignregionattribs(); + void carveholes(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Steiner points removal functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void initializecavity(list* floorlist, list* ceillist, list* frontlist, + list* ptlist, list* gluelist); + bool delaunizecavvertices(triface*, list*, list*, list*, queue*); + void retrievenewtets(list* newtetlist); + void insertauxsubface(triface* front, triface* idfront); + bool scoutfront(triface* front, triface* idfront); + void gluefronts(triface* front, triface* front1, list* gluetetlist, + list* glueshlist); + bool identifyfronts(list* frontlist,list* misfrontlist,list* gluetetlist, + list* glueshlist); + void detachauxsubfaces(list* newtetlist); + bool carvecavity(list* newtetlist, list* outtetlist, list* gluetetlist, + queue* flipque); + + void replacepolygonsubs(list* oldshlist, list* newshlist); + void orientnewsubs(list* newshlist, face* orientsh, REAL* norm); + bool registerelemflip(enum fliptype ft, point pa1, point pb1, point pc1, + point pa2, point pb2, point pc2); + bool check4fixededge(point pa, point pb); + bool removeedgebyflips(triface* remedge, int*); + bool removefacebyflips(triface* remface, int*); + bool recoveredgebyflips(triface* searchtet, point pb, int*); + bool recoverfacebyflips(triface* front, int*); + bool constrainedcavity(triface* oldtet, list* floorlist, list* ceillist, + list* ptlist, list* frontlist, list* misfrontlist, + list* newtetlist, list* gluetetlist, list* glueshlist, + queue* flipque); + bool findrelocatepoint2(point sp, point np, REAL* n, list*, list*); + bool relocatepoint(point steinpt, triface* oldtet, list*, list*, queue*); + bool findcollapseedge(point suppt, point* conpt, list* oldtetlist, list*); + void collapseedge(point suppt, point conpt, list* oldtetlist, list*); + void deallocfaketets(list* frontlist); + void restorepolyhedron(list* oldtetlist); + bool suppressfacetpoint(face* supsh, list* frontlist, list* misfrontlist, + list* ptlist, list* conlist, memorypool* viri, + queue* flipque, bool noreloc, bool optflag); + bool suppresssegpoint(face* supseg, list* spinshlist, list* newsegshlist, + list* frontlist, list* misfrontlist, list* ptlist, + list* conlist, memorypool* viri, queue* flipque, + bool noreloc, bool optflag); + bool suppressvolpoint(triface* suptet, list* frontlist, list* misfrontlist, + list* ptlist, queue* flipque, bool optflag); + void removesteiners2(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh rebuild functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void transfernodes(); + long reconstructmesh(); + void insertconstrainedpoints(tetgenio *addio); + bool p1interpolatebgm(point pt, triface* bgmtet, long *scount); + void interpolatesizemap(); + void duplicatebgmesh(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh refinement functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void marksharpsegments(REAL sharpangle); + void decidefeaturepointsizes(); + void enqueueencsub(face* ss, point encpt, int quenumber, REAL* cent); + badface* dequeueencsub(int* quenumber); + void enqueuebadtet(triface* tt, REAL key, REAL* cent); + badface* topbadtetra(); + void dequeuebadtet(); + bool checkseg4encroach(face* testseg, point testpt, point*, bool enqflag); + bool checksub4encroach(face* testsub, point testpt, bool enqflag); + bool checktet4badqual(triface* testtet, bool enqflag); + bool acceptsegpt(point segpt, point refpt, face* splitseg); + bool acceptfacpt(point facpt, list* subceillist, list* verlist); + bool acceptvolpt(point volpt, list* ceillist, list* verlist); + void getsplitpoint(point e1, point e2, point refpt, point newpt); + void setnewpointsize(point newpt, point e1, point e2); + bool splitencseg(point, face*, list*, list*, list*,queue*,bool,bool,bool); + bool tallencsegs(point testpt, int n, list** ceillists); + bool tallencsubs(point testpt, int n, list** ceillists); + void tallbadtetrahedrons(); + void repairencsegs(bool chkencsub, bool chkbadtet); + void repairencsubs(bool chkbadtet); + void repairbadtets(); + void enforcequality(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh optimization routines // +// // +/////////////////////////////////////////////////////////////////////////////// + + bool checktet4ill(triface* testtet, bool enqflag); + bool checktet4opt(triface* testtet, bool enqflag); + bool removeedge(badface* remedge, bool optflag); + bool smoothpoint(point smthpt, point, point, list*, bool, REAL*); + bool smoothsliver(badface* remedge, list *starlist); + bool splitsliver(badface* remedge, list *tetlist, list *ceillist); + void tallslivers(bool optflag); + void optimizemesh2(bool optflag); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh output functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + void jettisonnodes(); + void highorder(); + void numberedges(); + void outnodes(tetgenio*); + void outmetrics(tetgenio*); + void outelements(tetgenio*); + void outfaces(tetgenio*); + void outhullfaces(tetgenio*); + void outsubfaces(tetgenio*); + void outedges(tetgenio*); + void outsubsegments(tetgenio*); + void outneighbors(tetgenio*); + void outvoronoi(tetgenio*); + void outsmesh(char*); + void outmesh2medit(char*); + void outmesh2gid(char*); + void outmesh2off(char*); + void outmesh2vtk(char*); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Mesh check functions // +// // +/////////////////////////////////////////////////////////////////////////////// + + int checkmesh(); + int checkshells(); + int checksegments(); + int checkdelaunay(REAL, queue*); + void checkconforming(); + void algorithmicstatistics(); + void qualitystatistics(); + void statistics(); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Debug functions // +// // +/////////////////////////////////////////////////////////////////////////////// + /* + void ptet(triface* t); + void psh(face* s); + int pteti(int i, int j, int k, int l); + void pface(int i, int j, int k); + bool pedge(int i, int j); + int psubface(int i, int j, int k); + void psubseg(int i, int j); + int pmark(point p); + void pvert(point p); + int pverti(int i); + REAL test_orient3d(int i, int j, int k, int l); + REAL test_insphere(int i, int j, int k, int l, int m); + REAL test_insphere_s(int i, int j, int k, int l, int m); + void print_tetarray(arraypool* tetarray); + void print_tetlist(list* tetlist); + void print_facearray(arraypool* facearray); + void print_facelist(list* facelist); + void print_subfacearray(arraypool* subfacearray); + void print_subfacelist(list* subfacelist); + void dump_facetof(face* pssub); + void print_fliptetlist(triface *fliptet); + void print_deaditemstack(void* deaditemstack); + int check_deaditemstack(void* deaditemstack, uintptr_t addr); + void print_abtetlist(triface *abtetlist, int len); + int checkpoint2tetmap(); + int checkpoint2submap(); + int checkpoint2segmap(); + */ +/////////////////////////////////////////////////////////////////////////////// +// // +// Class variables // +// // +/////////////////////////////////////////////////////////////////////////////// + + // Pointer to the input data (a set of nodes, a PLC, or a mesh). + tetgenio *in; + + // Pointer to the options (and filenames). + tetgenbehavior *b; + + // Pointer to a background mesh (contains size specification map). + tetgenmesh *bgm; + + // Variables used to allocate and access memory for tetrahedra, subfaces + // subsegments, points, encroached subfaces, encroached subsegments, + // bad-quality tetrahedra, and so on. + memorypool *tetrahedrons; + memorypool *subfaces; + memorypool *subsegs; + memorypool *points; + memorypool *badsubsegs; + memorypool *badsubfaces; + memorypool *badtetrahedrons; + memorypool *tet2segpool, *tet2subpool; + + // Pointer to the 'tetrahedron' that occupies all of "outer space". + tetrahedron *dummytet; + tetrahedron *dummytetbase; // Keep base address so we can free it later. + + // Pointer to the omnipresent subface. Referenced by any tetrahedron, + // or subface that isn't connected to a subface at that location. + shellface *dummysh; + shellface *dummyshbase; // Keep base address so we can free it later. + + // Entry to find the binary tree nodes (-u option). + arraypool *btreenode_list; + // The maximum size of a btree node (number after -u option) is + int max_btreenode_size; // <= b->max_btreenode_size. + // The maximum btree depth (for bookkeeping). + int max_btree_depth; + + // Arrays used by Bowyer-Watson algorithm. + arraypool *cavetetlist, *cavebdrylist, *caveoldtetlist; + arraypool *caveshlist, *caveshbdlist; + // Stacks used by the boundary recovery algorithm. + arraypool *subsegstack, *subfacstack; + + // Two handles used in constrained facet recovery. + triface firsttopface, firstbotface; + + // An array for registering elementary flips. + arraypool *elemfliplist; + + // An array of fixed edges for facet recovering by flips. + arraypool *fixededgelist; + + // A point above the plane in which the facet currently being used lies. + // It is used as a reference point for orient3d(). + point *facetabovepointarray, abovepoint, dummypoint; + + // Array (size = numberoftetrahedra * 6) for storing high-order nodes of + // tetrahedra (only used when -o2 switch is selected). + point *highordertable; + + // Arrays for storing and searching pbc data. 'subpbcgrouptable', (size + // is numberofpbcgroups) for pbcgroup of subfaces. 'segpbcgrouptable', + // a list for pbcgroup of segments. Because a segment can have several + // pbcgroup incident on it, its size is unknown on input, it will be + // found in 'createsegpbcgrouptable()'. + pbcdata *subpbcgrouptable; + list *segpbcgrouptable; + // A map for searching the pbcgroups of a given segment. 'idx2segpglist' + // (size = number of input segments + 1), and 'segpglist'. + int *idx2segpglist, *segpglist; + + // Queues that maintain the bad (badly-shaped or too large) tetrahedra. + // The tails are pointers to the pointers that have to be filled in to + // enqueue an item. The queues are ordered from 63 (highest priority) + // to 0 (lowest priority). + badface *subquefront[3], **subquetail[3]; + badface *tetquefront[64], *tetquetail[64]; + int nextnonemptyq[64]; + int firstnonemptyq, recentq; + + // Pointer to a recently visited tetrahedron. Improves point location + // if proximate points are inserted sequentially. + triface recenttet; + + REAL xmax, xmin, ymax, ymin, zmax, zmin; // Bounding box of points. + REAL longest; // The longest possible edge length. + REAL lengthlimit; // The limiting length of a new edge. + long hullsize; // Number of faces of convex hull. + long insegments; // Number of input segments. + long meshedges; // Number of output mesh edges. + int steinerleft; // Number of Steiner points not yet used. + int sizeoftensor; // Number of REALs per metric tensor. + int pointmtrindex; // Index to find the metric tensor of a point. + int point2simindex; // Index to find a simplex adjacent to a point. + int pointmarkindex; // Index to find boundary marker of a point. + int point2pbcptindex; // Index to find a pbc point to a point. + int highorderindex; // Index to find extra nodes for highorder elements. + int elemattribindex; // Index to find attributes of a tetrahedron. + int volumeboundindex; // Index to find volume bound of a tetrahedron. + int elemmarkerindex; // Index to find marker of a tetrahedron. + int shmarkindex; // Index to find boundary marker of a subface. + int areaboundindex; // Index to find area bound of a subface. + int checksubfaces; // Are there subfaces in the mesh yet? + int checksubsegs; // Are there subsegs in the mesh yet? + int checkpbcs; // Are there periodic boundary conditions? + int varconstraint; // Are there variant (node, seg, facet) constraints? + int nonconvex; // Is current mesh non-convex? + int dupverts; // Are there duplicated vertices? + int unuverts; // Are there unused vertices? + int relverts; // The number of relocated vertices. + int suprelverts; // The number of suppressed relocated vertices. + int collapverts; // The number of collapsed relocated vertices. + int unsupverts; // The number of unsuppressed vertices. + int smoothsegverts; // The number of smoothed vertices. + int jettisoninverts; // The number of jettisoned input vertices. + long samples; // Number of random samples for point location. + unsigned long randomseed; // Current random number seed. + REAL macheps; // The machine epsilon. + REAL cosmaxdihed, cosmindihed; // The cosine values of max/min dihedral. + REAL minfaceang, minfacetdihed; // The minimum input (dihedral) angles. + int maxcavfaces, maxcavverts; // The size of the largest cavity. + bool b_steinerflag; + + // Algorithm statistical counters. + long ptloc_count, ptloc_max_count; + long orient3dcount; + long inspherecount, insphere_sos_count; + long flip14count, flip26count, flipn2ncount; + long flip22count; + long inserthullcount; + long maxbowatcavsize, totalbowatcavsize, totaldeadtets; + long across_face_count, across_edge_count, across_max_count; + long maxcavsize, maxregionsize; + long ndelaunayedgecount, cavityexpcount; + long opt_tet_peels, opt_face_flips, opt_edge_flips; + + long abovecount; // Number of abovepoints calculation. + long bowatvolcount, bowatsubcount, bowatsegcount; // Bowyer-Watsons. + long updvolcount, updsubcount, updsegcount; // Bow-Wat cavities updates. + long failvolcount, failsubcount, failsegcount; // Bow-Wat fails. + long outbowatcircumcount; // Number of circumcenters outside Bowat-cav. + long r1count, r2count, r3count; // Numbers of edge splitting rules. + long cdtenforcesegpts; // Number of CDT enforcement points. + long rejsegpts, rejsubpts, rejtetpts; // Number of rejected points. + long optcount[10]; // Numbers of various optimizing operations. + long flip23s, flip32s, flip22s, flip44s; // Number of flips performed. + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class constructor & destructor // +// // +/////////////////////////////////////////////////////////////////////////////// + + tetgenmesh() + { + bgm = (tetgenmesh *) NULL; + in = (tetgenio *) NULL; + b = (tetgenbehavior *) NULL; + + tetrahedrons = (memorypool *) NULL; + subfaces = (memorypool *) NULL; + subsegs = (memorypool *) NULL; + points = (memorypool *) NULL; + badsubsegs = (memorypool *) NULL; + badsubfaces = (memorypool *) NULL; + badtetrahedrons = (memorypool *) NULL; + tet2segpool = NULL; + tet2subpool = NULL; + + dummytet = (tetrahedron *) NULL; + dummytetbase = (tetrahedron *) NULL; + dummysh = (shellface *) NULL; + dummyshbase = (shellface *) NULL; + + facetabovepointarray = (point *) NULL; + abovepoint = (point) NULL; + dummypoint = NULL; + btreenode_list = (arraypool *) NULL; + highordertable = (point *) NULL; + subpbcgrouptable = (pbcdata *) NULL; + segpbcgrouptable = (list *) NULL; + idx2segpglist = (int *) NULL; + segpglist = (int *) NULL; + + cavetetlist = NULL; + cavebdrylist = NULL; + caveoldtetlist = NULL; + caveshlist = caveshbdlist = NULL; + subsegstack = subfacstack = NULL; + + elemfliplist = (arraypool *) NULL; + fixededgelist = (arraypool *) NULL; + + xmax = xmin = ymax = ymin = zmax = zmin = 0.0; + longest = 0.0; + hullsize = 0l; + insegments = 0l; + meshedges = 0l; + pointmtrindex = 0; + pointmarkindex = 0; + point2simindex = 0; + point2pbcptindex = 0; + highorderindex = 0; + elemattribindex = 0; + volumeboundindex = 0; + shmarkindex = 0; + areaboundindex = 0; + checksubfaces = 0; + checksubsegs = 0; + checkpbcs = 0; + varconstraint = 0; + nonconvex = 0; + dupverts = 0; + unuverts = 0; + relverts = 0; + suprelverts = 0; + collapverts = 0; + unsupverts = 0; + jettisoninverts = 0; + samples = 0l; + randomseed = 1l; + macheps = 0.0; + minfaceang = minfacetdihed = PI; + b_steinerflag = false; + + ptloc_count = ptloc_max_count = 0l; + orient3dcount = 0l; + inspherecount = insphere_sos_count = 0l; + flip14count = flip26count = flipn2ncount = 0l; + flip22count = 0l; + inserthullcount = 0l; + maxbowatcavsize = totalbowatcavsize = totaldeadtets = 0l; + across_face_count = across_edge_count = across_max_count = 0l; + maxcavsize = maxregionsize = 0l; + ndelaunayedgecount = cavityexpcount = 0l; + opt_tet_peels = opt_face_flips = opt_edge_flips = 0l; + + maxcavfaces = maxcavverts = 0; + abovecount = 0l; + bowatvolcount = bowatsubcount = bowatsegcount = 0l; + updvolcount = updsubcount = updsegcount = 0l; + outbowatcircumcount = 0l; + failvolcount = failsubcount = failsegcount = 0l; + r1count = r2count = r3count = 0l; + cdtenforcesegpts = 0l; + rejsegpts = rejsubpts = rejtetpts = 0l; + flip23s = flip32s = flip22s = flip44s = 0l; + } // tetgenmesh() + + ~tetgenmesh() + { + bgm = (tetgenmesh *) NULL; + in = (tetgenio *) NULL; + b = (tetgenbehavior *) NULL; + + if (tetrahedrons != (memorypool *) NULL) { + delete tetrahedrons; + } + if (subfaces != (memorypool *) NULL) { + delete subfaces; + } + if (subsegs != (memorypool *) NULL) { + delete subsegs; + } + if (points != (memorypool *) NULL) { + delete points; + } + if (tet2segpool != NULL) { + delete tet2segpool; + } + if (tet2subpool != NULL) { + delete tet2subpool; + } + if (dummytetbase != (tetrahedron *) NULL) { + delete [] dummytetbase; + } + if (dummyshbase != (shellface *) NULL) { + delete [] dummyshbase; + } + if (facetabovepointarray != (point *) NULL) { + delete [] facetabovepointarray; + } + if (dummypoint != NULL) { + delete [] dummypoint; + } + if (highordertable != (point *) NULL) { + delete [] highordertable; + } + if (subpbcgrouptable != (pbcdata *) NULL) { + delete [] subpbcgrouptable; + } + if (segpbcgrouptable != (list *) NULL) { + delete segpbcgrouptable; + delete [] idx2segpglist; + delete [] segpglist; + } + + if (cavetetlist != NULL) { + delete cavetetlist; + delete cavebdrylist; + delete caveoldtetlist; + } + if (subsegstack != NULL) { + delete subsegstack; + } + if (subfacstack != NULL) { + delete subfacstack; + } + } // ~tetgenmesh() + +}; // End of class tetgenmesh. + +/////////////////////////////////////////////////////////////////////////////// +// // +// tetrahedralize() Interface for using TetGen's library to generate // +// Delaunay tetrahedralizations, constrained Delaunay // +// tetrahedralizations, quality tetrahedral meshes. // +// // +// 'in' is an object of 'tetgenio' which contains a PLC you want to tetrahed-// +// ralize or a previously generated tetrahedral mesh you want to refine. It // +// must not be a NULL. 'out' is another object of 'tetgenio' for storing the // +// generated tetrahedral mesh. It can be a NULL. If so, the output will be // +// saved to file(s). If 'bgmin' != NULL, it contains a background mesh which // +// defines a mesh size distruction function. // +// // +/////////////////////////////////////////////////////////////////////////////// + +void tetrahedralize(tetgenbehavior *b, tetgenio *in, tetgenio *out, + tetgenio *addin = NULL, tetgenio *bgmin = NULL); + +#ifdef TETLIBRARY +void tetrahedralize(char *switches, tetgenio *in, tetgenio *out, + tetgenio *addin = NULL, tetgenio *bgmin = NULL); +#endif // #ifdef TETLIBRARY + +/////////////////////////////////////////////////////////////////////////////// +// // +// terminatetetgen() Terminate TetGen with a given exit code. // +// // +/////////////////////////////////////////////////////////////////////////////// + +inline void terminatetetgen(int x) +{ +#ifdef TETLIBRARY + throw x; +#else + switch (x) { + case 1: // Out of memory. + printf("Error: Out of memory.\n"); + break; + case 2: // Encounter an internal error. + printf(" Please report this bug to sihang@mail.berlios.de. Include\n"); + printf(" the message above, your input data set, and the exact\n"); + printf(" command line you used to run this program, thank you.\n"); + break; + default: + printf("Program stopped.\n"); + } // switch (x) + exit(x); +#endif // #ifdef TETLIBRARY +} + +/////////////////////////////////////////////////////////////////////////////// +// // +// Geometric predicates // +// // +// Return one of the values +1, 0, and -1 on basic geometric questions such // +// as the orientation of point sets, in-circle, and in-sphere tests. They // +// are basic units for implmenting geometric algorithms. TetGen uses two 3D // +// geometric predicates: the orientation and in-sphere tests. // +// // +// Orientation test: let a, b, c be a sequence of 3 non-collinear points in // +// R^3. They defines a unique hypeplane H. Let H+ and H- be the two spaces // +// separated by H, which are defined as follows (using the left-hand rule): // +// make a fist using your left hand in such a way that your fingers follow // +// the order of a, b and c, then your thumb is pointing to H+. Given any // +// point d in R^3, the orientation test returns +1 if d lies in H+, -1 if d // +// lies in H-, or 0 if d lies on H. // +// // +// In-sphere test: let a, b, c, d be 4 non-coplanar points in R^3. They // +// defines a unique circumsphere S. Given any point e in R^3, the in-sphere // +// test returns +1 if e lies inside S, or -1 if e lies outside S, or 0 if e // +// lies on S. // +// // +// The following routines use arbitrary precision floating-point arithmetic. // +// They are provided by J. R. Schewchuk in public domain (http://www.cs.cmu. // +// edu/~quake/robust.html). The source code are in "predicates.cxx". // +// // +/////////////////////////////////////////////////////////////////////////////// + +REAL exactinit(); +REAL orient3d(REAL *pa, REAL *pb, REAL *pc, REAL *pd); +REAL insphere(REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Inline functions of mesh data structures // +// // +/////////////////////////////////////////////////////////////////////////////// + +// Some macros for convenience + +#define Div2 >> 1 +#define Mod2 & 01 + +// NOTE: These bit operators should only be used in macros below. + +// Get orient(Range from 0 to 2) from face version(Range from 0 to 5). + +#define Orient(V) ((V) Div2) + +// Determine edge ring(0 or 1) from face version(Range from 0 to 5). + +#define EdgeRing(V) ((V) Mod2) + +// +// Begin of primitives for tetrahedra +// + +// Each tetrahedron contains four pointers to its neighboring tetrahedra, +// with face indices. To save memory, both information are kept in a +// single pointer. To make this possible, all tetrahedra are aligned to +// eight-byte boundaries, so that the last three bits of each pointer are +// zeros. A face index (in the range 0 to 3) is compressed into the last +// two bits of each pointer by the function 'encode()'. The function +// 'decode()' decodes a pointer, extracting a face index and a pointer to +// the beginning of a tetrahedron. + +inline void tetgenmesh::decode(tetrahedron ptr, triface& t) { + t.loc = (int) ((uintptr_t) (ptr) & (uintptr_t) 3); + t.tet = (tetrahedron *) ((uintptr_t) (ptr) & ~(uintptr_t) 7); +} + +inline tetgenmesh::tetrahedron tetgenmesh::encode(triface& t) { + return (tetrahedron) ((uintptr_t) t.tet | (uintptr_t) t.loc); +} + +// sym() finds the abutting tetrahedron on the same face. + +inline void tetgenmesh::sym(triface& t1, triface& t2) { + tetrahedron ptr = t1.tet[t1.loc]; + decode(ptr, t2); +} + +inline void tetgenmesh::symself(triface& t) { + tetrahedron ptr = t.tet[t.loc]; + decode(ptr, t); +} + +// Bond two tetrahedra together at their faces. + +inline void tetgenmesh::bond(triface& t1, triface& t2) { + t1.tet[t1.loc] = encode(t2); + t2.tet[t2.loc] = encode(t1); +} + +// Dissolve a bond (from one side). Note that the other tetrahedron will +// still think it is connected to this tetrahedron. Usually, however, +// the other tetrahedron is being deleted entirely, or bonded to another +// tetrahedron, so it doesn't matter. + +inline void tetgenmesh::dissolve(triface& t) { + t.tet[t.loc] = (tetrahedron) dummytet; +} + +// These primitives determine or set the origin, destination, apex or +// opposition of a tetrahedron with respect to 'loc' and 'ver'. + +inline tetgenmesh::point tetgenmesh::org(triface& t) { + return (point) t.tet[locver2org[t.loc][t.ver] + 4]; +} + +inline tetgenmesh::point tetgenmesh::dest(triface& t) { + return (point) t.tet[locver2dest[t.loc][t.ver] + 4]; +} + +inline tetgenmesh::point tetgenmesh::apex(triface& t) { + return (point) t.tet[locver2apex[t.loc][t.ver] + 4]; +} + +inline tetgenmesh::point tetgenmesh::oppo(triface& t) { + return (point) t.tet[loc2oppo[t.loc] + 4]; +} + +inline void tetgenmesh::setorg(triface& t, point pointptr) { + t.tet[locver2org[t.loc][t.ver] + 4] = (tetrahedron) pointptr; +} + +inline void tetgenmesh::setdest(triface& t, point pointptr) { + t.tet[locver2dest[t.loc][t.ver] + 4] = (tetrahedron) pointptr; +} + +inline void tetgenmesh::setapex(triface& t, point pointptr) { + t.tet[locver2apex[t.loc][t.ver] + 4] = (tetrahedron) pointptr; +} + +inline void tetgenmesh::setoppo(triface& t, point pointptr) { + t.tet[loc2oppo[t.loc] + 4] = (tetrahedron) pointptr; +} + +// These primitives were drived from Mucke's triangle-edge data structure +// to change face-edge relation in a tetrahedron (esym, enext and enext2) +// or between two tetrahedra (fnext). + +// If e0 = e(i, j), e1 = e(j, i), that is e0 and e1 are the two directions +// of the same undirected edge of a face. e0.sym() = e1 and vice versa. + +inline void tetgenmesh::esym(triface& t1, triface& t2) { + t2.tet = t1.tet; + t2.loc = t1.loc; + t2.ver = t1.ver + (EdgeRing(t1.ver) ? -1 : 1); +} + +inline void tetgenmesh::esymself(triface& t) { + t.ver += (EdgeRing(t.ver) ? -1 : 1); +} + +// If e0 and e1 are both in the same edge ring of a face, e1 = e0.enext(). + +inline void tetgenmesh::enext(triface& t1, triface& t2) { + t2.tet = t1.tet; + t2.loc = t1.loc; + t2.ver = ve[t1.ver]; +} + +inline void tetgenmesh::enextself(triface& t) { + t.ver = ve[t.ver]; +} + +// enext2() is equal to e2 = e0.enext().enext() + +inline void tetgenmesh::enext2(triface& t1, triface& t2) { + t2.tet = t1.tet; + t2.loc = t1.loc; + t2.ver = ve[ve[t1.ver]]; +} + +inline void tetgenmesh::enext2self(triface& t) { + t.ver = ve[ve[t.ver]]; +} + +// If f0 and f1 are both in the same face ring of a face, f1 = f0.fnext(). +// If f1 exists, return true. Otherwise, return false, i.e., f0 is a +// boundary or hull face. + +inline bool tetgenmesh::fnext(triface& t1, triface& t2) +{ + // Get the next face. + t2.loc = locver2nextf[t1.loc][t1.ver][0]; + // Is the next face in the same tet? + if (t2.loc != -1) { + // It's in the same tet. Get the edge version. + t2.ver = locver2nextf[t1.loc][t1.ver][1]; + t2.tet = t1.tet; + } else { + // The next face is in the neigbhour of 't1'. + sym(t1, t2); + if (t2.tet != dummytet) { + // Find the corresponding edge in t2. + point torg; + int tloc, tver, i; + t2.ver = 0; + torg = org(t1); + for (i = 0; (i < 3) && (org(t2) != torg); i++) { + enextself(t2); + } + // Go to the next face in t2. + tloc = t2.loc; + tver = t2.ver; + t2.loc = locver2nextf[tloc][tver][0]; + t2.ver = locver2nextf[tloc][tver][1]; + } + } + return t2.tet != dummytet; +} + +inline bool tetgenmesh::fnextself(triface& t1) +{ + triface t2; + + // Get the next face. + t2.loc = locver2nextf[t1.loc][t1.ver][0]; + // Is the next face in the same tet? + if (t2.loc != -1) { + // It's in the same tet. Get the edge version. + t2.ver = locver2nextf[t1.loc][t1.ver][1]; + t1.loc = t2.loc; + t1.ver = t2.ver; + } else { + // The next face is in the neigbhour of 't1'. + sym(t1, t2); + if (t2.tet != dummytet) { + // Find the corresponding edge in t2. + point torg; + int i; + t2.ver = 0; + torg = org(t1); + for (i = 0; (i < 3) && (org(t2) != torg); i++) { + enextself(t2); + } + t1.loc = locver2nextf[t2.loc][t2.ver][0]; + t1.ver = locver2nextf[t2.loc][t2.ver][1]; + t1.tet = t2.tet; + } + } + return t2.tet != dummytet; +} + +// Given a face t1, find the face f2 in the adjacent tet. If t2 is not +// a dummytet, then t1 and t2 refer to the same edge. Moreover, t2's +// edge must be in 0th edge ring, e.g., t2.ver is one of {0, 2, 4}. +// No matter what edge version t1 is. + +inline void tetgenmesh::symedge(triface& t1, triface& t2) +{ + decode(t1.tet[t1.loc], t2); + if (t2.tet != dummytet) { + // Search the edge of t1 in t2. + point tapex = apex(t1); + if ((point) (t2.tet[locver2apex[t2.loc][0] + 4]) == tapex) { + t2.ver = 0; + } else if ((point) (t2.tet[locver2apex[t2.loc][2] + 4]) == tapex) { + t2.ver = 2; + } else { + assert((point) (t2.tet[locver2apex[t2.loc][4] + 4]) == tapex); + t2.ver = 4; + } + } +} + +inline void tetgenmesh::symedgeself(triface& t) +{ + tetrahedron ptr; + point tapex; + + ptr = t.tet[t.loc]; + tapex = apex(t); + + decode(ptr, t); + if (t.tet != dummytet) { + // Search the edge of t1 in t2. + if ((point) (t.tet[locver2apex[t.loc][0] + 4]) == tapex) { + t.ver = 0; + } else if ((point) (t.tet[locver2apex[t.loc][2] + 4]) == tapex) { + t.ver = 2; + } else { + assert((point) (t.tet[locver2apex[t.loc][4] + 4]) == tapex); + t.ver = 4; + } + } +} + +// Given a face t1, find the next face t2 in the face ring, t1 and t2 +// are in two different tetrahedra. If the next face is a hull face, +// t2 is dummytet. + +inline void tetgenmesh::tfnext(triface& t1, triface& t2) +{ + int *iptr; + + if ((t1.ver & 1) == 0) { + t2.tet = t1.tet; + iptr = locver2nextf[t1.loc][t1.ver]; + t2.loc = iptr[0]; + t2.ver = iptr[1]; + symedgeself(t2); // t2.tet may be dummytet. + } else { + symedge(t1, t2); + if (t2.tet != dummytet) { + iptr = locver2nextf[t2.loc][t2.ver]; + t2.loc = iptr[0]; + t2.ver = iptr[1]; + } + } +} + +inline void tetgenmesh::tfnextself(triface& t) +{ + int *iptr; + + if ((t.ver & 1) == 0) { + iptr = locver2nextf[t.loc][t.ver]; + t.loc = iptr[0]; + t.ver = iptr[1]; + symedgeself(t); // t.tet may be dummytet. + } else { + symedgeself(t); + if (t.tet != dummytet) { + iptr = locver2nextf[t.loc][t.ver]; + t.loc = iptr[0]; + t.ver = iptr[1]; + } + } +} + +// enextfnext() and enext2fnext() are combination primitives of enext(), +// enext2() and fnext(). + +inline void tetgenmesh::enextfnext(triface& t1, triface& t2) { + enext(t1, t2); + fnextself(t2); +} + +inline void tetgenmesh::enextfnextself(triface& t) { + enextself(t); + fnextself(t); +} + +inline void tetgenmesh::enext2fnext(triface& t1, triface& t2) { + enext2(t1, t2); + fnextself(t2); +} + +inline void tetgenmesh::enext2fnextself(triface& t) { + enext2self(t); + fnextself(t); +} + +// Check or set a tetrahedron's attributes. + +inline REAL tetgenmesh::elemattribute(tetrahedron* ptr, int attnum) { + return ((REAL *) (ptr))[elemattribindex + attnum]; +} + +inline void tetgenmesh:: +setelemattribute(tetrahedron* ptr, int attnum, REAL value){ + ((REAL *) (ptr))[elemattribindex + attnum] = value; +} + +// Check or set a tetrahedron's maximum volume bound. + +inline REAL tetgenmesh::volumebound(tetrahedron* ptr) { + return ((REAL *) (ptr))[volumeboundindex]; +} + +inline void tetgenmesh::setvolumebound(tetrahedron* ptr, REAL value) { + ((REAL *) (ptr))[volumeboundindex] = value; +} + +// Check or set a tetrahedron's marker. + +inline int tetgenmesh::getelemmarker(tetrahedron* ptr) { + return ((int *) (ptr))[elemmarkerindex]; +} + +inline void tetgenmesh::setelemmarker(tetrahedron* ptr, int value) { + ((int *) (ptr))[elemmarkerindex] = value; +} + +// infect(), infected(), uninfect() -- primitives to flag or unflag a +// tetrahedron. The last bit of the element marker is flagged (1) +// or unflagged (0). + +inline void tetgenmesh::infect(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= (int) 1; +} + +inline void tetgenmesh::uninfect(triface& t) { + ((int *) (t.tet))[elemmarkerindex] &= ~(int) 1; +} + +// Test a tetrahedron for viral infection. + +inline bool tetgenmesh::infected(triface& t) { + return (((int *) (t.tet))[elemmarkerindex] & (int) 1) != 0; +} + +// marktest(), marktested(), unmarktest() -- primitives to flag or unflag a +// tetrahedron. The last second bit of the element marker is marked (1) +// or unmarked (0). +// One needs them in forming Bowyer-Watson cavity, to mark a tetrahedron if +// it has been checked (for Delaunay case) so later check can be avoided. + +inline void tetgenmesh::marktest(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= (int) 2; +} + +inline void tetgenmesh::unmarktest(triface& t) { + ((int *) (t.tet))[elemmarkerindex] &= ~(int) 2; +} + +inline bool tetgenmesh::marktested(triface& t) { + return (((int *) (t.tet))[elemmarkerindex] & (int) 2) != 0; +} + +// markface(), unmarkface(), facemarked() -- primitives to flag or unflag a +// face of a tetrahedron. From the last 3rd to 6th bits are used for +// face markers, e.g., the last third bit corresponds to loc = 0. +// One use of the face marker is in flip algorithm. Each queued face (check +// for locally Delaunay) is marked. + +inline void tetgenmesh::markface(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= (int) (4<<(t).loc); +} + +inline void tetgenmesh::unmarkface(triface& t) { + ((int *) (t.tet))[elemmarkerindex] &= ~(int) (4<<(t).loc); +} + +inline bool tetgenmesh::facemarked(triface& t) { + return (((int *) (t.tet))[elemmarkerindex] & (int) (4<<(t).loc)) != 0; +} + +// markedge(), unmarkedge(), edgemarked() -- primitives to flag or unflag an +// edge of a tetrahedron. From the last 7th to 12th bits are used for +// edge markers, e.g., the last 7th bit corresponds to the 0th edge, etc. +// Remark: The last 7th bit is marked by 2^6 = 64. + +inline void tetgenmesh::markedge(triface& t) { + ((int *) (t.tet))[elemmarkerindex] |= + (int) (64<> (int) 2; + // return ((int *) (s.sh))[shmarkindex]; +} + +inline void tetgenmesh::setshellmark(face& s, int value) { + ((int *) ((s).sh))[shmarkindex] = (value << (int) 2) + + ((((int *) ((s).sh))[shmarkindex]) & (int) 3); + // ((int *) (s.sh))[shmarkindex] = value; +} + +// These two primitives set or read the type of the subface or subsegment. + +inline enum tetgenmesh::shestype tetgenmesh::shelltype(face& s) { + return (enum shestype) ((int *) (s.sh))[shmarkindex + 1]; +} + +inline void tetgenmesh::setshelltype(face& s, enum shestype value) { + ((int *) (s.sh))[shmarkindex + 1] = (int) value; +} + +// These two primitives set or read the pbc group of the subface. + +inline int tetgenmesh::shellpbcgroup(face& s) { + return ((int *) (s.sh))[shmarkindex + 2]; +} + +inline void tetgenmesh::setshellpbcgroup(face& s, int value) { + ((int *) (s.sh))[shmarkindex + 2] = value; +} + +// sinfect(), sinfected(), suninfect() -- primitives to flag or unflag a +// subface. The last bit of ((int *) ((s).sh))[shmarkindex] is flaged. + +inline void tetgenmesh::sinfect(face& s) { + ((int *) ((s).sh))[shmarkindex] = + (((int *) ((s).sh))[shmarkindex] | (int) 1); + // s.sh[6] = (shellface) ((unsigned long) s.sh[6] | (unsigned long) 4l); +} + +inline void tetgenmesh::suninfect(face& s) { + ((int *) ((s).sh))[shmarkindex] = + (((int *) ((s).sh))[shmarkindex] & ~(int) 1); + // s.sh[6] = (shellface)((unsigned long) s.sh[6] & ~(unsigned long) 4l); +} + +// Test a subface for viral infection. + +inline bool tetgenmesh::sinfected(face& s) { + return (((int *) ((s).sh))[shmarkindex] & (int) 1) != 0; +} + +// smarktest(), smarktested(), sunmarktest() -- primitives to flag or unflag +// a subface. The last 2nd bit of ((int *) ((s).sh))[shmarkindex] is flaged. + +#define smarktest(s) \ + ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] | (int) 2) + +#define sunmarktest(s) \ + ((int *) ((s).sh))[shmarkindex] = (((int *)((s).sh))[shmarkindex] & ~(int) 2) + +#define smarktested(s) ((((int *) ((s).sh))[shmarkindex] & (int) 2) != 0) + +// +// End of primitives for subfaces/subsegments +// + +// +// Begin of primitives for interacting between tetrahedra and subfaces +// + +// tspivot() finds a subface abutting on this tetrahdera. + +inline void tetgenmesh::tspivot(triface& t, face& s) { + if ((t).tet[9] != NULL) { + sdecode(((shellface *) (t).tet[9])[(t).loc], s); + } else { + (s).sh = dummysh; + } + //shellface sptr = (shellface) t.tet[8 + t.loc]; + //sdecode(sptr, s); +} + +// stpivot() finds a tetrahedron abutting a subface. + +inline void tetgenmesh::stpivot(face& s, triface& t) { + tetrahedron ptr = (tetrahedron) s.sh[6 + EdgeRing(s.shver)]; + decode(ptr, t); +} + +// tsbond() bond a tetrahedron to a subface. + +inline void tetgenmesh::tsbond(triface& t, face& s) { + if ((t).tet[9] == NULL) { + // Allocate space for this tet. + (t).tet[9] = (tetrahedron) tet2subpool->alloc(); + // NULL all fields in this space. + for (int i = 0; i < 4; i++) { + ((shellface *) (t).tet[9])[i] = (shellface) dummysh; + } + } + // Bond t <==> s. + ((shellface *) (t).tet[9])[(t).loc] = sencode(s); + //t.tet[8 + t.loc] = (tetrahedron) sencode(s); + s.sh[6 + EdgeRing(s.shver)] = (shellface) encode(t); +} + +// tsdissolve() dissolve a bond (from the tetrahedron side). + +inline void tetgenmesh::tsdissolve(triface& t) { + if ((t).tet[9] != NULL) { + ((shellface *) (t).tet[9])[(t).loc] = (shellface) dummysh; + } + // t.tet[8 + t.loc] = (tetrahedron) dummysh; +} + +// stdissolve() dissolve a bond (from the subface side). + +inline void tetgenmesh::stdissolve(face& s) { + s.sh[6 + EdgeRing(s.shver)] = (shellface) dummytet; +} + +// +// End of primitives for interacting between tetrahedra and subfaces +// + +// +// Begin of primitives for interacting between subfaces and subsegs +// + +// sspivot() finds a subsegment abutting a subface. + +inline void tetgenmesh::sspivot(face& s, face& edge) { + shellface sptr = (shellface) s.sh[8 + Orient(s.shver)]; + sdecode(sptr, edge); +} + +// ssbond() bond a subface to a subsegment. + +inline void tetgenmesh::ssbond(face& s, face& edge) { + s.sh[8 + Orient(s.shver)] = sencode(edge); + edge.sh[0] = sencode(s); +} + +// ssdisolve() dissolve a bond (from the subface side) + +inline void tetgenmesh::ssdissolve(face& s) { + s.sh[8 + Orient(s.shver)] = (shellface) dummysh; +} + +// +// End of primitives for interacting between subfaces and subsegs +// + +// +// Begin of primitives for interacting between tet and subsegs. +// + +inline void tetgenmesh::tsspivot1(triface& t, face& s) +{ + if ((t).tet[8] != NULL) { + sdecode(((shellface *) (t).tet[8])[locver2edge[(t).loc][(t).ver]], s); + } else { + (s).sh = dummysh; + } + // shellface sptr = (shellface) t.tet[8 + locver2edge[t.loc][t.ver]]; + // sdecode(sptr, seg); +} + +// Only bond/dissolve at tet's side, but not vice versa. + +inline void tetgenmesh::tssbond1(triface& t, face& s) +{ + if ((t).tet[8] == NULL) { + // Allocate space for this tet. + (t).tet[8] = (tetrahedron) tet2segpool->alloc(); + // NULL all fields in this space. + for (int i = 0; i < 6; i++) { + ((shellface *) (t).tet[8])[i] = (shellface) dummysh; + } + } + // Bond the segment. + ((shellface *) (t).tet[8])[locver2edge[(t).loc][(t).ver]] = sencode((s)); + // t.tet[8 + locver2edge[t.loc][t.ver]] = (tetrahedron) sencode(seg); +} + +inline void tetgenmesh::tssdissolve1(triface& t) +{ + if ((t).tet[8] != NULL) { + ((shellface *) (t).tet[8])[locver2edge[(t).loc][(t).ver]] + = (shellface) dummysh; + } + // t.tet[8 + locver2edge[t.loc][t.ver]] = (tetrahedron) dummysh; +} + +// +// End of primitives for interacting between tet and subsegs. +// + +// +// Begin of primitives for points +// + +inline int tetgenmesh::pointmark(point pt) { + return ((int *) (pt))[pointmarkindex]; +} + +inline void tetgenmesh::setpointmark(point pt, int value) { + ((int *) (pt))[pointmarkindex] = value; +} + +// These two primitives set and read the type of the point. +// The last significant bit of this integer is used by pinfect/puninfect. + +inline enum tetgenmesh::verttype tetgenmesh::pointtype(point pt) { + return (enum verttype) (((int *) (pt))[pointmarkindex + 1] >> (int) 1); +} + +inline void tetgenmesh::setpointtype(point pt, enum verttype value) { + ((int *) (pt))[pointmarkindex + 1] = + ((int) value << 1) + (((int *) (pt))[pointmarkindex + 1] & (int) 1); +} + +// pinfect(), puninfect(), pinfected() -- primitives to flag or unflag +// a point. The last bit of the integer '[pointindex+1]' is flaged. + +inline void tetgenmesh::pinfect(point pt) { + ((int *) (pt))[pointmarkindex + 1] |= (int) 1; +} + +inline void tetgenmesh::puninfect(point pt) { + ((int *) (pt))[pointmarkindex + 1] &= ~(int) 1; +} + +inline bool tetgenmesh::pinfected(point pt) { + return (((int *) (pt))[pointmarkindex + 1] & (int) 1) != 0; +} + +// These following primitives set and read a pointer to a tetrahedron +// a subface/subsegment, a point, or a tet of background mesh. + +inline tetgenmesh::tetrahedron tetgenmesh::point2tet(point pt) { + return ((tetrahedron *) (pt))[point2simindex]; +} + +inline void tetgenmesh::setpoint2tet(point pt, tetrahedron value) { + ((tetrahedron *) (pt))[point2simindex] = value; +} + +inline tetgenmesh::shellface tetgenmesh::point2sh(point pt) { + return (shellface) ((tetrahedron *) (pt))[point2simindex + 1]; +} + +inline void tetgenmesh::setpoint2sh(point pt, shellface value) { + ((tetrahedron *) (pt))[point2simindex + 1] = (tetrahedron) value; +} + +inline tetgenmesh::shellface tetgenmesh::point2seg(point pt) { + return (shellface) ((tetrahedron *) (pt))[point2simindex + 2]; +} + +inline void tetgenmesh::setpoint2seg(point pt, shellface value) { + ((tetrahedron *) (pt))[point2simindex + 2] = (tetrahedron) value; +} + +inline tetgenmesh::point tetgenmesh::point2ppt(point pt) { + return (point) ((tetrahedron *) (pt))[point2simindex + 3]; +} + +inline void tetgenmesh::setpoint2ppt(point pt, point value) { + ((tetrahedron *) (pt))[point2simindex + 3] = (tetrahedron) value; +} + +inline tetgenmesh::tetrahedron tetgenmesh::point2bgmtet(point pt) { + return ((tetrahedron *) (pt))[point2simindex + 4]; +} + +inline void tetgenmesh::setpoint2bgmtet(point pt, tetrahedron value) { + ((tetrahedron *) (pt))[point2simindex + 4] = value; +} + +// These primitives set and read a pointer to its pbc point. + +inline tetgenmesh::point tetgenmesh::point2pbcpt(point pt) { + return (point) ((tetrahedron *) (pt))[point2pbcptindex]; +} + +inline void tetgenmesh::setpoint2pbcpt(point pt, point value) { + ((tetrahedron *) (pt))[point2pbcptindex] = (tetrahedron) value; +} + +// +// End of primitives for points +// + +// +// Begin of advanced primitives +// + +// adjustedgering() adjusts the edge version so that it belongs to the +// indicated edge ring. The 'direction' only can be 0(CCW) or 1(CW). +// If the edge is not in the wanted edge ring, reverse it. + +inline void tetgenmesh::adjustedgering(triface& t, int direction) { + if (EdgeRing(t.ver) != direction) { + esymself(t); + } +} + +inline void tetgenmesh::adjustedgering(face& s, int direction) { + if (EdgeRing(s.shver) != direction) { + sesymself(s); + } +} + +// isdead() returns TRUE if the tetrahedron or subface has been dealloced. + +inline bool tetgenmesh::isdead(triface* t) { + if (t->tet == (tetrahedron *) NULL) return true; + else return t->tet[4] == (tetrahedron) NULL; +} + +inline bool tetgenmesh::isdead(face* s) { + if (s->sh == (shellface *) NULL) return true; + else return s->sh[3] == (shellface) NULL; +} + +// isfacehaspoint() returns TRUE if the 'testpoint' is one of the vertices +// of the tetface 't' subface 's'. + +inline bool tetgenmesh::isfacehaspoint(triface* t, point testpoint) { + return ((org(*t) == testpoint) || (dest(*t) == testpoint) || + (apex(*t) == testpoint)); +} + +inline bool tetgenmesh::isfacehaspoint(face* s, point testpoint) { + return (s->sh[3] == (shellface) testpoint) || + (s->sh[4] == (shellface) testpoint) || + (s->sh[5] == (shellface) testpoint); +} + +// isfacehasedge() returns TRUE if the edge (given by its two endpoints) is +// one of the three edges of the subface 's'. + +inline bool tetgenmesh::isfacehasedge(face* s, point tend1, point tend2) { + return (isfacehaspoint(s, tend1) && isfacehaspoint(s, tend2)); +} + +// issymexist() returns TRUE if the adjoining tetrahedron is not 'duumytet'. + +inline bool tetgenmesh::issymexist(triface* t) { + tetrahedron *ptr = (tetrahedron *) + ((unsigned long)(t->tet[t->loc]) & ~(unsigned long)7l); + return ptr != dummytet; +} + +// dot() returns the dot product: v1 dot v2. + +inline REAL tetgenmesh::dot(REAL* v1, REAL* v2) +{ + return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; +} + +// cross() computes the cross product: n = v1 cross v2. + +inline void tetgenmesh::cross(REAL* v1, REAL* v2, REAL* n) +{ + n[0] = v1[1] * v2[2] - v2[1] * v1[2]; + n[1] = -(v1[0] * v2[2] - v2[0] * v1[2]); + n[2] = v1[0] * v2[1] - v2[0] * v1[1]; +} + +// distance() computs the Euclidean distance between two points. +inline REAL tetgenmesh::distance(REAL* p1, REAL* p2) +{ + return sqrt((p2[0] - p1[0]) * (p2[0] - p1[0]) + + (p2[1] - p1[1]) * (p2[1] - p1[1]) + + (p2[2] - p1[2]) * (p2[2] - p1[2])); +} + +// Linear algebra operators. + +#define NORM2(x, y, z) ((x) * (x) + (y) * (y) + (z) * (z)) + +#define DIST(p1, p2) \ + sqrt(NORM2((p2)[0] - (p1)[0], (p2)[1] - (p1)[1], (p2)[2] - (p1)[2])) + +#define DOT(v1, v2) \ + ((v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2]) + +#define CROSS(v1, v2, n) \ + (n)[0] = (v1)[1] * (v2)[2] - (v2)[1] * (v1)[2];\ + (n)[1] = -((v1)[0] * (v2)[2] - (v2)[0] * (v1)[2]);\ + (n)[2] = (v1)[0] * (v2)[1] - (v2)[0] * (v1)[1] + +#define SETVECTOR3(V, a0, a1, a2) (V)[0] = (a0); (V)[1] = (a1); (V)[2] = (a2) + +#define SWAP2(a0, a1, tmp) (tmp) = (a0); (a0) = (a1); (a1) = (tmp) + +/////////////////////////////////////////////////////////////////////////////// +// // +// Two inline functions used in read/write VTK files. // +// // +/////////////////////////////////////////////////////////////////////////////// + +inline void swapBytes(unsigned char* var, int size) +{ + int i = 0; + int j = size - 1; + char c; + + while (i < j) { + c = var[i]; var[i] = var[j]; var[j] = c; + i++, j--; + } +} + +inline bool testIsBigEndian() +{ + short word = 0x4321; + if((*(char *)& word) != 0x21) + return true; + else + return false; +} + +#endif // #ifndef tetgenH